diff --git a/.env.example b/.env.example
new file mode 100644
index 00000000..6d794978
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,15 @@
+##
+## signNow API SDK configuration
+##
+
+## Replace these dummy values with your actual credentials except API_HOST
+SIGNNOW_API_HOST=https://api.signnow.com
+SIGNNOW_API_BASIC_TOKEN=c2lnbk5vdyBBUEkgc2FtcGxlIEFwcCB2MS4wCg==
+SIGNNOW_API_USERNAME=user@signnow.com
+SIGNNOW_API_PASSWORD=coolest_pazzw0rd
+
+# Absolute or relative (starts with .) path to the directory
+# where the downloaded files will be stored (make sure you have write permissions to this directory)
+#
+# Default: ./storage/downloads
+SIGNNOW_DOWNLOADS_DIR=./storage/downloads
diff --git a/.env.test.dist b/.env.test.dist
new file mode 100644
index 00000000..b15ed96b
--- /dev/null
+++ b/.env.test.dist
@@ -0,0 +1,9 @@
+##
+## signNow API SDK configuration for tests running
+##
+SIGNNOW_API_HOST=http://0.0.0.0:8086
+SIGNNOW_API_BASIC_TOKEN=c2lnbk5vdyBBUEkgc2FtcGxlIEFwcCB2MS4wCg==
+SIGNNOW_API_USERNAME=user@signnow.com
+SIGNNOW_API_PASSWORD=coolest_pazzw0rd
+
+SIGNNOW_DOWNLOADS_DIR=./storage/downloads
diff --git a/.esdoc.json b/.esdoc.json
deleted file mode 100644
index 82569ac8..00000000
--- a/.esdoc.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- "source": "./lib",
- "excludes": [
- "webhook",
- "enumerations",
- "folder",
- "common"
- ],
- "destination": "./docs",
- "plugins": [
- {
- "name": "esdoc-standard-plugin",
- "option": {
- "lint": {
- "enable": true
- },
- "coverage": {
- "enable": true
- },
- "typeInference": {
- "enable": true
- },
- "brand": {
- "logo": "./docs/image/logo.svg",
- "title": "SignNow API client",
- "description": "SignNow REST Service Wrapper",
- "repository": "https://github.com/signnow/SignNowNodeSDK",
- "site": "https://www.signnow.com/",
- "author": "SignNow Team"
- },
- "test": {
- "source": "./test/",
- "interfaces": [
- "describe",
- "it"
- ],
- "includes": [
- "test\\.js$"
- ]
- }
- }
- },
- {
- "name": "esdoc-inject-style-plugin",
- "option": {
- "enable": true,
- "styles": [
- "./docs/css/custom.css"
- ]
- }
- },
- {
- "name": "esdoc-node"
- },
- {
- "name": "esdoc-ecmascript-proposal-plugin",
- "option": {
- "all": true
- }
- }
- ]
-}
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index d8f8d469..00000000
--- a/.eslintignore
+++ /dev/null
@@ -1 +0,0 @@
-docs
diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index 5df527e5..00000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,214 +0,0 @@
-{
- "env": {
- "commonjs": true,
- "es6": true,
- "node": true,
- "mocha": true
- },
- "extends": "eslint:recommended",
- "parserOptions": {
- "ecmaVersion": 2018
- },
- "rules": {
- "array-bracket-newline": [
- "error",
- {
- "multiline": true,
- "minItems": 2
- }
- ],
- "array-bracket-spacing": [
- "error",
- "always",
- {
- "objectsInArrays": true,
- "arraysInArrays": true,
- "singleValue": false
- }
- ],
- "array-element-newline": [
- "error",
- {
- "multiline": true,
- "minItems": 2
- }
- ],
- "arrow-parens": [
- "error",
- "as-needed"
- ],
- "block-spacing": "error",
- "callback-return": "error",
- "comma-dangle": [
- "error",
- "always-multiline"
- ],
- "computed-property-spacing": "error",
- "curly": "error",
- "default-case": "error",
- "dot-location": [
- "error",
- "property"
- ],
- "dot-notation": "error",
- "eol-last": [
- "error",
- "always"
- ],
- "eqeqeq": [
- "error",
- "always"
- ],
- "func-call-spacing": [
- "error",
- "never"
- ],
- "global-require": "error",
- "guard-for-in": "error",
- "handle-callback-err": [
- "error",
- "^(err|error)$"
- ],
- "indent": [
- "error",
- 2
- ],
- "key-spacing": [
- "error",
- {
- "beforeColon": false,
- "afterColon": true
- }
- ],
- "keyword-spacing": [
- "error", {
- "before": true,
- "after": true
- }
- ],
- "linebreak-style": [
- "error",
- "unix"
- ],
- "lines-around-comment": [
- "error",
- {
- "beforeBlockComment": true,
- "afterBlockComment": false,
- "beforeLineComment": true,
- "afterLineComment": false
- }
- ],
- "no-buffer-constructor": "error",
- "no-console": "off",
- "no-duplicate-imports": [
- "error",
- {
- "includeExports": true
- }
- ],
- "no-empty-function": "error",
- "no-eval": "error",
- "no-multi-spaces": "error",
- "no-param-reassign": "error",
- "no-shadow": "error",
- "no-template-curly-in-string": "error",
- "no-trailing-spaces": "error",
- "no-unused-expressions": [
- "error",
- {
- "allowShortCircuit": true
- }
- ],
- "no-use-before-define": [
- "error",
- {
- "functions": false
- }
- ],
- "no-useless-concat": "error",
- "no-var": "error",
- "no-whitespace-before-property": "error",
- "object-curly-newline": [
- "error",
- {
- "ObjectExpression": {
- "multiline": true,
- "minProperties": 2
- },
- "ObjectPattern": {
- "multiline": true,
- "minProperties": 3
- },
- "ImportDeclaration": {
- "multiline": true,
- "minProperties": 3
- },
- "ExportDeclaration": "never"
- }
- ],
- "object-curly-spacing": [
- "error",
- "always",
- {
- "arraysInObjects": true,
- "objectsInObjects": true
- }
- ],
- "object-property-newline": [
- "error",
- {
- "allowMultiplePropertiesPerLine": false,
- "allowAllPropertiesOnSameLine": false
- }
- ],
- "object-shorthand": [
- "error",
- "always"
- ],
- "prefer-arrow-callback": [
- "error",
- {
- "allowNamedFunctions": true,
- "allowUnboundThis": false
- }
- ],
- "prefer-const": "error",
- "prefer-destructuring": "error",
- "prefer-template": "error",
- "quote-props": [
- "error",
- "as-needed"
- ],
- "quotes": [
- "error",
- "single"
- ],
- "semi": [
- "error",
- "always"
- ],
- "semi-spacing": "error",
- "sort-imports": "error",
- "space-before-blocks": [
- "error",
- {
- "functions": "always",
- "keywords": "always",
- "classes": "always"
- }
- ],
- "space-before-function-paren": [
- "error",
- {
- "anonymous": "never",
- "named": "always",
- "asyncArrow": "always"
- }
- ],
- "spaced-comment": "error",
- "space-in-parens": "error",
- "strict": "error",
- "template-curly-spacing": "error"
- }
-}
diff --git a/.github/workflows/secure-build.yml b/.github/workflows/secure-build.yml
new file mode 100644
index 00000000..22726fcc
--- /dev/null
+++ b/.github/workflows/secure-build.yml
@@ -0,0 +1,15 @@
+name: Secure Build Workflow
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ types: [ opened, synchronize, reopened ]
+
+jobs:
+ secure-build:
+ # The stable version specified here is intentional.
+ # Please consult with the Security team before making any changes.
+ uses: pdffiller/security_checks/.github/workflows/secure-build.yml@stable
+ secrets: inherit
diff --git a/.gitignore b/.gitignore
index 3151d8f9..595a77b3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,18 +1,12 @@
-logs
-*.log
-pids
-*.pid
-*.seed
-lib-cov
-coverage
-.grunt
-build/Release
-.lock-wscript
-node_modules
-test-settings.js
-*.DS_Store
-launch.json
-.vscode
-.history
-.idea
-.npmrc
+/.idea
+/.fleet
+/.vscode
+/.netbeans
+/node_modules
+/target
+.env
+.env.backup
+.env.test
+.env.production
+.env.development
+package-lock.json
diff --git a/.huskyrc.json b/.huskyrc.json
deleted file mode 100644
index 0baac9d8..00000000
--- a/.huskyrc.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "hooks": {
- "pre-commit": "npm run lint"
- }
-}
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 4480896b..00000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,187 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
-and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-## [v1.8.2] - 2021-04-29
-
-### Fixed
-
-- Fix *freeform invite* in `document.invite`
-
-## [v1.8.1] - 2021-04-27
-
-### Changed
-
-- Updated [CHANGELOG.md](https://github.com/signnow/SignNowNodeSDK/blob/master/CHANGELOG.md)
-
-## [v1.8.0] - 2021-04-26
-
-### Added
-
-- Implemented *Create embedded signing invites for a document without sending emails.* feature. See gow to apply it in [Documentation](https://signnow.github.io/SignNowNodeSDK/class/lib/embedded/index.js~Embedded.html#static-method-createInvite), [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#embedded-create-invites), [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/embeddedCreateInvites.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/embedded-create-invites.js).
-- Implemented *Create a link for the embedded invite.* feature. See gow to apply it in [Documentation](https://signnow.github.io/SignNowNodeSDK/class/lib/embedded/index.js~Embedded.html#static-method-generateInviteLink), [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#embedded-generate-invite), [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/embeddedGenerateInviteLink.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/embedded-generate-link.js).
-- Implemented *Delete embedded invites for a document.* feature. See gow to apply it in [Documentation](https://signnow.github.io/SignNowNodeSDK/class/lib/embedded/index.js~Embedded.html#static-method-cancelInvites), [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#embedded-cancel-invites), [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/embeddedCancelInvites.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/embedded-cancel-invites.js).
-
-## [v1.7.0] - 2019-12-24
-
-### Added
-
-- Implemented *Document Signers* feature. See gow to apply it in [Documentation](https://signnow.github.io/SignNowNodeSDK/class/lib/document/index.js~Document.html#static-method-signers), [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#document-signers), [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/documentSigners.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/document-signers.js).
-- Implemented *View Template Routing Details* feature. See how to apply it in [Documentation](https://signnow.github.io/SignNowNodeSDK/class/lib/template/index.js~Template.html#static-method-getRoutingDetails), [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#routing-details), [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/getRoutingDetails.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/routing-details.js).
-- Implemented *Update Template Routing Details* feature. See how to apply it in [Documentation](https://signnow.github.io/SignNowNodeSDK/class/lib/template/index.js~Template.html#static-method-updateRoutingDetails), [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#update-routing-details), [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/updateTemplateRoutingDetails.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/update-routing-details.js).
-- Implemented *Download Document Group* feature. See how to apply it in [Documentation](https://signnow.github.io/SignNowNodeSDK/class/lib/document-group/index.js~Template.html#static-method-download), [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#download-document-group), [Full example of zipped download](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/downloadMergedDocumentGroup.js), [Full example of merged download](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/downloadZippedDocumentGroup.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/download-document-group.js).
-- Implemented *Send Verification Email* feature. See how to utilize it in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#verify-email) and [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/verify-email.js).
-- Implemented *Send Verification Email* feature. See how to apply it in [Documentation](https://signnow.github.io/SignNowNodeSDK/class/lib/template/index.js~Template.html#verify-email), [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#verify-email), [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/sendVerificationEmail.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/verify-email.js).
-- Implemented *Cancel Document Group Invite* feature. See how to apply it in [Documentation](https://signnow.github.io/SignNowNodeSDK/class/lib/document-group/index.js~DocumentGroup.html#static-method-cancelInvite), [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#cancel-document-group-invite), [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/cancelDocumentGroupInvite.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/cancel-documentgroup-invite.js).
-
-### Changed
-
-- Added optional abilities to send verification email or start 30 days free trial in *Create User* feature.
-- Added ability to set phone number into *Create User* feature.
-- Added for *View Template Routing Details* feature a [CLI Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/duplicate-template.js).
-- Added optional ability to download document archived in zip for *Download Document* feature. See how to apply it in [Short example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#download-document), [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/downloadDocumentWithAttachments.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/download-document.js).
-
-## [v1.6.0] - 2019-09-24
-
-### Added
-
-- Implemented *Cancel Free Form Invite* feature with documentation and example in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#cancel-freeform-invite)
-- Created CLI [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/cancel-freeform-invite.js) for *Cancel Free Form Invite* feature
-- Implemented *Cancel Field Invite* feature with documentation and example in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#cancel-field-invite)
-- Created CLI [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/cancel-field-invite.js) for *Cancel Field Invite* feature
-- Implemented *View Document Group Template* feature with documentation and example in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#view-documentgroup-template)
-- Created CLI [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/view-documentgroup-template.js) for *View Document Group Template* feature
-- Implemented *View Document Group* feature with documentation and example in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#view-document-group)
-- Created CLI [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/view-document-group.js) for *View Document Group* feature
-- Implemented *Create Invite to Sign Document Group Template* feature with documentation and example in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#invite-documentgroup-template)
-- Created CLI [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/invite-documentgroup-template.js) for *Create Invite to Sign Document Group Template* feature
-- Documented *Share Document* feature in [*Document*](https://signnow.github.io/SignNowNodeSDK/class/lib/document.js~Document.html) class
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/share-document.js) for testing of creation download link with *Share Document* method
-- Added *promisify* utility to common utilities with usage [example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#promisify)
-
-### Changed
-
-- `role_id` parameter in signer configurations of *Create Document Field Invite* feature made optional for easier invite creation
-- Added optional ability to download document with history in *Download Document* feature
-- Updated documentation of *Download Document* feature
-- Updated example of *Download Document* feature utilization in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#download-document)
-- Added handling of specific 404 error response from API
-- Removed validation for existing signatures and free from invites of documents intended for Document Group creation
-- Changed internal implementation of `cancelInvite` method in *Document* class to use new *Cancel Field Invite* feature under the hood
-- Updated the [example](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#cancel-field-invite) of *Cancel Field Invite* feature usage
-- Added optional ability to cancel document invites during deletion in *Remove Document* feature
-- Applied *promisify* utility to CLI applets
-- Added links to CLI applets and full examples into [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md)
-- Moved CLI applets from `samples/applets` to `bin` directory
-
-### Deprecated
-
-- `cancelInvite` method in *Document* class is about to be replaced with `cancelFieldInvite` to better fit its purpose
-
-## [v1.5.0] - 2019-08-21
-
-### Added
-
-- Implemented *Refresh Access Token* method with documentation and example in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#refresh-token)
-- Implemented *Remove Template* method with documentation and example in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#remove-template)
-- Updated documentation with *Get Document History* feature description
-- Implemented *Create Document Group Template* feature with documentation and example in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#create-document-group-template)
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-document-group-template.js) for testing creating of document group template with *Create Document Group Template* method
-- Implemented *Create Document Group Invite* feature with documentation and example in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#document-group-invite)
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/document-group-invite.js) for testing creating of document group invite with *Create Document Group Invite* method
-
-### Changed
-
-- Added validation in *Create Signing Link* method: a document must have at least one role that does not have a fixed e-mail to create an invite link
-- Added optional ability to remove original documents after merging documents in *Merge Documents* feature
-- Updated example of merging documents in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#merge-documents)
-
-## [v1.4.0] - 2019-08-08
-
-### Added
-
-- Implemented *Document Group Create* method with ability to create document group
-- Documented [*documentGroup*](https://signnow.github.io/SignNowNodeSDK/class/lib/documentGroup.js~DocumentGroup.html) methods
-- Documented [*link*](https://signnow.github.io/SignNowNodeSDK/class/lib/link.js~Link.html) methods
-- Added example of *Create Document Group* into [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#create-document-group)
-- Added example of *Create Signing Link* usage into [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#create-signing-link)
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-document-group.js) for testing creating of document group with *Create Document Group* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-signing-link.js) for testing creation of url signing link with *Create Signing Link* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/verify-access-token.js) for verifying access token with *Verify Access Token* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/user-info.js) for testing getting a detailed information about user with *Retrieve User Info* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/document-list.js) for testing getting a document list of specific user with *Retrieve User Document List* method
-
-## [v1.3.1] - 2019-08-01
-
-### Changed
-
-- Updated [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md)
-
-## [v1.3.0] - 2019-08-01
-
-### Added
-
-- Implemented *Remove Document* method
-- Added example how to utilize *Remove Document* method into [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#remove-document)
-- Implemented *Template Invite* method with ability to send field and freeform invites
-- Added examples of *Template Field Invite* and *Template Freeform Invite* into [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md#template-field-invite)
-- Documented [*template*](https://signnow.github.io/SignNowNodeSDK/class/lib/template.js~Template.html) methods
-- Extended the description of update method in [*document*](https://signnow.github.io/SignNowNodeSDK/class/lib/document.js~Document.html) module
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/extract-fields.js) for testing *Upload Document with Field Extraction* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/view-document.js) for testing *View Document* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/download-document.js) for testing *Download Document* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/remove-document.js) for testing *Remove Document* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-template.js) for testing *Create Template* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/template-field-invite.js) for testing field invite with *Template Invite* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/template-freeform-invite.js) for testing freeform invite with *Template Invite* method
-
-### Changed
-
-- Added optional ability to remove original document after template creation in *Create Template* method
-
-### Fixed
-
-- Made fix of download document bug related to encoding of binary data
-
-## [v1.2.0] - 2019-07-18
-
-### Added
-
-- Added `.odt`, `.rtf`, `.jpg`, `.jpeg`, `.gif`, `.bmp`, `.xml`, `.xls`, `.xlsx`, `.ppt`, `.pptx` to the list of acceptable file formats for document uploading
-- Generated and deployed [API Reference](https://signnow.github.io/SignNowNodeSDK/) for API Client
-- Added example of Creating Field Invite in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md)
-- Documented [*user*](https://signnow.github.io/SignNowNodeSDK/class/lib/user.js~User.html) methods
-- Documented [*oauth2*](https://signnow.github.io/SignNowNodeSDK/class/lib/oauth2.js~OAuth2.html) methods
-- Partially documented [*document*](https://signnow.github.io/SignNowNodeSDK/class/lib/document.js~Document.html) methods
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-user.js) for testing *Create User* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/get-access-token.js) for testing *Request Token* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-document.js) for testing *Create Document* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/update-document.js) for testing *Update Document* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-field-invite.js) for testing *Creation of Field Invite* with *Document Invite* method
-- Created [Applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-freeform-invite.js) for testing *Creation of Freeform Invite* with *Document Invite* method
-- Added [Change Log](https://github.com/signnow/SignNowNodeSDK/blob/master/CHANGELOG.md)
-- Added [License](https://github.com/signnow/SignNowNodeSDK/blob/master/LICENSE.md)
-- Integrated code linter ([ESLint](https://eslint.org/))
-- Integrated doc generator ([ESDoc](https://esdoc.org/))
-
-### Changed
-
-- Updated examples, links and contact information in [README](https://github.com/signnow/SignNowNodeSDK/blob/master/README.md)
-- Created and applied common request options builder
-- Created and applied common response handler builder
-- Created and applied common error handler builder
-
-### Fixed
-
-- Made fix of feature bug related to `Content-Length` header in requests
-
-[v1.7.0]: https://github.com/signnow/SignNowNodeSDK/compare/v1.6.0...v1.7.0
-[v1.6.0]: https://github.com/signnow/SignNowNodeSDK/compare/v1.5.0...v1.6.0
-[v1.5.0]: https://github.com/signnow/SignNowNodeSDK/compare/v1.4.0...v1.5.0
-[v1.4.0]: https://github.com/signnow/SignNowNodeSDK/compare/v1.3.1...v1.4.0
-[v1.3.1]: https://github.com/signnow/SignNowNodeSDK/compare/v1.3.0...v1.3.1
-[v1.3.0]: https://github.com/signnow/SignNowNodeSDK/compare/v1.2.0...v1.3.0
-[v1.2.0]: https://github.com/signnow/SignNowNodeSDK/compare/v1.1.4...v1.2.0
diff --git a/LICENSE.md b/LICENSE.md
index ca1d04e5..1b4a8031 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,6 +1,6 @@
# The MIT License
-Copyright (c) 2003-2019 airSlate Inc. [LICENSE](https://github.com/signnow/SignNowNodeSDK/blob/master/LICENSE.md)
+Copyright (c) 2003-present airSlate Inc. [LICENSE](https://github.com/signnow/SignNowNodeSDK/blob/master/LICENSE.md)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..9b65cb57
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+.PHONY: install mock-up mock-stop mock-restart tests static
+
+.SILENT: ; # no need for @
+.ONESHELL: ; # recipes execute in same shell
+.EXPORT_ALL_VARIABLES: ; # send all vars to shell
+
+SHELL := /bin/bash
+APP_DIR ?= ${PWD}
+
+install:
+ npm install
+
+test-env:
+ cp .env.test.dist .env.test
+
+# Raise WireMock docker container to mock signNow API
+mock-up:
+ . ${APP_DIR}/tests/resources/wiremock-config.env && \
+ docker run -d --rm \
+ -p $$WIREMOCK_PORT:8080 \
+ -v $$WIREMOCK_ROOT_DIR:/home/wiremock/mappings \
+ --name wiremock \
+ $$WIREMOCK_IMAGE
+
+# Stop WireMock docker container
+mock-stop:
+ docker stop wiremock
+
+# Stop/Start WireMock docker container
+mock-restart: mock-stop mock-up
+ docker ps
+
+# Run all the tests
+tests: test-env
+ npm run test
+
+#Run eslint
+static:
+ npm run eslint
diff --git a/README.md b/README.md
index bfd8c2f4..a67141a9 100644
--- a/README.md
+++ b/README.md
@@ -1,1112 +1,50 @@
-# The Official SignNow API client v1.8.2
+# signNow API NODE.JS SDK
+## v3.0.0
-SignNow Node.js REST API Wrapper
+[](https://nodejs.org/)
-[](https://github.com/signnow/SignNowNodeSDK/blob/master/LICENSE.md)
-[](#)
-[](#)
-[](https://www.npmjs.com/package/@signnow/api-client)
-[](https://twitter.com/signnow?ref_src=https%3A%2F%2Fgithub.com%2Fsignnow%2FSignNowNodeSDK)
-
-### Table of Contents
-
-1. [About SignNow](#about-signnow)
-2. [API Contact Information](#api-contact-info)
-3. [API and Application](#api-and-app)
-4. [Installation](#installation)
-5. [Documentation](#documentation)
-6. [Examples](#examples)
- * [User](#user)
- * [Create a User](#create-user)
- * [Send Verification Email](#verify-email)
- * [Retrieve User Information](#get-user)
- * [OAuth 2.0](#oauth2)
- * [Request Access Token](#get-token)
- * [Verify Access Token](#verify-token)
- * [Refresh Access Token](#refresh-token)
- * [Document](#document)
- * [Retrieve a List of the User’s Documents](#list-documents)
- * [Retrieve a Document Resource](#get-document)
- * [Download a Collapsed Document](#download-document)
- * [Upload Document](#upload-document)
- * [Upload File & Extract Fields](#extract-fields)
- * [Update Document (add fields)](#update-document)
- * [Create Invite to Sign a Document](#field-invite)
- * [Create Free Form Invite](#freeform-invite)
- * [Cancel Field Invite to Sign a Document](#cancel-field-invite)
- * [Cancel Free Form Invite](#cancel-freeform-invite)
- * [Create a One-time Use Download URL](#share-document)
- * [Merge Existing Documents](#merge-documents)
- * [Get Document History](#get-history)
- * [Remove Document](#remove-document)
- * [Links](#links)
- * [Create signing link](#create-signing-link)
- * [Enumerations](#enumerations)
- * [Add Enumeration Field to a Document](#add-enumeration)
- * [Add Enumeration Options to the Field](#enumeration-options)
- * [Template](#template)
- * [Create a Template](#create-template)
- * [Create a Document from a Template](#copy-template)
- * [Create Invite to Sign a Template](#template-field-invite)
- * [Create Free Form Invite from Template](#template-freeform-invite)
- * [Remove Template](#remove-template)
- * [View Routing Details](#routing-details)
- * [Update Routing Details](#update-routing-details)
- * [Folder](#folder)
- * [Returns a list of folders](#list-folders)
- * [Returns a list of documents inside a folder](#list-documents-in-folder)
- * [Document Group](#document-group)
- * [Create Document Group](#create-document-group)
- * [View Document Group](#view-document-group)
- * [Create Invite to Sign a Document Group](#document-group-invite)
- * [Cancel Invite to Sign a Document Group](#cancel-document-group-invite)
- * [Download Document Group](#download-document-group)
- * [Document Group Template](#document-group-template)
- * [Create Document Group Template](#create-document-group-template)
- * [View Document Group Template](#view-documentgroup-template)
- * [Create Invite to Sign a Document Group Template](#invite-documentgroup-template)
- * [Webhook](#webhook)
- * [Returns a list of Webhooks](#list-webhooks)
- * [Create a Webhook](#create-webhook)
- * [Embedded](#embedded)
- * [Create embedded signing invites for a document without sending emails](#embedded-create-invites)
- * [Create a link for the embedded invite.](#embedded-generate-invite)
- * [Delete embedded invites for a document.](#embedded-cancel-invites)
- * [Promisify methods](#promisify)
-7. [Unit Tests](#unit-tests)
-8. [License](#license)
-9. [Additional Contact Information](#contacts)
- * [Support](#support)
- * [Sales](#sales)
-
-### About SignNow
-
-[SignNow](https://www.signnow.com/) is a powerful web-based e-signature solution that streamlines the signing process and overall document flow for businesses of any size. SignNow offers SaaS as well as public and private cloud deployment options using the same underlying API. With SignNow you can easily sign, share and manage documents in compliance with international data laws and industry-specific regulations. SignNow enables you to collect signatures from partners, employees and customers from any device within minutes.
-
-### API Contact Information
-
-If you have questions about the SignNow API, please visit [https://docs.signnow.com](https://docs.signnow.com) or email [api@signnow.com](mailto:api@signnow.com).
-
-See additional contact information at the bottom.
-
-### API and Application
-
-Resources | Sandbox | Production
-------------- | ------------- | -------------
-API: | **api-eval.signnow.com:443** | **api.signnow.com:443**
-Application: | [https://app-eval.signnow.com](https://app-eval.signnow.com) | [https://app.signnow.com](https://app.signnow.com)
-Entry page: | [https://eval.signnow.com](https://eval.signnow.com) |
-
-## Installation
-
-`@signnow/api-client` supports node.js **v6.4.0** or later.
-
-To install the latest version of `@signnow/api-client` run:
+### Requirements
+- Node.js 20 or higher
+### Installation
+Get SDK code
```bash
-npm install @signnow/api-client
-```
-
-## Documentation
-
-See API reference in our [Documentation](https://signnow.github.io/SignNowNodeSDK/).
-
-## Examples
-
-To run the examples you will need an API key. You can get one here [https://www.signnow.com/api](https://www.signnow.com/api). For a full list of accepted parameters, refer to the SignNow REST Endpoints API guide: [https://docs.signnow.com](https://docs.signnow.com).
-
-Every resource is accessed via your api client instance:
-
-```javascript
-const api = require('@signnow/api-client')({
- credentials: 'ENCODED_CLIENT_CREDENTIALS',
- production: false, // if false uses eval server
-});
-```
-
-Every resource returns two parameters. The first param contains any errors and the second contains the results.
-
-### User
-
-#### Create a User
-
-By default verification email is not sent. To send it set `verifyEmail` option to `true`.
-
-```javascript
-api.user.create({
- email: 'john@domain.com',
- password: 'your password',
- first_name: 'John',
- last_name: 'Wayne',
- number: '123-456-789',
- options: { verifyEmail: true } // false by default
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/createUser.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-user.js)
-
-#### Send Verification Email
-
-```javascript
-api.user.verifyEmail({
- email: 'john@domain.com',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/sendVerificationEmail.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/verify-email.js)
-
-#### Send Verification Email
-
-```javascript
-api.user.verifyEmail({
- email: 'john@domain.com',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/sendVerificationEmail.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/verify-email.js)
-
-#### Retrieve User Information
-
-```javascript
-api.user.retrieve({
- token: 'your auth token',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/user-info.js)
-
-### OAuth 2.0
-
-#### Request Access Token
-
-```javascript
-api.oauth2.requestToken({
- username: 'username',
- password: 'password',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/requestAccessToken.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/get-access-token.js)
-
-#### Verify Access Token
-
-```javascript
-api.oauth2.verify({
- token: 'your auth token',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/verify-access-token.js)
-
-#### Refresh Access Token
-
-```javascript
-api.oauth2.refreshToken({
- refresh_token: 'your refresh token',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/refresh-token.js)
-
-### Document
-
-#### Retrieve a List of the User’s Documents
-
-```javascript
-api.document.list({
- token: 'your auth token',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/document-list.js)
-
-#### Retrieve a Document Resource
-
-```javascript
-api.document.view({
- token: 'your auth token',
- id: 'document id',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/view-document.js)
-
-#### Download a Collapsed Document
-
-By default document is downloaded without history or attachments. To download it with history set `withHistory` option to `true`. To download it with attachments set `withAttachments` option to `true`.
-
-```javascript
-api.document.download({
- token: 'your auth token',
- id: 'document id',
- options: {
- withAttachments: true, // false by default
- withHistory: true, // false by default
- },
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/downloadDocument.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/download-document.js)
-
-#### Upload Document
-
-```javascript
-api.document.create({
- token: 'your auth token',
- filepath: 'path to file',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-document.js)
-
-#### Upload File & Extract Fields
-
-```javascript
-api.document.fieldextract({
- token: 'your auth token',
- filepath: 'path to file',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/uploadDocumentWithFieldExtract.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/extract-fields.js)
-
-#### Update Document (add fields)
-
-```javascript
-const fields = {
- texts: [
- {
- size: 8,
- x: 61,
- y: 72,
- page_number: 0,
- font: 'Arial',
- data: 'sample text',
- line_height: 9.075,
- },
- ],
-}
-
-api.document.update({
- token: 'your auth token',
- id: 'document id',
- fields,
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Add signature field example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/addSignatureField.js), [Add text field example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/addTextField.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/update-document.js)
-
-#### Create Invite to Sign a Document
-
-```javascript
-const fieldInvite = {
- from: 'EMAIL_OF_SENDER',
- to: [
- {
- email: 'EMAIL_OF_SIGNER',
- role: 'Signer 1',
- order: 1,
- reassign: '0',
- decline_by_signature: '0',
- reminder: 4,
- expiration_days: 27,
- subject: 'Field invite Signer1',
- message: 'Message',
- },
- ],
-};
-
-api.document.invite({
- data: {
- ...fieldInvite,
- },
- id: 'DOCUMENT_ID_GOES_HERE',
- token: 'YOUR_AUTH_TOKEN',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Invite to sign example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/sendDocumentSignatureInviteWithOneRole.js), [Invite with payment request example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/requestPayment.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-field-invite.js)
-
-#### Create Free Form Invite
-
-```javascript
-api.document.invite({
- token: 'your auth token',
- id: 'document id',
- data: {
- from: 'email address',
- to: 'email address',
- },
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/sendDocumentFreeformInvite.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-freeform-invite.js)
-
-#### Cancel Field Invite to Sign a Document
-
-```javascript
-api.document.cancelFieldInvite({
- token: 'your auth token',
- id: 'document id',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-#### Cancel Free Form Invite
-
-```javascript
-api.document.cancelFreeFormInvite({
- token: 'your auth token',
- id: 'id of invite',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-#### Create a One-time Use Download URL
-
-```javascript
-api.document.share({
- token: 'your auth token',
- id: 'document id',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/shareDocument.js)
-
-#### Merge Existing Documents
-
-By default original documents are not removed after merging. To remove original documents set `removeOriginalDocuments` option to `true`.
-
-```javascript
-api.document.merge({
- token: 'your auth token',
- name: 'the merged doc',
- document_ids: [
- '84a18d12bf7473ea3dd0e4dd1cdcded6ba6281aa',
- 'a71d963c49f33176e90c5827069c422616b1500c',
- ],
- options: {
- removeOriginalDocuments: true, // false by default
- },
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/mergeDocuments.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/merge-documents.js)
-
-#### Get Document History
-
-```javascript
-api.document.history({
- token: 'your auth token',
- id: 'document id',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/getDocumentHistory.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/document-history.js)
-
-#### Remove Document
-
-By default document invites are not cancelled during deletion. To cancel all document invites set `cancelInvites` option to `true`.
-
-```javascript
-api.document.remove({
- token: 'your auth token',
- id: 'document id',
- options: {
- cancelInvites: true, // false by default
- },
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/remove-document.js)
-
-### Links
-
-#### Create Signing Link
-
-```javascript
-api.link.create({
- token: 'your auth token',
- document_id: 'document or template id',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/createSigningLink.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-signing-link.js)
-
-### Enumerations
-
-#### Add Enumeration Field to a Document
-
-```javascript
-api.enumerations.addField({
- token: 'your auth token',
- document_id: 'document id',
- x: 150,
- y: 200,
- width: 200,
- height: 50,
- page_number: 0,
- role: 'buyer',
- required: true,
- label: 'Clothing Brand',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-#### Add Enumeration Options to the Field
-
-```javascript
-api.enumerations.addOptions({
- token: 'your auth token',
- enumeration_options: [
- {
- enumeration_id: '8a3501896160b12d4ef7507a81b2f0998b8137b1',
- data: 'Active',
- },
- {
- enumeration_id: '8a3501896160b12d4ef7507a81b2f0998b8137b1',
- data: 'Old Navy',
- },
- {
- enumeration_id: '8a3501896160b12d4ef7507a81b2f0998b8137b1',
- data: 'Volcom',
- },
- ],
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-### Template
-
-#### Create a Template
-
-By default original document is not removed after template creation. To remove original document set `removeOriginalDocument` option to `true`.
-
-```javascript
-api.template.create({
- token: 'your auth token',
- document_id: 'document id',
- document_name: 'my template',
- options: {
- removeOriginalDocument: true, // false by default
- },
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/createTemplate.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-template.js)
-
-#### Create a Document from a Template
-
-```javascript
-api.template.duplicate({
- token: 'your auth token',
- id: 'document id',
- name: 'my template',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/createDocumentFromTemplate.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/duplicate-template.js)
-
-#### Create Invite to Sign a Template
-
-```javascript
-const fieldInvite = {
- from: 'EMAIL_OF_SENDER',
- to: [
- {
- email: 'EMAIL_OF_SIGNER',
- role: 'Signer 1',
- order: 1,
- reassign: '0',
- decline_by_signature: '0',
- reminder: 4,
- expiration_days: 27,
- subject: 'Field invite Signer1',
- message: 'Message',
- },
- ],
-};
-
-api.template.invite({
- data: {
- ...fieldInvite,
- },
- id: 'TEMPLATE_ID_GOES_HERE',
- token: 'YOUR_AUTH_TOKEN',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full one role example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/sendTemplateSignatureInviteWithOneRole%20copy.js), [Full two roles example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/sendTemplateSignatureInviteWithMultipleRole.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/template-field-invite.js)
-
-#### Create Free Form Invite from Template
-
-```javascript
-api.template.invite({
- token: 'YOUR_AUTH_TOKEN',
- id: 'TEMPLATE_ID_GOES_HERE',
- data: {
- from: 'EMAIL_OF_SENDER',
- to: 'EMAIL_OF_SIGNER',
- },
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/sendTemplateFreeformInvite.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/template-freeform-invite.js)
-
-#### Remove Template
-
-```javascript
-api.template.remove({
- token: 'your auth token',
- id: 'template id',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/remove-template.js)
-
-#### View Routing Details
-
-```javascript
-api.template.getRoutingDetails({
- token: 'your auth token',
- id: 'template id',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/getRoutingDetails.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/routing-details.js)
-
-#### Update Routing Details
-
-```javascript
-const routingDetails = {
- template_data: [
- {
- default_email: '',
- inviter_role: false,
- name: 'Signer 1',
- role_id: 'SIGNER 1 ROLE ID',
- signing_order: 1,
- decline_by_signature: true,
- },
- {
- default_email: 'signer2@mail.com',
- inviter_role: false,
- name: 'Signer 2',
- role_id: 'SIGNER 2 ROLE ID',
- signing_order: 2,
- },
- ],
- cc: [
- 'cc1@mail.com',
- 'cc2@mail.com',
- ],
- cc_step: [
- {
- email: 'cc1@mail.com',
- step: 1,
- name: 'CC 1',
- },
- {
- email: 'cc2@mail.com',
- step: 2,
- name: 'CC 2',
- },
- ],
- invite_link_instructions: 'Invite link signing instruction',
-};
-
-api.template.updateRoutingDetails({
- data: routingDetails,
- token: 'your auth token',
- id: 'template id',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/updateTemplateRoutingDetails.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/update-routing-details.js)
-
-### Folder
-
-#### Returns a list of folders
-
-```javascript
-api.folder.list({
- token: 'your auth token',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-#### Returns a list of documents inside a folder
-
-Filters | Values
-------------- | -------------
-```signing-status``` | ```waiting-for-me```, ```waiting-for-others```, ```signed```, ```pending```
-```document-updated``` | ```new Date()```
-```document-created``` | ```new Date()```
-
-Sort | Values
-------------- | -------------
-```document-name``` | ```asc```/```desc```
-```updated``` | ```asc```/```desc```
-```created``` | ```asc```/```desc```
-
-```javascript
-api.folder.documents({
- token: 'your auth token',
- id: 'folder id',
- filter: [
- {
- 'signing-status': 'pending',
- },
- ],
- sort: {
- 'document-name': 'asc',
- },
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-### Document Group
-
-#### Create Document Group
-
-```javascript
-api.documentGroup.create({
- token: 'your auth token',
- group_name: 'my document group name',
- ids: [
- // put document or template IDs here
- '84a18d12bf7473ea3dd0e4dd1cdcded6ba6281aa',
- 'a71d963c49f33176e90c5827069c422616b1500c',
- ],
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/createDocumentGroup.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-document-group.js)
-
-#### View Document Group
-
-```javascript
-api.documentGroup.view({
- token: 'Your auth token',
- id: 'Document Group ID',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/viewDocumentGroup.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/view-document-group.js)
-
-#### Create Invite to Sign a Document Group
-
-```javascript
-const data = {
- invite_steps: [
- {
- order: 1,
- invite_emails: [
- {
- email: 'Email of Signer 1',
- subject: 'Signer 1 Needs Your Signature',
- message: 'Signer 1 invited you to sign Document 1',
- expiration_days: 30,
- reminder: 0,
- },
- ],
- invite_actions: [
- {
- email: 'Email of Signer 1',
- role_name: 'Signer 1',
- action: 'sign',
- document_id: 'Document 1 ID',
- allow_reassign: '0',
- decline_by_signature: '0',
- },
- ],
- },
- {
- order: 2,
- invite_emails: [
- {
- email: 'Email of Signer 2',
- subject: 'Signer 2 Needs Your Signature',
- message: 'Signer 2 invited you to sign Document 2',
- expiration_days: 30,
- reminder: 0,
- },
- ],
- invite_actions: [
- {
- email: 'Email of Signer 2',
- role_name: 'Signer 2',
- action: 'sign',
- document_id: 'Document 2 ID',
- allow_reassign: '0',
- decline_by_signature: '0',
- },
- ],
- },
- ],
-};
-
-api.documentGroup.invite({
- token: 'your auth token',
- id: 'Document Group ID',
- data,
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/createDocumentGroupInvite.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/document-group-invite.js)
-
-#### Cancel Invite to Sign a Document Group
-
-```javascript
-api.documentGroup.cancelInvite({
- token: 'your auth token',
- id: 'Document Group ID',
- inviteId: 'Document Group invite ID'
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/cancelDocumentGroupInvite.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/cancel-documentgroup-invite.js)
-
-#### Download Document Group
-
-By default Document Group is downloaded without history as .zip archive with PDF files. To download it as a signle merged PDF set `type` to `merged`. To download document group with history set `with_history` to `after_each_document` or `after_merged_pdf`.
-
-```javascript
-api.documentGroup.download({
- token: 'your auth token',
- id: 'document group ID',
- type: 'merged', // 'zip' by default
- with_history: 'after_each_document', // 'no' by default
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Zipped Download Example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/downloadZippedDocumentGroup.js), [Merged Download Example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/downloadMergedDocumentGroup.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/download-document-group.js)
-
-### Document Group Template
-
-#### Create Document Group Template
-
-```javascript
-const routing_details = {
- invite_steps: [
- {
- order: 1,
- invite_emails: [
- {
- email: 'Email of Signer 1',
- subject: 'Signer 1 Needs Your Signature',
- message: 'Signer 1 invited you to sign Document 1',
- expiration_days: 30,
- reminder: 0,
- hasSignActions: true,
- allow_reassign: '0',
- },
- ],
- invite_actions: [
- {
- email: 'Email of Signer 1',
- role_name: 'Signer 1',
- action: 'sign',
- document_id: 'b6f4f61a5662c5c4385b02421397b76dc6d9c8af',
- document_name: 'Document 1',
- allow_reassign: '0',
- decline_by_signature: '0',
- },
- ],
- },
- {
- order: 2,
- invite_emails: [
- {
- email: 'Email of Signer 2',
- subject: 'Signer 2 Needs Your Signature',
- message: 'Signer 2 invited you to sign Document 2',
- expiration_days: 30,
- reminder: 0,
- hasSignActions: true,
- allow_reassign: '0',
- },
- ],
- invite_actions: [
- {
- email: 'Email of Signer 2',
- role_name: 'Signer 2',
- action: 'sign',
- document_id: '14f02aac643770f22a384fe4e7a6b1ed6d15a9b8',
- document_name: 'Document 2',
- allow_reassign: '0',
- decline_by_signature: '0',
- },
- ],
- },
- ],
- include_email_attachments: 0,
-};
-
-api.documentGroupTemplate.create({
- token: 'your auth token',
- template_ids: [
- '84a18d12bf7473ea3dd0e4dd1cdcded6ba6281aa',
- 'a71d963c49f33176e90c5827069c422616b1500c',
- ],
- template_group_name: 'Document group template name',
- routing_details,
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/createDocumentGroupTemplate.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/create-document-group-template.js)
-
-#### View Document Group Template
-
-```javascript
-api.documentGroupTemplate.view({
- token: 'Your auth token',
- id: 'Document Group Template ID',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/viewDocumentGroupTemplate.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/view-documentgroup-template.js)
-
-#### Create Invite to Sign a Document Group Template
-
-```javascript
-api.documentGroupTemplate.invite({
- token: 'Your auth token',
- id: 'Document Group Template ID'
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-More: [Full example](https://github.com/signnow/SignNowNodeSDK/blob/master/samples/snippets/inviteDocumentGroupTemplate.js), [CLI applet](https://github.com/signnow/SignNowNodeSDK/blob/master/bin/invite-documentgroup-template.js)
-
-### Webhook
-
-#### Returns a list of Webhooks
-
-```javascript
-signnow.webhook.list({
- token: 'your auth token',
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-#### Create a Webhook
-
-Events | Description
-------------- | -------------
-```document.create``` | Webhook is triggered when a document is uploaded to users account in SignNow
-```document.update``` | Webhook is triggered when a document is updated (fields added, text added, signature added, etc.)
-```document.delete``` | Webhook is triggered when a document is deleted from
-```invite.create``` | Webhook is triggered when an invitation to a SignNow document is created.
-```invite.update``` | Webhook is triggered when an invite to SignNow document is updated. Ex. A signer has signed the document.
-
-```javascript
-api.webhook.create({
- token: 'your auth token',
- event: 'document.create',
- callback_url: 'http://www.domain.com/path',
-}, (err, res) => {
- // handle error or process response data
-});
+git clone git@github.com:signnow/SignNowNodeSDK.git
```
-
-
-### Embedded
-
-#### Create embedded signing invites for a document without sending emails
-
-```javascript
-signnow.embedded.createInvite({
- token: 'access token',
- document_id: 'document id',
- invites: [
- {
- email: 'email of signer',
- role_id: 'role id',
- order: 1,
- auth_method: 'password',
- },
- ],
-}, (err, res) => {
- // handle error or process response data
-});
-```
-
-#### Creates a link for the embedded invite.
-
-```javascript
-signnow.embedded.generateInviteLink({
- token: 'access token',
- document_id: 'document id',
- field_invite_unique_id: 'field invite unique id',
- link_expiration: 15,
- auth_method: 'password',
-}, (err, res) => {
- // handle error or process response data
-});
+Install dependencies
+```bash
+npm install
```
-#### Deletes embedded invites for a document.
-
-```javascript
-signnow.embedded.cancelInvites({
- token: 'access token',
- document_id: 'document id',
-}, (err, res) => {
- // handle error or process response data
-});
+### Configuration
+Copy `.env.example` to `.env` and fill your credentials in the required values
+```bash
+cp .env.example .env
```
-### Promisify methods
-
-If you are using node.js version **8.0.0** or higher you can use built in [*promisify*](https://nodejs.org/api/util.html#util_util_promisify_original) utility:
-
-```javascript
-const { promisify } = require('util');
-const api = require('@signnow/api-client')({
- credentials: 'ENCODED_CLIENT_CREDENTIALS',
- production: false, // if false uses eval server
-});
-const requestToken = promisify(api.oauth2.requestToken);
-
-requestToken({
- username: 'username',
- password: 'password',
-})
- .then(res => {
- // process response data
- })
- .catch(err => {
- // handle error
- });
+### Run tests
+To run tests you need to have a valid `.env.test` file with credentials for testing.
+If you don't have it, you can create it by copying the `.env.test.dist` file and renaming it to `.env.test`.
+However, the file will be created automatically if you just run test execution with the following commands:
+```bash
+npm run test
```
-If you are using node.js version prior to **8.0.0** you can use our own simple *promisify* utility:
-
-```javascript
-const { promisify } = require('@signnow/api-client/utils');
-const api = require('@signnow/api-client')({
- credentials: 'ENCODED_CLIENT_CREDENTIALS',
- production: false, // if false uses eval server
-});
-const requestToken = promisify(api.oauth2.requestToken);
-
-requestToken({
- username: 'username',
- password: 'password',
-})
- .then(res => {
- // process response data
- })
- .catch(err => {
- // handle error
- });
-```
+### Usage
+To start using the SDK, you need to create a new instance of the SDK API client and authenticate it using the credentials from the `.env` file.
+Example of sending a request to get a document by id:
+```typescript
-## Unit Tests
+import { Sdk, DocumentGet } from '@signnow/api-sdk';
+import type { Document } from '@signnow/api-sdk';
-To run the unit test you will need to install "Mocha" and "Chai". You also need to edit a [test.settings.js](https://github.com/signnow/SignNowNodeSDK/blob/master/test/test.settings.js) in the [test](https://github.com/signnow/SignNowNodeSDK/tree/master/test) folder of the api client module. The file need to contain the following:
+const sdk = await new Sdk().authenticate();
+const client = sdk.getClient();
-```javascript
-exports.settings = {
- credentials: '[ENCODED CLIENT CREDENTIALS]',
- token: '[ACCESS TOKEN]',
- username: '[SIGNNOW USERNAME]',
- password: '[SIGNNOW PASSWORD]',
- documentid: '[EXISTING DOCUMENT ID]',
- templateid: '[EXISTING TEMPLATE ID]',
- folderid: '[EXISTING FOLDER ID]',
- email: '[FROM EMAIL FOR INVITE]',
- testemail: '[TO EMAIL FOR INVITE]',
-};
+const documentGet = new DocumentGet('29db9956636d481f9c532ef64951ae78209f7483');
+const responseDocumentGet = await client.send(documentGet);
+console.log('response document get', responseDocumentGet);
```
-## License
-
-This project is released under the MIT [License](https://github.com/signnow/SignNowNodeSDK/blob/master/LICENSE.md).
-
-## Additional Contact Information
-
-### Support
-
-To contact SignNow support, please email [support@signnow.com](mailto:support@signnow.com) or [api@signnow.com](mailto:api@signnow.com).
-
-### Sales
-
-For pricing information, please call [(800) 831-2050](tel:8008312050), email [sales@signnow.com](mailto:sales@signnow.com) or visit [https://www.signnow.com/contact](https://www.signnow.com/contact).
+### Examples
+You can find more examples of API usage in the [`examples`](./examples) directory.
\ No newline at end of file
diff --git a/bin/bulk-invite.js b/bin/bulk-invite.js
deleted file mode 100755
index 3360dc83..00000000
--- a/bin/bulk-invite.js
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run bulk-invite applet from the project root folder type in your console:
- * > node bin/bulk-invite
- * , , , , , , - are required params
- * - path to .csv file with roles and their emails. Max file size should be <= 1 Megabyte
- * - an ID of folder where signed documents will be saved
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- templateId,
- csvFile,
- folderId,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- template: { bulkInvite: sendBulkInvite },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const sendBulkInvite$ = promisify(sendBulkInvite);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => sendBulkInvite$({
- data: {
- file: csvFile,
- folder_id: folderId,
- },
- id: templateId,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/cancel-documentgroup-invite.js b/bin/cancel-documentgroup-invite.js
deleted file mode 100644
index c289185d..00000000
--- a/bin/cancel-documentgroup-invite.js
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run cancel-documentgroup-invite applet from the project root folder type in your console:
- * > node bin/cancel-documentgroup-invite
- * , , , , , - are required params
- */
-
-'use strict';
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentGroupId,
- inviteId,
-] = process.argv.slice(2);
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: false,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- documentGroup: { cancelInvite: cancelDocumentGroupInvite },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const cancelDocumentGroupInvite$ = promisify(cancelDocumentGroupInvite);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => cancelDocumentGroupInvite$({
- id: documentGroupId,
- inviteId,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/cancel-field-invite.js b/bin/cancel-field-invite.js
deleted file mode 100755
index 200612a6..00000000
--- a/bin/cancel-field-invite.js
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run cancel-field-invite applet from the project root folder type in your console:
- * > node bin/cancel-field-invite
- * - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentId,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- document: { cancelFieldInvite: cancelDocumentFieldInvite },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const cancelDocumentFieldInvite$ = promisify(cancelDocumentFieldInvite);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => cancelDocumentFieldInvite$({
- id: documentId,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/cancel-freeform-invite.js b/bin/cancel-freeform-invite.js
deleted file mode 100755
index 9d668775..00000000
--- a/bin/cancel-freeform-invite.js
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run cancel-freeform-invite applet from the project root folder type in your console:
- * > node bin/cancel-freeform-invite
- * , , , , - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- inviteId,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- document: { cancelFreeFormInvite: cancelDocumentFreeFormInvite },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const cancelDocumentFreeFormInvite$ = promisify(cancelDocumentFreeFormInvite);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => cancelDocumentFreeFormInvite$({
- id: inviteId,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/create-document-group-template.js b/bin/create-document-group-template.js
deleted file mode 100755
index 8626866a..00000000
--- a/bin/create-document-group-template.js
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run create-document-group-template applet from the project root folder type in your console:
- * > node bin/create-document-group-template <...template_ids>
- * <...template_ids> - are required params
- * <...template_ids> - ID(s) of one or more templates
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- template_group_name,
- ...templateIDsWithRoutingDetails
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- documentGroupTemplate: { create: createDocumentGroupTemplate },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const createDocumentGroupTemplate$ = promisify(createDocumentGroupTemplate);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => {
- const template_ids = templateIDsWithRoutingDetails.slice(0, -1);
- const routingDetailsStringified = templateIDsWithRoutingDetails.slice(-1);
- const routing_details = JSON.parse(routingDetailsStringified);
-
- return {
- token,
- template_ids,
- routing_details,
- };
- })
- .then(({
- token,
- template_ids,
- routing_details,
- }) => createDocumentGroupTemplate$({
- token,
- template_ids,
- template_group_name,
- routing_details,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/create-document-group.js b/bin/create-document-group.js
deleted file mode 100755
index b5117f41..00000000
--- a/bin/create-document-group.js
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run create-document-group applet from the project root folder type in your console:
- * > node bin/create-document-group <...document_ids>
- * , , , , , <...document_ids> - are required params
- * <...document_ids> - ID(s) of one or more documents
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- group_name,
- ...ids
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- documentGroup: { create: createDocumentGroup },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const createDocumentGroup$ = promisify(createDocumentGroup);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => createDocumentGroup$({
- token,
- ids,
- group_name,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/create-document.js b/bin/create-document.js
deleted file mode 100755
index 46a384a9..00000000
--- a/bin/create-document.js
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run create-document applet from the project root folder type in your console:
- * > node bin/create-document
- * , , , - are required params
- * - is optional param. If empty will be used default value './samples/files/pdf-sample.pdf'
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- filepath = './samples/files/pdf-sample.pdf',
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- document: { create: uploadDocument },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const uploadDocument$ = promisify(uploadDocument);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => uploadDocument$({
- filepath,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/create-field-invite.js b/bin/create-field-invite.js
deleted file mode 100755
index e199eb5b..00000000
--- a/bin/create-field-invite.js
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run create-field-invite applet from the project root folder type in your console:
- * > node bin/create-field-invite ''
- * , , , , , - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentId,
- signersStringified,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- document: { invite: sendFieldInvite },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const sendFieldInvite$ = promisify(sendFieldInvite);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => {
- const signers = JSON.parse(signersStringified);
-
- return {
- token,
- signers,
- };
- })
- .then(({ token, signers }) => sendFieldInvite$({
- data: {
- from: username,
- to: signers,
- },
- id: documentId,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/create-freeform-invite.js b/bin/create-freeform-invite.js
deleted file mode 100755
index 13ba7069..00000000
--- a/bin/create-freeform-invite.js
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run create-freeform-invite applet from the project root folder type in your console:
- * > node bin/create-freeform-invite
- * , , , , , - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentId,
- signer,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- document: { invite: sendFreeformInvite },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const sendFreeformInvite$ = promisify(sendFreeformInvite);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => sendFreeformInvite$({
- data: {
- from: username,
- to: signer,
- },
- id: documentId,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/create-signing-link.js b/bin/create-signing-link.js
deleted file mode 100755
index ccffaf6d..00000000
--- a/bin/create-signing-link.js
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run create-signing-link applet from the project root folder type in your console:
- * > node bin/create-signing-link
- * , , , , - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- document_id,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- link: { create: createSigningLink },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const createSigningLink$ = promisify(createSigningLink);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => createSigningLink$({
- document_id,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/create-template.js b/bin/create-template.js
deleted file mode 100755
index c6d20c82..00000000
--- a/bin/create-template.js
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run create-template applet from the project root folder type in your console:
- * > node bin/create-template
- * - are required params
- * options:
- * --delete-original - original document will be removed after template creation
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentId,
- templateName,
-] = params;
-
-const removeOriginalDocument = flags.includes('--delete-original');
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- template: { create: createTemplate },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const createTemplate$ = promisify(createTemplate);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => createTemplate$({
- document_id: documentId,
- document_name: templateName,
- options: { removeOriginalDocument },
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/create-user.js b/bin/create-user.js
deleted file mode 100755
index 40f7b7f1..00000000
--- a/bin/create-user.js
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run create-user applet from the project root folder type in your console:
- * > node bin/create-user
- * , , , - are required params
- * , , - are optional
- * options:
- * --verify-email - send verification email
- * --start-trial - start 30 day free trial. Defaults to expired subscription
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- email,
- password,
- first_name,
- last_name,
- number,
-] = params;
-
-const verifyEmail = flags.includes('--verify-email');
-const startTrial = flags.includes('--start-trial');
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const { user: { create: createUser } } = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const createUser$ = promisify(createUser);
-
-createUser$({
- email,
- password,
- first_name,
- last_name,
- number,
- options: {
- verifyEmail,
- startTrial,
- },
-})
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/document-group-invite.js b/bin/document-group-invite.js
deleted file mode 100755
index 5ac88a84..00000000
--- a/bin/document-group-invite.js
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run document-group-invite applet from the project root folder type in your console:
- * > node bin/document-group-invite ''
- * - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentGroupId,
- inviteConfigStringified,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- documentGroup: { invite: createDocumentGroupInvite },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const createDocumentGroupInvite$ = promisify(createDocumentGroupInvite);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => {
- const inviteConfig = JSON.parse(inviteConfigStringified);
-
- return {
- token,
- inviteConfig,
- };
- })
- .then(({ token, inviteConfig }) => createDocumentGroupInvite$({
- id: documentGroupId,
- data: inviteConfig,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/document-history.js b/bin/document-history.js
deleted file mode 100755
index ac705b77..00000000
--- a/bin/document-history.js
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run document-history applet from the project root folder type in your console:
- * > node bin/document-history
- * , , , , - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentId,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- document: { history: getDocumentHistory },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const getDocumentHistory$ = promisify(getDocumentHistory);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => getDocumentHistory$({
- id: documentId,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/document-list.js b/bin/document-list.js
deleted file mode 100755
index 3c753a55..00000000
--- a/bin/document-list.js
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run document-list applet from the project root folder type in your console:
- * > node bin/document-list
- * , , , - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- document: { list: getUserDocumentList },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const getUserDocumentList$ = promisify(getUserDocumentList);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => getUserDocumentList$({ token }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/document-signers.js b/bin/document-signers.js
deleted file mode 100644
index 18ca0e90..00000000
--- a/bin/document-signers.js
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env node
-
-/*
- * to run document-signers applet from the project root folder type in your console:
- * > node bin/document-signers
- * , , , , - are required params
- * options:
- * --freeform-invites - will return a list of all freeform invite signers
- * --field-invite-status (the same as --field-invite-status=all) - will return a list of all field invite signers
- * --field-invite-status=pending,declined,fulfilled,created,skipped - will return a list of field invite signers by invite status(es). choose one(s) that you need
- * --payment-request-status (the same as --payment-request-status=all) - will return a list of all signers that payment requests are made for
- * --payment-request-status=created,pending,skipped,fulfilled - will return a list of signers that payment requests are made for by payment request status(es). choose one(s) that you need
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const freeForm = 'freeFormInvites';
-const fieldStatus = 'fieldInviteStatus';
-const payment = 'paymentRequestStatus';
-const allExceptFirst = arr => arr.slice(1).join('').split(',');
-
-const options = flags
- .map(flag => flag.split('=').filter(val => val !== ''))
- .reduce((acc, arr) => {
- if (arr.includes('--freeform-invites')) {
- acc[freeForm] = acc[freeForm] || true;
- }
- if (arr.includes('--field-invite-status')) {
- acc[fieldStatus] = acc[fieldStatus] || allExceptFirst(arr);
- }
- if (arr.includes('--payment-request-status')) {
- acc[payment] = acc[payment] || allExceptFirst(arr);
- }
- return acc;
- }, {});
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentId,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- document: { signers: getDocumentSigners },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const getDocumentSigners$ = promisify(getDocumentSigners);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => getDocumentSigners$({
- id: documentId,
- token,
- options,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/download-document-group.js b/bin/download-document-group.js
deleted file mode 100644
index be4ef954..00000000
--- a/bin/download-document-group.js
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run download-document-group applet from the project root folder type in your console:
- * > node bin/download-document-group <...document_order>
- * , , , , , - are required params
- * <...document_order> - is optional param. It stands for one or more document IDs
- * options:
- * --type - type of download flow, can be `zip` or `merged`. Defaults to `zip`
- * --with-history - type of history merging flow, can be `no`, `after-each-document`, or `after-merged-pdf`. Defaults to `no`
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const options = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentGroupId,
- pathToSaveFile,
- ...document_order
-] = params;
-
-const { type, with_history } = options.reduce((acc, cur) => {
- const [
- key,
- value,
- ] = cur.split('=');
- acc[key.slice(2).replace(/-/g, '_')] = value;
- return acc;
-}, {});
-
-const fs = require('fs');
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: false,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- documentGroup: { download: downloadDocumentGroup },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const downloadDocumentGroup$ = promisify(downloadDocumentGroup);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => downloadDocumentGroup$({
- id: documentGroupId,
- token,
- type,
- with_history,
- document_order,
- }))
- .then(file => {
- const absolutePath = `${pathToSaveFile}/${documentGroupId}.${type === 'merged' ? 'pdf' : 'zip'}`;
- fs.writeFileSync(absolutePath, file, { encoding: 'binary' });
- console.log(`Document has been downloaded. Check your ${pathToSaveFile} directory`);
- })
- .catch(err => console.error(err));
diff --git a/bin/download-document.js b/bin/download-document.js
deleted file mode 100755
index 196b3630..00000000
--- a/bin/download-document.js
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run download-document applet from the project root folder type in your console:
- * > node bin/download-document
- * , , , , , - are required params
- * options:
- * --with-attachments - document will be downloaded as zip package with its attachments
- * --with-history - document will be downloaded with its history
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentId,
- pathToSaveFile,
-] = params;
-
-const withAttachments = flags.includes('--with-attachments');
-const withHistory = flags.includes('--with-history');
-const dev = flags.includes('--dev');
-
-const fs = require('fs');
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- document: { download: downloadDocument },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const downloadDocument$ = promisify(downloadDocument);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => downloadDocument$({
- id: documentId,
- options: {
- withAttachments,
- withHistory,
- },
- token,
- }))
- .then(file => {
- const fileExtension = withAttachments ? 'zip' : 'pdf';
- const absolutePath = `${pathToSaveFile}/${documentId}.${fileExtension}`;
- fs.writeFileSync(absolutePath, file, { encoding: 'binary' });
- console.log(`Document has been downloaded. Check your '${pathToSaveFile}' directory.`);
- })
- .catch(err => console.error(err));
diff --git a/bin/duplicate-template.js b/bin/duplicate-template.js
deleted file mode 100644
index 0a61394a..00000000
--- a/bin/duplicate-template.js
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run duplicate-template applet from the project root folder type in your console:
- * > node bin/duplicate-template
- * , , , , - are required params
- * - optional param
- */
-
-'use strict';
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- templateId,
- documentName,
-] = process.argv.slice(2);
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: false,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- template: { duplicate: createDocument },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const createDocument$ = promisify(createDocument);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => createDocument$({
- id: templateId,
- name: documentName,
- token,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/embedded-cancel-invites.js b/bin/embedded-cancel-invites.js
deleted file mode 100755
index 3316fa7b..00000000
--- a/bin/embedded-cancel-invites.js
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run embedded-cancel-invites applet from the project root folder type in your console:
- * > node bin/embedded-cancel-invites
- * , , , , - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentId,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- embedded: { cancelInvites },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const cancelInvites$ = promisify(cancelInvites);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => cancelInvites$({
- token,
- document_id: documentId,
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/embedded-create-invites.js b/bin/embedded-create-invites.js
deleted file mode 100755
index 71693b22..00000000
--- a/bin/embedded-create-invites.js
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run embedded-create-invites applet from the project root folder type in your console:
- * > node bin/embedded-create-invites
- * , , , , - are required params
- * options:
- * --dev - request will be sent to developer sandbox API
- */
-
-'use strict';
-
-const args = process.argv.slice(2);
-const flags = args.filter(arg => /^--/.test(arg));
-const params = args.filter(arg => !/^--/.test(arg));
-
-const [
- clientId,
- clientSecret,
- username,
- password,
- documentId,
- invitesStringified,
-] = params;
-
-const dev = flags.includes('--dev');
-
-const { promisify } = require('../utils');
-const api = require('../lib')({
- credentials: Buffer.from(`${clientId}:${clientSecret}`).toString('base64'),
- production: !dev,
-});
-
-const {
- oauth2: { requestToken: getAccessToken },
- embedded: { createInvite },
-} = api;
-
-const getAccessToken$ = promisify(getAccessToken);
-const createInvite$ = promisify(createInvite);
-
-getAccessToken$({
- username,
- password,
-})
- .then(({ access_token: token }) => createInvite$({
- token,
- document_id: documentId,
- invites: JSON.parse(invitesStringified),
- }))
- .then(res => console.log(res))
- .catch(err => console.error(err));
diff --git a/bin/embedded-generate-link.js b/bin/embedded-generate-link.js
deleted file mode 100755
index cfebcc84..00000000
--- a/bin/embedded-generate-link.js
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * to run embedded-generate-link applet from the project root folder type in your console:
- * > node bin/embedded-generate-link
- * , , , ,