├── index.js ├── core └── com │ └── zoho │ └── officeintegrator │ ├── dc │ ├── api_server │ │ ├── import_api_server.js │ │ └── production.js │ ├── import_dc.js │ ├── environment.js │ └── api_server.js │ └── v1 │ ├── response_handler.js │ ├── show_response_handler.js │ ├── sheet_response_handler.js │ ├── writer_response_handler.js │ ├── authentication.js │ ├── token_flow.js │ ├── sheet_response_handler1.js │ ├── merge_fields_response.js │ ├── combine_pd_fs_output_settings.js │ ├── file_body_wrapper.js │ ├── sheet_download_parameters.js │ ├── fillable_link_output_settings.js │ ├── sheet_ui_options.js │ ├── zoho_show_editor_settings.js │ ├── sheet_user_settings.js │ ├── file_delete_success_response.js │ ├── preview_document_info.js │ ├── fillable_link_response.js │ ├── session_delete_success_response.js │ ├── document_delete_success_response.js │ ├── document_session_delete_success_response.js │ ├── user_info.js │ ├── sheet_editor_settings.js │ ├── session_user_info.js │ ├── document_info.js │ ├── sheet_conversion_output_options.js │ ├── mail_merge_webhook_settings.js │ ├── get_merge_fields_parameters.js │ ├── compare_document_response.js │ ├── merge_and_deliver_via_webhook_success_response.js │ ├── combine_pd_fs_parameters.js │ ├── editor_settings.js │ ├── merge_fields.js │ ├── fillable_form_options.js │ ├── convert_presentation_parameters.js │ ├── session_meta.js │ ├── watermark_parameters.js │ ├── sheet_conversion_parameters.js │ ├── margin.js │ ├── fillable_submission_settings.js │ ├── merge_and_deliver_records_meta.js │ ├── ui_options.js │ ├── sheet_preview_parameters.js │ ├── invalid_configuration_exception.js │ ├── presentation_preview_parameters.js │ ├── sheet_callback_settings.js │ ├── preview_parameters.js │ ├── document_conversion_parameters.js │ ├── import_v1.js │ ├── fillable_callback_settings.js │ ├── document_conversion_output_options.js │ ├── preview_response.js │ └── compare_document_parameters.js ├── models └── authenticator │ ├── authentication_schema.js │ ├── parsable_enum.js │ ├── auth.js │ ├── store │ ├── token_store.js │ └── db_builder.js │ ├── token.js │ └── auth_builder.js ├── utils └── util │ ├── choice.js │ ├── xml_converter.js │ ├── utility.js │ ├── text_converter.js │ ├── stream_wrapper.js │ ├── downloader.js │ └── header_param_validator.js ├── routes ├── logger │ ├── log_builder.js │ ├── logger.js │ └── sdk_logger.js ├── user_signature.js ├── header.js ├── param.js ├── proxy_builder.js ├── exception │ └── sdk_exception.js ├── request_proxy.js ├── controllers │ └── api_response.js ├── sdk_config.js ├── sdk_config_builder.js ├── header_map.js └── parameter_map.js ├── .gitignore └── package.json /index.js: -------------------------------------------------------------------------------- 1 | export * from "./OfficeIntegrator.js"; -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/dc/api_server/import_api_server.js: -------------------------------------------------------------------------------- 1 | export { Production } from "./production.js"; 2 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/dc/import_dc.js: -------------------------------------------------------------------------------- 1 | export { APIServer } from "./api_server.js"; 2 | export { Environment } from "./environment.js"; 3 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/response_handler.js: -------------------------------------------------------------------------------- 1 | class ResponseHandler{ 2 | 3 | } 4 | export { 5 | ResponseHandler as MasterModel, 6 | ResponseHandler as ResponseHandler 7 | } 8 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/show_response_handler.js: -------------------------------------------------------------------------------- 1 | class ShowResponseHandler{ 2 | 3 | } 4 | export { 5 | ShowResponseHandler as MasterModel, 6 | ShowResponseHandler as ShowResponseHandler 7 | } 8 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_response_handler.js: -------------------------------------------------------------------------------- 1 | class SheetResponseHandler{ 2 | 3 | } 4 | export { 5 | SheetResponseHandler as MasterModel, 6 | SheetResponseHandler as SheetResponseHandler 7 | } 8 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/writer_response_handler.js: -------------------------------------------------------------------------------- 1 | class WriterResponseHandler{ 2 | 3 | } 4 | export { 5 | WriterResponseHandler as MasterModel, 6 | WriterResponseHandler as WriterResponseHandler 7 | } 8 | -------------------------------------------------------------------------------- /models/authenticator/authentication_schema.js: -------------------------------------------------------------------------------- 1 | class AuthenticationSchema 2 | { 3 | getAuthenticationType() { } 4 | getTokenUrl() { } 5 | getRefreshUrl() { } 6 | getSchema() { } 7 | } 8 | export { 9 | AuthenticationSchema as MasterModel, 10 | AuthenticationSchema as AuthenticationSchema 11 | } -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/dc/environment.js: -------------------------------------------------------------------------------- 1 | 2 | class Environment 3 | { 4 | getUrl() {} 5 | 6 | getDc() {} 7 | 8 | getLocation() {} 9 | 10 | getName() {} 11 | 12 | getValue() {} 13 | } 14 | 15 | 16 | export { 17 | Environment as MasterModel, 18 | Environment as Environment 19 | } -------------------------------------------------------------------------------- /utils/util/choice.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Common Class to provide or obtain a value, when there are multiple supported values. 3 | */ 4 | class Choice { 5 | value; 6 | 7 | constructor(value) { 8 | this.value = value; 9 | } 10 | 11 | getValue() { 12 | return this.value; 13 | } 14 | } 15 | 16 | export { 17 | Choice as MasterModel, 18 | Choice as Choice 19 | } -------------------------------------------------------------------------------- /routes/logger/log_builder.js: -------------------------------------------------------------------------------- 1 | import {Logger} from "./logger.js"; 2 | 3 | class LogBuilder { 4 | _level; 5 | 6 | _filePath; 7 | 8 | level(level) { 9 | this._level = level; 10 | 11 | return this; 12 | } 13 | 14 | filePath(filePath) { 15 | this._filePath = filePath; 16 | 17 | return this; 18 | } 19 | 20 | build() { 21 | return Logger.getInstance(this._level, this._filePath); 22 | } 23 | } 24 | 25 | export {LogBuilder as MasterModel, LogBuilder as LogBuilder} -------------------------------------------------------------------------------- /routes/user_signature.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * This class represents the Zoho User. 4 | */ 5 | class UserSignature { 6 | 7 | _name; 8 | 9 | /** 10 | * Creates an UserSignature class instance with the specified user name. 11 | * @param {string} name - A String containing the Zoho user name. 12 | */ 13 | constructor(name) { 14 | 15 | this._name = name; 16 | } 17 | 18 | /** 19 | * This is a getter method to get user name. 20 | * @returns {string} A String representing the Zoho user name. 21 | */ 22 | getName() { 23 | return this._name; 24 | } 25 | } 26 | 27 | export { 28 | UserSignature as MasterModel, 29 | UserSignature as UserSignature 30 | } -------------------------------------------------------------------------------- /models/authenticator/parsable_enum.js: -------------------------------------------------------------------------------- 1 | class ParsableEnum { 2 | static parse(cl, value) { 3 | if (!cl || typeof cl !== 'function' || !cl.hasOwnProperty('values')) { 4 | throw new Error('Given class is not an enum'); 5 | } 6 | const enumMap = STORE.get(cl); 7 | if (!enumMap) { 8 | throw new Error('Enum class not registered'); 9 | } 10 | const enumValue = enumMap.get(value); 11 | if (!enumValue) { 12 | throw new Error(`Given value '${value}' is not a valid '${cl.name}'`); 13 | } 14 | return enumValue; 15 | } 16 | } 17 | 18 | const STORE = new Map(); 19 | 20 | export { ParsableEnum as MasterModel, ParsableEnum as ParsableEnum, STORE } -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/authentication.js: -------------------------------------------------------------------------------- 1 | import {AuthenticationSchema} from "../../../../../models/authenticator/authentication_schema.js"; 2 | import {AuthenticationType} from "../../../../../models/authenticator/token.js"; 3 | import {TokenFlow} from "./token_flow.js"; 4 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 5 | import {Constants} from "../../../../../utils/util/constants.js"; 6 | 7 | class Authentication{ 8 | /** 9 | * The method to get the tokenFlow 10 | * @returns {TokenFlow} An instance of TokenFlow 11 | */ 12 | async getTokenFlow() { 13 | return new TokenFlow(); 14 | 15 | } 16 | } 17 | export { 18 | Authentication as MasterModel, 19 | Authentication as Authentication 20 | } 21 | -------------------------------------------------------------------------------- /utils/util/xml_converter.js: -------------------------------------------------------------------------------- 1 | import {Converter} from "./converter.js"; 2 | 3 | class XMLConverter extends Converter{ 4 | constructor(commonAPIHandler) { 5 | super(commonAPIHandler); 6 | } 7 | 8 | getWrappedResponse(response, contents) { 9 | return null; 10 | } 11 | 12 | getWrappedRequest(response, pack) 13 | { 14 | return null; 15 | } 16 | 17 | getResponse(response, pack, groupType) { 18 | return null; 19 | } 20 | 21 | appendToRequest(requestBase, requestObject) { 22 | } 23 | 24 | formRequest(requestObject, pack, instanceNumber, memberDetail, groupType) { 25 | return null; 26 | } 27 | 28 | } 29 | export { 30 | XMLConverter as MasterModel, 31 | XMLConverter as XMLConverter 32 | } -------------------------------------------------------------------------------- /utils/util/utility.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../routes/exception/sdk_exception.js"; 2 | 3 | /** 4 | * This class handles module field details. 5 | */ 6 | class Utility { 7 | 8 | static assertNotNull(value, errorCode, errorMessage) { 9 | if (value == null) { 10 | throw new SDKException(errorCode, errorMessage); 11 | } 12 | } 13 | 14 | static async getJSONObject(json, key) { 15 | let keyArray = Array.from(Object.keys(json)); 16 | 17 | for (let keyInJSON of keyArray) { 18 | if (key.toLowerCase() == keyInJSON.toLowerCase()) { 19 | return json[keyInJSON]; 20 | } 21 | } 22 | 23 | return null; 24 | } 25 | 26 | static checkInteger(value) { 27 | return (parseInt(value) === value); 28 | } 29 | } 30 | 31 | export { 32 | Utility as MasterModel, 33 | Utility as Utility 34 | } 35 | -------------------------------------------------------------------------------- /routes/header.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This class represents the HTTP header. 3 | */ 4 | class Header { 5 | 6 | _name; 7 | _className; 8 | 9 | /** 10 | * Creates a Header class instance with the specified header name. 11 | * @param {string} name - A String containing the header name. 12 | * @param {string} className - A String containing the class name. 13 | */ 14 | constructor(name, className = null) { 15 | this._name = name; 16 | this._className = className; 17 | } 18 | 19 | /** 20 | * This is a getter method to get the header name. 21 | * @returns A String representing the header name. 22 | */ 23 | getName() { 24 | return this._name; 25 | } 26 | 27 | /** 28 | * This is a getter method to get the class name. 29 | * @returns A String representing the class name. 30 | */ 31 | getClassName() { 32 | return this._className; 33 | } 34 | } 35 | 36 | export { 37 | Header as MasterModel, 38 | Header as Header 39 | } -------------------------------------------------------------------------------- /routes/param.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This class represents the HTTP parameter. 3 | */ 4 | class Param { 5 | 6 | _name; 7 | 8 | _className; 9 | 10 | /** 11 | * Creates an Param class instance with the specified parameter name. 12 | * @param {string} name - A String containing the parameter name. 13 | * @param {string} className - A String containing the class name. 14 | */ 15 | constructor(name, className = null) { 16 | this._name = name; 17 | this._className = className; 18 | } 19 | 20 | /** 21 | * This is a getter method to get parameter name. 22 | * @returns {string} A String representing the parameter name. 23 | */ 24 | getName() { 25 | return this._name; 26 | } 27 | 28 | /** 29 | * This is a getter method to get class name. 30 | * @returns {string} A String representing the class name. 31 | */ 32 | getClassName() { 33 | return this._className; 34 | } 35 | } 36 | 37 | export { 38 | Param as MasterModel, 39 | Param as Param 40 | } -------------------------------------------------------------------------------- /utils/util/text_converter.js: -------------------------------------------------------------------------------- 1 | import {Converter} from "./converter.js"; 2 | 3 | class TextConverter extends Converter 4 | { 5 | constructor(commonAPIHandler) { 6 | super(commonAPIHandler); 7 | } 8 | 9 | getWrappedRequest(response, pack) { 10 | return null; 11 | } 12 | 13 | formRequest(requestObject, pack, instanceNumber, memberDetail, groupType) { 14 | return null; 15 | } 16 | 17 | appendToRequest(requestBase, requestObject) { 18 | } 19 | 20 | async getWrappedResponse(response, contents) { 21 | let responseEntity = response.body; 22 | if (responseEntity != null) 23 | { 24 | return [await this.getResponse(responseEntity, null, null), null]; 25 | } 26 | return null; 27 | } 28 | 29 | async getResponse(response, pack, groupType) { 30 | return response; 31 | } 32 | } 33 | export { 34 | TextConverter as MasterModel, 35 | TextConverter as TextConverter 36 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.dll 6 | *.exe 7 | *.o 8 | *.so 9 | 10 | # Packages # 11 | ############ 12 | # it's better to unpack these files and commit the raw source 13 | # git has its own built in compression methods 14 | *.7z 15 | *.dmg 16 | *.gz 17 | *.iso 18 | *.jar 19 | *.rar 20 | *.tar 21 | *.zip 22 | 23 | # Logs and databases # 24 | ###################### 25 | *.log 26 | *.sqlite 27 | 28 | # OS generated files # 29 | ###################### 30 | .DS_Store 31 | .DS_Store? 32 | ._* 33 | .Spotlight-V100 34 | .Trashes 35 | ehthumbs.db 36 | Thumbs.db 37 | *.swp 38 | *.swo 39 | *.orig 40 | 41 | # IDE related files # 42 | ###################### 43 | .classpath 44 | .project 45 | .settings 46 | .idea 47 | .metadata 48 | *.iml 49 | *.ipr 50 | /.zide_resources/ 51 | /bin/ 52 | /.antsetup/ 53 | /.zide/ 54 | **/sdk_tokens.txt 55 | **/java-sdk/target 56 | 57 | # Byte-compiled / optimized / DLL files 58 | __pycache__/ 59 | *.py[cod] 60 | *$py.class 61 | **/path/* 62 | **/dist/* -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/dc/api_server.js: -------------------------------------------------------------------------------- 1 | import {Location} from "../../../../../models/authenticator/token.js"; 2 | import {Environment} from "../../../../com/zoho/officeintegrator/dc/environment.js"; 3 | import {Production} from "./api_server/production.js"; 4 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 5 | import {Constants} from "../../../../../utils/util/constants.js"; 6 | 7 | class APIServer{ 8 | /** 9 | * The method to get the production 10 | * @param {String} serverDomain A String representing the serverDomain 11 | * @returns {Production} An instance of Production 12 | */ 13 | async getProduction(serverDomain) { 14 | if((serverDomain != null) && (!(Object.prototype.toString.call(serverDomain) == "[object String]"))) { 15 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: serverDomain EXPECTED TYPE: String", null, null); 16 | } 17 | return new Production(serverDomain); 18 | 19 | } 20 | } 21 | export { 22 | APIServer as MasterModel, 23 | APIServer as APIServer 24 | } 25 | -------------------------------------------------------------------------------- /routes/proxy_builder.js: -------------------------------------------------------------------------------- 1 | import {RequestProxy} from "./request_proxy.js"; 2 | import {Constants} from "../utils/util/constants.js"; 3 | import {Utility} from "../utils/util/utility.js"; 4 | 5 | class ProxyBuilder { 6 | _host; 7 | 8 | _port; 9 | 10 | _user; 11 | 12 | _password = ""; 13 | 14 | host(host) { 15 | Utility.assertNotNull(host, Constants.REQUEST_PROXY_ERROR, Constants.HOST_ERROR_MESSAGE); 16 | 17 | this._host = host; 18 | 19 | return this; 20 | } 21 | 22 | port(port) { 23 | Utility.assertNotNull(port, Constants.REQUEST_PROXY_ERROR, Constants.PORT_ERROR_MESSAGE); 24 | 25 | this._port = port; 26 | 27 | return this; 28 | } 29 | 30 | user(user) { 31 | this._user = user; 32 | 33 | return this; 34 | } 35 | 36 | password(password) { 37 | this._password = password; 38 | 39 | return this; 40 | } 41 | 42 | build() { 43 | Utility.assertNotNull(this._host, Constants.REQUEST_PROXY_ERROR, Constants.HOST_ERROR_MESSAGE); 44 | 45 | Utility.assertNotNull(this._port, Constants.REQUEST_PROXY_ERROR, Constants.PORT_ERROR_MESSAGE); 46 | 47 | return new RequestProxy(this._host, this._port, this._user, this._password); 48 | } 49 | } 50 | 51 | export { 52 | ProxyBuilder as MasterModel, 53 | ProxyBuilder as ProxyBuilder 54 | } -------------------------------------------------------------------------------- /models/authenticator/auth.js: -------------------------------------------------------------------------------- 1 | import {Token} from "./token.js"; 2 | 3 | class Auth extends Token 4 | { 5 | _authenticationSchema; 6 | 7 | _parameterMap = new Map(); 8 | 9 | _headerMap = new Map(); 10 | 11 | getAuthenticationSchema() 12 | { 13 | return this._authenticationSchema; 14 | } 15 | setAuthenticationSchema(authenticationSchema) 16 | { 17 | this._authenticationSchema = authenticationSchema; 18 | } 19 | authenticate(urlConnection, config) { 20 | if(this._headerMap.size > 0) 21 | { 22 | for (const header of this._headerMap.keys()) 23 | { 24 | urlConnection.addHeader(header, this._headerMap.get(header)) 25 | } 26 | } 27 | if (this._parameterMap.size > 0) 28 | { 29 | for (const param of this._parameterMap.keys()) 30 | { 31 | urlConnection.addParam(param, this._parameterMap.get(param)) 32 | } 33 | } 34 | } 35 | remove() {} 36 | generateToken() {} 37 | getId() 38 | { 39 | return null 40 | } 41 | constructor(parameterMap, headerMap, authenticationSchema) { 42 | super(); 43 | this._parameterMap = parameterMap; 44 | this._headerMap = headerMap; 45 | this._authenticationSchema = authenticationSchema; 46 | } 47 | } 48 | export { 49 | Auth as MasterModel, 50 | Auth as Auth 51 | } -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/token_flow.js: -------------------------------------------------------------------------------- 1 | import {AuthenticationSchema} from "../../../../../models/authenticator/authentication_schema.js"; 2 | import {AuthenticationType} from "../../../../../models/authenticator/token.js"; 3 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 4 | import {Constants} from "../../../../../utils/util/constants.js"; 5 | 6 | class TokenFlow extends AuthenticationSchema{ 7 | /** 8 | * The method to get Token Url 9 | * @returns {String} A String representing the TokenUrl 10 | */ 11 | getTokenUrl() { 12 | return "/zest/v1/__internal/ticket"; 13 | 14 | } 15 | 16 | /** 17 | * The method to get Authentication Url 18 | * @returns {String} A String representing the AuthenticationUrl 19 | */ 20 | getAuthenticationUrl() { 21 | return ""; 22 | 23 | } 24 | 25 | /** 26 | * The method to get Refresh Url 27 | * @returns {String} A String representing the RefreshUrl 28 | */ 29 | getRefreshUrl() { 30 | return ""; 31 | 32 | } 33 | 34 | /** 35 | * The method to get Schema 36 | * @returns {String} A String representing the Schema 37 | */ 38 | getSchema() { 39 | return "TokenFlow"; 40 | 41 | } 42 | 43 | /** 44 | * The method to get Authentication Type 45 | * @returns {AuthenticationType} An instance of AuthenticationType 46 | */ 47 | getAuthenticationType() { 48 | return AuthenticationType.TOKEN; 49 | 50 | } 51 | 52 | 53 | } 54 | export { 55 | TokenFlow as MasterModel, 56 | TokenFlow as TokenFlow 57 | } 58 | -------------------------------------------------------------------------------- /routes/logger/logger.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This class represents the Logger level and the file path. 3 | */ 4 | class Logger { 5 | level; 6 | filePath; 7 | 8 | constructor(level, filePath) { 9 | this.level = level; 10 | this.filePath = filePath; 11 | } 12 | 13 | /** 14 | * Creates an Logger class instance with the specified log level and file path. 15 | * @param {Levels} level A Levels class member containing log level. 16 | * @param {String} filePath A string containing absolute file path to write logs. 17 | */ 18 | static getInstance(level, filePath) { 19 | return new Logger(level, filePath) 20 | } 21 | 22 | /** 23 | * The method to get the logger level 24 | * @returns {String} A string representing the Log level. 25 | */ 26 | getLevel() { 27 | return this.level; 28 | } 29 | 30 | /** 31 | * The method to get the logger filepath 32 | * @returns {String} A string representing the Log filepath 33 | */ 34 | getFilePath() { 35 | return this.filePath; 36 | } 37 | } 38 | 39 | /** 40 | * This class represents the possible logger levels 41 | */ 42 | class Levels { 43 | static INFO = 'info'; 44 | static DEBUG = 'debug'; 45 | static WARN = 'warn'; 46 | static VERBOSE = 'verbose'; 47 | static ERROR = 'error'; 48 | static SILLY = 'silly'; 49 | static OFF = 'off'; // No I18N 50 | } 51 | 52 | export { 53 | Logger as Logger, 54 | Levels as Levels 55 | } 56 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@zoho-corp/office-integrator-sdk", 3 | "title": "Zoho Office Integrator NodeJS SDK", 4 | "description": "NodeJS SDK to integrate zoho office suite editors in to web application.", 5 | "version": "1.0.0", 6 | "homepage": "https://www.zoho.com/officeplatform/integrator", 7 | "author": { 8 | "name": "Team - Zoho Office Integrator", 9 | "email": "support@zohoofficeintegrator.com" 10 | }, 11 | "main": "index.js", 12 | "type": "module", 13 | "maintainers": [ 14 | { 15 | "name": "Support - Zoho Office Integrator", 16 | "email": "support@zohoofficeintegrator.com", 17 | "url": "https://www.zoho.com/officeplatform/integrator/contact-support.html" 18 | } 19 | ], 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/zoho/office-integrator-nodejs-sdk.git" 23 | }, 24 | "bugs": { 25 | "url": "https://github.com/zoho/office-integrator-nodejs-sdk/issues" 26 | }, 27 | "license": "Apache-2.0", 28 | "dependencies": { 29 | "form-data": "^3.0.0", 30 | "got": "^11.2.0", 31 | "mysql2": "^3.9.1", 32 | "tunnel": "0.0.6", 33 | "winston": "^3.2.1", 34 | "date": "^1.0.2", 35 | "string-format": "^2.0.0", 36 | "moment-timezone": "0.5.43", 37 | "utils": "^0.3.1" 38 | }, 39 | "keywords": [ 40 | "zoho", "office integrator", "office suite editors", "zoho writer", "zoho sheet", "zoho show" 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /routes/exception/sdk_exception.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This class is the common SDKException object. 3 | */ 4 | class SDKException extends Error { 5 | /** 6 | * 7 | * @param {string} code - A String containing the Exception error code. 8 | * @param {string} message - A String containing the Exception error message. 9 | * @param {object} details - A key/value pair object containing the error response. 10 | * @param {Error} cause - A Error class instance. 11 | */ 12 | constructor(code, message, details = null, cause = null) { 13 | super(); 14 | 15 | this.code = code; 16 | 17 | this.message = (message === null) ? "" : message; 18 | 19 | this.cause = cause; 20 | 21 | this.details = details; 22 | 23 | if (this.details != null) { 24 | this.message = this.message + JSON.stringify(this.details); 25 | } 26 | 27 | if (this.cause != null) { 28 | this.message = this.message.concat(this.cause.toString()); 29 | } 30 | } 31 | 32 | toString() { 33 | let returnMessage = "Caused By : "; 34 | 35 | if (this.details != null) { 36 | this.message = (this.message != null ? this.message : "") + JSON.stringify(this.details); 37 | } 38 | 39 | if (this.code != null) { 40 | returnMessage += this.code + " - " + this.message; 41 | } 42 | else { 43 | returnMessage += this.message; 44 | } 45 | 46 | return returnMessage; 47 | } 48 | } 49 | 50 | export {SDKException as MasterModel, SDKException as SDKException} -------------------------------------------------------------------------------- /routes/logger/sdk_logger.js: -------------------------------------------------------------------------------- 1 | import pkg from "winston"; 2 | import {Levels} from "./logger.js"; 3 | 4 | /** 5 | * The class to initialize the SDK logger. 6 | */ 7 | class SDKLogger { 8 | 9 | constructor(loggerInstance) { 10 | let winston = pkg; 11 | if (loggerInstance.getLevel() === Levels.OFF || loggerInstance.getFilePath() == null || loggerInstance.getFilePath === "") 12 | { 13 | winston.configure({ 14 | silent : true, 15 | 16 | transports: [ 17 | new winston.transports.Console({ 18 | silent: true 19 | }) 20 | ] 21 | }); 22 | } 23 | else { 24 | winston.configure({ 25 | 26 | level: loggerInstance.level, 27 | 28 | format: winston.format.combine( 29 | winston.format.timestamp({format: 'YYYY-MM-DD HH:mm:ss'}), 30 | winston.format.prettyPrint() 31 | ), 32 | transports: [ 33 | new winston.transports.File({ 34 | filename: loggerInstance.getFilePath() 35 | }) 36 | ] 37 | }); 38 | } 39 | } 40 | /** 41 | * The method to initialize SDKLogger 42 | * @param {Logger} loggerInstance A Logger class instance 43 | */ 44 | static initialize(loggerInstance) { 45 | return new SDKLogger(loggerInstance); 46 | } 47 | } 48 | 49 | 50 | export { 51 | SDKLogger as SDKLogger, 52 | SDKLogger as MasterModel 53 | } -------------------------------------------------------------------------------- /routes/request_proxy.js: -------------------------------------------------------------------------------- 1 | class RequestProxy { 2 | _host; 3 | 4 | _port; 5 | 6 | _user; 7 | 8 | _password; 9 | 10 | /** 11 | * Creates a RequestProxy class instance with the specified parameters. 12 | * @param {String} host A String containing the hostname or address of the proxy server 13 | * @param {Number} port An Integer containing The port number of the proxy server 14 | * @param {String} user A String containing the user name of the proxy server 15 | * @param {String} password A String containing the password of the proxy server 16 | */ 17 | constructor(host, port, user = null, password = null) { 18 | 19 | this._host = host; 20 | 21 | this._port = port; 22 | 23 | this._user = user; 24 | 25 | this._password = password; 26 | } 27 | 28 | /** 29 | * This is a getter method to get Proxy host. 30 | * @returns {String} 31 | */ 32 | getHost() { 33 | return this._host; 34 | } 35 | 36 | /** 37 | * This is a getter method to get the Proxy port. 38 | * @returns {Number} 39 | */ 40 | getPort() { 41 | return this._port; 42 | } 43 | 44 | /** 45 | * This is a getter method to get the Proxy user name. 46 | * @returns {String} 47 | */ 48 | getUser() { 49 | return this._user; 50 | } 51 | 52 | /** 53 | * This is a getter method to get the Proxy password. 54 | * @returns {String} 55 | */ 56 | getPassword() { 57 | return this._password; 58 | } 59 | } 60 | 61 | export { 62 | RequestProxy as MasterModel, 63 | RequestProxy as RequestProxy 64 | } -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_response_handler1.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SheetResponseHandler1{ 5 | 6 | keyModified = new Map(); 7 | /** 8 | * The method to check if the user has modified the given key 9 | * @param {String} key A String representing the key 10 | * @returns {number} A number representing the modification 11 | */ 12 | isKeyModified(key) { 13 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 14 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 15 | } 16 | if(this.keyModified.has(key)) { 17 | return this.keyModified.get(key); 18 | } 19 | return null; 20 | 21 | } 22 | 23 | /** 24 | * The method to mark the given key as modified 25 | * @param {String} key A String representing the key 26 | * @param {number} modification A number representing the modification 27 | */ 28 | setKeyModified(key, modification) { 29 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 30 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 31 | } 32 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 33 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 34 | } 35 | this.keyModified.set(key, modification); 36 | 37 | } 38 | 39 | 40 | } 41 | export { 42 | SheetResponseHandler1 as MasterModel, 43 | SheetResponseHandler1 as SheetResponseHandler1 44 | } 45 | -------------------------------------------------------------------------------- /models/authenticator/store/token_store.js: -------------------------------------------------------------------------------- 1 | import {Token} from "../token.js"; 2 | import {SDKException} from "../../../routes/exception/sdk_exception.js"; 3 | 4 | /** 5 | * This class stores the user token details. 6 | */ 7 | class TokenStore { 8 | 9 | /** 10 | This method is used to get user token details. 11 | * @param {Token} token - A Token class instance. 12 | * @returns {Token} A Token class instance representing the user token details. 13 | * @throws {SDKException} 14 | */ 15 | findToken(token) { } 16 | 17 | /** 18 | * This method is used to retrieve the user token details based on unique ID 19 | * @param {String} id - A String representing the unique ID 20 | * @return {Token} A Token class instance representing the user token details. 21 | * @throws SDKException 22 | */ 23 | findTokenById(id) { } 24 | 25 | /** 26 | * This method is used to store user token details. 27 | * @param {Token} token - A Token class instance. 28 | * @throws {SDKException} 29 | */ 30 | saveToken(token) { } 31 | 32 | /** 33 | This method is used to delete user token details. 34 | * @param {String} id - A String representing the unique ID 35 | * @throws {SDKException} 36 | */ 37 | deleteToken(id) { } 38 | 39 | /** 40 | * The method to retrieve all the stored tokens. 41 | * @returns {Array} - An array of Token class instances 42 | * @throws {SDKException} 43 | */ 44 | getTokens() { } 45 | 46 | /** 47 | * The method to delete all the stored tokens. 48 | * @throws {SDKException} 49 | */ 50 | deleteTokens() { } 51 | } 52 | 53 | export {TokenStore as MasterModel, TokenStore as TokenStore} -------------------------------------------------------------------------------- /models/authenticator/store/db_builder.js: -------------------------------------------------------------------------------- 1 | import {DBStore} from "./db_store.js"; 2 | import {Constants} from "../../../utils/util/constants.js"; 3 | 4 | class DBBuilder { 5 | _userName = Constants.MYSQL_USER_NAME; 6 | 7 | _portNumber = Constants.MYSQL_PORT_NUMBER; 8 | 9 | _password = ""; 10 | 11 | _host = Constants.MYSQL_HOST; 12 | 13 | _databaseName = Constants.MYSQL_DATABASE_NAME; 14 | 15 | _tableName = Constants.MYSQL_TABLE_NAME; 16 | 17 | userName(userName) { 18 | if (userName != null) { 19 | this._userName = userName; 20 | } 21 | 22 | return this; 23 | } 24 | 25 | portNumber(portNumber) { 26 | if (portNumber != null) { 27 | this._portNumber = portNumber; 28 | } 29 | 30 | return this; 31 | } 32 | 33 | password(password) { 34 | if (password != null) { 35 | this._password = password; 36 | } 37 | 38 | return this; 39 | } 40 | 41 | host(host) { 42 | if (host != null) { 43 | this._host = host; 44 | } 45 | 46 | return this; 47 | } 48 | 49 | databaseName(databaseName) { 50 | if (databaseName != null) { 51 | this._databaseName = databaseName; 52 | } 53 | 54 | return this; 55 | } 56 | 57 | tableName(tableName) { 58 | if (tableName != null) { 59 | this._tableName = tableName; 60 | } 61 | 62 | return this; 63 | } 64 | 65 | build() { 66 | return new DBStore(this._host, this._databaseName, this._tableName, this._userName, this._password, this._portNumber); 67 | } 68 | } 69 | 70 | export { 71 | DBBuilder as MasterModel, 72 | DBBuilder as DBBuilder 73 | } -------------------------------------------------------------------------------- /utils/util/stream_wrapper.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "./constants.js"; 3 | import * as fs from "fs"; 4 | import * as path from "path"; 5 | 6 | /** 7 | * This class handles the file stream and name. 8 | */ 9 | class StreamWrapper { 10 | 11 | name; 12 | 13 | stream; 14 | 15 | file; 16 | 17 | /** 18 | * Creates a StreamWrapper class instance with the specified parameters. 19 | * @param {string} name - A String containing the file name. 20 | * @param {object} stream - A InputStream containing the file stream. 21 | * @param {string} filePath - A String containing the absolute file path. 22 | */ 23 | constructor(name = null, stream = null, filePath = null) { 24 | if (filePath == null) { 25 | this.name = name; 26 | 27 | this.stream = stream; 28 | } 29 | else { 30 | if (!fs.existsSync(filePath)) { 31 | throw new SDKException(Constants.FILE_ERROR, Constants.FILE_DOES_NOT_EXISTS); 32 | } 33 | 34 | this.file = filePath; 35 | 36 | this.name = path.basename(filePath); 37 | 38 | this.stream = fs.createReadStream(filePath); 39 | } 40 | } 41 | 42 | /** 43 | * This is a getter method to get the file name. 44 | * @returns A String representing the file name. 45 | */ 46 | getName() { 47 | return this.name; 48 | } 49 | 50 | /** 51 | * This is a getter method to get the file input stream. 52 | * @returns A ReadStream representing the file input stream. 53 | */ 54 | getStream() { 55 | return this.stream; 56 | } 57 | } 58 | 59 | export { 60 | StreamWrapper as MasterModel, 61 | StreamWrapper as StreamWrapper 62 | } 63 | -------------------------------------------------------------------------------- /routes/controllers/api_response.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This class is the common API response object. 3 | */ 4 | class APIResponse { 5 | 6 | statusCode; 7 | 8 | object; 9 | 10 | headers; 11 | 12 | responseJSON 13 | 14 | /** 15 | * Creates an APIResponse class instance with the specified parameters. 16 | * @param {Map} headers The map containing the API Response headers 17 | * @param {number} statusCode The integer containing the API response HTTP status code. 18 | * @param {Object} object The object containing the API response class instance. 19 | * @param responseJSON contains API response 20 | */ 21 | constructor(headers, statusCode, object, responseJSON) { 22 | 23 | this.headers = headers; 24 | 25 | this.statusCode = statusCode; 26 | 27 | this.object = object; 28 | 29 | this.responseJSON = responseJSON 30 | } 31 | 32 | /** 33 | * The method to get the API Response headers 34 | * @returns {Map} The map containing the API Response headers 35 | */ 36 | getHeaders() { 37 | 38 | return this.headers; 39 | } 40 | 41 | /** 42 | * The method to get the API response HTTP status code. 43 | * @returns {number} The integer containing the API response HTTP status code. 44 | */ 45 | getStatusCode() { 46 | 47 | return this.statusCode; 48 | } 49 | 50 | /** 51 | * The method to get the API response class instance. 52 | * @returns {Object} The object containing the API response class instance. 53 | */ 54 | getObject() { 55 | 56 | return this.object; 57 | } 58 | 59 | getResponseJSON() 60 | { 61 | return this.responseJSON; 62 | } 63 | } 64 | 65 | export { 66 | APIResponse as MasterModel, 67 | APIResponse as APIResponse 68 | } 69 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/dc/api_server/production.js: -------------------------------------------------------------------------------- 1 | import {Location} from "../../../../../../models/authenticator/token.js"; 2 | import {Environment} from "../../../../../com/zoho/officeintegrator/dc/environment.js"; 3 | import {SDKException} from "../../../../../../routes/exception/sdk_exception.js"; 4 | import {Constants} from "../../../../../../utils/util/constants.js"; 5 | 6 | class Production extends Environment{ 7 | 8 | serverDomain; 9 | /** 10 | * Creates an instance of Production with the given parameters 11 | * @param {String} serverDomain A String representing the serverDomain 12 | */ 13 | constructor(serverDomain){ 14 | super(); 15 | if((serverDomain != null) && (!(Object.prototype.toString.call(serverDomain) == "[object String]"))) { 16 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: serverDomain EXPECTED TYPE: String", null, null); 17 | } 18 | this.serverDomain = serverDomain; 19 | 20 | } 21 | 22 | /** 23 | * The method to get Url 24 | * @returns {String} A String representing the Url 25 | */ 26 | getUrl() { 27 | return "" + this.serverDomain + ""; 28 | 29 | } 30 | 31 | /** 32 | * The method to get dc 33 | * @returns {String} A String representing the dc 34 | */ 35 | getDc() { 36 | return "alldc"; 37 | 38 | } 39 | 40 | /** 41 | * The method to get location 42 | * @returns {Location} An instance of Location 43 | */ 44 | getLocation() { 45 | return null; 46 | 47 | } 48 | 49 | /** 50 | * The method to get name 51 | * @returns {String} A String representing the name 52 | */ 53 | getName() { 54 | return ""; 55 | 56 | } 57 | 58 | /** 59 | * The method to get value 60 | * @returns {String} A String representing the value 61 | */ 62 | getValue() { 63 | return ""; 64 | 65 | } 66 | 67 | 68 | } 69 | export { 70 | Production as MasterModel, 71 | Production as Production 72 | } 73 | -------------------------------------------------------------------------------- /models/authenticator/token.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This class verifies and sets token to APIHTTPConnector instance. 3 | */ 4 | class Token { 5 | 6 | /** 7 | * This method is to set authentication token to APIHTTPConnector instance. 8 | * @param {APIHTTPConnector} urlConnection - A APIHTTPConnector class instance. 9 | * @param {Object} config 10 | * @throws {SDKException} 11 | */ 12 | authenticate(urlConnection, config) { } 13 | 14 | remove() { } 15 | 16 | generateToken() { } 17 | 18 | getId() { } 19 | 20 | getAuthenticationSchema() { } 21 | 22 | } 23 | import { ParsableEnum, STORE } from './parsable_enum.js'; 24 | class Location extends ParsableEnum { 25 | constructor(name) { 26 | super(); 27 | this.name = name; 28 | } 29 | static parse(location) 30 | { 31 | return super.parse(Location, location); 32 | } 33 | 34 | toString() { 35 | return this.name; 36 | } 37 | } 38 | 39 | Location.values =[ 40 | Location.HEADER = new Location('HEADER'), 41 | Location.PARAM = new Location('PARAM'), 42 | Location.VARIABLE = new Location('VARIABLE') 43 | ]; 44 | 45 | STORE.set(Location, new Map(Location.values.map(value => [value.name, value]))); 46 | 47 | class AuthenticationType extends ParsableEnum { 48 | constructor(name) { 49 | super(); 50 | this.name = name; 51 | } 52 | 53 | static parse(type) 54 | { 55 | return super.parse(AuthenticationType, type); 56 | } 57 | toString() { 58 | return this.name; 59 | } 60 | } 61 | 62 | AuthenticationType.values = [ 63 | AuthenticationType.OAUTH2 = new AuthenticationType('OAUTH2'), 64 | AuthenticationType.TOKEN = new AuthenticationType('TOKEN') 65 | ]; 66 | 67 | STORE.set(AuthenticationType, new Map(AuthenticationType.values.map(value => [value.name, value]))); 68 | 69 | 70 | export { 71 | Token as MasterModel, 72 | Token as Token, 73 | Location as Location, 74 | AuthenticationType as AuthenticationType 75 | } 76 | -------------------------------------------------------------------------------- /models/authenticator/auth_builder.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../utils/util/constants.js"; 3 | import {Auth} from "./auth.js"; 4 | 5 | class AuthBuilder 6 | { 7 | _authenticationSchema; 8 | _parameterMap = new Map(); 9 | _headerMap = new Map(); 10 | addParam(paramName, paramValue) 11 | { 12 | if (this._parameterMap.has(paramName) && this._parameterMap.get(paramName).length > 0) 13 | { 14 | let existingParamValue = this._parameterMap.get(paramName); 15 | existingParamValue = existingParamValue + "," + paramValue; 16 | this._parameterMap.set(paramName, existingParamValue); 17 | } 18 | else 19 | { 20 | this._parameterMap.set(paramName, paramValue); 21 | } 22 | return this; 23 | } 24 | 25 | addHeader(headerName, headerValue) 26 | { 27 | if (this._headerMap.has(headerName) && this._headerMap.get(headerName).length > 0) 28 | { 29 | let existingHeaderValue = this._headerMap.get(headerName); 30 | existingHeaderValue = existingHeaderValue + "," + headerValue; 31 | this._headerMap.set(headerName, existingHeaderValue); 32 | } 33 | else 34 | { 35 | this._headerMap.set(headerName, headerValue); 36 | } 37 | return this; 38 | } 39 | 40 | parameterMap(parameterMap) 41 | { 42 | this._parameterMap = parameterMap; 43 | return this; 44 | } 45 | headerMap(headerMap) 46 | { 47 | this._headerMap = headerMap; 48 | return this; 49 | } 50 | authenticationSchema(authenticationSchema) 51 | { 52 | this._authenticationSchema = authenticationSchema; 53 | return this; 54 | } 55 | 56 | build() 57 | { 58 | if (this._authenticationSchema == null) 59 | { 60 | throw new SDKException(Constants.MANDATORY_VALUE_ERROR, Constants.MANDATORY_KEY_ERROR + "-" + Constants.OAUTH_MANDATORY_KEYS_1) 61 | } 62 | return new Auth(this._parameterMap, this._headerMap, this._authenticationSchema); 63 | } 64 | } 65 | export 66 | { 67 | AuthBuilder as MasterModel, 68 | AuthBuilder as AuthBuilder 69 | } -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/merge_fields_response.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class MergeFieldsResponse{ 5 | 6 | merge; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the merge 10 | * @returns {Array} An Array representing the merge 11 | */ 12 | getMerge() { 13 | return this.merge; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to merge 19 | * @param {Array} merge An Array representing the merge 20 | */ 21 | setMerge(merge) { 22 | if((merge != null) && (!(Object.prototype.toString.call(merge) == "[object Array]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: merge EXPECTED TYPE: Array", null, null); 24 | } 25 | this.merge = merge; 26 | this.keyModified.set("merge", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | MergeFieldsResponse as MasterModel, 66 | MergeFieldsResponse as MergeFieldsResponse 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/combine_pd_fs_output_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class CombinePDFsOutputSettings{ 5 | 6 | name; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the name 10 | * @returns {String} A String representing the name 11 | */ 12 | getName() { 13 | return this.name; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to name 19 | * @param {String} name A String representing the name 20 | */ 21 | setName(name) { 22 | if((name != null) && (!(Object.prototype.toString.call(name) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: name EXPECTED TYPE: String", null, null); 24 | } 25 | this.name = name; 26 | this.keyModified.set("name", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | CombinePDFsOutputSettings as MasterModel, 66 | CombinePDFsOutputSettings as CombinePDFsOutputSettings 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/file_body_wrapper.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class FileBodyWrapper{ 6 | 7 | file; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the file 11 | * @returns {StreamWrapper} An instance of StreamWrapper 12 | */ 13 | getFile() { 14 | return this.file; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to file 20 | * @param {StreamWrapper} file An instance of StreamWrapper 21 | */ 22 | setFile(file) { 23 | if((file != null) && (!(file instanceof StreamWrapper))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: file EXPECTED TYPE: StreamWrapper", null, null); 25 | } 26 | this.file = file; 27 | this.keyModified.set("file", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to check if the user has modified the given key 33 | * @param {String} key A String representing the key 34 | * @returns {number} A number representing the modification 35 | */ 36 | isKeyModified(key) { 37 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 38 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 39 | } 40 | if(this.keyModified.has(key)) { 41 | return this.keyModified.get(key); 42 | } 43 | return null; 44 | 45 | } 46 | 47 | /** 48 | * The method to mark the given key as modified 49 | * @param {String} key A String representing the key 50 | * @param {number} modification A number representing the modification 51 | */ 52 | setKeyModified(key, modification) { 53 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 54 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 55 | } 56 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 57 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 58 | } 59 | this.keyModified.set(key, modification); 60 | 61 | } 62 | 63 | 64 | } 65 | export { 66 | FileBodyWrapper as MasterModel, 67 | FileBodyWrapper as FileBodyWrapper 68 | } 69 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_download_parameters.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SheetDownloadParameters{ 5 | 6 | format; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the format 10 | * @returns {String} A String representing the format 11 | */ 12 | getFormat() { 13 | return this.format; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to format 19 | * @param {String} format A String representing the format 20 | */ 21 | setFormat(format) { 22 | if((format != null) && (!(Object.prototype.toString.call(format) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: format EXPECTED TYPE: String", null, null); 24 | } 25 | this.format = format; 26 | this.keyModified.set("format", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | SheetDownloadParameters as MasterModel, 66 | SheetDownloadParameters as SheetDownloadParameters 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/fillable_link_output_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class FillableLinkOutputSettings{ 5 | 6 | format; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the format 10 | * @returns {String} A String representing the format 11 | */ 12 | getFormat() { 13 | return this.format; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to format 19 | * @param {String} format A String representing the format 20 | */ 21 | setFormat(format) { 22 | if((format != null) && (!(Object.prototype.toString.call(format) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: format EXPECTED TYPE: String", null, null); 24 | } 25 | this.format = format; 26 | this.keyModified.set("format", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | FillableLinkOutputSettings as MasterModel, 66 | FillableLinkOutputSettings as FillableLinkOutputSettings 67 | } 68 | -------------------------------------------------------------------------------- /routes/sdk_config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The class to configure the SDK. 3 | */ 4 | class SDKConfig { 5 | pickListValidation; 6 | 7 | _timeout; 8 | 9 | _connectionTimeout = 0; 10 | 11 | _requestTimeout = 0; 12 | 13 | _socketTimeout = 0; 14 | 15 | /** 16 | * Creates an instance of SDKConfig with the given parameters 17 | * @param {Boolean} pickListValidation A boolean representing pickListValidation 18 | * @param {number} timeout A Integer representing timeout 19 | * @param connectionTimeout A Integer representing connectionTimeout 20 | * @param requestTimeout A Integer representing requestTimeout 21 | * @param socketTimeout A Integer representing socketTimeout 22 | */ 23 | constructor(pickListValidation, timeout, connectionTimeout, requestTimeout, socketTimeout) { 24 | 25 | this.pickListValidation = pickListValidation; 26 | 27 | this._timeout = timeout; 28 | 29 | this._connectionTimeout = connectionTimeout; 30 | 31 | this._requestTimeout = requestTimeout; 32 | 33 | this._socketTimeout = socketTimeout; 34 | } 35 | 36 | /** 37 | * This is a getter method to get pickListValidation. 38 | * @returns {Boolean} A boolean representing pickListValidation 39 | */ 40 | getPickListValidation() { 41 | return this.pickListValidation; 42 | } 43 | 44 | /** 45 | * This is a getter method to get timeout. 46 | * @returns {number} A Integer representing API timeout 47 | */ 48 | getTimeout() { 49 | return this._timeout; 50 | } 51 | 52 | /** 53 | * This is a getter method to get connectionTimeout. 54 | * @return AN int representing connectionTimeout 55 | */ 56 | getConnectionTimeout() 57 | { 58 | return this._connectionTimeout; 59 | } 60 | 61 | /** 62 | * This is a getter method to get requestTimeout. 63 | * @return A int representing requestTimeout 64 | */ 65 | getRequestTimeout() 66 | { 67 | return this._requestTimeout; 68 | } 69 | 70 | /** 71 | * This is a getter method to get socketTimeout. 72 | * @return AN int representing socketTimeout 73 | */ 74 | getSocketTimeout() 75 | { 76 | return this._socketTimeout; 77 | } 78 | } 79 | 80 | export { 81 | SDKConfig as MasterModel, 82 | SDKConfig as SDKConfig 83 | } -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_ui_options.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SheetUiOptions{ 5 | 6 | saveButton; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the saveButton 10 | * @returns {String} A String representing the saveButton 11 | */ 12 | getSaveButton() { 13 | return this.saveButton; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to saveButton 19 | * @param {String} saveButton A String representing the saveButton 20 | */ 21 | setSaveButton(saveButton) { 22 | if((saveButton != null) && (!(Object.prototype.toString.call(saveButton) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: saveButton EXPECTED TYPE: String", null, null); 24 | } 25 | this.saveButton = saveButton; 26 | this.keyModified.set("save_button", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | SheetUiOptions as MasterModel, 66 | SheetUiOptions as SheetUiOptions 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/zoho_show_editor_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class ZohoShowEditorSettings{ 5 | 6 | language; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the language 10 | * @returns {String} A String representing the language 11 | */ 12 | getLanguage() { 13 | return this.language; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to language 19 | * @param {String} language A String representing the language 20 | */ 21 | setLanguage(language) { 22 | if((language != null) && (!(Object.prototype.toString.call(language) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: language EXPECTED TYPE: String", null, null); 24 | } 25 | this.language = language; 26 | this.keyModified.set("language", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | ZohoShowEditorSettings as MasterModel, 66 | ZohoShowEditorSettings as ZohoShowEditorSettings 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_user_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SheetUserSettings{ 5 | 6 | displayName; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the displayName 10 | * @returns {String} A String representing the displayName 11 | */ 12 | getDisplayName() { 13 | return this.displayName; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to displayName 19 | * @param {String} displayName A String representing the displayName 20 | */ 21 | setDisplayName(displayName) { 22 | if((displayName != null) && (!(Object.prototype.toString.call(displayName) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: displayName EXPECTED TYPE: String", null, null); 24 | } 25 | this.displayName = displayName; 26 | this.keyModified.set("display_name", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | SheetUserSettings as MasterModel, 66 | SheetUserSettings as SheetUserSettings 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/file_delete_success_response.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class FileDeleteSuccessResponse{ 5 | 6 | docDelete; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the docDelete 10 | * @returns {String} A String representing the docDelete 11 | */ 12 | getDocDelete() { 13 | return this.docDelete; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to docDelete 19 | * @param {String} docDelete A String representing the docDelete 20 | */ 21 | setDocDelete(docDelete) { 22 | if((docDelete != null) && (!(Object.prototype.toString.call(docDelete) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: docDelete EXPECTED TYPE: String", null, null); 24 | } 25 | this.docDelete = docDelete; 26 | this.keyModified.set("doc_delete", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | FileDeleteSuccessResponse as MasterModel, 66 | FileDeleteSuccessResponse as FileDeleteSuccessResponse 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/preview_document_info.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class PreviewDocumentInfo{ 5 | 6 | documentName; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the documentName 10 | * @returns {String} A String representing the documentName 11 | */ 12 | getDocumentName() { 13 | return this.documentName; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to documentName 19 | * @param {String} documentName A String representing the documentName 20 | */ 21 | setDocumentName(documentName) { 22 | if((documentName != null) && (!(Object.prototype.toString.call(documentName) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentName EXPECTED TYPE: String", null, null); 24 | } 25 | this.documentName = documentName; 26 | this.keyModified.set("document_name", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | PreviewDocumentInfo as MasterModel, 66 | PreviewDocumentInfo as PreviewDocumentInfo 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/fillable_link_response.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class FillableLinkResponse{ 5 | 6 | fillableFormUrl; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the fillableFormUrl 10 | * @returns {String} A String representing the fillableFormUrl 11 | */ 12 | getFillableFormUrl() { 13 | return this.fillableFormUrl; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to fillableFormUrl 19 | * @param {String} fillableFormUrl A String representing the fillableFormUrl 20 | */ 21 | setFillableFormUrl(fillableFormUrl) { 22 | if((fillableFormUrl != null) && (!(Object.prototype.toString.call(fillableFormUrl) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: fillableFormUrl EXPECTED TYPE: String", null, null); 24 | } 25 | this.fillableFormUrl = fillableFormUrl; 26 | this.keyModified.set("fillable_form_url", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | FillableLinkResponse as MasterModel, 66 | FillableLinkResponse as FillableLinkResponse 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/session_delete_success_response.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SessionDeleteSuccessResponse{ 5 | 6 | sessionDelete; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the sessionDelete 10 | * @returns {String} A String representing the sessionDelete 11 | */ 12 | getSessionDelete() { 13 | return this.sessionDelete; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to sessionDelete 19 | * @param {String} sessionDelete A String representing the sessionDelete 20 | */ 21 | setSessionDelete(sessionDelete) { 22 | if((sessionDelete != null) && (!(Object.prototype.toString.call(sessionDelete) == "[object String]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: sessionDelete EXPECTED TYPE: String", null, null); 24 | } 25 | this.sessionDelete = sessionDelete; 26 | this.keyModified.set("session_delete", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | SessionDeleteSuccessResponse as MasterModel, 66 | SessionDeleteSuccessResponse as SessionDeleteSuccessResponse 67 | } 68 | -------------------------------------------------------------------------------- /routes/sdk_config_builder.js: -------------------------------------------------------------------------------- 1 | import {SDKConfig} from "./sdk_config.js"; 2 | 3 | class SDKConfigBuilder { 4 | _pickListValidation = true; 5 | 6 | _timeout = 0; 7 | 8 | _connectionTimeout = 0; 9 | 10 | _requestTimeout = 0; 11 | 12 | _socketTimeout = 0; 13 | 14 | /** 15 | * This is a setter method to set pickListValidation. 16 | * @param {Boolean} pickListValidation A boolean value 17 | * @returns {SDKConfigBuilder} An instance of SDKConfigBuilder 18 | */ 19 | pickListValidation(pickListValidation) { 20 | this._pickListValidation = pickListValidation; 21 | 22 | return this; 23 | } 24 | 25 | /** 26 | * This is a setter method to set API timeout. 27 | * @param {number} timeout 28 | * @returns {SDKConfigBuilder} An instance of SDKConfigBuilder 29 | */ 30 | timeout(timeout) { 31 | this._timeout = timeout > 0 ? timeout : 0; 32 | 33 | return this; 34 | } 35 | 36 | /** 37 | * This is a setter method to set connectionTimeout. 38 | * @param {number} connectionTimeout 39 | * @returns {SDKConfigBuilder} An instance of SDKConfigBuilder 40 | */ 41 | connectionTimeout(connectionTimeout) 42 | { 43 | this._connectionTimeout = connectionTimeout > 0 ? connectionTimeout : 0; 44 | 45 | return this; 46 | } 47 | 48 | /** 49 | * This is a setter method to set requestTimeout. 50 | * @param {number} requestTimeout 51 | * @returns {SDKConfigBuilder} An instance of SDKConfigBuilder 52 | */ 53 | requestTimeout(requestTimeout) 54 | { 55 | this._requestTimeout = requestTimeout > 0 ? requestTimeout : 0; 56 | 57 | return this; 58 | } 59 | 60 | /** 61 | * This is a setter method to set socketTimeout. 62 | * @param {number} socketTimeout 63 | * @returns {SDKConfigBuilder} An instance of SDKConfigBuilder 64 | */ 65 | socketTimeout(socketTimeout) 66 | { 67 | this._socketTimeout = socketTimeout > 0 ? socketTimeout : 0; 68 | 69 | return this; 70 | } 71 | 72 | 73 | /** 74 | * The method to build the SDKConfig instance 75 | * @returns {SDKConfig} An instance of SDKConfig 76 | */ 77 | build() { 78 | return new SDKConfig(this._pickListValidation, this._timeout, this._connectionTimeout, this._requestTimeout, this._socketTimeout); 79 | } 80 | } 81 | 82 | export { 83 | SDKConfigBuilder as MasterModel, 84 | SDKConfigBuilder as SDKConfigBuilder 85 | } -------------------------------------------------------------------------------- /routes/header_map.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "./exception/sdk_exception.js"; 2 | import {Constants} from "../utils/util/constants.js"; 3 | import {HeaderParamValidator} from "../utils/util/header_param_validator.js"; 4 | import {DataTypeConverter} from "../utils/util/datatype_converter.js"; 5 | 6 | /** 7 | * This class represents the HTTP header name and value. 8 | */ 9 | class HeaderMap { 10 | headerMap = new Map(); 11 | 12 | /** 13 | * This is a getter method to get the header map. 14 | * @returns {Map} A Map representing the API request headers. 15 | */ 16 | getHeaderMap() { 17 | return this.headerMap; 18 | } 19 | 20 | /** 21 | * The method to add the header name and value. 22 | * @param {Header} header - A Header class instance. 23 | * @param {object} value - An object containing the header value. 24 | * @throws {SDKException} 25 | */ 26 | async add(header, value) { 27 | 28 | if (header == null) { 29 | throw new SDKException(Constants.HEADER_NULL_ERROR, Constants.HEADER_INSTANCE_NULL_ERROR); 30 | } 31 | var headerName = header.getName(); 32 | 33 | if (headerName == null) { 34 | throw new SDKException(Constants.HEADER_NAME_NULL_ERROR, Constants.HEADER_NAME_NULL_ERROR_MESSAGE); 35 | } 36 | 37 | if (value == null) { 38 | throw new SDKException(Constants.HEADER_NULL_ERROR, headerName + Constants.NULL_VALUE_ERROR_MESSAGE); 39 | } 40 | 41 | var headerClassName = header.getClassName(); 42 | 43 | var parsedHeaderValue = null; 44 | 45 | if (headerClassName != null) { 46 | let headerParamValidator = new HeaderParamValidator(); 47 | 48 | parsedHeaderValue = await headerParamValidator.validate(headerName, headerClassName, value).catch(err => { throw err; }); 49 | } 50 | else { 51 | try { 52 | let type = typeof value; 53 | parsedHeaderValue = DataTypeConverter.postConvert(value, type); 54 | } 55 | catch(ex) 56 | { 57 | parsedHeaderValue = value; 58 | } 59 | } 60 | 61 | parsedHeaderValue = JSON.stringify(parsedHeaderValue); 62 | 63 | 64 | if (this.headerMap.has(headerName) && this.headerMap.get(headerName) != null) { 65 | let headerValue = this.headerMap.get(headerName); 66 | 67 | headerValue = headerValue.concat(",", parsedHeaderValue.toString()); 68 | 69 | this.headerMap.set(headerName, headerValue); 70 | } 71 | else { 72 | this.headerMap.set(headerName, parsedHeaderValue.toString()); 73 | } 74 | } 75 | } 76 | 77 | export { 78 | HeaderMap as MasterModel, 79 | HeaderMap as HeaderMap 80 | } 81 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/document_delete_success_response.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class DocumentDeleteSuccessResponse{ 5 | 6 | documentDeleted; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the documentDeleted 10 | * @returns {Boolean} A Boolean representing the documentDeleted 11 | */ 12 | getDocumentDeleted() { 13 | return this.documentDeleted; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to documentDeleted 19 | * @param {Boolean} documentDeleted A Boolean representing the documentDeleted 20 | */ 21 | setDocumentDeleted(documentDeleted) { 22 | if((documentDeleted != null) && (!(Object.prototype.toString.call(documentDeleted) == "[object Boolean]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentDeleted EXPECTED TYPE: Boolean", null, null); 24 | } 25 | this.documentDeleted = documentDeleted; 26 | this.keyModified.set("document_deleted", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | DocumentDeleteSuccessResponse as MasterModel, 66 | DocumentDeleteSuccessResponse as DocumentDeleteSuccessResponse 67 | } 68 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/document_session_delete_success_response.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class DocumentSessionDeleteSuccessResponse{ 5 | 6 | sessionDeleted; 7 | keyModified = new Map(); 8 | /** 9 | * The method to get the sessionDeleted 10 | * @returns {Boolean} A Boolean representing the sessionDeleted 11 | */ 12 | getSessionDeleted() { 13 | return this.sessionDeleted; 14 | 15 | } 16 | 17 | /** 18 | * The method to set the value to sessionDeleted 19 | * @param {Boolean} sessionDeleted A Boolean representing the sessionDeleted 20 | */ 21 | setSessionDeleted(sessionDeleted) { 22 | if((sessionDeleted != null) && (!(Object.prototype.toString.call(sessionDeleted) == "[object Boolean]"))) { 23 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: sessionDeleted EXPECTED TYPE: Boolean", null, null); 24 | } 25 | this.sessionDeleted = sessionDeleted; 26 | this.keyModified.set("session_deleted", 1); 27 | 28 | } 29 | 30 | /** 31 | * The method to check if the user has modified the given key 32 | * @param {String} key A String representing the key 33 | * @returns {number} A number representing the modification 34 | */ 35 | isKeyModified(key) { 36 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 37 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 38 | } 39 | if(this.keyModified.has(key)) { 40 | return this.keyModified.get(key); 41 | } 42 | return null; 43 | 44 | } 45 | 46 | /** 47 | * The method to mark the given key as modified 48 | * @param {String} key A String representing the key 49 | * @param {number} modification A number representing the modification 50 | */ 51 | setKeyModified(key, modification) { 52 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 53 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 54 | } 55 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 56 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 57 | } 58 | this.keyModified.set(key, modification); 59 | 60 | } 61 | 62 | 63 | } 64 | export { 65 | DocumentSessionDeleteSuccessResponse as MasterModel, 66 | DocumentSessionDeleteSuccessResponse as DocumentSessionDeleteSuccessResponse 67 | } 68 | -------------------------------------------------------------------------------- /routes/parameter_map.js: -------------------------------------------------------------------------------- 1 | import {DataTypeConverter} from "../utils/util/datatype_converter.js"; 2 | import {HeaderParamValidator} from "../utils/util/header_param_validator.js"; 3 | import {Constants} from "../utils/util/constants.js"; 4 | import {SDKException} from "./exception/sdk_exception.js"; 5 | 6 | /** 7 | * This class represents the HTTP parameter name and value. 8 | */ 9 | class ParameterMap { 10 | 11 | parameterMap = new Map(); 12 | 13 | /** 14 | * This is a getter method to get parameter map. 15 | * @returns {Map} A Map representing the API request parameters. 16 | */ 17 | getParameterMap() { 18 | return this.parameterMap; 19 | } 20 | 21 | /** 22 | * The method to add parameter name and value. 23 | * @param {Param} param - A Param class instance. 24 | * @param {object} value - An object containing the parameter value. 25 | * @throws {SDKException} 26 | */ 27 | async add(param, value) { 28 | 29 | if (param == null) { 30 | throw new SDKException(Constants.PARAMETER_NULL_ERROR, Constants.PARAM_INSTANCE_NULL_ERROR); 31 | } 32 | 33 | var paramName = param.getName(); 34 | 35 | if (paramName == null) { 36 | throw new SDKException(Constants.PARAM_NAME_NULL_ERROR, Constants.PARAM_NAME_NULL_ERROR_MESSAGE); 37 | } 38 | 39 | if (value == null) { 40 | throw new SDKException(Constants.PARAMETER_NULL_ERROR, paramName + Constants.NULL_VALUE_ERROR_MESSAGE); 41 | } 42 | 43 | var paramClassName = param.getClassName(); 44 | 45 | var parsedParamValue = null; 46 | 47 | if (paramClassName != null) { 48 | let headerParamValidator = new HeaderParamValidator(); 49 | 50 | parsedParamValue = await headerParamValidator.validate(paramName, paramClassName, value).catch(err => { throw err; }); 51 | } 52 | else { 53 | try { 54 | let type = typeof value; 55 | parsedParamValue = DataTypeConverter.postConvert(value, type); 56 | } 57 | catch(ex) 58 | { 59 | parsedParamValue = value; 60 | } 61 | } 62 | 63 | if (typeof parsedParamValue == "object") 64 | { 65 | parsedParamValue = JSON.stringify(parsedParamValue); 66 | } 67 | if (this.parameterMap.has(paramName) && this.parameterMap.get(paramName) != null) { 68 | let paramValue = this.parameterMap.get(paramName) 69 | 70 | paramValue = paramValue.concat(",", parsedParamValue.toString()); 71 | 72 | this.parameterMap.set(paramName, paramValue); 73 | } 74 | else { 75 | this.parameterMap.set(paramName, parsedParamValue.toString()); 76 | } 77 | } 78 | } 79 | 80 | export { 81 | ParameterMap as MasterModel, 82 | ParameterMap as ParameterMap 83 | } 84 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/user_info.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class UserInfo{ 5 | 6 | userId; 7 | displayName; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the userId 11 | * @returns {String} A String representing the userId 12 | */ 13 | getUserId() { 14 | return this.userId; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to userId 20 | * @param {String} userId A String representing the userId 21 | */ 22 | setUserId(userId) { 23 | if((userId != null) && (!(Object.prototype.toString.call(userId) == "[object String]"))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: userId EXPECTED TYPE: String", null, null); 25 | } 26 | this.userId = userId; 27 | this.keyModified.set("user_id", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to get the displayName 33 | * @returns {String} A String representing the displayName 34 | */ 35 | getDisplayName() { 36 | return this.displayName; 37 | 38 | } 39 | 40 | /** 41 | * The method to set the value to displayName 42 | * @param {String} displayName A String representing the displayName 43 | */ 44 | setDisplayName(displayName) { 45 | if((displayName != null) && (!(Object.prototype.toString.call(displayName) == "[object String]"))) { 46 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: displayName EXPECTED TYPE: String", null, null); 47 | } 48 | this.displayName = displayName; 49 | this.keyModified.set("display_name", 1); 50 | 51 | } 52 | 53 | /** 54 | * The method to check if the user has modified the given key 55 | * @param {String} key A String representing the key 56 | * @returns {number} A number representing the modification 57 | */ 58 | isKeyModified(key) { 59 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 60 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 61 | } 62 | if(this.keyModified.has(key)) { 63 | return this.keyModified.get(key); 64 | } 65 | return null; 66 | 67 | } 68 | 69 | /** 70 | * The method to mark the given key as modified 71 | * @param {String} key A String representing the key 72 | * @param {number} modification A number representing the modification 73 | */ 74 | setKeyModified(key, modification) { 75 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 76 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 77 | } 78 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 79 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 80 | } 81 | this.keyModified.set(key, modification); 82 | 83 | } 84 | 85 | 86 | } 87 | export { 88 | UserInfo as MasterModel, 89 | UserInfo as UserInfo 90 | } 91 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_editor_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SheetEditorSettings{ 5 | 6 | country; 7 | language; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the country 11 | * @returns {String} A String representing the country 12 | */ 13 | getCountry() { 14 | return this.country; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to country 20 | * @param {String} country A String representing the country 21 | */ 22 | setCountry(country) { 23 | if((country != null) && (!(Object.prototype.toString.call(country) == "[object String]"))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: country EXPECTED TYPE: String", null, null); 25 | } 26 | this.country = country; 27 | this.keyModified.set("country", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to get the language 33 | * @returns {String} A String representing the language 34 | */ 35 | getLanguage() { 36 | return this.language; 37 | 38 | } 39 | 40 | /** 41 | * The method to set the value to language 42 | * @param {String} language A String representing the language 43 | */ 44 | setLanguage(language) { 45 | if((language != null) && (!(Object.prototype.toString.call(language) == "[object String]"))) { 46 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: language EXPECTED TYPE: String", null, null); 47 | } 48 | this.language = language; 49 | this.keyModified.set("language", 1); 50 | 51 | } 52 | 53 | /** 54 | * The method to check if the user has modified the given key 55 | * @param {String} key A String representing the key 56 | * @returns {number} A number representing the modification 57 | */ 58 | isKeyModified(key) { 59 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 60 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 61 | } 62 | if(this.keyModified.has(key)) { 63 | return this.keyModified.get(key); 64 | } 65 | return null; 66 | 67 | } 68 | 69 | /** 70 | * The method to mark the given key as modified 71 | * @param {String} key A String representing the key 72 | * @param {number} modification A number representing the modification 73 | */ 74 | setKeyModified(key, modification) { 75 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 76 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 77 | } 78 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 79 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 80 | } 81 | this.keyModified.set(key, modification); 82 | 83 | } 84 | 85 | 86 | } 87 | export { 88 | SheetEditorSettings as MasterModel, 89 | SheetEditorSettings as SheetEditorSettings 90 | } 91 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/session_user_info.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SessionUserInfo{ 5 | 6 | displayName; 7 | userId; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the displayName 11 | * @returns {String} A String representing the displayName 12 | */ 13 | getDisplayName() { 14 | return this.displayName; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to displayName 20 | * @param {String} displayName A String representing the displayName 21 | */ 22 | setDisplayName(displayName) { 23 | if((displayName != null) && (!(Object.prototype.toString.call(displayName) == "[object String]"))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: displayName EXPECTED TYPE: String", null, null); 25 | } 26 | this.displayName = displayName; 27 | this.keyModified.set("display_name", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to get the userId 33 | * @returns {String} A String representing the userId 34 | */ 35 | getUserId() { 36 | return this.userId; 37 | 38 | } 39 | 40 | /** 41 | * The method to set the value to userId 42 | * @param {String} userId A String representing the userId 43 | */ 44 | setUserId(userId) { 45 | if((userId != null) && (!(Object.prototype.toString.call(userId) == "[object String]"))) { 46 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: userId EXPECTED TYPE: String", null, null); 47 | } 48 | this.userId = userId; 49 | this.keyModified.set("user_id", 1); 50 | 51 | } 52 | 53 | /** 54 | * The method to check if the user has modified the given key 55 | * @param {String} key A String representing the key 56 | * @returns {number} A number representing the modification 57 | */ 58 | isKeyModified(key) { 59 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 60 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 61 | } 62 | if(this.keyModified.has(key)) { 63 | return this.keyModified.get(key); 64 | } 65 | return null; 66 | 67 | } 68 | 69 | /** 70 | * The method to mark the given key as modified 71 | * @param {String} key A String representing the key 72 | * @param {number} modification A number representing the modification 73 | */ 74 | setKeyModified(key, modification) { 75 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 76 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 77 | } 78 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 79 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 80 | } 81 | this.keyModified.set(key, modification); 82 | 83 | } 84 | 85 | 86 | } 87 | export { 88 | SessionUserInfo as MasterModel, 89 | SessionUserInfo as SessionUserInfo 90 | } 91 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/document_info.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class DocumentInfo{ 5 | 6 | documentName; 7 | documentId; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the documentName 11 | * @returns {String} A String representing the documentName 12 | */ 13 | getDocumentName() { 14 | return this.documentName; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to documentName 20 | * @param {String} documentName A String representing the documentName 21 | */ 22 | setDocumentName(documentName) { 23 | if((documentName != null) && (!(Object.prototype.toString.call(documentName) == "[object String]"))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentName EXPECTED TYPE: String", null, null); 25 | } 26 | this.documentName = documentName; 27 | this.keyModified.set("document_name", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to get the documentId 33 | * @returns {String} A String representing the documentId 34 | */ 35 | getDocumentId() { 36 | return this.documentId; 37 | 38 | } 39 | 40 | /** 41 | * The method to set the value to documentId 42 | * @param {String} documentId A String representing the documentId 43 | */ 44 | setDocumentId(documentId) { 45 | if((documentId != null) && (!(Object.prototype.toString.call(documentId) == "[object String]"))) { 46 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentId EXPECTED TYPE: String", null, null); 47 | } 48 | this.documentId = documentId; 49 | this.keyModified.set("document_id", 1); 50 | 51 | } 52 | 53 | /** 54 | * The method to check if the user has modified the given key 55 | * @param {String} key A String representing the key 56 | * @returns {number} A number representing the modification 57 | */ 58 | isKeyModified(key) { 59 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 60 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 61 | } 62 | if(this.keyModified.has(key)) { 63 | return this.keyModified.get(key); 64 | } 65 | return null; 66 | 67 | } 68 | 69 | /** 70 | * The method to mark the given key as modified 71 | * @param {String} key A String representing the key 72 | * @param {number} modification A number representing the modification 73 | */ 74 | setKeyModified(key, modification) { 75 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 76 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 77 | } 78 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 79 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 80 | } 81 | this.keyModified.set(key, modification); 82 | 83 | } 84 | 85 | 86 | } 87 | export { 88 | DocumentInfo as MasterModel, 89 | DocumentInfo as DocumentInfo 90 | } 91 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_conversion_output_options.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SheetConversionOutputOptions{ 5 | 6 | format; 7 | documentName; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the format 11 | * @returns {String} A String representing the format 12 | */ 13 | getFormat() { 14 | return this.format; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to format 20 | * @param {String} format A String representing the format 21 | */ 22 | setFormat(format) { 23 | if((format != null) && (!(Object.prototype.toString.call(format) == "[object String]"))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: format EXPECTED TYPE: String", null, null); 25 | } 26 | this.format = format; 27 | this.keyModified.set("format", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to get the documentName 33 | * @returns {String} A String representing the documentName 34 | */ 35 | getDocumentName() { 36 | return this.documentName; 37 | 38 | } 39 | 40 | /** 41 | * The method to set the value to documentName 42 | * @param {String} documentName A String representing the documentName 43 | */ 44 | setDocumentName(documentName) { 45 | if((documentName != null) && (!(Object.prototype.toString.call(documentName) == "[object String]"))) { 46 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentName EXPECTED TYPE: String", null, null); 47 | } 48 | this.documentName = documentName; 49 | this.keyModified.set("document_name", 1); 50 | 51 | } 52 | 53 | /** 54 | * The method to check if the user has modified the given key 55 | * @param {String} key A String representing the key 56 | * @returns {number} A number representing the modification 57 | */ 58 | isKeyModified(key) { 59 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 60 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 61 | } 62 | if(this.keyModified.has(key)) { 63 | return this.keyModified.get(key); 64 | } 65 | return null; 66 | 67 | } 68 | 69 | /** 70 | * The method to mark the given key as modified 71 | * @param {String} key A String representing the key 72 | * @param {number} modification A number representing the modification 73 | */ 74 | setKeyModified(key, modification) { 75 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 76 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 77 | } 78 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 79 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 80 | } 81 | this.keyModified.set(key, modification); 82 | 83 | } 84 | 85 | 86 | } 87 | export { 88 | SheetConversionOutputOptions as MasterModel, 89 | SheetConversionOutputOptions as SheetConversionOutputOptions 90 | } 91 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/mail_merge_webhook_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class MailMergeWebhookSettings{ 5 | 6 | invokeUrl; 7 | invokePeriod; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the invokeUrl 11 | * @returns {String} A String representing the invokeUrl 12 | */ 13 | getInvokeUrl() { 14 | return this.invokeUrl; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to invokeUrl 20 | * @param {String} invokeUrl A String representing the invokeUrl 21 | */ 22 | setInvokeUrl(invokeUrl) { 23 | if((invokeUrl != null) && (!(Object.prototype.toString.call(invokeUrl) == "[object String]"))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: invokeUrl EXPECTED TYPE: String", null, null); 25 | } 26 | this.invokeUrl = invokeUrl; 27 | this.keyModified.set("invoke_url", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to get the invokePeriod 33 | * @returns {String} A String representing the invokePeriod 34 | */ 35 | getInvokePeriod() { 36 | return this.invokePeriod; 37 | 38 | } 39 | 40 | /** 41 | * The method to set the value to invokePeriod 42 | * @param {String} invokePeriod A String representing the invokePeriod 43 | */ 44 | setInvokePeriod(invokePeriod) { 45 | if((invokePeriod != null) && (!(Object.prototype.toString.call(invokePeriod) == "[object String]"))) { 46 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: invokePeriod EXPECTED TYPE: String", null, null); 47 | } 48 | this.invokePeriod = invokePeriod; 49 | this.keyModified.set("invoke_period", 1); 50 | 51 | } 52 | 53 | /** 54 | * The method to check if the user has modified the given key 55 | * @param {String} key A String representing the key 56 | * @returns {number} A number representing the modification 57 | */ 58 | isKeyModified(key) { 59 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 60 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 61 | } 62 | if(this.keyModified.has(key)) { 63 | return this.keyModified.get(key); 64 | } 65 | return null; 66 | 67 | } 68 | 69 | /** 70 | * The method to mark the given key as modified 71 | * @param {String} key A String representing the key 72 | * @param {number} modification A number representing the modification 73 | */ 74 | setKeyModified(key, modification) { 75 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 76 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 77 | } 78 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 79 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 80 | } 81 | this.keyModified.set(key, modification); 82 | 83 | } 84 | 85 | 86 | } 87 | export { 88 | MailMergeWebhookSettings as MasterModel, 89 | MailMergeWebhookSettings as MailMergeWebhookSettings 90 | } 91 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/get_merge_fields_parameters.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class GetMergeFieldsParameters{ 6 | 7 | fileContent; 8 | fileUrl; 9 | keyModified = new Map(); 10 | /** 11 | * The method to get the fileContent 12 | * @returns {StreamWrapper} An instance of StreamWrapper 13 | */ 14 | getFileContent() { 15 | return this.fileContent; 16 | 17 | } 18 | 19 | /** 20 | * The method to set the value to fileContent 21 | * @param {StreamWrapper} fileContent An instance of StreamWrapper 22 | */ 23 | setFileContent(fileContent) { 24 | if((fileContent != null) && (!(fileContent instanceof StreamWrapper))) { 25 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: fileContent EXPECTED TYPE: StreamWrapper", null, null); 26 | } 27 | this.fileContent = fileContent; 28 | this.keyModified.set("file_content", 1); 29 | 30 | } 31 | 32 | /** 33 | * The method to get the fileUrl 34 | * @returns {String} A String representing the fileUrl 35 | */ 36 | getFileUrl() { 37 | return this.fileUrl; 38 | 39 | } 40 | 41 | /** 42 | * The method to set the value to fileUrl 43 | * @param {String} fileUrl A String representing the fileUrl 44 | */ 45 | setFileUrl(fileUrl) { 46 | if((fileUrl != null) && (!(Object.prototype.toString.call(fileUrl) == "[object String]"))) { 47 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: fileUrl EXPECTED TYPE: String", null, null); 48 | } 49 | this.fileUrl = fileUrl; 50 | this.keyModified.set("file_url", 1); 51 | 52 | } 53 | 54 | /** 55 | * The method to check if the user has modified the given key 56 | * @param {String} key A String representing the key 57 | * @returns {number} A number representing the modification 58 | */ 59 | isKeyModified(key) { 60 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 61 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 62 | } 63 | if(this.keyModified.has(key)) { 64 | return this.keyModified.get(key); 65 | } 66 | return null; 67 | 68 | } 69 | 70 | /** 71 | * The method to mark the given key as modified 72 | * @param {String} key A String representing the key 73 | * @param {number} modification A number representing the modification 74 | */ 75 | setKeyModified(key, modification) { 76 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 77 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 78 | } 79 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 80 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 81 | } 82 | this.keyModified.set(key, modification); 83 | 84 | } 85 | 86 | 87 | } 88 | export { 89 | GetMergeFieldsParameters as MasterModel, 90 | GetMergeFieldsParameters as GetMergeFieldsParameters 91 | } 92 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/compare_document_response.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class CompareDocumentResponse{ 5 | 6 | compareUrl; 7 | sessionDeleteUrl; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the compareUrl 11 | * @returns {String} A String representing the compareUrl 12 | */ 13 | getCompareUrl() { 14 | return this.compareUrl; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to compareUrl 20 | * @param {String} compareUrl A String representing the compareUrl 21 | */ 22 | setCompareUrl(compareUrl) { 23 | if((compareUrl != null) && (!(Object.prototype.toString.call(compareUrl) == "[object String]"))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: compareUrl EXPECTED TYPE: String", null, null); 25 | } 26 | this.compareUrl = compareUrl; 27 | this.keyModified.set("compare_url", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to get the sessionDeleteUrl 33 | * @returns {String} A String representing the sessionDeleteUrl 34 | */ 35 | getSessionDeleteUrl() { 36 | return this.sessionDeleteUrl; 37 | 38 | } 39 | 40 | /** 41 | * The method to set the value to sessionDeleteUrl 42 | * @param {String} sessionDeleteUrl A String representing the sessionDeleteUrl 43 | */ 44 | setSessionDeleteUrl(sessionDeleteUrl) { 45 | if((sessionDeleteUrl != null) && (!(Object.prototype.toString.call(sessionDeleteUrl) == "[object String]"))) { 46 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: sessionDeleteUrl EXPECTED TYPE: String", null, null); 47 | } 48 | this.sessionDeleteUrl = sessionDeleteUrl; 49 | this.keyModified.set("session_delete_url", 1); 50 | 51 | } 52 | 53 | /** 54 | * The method to check if the user has modified the given key 55 | * @param {String} key A String representing the key 56 | * @returns {number} A number representing the modification 57 | */ 58 | isKeyModified(key) { 59 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 60 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 61 | } 62 | if(this.keyModified.has(key)) { 63 | return this.keyModified.get(key); 64 | } 65 | return null; 66 | 67 | } 68 | 69 | /** 70 | * The method to mark the given key as modified 71 | * @param {String} key A String representing the key 72 | * @param {number} modification A number representing the modification 73 | */ 74 | setKeyModified(key, modification) { 75 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 76 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 77 | } 78 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 79 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 80 | } 81 | this.keyModified.set(key, modification); 82 | 83 | } 84 | 85 | 86 | } 87 | export { 88 | CompareDocumentResponse as MasterModel, 89 | CompareDocumentResponse as CompareDocumentResponse 90 | } 91 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/merge_and_deliver_via_webhook_success_response.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class MergeAndDeliverViaWebhookSuccessResponse{ 5 | 6 | mergeReportDataUrl; 7 | records; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the mergeReportDataUrl 11 | * @returns {String} A String representing the mergeReportDataUrl 12 | */ 13 | getMergeReportDataUrl() { 14 | return this.mergeReportDataUrl; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to mergeReportDataUrl 20 | * @param {String} mergeReportDataUrl A String representing the mergeReportDataUrl 21 | */ 22 | setMergeReportDataUrl(mergeReportDataUrl) { 23 | if((mergeReportDataUrl != null) && (!(Object.prototype.toString.call(mergeReportDataUrl) == "[object String]"))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: mergeReportDataUrl EXPECTED TYPE: String", null, null); 25 | } 26 | this.mergeReportDataUrl = mergeReportDataUrl; 27 | this.keyModified.set("merge_report_data_url", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to get the records 33 | * @returns {Array} An Array representing the records 34 | */ 35 | getRecords() { 36 | return this.records; 37 | 38 | } 39 | 40 | /** 41 | * The method to set the value to records 42 | * @param {Array} records An Array representing the records 43 | */ 44 | setRecords(records) { 45 | if((records != null) && (!(Object.prototype.toString.call(records) == "[object Array]"))) { 46 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: records EXPECTED TYPE: Array", null, null); 47 | } 48 | this.records = records; 49 | this.keyModified.set("records", 1); 50 | 51 | } 52 | 53 | /** 54 | * The method to check if the user has modified the given key 55 | * @param {String} key A String representing the key 56 | * @returns {number} A number representing the modification 57 | */ 58 | isKeyModified(key) { 59 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 60 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 61 | } 62 | if(this.keyModified.has(key)) { 63 | return this.keyModified.get(key); 64 | } 65 | return null; 66 | 67 | } 68 | 69 | /** 70 | * The method to mark the given key as modified 71 | * @param {String} key A String representing the key 72 | * @param {number} modification A number representing the modification 73 | */ 74 | setKeyModified(key, modification) { 75 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 76 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 77 | } 78 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 79 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 80 | } 81 | this.keyModified.set(key, modification); 82 | 83 | } 84 | 85 | 86 | } 87 | export { 88 | MergeAndDeliverViaWebhookSuccessResponse as MasterModel, 89 | MergeAndDeliverViaWebhookSuccessResponse as MergeAndDeliverViaWebhookSuccessResponse 90 | } 91 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/combine_pd_fs_parameters.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class CombinePDFsParameters{ 5 | 6 | inputOptions; 7 | outputSettings; 8 | keyModified = new Map(); 9 | /** 10 | * The method to get the inputOptions 11 | * @returns {Map} A Map representing the inputOptions 12 | */ 13 | getInputOptions() { 14 | return this.inputOptions; 15 | 16 | } 17 | 18 | /** 19 | * The method to set the value to inputOptions 20 | * @param {Map} inputOptions A Map representing the inputOptions 21 | */ 22 | setInputOptions(inputOptions) { 23 | if((inputOptions != null) && (!(Object.prototype.toString.call(inputOptions) == "[object Map]"))) { 24 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: inputOptions EXPECTED TYPE: Map", null, null); 25 | } 26 | this.inputOptions = inputOptions; 27 | this.keyModified.set("input_options", 1); 28 | 29 | } 30 | 31 | /** 32 | * The method to get the outputSettings 33 | * @returns {CombinePDFsOutputSettings} An instance of CombinePDFsOutputSettings 34 | */ 35 | getOutputSettings() { 36 | return this.outputSettings; 37 | 38 | } 39 | 40 | /** 41 | * The method to set the value to outputSettings 42 | * @param {CombinePDFsOutputSettings} outputSettings An instance of CombinePDFsOutputSettings 43 | */ 44 | async setOutputSettings(outputSettings) { 45 | const CombinePdFsOutputSettings = (await (import("./combine_pd_fs_output_settings.js"))).MasterModel; 46 | if((outputSettings != null) && (!(outputSettings instanceof CombinePDFsOutputSettings))) { 47 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: outputSettings EXPECTED TYPE: CombinePDFsOutputSettings", null, null); 48 | } 49 | this.outputSettings = outputSettings; 50 | this.keyModified.set("output_settings", 1); 51 | 52 | } 53 | 54 | /** 55 | * The method to check if the user has modified the given key 56 | * @param {String} key A String representing the key 57 | * @returns {number} A number representing the modification 58 | */ 59 | isKeyModified(key) { 60 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 61 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 62 | } 63 | if(this.keyModified.has(key)) { 64 | return this.keyModified.get(key); 65 | } 66 | return null; 67 | 68 | } 69 | 70 | /** 71 | * The method to mark the given key as modified 72 | * @param {String} key A String representing the key 73 | * @param {number} modification A number representing the modification 74 | */ 75 | setKeyModified(key, modification) { 76 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 77 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 78 | } 79 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 80 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 81 | } 82 | this.keyModified.set(key, modification); 83 | 84 | } 85 | 86 | 87 | } 88 | export { 89 | CombinePDFsParameters as MasterModel, 90 | CombinePDFsParameters as CombinePDFsParameters 91 | } 92 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/editor_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class EditorSettings{ 5 | 6 | unit; 7 | language; 8 | view; 9 | keyModified = new Map(); 10 | /** 11 | * The method to get the unit 12 | * @returns {String} A String representing the unit 13 | */ 14 | getUnit() { 15 | return this.unit; 16 | 17 | } 18 | 19 | /** 20 | * The method to set the value to unit 21 | * @param {String} unit A String representing the unit 22 | */ 23 | setUnit(unit) { 24 | if((unit != null) && (!(Object.prototype.toString.call(unit) == "[object String]"))) { 25 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: unit EXPECTED TYPE: String", null, null); 26 | } 27 | this.unit = unit; 28 | this.keyModified.set("unit", 1); 29 | 30 | } 31 | 32 | /** 33 | * The method to get the language 34 | * @returns {String} A String representing the language 35 | */ 36 | getLanguage() { 37 | return this.language; 38 | 39 | } 40 | 41 | /** 42 | * The method to set the value to language 43 | * @param {String} language A String representing the language 44 | */ 45 | setLanguage(language) { 46 | if((language != null) && (!(Object.prototype.toString.call(language) == "[object String]"))) { 47 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: language EXPECTED TYPE: String", null, null); 48 | } 49 | this.language = language; 50 | this.keyModified.set("language", 1); 51 | 52 | } 53 | 54 | /** 55 | * The method to get the view 56 | * @returns {String} A String representing the view 57 | */ 58 | getView() { 59 | return this.view; 60 | 61 | } 62 | 63 | /** 64 | * The method to set the value to view 65 | * @param {String} view A String representing the view 66 | */ 67 | setView(view) { 68 | if((view != null) && (!(Object.prototype.toString.call(view) == "[object String]"))) { 69 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: view EXPECTED TYPE: String", null, null); 70 | } 71 | this.view = view; 72 | this.keyModified.set("view", 1); 73 | 74 | } 75 | 76 | /** 77 | * The method to check if the user has modified the given key 78 | * @param {String} key A String representing the key 79 | * @returns {number} A number representing the modification 80 | */ 81 | isKeyModified(key) { 82 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 83 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 84 | } 85 | if(this.keyModified.has(key)) { 86 | return this.keyModified.get(key); 87 | } 88 | return null; 89 | 90 | } 91 | 92 | /** 93 | * The method to mark the given key as modified 94 | * @param {String} key A String representing the key 95 | * @param {number} modification A number representing the modification 96 | */ 97 | setKeyModified(key, modification) { 98 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 99 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 100 | } 101 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 102 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 103 | } 104 | this.keyModified.set(key, modification); 105 | 106 | } 107 | 108 | 109 | } 110 | export { 111 | EditorSettings as MasterModel, 112 | EditorSettings as EditorSettings 113 | } 114 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/merge_fields.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class MergeFields{ 5 | 6 | id; 7 | displayName; 8 | type; 9 | keyModified = new Map(); 10 | /** 11 | * The method to get the id 12 | * @returns {String} A String representing the id 13 | */ 14 | getId() { 15 | return this.id; 16 | 17 | } 18 | 19 | /** 20 | * The method to set the value to id 21 | * @param {String} id A String representing the id 22 | */ 23 | setId(id) { 24 | if((id != null) && (!(Object.prototype.toString.call(id) == "[object String]"))) { 25 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: id EXPECTED TYPE: String", null, null); 26 | } 27 | this.id = id; 28 | this.keyModified.set("id", 1); 29 | 30 | } 31 | 32 | /** 33 | * The method to get the displayName 34 | * @returns {String} A String representing the displayName 35 | */ 36 | getDisplayName() { 37 | return this.displayName; 38 | 39 | } 40 | 41 | /** 42 | * The method to set the value to displayName 43 | * @param {String} displayName A String representing the displayName 44 | */ 45 | setDisplayName(displayName) { 46 | if((displayName != null) && (!(Object.prototype.toString.call(displayName) == "[object String]"))) { 47 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: displayName EXPECTED TYPE: String", null, null); 48 | } 49 | this.displayName = displayName; 50 | this.keyModified.set("display_name", 1); 51 | 52 | } 53 | 54 | /** 55 | * The method to get the type 56 | * @returns {String} A String representing the type 57 | */ 58 | getType() { 59 | return this.type; 60 | 61 | } 62 | 63 | /** 64 | * The method to set the value to type 65 | * @param {String} type A String representing the type 66 | */ 67 | setType(type) { 68 | if((type != null) && (!(Object.prototype.toString.call(type) == "[object String]"))) { 69 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: type EXPECTED TYPE: String", null, null); 70 | } 71 | this.type = type; 72 | this.keyModified.set("type", 1); 73 | 74 | } 75 | 76 | /** 77 | * The method to check if the user has modified the given key 78 | * @param {String} key A String representing the key 79 | * @returns {number} A number representing the modification 80 | */ 81 | isKeyModified(key) { 82 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 83 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 84 | } 85 | if(this.keyModified.has(key)) { 86 | return this.keyModified.get(key); 87 | } 88 | return null; 89 | 90 | } 91 | 92 | /** 93 | * The method to mark the given key as modified 94 | * @param {String} key A String representing the key 95 | * @param {number} modification A number representing the modification 96 | */ 97 | setKeyModified(key, modification) { 98 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 99 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 100 | } 101 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 102 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 103 | } 104 | this.keyModified.set(key, modification); 105 | 106 | } 107 | 108 | 109 | } 110 | export { 111 | MergeFields as MasterModel, 112 | MergeFields as MergeFields 113 | } 114 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/fillable_form_options.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class FillableFormOptions{ 5 | 6 | download; 7 | print; 8 | submit; 9 | keyModified = new Map(); 10 | /** 11 | * The method to get the download 12 | * @returns {Boolean} A Boolean representing the download 13 | */ 14 | getDownload() { 15 | return this.download; 16 | 17 | } 18 | 19 | /** 20 | * The method to set the value to download 21 | * @param {Boolean} download A Boolean representing the download 22 | */ 23 | setDownload(download) { 24 | if((download != null) && (!(Object.prototype.toString.call(download) == "[object Boolean]"))) { 25 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: download EXPECTED TYPE: Boolean", null, null); 26 | } 27 | this.download = download; 28 | this.keyModified.set("download", 1); 29 | 30 | } 31 | 32 | /** 33 | * The method to get the print 34 | * @returns {Boolean} A Boolean representing the print 35 | */ 36 | getPrint() { 37 | return this.print; 38 | 39 | } 40 | 41 | /** 42 | * The method to set the value to print 43 | * @param {Boolean} print A Boolean representing the print 44 | */ 45 | setPrint(print) { 46 | if((print != null) && (!(Object.prototype.toString.call(print) == "[object Boolean]"))) { 47 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: print EXPECTED TYPE: Boolean", null, null); 48 | } 49 | this.print = print; 50 | this.keyModified.set("print", 1); 51 | 52 | } 53 | 54 | /** 55 | * The method to get the submit 56 | * @returns {Boolean} A Boolean representing the submit 57 | */ 58 | getSubmit() { 59 | return this.submit; 60 | 61 | } 62 | 63 | /** 64 | * The method to set the value to submit 65 | * @param {Boolean} submit A Boolean representing the submit 66 | */ 67 | setSubmit(submit) { 68 | if((submit != null) && (!(Object.prototype.toString.call(submit) == "[object Boolean]"))) { 69 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: submit EXPECTED TYPE: Boolean", null, null); 70 | } 71 | this.submit = submit; 72 | this.keyModified.set("submit", 1); 73 | 74 | } 75 | 76 | /** 77 | * The method to check if the user has modified the given key 78 | * @param {String} key A String representing the key 79 | * @returns {number} A number representing the modification 80 | */ 81 | isKeyModified(key) { 82 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 83 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 84 | } 85 | if(this.keyModified.has(key)) { 86 | return this.keyModified.get(key); 87 | } 88 | return null; 89 | 90 | } 91 | 92 | /** 93 | * The method to mark the given key as modified 94 | * @param {String} key A String representing the key 95 | * @param {number} modification A number representing the modification 96 | */ 97 | setKeyModified(key, modification) { 98 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 99 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 100 | } 101 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 102 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 103 | } 104 | this.keyModified.set(key, modification); 105 | 106 | } 107 | 108 | 109 | } 110 | export { 111 | FillableFormOptions as MasterModel, 112 | FillableFormOptions as FillableFormOptions 113 | } 114 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/convert_presentation_parameters.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class ConvertPresentationParameters{ 6 | 7 | url; 8 | document; 9 | format; 10 | keyModified = new Map(); 11 | /** 12 | * The method to get the url 13 | * @returns {String} A String representing the url 14 | */ 15 | getUrl() { 16 | return this.url; 17 | 18 | } 19 | 20 | /** 21 | * The method to set the value to url 22 | * @param {String} url A String representing the url 23 | */ 24 | setUrl(url) { 25 | if((url != null) && (!(Object.prototype.toString.call(url) == "[object String]"))) { 26 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url EXPECTED TYPE: String", null, null); 27 | } 28 | this.url = url; 29 | this.keyModified.set("url", 1); 30 | 31 | } 32 | 33 | /** 34 | * The method to get the document 35 | * @returns {StreamWrapper} An instance of StreamWrapper 36 | */ 37 | getDocument() { 38 | return this.document; 39 | 40 | } 41 | 42 | /** 43 | * The method to set the value to document 44 | * @param {StreamWrapper} document An instance of StreamWrapper 45 | */ 46 | setDocument(document) { 47 | if((document != null) && (!(document instanceof StreamWrapper))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: document EXPECTED TYPE: StreamWrapper", null, null); 49 | } 50 | this.document = document; 51 | this.keyModified.set("document", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the format 57 | * @returns {String} A String representing the format 58 | */ 59 | getFormat() { 60 | return this.format; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to format 66 | * @param {String} format A String representing the format 67 | */ 68 | setFormat(format) { 69 | if((format != null) && (!(Object.prototype.toString.call(format) == "[object String]"))) { 70 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: format EXPECTED TYPE: String", null, null); 71 | } 72 | this.format = format; 73 | this.keyModified.set("format", 1); 74 | 75 | } 76 | 77 | /** 78 | * The method to check if the user has modified the given key 79 | * @param {String} key A String representing the key 80 | * @returns {number} A number representing the modification 81 | */ 82 | isKeyModified(key) { 83 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 84 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 85 | } 86 | if(this.keyModified.has(key)) { 87 | return this.keyModified.get(key); 88 | } 89 | return null; 90 | 91 | } 92 | 93 | /** 94 | * The method to mark the given key as modified 95 | * @param {String} key A String representing the key 96 | * @param {number} modification A number representing the modification 97 | */ 98 | setKeyModified(key, modification) { 99 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 100 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 101 | } 102 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 103 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 104 | } 105 | this.keyModified.set(key, modification); 106 | 107 | } 108 | 109 | 110 | } 111 | export { 112 | ConvertPresentationParameters as MasterModel, 113 | ConvertPresentationParameters as ConvertPresentationParameters 114 | } 115 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/session_meta.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SessionMeta{ 5 | 6 | status; 7 | info; 8 | userInfo; 9 | keyModified = new Map(); 10 | /** 11 | * The method to get the status 12 | * @returns {String} A String representing the status 13 | */ 14 | getStatus() { 15 | return this.status; 16 | 17 | } 18 | 19 | /** 20 | * The method to set the value to status 21 | * @param {String} status A String representing the status 22 | */ 23 | setStatus(status) { 24 | if((status != null) && (!(Object.prototype.toString.call(status) == "[object String]"))) { 25 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: status EXPECTED TYPE: String", null, null); 26 | } 27 | this.status = status; 28 | this.keyModified.set("status", 1); 29 | 30 | } 31 | 32 | /** 33 | * The method to get the info 34 | * @returns {SessionInfo} An instance of SessionInfo 35 | */ 36 | getInfo() { 37 | return this.info; 38 | 39 | } 40 | 41 | /** 42 | * The method to set the value to info 43 | * @param {SessionInfo} info An instance of SessionInfo 44 | */ 45 | async setInfo(info) { 46 | const SessionInfo = (await (import("./session_info.js"))).MasterModel; 47 | if((info != null) && (!(info instanceof SessionInfo))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: info EXPECTED TYPE: SessionInfo", null, null); 49 | } 50 | this.info = info; 51 | this.keyModified.set("info", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the userInfo 57 | * @returns {SessionUserInfo} An instance of SessionUserInfo 58 | */ 59 | getUserInfo() { 60 | return this.userInfo; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to userInfo 66 | * @param {SessionUserInfo} userInfo An instance of SessionUserInfo 67 | */ 68 | async setUserInfo(userInfo) { 69 | const SessionUserInfo = (await (import("./session_user_info.js"))).MasterModel; 70 | if((userInfo != null) && (!(userInfo instanceof SessionUserInfo))) { 71 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: userInfo EXPECTED TYPE: SessionUserInfo", null, null); 72 | } 73 | this.userInfo = userInfo; 74 | this.keyModified.set("user_info", 1); 75 | 76 | } 77 | 78 | /** 79 | * The method to check if the user has modified the given key 80 | * @param {String} key A String representing the key 81 | * @returns {number} A number representing the modification 82 | */ 83 | isKeyModified(key) { 84 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 85 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 86 | } 87 | if(this.keyModified.has(key)) { 88 | return this.keyModified.get(key); 89 | } 90 | return null; 91 | 92 | } 93 | 94 | /** 95 | * The method to mark the given key as modified 96 | * @param {String} key A String representing the key 97 | * @param {number} modification A number representing the modification 98 | */ 99 | setKeyModified(key, modification) { 100 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 101 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 102 | } 103 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 104 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 105 | } 106 | this.keyModified.set(key, modification); 107 | 108 | } 109 | 110 | 111 | } 112 | export { 113 | SessionMeta as MasterModel, 114 | SessionMeta as SessionMeta 115 | } 116 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/watermark_parameters.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class WatermarkParameters{ 6 | 7 | url; 8 | document; 9 | watermarkSettings; 10 | keyModified = new Map(); 11 | /** 12 | * The method to get the url 13 | * @returns {String} A String representing the url 14 | */ 15 | getUrl() { 16 | return this.url; 17 | 18 | } 19 | 20 | /** 21 | * The method to set the value to url 22 | * @param {String} url A String representing the url 23 | */ 24 | setUrl(url) { 25 | if((url != null) && (!(Object.prototype.toString.call(url) == "[object String]"))) { 26 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url EXPECTED TYPE: String", null, null); 27 | } 28 | this.url = url; 29 | this.keyModified.set("url", 1); 30 | 31 | } 32 | 33 | /** 34 | * The method to get the document 35 | * @returns {StreamWrapper} An instance of StreamWrapper 36 | */ 37 | getDocument() { 38 | return this.document; 39 | 40 | } 41 | 42 | /** 43 | * The method to set the value to document 44 | * @param {StreamWrapper} document An instance of StreamWrapper 45 | */ 46 | setDocument(document) { 47 | if((document != null) && (!(document instanceof StreamWrapper))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: document EXPECTED TYPE: StreamWrapper", null, null); 49 | } 50 | this.document = document; 51 | this.keyModified.set("document", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the watermarkSettings 57 | * @returns {WatermarkSettings} An instance of WatermarkSettings 58 | */ 59 | getWatermarkSettings() { 60 | return this.watermarkSettings; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to watermarkSettings 66 | * @param {WatermarkSettings} watermarkSettings An instance of WatermarkSettings 67 | */ 68 | async setWatermarkSettings(watermarkSettings) { 69 | const WatermarkSettings = (await (import("./watermark_settings.js"))).MasterModel; 70 | if((watermarkSettings != null) && (!(watermarkSettings instanceof WatermarkSettings))) { 71 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: watermarkSettings EXPECTED TYPE: WatermarkSettings", null, null); 72 | } 73 | this.watermarkSettings = watermarkSettings; 74 | this.keyModified.set("watermark_settings", 1); 75 | 76 | } 77 | 78 | /** 79 | * The method to check if the user has modified the given key 80 | * @param {String} key A String representing the key 81 | * @returns {number} A number representing the modification 82 | */ 83 | isKeyModified(key) { 84 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 85 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 86 | } 87 | if(this.keyModified.has(key)) { 88 | return this.keyModified.get(key); 89 | } 90 | return null; 91 | 92 | } 93 | 94 | /** 95 | * The method to mark the given key as modified 96 | * @param {String} key A String representing the key 97 | * @param {number} modification A number representing the modification 98 | */ 99 | setKeyModified(key, modification) { 100 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 101 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 102 | } 103 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 104 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 105 | } 106 | this.keyModified.set(key, modification); 107 | 108 | } 109 | 110 | 111 | } 112 | export { 113 | WatermarkParameters as MasterModel, 114 | WatermarkParameters as WatermarkParameters 115 | } 116 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_conversion_parameters.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class SheetConversionParameters{ 6 | 7 | url; 8 | document; 9 | outputOptions; 10 | keyModified = new Map(); 11 | /** 12 | * The method to get the url 13 | * @returns {String} A String representing the url 14 | */ 15 | getUrl() { 16 | return this.url; 17 | 18 | } 19 | 20 | /** 21 | * The method to set the value to url 22 | * @param {String} url A String representing the url 23 | */ 24 | setUrl(url) { 25 | if((url != null) && (!(Object.prototype.toString.call(url) == "[object String]"))) { 26 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url EXPECTED TYPE: String", null, null); 27 | } 28 | this.url = url; 29 | this.keyModified.set("url", 1); 30 | 31 | } 32 | 33 | /** 34 | * The method to get the document 35 | * @returns {StreamWrapper} An instance of StreamWrapper 36 | */ 37 | getDocument() { 38 | return this.document; 39 | 40 | } 41 | 42 | /** 43 | * The method to set the value to document 44 | * @param {StreamWrapper} document An instance of StreamWrapper 45 | */ 46 | setDocument(document) { 47 | if((document != null) && (!(document instanceof StreamWrapper))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: document EXPECTED TYPE: StreamWrapper", null, null); 49 | } 50 | this.document = document; 51 | this.keyModified.set("document", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the outputOptions 57 | * @returns {SheetConversionOutputOptions} An instance of SheetConversionOutputOptions 58 | */ 59 | getOutputOptions() { 60 | return this.outputOptions; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to outputOptions 66 | * @param {SheetConversionOutputOptions} outputOptions An instance of SheetConversionOutputOptions 67 | */ 68 | async setOutputOptions(outputOptions) { 69 | const SheetConversionOutputOptions = (await (import("./sheet_conversion_output_options.js"))).MasterModel; 70 | if((outputOptions != null) && (!(outputOptions instanceof SheetConversionOutputOptions))) { 71 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: outputOptions EXPECTED TYPE: SheetConversionOutputOptions", null, null); 72 | } 73 | this.outputOptions = outputOptions; 74 | this.keyModified.set("output_options", 1); 75 | 76 | } 77 | 78 | /** 79 | * The method to check if the user has modified the given key 80 | * @param {String} key A String representing the key 81 | * @returns {number} A number representing the modification 82 | */ 83 | isKeyModified(key) { 84 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 85 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 86 | } 87 | if(this.keyModified.has(key)) { 88 | return this.keyModified.get(key); 89 | } 90 | return null; 91 | 92 | } 93 | 94 | /** 95 | * The method to mark the given key as modified 96 | * @param {String} key A String representing the key 97 | * @param {number} modification A number representing the modification 98 | */ 99 | setKeyModified(key, modification) { 100 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 101 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 102 | } 103 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 104 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 105 | } 106 | this.keyModified.set(key, modification); 107 | 108 | } 109 | 110 | 111 | } 112 | export { 113 | SheetConversionParameters as MasterModel, 114 | SheetConversionParameters as SheetConversionParameters 115 | } 116 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/margin.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class Margin{ 5 | 6 | left; 7 | right; 8 | top; 9 | bottom; 10 | keyModified = new Map(); 11 | /** 12 | * The method to get the left 13 | * @returns {String} A String representing the left 14 | */ 15 | getLeft() { 16 | return this.left; 17 | 18 | } 19 | 20 | /** 21 | * The method to set the value to left 22 | * @param {String} left A String representing the left 23 | */ 24 | setLeft(left) { 25 | if((left != null) && (!(Object.prototype.toString.call(left) == "[object String]"))) { 26 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: left EXPECTED TYPE: String", null, null); 27 | } 28 | this.left = left; 29 | this.keyModified.set("left", 1); 30 | 31 | } 32 | 33 | /** 34 | * The method to get the right 35 | * @returns {String} A String representing the right 36 | */ 37 | getRight() { 38 | return this.right; 39 | 40 | } 41 | 42 | /** 43 | * The method to set the value to right 44 | * @param {String} right A String representing the right 45 | */ 46 | setRight(right) { 47 | if((right != null) && (!(Object.prototype.toString.call(right) == "[object String]"))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: right EXPECTED TYPE: String", null, null); 49 | } 50 | this.right = right; 51 | this.keyModified.set("right", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the top 57 | * @returns {String} A String representing the top 58 | */ 59 | getTop() { 60 | return this.top; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to top 66 | * @param {String} top A String representing the top 67 | */ 68 | setTop(top) { 69 | if((top != null) && (!(Object.prototype.toString.call(top) == "[object String]"))) { 70 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: top EXPECTED TYPE: String", null, null); 71 | } 72 | this.top = top; 73 | this.keyModified.set("top", 1); 74 | 75 | } 76 | 77 | /** 78 | * The method to get the bottom 79 | * @returns {String} A String representing the bottom 80 | */ 81 | getBottom() { 82 | return this.bottom; 83 | 84 | } 85 | 86 | /** 87 | * The method to set the value to bottom 88 | * @param {String} bottom A String representing the bottom 89 | */ 90 | setBottom(bottom) { 91 | if((bottom != null) && (!(Object.prototype.toString.call(bottom) == "[object String]"))) { 92 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: bottom EXPECTED TYPE: String", null, null); 93 | } 94 | this.bottom = bottom; 95 | this.keyModified.set("bottom", 1); 96 | 97 | } 98 | 99 | /** 100 | * The method to check if the user has modified the given key 101 | * @param {String} key A String representing the key 102 | * @returns {number} A number representing the modification 103 | */ 104 | isKeyModified(key) { 105 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 106 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 107 | } 108 | if(this.keyModified.has(key)) { 109 | return this.keyModified.get(key); 110 | } 111 | return null; 112 | 113 | } 114 | 115 | /** 116 | * The method to mark the given key as modified 117 | * @param {String} key A String representing the key 118 | * @param {number} modification A number representing the modification 119 | */ 120 | setKeyModified(key, modification) { 121 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 122 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 123 | } 124 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 125 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 126 | } 127 | this.keyModified.set(key, modification); 128 | 129 | } 130 | 131 | 132 | } 133 | export { 134 | Margin as MasterModel, 135 | Margin as Margin 136 | } 137 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/fillable_submission_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class FillableSubmissionSettings{ 5 | 6 | callbackOptions; 7 | redirectUrl; 8 | onsubmitMessage; 9 | keyModified = new Map(); 10 | /** 11 | * The method to get the callbackOptions 12 | * @returns {FillableCallbackSettings} An instance of FillableCallbackSettings 13 | */ 14 | getCallbackOptions() { 15 | return this.callbackOptions; 16 | 17 | } 18 | 19 | /** 20 | * The method to set the value to callbackOptions 21 | * @param {FillableCallbackSettings} callbackOptions An instance of FillableCallbackSettings 22 | */ 23 | async setCallbackOptions(callbackOptions) { 24 | const FillableCallbackSettings = (await (import("./fillable_callback_settings.js"))).MasterModel; 25 | if((callbackOptions != null) && (!(callbackOptions instanceof FillableCallbackSettings))) { 26 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: callbackOptions EXPECTED TYPE: FillableCallbackSettings", null, null); 27 | } 28 | this.callbackOptions = callbackOptions; 29 | this.keyModified.set("callback_options", 1); 30 | 31 | } 32 | 33 | /** 34 | * The method to get the redirectUrl 35 | * @returns {String} A String representing the redirectUrl 36 | */ 37 | getRedirectUrl() { 38 | return this.redirectUrl; 39 | 40 | } 41 | 42 | /** 43 | * The method to set the value to redirectUrl 44 | * @param {String} redirectUrl A String representing the redirectUrl 45 | */ 46 | setRedirectUrl(redirectUrl) { 47 | if((redirectUrl != null) && (!(Object.prototype.toString.call(redirectUrl) == "[object String]"))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: redirectUrl EXPECTED TYPE: String", null, null); 49 | } 50 | this.redirectUrl = redirectUrl; 51 | this.keyModified.set("redirect_url", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the onsubmitMessage 57 | * @returns {String} A String representing the onsubmitMessage 58 | */ 59 | getOnsubmitMessage() { 60 | return this.onsubmitMessage; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to onsubmitMessage 66 | * @param {String} onsubmitMessage A String representing the onsubmitMessage 67 | */ 68 | setOnsubmitMessage(onsubmitMessage) { 69 | if((onsubmitMessage != null) && (!(Object.prototype.toString.call(onsubmitMessage) == "[object String]"))) { 70 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: onsubmitMessage EXPECTED TYPE: String", null, null); 71 | } 72 | this.onsubmitMessage = onsubmitMessage; 73 | this.keyModified.set("onsubmit_message", 1); 74 | 75 | } 76 | 77 | /** 78 | * The method to check if the user has modified the given key 79 | * @param {String} key A String representing the key 80 | * @returns {number} A number representing the modification 81 | */ 82 | isKeyModified(key) { 83 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 84 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 85 | } 86 | if(this.keyModified.has(key)) { 87 | return this.keyModified.get(key); 88 | } 89 | return null; 90 | 91 | } 92 | 93 | /** 94 | * The method to mark the given key as modified 95 | * @param {String} key A String representing the key 96 | * @param {number} modification A number representing the modification 97 | */ 98 | setKeyModified(key, modification) { 99 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 100 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 101 | } 102 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 103 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 104 | } 105 | this.keyModified.set(key, modification); 106 | 107 | } 108 | 109 | 110 | } 111 | export { 112 | FillableSubmissionSettings as MasterModel, 113 | FillableSubmissionSettings as FillableSubmissionSettings 114 | } 115 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/merge_and_deliver_records_meta.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class MergeAndDeliverRecordsMeta{ 5 | 6 | downloadLink; 7 | email; 8 | name; 9 | status; 10 | keyModified = new Map(); 11 | /** 12 | * The method to get the downloadLink 13 | * @returns {String} A String representing the downloadLink 14 | */ 15 | getDownloadLink() { 16 | return this.downloadLink; 17 | 18 | } 19 | 20 | /** 21 | * The method to set the value to downloadLink 22 | * @param {String} downloadLink A String representing the downloadLink 23 | */ 24 | setDownloadLink(downloadLink) { 25 | if((downloadLink != null) && (!(Object.prototype.toString.call(downloadLink) == "[object String]"))) { 26 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: downloadLink EXPECTED TYPE: String", null, null); 27 | } 28 | this.downloadLink = downloadLink; 29 | this.keyModified.set("download_link", 1); 30 | 31 | } 32 | 33 | /** 34 | * The method to get the email 35 | * @returns {String} A String representing the email 36 | */ 37 | getEmail() { 38 | return this.email; 39 | 40 | } 41 | 42 | /** 43 | * The method to set the value to email 44 | * @param {String} email A String representing the email 45 | */ 46 | setEmail(email) { 47 | if((email != null) && (!(Object.prototype.toString.call(email) == "[object String]"))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: email EXPECTED TYPE: String", null, null); 49 | } 50 | this.email = email; 51 | this.keyModified.set("email", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the name 57 | * @returns {String} A String representing the name 58 | */ 59 | getName() { 60 | return this.name; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to name 66 | * @param {String} name A String representing the name 67 | */ 68 | setName(name) { 69 | if((name != null) && (!(Object.prototype.toString.call(name) == "[object String]"))) { 70 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: name EXPECTED TYPE: String", null, null); 71 | } 72 | this.name = name; 73 | this.keyModified.set("name", 1); 74 | 75 | } 76 | 77 | /** 78 | * The method to get the status 79 | * @returns {String} A String representing the status 80 | */ 81 | getStatus() { 82 | return this.status; 83 | 84 | } 85 | 86 | /** 87 | * The method to set the value to status 88 | * @param {String} status A String representing the status 89 | */ 90 | setStatus(status) { 91 | if((status != null) && (!(Object.prototype.toString.call(status) == "[object String]"))) { 92 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: status EXPECTED TYPE: String", null, null); 93 | } 94 | this.status = status; 95 | this.keyModified.set("status", 1); 96 | 97 | } 98 | 99 | /** 100 | * The method to check if the user has modified the given key 101 | * @param {String} key A String representing the key 102 | * @returns {number} A number representing the modification 103 | */ 104 | isKeyModified(key) { 105 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 106 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 107 | } 108 | if(this.keyModified.has(key)) { 109 | return this.keyModified.get(key); 110 | } 111 | return null; 112 | 113 | } 114 | 115 | /** 116 | * The method to mark the given key as modified 117 | * @param {String} key A String representing the key 118 | * @param {number} modification A number representing the modification 119 | */ 120 | setKeyModified(key, modification) { 121 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 122 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 123 | } 124 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 125 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 126 | } 127 | this.keyModified.set(key, modification); 128 | 129 | } 130 | 131 | 132 | } 133 | export { 134 | MergeAndDeliverRecordsMeta as MasterModel, 135 | MergeAndDeliverRecordsMeta as MergeAndDeliverRecordsMeta 136 | } 137 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/ui_options.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class UiOptions{ 5 | 6 | saveButton; 7 | chatPanel; 8 | fileMenu; 9 | darkMode; 10 | keyModified = new Map(); 11 | /** 12 | * The method to get the saveButton 13 | * @returns {String} A String representing the saveButton 14 | */ 15 | getSaveButton() { 16 | return this.saveButton; 17 | 18 | } 19 | 20 | /** 21 | * The method to set the value to saveButton 22 | * @param {String} saveButton A String representing the saveButton 23 | */ 24 | setSaveButton(saveButton) { 25 | if((saveButton != null) && (!(Object.prototype.toString.call(saveButton) == "[object String]"))) { 26 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: saveButton EXPECTED TYPE: String", null, null); 27 | } 28 | this.saveButton = saveButton; 29 | this.keyModified.set("save_button", 1); 30 | 31 | } 32 | 33 | /** 34 | * The method to get the chatPanel 35 | * @returns {String} A String representing the chatPanel 36 | */ 37 | getChatPanel() { 38 | return this.chatPanel; 39 | 40 | } 41 | 42 | /** 43 | * The method to set the value to chatPanel 44 | * @param {String} chatPanel A String representing the chatPanel 45 | */ 46 | setChatPanel(chatPanel) { 47 | if((chatPanel != null) && (!(Object.prototype.toString.call(chatPanel) == "[object String]"))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: chatPanel EXPECTED TYPE: String", null, null); 49 | } 50 | this.chatPanel = chatPanel; 51 | this.keyModified.set("chat_panel", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the fileMenu 57 | * @returns {String} A String representing the fileMenu 58 | */ 59 | getFileMenu() { 60 | return this.fileMenu; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to fileMenu 66 | * @param {String} fileMenu A String representing the fileMenu 67 | */ 68 | setFileMenu(fileMenu) { 69 | if((fileMenu != null) && (!(Object.prototype.toString.call(fileMenu) == "[object String]"))) { 70 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: fileMenu EXPECTED TYPE: String", null, null); 71 | } 72 | this.fileMenu = fileMenu; 73 | this.keyModified.set("file_menu", 1); 74 | 75 | } 76 | 77 | /** 78 | * The method to get the darkMode 79 | * @returns {String} A String representing the darkMode 80 | */ 81 | getDarkMode() { 82 | return this.darkMode; 83 | 84 | } 85 | 86 | /** 87 | * The method to set the value to darkMode 88 | * @param {String} darkMode A String representing the darkMode 89 | */ 90 | setDarkMode(darkMode) { 91 | if((darkMode != null) && (!(Object.prototype.toString.call(darkMode) == "[object String]"))) { 92 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: darkMode EXPECTED TYPE: String", null, null); 93 | } 94 | this.darkMode = darkMode; 95 | this.keyModified.set("dark_mode", 1); 96 | 97 | } 98 | 99 | /** 100 | * The method to check if the user has modified the given key 101 | * @param {String} key A String representing the key 102 | * @returns {number} A number representing the modification 103 | */ 104 | isKeyModified(key) { 105 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 106 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 107 | } 108 | if(this.keyModified.has(key)) { 109 | return this.keyModified.get(key); 110 | } 111 | return null; 112 | 113 | } 114 | 115 | /** 116 | * The method to mark the given key as modified 117 | * @param {String} key A String representing the key 118 | * @param {number} modification A number representing the modification 119 | */ 120 | setKeyModified(key, modification) { 121 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 122 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 123 | } 124 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 125 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 126 | } 127 | this.keyModified.set(key, modification); 128 | 129 | } 130 | 131 | 132 | } 133 | export { 134 | UiOptions as MasterModel, 135 | UiOptions as UiOptions 136 | } 137 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_preview_parameters.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class SheetPreviewParameters{ 6 | 7 | url; 8 | document; 9 | language; 10 | permissions; 11 | keyModified = new Map(); 12 | /** 13 | * The method to get the url 14 | * @returns {String} A String representing the url 15 | */ 16 | getUrl() { 17 | return this.url; 18 | 19 | } 20 | 21 | /** 22 | * The method to set the value to url 23 | * @param {String} url A String representing the url 24 | */ 25 | setUrl(url) { 26 | if((url != null) && (!(Object.prototype.toString.call(url) == "[object String]"))) { 27 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url EXPECTED TYPE: String", null, null); 28 | } 29 | this.url = url; 30 | this.keyModified.set("url", 1); 31 | 32 | } 33 | 34 | /** 35 | * The method to get the document 36 | * @returns {StreamWrapper} An instance of StreamWrapper 37 | */ 38 | getDocument() { 39 | return this.document; 40 | 41 | } 42 | 43 | /** 44 | * The method to set the value to document 45 | * @param {StreamWrapper} document An instance of StreamWrapper 46 | */ 47 | setDocument(document) { 48 | if((document != null) && (!(document instanceof StreamWrapper))) { 49 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: document EXPECTED TYPE: StreamWrapper", null, null); 50 | } 51 | this.document = document; 52 | this.keyModified.set("document", 1); 53 | 54 | } 55 | 56 | /** 57 | * The method to get the language 58 | * @returns {String} A String representing the language 59 | */ 60 | getLanguage() { 61 | return this.language; 62 | 63 | } 64 | 65 | /** 66 | * The method to set the value to language 67 | * @param {String} language A String representing the language 68 | */ 69 | setLanguage(language) { 70 | if((language != null) && (!(Object.prototype.toString.call(language) == "[object String]"))) { 71 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: language EXPECTED TYPE: String", null, null); 72 | } 73 | this.language = language; 74 | this.keyModified.set("language", 1); 75 | 76 | } 77 | 78 | /** 79 | * The method to get the permissions 80 | * @returns {Map} A Map representing the permissions 81 | */ 82 | getPermissions() { 83 | return this.permissions; 84 | 85 | } 86 | 87 | /** 88 | * The method to set the value to permissions 89 | * @param {Map} permissions A Map representing the permissions 90 | */ 91 | setPermissions(permissions) { 92 | if((permissions != null) && (!(Object.prototype.toString.call(permissions) == "[object Map]"))) { 93 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: permissions EXPECTED TYPE: Map", null, null); 94 | } 95 | this.permissions = permissions; 96 | this.keyModified.set("permissions", 1); 97 | 98 | } 99 | 100 | /** 101 | * The method to check if the user has modified the given key 102 | * @param {String} key A String representing the key 103 | * @returns {number} A number representing the modification 104 | */ 105 | isKeyModified(key) { 106 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 107 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 108 | } 109 | if(this.keyModified.has(key)) { 110 | return this.keyModified.get(key); 111 | } 112 | return null; 113 | 114 | } 115 | 116 | /** 117 | * The method to mark the given key as modified 118 | * @param {String} key A String representing the key 119 | * @param {number} modification A number representing the modification 120 | */ 121 | setKeyModified(key, modification) { 122 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 123 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 124 | } 125 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 126 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 127 | } 128 | this.keyModified.set(key, modification); 129 | 130 | } 131 | 132 | 133 | } 134 | export { 135 | SheetPreviewParameters as MasterModel, 136 | SheetPreviewParameters as SheetPreviewParameters 137 | } 138 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/invalid_configuration_exception.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class InvalidConfigurationException{ 5 | 6 | keyName; 7 | code; 8 | parameterName; 9 | message; 10 | keyModified = new Map(); 11 | /** 12 | * The method to get the keyName 13 | * @returns {String} A String representing the keyName 14 | */ 15 | getKeyName() { 16 | return this.keyName; 17 | 18 | } 19 | 20 | /** 21 | * The method to set the value to keyName 22 | * @param {String} keyName A String representing the keyName 23 | */ 24 | setKeyName(keyName) { 25 | if((keyName != null) && (!(Object.prototype.toString.call(keyName) == "[object String]"))) { 26 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: keyName EXPECTED TYPE: String", null, null); 27 | } 28 | this.keyName = keyName; 29 | this.keyModified.set("key_name", 1); 30 | 31 | } 32 | 33 | /** 34 | * The method to get the code 35 | * @returns {number} A number representing the code 36 | */ 37 | getCode() { 38 | return this.code; 39 | 40 | } 41 | 42 | /** 43 | * The method to set the value to code 44 | * @param {number} code A number representing the code 45 | */ 46 | setCode(code) { 47 | if((code != null) && (!(Object.prototype.toString.call(code) == "[object Number]"))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: code EXPECTED TYPE: number", null, null); 49 | } 50 | this.code = code; 51 | this.keyModified.set("code", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the parameterName 57 | * @returns {String} A String representing the parameterName 58 | */ 59 | getParameterName() { 60 | return this.parameterName; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to parameterName 66 | * @param {String} parameterName A String representing the parameterName 67 | */ 68 | setParameterName(parameterName) { 69 | if((parameterName != null) && (!(Object.prototype.toString.call(parameterName) == "[object String]"))) { 70 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: parameterName EXPECTED TYPE: String", null, null); 71 | } 72 | this.parameterName = parameterName; 73 | this.keyModified.set("parameter_name", 1); 74 | 75 | } 76 | 77 | /** 78 | * The method to get the message 79 | * @returns {String} A String representing the message 80 | */ 81 | getMessage() { 82 | return this.message; 83 | 84 | } 85 | 86 | /** 87 | * The method to set the value to message 88 | * @param {String} message A String representing the message 89 | */ 90 | setMessage(message) { 91 | if((message != null) && (!(Object.prototype.toString.call(message) == "[object String]"))) { 92 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: message EXPECTED TYPE: String", null, null); 93 | } 94 | this.message = message; 95 | this.keyModified.set("message", 1); 96 | 97 | } 98 | 99 | /** 100 | * The method to check if the user has modified the given key 101 | * @param {String} key A String representing the key 102 | * @returns {number} A number representing the modification 103 | */ 104 | isKeyModified(key) { 105 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 106 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 107 | } 108 | if(this.keyModified.has(key)) { 109 | return this.keyModified.get(key); 110 | } 111 | return null; 112 | 113 | } 114 | 115 | /** 116 | * The method to mark the given key as modified 117 | * @param {String} key A String representing the key 118 | * @param {number} modification A number representing the modification 119 | */ 120 | setKeyModified(key, modification) { 121 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 122 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 123 | } 124 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 125 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 126 | } 127 | this.keyModified.set(key, modification); 128 | 129 | } 130 | 131 | 132 | } 133 | export { 134 | InvalidConfigurationException as MasterModel, 135 | InvalidConfigurationException as InvalidConfigurationException 136 | } 137 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/presentation_preview_parameters.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class PresentationPreviewParameters{ 6 | 7 | url; 8 | document; 9 | language; 10 | documentInfo; 11 | keyModified = new Map(); 12 | /** 13 | * The method to get the url 14 | * @returns {String} A String representing the url 15 | */ 16 | getUrl() { 17 | return this.url; 18 | 19 | } 20 | 21 | /** 22 | * The method to set the value to url 23 | * @param {String} url A String representing the url 24 | */ 25 | setUrl(url) { 26 | if((url != null) && (!(Object.prototype.toString.call(url) == "[object String]"))) { 27 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url EXPECTED TYPE: String", null, null); 28 | } 29 | this.url = url; 30 | this.keyModified.set("url", 1); 31 | 32 | } 33 | 34 | /** 35 | * The method to get the document 36 | * @returns {StreamWrapper} An instance of StreamWrapper 37 | */ 38 | getDocument() { 39 | return this.document; 40 | 41 | } 42 | 43 | /** 44 | * The method to set the value to document 45 | * @param {StreamWrapper} document An instance of StreamWrapper 46 | */ 47 | setDocument(document) { 48 | if((document != null) && (!(document instanceof StreamWrapper))) { 49 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: document EXPECTED TYPE: StreamWrapper", null, null); 50 | } 51 | this.document = document; 52 | this.keyModified.set("document", 1); 53 | 54 | } 55 | 56 | /** 57 | * The method to get the language 58 | * @returns {String} A String representing the language 59 | */ 60 | getLanguage() { 61 | return this.language; 62 | 63 | } 64 | 65 | /** 66 | * The method to set the value to language 67 | * @param {String} language A String representing the language 68 | */ 69 | setLanguage(language) { 70 | if((language != null) && (!(Object.prototype.toString.call(language) == "[object String]"))) { 71 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: language EXPECTED TYPE: String", null, null); 72 | } 73 | this.language = language; 74 | this.keyModified.set("language", 1); 75 | 76 | } 77 | 78 | /** 79 | * The method to get the documentInfo 80 | * @returns {DocumentInfo} An instance of DocumentInfo 81 | */ 82 | getDocumentInfo() { 83 | return this.documentInfo; 84 | 85 | } 86 | 87 | /** 88 | * The method to set the value to documentInfo 89 | * @param {DocumentInfo} documentInfo An instance of DocumentInfo 90 | */ 91 | async setDocumentInfo(documentInfo) { 92 | const DocumentInfo = (await (import("./document_info.js"))).MasterModel; 93 | if((documentInfo != null) && (!(documentInfo instanceof DocumentInfo))) { 94 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentInfo EXPECTED TYPE: DocumentInfo", null, null); 95 | } 96 | this.documentInfo = documentInfo; 97 | this.keyModified.set("document_info", 1); 98 | 99 | } 100 | 101 | /** 102 | * The method to check if the user has modified the given key 103 | * @param {String} key A String representing the key 104 | * @returns {number} A number representing the modification 105 | */ 106 | isKeyModified(key) { 107 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 108 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 109 | } 110 | if(this.keyModified.has(key)) { 111 | return this.keyModified.get(key); 112 | } 113 | return null; 114 | 115 | } 116 | 117 | /** 118 | * The method to mark the given key as modified 119 | * @param {String} key A String representing the key 120 | * @param {number} modification A number representing the modification 121 | */ 122 | setKeyModified(key, modification) { 123 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 124 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 125 | } 126 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 127 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 128 | } 129 | this.keyModified.set(key, modification); 130 | 131 | } 132 | 133 | 134 | } 135 | export { 136 | PresentationPreviewParameters as MasterModel, 137 | PresentationPreviewParameters as PresentationPreviewParameters 138 | } 139 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/sheet_callback_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class SheetCallbackSettings{ 5 | 6 | saveFormat; 7 | saveUrl; 8 | saveUrlParams; 9 | saveUrlHeaders; 10 | keyModified = new Map(); 11 | /** 12 | * The method to get the saveFormat 13 | * @returns {String} A String representing the saveFormat 14 | */ 15 | getSaveFormat() { 16 | return this.saveFormat; 17 | 18 | } 19 | 20 | /** 21 | * The method to set the value to saveFormat 22 | * @param {String} saveFormat A String representing the saveFormat 23 | */ 24 | setSaveFormat(saveFormat) { 25 | if((saveFormat != null) && (!(Object.prototype.toString.call(saveFormat) == "[object String]"))) { 26 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: saveFormat EXPECTED TYPE: String", null, null); 27 | } 28 | this.saveFormat = saveFormat; 29 | this.keyModified.set("save_format", 1); 30 | 31 | } 32 | 33 | /** 34 | * The method to get the saveUrl 35 | * @returns {String} A String representing the saveUrl 36 | */ 37 | getSaveUrl() { 38 | return this.saveUrl; 39 | 40 | } 41 | 42 | /** 43 | * The method to set the value to saveUrl 44 | * @param {String} saveUrl A String representing the saveUrl 45 | */ 46 | setSaveUrl(saveUrl) { 47 | if((saveUrl != null) && (!(Object.prototype.toString.call(saveUrl) == "[object String]"))) { 48 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: saveUrl EXPECTED TYPE: String", null, null); 49 | } 50 | this.saveUrl = saveUrl; 51 | this.keyModified.set("save_url", 1); 52 | 53 | } 54 | 55 | /** 56 | * The method to get the saveUrlParams 57 | * @returns {Map} A Map representing the saveUrlParams 58 | */ 59 | getSaveUrlParams() { 60 | return this.saveUrlParams; 61 | 62 | } 63 | 64 | /** 65 | * The method to set the value to saveUrlParams 66 | * @param {Map} saveUrlParams A Map representing the saveUrlParams 67 | */ 68 | setSaveUrlParams(saveUrlParams) { 69 | if((saveUrlParams != null) && (!(Object.prototype.toString.call(saveUrlParams) == "[object Map]"))) { 70 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: saveUrlParams EXPECTED TYPE: Map", null, null); 71 | } 72 | this.saveUrlParams = saveUrlParams; 73 | this.keyModified.set("save_url_params", 1); 74 | 75 | } 76 | 77 | /** 78 | * The method to get the saveUrlHeaders 79 | * @returns {Map} A Map representing the saveUrlHeaders 80 | */ 81 | getSaveUrlHeaders() { 82 | return this.saveUrlHeaders; 83 | 84 | } 85 | 86 | /** 87 | * The method to set the value to saveUrlHeaders 88 | * @param {Map} saveUrlHeaders A Map representing the saveUrlHeaders 89 | */ 90 | setSaveUrlHeaders(saveUrlHeaders) { 91 | if((saveUrlHeaders != null) && (!(Object.prototype.toString.call(saveUrlHeaders) == "[object Map]"))) { 92 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: saveUrlHeaders EXPECTED TYPE: Map", null, null); 93 | } 94 | this.saveUrlHeaders = saveUrlHeaders; 95 | this.keyModified.set("save_url_headers", 1); 96 | 97 | } 98 | 99 | /** 100 | * The method to check if the user has modified the given key 101 | * @param {String} key A String representing the key 102 | * @returns {number} A number representing the modification 103 | */ 104 | isKeyModified(key) { 105 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 106 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 107 | } 108 | if(this.keyModified.has(key)) { 109 | return this.keyModified.get(key); 110 | } 111 | return null; 112 | 113 | } 114 | 115 | /** 116 | * The method to mark the given key as modified 117 | * @param {String} key A String representing the key 118 | * @param {number} modification A number representing the modification 119 | */ 120 | setKeyModified(key, modification) { 121 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 122 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 123 | } 124 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 125 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 126 | } 127 | this.keyModified.set(key, modification); 128 | 129 | } 130 | 131 | 132 | } 133 | export { 134 | SheetCallbackSettings as MasterModel, 135 | SheetCallbackSettings as SheetCallbackSettings 136 | } 137 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/preview_parameters.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class PreviewParameters{ 6 | 7 | url; 8 | document; 9 | documentInfo; 10 | permissions; 11 | keyModified = new Map(); 12 | /** 13 | * The method to get the url 14 | * @returns {String} A String representing the url 15 | */ 16 | getUrl() { 17 | return this.url; 18 | 19 | } 20 | 21 | /** 22 | * The method to set the value to url 23 | * @param {String} url A String representing the url 24 | */ 25 | setUrl(url) { 26 | if((url != null) && (!(Object.prototype.toString.call(url) == "[object String]"))) { 27 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url EXPECTED TYPE: String", null, null); 28 | } 29 | this.url = url; 30 | this.keyModified.set("url", 1); 31 | 32 | } 33 | 34 | /** 35 | * The method to get the document 36 | * @returns {StreamWrapper} An instance of StreamWrapper 37 | */ 38 | getDocument() { 39 | return this.document; 40 | 41 | } 42 | 43 | /** 44 | * The method to set the value to document 45 | * @param {StreamWrapper} document An instance of StreamWrapper 46 | */ 47 | setDocument(document) { 48 | if((document != null) && (!(document instanceof StreamWrapper))) { 49 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: document EXPECTED TYPE: StreamWrapper", null, null); 50 | } 51 | this.document = document; 52 | this.keyModified.set("document", 1); 53 | 54 | } 55 | 56 | /** 57 | * The method to get the documentInfo 58 | * @returns {PreviewDocumentInfo} An instance of PreviewDocumentInfo 59 | */ 60 | getDocumentInfo() { 61 | return this.documentInfo; 62 | 63 | } 64 | 65 | /** 66 | * The method to set the value to documentInfo 67 | * @param {PreviewDocumentInfo} documentInfo An instance of PreviewDocumentInfo 68 | */ 69 | async setDocumentInfo(documentInfo) { 70 | const PreviewDocumentInfo = (await (import("./preview_document_info.js"))).MasterModel; 71 | if((documentInfo != null) && (!(documentInfo instanceof PreviewDocumentInfo))) { 72 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentInfo EXPECTED TYPE: PreviewDocumentInfo", null, null); 73 | } 74 | this.documentInfo = documentInfo; 75 | this.keyModified.set("document_info", 1); 76 | 77 | } 78 | 79 | /** 80 | * The method to get the permissions 81 | * @returns {Map} A Map representing the permissions 82 | */ 83 | getPermissions() { 84 | return this.permissions; 85 | 86 | } 87 | 88 | /** 89 | * The method to set the value to permissions 90 | * @param {Map} permissions A Map representing the permissions 91 | */ 92 | setPermissions(permissions) { 93 | if((permissions != null) && (!(Object.prototype.toString.call(permissions) == "[object Map]"))) { 94 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: permissions EXPECTED TYPE: Map", null, null); 95 | } 96 | this.permissions = permissions; 97 | this.keyModified.set("permissions", 1); 98 | 99 | } 100 | 101 | /** 102 | * The method to check if the user has modified the given key 103 | * @param {String} key A String representing the key 104 | * @returns {number} A number representing the modification 105 | */ 106 | isKeyModified(key) { 107 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 108 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 109 | } 110 | if(this.keyModified.has(key)) { 111 | return this.keyModified.get(key); 112 | } 113 | return null; 114 | 115 | } 116 | 117 | /** 118 | * The method to mark the given key as modified 119 | * @param {String} key A String representing the key 120 | * @param {number} modification A number representing the modification 121 | */ 122 | setKeyModified(key, modification) { 123 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 124 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 125 | } 126 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 127 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 128 | } 129 | this.keyModified.set(key, modification); 130 | 131 | } 132 | 133 | 134 | } 135 | export { 136 | PreviewParameters as MasterModel, 137 | PreviewParameters as PreviewParameters 138 | } 139 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/document_conversion_parameters.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class DocumentConversionParameters{ 6 | 7 | document; 8 | url; 9 | password; 10 | outputOptions; 11 | keyModified = new Map(); 12 | /** 13 | * The method to get the document 14 | * @returns {StreamWrapper} An instance of StreamWrapper 15 | */ 16 | getDocument() { 17 | return this.document; 18 | 19 | } 20 | 21 | /** 22 | * The method to set the value to document 23 | * @param {StreamWrapper} document An instance of StreamWrapper 24 | */ 25 | setDocument(document) { 26 | if((document != null) && (!(document instanceof StreamWrapper))) { 27 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: document EXPECTED TYPE: StreamWrapper", null, null); 28 | } 29 | this.document = document; 30 | this.keyModified.set("document", 1); 31 | 32 | } 33 | 34 | /** 35 | * The method to get the url 36 | * @returns {String} A String representing the url 37 | */ 38 | getUrl() { 39 | return this.url; 40 | 41 | } 42 | 43 | /** 44 | * The method to set the value to url 45 | * @param {String} url A String representing the url 46 | */ 47 | setUrl(url) { 48 | if((url != null) && (!(Object.prototype.toString.call(url) == "[object String]"))) { 49 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url EXPECTED TYPE: String", null, null); 50 | } 51 | this.url = url; 52 | this.keyModified.set("url", 1); 53 | 54 | } 55 | 56 | /** 57 | * The method to get the password 58 | * @returns {String} A String representing the password 59 | */ 60 | getPassword() { 61 | return this.password; 62 | 63 | } 64 | 65 | /** 66 | * The method to set the value to password 67 | * @param {String} password A String representing the password 68 | */ 69 | setPassword(password) { 70 | if((password != null) && (!(Object.prototype.toString.call(password) == "[object String]"))) { 71 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: password EXPECTED TYPE: String", null, null); 72 | } 73 | this.password = password; 74 | this.keyModified.set("password", 1); 75 | 76 | } 77 | 78 | /** 79 | * The method to get the outputOptions 80 | * @returns {DocumentConversionOutputOptions} An instance of DocumentConversionOutputOptions 81 | */ 82 | getOutputOptions() { 83 | return this.outputOptions; 84 | 85 | } 86 | 87 | /** 88 | * The method to set the value to outputOptions 89 | * @param {DocumentConversionOutputOptions} outputOptions An instance of DocumentConversionOutputOptions 90 | */ 91 | async setOutputOptions(outputOptions) { 92 | const DocumentConversionOutputOptions = (await (import("./document_conversion_output_options.js"))).MasterModel; 93 | if((outputOptions != null) && (!(outputOptions instanceof DocumentConversionOutputOptions))) { 94 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: outputOptions EXPECTED TYPE: DocumentConversionOutputOptions", null, null); 95 | } 96 | this.outputOptions = outputOptions; 97 | this.keyModified.set("output_options", 1); 98 | 99 | } 100 | 101 | /** 102 | * The method to check if the user has modified the given key 103 | * @param {String} key A String representing the key 104 | * @returns {number} A number representing the modification 105 | */ 106 | isKeyModified(key) { 107 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 108 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 109 | } 110 | if(this.keyModified.has(key)) { 111 | return this.keyModified.get(key); 112 | } 113 | return null; 114 | 115 | } 116 | 117 | /** 118 | * The method to mark the given key as modified 119 | * @param {String} key A String representing the key 120 | * @param {number} modification A number representing the modification 121 | */ 122 | setKeyModified(key, modification) { 123 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 124 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 125 | } 126 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 127 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 128 | } 129 | this.keyModified.set(key, modification); 130 | 131 | } 132 | 133 | 134 | } 135 | export { 136 | DocumentConversionParameters as MasterModel, 137 | DocumentConversionParameters as DocumentConversionParameters 138 | } 139 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/import_v1.js: -------------------------------------------------------------------------------- 1 | export { SessionUserInfo } from "./session_user_info.js"; 2 | export * as WriterResponseHandler from "./writer_response_handler.js"; 3 | export { CreateDocumentResponse } from "./create_document_response.js"; 4 | export { UserInfo } from "./user_info.js"; 5 | export { SheetPreviewParameters } from "./sheet_preview_parameters.js"; 6 | export { Authentication } from "./authentication.js"; 7 | export { FillableLinkResponse } from "./fillable_link_response.js"; 8 | export { DocumentConversionParameters } from "./document_conversion_parameters.js"; 9 | export { CreateSheetParameters } from "./create_sheet_parameters.js"; 10 | export { EditorSettings } from "./editor_settings.js"; 11 | export { MailMergeWebhookSettings } from "./mail_merge_webhook_settings.js"; 12 | export { PlanDetails } from "./plan_details.js"; 13 | export { SheetEditorSettings } from "./sheet_editor_settings.js"; 14 | export { SessionMeta } from "./session_meta.js"; 15 | export { PreviewParameters } from "./preview_parameters.js"; 16 | export { SheetConversionParameters } from "./sheet_conversion_parameters.js"; 17 | export { MergeFieldsResponse } from "./merge_fields_response.js"; 18 | export { CombinePDFsOutputSettings } from "./combine_pd_fs_output_settings.js"; 19 | export { DocumentMeta } from "./document_meta.js"; 20 | export { CreatePresentationParameters } from "./create_presentation_parameters.js"; 21 | export * as ShowResponseHandler from "./show_response_handler.js"; 22 | export { FillableFormOptions } from "./fillable_form_options.js"; 23 | export { CombinePDFsParameters } from "./combine_pd_fs_parameters.js"; 24 | export { MailMergeTemplateParameters } from "./mail_merge_template_parameters.js"; 25 | export { ZohoShowEditorSettings } from "./zoho_show_editor_settings.js"; 26 | export { WatermarkParameters } from "./watermark_parameters.js"; 27 | export { FillableSubmissionSettings } from "./fillable_submission_settings.js"; 28 | export { MergeAndDeliverViaWebhookSuccessResponse } from "./merge_and_deliver_via_webhook_success_response.js"; 29 | export { DocumentConversionOutputOptions } from "./document_conversion_output_options.js"; 30 | export { WatermarkSettings } from "./watermark_settings.js"; 31 | export { MergeAndDownloadDocumentParameters } from "./merge_and_download_document_parameters.js"; 32 | export { TokenFlow } from "./token_flow.js"; 33 | export { SheetCallbackSettings } from "./sheet_callback_settings.js"; 34 | export { CallbackSettings } from "./callback_settings.js"; 35 | export { PresentationPreviewParameters } from "./presentation_preview_parameters.js"; 36 | export * as ResponseHandler from "./response_handler.js"; 37 | export { SheetUserSettings } from "./sheet_user_settings.js"; 38 | export { ConvertPresentationParameters } from "./convert_presentation_parameters.js"; 39 | export { FileDeleteSuccessResponse } from "./file_delete_success_response.js"; 40 | export { CompareDocumentResponse } from "./compare_document_response.js"; 41 | export { SessionInfo } from "./session_info.js"; 42 | export { FillableLinkOutputSettings } from "./fillable_link_output_settings.js"; 43 | export { DocumentSessionDeleteSuccessResponse } from "./document_session_delete_success_response.js"; 44 | export { DocumentDefaults } from "./document_defaults.js"; 45 | export { SheetResponseHandler1 } from "./sheet_response_handler1.js"; 46 | export { PreviewDocumentInfo } from "./preview_document_info.js"; 47 | export { FillableLinkParameters } from "./fillable_link_parameters.js"; 48 | export { DocumentDeleteSuccessResponse } from "./document_delete_success_response.js"; 49 | export { GetMergeFieldsParameters } from "./get_merge_fields_parameters.js"; 50 | export { FileBodyWrapper } from "./file_body_wrapper.js"; 51 | export { UiOptions } from "./ui_options.js"; 52 | export { SheetPreviewResponse } from "./sheet_preview_response.js"; 53 | export { SheetUiOptions } from "./sheet_ui_options.js"; 54 | export { CreateSheetResponse } from "./create_sheet_response.js"; 55 | export * as SheetResponseHandler from "./sheet_response_handler.js"; 56 | export { CompareDocumentParameters } from "./compare_document_parameters.js"; 57 | export { SheetDownloadParameters } from "./sheet_download_parameters.js"; 58 | export { SheetConversionOutputOptions } from "./sheet_conversion_output_options.js"; 59 | export { MergeAndDeliverRecordsMeta } from "./merge_and_deliver_records_meta.js"; 60 | export { V1Operations } from "./v1_operations.js"; 61 | export { CreateDocumentParameters } from "./create_document_parameters.js"; 62 | export { InvalidConfigurationException } from "./invalid_configuration_exception.js"; 63 | export { MergeAndDeliverViaWebhookParameters } from "./merge_and_deliver_via_webhook_parameters.js"; 64 | export { FillableCallbackSettings } from "./fillable_callback_settings.js"; 65 | export { PreviewResponse } from "./preview_response.js"; 66 | export { MergeFields } from "./merge_fields.js"; 67 | export { Margin } from "./margin.js"; 68 | export { DocumentInfo } from "./document_info.js"; 69 | export { SessionDeleteSuccessResponse } from "./session_delete_success_response.js"; 70 | export { AllSessionsResponse } from "./all_sessions_response.js"; 71 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/fillable_callback_settings.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class FillableCallbackSettings{ 5 | 6 | output; 7 | url; 8 | httpMethodType; 9 | retries; 10 | timeout; 11 | keyModified = new Map(); 12 | /** 13 | * The method to get the output 14 | * @returns {FillableLinkOutputSettings} An instance of FillableLinkOutputSettings 15 | */ 16 | getOutput() { 17 | return this.output; 18 | 19 | } 20 | 21 | /** 22 | * The method to set the value to output 23 | * @param {FillableLinkOutputSettings} output An instance of FillableLinkOutputSettings 24 | */ 25 | async setOutput(output) { 26 | const FillableLinkOutputSettings = (await (import("./fillable_link_output_settings.js"))).MasterModel; 27 | if((output != null) && (!(output instanceof FillableLinkOutputSettings))) { 28 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: output EXPECTED TYPE: FillableLinkOutputSettings", null, null); 29 | } 30 | this.output = output; 31 | this.keyModified.set("output", 1); 32 | 33 | } 34 | 35 | /** 36 | * The method to get the url 37 | * @returns {String} A String representing the url 38 | */ 39 | getUrl() { 40 | return this.url; 41 | 42 | } 43 | 44 | /** 45 | * The method to set the value to url 46 | * @param {String} url A String representing the url 47 | */ 48 | setUrl(url) { 49 | if((url != null) && (!(Object.prototype.toString.call(url) == "[object String]"))) { 50 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url EXPECTED TYPE: String", null, null); 51 | } 52 | this.url = url; 53 | this.keyModified.set("url", 1); 54 | 55 | } 56 | 57 | /** 58 | * The method to get the httpMethodType 59 | * @returns {String} A String representing the httpMethodType 60 | */ 61 | getHttpMethodType() { 62 | return this.httpMethodType; 63 | 64 | } 65 | 66 | /** 67 | * The method to set the value to httpMethodType 68 | * @param {String} httpMethodType A String representing the httpMethodType 69 | */ 70 | setHttpMethodType(httpMethodType) { 71 | if((httpMethodType != null) && (!(Object.prototype.toString.call(httpMethodType) == "[object String]"))) { 72 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: httpMethodType EXPECTED TYPE: String", null, null); 73 | } 74 | this.httpMethodType = httpMethodType; 75 | this.keyModified.set("http_method_type", 1); 76 | 77 | } 78 | 79 | /** 80 | * The method to get the retries 81 | * @returns {number} A number representing the retries 82 | */ 83 | getRetries() { 84 | return this.retries; 85 | 86 | } 87 | 88 | /** 89 | * The method to set the value to retries 90 | * @param {number} retries A number representing the retries 91 | */ 92 | setRetries(retries) { 93 | if((retries != null) && (!(Object.prototype.toString.call(retries) == "[object Number]"))) { 94 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: retries EXPECTED TYPE: number", null, null); 95 | } 96 | this.retries = retries; 97 | this.keyModified.set("retries", 1); 98 | 99 | } 100 | 101 | /** 102 | * The method to get the timeout 103 | * @returns {number} A number representing the timeout 104 | */ 105 | getTimeout() { 106 | return this.timeout; 107 | 108 | } 109 | 110 | /** 111 | * The method to set the value to timeout 112 | * @param {number} timeout A number representing the timeout 113 | */ 114 | setTimeout(timeout) { 115 | if((timeout != null) && (!(Object.prototype.toString.call(timeout) == "[object Number]"))) { 116 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: timeout EXPECTED TYPE: number", null, null); 117 | } 118 | this.timeout = timeout; 119 | this.keyModified.set("timeout", 1); 120 | 121 | } 122 | 123 | /** 124 | * The method to check if the user has modified the given key 125 | * @param {String} key A String representing the key 126 | * @returns {number} A number representing the modification 127 | */ 128 | isKeyModified(key) { 129 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 130 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 131 | } 132 | if(this.keyModified.has(key)) { 133 | return this.keyModified.get(key); 134 | } 135 | return null; 136 | 137 | } 138 | 139 | /** 140 | * The method to mark the given key as modified 141 | * @param {String} key A String representing the key 142 | * @param {number} modification A number representing the modification 143 | */ 144 | setKeyModified(key, modification) { 145 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 146 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 147 | } 148 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 149 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 150 | } 151 | this.keyModified.set(key, modification); 152 | 153 | } 154 | 155 | 156 | } 157 | export { 158 | FillableCallbackSettings as MasterModel, 159 | FillableCallbackSettings as FillableCallbackSettings 160 | } 161 | -------------------------------------------------------------------------------- /utils/util/downloader.js: -------------------------------------------------------------------------------- 1 | import {Converter} from "./converter.js"; 2 | import {Constants} from "./constants.js"; 3 | import {StreamWrapper} from "./stream_wrapper.js"; 4 | 5 | /** 6 | * This class is to process the download file and stream response. 7 | * @extends Converter 8 | */ 9 | class Downloader extends Converter { 10 | uniqueValuesMap = []; 11 | 12 | constructor(commonApiHandler) { 13 | super(commonApiHandler); 14 | } 15 | 16 | getWrappedRequest(response, pack) 17 | { 18 | return null; 19 | } 20 | 21 | appendToRequest(requestBase, requestObject) 22 | {} 23 | 24 | formRequest(requestObject, pack, instanceNumber, memberDetail, groupType) { 25 | return null; 26 | } 27 | 28 | async getWrappedResponse(response, contents) { 29 | 30 | const Initializer = (await import("../../routes/initializer.js")).Initializer; 31 | 32 | if (contents.length >= 1) 33 | { 34 | let pack = contents[0]; 35 | 36 | if(pack.hasOwnProperty(Constants.INTERFACE) && pack[Constants.INTERFACE]) 37 | { 38 | return [await this.getResponse(response, pack[Constants.CLASSES][0], pack[Constants.GROUP_TYPE])]; 39 | } 40 | else 41 | { 42 | let className = pack[Constants.CLASSES][0]; 43 | if (className.toString().includes(Constants.FILE_BODY_WRAPPER)) 44 | { 45 | return [await this.getResponse(response, className, null)]; 46 | } 47 | return [await this.getStreamInstance(response, className)]; 48 | } 49 | 50 | } 51 | return null; 52 | } 53 | 54 | async getResponse(response, pack, groupType) { 55 | 56 | const Initializer = (await import("../../routes/initializer.js")).Initializer; // No I18N 57 | 58 | var recordJsonDetails = Initializer.jsonDetails[pack]; 59 | var instance = null; 60 | if (recordJsonDetails.hasOwnProperty(Constants.INTERFACE) && recordJsonDetails[Constants.INTERFACE] && groupType != null) 61 | { 62 | let groupType1 = recordJsonDetails[groupType]; 63 | if(groupType1 != null) 64 | { 65 | let classes = groupType1[Constants.CLASSES]; 66 | for(let index = 0; index < classes.length; index++) 67 | { 68 | let className = classes[index]; 69 | if (className.toString().includes(Constants.FILE_BODY_WRAPPER)) 70 | { 71 | return this.getResponse(response, className, null); 72 | } 73 | } 74 | } 75 | return instance; 76 | } 77 | else { 78 | let ClassName = (await import("../../"+pack+".js")).MasterModel; 79 | instance = new ClassName(); 80 | for (let memberName in recordJsonDetails) { 81 | var memberJsonDetails = recordJsonDetails[memberName]; 82 | var type = memberJsonDetails[Constants.TYPE]; 83 | let instanceValue = null; 84 | if (type === Constants.STREAM_WRAPPER_CLASS_PATH) { 85 | var fileName = ""; 86 | let contentDisposition = (response.headers[Constants.CONTENT_DISPOSITION]).toString(); 87 | if (contentDisposition.includes("'")) { 88 | let start_index = contentDisposition.lastIndexOf("'"); 89 | fileName = contentDisposition.substring(start_index + 1); 90 | } 91 | else if (contentDisposition.includes("\"")) { 92 | let start_index = contentDisposition.lastIndexOf("="); 93 | fileName = contentDisposition.substring(start_index + 1).replace(/"/g, ""); 94 | } 95 | instanceValue = new StreamWrapper(fileName, response.rawBody, null); 96 | } 97 | Reflect.set(instance, memberName, instanceValue); 98 | } 99 | return instance; 100 | } 101 | } 102 | 103 | 104 | async getStreamInstance(response, type) 105 | { 106 | let contentDispositionHeader = (response.headers[Constants.CONTENT_DISPOSITION]).toString(); 107 | 108 | var fileName = ""; 109 | 110 | var instance = null; 111 | 112 | var instanceValue = null; 113 | 114 | var className = (await import("../../".concat(type).concat(".js"))).MasterModel; 115 | 116 | if (contentDispositionHeader.includes("'")) { 117 | let start_index = contentDispositionHeader.lastIndexOf("'"); 118 | 119 | fileName = contentDispositionHeader.substring(start_index + 1); 120 | } 121 | else if (contentDispositionHeader.includes("\"")) { 122 | let start_index = contentDispositionHeader.lastIndexOf("="); 123 | 124 | fileName = contentDispositionHeader.substring(start_index + 1).replace(/"/g, ""); 125 | } 126 | instance = new className(fileName, response.rawBody, null); 127 | 128 | return instance; 129 | 130 | } 131 | } 132 | 133 | export { 134 | Downloader as MasterModel, 135 | Downloader as Downloader 136 | } -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/document_conversion_output_options.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class DocumentConversionOutputOptions{ 5 | 6 | format; 7 | documentName; 8 | password; 9 | includeChanges; 10 | includeComments; 11 | keyModified = new Map(); 12 | /** 13 | * The method to get the format 14 | * @returns {String} A String representing the format 15 | */ 16 | getFormat() { 17 | return this.format; 18 | 19 | } 20 | 21 | /** 22 | * The method to set the value to format 23 | * @param {String} format A String representing the format 24 | */ 25 | setFormat(format) { 26 | if((format != null) && (!(Object.prototype.toString.call(format) == "[object String]"))) { 27 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: format EXPECTED TYPE: String", null, null); 28 | } 29 | this.format = format; 30 | this.keyModified.set("format", 1); 31 | 32 | } 33 | 34 | /** 35 | * The method to get the documentName 36 | * @returns {String} A String representing the documentName 37 | */ 38 | getDocumentName() { 39 | return this.documentName; 40 | 41 | } 42 | 43 | /** 44 | * The method to set the value to documentName 45 | * @param {String} documentName A String representing the documentName 46 | */ 47 | setDocumentName(documentName) { 48 | if((documentName != null) && (!(Object.prototype.toString.call(documentName) == "[object String]"))) { 49 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentName EXPECTED TYPE: String", null, null); 50 | } 51 | this.documentName = documentName; 52 | this.keyModified.set("document_name", 1); 53 | 54 | } 55 | 56 | /** 57 | * The method to get the password 58 | * @returns {String} A String representing the password 59 | */ 60 | getPassword() { 61 | return this.password; 62 | 63 | } 64 | 65 | /** 66 | * The method to set the value to password 67 | * @param {String} password A String representing the password 68 | */ 69 | setPassword(password) { 70 | if((password != null) && (!(Object.prototype.toString.call(password) == "[object String]"))) { 71 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: password EXPECTED TYPE: String", null, null); 72 | } 73 | this.password = password; 74 | this.keyModified.set("password", 1); 75 | 76 | } 77 | 78 | /** 79 | * The method to get the includeChanges 80 | * @returns {String} A String representing the includeChanges 81 | */ 82 | getIncludeChanges() { 83 | return this.includeChanges; 84 | 85 | } 86 | 87 | /** 88 | * The method to set the value to includeChanges 89 | * @param {String} includeChanges A String representing the includeChanges 90 | */ 91 | setIncludeChanges(includeChanges) { 92 | if((includeChanges != null) && (!(Object.prototype.toString.call(includeChanges) == "[object String]"))) { 93 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: includeChanges EXPECTED TYPE: String", null, null); 94 | } 95 | this.includeChanges = includeChanges; 96 | this.keyModified.set("include_changes", 1); 97 | 98 | } 99 | 100 | /** 101 | * The method to get the includeComments 102 | * @returns {String} A String representing the includeComments 103 | */ 104 | getIncludeComments() { 105 | return this.includeComments; 106 | 107 | } 108 | 109 | /** 110 | * The method to set the value to includeComments 111 | * @param {String} includeComments A String representing the includeComments 112 | */ 113 | setIncludeComments(includeComments) { 114 | if((includeComments != null) && (!(Object.prototype.toString.call(includeComments) == "[object String]"))) { 115 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: includeComments EXPECTED TYPE: String", null, null); 116 | } 117 | this.includeComments = includeComments; 118 | this.keyModified.set("include_comments", 1); 119 | 120 | } 121 | 122 | /** 123 | * The method to check if the user has modified the given key 124 | * @param {String} key A String representing the key 125 | * @returns {number} A number representing the modification 126 | */ 127 | isKeyModified(key) { 128 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 129 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 130 | } 131 | if(this.keyModified.has(key)) { 132 | return this.keyModified.get(key); 133 | } 134 | return null; 135 | 136 | } 137 | 138 | /** 139 | * The method to mark the given key as modified 140 | * @param {String} key A String representing the key 141 | * @param {number} modification A number representing the modification 142 | */ 143 | setKeyModified(key, modification) { 144 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 145 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 146 | } 147 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 148 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 149 | } 150 | this.keyModified.set(key, modification); 151 | 152 | } 153 | 154 | 155 | } 156 | export { 157 | DocumentConversionOutputOptions as MasterModel, 158 | DocumentConversionOutputOptions as DocumentConversionOutputOptions 159 | } 160 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/preview_response.js: -------------------------------------------------------------------------------- 1 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 2 | import {Constants} from "../../../../../utils/util/constants.js"; 3 | 4 | class PreviewResponse{ 5 | 6 | previewUrl; 7 | documentId; 8 | sessionId; 9 | sessionDeleteUrl; 10 | documentDeleteUrl; 11 | keyModified = new Map(); 12 | /** 13 | * The method to get the previewUrl 14 | * @returns {String} A String representing the previewUrl 15 | */ 16 | getPreviewUrl() { 17 | return this.previewUrl; 18 | 19 | } 20 | 21 | /** 22 | * The method to set the value to previewUrl 23 | * @param {String} previewUrl A String representing the previewUrl 24 | */ 25 | setPreviewUrl(previewUrl) { 26 | if((previewUrl != null) && (!(Object.prototype.toString.call(previewUrl) == "[object String]"))) { 27 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: previewUrl EXPECTED TYPE: String", null, null); 28 | } 29 | this.previewUrl = previewUrl; 30 | this.keyModified.set("preview_url", 1); 31 | 32 | } 33 | 34 | /** 35 | * The method to get the documentId 36 | * @returns {String} A String representing the documentId 37 | */ 38 | getDocumentId() { 39 | return this.documentId; 40 | 41 | } 42 | 43 | /** 44 | * The method to set the value to documentId 45 | * @param {String} documentId A String representing the documentId 46 | */ 47 | setDocumentId(documentId) { 48 | if((documentId != null) && (!(Object.prototype.toString.call(documentId) == "[object String]"))) { 49 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentId EXPECTED TYPE: String", null, null); 50 | } 51 | this.documentId = documentId; 52 | this.keyModified.set("document_id", 1); 53 | 54 | } 55 | 56 | /** 57 | * The method to get the sessionId 58 | * @returns {String} A String representing the sessionId 59 | */ 60 | getSessionId() { 61 | return this.sessionId; 62 | 63 | } 64 | 65 | /** 66 | * The method to set the value to sessionId 67 | * @param {String} sessionId A String representing the sessionId 68 | */ 69 | setSessionId(sessionId) { 70 | if((sessionId != null) && (!(Object.prototype.toString.call(sessionId) == "[object String]"))) { 71 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: sessionId EXPECTED TYPE: String", null, null); 72 | } 73 | this.sessionId = sessionId; 74 | this.keyModified.set("session_id", 1); 75 | 76 | } 77 | 78 | /** 79 | * The method to get the sessionDeleteUrl 80 | * @returns {String} A String representing the sessionDeleteUrl 81 | */ 82 | getSessionDeleteUrl() { 83 | return this.sessionDeleteUrl; 84 | 85 | } 86 | 87 | /** 88 | * The method to set the value to sessionDeleteUrl 89 | * @param {String} sessionDeleteUrl A String representing the sessionDeleteUrl 90 | */ 91 | setSessionDeleteUrl(sessionDeleteUrl) { 92 | if((sessionDeleteUrl != null) && (!(Object.prototype.toString.call(sessionDeleteUrl) == "[object String]"))) { 93 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: sessionDeleteUrl EXPECTED TYPE: String", null, null); 94 | } 95 | this.sessionDeleteUrl = sessionDeleteUrl; 96 | this.keyModified.set("session_delete_url", 1); 97 | 98 | } 99 | 100 | /** 101 | * The method to get the documentDeleteUrl 102 | * @returns {String} A String representing the documentDeleteUrl 103 | */ 104 | getDocumentDeleteUrl() { 105 | return this.documentDeleteUrl; 106 | 107 | } 108 | 109 | /** 110 | * The method to set the value to documentDeleteUrl 111 | * @param {String} documentDeleteUrl A String representing the documentDeleteUrl 112 | */ 113 | setDocumentDeleteUrl(documentDeleteUrl) { 114 | if((documentDeleteUrl != null) && (!(Object.prototype.toString.call(documentDeleteUrl) == "[object String]"))) { 115 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: documentDeleteUrl EXPECTED TYPE: String", null, null); 116 | } 117 | this.documentDeleteUrl = documentDeleteUrl; 118 | this.keyModified.set("document_delete_url", 1); 119 | 120 | } 121 | 122 | /** 123 | * The method to check if the user has modified the given key 124 | * @param {String} key A String representing the key 125 | * @returns {number} A number representing the modification 126 | */ 127 | isKeyModified(key) { 128 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 129 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 130 | } 131 | if(this.keyModified.has(key)) { 132 | return this.keyModified.get(key); 133 | } 134 | return null; 135 | 136 | } 137 | 138 | /** 139 | * The method to mark the given key as modified 140 | * @param {String} key A String representing the key 141 | * @param {number} modification A number representing the modification 142 | */ 143 | setKeyModified(key, modification) { 144 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 145 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 146 | } 147 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 148 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 149 | } 150 | this.keyModified.set(key, modification); 151 | 152 | } 153 | 154 | 155 | } 156 | export { 157 | PreviewResponse as MasterModel, 158 | PreviewResponse as PreviewResponse 159 | } 160 | -------------------------------------------------------------------------------- /core/com/zoho/officeintegrator/v1/compare_document_parameters.js: -------------------------------------------------------------------------------- 1 | import {StreamWrapper} from "../../../../../utils/util/stream_wrapper.js"; 2 | import {SDKException} from "../../../../../routes/exception/sdk_exception.js"; 3 | import {Constants} from "../../../../../utils/util/constants.js"; 4 | 5 | class CompareDocumentParameters{ 6 | 7 | document1; 8 | url1; 9 | document2; 10 | url2; 11 | title; 12 | lang; 13 | keyModified = new Map(); 14 | /** 15 | * The method to get the document1 16 | * @returns {StreamWrapper} An instance of StreamWrapper 17 | */ 18 | getDocument1() { 19 | return this.document1; 20 | 21 | } 22 | 23 | /** 24 | * The method to set the value to document1 25 | * @param {StreamWrapper} document1 An instance of StreamWrapper 26 | */ 27 | setDocument1(document1) { 28 | if((document1 != null) && (!(document1 instanceof StreamWrapper))) { 29 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: document1 EXPECTED TYPE: StreamWrapper", null, null); 30 | } 31 | this.document1 = document1; 32 | this.keyModified.set("document1", 1); 33 | 34 | } 35 | 36 | /** 37 | * The method to get the url1 38 | * @returns {String} A String representing the url1 39 | */ 40 | getUrl1() { 41 | return this.url1; 42 | 43 | } 44 | 45 | /** 46 | * The method to set the value to url1 47 | * @param {String} url1 A String representing the url1 48 | */ 49 | setUrl1(url1) { 50 | if((url1 != null) && (!(Object.prototype.toString.call(url1) == "[object String]"))) { 51 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url1 EXPECTED TYPE: String", null, null); 52 | } 53 | this.url1 = url1; 54 | this.keyModified.set("url1", 1); 55 | 56 | } 57 | 58 | /** 59 | * The method to get the document2 60 | * @returns {StreamWrapper} An instance of StreamWrapper 61 | */ 62 | getDocument2() { 63 | return this.document2; 64 | 65 | } 66 | 67 | /** 68 | * The method to set the value to document2 69 | * @param {StreamWrapper} document2 An instance of StreamWrapper 70 | */ 71 | setDocument2(document2) { 72 | if((document2 != null) && (!(document2 instanceof StreamWrapper))) { 73 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: document2 EXPECTED TYPE: StreamWrapper", null, null); 74 | } 75 | this.document2 = document2; 76 | this.keyModified.set("document2", 1); 77 | 78 | } 79 | 80 | /** 81 | * The method to get the url2 82 | * @returns {String} A String representing the url2 83 | */ 84 | getUrl2() { 85 | return this.url2; 86 | 87 | } 88 | 89 | /** 90 | * The method to set the value to url2 91 | * @param {String} url2 A String representing the url2 92 | */ 93 | setUrl2(url2) { 94 | if((url2 != null) && (!(Object.prototype.toString.call(url2) == "[object String]"))) { 95 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: url2 EXPECTED TYPE: String", null, null); 96 | } 97 | this.url2 = url2; 98 | this.keyModified.set("url2", 1); 99 | 100 | } 101 | 102 | /** 103 | * The method to get the title 104 | * @returns {String} A String representing the title 105 | */ 106 | getTitle() { 107 | return this.title; 108 | 109 | } 110 | 111 | /** 112 | * The method to set the value to title 113 | * @param {String} title A String representing the title 114 | */ 115 | setTitle(title) { 116 | if((title != null) && (!(Object.prototype.toString.call(title) == "[object String]"))) { 117 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: title EXPECTED TYPE: String", null, null); 118 | } 119 | this.title = title; 120 | this.keyModified.set("title", 1); 121 | 122 | } 123 | 124 | /** 125 | * The method to get the lang 126 | * @returns {String} A String representing the lang 127 | */ 128 | getLang() { 129 | return this.lang; 130 | 131 | } 132 | 133 | /** 134 | * The method to set the value to lang 135 | * @param {String} lang A String representing the lang 136 | */ 137 | setLang(lang) { 138 | if((lang != null) && (!(Object.prototype.toString.call(lang) == "[object String]"))) { 139 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: lang EXPECTED TYPE: String", null, null); 140 | } 141 | this.lang = lang; 142 | this.keyModified.set("lang", 1); 143 | 144 | } 145 | 146 | /** 147 | * The method to check if the user has modified the given key 148 | * @param {String} key A String representing the key 149 | * @returns {number} A number representing the modification 150 | */ 151 | isKeyModified(key) { 152 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 153 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 154 | } 155 | if(this.keyModified.has(key)) { 156 | return this.keyModified.get(key); 157 | } 158 | return null; 159 | 160 | } 161 | 162 | /** 163 | * The method to mark the given key as modified 164 | * @param {String} key A String representing the key 165 | * @param {number} modification A number representing the modification 166 | */ 167 | setKeyModified(key, modification) { 168 | if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { 169 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); 170 | } 171 | if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { 172 | throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); 173 | } 174 | this.keyModified.set(key, modification); 175 | 176 | } 177 | 178 | 179 | } 180 | export { 181 | CompareDocumentParameters as MasterModel, 182 | CompareDocumentParameters as CompareDocumentParameters 183 | } 184 | -------------------------------------------------------------------------------- /utils/util/header_param_validator.js: -------------------------------------------------------------------------------- 1 | import {Constants} from "./constants.js"; 2 | import * as path from "path"; 3 | import {DataTypeConverter} from "./datatype_converter.js"; 4 | import {JSONConverter} from "./json_converter.js"; // No I18N 5 | import {Initializer} from "../../routes/initializer.js"; 6 | import {SDKException} from "../../routes/exception/sdk_exception.js"; 7 | import * as url from "url"; // No I18N 8 | const __dirname = url.fileURLToPath(new URL(".",import.meta.url)); 9 | 10 | 11 | 12 | /** 13 | * This class validates the Header and Parameter values with the type accepted by the Zoho APIs. 14 | */ 15 | class HeaderParamValidator { 16 | 17 | jsonDetails = Initializer.jsonDetails; 18 | 19 | async validate(name, className, value) 20 | { 21 | className = await this.getFileName(className).catch(err=> {throw err;}); 22 | 23 | if (this.jsonDetails.hasOwnProperty(className)) 24 | { 25 | let classObject = this.jsonDetails[className]; 26 | for (let key in classObject) 27 | { 28 | let memberDetail = classObject[key]; 29 | 30 | let keyName = memberDetail[Constants.NAME]; 31 | 32 | if (name == keyName) 33 | { 34 | if (memberDetail.hasOwnProperty(Constants.STRUCTURE_NAME)) 35 | { 36 | if (value instanceof Array) 37 | { 38 | let jsonArray = []; 39 | 40 | let requestObjects = value; 41 | 42 | if (requestObjects.length > 0) 43 | { 44 | for (let requestObject of requestObjects) 45 | { 46 | jsonArray.push(await new JSONConverter(null).formRequest(requestObject, memberDetail[Constants.STRUCTURE_NAME], null, null, null)); 47 | } 48 | } 49 | return jsonArray.toString(); 50 | } 51 | return (await new JSONConverter(null).formRequest(value, memberDetail[Constants.STRUCTURE_NAME], null, null, null)).toString(); 52 | } 53 | return (await this.parseData(value, value.constructor.name)).toString(); 54 | } 55 | } 56 | } 57 | return DataTypeConverter.postConvert(value, value.constructor.name); 58 | } 59 | 60 | async parseData(value, type) { 61 | if(type.toLowerCase() === Constants.OBJECT_KEY.toLowerCase()) { 62 | type = Object.prototype.toString.call(value) 63 | } 64 | if (type.toLowerCase() == Constants.MAP_NAMESPACE.toLowerCase() || type.toLowerCase() == Constants.MAP_TYPE.toLowerCase()) { 65 | var jsonObject = {}; 66 | if (Array.from(value.keys()).length > 0) { 67 | for (let key of value.keys()) { 68 | let requestObject = value.get(key); 69 | jsonObject[key] = await this.parseData(requestObject, typeof requestObject).catch(err => { throw err; }); 70 | } 71 | } 72 | return jsonObject; 73 | } 74 | else if (type.toLowerCase() == Constants.LIST_NAMESPACE.toLowerCase() || type.toLowerCase() == Constants.ARRAY_TYPE.toLowerCase()) { 75 | var jsonArray = []; 76 | if (value.length > 0) { 77 | for (let requestObject of value) { 78 | jsonArray.push(await this.parseData(requestObject, typeof requestObject).catch(err => { throw err; })); 79 | } 80 | } 81 | return jsonArray; 82 | } 83 | else 84 | { 85 | return DataTypeConverter.postConvert(value, type); 86 | } 87 | } 88 | 89 | async getJSONDetails() { 90 | let Initializer = (await import("../../routes/initializer.js")).Initializer; // No I18N 91 | 92 | if (Initializer.jsonDetails == null) { 93 | Initializer.jsonDetails = await Initializer.getJSON(path.join(__dirname, "..", "..", Constants.CONFIG_DIRECTORY, Constants.JSON_DETAILS_FILE_PATH)); 94 | } 95 | 96 | return Initializer.jsonDetails; 97 | } 98 | 99 | async getFileName(name) { 100 | let spl = name.toString().split("."); 101 | let className = await this.getSplitFileName(spl.pop()); 102 | let resourceName = await this.getSplitFileName(spl.pop()); 103 | return "core/" + spl.join("/").toLowerCase() + "/" + resourceName.join("_") + "/" + className.join("_"); //No i18N 104 | } 105 | 106 | async getSplitFileName(className) { 107 | let fileName = [] 108 | let nameParts = className.split(/([A-Z][a-z]+)/).filter(function (e) { return e }); 109 | 110 | fileName.push(nameParts[0].toLowerCase()); 111 | 112 | for (let i = 1; i < nameParts.length; i++) { 113 | fileName.push(nameParts[i].toLowerCase()); 114 | } 115 | 116 | return fileName; 117 | } 118 | 119 | async getKeyJSONDetails(name, jsonDetails) { 120 | let keyArray = Array.from(Object.keys(jsonDetails)); 121 | for (let index = 0; index < keyArray.length; index++) { 122 | const key = keyArray[index]; 123 | 124 | let detail = jsonDetails[key]; 125 | 126 | if (detail.hasOwnProperty(Constants.NAME) && detail[Constants.NAME].toLowerCase() == name.toLowerCase()) { 127 | return detail; 128 | } 129 | } 130 | } 131 | } 132 | 133 | export { 134 | HeaderParamValidator as MasterModel, 135 | HeaderParamValidator as HeaderParamValidator 136 | } --------------------------------------------------------------------------------