-
+
@@ -72,10 +54,7 @@ const Signed: NextPageWithLayout = (props: any) => {
Want to send slick signing links like this one?{" "}
-
+
Hosted Documenso is coming soon™
diff --git a/apps/web/pages/settings/account.tsx b/apps/web/pages/settings/account.tsx
index e593d261a..fd60790e5 100644
--- a/apps/web/pages/settings/account.tsx
+++ b/apps/web/pages/settings/account.tsx
@@ -1,2 +1,3 @@
import SettingsPage from ".";
+
export default SettingsPage;
diff --git a/apps/web/pages/settings/password.tsx b/apps/web/pages/settings/password.tsx
index e593d261a..fd60790e5 100644
--- a/apps/web/pages/settings/password.tsx
+++ b/apps/web/pages/settings/password.tsx
@@ -1,2 +1,3 @@
import SettingsPage from ".";
+
export default SettingsPage;
diff --git a/apps/web/pages/settings/profile.tsx b/apps/web/pages/settings/profile.tsx
index e593d261a..fd60790e5 100644
--- a/apps/web/pages/settings/profile.tsx
+++ b/apps/web/pages/settings/profile.tsx
@@ -1,2 +1,3 @@
import SettingsPage from ".";
+
export default SettingsPage;
diff --git a/apps/web/postcss.config.js b/apps/web/postcss.config.js
index 33ad091d2..12a703d90 100644
--- a/apps/web/postcss.config.js
+++ b/apps/web/postcss.config.js
@@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
-}
+};
diff --git a/apps/web/styles/tailwind.css b/apps/web/styles/tailwind.css
index 1a744e23d..2ea56f9bf 100644
--- a/apps/web/styles/tailwind.css
+++ b/apps/web/styles/tailwind.css
@@ -24,9 +24,8 @@ body,
font-weight: 400;
font-display: swap;
src: url("/fonts/montserrat.woff2") format("woff2");
- unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
- U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
- U+FEFF, U+FFFD;
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
+ U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@@ -36,7 +35,6 @@ body,
font-weight: 700;
font-display: swap;
src: url("/fonts/montserrat.woff2") format("woff2");
- unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
- U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
- U+FEFF, U+FFFD;
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
+ U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
diff --git a/package-lock.json b/package-lock.json
index af9ca495f..cf3178688 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -37,6 +37,11 @@
"react-hot-toast": "^2.4.0",
"react-signature-canvas": "^1.0.6",
"typescript": "4.8.4"
+ },
+ "devDependencies": {
+ "@trivago/prettier-plugin-sort-imports": "^4.1.1",
+ "prettier": "^2.8.7",
+ "prettier-plugin-tailwindcss": "^0.2.5"
}
},
"apps/web": {
@@ -102,6 +107,244 @@
"integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==",
"dev": true
},
+ "node_modules/@babel/code-frame": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz",
+ "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/highlight": "^7.18.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/generator": {
+ "version": "7.17.7",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz",
+ "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==",
+ "dev": true,
+ "dependencies": {
+ "@babel/types": "^7.17.0",
+ "jsesc": "^2.5.1",
+ "source-map": "^0.5.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/generator/node_modules/source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/@babel/helper-environment-visitor": {
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz",
+ "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==",
+ "dev": true,
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-function-name": {
+ "version": "7.21.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz",
+ "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/template": "^7.20.7",
+ "@babel/types": "^7.21.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-function-name/node_modules/@babel/types": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
+ "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.19.4",
+ "@babel/helper-validator-identifier": "^7.19.1",
+ "to-fast-properties": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-hoist-variables": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz",
+ "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==",
+ "dev": true,
+ "dependencies": {
+ "@babel/types": "^7.18.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
+ "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.19.4",
+ "@babel/helper-validator-identifier": "^7.19.1",
+ "to-fast-properties": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-split-export-declaration": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz",
+ "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/types": "^7.18.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
+ "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.19.4",
+ "@babel/helper-validator-identifier": "^7.19.1",
+ "to-fast-properties": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.19.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz",
+ "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==",
+ "dev": true,
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.19.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
+ "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
+ "dev": true,
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/highlight": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
+ "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.18.6",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
+ "dev": true
+ },
+ "node_modules/@babel/highlight/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/parser": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.4.tgz",
+ "integrity": "sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==",
+ "dev": true,
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
"node_modules/@babel/runtime": {
"version": "7.21.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz",
@@ -113,6 +356,77 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@babel/template": {
+ "version": "7.20.7",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz",
+ "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/code-frame": "^7.18.6",
+ "@babel/parser": "^7.20.7",
+ "@babel/types": "^7.20.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/template/node_modules/@babel/types": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
+ "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.19.4",
+ "@babel/helper-validator-identifier": "^7.19.1",
+ "to-fast-properties": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/traverse": {
+ "version": "7.17.3",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz",
+ "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/code-frame": "^7.16.7",
+ "@babel/generator": "^7.17.3",
+ "@babel/helper-environment-visitor": "^7.16.7",
+ "@babel/helper-function-name": "^7.16.7",
+ "@babel/helper-hoist-variables": "^7.16.7",
+ "@babel/helper-split-export-declaration": "^7.16.7",
+ "@babel/parser": "^7.17.3",
+ "@babel/types": "^7.17.0",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/traverse/node_modules/globals": {
+ "version": "11.12.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
+ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/types": {
+ "version": "7.17.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz",
+ "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.16.7",
+ "to-fast-properties": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@cspotcode/source-map-support": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
@@ -724,6 +1038,29 @@
"tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1"
}
},
+ "node_modules/@trivago/prettier-plugin-sort-imports": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.1.1.tgz",
+ "integrity": "sha512-dQ2r2uzNr1x6pJsuh/8x0IRA3CBUB+pWEW3J/7N98axqt7SQSm+2fy0FLNXvXGg77xEDC7KHxJlHfLYyi7PDcw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/generator": "7.17.7",
+ "@babel/parser": "^7.20.5",
+ "@babel/traverse": "7.17.3",
+ "@babel/types": "7.17.0",
+ "javascript-natural-sort": "0.7.1",
+ "lodash": "^4.17.21"
+ },
+ "peerDependencies": {
+ "@vue/compiler-sfc": "3.x",
+ "prettier": "2.x"
+ },
+ "peerDependenciesMeta": {
+ "@vue/compiler-sfc": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@tsconfig/node10": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
@@ -3486,6 +3823,12 @@
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g=="
},
+ "node_modules/javascript-natural-sort": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
+ "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==",
+ "dev": true
+ },
"node_modules/jest-worker": {
"version": "27.5.1",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",
@@ -3553,6 +3896,18 @@
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg=="
},
+ "node_modules/jsesc": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
+ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
+ "dev": true,
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@@ -3685,6 +4040,12 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/lodash": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
+ "dev": true
+ },
"node_modules/lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
@@ -7227,6 +7588,95 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/prettier": {
+ "version": "2.8.7",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz",
+ "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==",
+ "dev": true,
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/prettier-plugin-tailwindcss": {
+ "version": "0.2.6",
+ "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.6.tgz",
+ "integrity": "sha512-F+7XCl9RLF/LPrGdUMHWpsT6TM31JraonAUyE6eBmpqymFvDwyl0ETHsKFHP1NG+sEfv8bmKqnTxEbWQbHPlBA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12.17.0"
+ },
+ "peerDependencies": {
+ "@ianvs/prettier-plugin-sort-imports": "*",
+ "@prettier/plugin-php": "*",
+ "@prettier/plugin-pug": "*",
+ "@shopify/prettier-plugin-liquid": "*",
+ "@shufo/prettier-plugin-blade": "*",
+ "@trivago/prettier-plugin-sort-imports": "*",
+ "prettier": ">=2.2.0",
+ "prettier-plugin-astro": "*",
+ "prettier-plugin-css-order": "*",
+ "prettier-plugin-import-sort": "*",
+ "prettier-plugin-jsdoc": "*",
+ "prettier-plugin-organize-attributes": "*",
+ "prettier-plugin-organize-imports": "*",
+ "prettier-plugin-style-order": "*",
+ "prettier-plugin-svelte": "*",
+ "prettier-plugin-twig-melody": "*"
+ },
+ "peerDependenciesMeta": {
+ "@ianvs/prettier-plugin-sort-imports": {
+ "optional": true
+ },
+ "@prettier/plugin-php": {
+ "optional": true
+ },
+ "@prettier/plugin-pug": {
+ "optional": true
+ },
+ "@shopify/prettier-plugin-liquid": {
+ "optional": true
+ },
+ "@shufo/prettier-plugin-blade": {
+ "optional": true
+ },
+ "@trivago/prettier-plugin-sort-imports": {
+ "optional": true
+ },
+ "prettier-plugin-astro": {
+ "optional": true
+ },
+ "prettier-plugin-css-order": {
+ "optional": true
+ },
+ "prettier-plugin-import-sort": {
+ "optional": true
+ },
+ "prettier-plugin-jsdoc": {
+ "optional": true
+ },
+ "prettier-plugin-organize-attributes": {
+ "optional": true
+ },
+ "prettier-plugin-organize-imports": {
+ "optional": true
+ },
+ "prettier-plugin-style-order": {
+ "optional": true
+ },
+ "prettier-plugin-svelte": {
+ "optional": true
+ },
+ "prettier-plugin-twig-melody": {
+ "optional": true
+ }
+ }
+ },
"node_modules/pretty-format": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz",
@@ -8138,6 +8588,15 @@
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
},
+ "node_modules/to-fast-properties": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
+ "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@@ -8685,6 +9144,194 @@
}
},
"dependencies": {
+ "@babel/code-frame": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz",
+ "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.18.6"
+ }
+ },
+ "@babel/generator": {
+ "version": "7.17.7",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz",
+ "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.17.0",
+ "jsesc": "^2.5.1",
+ "source-map": "^0.5.0"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==",
+ "dev": true
+ }
+ }
+ },
+ "@babel/helper-environment-visitor": {
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz",
+ "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==",
+ "dev": true
+ },
+ "@babel/helper-function-name": {
+ "version": "7.21.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz",
+ "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==",
+ "dev": true,
+ "requires": {
+ "@babel/template": "^7.20.7",
+ "@babel/types": "^7.21.0"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
+ "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-string-parser": "^7.19.4",
+ "@babel/helper-validator-identifier": "^7.19.1",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
+ }
+ },
+ "@babel/helper-hoist-variables": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz",
+ "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.18.6"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
+ "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-string-parser": "^7.19.4",
+ "@babel/helper-validator-identifier": "^7.19.1",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
+ }
+ },
+ "@babel/helper-split-export-declaration": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz",
+ "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.18.6"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
+ "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-string-parser": "^7.19.4",
+ "@babel/helper-validator-identifier": "^7.19.1",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
+ }
+ },
+ "@babel/helper-string-parser": {
+ "version": "7.19.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz",
+ "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==",
+ "dev": true
+ },
+ "@babel/helper-validator-identifier": {
+ "version": "7.19.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
+ "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
+ "dev": true
+ },
+ "@babel/highlight": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
+ "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-validator-identifier": "^7.18.6",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ }
+ },
+ "color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "requires": {
+ "color-name": "1.1.3"
+ }
+ },
+ "color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
+ "dev": true
+ },
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "dev": true
+ },
+ "has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "@babel/parser": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.4.tgz",
+ "integrity": "sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==",
+ "dev": true
+ },
"@babel/runtime": {
"version": "7.21.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz",
@@ -8693,6 +9340,66 @@
"regenerator-runtime": "^0.13.11"
}
},
+ "@babel/template": {
+ "version": "7.20.7",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz",
+ "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.18.6",
+ "@babel/parser": "^7.20.7",
+ "@babel/types": "^7.20.7"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.21.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
+ "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-string-parser": "^7.19.4",
+ "@babel/helper-validator-identifier": "^7.19.1",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
+ }
+ },
+ "@babel/traverse": {
+ "version": "7.17.3",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz",
+ "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.16.7",
+ "@babel/generator": "^7.17.3",
+ "@babel/helper-environment-visitor": "^7.16.7",
+ "@babel/helper-function-name": "^7.16.7",
+ "@babel/helper-hoist-variables": "^7.16.7",
+ "@babel/helper-split-export-declaration": "^7.16.7",
+ "@babel/parser": "^7.17.3",
+ "@babel/types": "^7.17.0",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0"
+ },
+ "dependencies": {
+ "globals": {
+ "version": "11.12.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
+ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
+ "dev": true
+ }
+ }
+ },
+ "@babel/types": {
+ "version": "7.17.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz",
+ "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-validator-identifier": "^7.16.7",
+ "to-fast-properties": "^2.0.0"
+ }
+ },
"@cspotcode/source-map-support": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
@@ -9170,6 +9877,20 @@
"mini-svg-data-uri": "^1.2.3"
}
},
+ "@trivago/prettier-plugin-sort-imports": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.1.1.tgz",
+ "integrity": "sha512-dQ2r2uzNr1x6pJsuh/8x0IRA3CBUB+pWEW3J/7N98axqt7SQSm+2fy0FLNXvXGg77xEDC7KHxJlHfLYyi7PDcw==",
+ "dev": true,
+ "requires": {
+ "@babel/generator": "7.17.7",
+ "@babel/parser": "^7.20.5",
+ "@babel/traverse": "7.17.3",
+ "@babel/types": "7.17.0",
+ "javascript-natural-sort": "0.7.1",
+ "lodash": "^4.17.21"
+ }
+ },
"@tsconfig/node10": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
@@ -11238,6 +11959,12 @@
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g=="
},
+ "javascript-natural-sort": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
+ "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==",
+ "dev": true
+ },
"jest-worker": {
"version": "27.5.1",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",
@@ -11288,6 +12015,12 @@
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg=="
},
+ "jsesc": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
+ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
+ "dev": true
+ },
"json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@@ -11390,6 +12123,12 @@
"p-locate": "^5.0.0"
}
},
+ "lodash": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
+ "dev": true
+ },
"lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
@@ -13722,6 +14461,19 @@
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="
},
+ "prettier": {
+ "version": "2.8.7",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz",
+ "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==",
+ "dev": true
+ },
+ "prettier-plugin-tailwindcss": {
+ "version": "0.2.6",
+ "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.6.tgz",
+ "integrity": "sha512-F+7XCl9RLF/LPrGdUMHWpsT6TM31JraonAUyE6eBmpqymFvDwyl0ETHsKFHP1NG+sEfv8bmKqnTxEbWQbHPlBA==",
+ "dev": true,
+ "requires": {}
+ },
"pretty-format": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz",
@@ -14331,6 +15083,12 @@
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
},
+ "to-fast-properties": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
+ "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
+ "dev": true
+ },
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
diff --git a/package.json b/package.json
index 96efb8f04..a993179f2 100644
--- a/package.json
+++ b/package.json
@@ -43,5 +43,10 @@
"react-hot-toast": "^2.4.0",
"react-signature-canvas": "^1.0.6",
"typescript": "4.8.4"
+ },
+ "devDependencies": {
+ "@trivago/prettier-plugin-sort-imports": "^4.1.1",
+ "prettier": "^2.8.7",
+ "prettier-plugin-tailwindcss": "^0.2.5"
}
}
diff --git a/packages/features/editor/createField.ts b/packages/features/editor/createField.ts
index f97c57bf6..c66c16691 100644
--- a/packages/features/editor/createField.ts
+++ b/packages/features/editor/createField.ts
@@ -14,10 +14,8 @@ export const createField = (
if (newFieldX < 0) newFieldX = 0;
if (newFieldY < 0) newFieldY = 0;
- if (newFieldX + fieldSize.width > rect.width)
- newFieldX = rect.width - fieldSize.width;
- if (newFieldY + fieldSize.height > rect.height)
- newFieldY = rect.height - fieldSize.height;
+ if (newFieldX + fieldSize.width > rect.width) newFieldX = rect.width - fieldSize.width;
+ if (newFieldY + fieldSize.height > rect.height) newFieldY = rect.height - fieldSize.height;
const signatureField = {
id: -1,
diff --git a/packages/features/uploadDocument.ts b/packages/features/uploadDocument.ts
index b5b7e560f..ef57d795f 100644
--- a/packages/features/uploadDocument.ts
+++ b/packages/features/uploadDocument.ts
@@ -1,6 +1,6 @@
import router from "next/router";
-import toast from "react-hot-toast";
import { NEXT_PUBLIC_WEBAPP_URL } from "../lib/constants";
+import toast from "react-hot-toast";
export const uploadDocument = async (event: any) => {
if (event.target.files && event.target.files[0]) {
diff --git a/packages/lib/api/deleteRecipient.ts b/packages/lib/api/deleteRecipient.ts
index 138cb52c2..bf73b2b84 100644
--- a/packages/lib/api/deleteRecipient.ts
+++ b/packages/lib/api/deleteRecipient.ts
@@ -6,16 +6,13 @@ export const deleteRecipient = (recipient: any) => {
}
return toast.promise(
- fetch(
- "/api/documents/" + recipient.documentId + "/recipients/" + recipient.id,
- {
- method: "DELETE",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify(recipient),
- }
- ),
+ fetch("/api/documents/" + recipient.documentId + "/recipients/" + recipient.id, {
+ method: "DELETE",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(recipient),
+ }),
{
loading: "Deleting...",
success: "Deleted.",
diff --git a/packages/lib/api/index.ts b/packages/lib/api/index.ts
index b6cca406f..ef9139868 100644
--- a/packages/lib/api/index.ts
+++ b/packages/lib/api/index.ts
@@ -7,4 +7,4 @@ export { getDocuments } from "./getDocuments";
export { deleteDocument } from "./deleteDocument";
export { deleteRecipient } from "./deleteRecipient";
export { createOrUpdateRecipient } from "./createOrUpdateRecipient";
-export { sendSigningRequests } from "./sendSigningRequests";
\ No newline at end of file
+export { sendSigningRequests } from "./sendSigningRequests";
diff --git a/packages/lib/api/sendSigningRequests.ts b/packages/lib/api/sendSigningRequests.ts
index 75ab99d50..dda1520e2 100644
--- a/packages/lib/api/sendSigningRequests.ts
+++ b/packages/lib/api/sendSigningRequests.ts
@@ -1,9 +1,6 @@
import toast from "react-hot-toast";
-export const sendSigningRequests = async (
- document: any,
- resendTo: number[] = []
-) => {
+export const sendSigningRequests = async (document: any, resendTo: number[] = []) => {
if (!document || !document.id) return;
try {
const sent = await toast.promise(
diff --git a/packages/lib/api/signDocument.ts b/packages/lib/api/signDocument.ts
index 94dbfb679..017a29623 100644
--- a/packages/lib/api/signDocument.ts
+++ b/packages/lib/api/signDocument.ts
@@ -1,11 +1,7 @@
import { useRouter } from "next/router";
import toast from "react-hot-toast";
-export const signDocument = (
- document: any,
- signatures: any[],
- token: string
-): Promise
=> {
+export const signDocument = (document: any, signatures: any[], token: string): Promise => {
const body = { documentId: document.id, signatures };
return toast.promise(
diff --git a/packages/lib/auth.ts b/packages/lib/auth.ts
index 1c83255b6..71efa1fbf 100644
--- a/packages/lib/auth.ts
+++ b/packages/lib/auth.ts
@@ -1,12 +1,8 @@
-import { compare, hash } from "bcryptjs";
import type { NextApiRequest } from "next";
-import type { Session } from "next-auth";
-import {
- getSession as getSessionInner,
- GetSessionParams,
-} from "next-auth/react";
-
import { HttpError } from "@documenso/lib/server";
+import { compare, hash } from "bcryptjs";
+import type { Session } from "next-auth";
+import { GetSessionParams, getSession as getSessionInner } from "next-auth/react";
export async function hashPassword(password: string) {
const hashedPassword = await hash(password, 12);
@@ -28,9 +24,7 @@ export function validPassword(password: string) {
return true;
}
-export async function getSession(
- options: GetSessionParams
-): Promise {
+export async function getSession(options: GetSessionParams): Promise {
const session = await getSessionInner(options);
// that these are equal are ensured in `[...nextauth]`'s callback
@@ -43,11 +37,7 @@ export function isPasswordValid(
breakdown: boolean,
strict?: boolean
): { caplow: boolean; num: boolean; min: boolean; admin_min: boolean };
-export function isPasswordValid(
- password: string,
- breakdown?: boolean,
- strict?: boolean
-) {
+export function isPasswordValid(password: string, breakdown?: boolean, strict?: boolean) {
let cap = false, // Has uppercase characters
low = false, // Has lowercase characters
num = false, // At least one number
@@ -63,8 +53,7 @@ export function isPasswordValid(
}
}
- if (!breakdown)
- return cap && low && num && min && (strict ? admin_min : true);
+ if (!breakdown) return cap && low && num && min && (strict ? admin_min : true);
let errors: Record = { caplow: cap && low, num, min };
// Only return the admin key if strict mode is enabled.
@@ -79,8 +68,7 @@ type CtxOrReq =
export const ensureSession = async (ctxOrReq: CtxOrReq) => {
const session = await getSession(ctxOrReq);
- if (!session?.user)
- throw new HttpError({ statusCode: 401, message: "Unauthorized" });
+ if (!session?.user) throw new HttpError({ statusCode: 401, message: "Unauthorized" });
return session;
};
diff --git a/packages/lib/mail/sendSigningDoneMail.ts b/packages/lib/mail/sendSigningDoneMail.ts
index 85708e88f..67c73868e 100644
--- a/packages/lib/mail/sendSigningDoneMail.ts
+++ b/packages/lib/mail/sendSigningDoneMail.ts
@@ -1,13 +1,9 @@
-import { sendMail } from "./sendMail";
import { signingCompleteTemplate } from "@documenso/lib/mail";
-import { Document as PrismaDocument } from "@prisma/client";
import { addDigitalSignature } from "@documenso/signing/addDigitalSignature";
+import { sendMail } from "./sendMail";
+import { Document as PrismaDocument } from "@prisma/client";
-export const sendSigningDoneMail = async (
- recipient: any,
- document: PrismaDocument,
- user: any
-) => {
+export const sendSigningDoneMail = async (recipient: any, document: PrismaDocument, user: any) => {
await sendMail(
user.email,
`Completed: "${document.title}"`,
@@ -15,10 +11,7 @@ export const sendSigningDoneMail = async (
[
{
filename: document.title,
- content: Buffer.from(
- await addDigitalSignature(document.document),
- "base64"
- ),
+ content: Buffer.from(await addDigitalSignature(document.document), "base64"),
},
]
);
diff --git a/packages/lib/mail/sendSigningRequest.ts b/packages/lib/mail/sendSigningRequest.ts
index 6ada0db06..13cf52ecb 100644
--- a/packages/lib/mail/sendSigningRequest.ts
+++ b/packages/lib/mail/sendSigningRequest.ts
@@ -1,8 +1,8 @@
-import prisma from "@documenso/prisma";
-import { sendMail } from "./sendMail";
-import { SendStatus, ReadStatus, DocumentStatus } from "@prisma/client";
-import { NEXT_PUBLIC_WEBAPP_URL } from "../constants";
import { signingRequestTemplate } from "@documenso/lib/mail";
+import prisma from "@documenso/prisma";
+import { NEXT_PUBLIC_WEBAPP_URL } from "../constants";
+import { sendMail } from "./sendMail";
+import { DocumentStatus, ReadStatus, SendStatus } from "@prisma/client";
export const sendSigningRequest = async (recipient: any, document: any, user: any) => {
const signingRequestMessage = user.name
diff --git a/packages/lib/mail/signingCompleteTemplate.ts b/packages/lib/mail/signingCompleteTemplate.ts
index 532c1ce1f..803c26db6 100644
--- a/packages/lib/mail/signingCompleteTemplate.ts
+++ b/packages/lib/mail/signingCompleteTemplate.ts
@@ -1,6 +1,6 @@
import { NEXT_PUBLIC_WEBAPP_URL } from "../constants";
-import { Document as PrismaDocument } from "@prisma/client";
import { baseEmailTemplate } from "./baseTemplate";
+import { Document as PrismaDocument } from "@prisma/client";
export const signingCompleteTemplate = (message: string) => {
const customContent = `
diff --git a/packages/lib/mail/signingRequestTemplate.ts b/packages/lib/mail/signingRequestTemplate.ts
index 3992bee1e..a99ff2be4 100644
--- a/packages/lib/mail/signingRequestTemplate.ts
+++ b/packages/lib/mail/signingRequestTemplate.ts
@@ -1,6 +1,6 @@
import { NEXT_PUBLIC_WEBAPP_URL } from "../constants";
-import { Document as PrismaDocument } from "@prisma/client";
import { baseEmailTemplate } from "./baseTemplate";
+import { Document as PrismaDocument } from "@prisma/client";
export const signingRequestTemplate = (
message: string,
diff --git a/packages/lib/query/getDocumentsForUserFromToken.ts b/packages/lib/query/getDocumentsForUserFromToken.ts
index cbdde2a07..819b414c1 100644
--- a/packages/lib/query/getDocumentsForUserFromToken.ts
+++ b/packages/lib/query/getDocumentsForUserFromToken.ts
@@ -1,9 +1,7 @@
import { getUserFromToken } from "@documenso/lib/server";
import prisma from "@documenso/prisma";
-export const getDocumentsForUserFromToken = async (
- context: any
-): Promise => {
+export const getDocumentsForUserFromToken = async (context: any): Promise => {
const user = await getUserFromToken(context.req, context.res);
if (!user) return Promise.reject("Invalid user or token.");
diff --git a/packages/lib/server/defaultHandler.ts b/packages/lib/server/defaultHandler.ts
index 1cfa351bd..69d466648 100644
--- a/packages/lib/server/defaultHandler.ts
+++ b/packages/lib/server/defaultHandler.ts
@@ -1,24 +1,27 @@
import type { NextApiHandler, NextApiRequest, NextApiResponse } from "next";
type Handlers = {
- [method in "GET" | "POST" | "PATCH" | "PUT" | "DELETE"]?: Promise<{ default: NextApiHandler }>;
+ [method in "GET" | "POST" | "PATCH" | "PUT" | "DELETE"]?: Promise<{
+ default: NextApiHandler;
+ }>;
};
/** Allows us to split big API handlers by method */
-export const defaultHandler = (handlers: Handlers) => async (req: NextApiRequest, res: NextApiResponse) => {
- const handler = (await handlers[req.method as keyof typeof handlers])?.default;
- // auto catch unsupported methods.
- if (!handler) {
- return res
- .status(405)
- .json({ message: `Method Not Allowed (Allow: ${Object.keys(handlers).join(",")})` });
- }
+export const defaultHandler =
+ (handlers: Handlers) => async (req: NextApiRequest, res: NextApiResponse) => {
+ const handler = (await handlers[req.method as keyof typeof handlers])?.default;
+ // auto catch unsupported methods.
+ if (!handler) {
+ return res.status(405).json({
+ message: `Method Not Allowed (Allow: ${Object.keys(handlers).join(",")})`,
+ });
+ }
- try {
- await handler(req, res);
- return;
- } catch (error) {
- console.error(error);
- return res.status(500).json({ message: "Something went wrong" });
- }
-};
+ try {
+ await handler(req, res);
+ return;
+ } catch (error) {
+ console.error(error);
+ return res.status(500).json({ message: "Something went wrong" });
+ }
+ };
diff --git a/packages/lib/server/defaultResponder.ts b/packages/lib/server/defaultResponder.ts
index b598a977f..796bbe90b 100644
--- a/packages/lib/server/defaultResponder.ts
+++ b/packages/lib/server/defaultResponder.ts
@@ -1,5 +1,4 @@
import type { NextApiRequest, NextApiResponse } from "next";
-
import { getServerErrorFromUnknown } from "@documenso/lib/server";
type Handle = (req: NextApiRequest, res: NextApiResponse) => Promise;
diff --git a/packages/lib/server/getServerErrorFromUnknown.ts b/packages/lib/server/getServerErrorFromUnknown.ts
index 1ec9d93d8..8a4823082 100644
--- a/packages/lib/server/getServerErrorFromUnknown.ts
+++ b/packages/lib/server/getServerErrorFromUnknown.ts
@@ -1,9 +1,5 @@
-import {
- PrismaClientKnownRequestError,
- NotFoundError,
-} from "@prisma/client/runtime";
-
import { HttpError } from "@documenso/lib/server";
+import { NotFoundError, PrismaClientKnownRequestError } from "@prisma/client/runtime";
export function getServerErrorFromUnknown(cause: unknown): HttpError {
// Error was manually thrown and does not need to be parsed.
diff --git a/packages/lib/server/getUserFromToken.ts b/packages/lib/server/getUserFromToken.ts
index 579d47ada..b548a2ffa 100644
--- a/packages/lib/server/getUserFromToken.ts
+++ b/packages/lib/server/getUserFromToken.ts
@@ -1,6 +1,6 @@
+import { NextApiRequest, NextApiResponse } from "next";
import prisma from "@documenso/prisma";
import { User as PrismaUser } from "@prisma/client";
-import { NextApiRequest, NextApiResponse } from "next";
import { getToken } from "next-auth/jwt";
import { signOut } from "next-auth/react";
diff --git a/packages/lib/server/http-error.ts b/packages/lib/server/http-error.ts
index 223761480..b73b23f9d 100644
--- a/packages/lib/server/http-error.ts
+++ b/packages/lib/server/http-error.ts
@@ -5,7 +5,13 @@ export class HttpError extends Error {
public readonly url: string | undefined;
public readonly method: string | undefined;
- constructor(opts: { url?: string; method?: string; message?: string; statusCode: TCode; cause?: Error }) {
+ constructor(opts: {
+ url?: string;
+ method?: string;
+ message?: string;
+ statusCode: TCode;
+ cause?: Error;
+ }) {
super(opts.message ?? `HTTP Error ${opts.statusCode} `);
Object.setPrototypeOf(this, HttpError.prototype);
diff --git a/packages/pdf/insertTextInPDF.ts b/packages/pdf/insertTextInPDF.ts
index d7e829069..83487e94b 100644
--- a/packages/pdf/insertTextInPDF.ts
+++ b/packages/pdf/insertTextInPDF.ts
@@ -1,6 +1,6 @@
-import { PDFDocument, rgb, StandardFonts } from "pdf-lib";
import fontkit from "@pdf-lib/fontkit";
import * as fs from "fs";
+import { PDFDocument, StandardFonts, rgb } from "pdf-lib";
export async function insertTextInPDF(
pdfAsBase64: string,
diff --git a/packages/prisma/index.ts b/packages/prisma/index.ts
index 0c2cb450e..3a76d6bca 100644
--- a/packages/prisma/index.ts
+++ b/packages/prisma/index.ts
@@ -1,5 +1,5 @@
-import { PrismaClient, Document, User } from "@prisma/client";
-import { isENVProd } from "@documenso/lib"
+import { isENVProd } from "@documenso/lib";
+import { Document, PrismaClient, User } from "@prisma/client";
declare global {
var client: PrismaClient | undefined;
diff --git a/packages/prisma/seed.ts b/packages/prisma/seed.ts
index 5f9203a01..42812331f 100644
--- a/packages/prisma/seed.ts
+++ b/packages/prisma/seed.ts
@@ -1,7 +1,7 @@
-import prisma from "@documenso/prisma";
-import { hashPassword } from "@documenso/lib/auth";
-import { IdentityProvider } from "@prisma/client";
import { coloredConsole } from "@documenso/lib";
+import { hashPassword } from "@documenso/lib/auth";
+import prisma from "@documenso/prisma";
+import { IdentityProvider } from "@prisma/client";
async function createUser(userData: { email: string; password: string }) {
try {
diff --git a/packages/signing/addDigitalSignature.ts b/packages/signing/addDigitalSignature.ts
index f38a85cb4..b77c60138 100644
--- a/packages/signing/addDigitalSignature.ts
+++ b/packages/signing/addDigitalSignature.ts
@@ -1,17 +1,10 @@
+import { PDFDocument, PDFHexString, PDFName, PDFNumber, PDFString } from "pdf-lib";
+
const fs = require("fs");
// Local copy of Node SignPDF because https://github.com/vbuch/node-signpdf/pull/187 was not published in NPM yet. Can be switched to npm packge.
const signer = require("./node-signpdf/dist/signpdf");
-import {
- PDFDocument,
- PDFName,
- PDFNumber,
- PDFHexString,
- PDFString,
-} from "pdf-lib";
-export const addDigitalSignature = async (
- documentAsBase64: string
-): Promise => {
+export const addDigitalSignature = async (documentAsBase64: string): Promise => {
// Custom code to add Byterange to PDF
const PDFArrayCustom = require("./PDFArrayCustom");
const pdfBuffer = Buffer.from(documentAsBase64, "base64");
diff --git a/packages/signing/index.ts b/packages/signing/index.ts
index e09ffe6ea..7aeeb6470 100644
--- a/packages/signing/index.ts
+++ b/packages/signing/index.ts
@@ -1 +1 @@
-export { signDocument } from "./signDocument";
\ No newline at end of file
+export { signDocument } from "./signDocument";
diff --git a/packages/signing/node-signpdf/dist/SignPdfError.js b/packages/signing/node-signpdf/dist/SignPdfError.js
index a46e7f97e..f8e06aa0f 100644
--- a/packages/signing/node-signpdf/dist/SignPdfError.js
+++ b/packages/signing/node-signpdf/dist/SignPdfError.js
@@ -1,9 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
-exports.default = exports.ERROR_VERIFY_SIGNATURE = exports.ERROR_TYPE_UNKNOWN = exports.ERROR_TYPE_PARSE = exports.ERROR_TYPE_INPUT = void 0;
+exports.default =
+ exports.ERROR_VERIFY_SIGNATURE =
+ exports.ERROR_TYPE_UNKNOWN =
+ exports.ERROR_TYPE_PARSE =
+ exports.ERROR_TYPE_INPUT =
+ void 0;
const ERROR_TYPE_UNKNOWN = 1;
exports.ERROR_TYPE_UNKNOWN = ERROR_TYPE_UNKNOWN;
const ERROR_TYPE_INPUT = 2;
@@ -18,13 +23,11 @@ class SignPdfError extends Error {
super(msg);
this.type = type;
}
-
} // Shorthand
-
SignPdfError.TYPE_UNKNOWN = ERROR_TYPE_UNKNOWN;
SignPdfError.TYPE_INPUT = ERROR_TYPE_INPUT;
SignPdfError.TYPE_PARSE = ERROR_TYPE_PARSE;
SignPdfError.VERIFY_SIGNATURE = ERROR_VERIFY_SIGNATURE;
var _default = SignPdfError;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/const.js b/packages/signing/node-signpdf/dist/helpers/const.js
index 7b2d86721..3fe7e4ad6 100644
--- a/packages/signing/node-signpdf/dist/helpers/const.js
+++ b/packages/signing/node-signpdf/dist/helpers/const.js
@@ -1,18 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
-exports.SUBFILTER_ETSI_CADES_DETACHED = exports.SUBFILTER_ADOBE_X509_SHA1 = exports.SUBFILTER_ADOBE_PKCS7_SHA1 = exports.SUBFILTER_ADOBE_PKCS7_DETACHED = exports.DEFAULT_SIGNATURE_LENGTH = exports.DEFAULT_BYTE_RANGE_PLACEHOLDER = void 0;
+exports.SUBFILTER_ETSI_CADES_DETACHED =
+ exports.SUBFILTER_ADOBE_X509_SHA1 =
+ exports.SUBFILTER_ADOBE_PKCS7_SHA1 =
+ exports.SUBFILTER_ADOBE_PKCS7_DETACHED =
+ exports.DEFAULT_SIGNATURE_LENGTH =
+ exports.DEFAULT_BYTE_RANGE_PLACEHOLDER =
+ void 0;
const DEFAULT_SIGNATURE_LENGTH = 8192;
exports.DEFAULT_SIGNATURE_LENGTH = DEFAULT_SIGNATURE_LENGTH;
-const DEFAULT_BYTE_RANGE_PLACEHOLDER = '**********';
+const DEFAULT_BYTE_RANGE_PLACEHOLDER = "**********";
exports.DEFAULT_BYTE_RANGE_PLACEHOLDER = DEFAULT_BYTE_RANGE_PLACEHOLDER;
-const SUBFILTER_ADOBE_PKCS7_DETACHED = 'adbe.pkcs7.detached';
+const SUBFILTER_ADOBE_PKCS7_DETACHED = "adbe.pkcs7.detached";
exports.SUBFILTER_ADOBE_PKCS7_DETACHED = SUBFILTER_ADOBE_PKCS7_DETACHED;
-const SUBFILTER_ADOBE_PKCS7_SHA1 = 'adbe.pkcs7.sha1';
+const SUBFILTER_ADOBE_PKCS7_SHA1 = "adbe.pkcs7.sha1";
exports.SUBFILTER_ADOBE_PKCS7_SHA1 = SUBFILTER_ADOBE_PKCS7_SHA1;
-const SUBFILTER_ADOBE_X509_SHA1 = 'adbe.x509.rsa.sha1';
+const SUBFILTER_ADOBE_X509_SHA1 = "adbe.x509.rsa.sha1";
exports.SUBFILTER_ADOBE_X509_SHA1 = SUBFILTER_ADOBE_X509_SHA1;
-const SUBFILTER_ETSI_CADES_DETACHED = 'ETSI.CAdES.detached';
-exports.SUBFILTER_ETSI_CADES_DETACHED = SUBFILTER_ETSI_CADES_DETACHED;
\ No newline at end of file
+const SUBFILTER_ETSI_CADES_DETACHED = "ETSI.CAdES.detached";
+exports.SUBFILTER_ETSI_CADES_DETACHED = SUBFILTER_ETSI_CADES_DETACHED;
diff --git a/packages/signing/node-signpdf/dist/helpers/extractSignature.js b/packages/signing/node-signpdf/dist/helpers/extractSignature.js
index 0d3002401..e966f4dc3 100644
--- a/packages/signing/node-signpdf/dist/helpers/extractSignature.js
+++ b/packages/signing/node-signpdf/dist/helpers/extractSignature.js
@@ -1,13 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
var _SignPdfError = _interopRequireDefault(require("../SignPdfError"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
const getSubstringIndex = (str, substring, n) => {
let times = 0;
@@ -30,42 +32,55 @@ const getSubstringIndex = (str, substring, n) => {
* @returns {Object} {ByteRange: Number[], signature: Buffer, signedData: Buffer}
*/
-
const extractSignature = (pdf, signatureCount = 1) => {
if (!(pdf instanceof Buffer)) {
- throw new _SignPdfError.default('PDF expected as Buffer.', _SignPdfError.default.TYPE_INPUT);
+ throw new _SignPdfError.default("PDF expected as Buffer.", _SignPdfError.default.TYPE_INPUT);
} // const byteRangePos = pdf.indexOf('/ByteRange [');
-
- const byteRangePos = getSubstringIndex(pdf, '/ByteRange [', signatureCount);
+ const byteRangePos = getSubstringIndex(pdf, "/ByteRange [", signatureCount);
if (byteRangePos === -1) {
- throw new _SignPdfError.default('Failed to locate ByteRange.', _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ "Failed to locate ByteRange.",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
- const byteRangeEnd = pdf.indexOf(']', byteRangePos);
+ const byteRangeEnd = pdf.indexOf("]", byteRangePos);
if (byteRangeEnd === -1) {
- throw new _SignPdfError.default('Failed to locate the end of the ByteRange.', _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ "Failed to locate the end of the ByteRange.",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
const byteRange = pdf.slice(byteRangePos, byteRangeEnd + 1).toString();
const matches = /\/ByteRange \[(\d+) +(\d+) +(\d+) +(\d+) *\]/.exec(byteRange);
if (matches === null) {
- throw new _SignPdfError.default('Failed to parse the ByteRange.', _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ "Failed to parse the ByteRange.",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
const ByteRange = matches.slice(1).map(Number);
- const signedData = Buffer.concat([pdf.slice(ByteRange[0], ByteRange[0] + ByteRange[1]), pdf.slice(ByteRange[2], ByteRange[2] + ByteRange[3])]);
- const signatureHex = pdf.slice(ByteRange[0] + ByteRange[1] + 1, ByteRange[2]).toString('binary').replace(/(?:00|>)+$/, '');
- const signature = Buffer.from(signatureHex, 'hex').toString('binary');
+ const signedData = Buffer.concat([
+ pdf.slice(ByteRange[0], ByteRange[0] + ByteRange[1]),
+ pdf.slice(ByteRange[2], ByteRange[2] + ByteRange[3]),
+ ]);
+ const signatureHex = pdf
+ .slice(ByteRange[0] + ByteRange[1] + 1, ByteRange[2])
+ .toString("binary")
+ .replace(/(?:00|>)+$/, "");
+ const signature = Buffer.from(signatureHex, "hex").toString("binary");
return {
ByteRange: matches.slice(1, 5).map(Number),
signature,
- signedData
+ signedData,
};
};
var _default = extractSignature;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/findByteRange.js b/packages/signing/node-signpdf/dist/helpers/findByteRange.js
index c3853bf07..556e98d45 100644
--- a/packages/signing/node-signpdf/dist/helpers/findByteRange.js
+++ b/packages/signing/node-signpdf/dist/helpers/findByteRange.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
@@ -9,7 +9,9 @@ var _SignPdfError = _interopRequireDefault(require("../SignPdfError"));
var _const = require("./const");
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
/**
* Finds ByteRange information within a given PDF Buffer if one exists
@@ -17,25 +19,32 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
* @param {Buffer} pdf
* @returns {Object} {byteRangePlaceholder: String, byteRangeStrings: String[], byteRange: String[]}
*/
-const findByteRange = pdf => {
+const findByteRange = (pdf) => {
if (!(pdf instanceof Buffer)) {
- throw new _SignPdfError.default('PDF expected as Buffer.', _SignPdfError.default.TYPE_INPUT);
+ throw new _SignPdfError.default("PDF expected as Buffer.", _SignPdfError.default.TYPE_INPUT);
}
- const byteRangeStrings = pdf.toString().match(/\/ByteRange\s*\[{1}\s*(?:(?:\d*|\/\*{10})\s+){3}(?:\d+|\/\*{10}){1}\s*]{1}/g);
+ const byteRangeStrings = pdf
+ .toString()
+ .match(/\/ByteRange\s*\[{1}\s*(?:(?:\d*|\/\*{10})\s+){3}(?:\d+|\/\*{10}){1}\s*]{1}/g);
if (!byteRangeStrings) {
- throw new _SignPdfError.default('No ByteRangeStrings found within PDF buffer', _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ "No ByteRangeStrings found within PDF buffer",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
- const byteRangePlaceholder = byteRangeStrings.find(s => s.includes(`/${_const.DEFAULT_BYTE_RANGE_PLACEHOLDER}`));
- const byteRanges = byteRangeStrings.map(brs => brs.match(/[^[\s]*(?:\d|\/\*{10})/g));
+ const byteRangePlaceholder = byteRangeStrings.find((s) =>
+ s.includes(`/${_const.DEFAULT_BYTE_RANGE_PLACEHOLDER}`)
+ );
+ const byteRanges = byteRangeStrings.map((brs) => brs.match(/[^[\s]*(?:\d|\/\*{10})/g));
return {
byteRangePlaceholder,
byteRangeStrings,
- byteRanges
+ byteRanges,
};
};
var _default = findByteRange;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/index.js b/packages/signing/node-signpdf/dist/helpers/index.js
index 3c44df91b..088ad1ecb 100644
--- a/packages/signing/node-signpdf/dist/helpers/index.js
+++ b/packages/signing/node-signpdf/dist/helpers/index.js
@@ -1,37 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
Object.defineProperty(exports, "extractSignature", {
enumerable: true,
get: function () {
return _extractSignature.default;
- }
+ },
});
Object.defineProperty(exports, "findByteRange", {
enumerable: true,
get: function () {
return _findByteRange.default;
- }
+ },
});
Object.defineProperty(exports, "pdfkitAddPlaceholder", {
enumerable: true,
get: function () {
return _pdfkitAddPlaceholder.default;
- }
+ },
});
Object.defineProperty(exports, "plainAddPlaceholder", {
enumerable: true,
get: function () {
return _plainAddPlaceholder.default;
- }
+ },
});
Object.defineProperty(exports, "removeTrailingNewLine", {
enumerable: true,
get: function () {
return _removeTrailingNewLine.default;
- }
+ },
});
var _extractSignature = _interopRequireDefault(require("./extractSignature"));
@@ -44,6 +44,8 @@ var _removeTrailingNewLine = _interopRequireDefault(require("./removeTrailingNew
var _findByteRange = _interopRequireDefault(require("./findByteRange"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
-'This string is added so that jest collects coverage for this file'; // eslint-disable-line
\ No newline at end of file
+("This string is added so that jest collects coverage for this file"); // eslint-disable-line
diff --git a/packages/signing/node-signpdf/dist/helpers/pdfkit/abstract_reference.js b/packages/signing/node-signpdf/dist/helpers/pdfkit/abstract_reference.js
index d68dbff2e..982f8f773 100644
--- a/packages/signing/node-signpdf/dist/helpers/pdfkit/abstract_reference.js
+++ b/packages/signing/node-signpdf/dist/helpers/pdfkit/abstract_reference.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
@@ -17,10 +17,9 @@ PDFAbstractReference - abstract class for PDF reference
*/
class PDFAbstractReference {
toString() {
- throw new Error('Must be implemented by subclasses');
+ throw new Error("Must be implemented by subclasses");
}
-
}
var _default = PDFAbstractReference;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/pdfkit/pdfobject.js b/packages/signing/node-signpdf/dist/helpers/pdfkit/pdfobject.js
index 498ab5323..7be4d3b93 100644
--- a/packages/signing/node-signpdf/dist/helpers/pdfkit/pdfobject.js
+++ b/packages/signing/node-signpdf/dist/helpers/pdfkit/pdfobject.js
@@ -1,13 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
var _abstract_reference = _interopRequireDefault(require("./abstract_reference"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
/*
PDFObject by Devon Govett used below.
@@ -20,26 +22,26 @@ Modifications may have been applied for the purposes of node-signpdf.
PDFObject - converts JavaScript types into their corresponding PDF types.
By Devon Govett
*/
-const pad = (str, length) => (Array(length + 1).join('0') + str).slice(-length);
+const pad = (str, length) => (Array(length + 1).join("0") + str).slice(-length);
const escapableRe = /[\n\r\t\b\f()\\]/g;
const escapable = {
- '\n': '\\n',
- '\r': '\\r',
- '\t': '\\t',
- '\b': '\\b',
- '\f': '\\f',
- '\\': '\\\\',
- '(': '\\(',
- ')': '\\)'
+ "\n": "\\n",
+ "\r": "\\r",
+ "\t": "\\t",
+ "\b": "\\b",
+ "\f": "\\f",
+ "\\": "\\\\",
+ "(": "\\(",
+ ")": "\\)",
}; // Convert little endian UTF-16 to big endian
-const swapBytes = buff => buff.swap16();
+const swapBytes = (buff) => buff.swap16();
class PDFObject {
static convert(object, encryptFn = null) {
// String literals are converted to the PDF name type
- if (typeof object === 'string') {
+ if (typeof object === "string") {
return `/${object}`; // String objects are converted to PDF strings (UTF-16)
}
@@ -55,29 +57,26 @@ class PDFObject {
}
} // If so, encode it as big endian UTF-16
-
let stringBuffer;
if (isUnicode) {
- stringBuffer = swapBytes(Buffer.from(`\ufeff${string}`, 'utf16le'));
+ stringBuffer = swapBytes(Buffer.from(`\ufeff${string}`, "utf16le"));
} else {
- stringBuffer = Buffer.from(string, 'ascii');
+ stringBuffer = Buffer.from(string, "ascii");
} // Encrypt the string when necessary
-
if (encryptFn) {
- string = encryptFn(stringBuffer).toString('binary');
+ string = encryptFn(stringBuffer).toString("binary");
} else {
- string = stringBuffer.toString('binary');
+ string = stringBuffer.toString("binary");
} // Escape characters as required by the spec
-
- string = string.replace(escapableRe, c => escapable[c]);
+ string = string.replace(escapableRe, (c) => escapable[c]);
return `(${string})`; // Buffers are converted to PDF hex strings
}
if (Buffer.isBuffer(object)) {
- return `<${object.toString('hex')}>`;
+ return `<${object.toString("hex")}>`;
}
if (object instanceof _abstract_reference.default) {
@@ -85,51 +84,57 @@ class PDFObject {
}
if (object instanceof Date) {
- let string = `D:${pad(object.getUTCFullYear(), 4)}${pad(object.getUTCMonth() + 1, 2)}${pad(object.getUTCDate(), 2)}${pad(object.getUTCHours(), 2)}${pad(object.getUTCMinutes(), 2)}${pad(object.getUTCSeconds(), 2)}Z`; // Encrypt the string when necessary
+ let string = `D:${pad(object.getUTCFullYear(), 4)}${pad(object.getUTCMonth() + 1, 2)}${pad(
+ object.getUTCDate(),
+ 2
+ )}${pad(object.getUTCHours(), 2)}${pad(object.getUTCMinutes(), 2)}${pad(
+ object.getUTCSeconds(),
+ 2
+ )}Z`; // Encrypt the string when necessary
if (encryptFn) {
- string = encryptFn(Buffer.from(string, 'ascii')).toString('binary'); // Escape characters as required by the spec
+ string = encryptFn(Buffer.from(string, "ascii")).toString("binary"); // Escape characters as required by the spec
- string = string.replace(escapableRe, c => escapable[c]);
+ string = string.replace(escapableRe, (c) => escapable[c]);
}
return `(${string})`;
}
if (Array.isArray(object)) {
- const items = object.map(e => PDFObject.convert(e, encryptFn)).join(' ');
+ const items = object.map((e) => PDFObject.convert(e, encryptFn)).join(" ");
return `[${items}]`;
}
- if ({}.toString.call(object) === '[object Object]') {
- const out = ['<<'];
+ if ({}.toString.call(object) === "[object Object]") {
+ const out = ["<<"];
let streamData; // @todo this can probably be refactored into a reduce
Object.entries(object).forEach(([key, val]) => {
- let checkedValue = '';
+ let checkedValue = "";
- if (val.toString().indexOf('<<') !== -1) {
+ if (val.toString().indexOf("<<") !== -1) {
checkedValue = val;
} else {
checkedValue = PDFObject.convert(val, encryptFn);
}
- if (key === 'stream') {
+ if (key === "stream") {
streamData = `${key}\n${val}\nendstream`;
} else {
out.push(`/${key} ${checkedValue}`);
}
});
- out.push('>>');
+ out.push(">>");
if (streamData) {
out.push(streamData);
}
- return out.join('\n');
+ return out.join("\n");
}
- if (typeof object === 'number') {
+ if (typeof object === "number") {
return PDFObject.number(object);
}
@@ -143,7 +148,6 @@ class PDFObject {
throw new Error(`unsupported number: ${n}`);
}
-
}
-exports.default = PDFObject;
\ No newline at end of file
+exports.default = PDFObject;
diff --git a/packages/signing/node-signpdf/dist/helpers/pdfkitAddPlaceholder.js b/packages/signing/node-signpdf/dist/helpers/pdfkitAddPlaceholder.js
index fe266ec10..0f4501c78 100644
--- a/packages/signing/node-signpdf/dist/helpers/pdfkitAddPlaceholder.js
+++ b/packages/signing/node-signpdf/dist/helpers/pdfkitAddPlaceholder.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
@@ -9,7 +9,9 @@ var _const = require("./const");
var _pdfkitReferenceMock = _interopRequireDefault(require("./pdfkitReferenceMock"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
// eslint-disable-next-line import/no-unresolved
@@ -25,18 +27,18 @@ const pdfkitAddPlaceholder = ({
pdf,
pdfBuffer,
reason,
- contactInfo = 'emailfromp1289@gmail.com',
- name = 'Name from p12',
- location = 'Location from p12',
+ contactInfo = "emailfromp1289@gmail.com",
+ name = "Name from p12",
+ location = "Location from p12",
signatureLength = _const.DEFAULT_SIGNATURE_LENGTH,
byteRangePlaceholder = _const.DEFAULT_BYTE_RANGE_PLACEHOLDER,
- subFilter = _const.SUBFILTER_ADOBE_PKCS7_DETACHED
+ subFilter = _const.SUBFILTER_ADOBE_PKCS7_DETACHED,
}) => {
/* eslint-disable no-underscore-dangle,no-param-reassign */
// Generate the signature placeholder
const signature = pdf.ref({
- Type: 'Sig',
- Filter: 'Adobe.PPKLite',
+ Type: "Sig",
+ Filter: "Adobe.PPKLite",
SubFilter: subFilter,
ByteRange: [0, byteRangePlaceholder, byteRangePlaceholder, byteRangePlaceholder],
Contents: Buffer.from(String.fromCharCode(0).repeat(signatureLength)),
@@ -47,11 +49,10 @@ const pdfkitAddPlaceholder = ({
// eslint-disable-line no-new-wrappers
Name: new String(name),
// eslint-disable-line no-new-wrappers
- Location: new String(location) // eslint-disable-line no-new-wrappers
-
+ Location: new String(location), // eslint-disable-line no-new-wrappers
}); // Check if pdf already contains acroform field
- const acroFormPosition = pdfBuffer.lastIndexOf('/Type /AcroForm');
+ const acroFormPosition = pdfBuffer.lastIndexOf("/Type /AcroForm");
const isAcroFormExists = acroFormPosition !== -1;
let fieldIds = [];
let acroFormId;
@@ -65,13 +66,13 @@ const pdfkitAddPlaceholder = ({
// (generally it's 2 or 3, but I'm giving a big space though)
const maxAcroFormIdLength = 12;
- let foundAcroFormId = '';
+ let foundAcroFormId = "";
let index = charsUntilIdEnd + 1;
for (index; index < charsUntilIdEnd + maxAcroFormIdLength; index += 1) {
const acroFormIdString = pdfBuffer.slice(acroFormPosition - index, acroFormIdEnd).toString();
- if (acroFormIdString[0] === '\n') {
+ if (acroFormIdString[0] === "\n") {
break;
}
@@ -80,25 +81,27 @@ const pdfkitAddPlaceholder = ({
}
const pdfSlice = pdfBuffer.slice(acroFormStart);
- const acroForm = pdfSlice.slice(0, pdfSlice.indexOf('endobj')).toString();
+ const acroForm = pdfSlice.slice(0, pdfSlice.indexOf("endobj")).toString();
acroFormId = parseInt(foundAcroFormId);
- const acroFormFields = acroForm.slice(acroForm.indexOf('/Fields [') + 9, acroForm.indexOf(']'));
- fieldIds = acroFormFields.split(' ').filter((element, i) => i % 3 === 0).map(fieldId => new _pdfkitReferenceMock.default(fieldId));
+ const acroFormFields = acroForm.slice(acroForm.indexOf("/Fields [") + 9, acroForm.indexOf("]"));
+ fieldIds = acroFormFields
+ .split(" ")
+ .filter((element, i) => i % 3 === 0)
+ .map((fieldId) => new _pdfkitReferenceMock.default(fieldId));
}
- const signatureName = 'Signature'; // Generate signature annotation widget
+ const signatureName = "Signature"; // Generate signature annotation widget
const widget = pdf.ref({
- Type: 'Annot',
- Subtype: 'Widget',
- FT: 'Sig',
+ Type: "Annot",
+ Subtype: "Widget",
+ FT: "Sig",
Rect: [0, 0, 0, 0],
V: signature,
T: new String(signatureName + (fieldIds.length + 1)),
// eslint-disable-line no-new-wrappers
F: 4,
- P: pdf.page.dictionary // eslint-disable-line no-underscore-dangle
-
+ P: pdf.page.dictionary, // eslint-disable-line no-underscore-dangle
});
pdf.page.dictionary.data.Annots = [widget]; // Include the widget in a page
@@ -107,27 +110,30 @@ const pdfkitAddPlaceholder = ({
if (!isAcroFormExists) {
// Create a form (with the widget) and link in the _root
form = pdf.ref({
- Type: 'AcroForm',
+ Type: "AcroForm",
SigFlags: 3,
- Fields: [...fieldIds, widget]
+ Fields: [...fieldIds, widget],
});
} else {
// Use existing acroform and extend the fields with newly created widgets
- form = pdf.ref({
- Type: 'AcroForm',
- SigFlags: 3,
- Fields: [...fieldIds, widget]
- }, acroFormId);
+ form = pdf.ref(
+ {
+ Type: "AcroForm",
+ SigFlags: 3,
+ Fields: [...fieldIds, widget],
+ },
+ acroFormId
+ );
}
pdf._root.data.AcroForm = form;
return {
signature,
form,
- widget
+ widget,
};
/* eslint-enable no-underscore-dangle,no-param-reassign */
};
var _default = pdfkitAddPlaceholder;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/pdfkitReferenceMock.js b/packages/signing/node-signpdf/dist/helpers/pdfkitReferenceMock.js
index 0930df58d..5fea8a3fe 100644
--- a/packages/signing/node-signpdf/dist/helpers/pdfkitReferenceMock.js
+++ b/packages/signing/node-signpdf/dist/helpers/pdfkitReferenceMock.js
@@ -1,20 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
var _abstract_reference = _interopRequireDefault(require("./pdfkit/abstract_reference"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
class PDFKitReferenceMock extends _abstract_reference.default {
constructor(index, additionalData = undefined) {
super();
this.index = index;
- if (typeof additionalData !== 'undefined') {
+ if (typeof additionalData !== "undefined") {
Object.assign(this, additionalData);
}
}
@@ -22,8 +24,7 @@ class PDFKitReferenceMock extends _abstract_reference.default {
toString() {
return `${this.index} 0 R`;
}
-
}
var _default = PDFKitReferenceMock;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferPageWithAnnotation.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferPageWithAnnotation.js
index 1a046096c..73ffafd2d 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferPageWithAnnotation.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferPageWithAnnotation.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
@@ -9,7 +9,9 @@ var _findObject = _interopRequireDefault(require("./findObject"));
var _getIndexFromRef = _interopRequireDefault(require("./getIndexFromRef"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
const createBufferPageWithAnnotation = (pdf, info, pagesRef, widget) => {
const pagesDictionary = (0, _findObject.default)(pdf, info.xref, pagesRef).toString(); // Extend page dictionary with newly created annotations
@@ -17,16 +19,16 @@ const createBufferPageWithAnnotation = (pdf, info, pagesRef, widget) => {
let annotsStart;
let annotsEnd;
let annots;
- annotsStart = pagesDictionary.indexOf('/Annots');
+ annotsStart = pagesDictionary.indexOf("/Annots");
if (annotsStart > -1) {
- annotsEnd = pagesDictionary.indexOf(']', annotsStart);
+ annotsEnd = pagesDictionary.indexOf("]", annotsStart);
annots = pagesDictionary.substr(annotsStart, annotsEnd + 1 - annotsStart);
annots = annots.substr(0, annots.length - 1); // remove the trailing ]
} else {
annotsStart = pagesDictionary.length;
annotsEnd = pagesDictionary.length;
- annots = '/Annots [';
+ annots = "/Annots [";
}
const pagesDictionaryIndex = (0, _getIndexFromRef.default)(info.xref, pagesRef);
@@ -34,14 +36,19 @@ const createBufferPageWithAnnotation = (pdf, info, pagesRef, widget) => {
annots = `${annots} ${widgetValue}]`; // add the trailing ] back
const preAnnots = pagesDictionary.substr(0, annotsStart);
- let postAnnots = '';
+ let postAnnots = "";
if (pagesDictionary.length > annotsEnd) {
postAnnots = pagesDictionary.substr(annotsEnd + 1);
}
- return Buffer.concat([Buffer.from(`${pagesDictionaryIndex} 0 obj\n`), Buffer.from('<<\n'), Buffer.from(`${preAnnots + annots + postAnnots}\n`), Buffer.from('\n>>\nendobj\n')]);
+ return Buffer.concat([
+ Buffer.from(`${pagesDictionaryIndex} 0 obj\n`),
+ Buffer.from("<<\n"),
+ Buffer.from(`${preAnnots + annots + postAnnots}\n`),
+ Buffer.from("\n>>\nendobj\n"),
+ ]);
};
var _default = createBufferPageWithAnnotation;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferRootWithAcroform.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferRootWithAcroform.js
index 4a34369c1..1930db43d 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferRootWithAcroform.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferRootWithAcroform.js
@@ -1,18 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
var _getIndexFromRef = _interopRequireDefault(require("./getIndexFromRef"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
const createBufferRootWithAcroform = (pdf, info, form) => {
const rootIndex = (0, _getIndexFromRef.default)(info.xref, info.rootRef);
- return Buffer.concat([Buffer.from(`${rootIndex} 0 obj\n`), Buffer.from('<<\n'), Buffer.from(`${info.root}\n`), Buffer.from(`/AcroForm ${form}`), Buffer.from('\n>>\nendobj\n')]);
+ return Buffer.concat([
+ Buffer.from(`${rootIndex} 0 obj\n`),
+ Buffer.from("<<\n"),
+ Buffer.from(`${info.root}\n`),
+ Buffer.from(`/AcroForm ${form}`),
+ Buffer.from("\n>>\nendobj\n"),
+ ]);
};
var _default = createBufferRootWithAcroform;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferTrailer.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferTrailer.js
index c982767ba..0e57e5f23 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferTrailer.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/createBufferTrailer.js
@@ -1,21 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
const createBufferTrailer = (pdf, info, addedReferences) => {
let rows = [];
- rows[0] = '0000000000 65535 f '; // info.xref.tableRows[0];
+ rows[0] = "0000000000 65535 f "; // info.xref.tableRows[0];
addedReferences.forEach((offset, index) => {
const paddedOffset = `0000000000${offset}`.slice(-10);
rows[index + 1] = `${index} 1\n${paddedOffset} 00000 n `;
});
- rows = rows.filter(row => row !== undefined);
- return Buffer.concat([Buffer.from('xref\n'), Buffer.from(`${info.xref.startingIndex} 1\n`), Buffer.from(rows.join('\n')), Buffer.from('\ntrailer\n'), Buffer.from('<<\n'), Buffer.from(`/Size ${info.xref.maxIndex + 1}\n`), Buffer.from(`/Root ${info.rootRef}\n`), Buffer.from(info.infoRef ? `/Info ${info.infoRef}\n` : ''), Buffer.from(`/Prev ${info.xRefPosition}\n`), Buffer.from('>>\n'), Buffer.from('startxref\n'), Buffer.from(`${pdf.length}\n`), Buffer.from('%%EOF')]);
+ rows = rows.filter((row) => row !== undefined);
+ return Buffer.concat([
+ Buffer.from("xref\n"),
+ Buffer.from(`${info.xref.startingIndex} 1\n`),
+ Buffer.from(rows.join("\n")),
+ Buffer.from("\ntrailer\n"),
+ Buffer.from("<<\n"),
+ Buffer.from(`/Size ${info.xref.maxIndex + 1}\n`),
+ Buffer.from(`/Root ${info.rootRef}\n`),
+ Buffer.from(info.infoRef ? `/Info ${info.infoRef}\n` : ""),
+ Buffer.from(`/Prev ${info.xRefPosition}\n`),
+ Buffer.from(">>\n"),
+ Buffer.from("startxref\n"),
+ Buffer.from(`${pdf.length}\n`),
+ Buffer.from("%%EOF"),
+ ]);
};
var _default = createBufferTrailer;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/findObject.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/findObject.js
index db6c7b3e4..cb3bc4845 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/findObject.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/findObject.js
@@ -1,13 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
var _getIndexFromRef = _interopRequireDefault(require("./getIndexFromRef"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
/**
* @param {Buffer} pdf
@@ -18,12 +20,12 @@ const findObject = (pdf, refTable, ref) => {
const index = (0, _getIndexFromRef.default)(refTable, ref);
const offset = refTable.offsets.get(index);
let slice = pdf.slice(offset);
- slice = slice.slice(0, slice.indexOf('endobj', 'utf8')); // FIXME: What if it is a stream?
+ slice = slice.slice(0, slice.indexOf("endobj", "utf8")); // FIXME: What if it is a stream?
- slice = slice.slice(slice.indexOf('<<', 'utf8') + 2);
- slice = slice.slice(0, slice.lastIndexOf('>>', 'utf8'));
+ slice = slice.slice(slice.indexOf("<<", "utf8") + 2);
+ slice = slice.slice(0, slice.lastIndexOf(">>", "utf8"));
return slice;
};
var _default = findObject;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getIndexFromRef.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getIndexFromRef.js
index 1db2ed468..6b8b6d0f2 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getIndexFromRef.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getIndexFromRef.js
@@ -1,13 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
var _SignPdfError = _interopRequireDefault(require("../../SignPdfError"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
/**
* @param {object} refTable
@@ -15,15 +17,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
* @returns {number}
*/
const getIndexFromRef = (refTable, ref) => {
- let [index] = ref.split(' ');
+ let [index] = ref.split(" ");
index = parseInt(index);
if (!refTable.offsets.has(index)) {
- throw new _SignPdfError.default(`Failed to locate object "${ref}".`, _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ `Failed to locate object "${ref}".`,
+ _SignPdfError.default.TYPE_PARSE
+ );
}
return index;
};
var _default = getIndexFromRef;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPageRef.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPageRef.js
index f7dc95b85..1529d1e09 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPageRef.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPageRef.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = getPageRef;
@@ -9,7 +9,9 @@ var _getPagesDictionaryRef = _interopRequireDefault(require("./getPagesDictionar
var _findObject = _interopRequireDefault(require("./findObject"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
/**
* Finds the reference to a page.
@@ -20,10 +22,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
function getPageRef(pdfBuffer, info) {
const pagesRef = (0, _getPagesDictionaryRef.default)(info);
const pagesDictionary = (0, _findObject.default)(pdfBuffer, info.xref, pagesRef);
- const kidsPosition = pagesDictionary.indexOf('/Kids');
- const kidsStart = pagesDictionary.indexOf('[', kidsPosition) + 1;
- const kidsEnd = pagesDictionary.indexOf(']', kidsPosition);
+ const kidsPosition = pagesDictionary.indexOf("/Kids");
+ const kidsStart = pagesDictionary.indexOf("[", kidsPosition) + 1;
+ const kidsEnd = pagesDictionary.indexOf("]", kidsPosition);
const pages = pagesDictionary.slice(kidsStart, kidsEnd).toString();
- const split = pages.trim().split(' ', 3);
+ const split = pages.trim().split(" ", 3);
return `${split[0]} ${split[1]} ${split[2]}`;
-}
\ No newline at end of file
+}
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPagesDictionaryRef.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPagesDictionaryRef.js
index 375de63b0..3f34b176d 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPagesDictionaryRef.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPagesDictionaryRef.js
@@ -1,13 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = getPagesDictionaryRef;
var _SignPdfError = _interopRequireDefault(require("../../SignPdfError"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
/**
* @param {Object} info As extracted from readRef()
@@ -17,8 +19,11 @@ function getPagesDictionaryRef(info) {
const match = pagesRefRegex.exec(info.root);
if (match === null) {
- throw new _SignPdfError.default('Failed to find the pages descriptor. This is probably a problem in node-signpdf.', _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ "Failed to find the pages descriptor. This is probably a problem in node-signpdf.",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
return match[1];
-}
\ No newline at end of file
+}
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/index.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/index.js
index 764dbfe24..08241d99e 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/index.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/index.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
@@ -21,18 +21,24 @@ var _readPdf = _interopRequireDefault(require("./readPdf"));
var _getPageRef = _interopRequireDefault(require("./getPageRef"));
-var _createBufferRootWithAcroform = _interopRequireDefault(require("./createBufferRootWithAcroform"));
+var _createBufferRootWithAcroform = _interopRequireDefault(
+ require("./createBufferRootWithAcroform")
+);
-var _createBufferPageWithAnnotation = _interopRequireDefault(require("./createBufferPageWithAnnotation"));
+var _createBufferPageWithAnnotation = _interopRequireDefault(
+ require("./createBufferPageWithAnnotation")
+);
var _createBufferTrailer = _interopRequireDefault(require("./createBufferTrailer"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
-const isContainBufferRootWithAcroform = pdf => {
+const isContainBufferRootWithAcroform = (pdf) => {
const bufferRootWithAcroformRefRegex = /\/AcroForm\s+(\d+\s\d+\sR)/g;
const match = bufferRootWithAcroformRefRegex.exec(pdf.toString());
- return match != null && match[1] != null && match[1] !== '';
+ return match != null && match[1] != null && match[1] !== "";
};
/**
* Adds a signature placeholder to a PDF Buffer.
@@ -44,15 +50,14 @@ const isContainBufferRootWithAcroform = pdf => {
* not only on a freshly created through PDFKit one.
*/
-
const plainAddPlaceholder = ({
pdfBuffer,
reason,
- contactInfo = 'emailfromp1289@gmail.com',
- name = 'Name from p12',
- location = 'Location from p12',
+ contactInfo = "emailfromp1289@gmail.com",
+ name = "Name from p12",
+ location = "Location from p12",
signatureLength = _const.DEFAULT_SIGNATURE_LENGTH,
- subFilter = _const.SUBFILTER_ADOBE_PKCS7_DETACHED
+ subFilter = _const.SUBFILTER_ADOBE_PKCS7_DETACHED,
}) => {
let pdf = (0, _removeTrailingNewLine.default)(pdfBuffer);
const info = (0, _readPdf.default)(pdf);
@@ -65,24 +70,27 @@ const plainAddPlaceholder = ({
const index = additionalIndex != null ? additionalIndex : info.xref.maxIndex;
addedReferences.set(index, pdf.length + 1); // + 1 new line
- pdf = Buffer.concat([pdf, Buffer.from('\n'), Buffer.from(`${index} 0 obj\n`), Buffer.from(_pdfobject.default.convert(input)), Buffer.from('\nendobj\n')]);
+ pdf = Buffer.concat([
+ pdf,
+ Buffer.from("\n"),
+ Buffer.from(`${index} 0 obj\n`),
+ Buffer.from(_pdfobject.default.convert(input)),
+ Buffer.from("\nendobj\n"),
+ ]);
return new _pdfkitReferenceMock.default(info.xref.maxIndex);
},
page: {
dictionary: new _pdfkitReferenceMock.default(pageIndex, {
data: {
- Annots: []
- }
- })
+ Annots: [],
+ },
+ }),
},
_root: {
- data: {}
- }
+ data: {},
+ },
};
- const {
- form,
- widget
- } = (0, _pdfkitAddPlaceholder.default)({
+ const { form, widget } = (0, _pdfkitAddPlaceholder.default)({
pdf: pdfKitMock,
pdfBuffer,
reason,
@@ -90,20 +98,32 @@ const plainAddPlaceholder = ({
name,
location,
signatureLength,
- subFilter
+ subFilter,
});
if (!isContainBufferRootWithAcroform(pdf)) {
const rootIndex = (0, _getIndexFromRef.default)(info.xref, info.rootRef);
addedReferences.set(rootIndex, pdf.length + 1);
- pdf = Buffer.concat([pdf, Buffer.from('\n'), (0, _createBufferRootWithAcroform.default)(pdf, info, form)]);
+ pdf = Buffer.concat([
+ pdf,
+ Buffer.from("\n"),
+ (0, _createBufferRootWithAcroform.default)(pdf, info, form),
+ ]);
}
addedReferences.set(pageIndex, pdf.length + 1);
- pdf = Buffer.concat([pdf, Buffer.from('\n'), (0, _createBufferPageWithAnnotation.default)(pdf, info, pageRef, widget)]);
- pdf = Buffer.concat([pdf, Buffer.from('\n'), (0, _createBufferTrailer.default)(pdf, info, addedReferences)]);
+ pdf = Buffer.concat([
+ pdf,
+ Buffer.from("\n"),
+ (0, _createBufferPageWithAnnotation.default)(pdf, info, pageRef, widget),
+ ]);
+ pdf = Buffer.concat([
+ pdf,
+ Buffer.from("\n"),
+ (0, _createBufferTrailer.default)(pdf, info, addedReferences),
+ ]);
return pdf;
};
var _default = plainAddPlaceholder;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/readPdf.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/readPdf.js
index 1bba22555..422bf98b9 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/readPdf.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/readPdf.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
@@ -9,7 +9,9 @@ var _readRefTable = _interopRequireDefault(require("./readRefTable"));
var _findObject = _interopRequireDefault(require("./findObject"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
const getValue = (trailer, key) => {
let index = trailer.indexOf(key);
@@ -19,13 +21,16 @@ const getValue = (trailer, key) => {
}
const slice = trailer.slice(index);
- index = slice.indexOf('/', 1);
+ index = slice.indexOf("/", 1);
if (index === -1) {
- index = slice.indexOf('>', 1);
+ index = slice.indexOf(">", 1);
}
- return slice.slice(key.length + 1, index).toString().trim(); // key + at least one space
+ return slice
+ .slice(key.length + 1, index)
+ .toString()
+ .trim(); // key + at least one space
};
/**
* Simplified parsing of a PDF Buffer.
@@ -36,18 +41,17 @@ const getValue = (trailer, key) => {
* @param {Buffer} pdfBuffer
*/
-
-const readPdf = pdfBuffer => {
+const readPdf = (pdfBuffer) => {
// Extract the trailer dictionary.
- const trailerStart = pdfBuffer.lastIndexOf('trailer'); // The trailer is followed by xref. Then an EOF. EOF's length is 6 characters.
+ const trailerStart = pdfBuffer.lastIndexOf("trailer"); // The trailer is followed by xref. Then an EOF. EOF's length is 6 characters.
const trailer = pdfBuffer.slice(trailerStart, pdfBuffer.length - 6);
- let xRefPosition = trailer.slice(trailer.lastIndexOf('startxref') + 10).toString();
+ let xRefPosition = trailer.slice(trailer.lastIndexOf("startxref") + 10).toString();
xRefPosition = parseInt(xRefPosition);
const refTable = (0, _readRefTable.default)(pdfBuffer);
- const rootRef = getValue(trailer, '/Root');
+ const rootRef = getValue(trailer, "/Root");
const root = (0, _findObject.default)(pdfBuffer, refTable, rootRef).toString();
- const infoRef = getValue(trailer, '/Info');
+ const infoRef = getValue(trailer, "/Info");
return {
xref: refTable,
rootRef,
@@ -55,9 +59,9 @@ const readPdf = pdfBuffer => {
infoRef,
trailerStart,
previousXrefs: [],
- xRefPosition
+ xRefPosition,
};
};
var _default = readPdf;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js
index 8c8a75c27..c5f75ca66 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js
@@ -1,20 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
-exports.getXref = exports.getLastTrailerPosition = exports.getFullXrefTable = exports.default = void 0;
+exports.getXref =
+ exports.getLastTrailerPosition =
+ exports.getFullXrefTable =
+ exports.default =
+ void 0;
var _SignPdfError = _interopRequireDefault(require("../../SignPdfError"));
var _xrefToRefMap = _interopRequireDefault(require("./xrefToRefMap"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
-const getLastTrailerPosition = pdf => {
- const trailerStart = pdf.lastIndexOf(Buffer.from('trailer', 'utf8'));
+const getLastTrailerPosition = (pdf) => {
+ const trailerStart = pdf.lastIndexOf(Buffer.from("trailer", "utf8"));
const trailer = pdf.slice(trailerStart, pdf.length - 6);
- const xRefPosition = trailer.slice(trailer.lastIndexOf(Buffer.from('startxref', 'utf8')) + 10).toString();
+ const xRefPosition = trailer
+ .slice(trailer.lastIndexOf(Buffer.from("startxref", "utf8")) + 10)
+ .toString();
return parseInt(xRefPosition);
};
@@ -23,47 +31,62 @@ exports.getLastTrailerPosition = getLastTrailerPosition;
const getXref = (pdf, position) => {
let refTable = pdf.slice(position); // slice starting from where xref starts
- const realPosition = refTable.indexOf(Buffer.from('xref', 'utf8'));
+ const realPosition = refTable.indexOf(Buffer.from("xref", "utf8"));
if (realPosition === -1) {
- throw new _SignPdfError.default(`Could not find xref anywhere at or after ${position}.`, _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ `Could not find xref anywhere at or after ${position}.`,
+ _SignPdfError.default.TYPE_PARSE
+ );
}
if (realPosition > 0) {
const prefix = refTable.slice(0, realPosition);
- if (prefix.toString().replace(/\s*/g, '') !== '') {
- throw new _SignPdfError.default(`Expected xref at ${position} but found other content.`, _SignPdfError.default.TYPE_PARSE);
+ if (prefix.toString().replace(/\s*/g, "") !== "") {
+ throw new _SignPdfError.default(
+ `Expected xref at ${position} but found other content.`,
+ _SignPdfError.default.TYPE_PARSE
+ );
}
}
- const nextEofPosition = refTable.indexOf(Buffer.from('%%EOF', 'utf8'));
+ const nextEofPosition = refTable.indexOf(Buffer.from("%%EOF", "utf8"));
if (nextEofPosition === -1) {
- throw new _SignPdfError.default('Expected EOF after xref and trailer but could not find one.', _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ "Expected EOF after xref and trailer but could not find one.",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
refTable = refTable.slice(0, nextEofPosition);
refTable = refTable.slice(realPosition + 4); // move ahead with the "xref"
- refTable = refTable.slice(refTable.indexOf('\n') + 1); // move after the next new line
+ refTable = refTable.slice(refTable.indexOf("\n") + 1); // move after the next new line
// extract the size
- let size = refTable.toString().split('/Size')[1];
+ let size = refTable.toString().split("/Size")[1];
if (!size) {
- throw new _SignPdfError.default('Size not found in xref table.', _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ "Size not found in xref table.",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
size = /^\s*(\d+)/.exec(size);
if (size === null) {
- throw new _SignPdfError.default('Failed to parse size of xref table.', _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ "Failed to parse size of xref table.",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
size = parseInt(size[1]);
- const [objects, infos] = refTable.toString().split('trailer');
- const isContainingPrev = infos.split('/Prev')[1] != null;
+ const [objects, infos] = refTable.toString().split("trailer");
+ const isContainingPrev = infos.split("/Prev")[1] != null;
let prev;
if (isContainingPrev) {
@@ -77,13 +100,13 @@ const getXref = (pdf, position) => {
return {
size,
prev,
- xRefContent
+ xRefContent,
};
};
exports.getXref = getXref;
-const getFullXrefTable = pdf => {
+const getFullXrefTable = (pdf) => {
const lastTrailerPosition = getLastTrailerPosition(pdf);
const lastXrefTable = getXref(pdf, lastTrailerPosition);
@@ -101,19 +124,18 @@ const getFullXrefTable = pdf => {
* @returns {object}
*/
-
exports.getFullXrefTable = getFullXrefTable;
-const readRefTable = pdf => {
+const readRefTable = (pdf) => {
const fullXrefTable = getFullXrefTable(pdf);
const startingIndex = 0;
const maxIndex = Math.max(...fullXrefTable.keys());
return {
startingIndex,
maxIndex,
- offsets: fullXrefTable
+ offsets: fullXrefTable,
};
};
var _default = readRefTable;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/xrefToRefMap.js b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/xrefToRefMap.js
index 5c78727b5..224f7e7bc 100644
--- a/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/xrefToRefMap.js
+++ b/packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/xrefToRefMap.js
@@ -1,21 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
var _SignPdfError = _interopRequireDefault(require("../../SignPdfError"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
-const xrefToRefMap = xrefString => {
- const lines = xrefString.split('\n').filter(l => l !== '');
+const xrefToRefMap = (xrefString) => {
+ const lines = xrefString.split("\n").filter((l) => l !== "");
let index = 0;
let expectedLines = 0;
const xref = new Map();
- lines.forEach(line => {
- const split = line.split(' ');
+ lines.forEach((line) => {
+ const split = line.split(" ");
if (split.length === 2) {
index = parseInt(split[0]);
@@ -24,23 +26,32 @@ const xrefToRefMap = xrefString => {
}
if (expectedLines <= 0) {
- throw new _SignPdfError.default('Too many lines in xref table.', _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ "Too many lines in xref table.",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
expectedLines -= 1;
- const [offset,, inUse] = split;
+ const [offset, , inUse] = split;
- if (inUse.trim() === 'f') {
+ if (inUse.trim() === "f") {
index += 1;
return;
}
- if (inUse.trim() !== 'n') {
- throw new _SignPdfError.default(`Unknown in-use flag "${inUse}". Expected "n" or "f".`, _SignPdfError.default.TYPE_PARSE);
+ if (inUse.trim() !== "n") {
+ throw new _SignPdfError.default(
+ `Unknown in-use flag "${inUse}". Expected "n" or "f".`,
+ _SignPdfError.default.TYPE_PARSE
+ );
}
if (!/^\d+$/.test(offset.trim())) {
- throw new _SignPdfError.default(`Expected integer offset. Got "${offset}".`, _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ `Expected integer offset. Got "${offset}".`,
+ _SignPdfError.default.TYPE_PARSE
+ );
}
const storeOffset = parseInt(offset.trim());
@@ -51,4 +62,4 @@ const xrefToRefMap = xrefString => {
};
var _default = xrefToRefMap;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/helpers/removeTrailingNewLine.js b/packages/signing/node-signpdf/dist/helpers/removeTrailingNewLine.js
index 74f19c47a..2d6cae9f1 100644
--- a/packages/signing/node-signpdf/dist/helpers/removeTrailingNewLine.js
+++ b/packages/signing/node-signpdf/dist/helpers/removeTrailingNewLine.js
@@ -1,13 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
exports.default = void 0;
var _SignPdfError = _interopRequireDefault(require("../SignPdfError"));
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
const sliceLastChar = (pdf, character) => {
const lastChar = pdf.slice(pdf.length - 1).toString();
@@ -26,23 +28,25 @@ const sliceLastChar = (pdf, character) => {
* @returns {Buffer}
*/
-
-const removeTrailingNewLine = pdf => {
+const removeTrailingNewLine = (pdf) => {
if (!(pdf instanceof Buffer)) {
- throw new _SignPdfError.default('PDF expected as Buffer.', _SignPdfError.default.TYPE_INPUT);
+ throw new _SignPdfError.default("PDF expected as Buffer.", _SignPdfError.default.TYPE_INPUT);
}
let output = pdf;
- output = sliceLastChar(output, '\n');
- output = sliceLastChar(output, '\r');
+ output = sliceLastChar(output, "\n");
+ output = sliceLastChar(output, "\r");
const lastLine = output.slice(output.length - 6).toString();
- if (lastLine !== '\n%%EOF') {
- throw new _SignPdfError.default('A PDF file must end with an EOF line.', _SignPdfError.default.TYPE_PARSE);
+ if (lastLine !== "\n%%EOF") {
+ throw new _SignPdfError.default(
+ "A PDF file must end with an EOF line.",
+ _SignPdfError.default.TYPE_PARSE
+ );
}
return output;
};
var _default = removeTrailingNewLine;
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/signing/node-signpdf/dist/signpdf.js b/packages/signing/node-signpdf/dist/signpdf.js
index 9e06b6028..133623e4b 100644
--- a/packages/signing/node-signpdf/dist/signpdf.js
+++ b/packages/signing/node-signpdf/dist/signpdf.js
@@ -1,18 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
- value: true
+ value: true,
});
var _exportNames = {
SignPdf: true,
- SignPdfError: true
+ SignPdfError: true,
};
exports.SignPdf = void 0;
Object.defineProperty(exports, "SignPdfError", {
enumerable: true,
get: function () {
return _SignPdfError.default;
- }
+ },
});
exports.default = void 0;
@@ -30,7 +30,7 @@ Object.keys(_helpers).forEach(function (key) {
enumerable: true,
get: function () {
return _helpers[key];
- }
+ },
});
});
@@ -44,11 +44,13 @@ Object.keys(_const).forEach(function (key) {
enumerable: true,
get: function () {
return _const[key];
- }
+ },
});
});
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+}
class SignPdf {
constructor() {
@@ -59,77 +61,88 @@ class SignPdf {
sign(pdfBuffer, p12Buffer, additionalOptions = {}) {
const options = {
asn1StrictParsing: false,
- passphrase: '',
- ...additionalOptions
+ passphrase: "",
+ ...additionalOptions,
};
if (!(pdfBuffer instanceof Buffer)) {
- throw new _SignPdfError.default('PDF expected as Buffer.', _SignPdfError.default.TYPE_INPUT);
+ throw new _SignPdfError.default("PDF expected as Buffer.", _SignPdfError.default.TYPE_INPUT);
}
if (!(p12Buffer instanceof Buffer)) {
- throw new _SignPdfError.default('p12 certificate expected as Buffer.', _SignPdfError.default.TYPE_INPUT);
+ throw new _SignPdfError.default(
+ "p12 certificate expected as Buffer.",
+ _SignPdfError.default.TYPE_INPUT
+ );
}
let pdf = (0, _helpers.removeTrailingNewLine)(pdfBuffer); // Find the ByteRange placeholder.
- const {
- byteRangePlaceholder
- } = (0, _helpers.findByteRange)(pdf);
+ const { byteRangePlaceholder } = (0, _helpers.findByteRange)(pdf);
if (!byteRangePlaceholder) {
- throw new _SignPdfError.default(`Could not find empty ByteRange placeholder: ${byteRangePlaceholder}`, _SignPdfError.default.TYPE_PARSE);
+ throw new _SignPdfError.default(
+ `Could not find empty ByteRange placeholder: ${byteRangePlaceholder}`,
+ _SignPdfError.default.TYPE_PARSE
+ );
}
const byteRangePos = pdf.indexOf(byteRangePlaceholder); // Calculate the actual ByteRange that needs to replace the placeholder.
const byteRangeEnd = byteRangePos + byteRangePlaceholder.length;
- const contentsTagPos = pdf.indexOf('/Contents ', byteRangeEnd);
- const placeholderPos = pdf.indexOf('<', contentsTagPos);
- const placeholderEnd = pdf.indexOf('>', placeholderPos);
+ const contentsTagPos = pdf.indexOf("/Contents ", byteRangeEnd);
+ const placeholderPos = pdf.indexOf("<", contentsTagPos);
+ const placeholderEnd = pdf.indexOf(">", placeholderPos);
const placeholderLengthWithBrackets = placeholderEnd + 1 - placeholderPos;
const placeholderLength = placeholderLengthWithBrackets - 2;
const byteRange = [0, 0, 0, 0];
byteRange[1] = placeholderPos;
byteRange[2] = byteRange[1] + placeholderLengthWithBrackets;
byteRange[3] = pdf.length - byteRange[2];
- let actualByteRange = `/ByteRange [${byteRange.join(' ')}]`;
- actualByteRange += ' '.repeat(byteRangePlaceholder.length - actualByteRange.length); // Replace the /ByteRange placeholder with the actual ByteRange
+ let actualByteRange = `/ByteRange [${byteRange.join(" ")}]`;
+ actualByteRange += " ".repeat(byteRangePlaceholder.length - actualByteRange.length); // Replace the /ByteRange placeholder with the actual ByteRange
- pdf = Buffer.concat([pdf.slice(0, byteRangePos), Buffer.from(actualByteRange), pdf.slice(byteRangeEnd)]); // Remove the placeholder signature
+ pdf = Buffer.concat([
+ pdf.slice(0, byteRangePos),
+ Buffer.from(actualByteRange),
+ pdf.slice(byteRangeEnd),
+ ]); // Remove the placeholder signature
- pdf = Buffer.concat([pdf.slice(0, byteRange[1]), pdf.slice(byteRange[2], byteRange[2] + byteRange[3])]); // Convert Buffer P12 to a forge implementation.
+ pdf = Buffer.concat([
+ pdf.slice(0, byteRange[1]),
+ pdf.slice(byteRange[2], byteRange[2] + byteRange[3]),
+ ]); // Convert Buffer P12 to a forge implementation.
- const forgeCert = _nodeForge.default.util.createBuffer(p12Buffer.toString('binary'));
+ const forgeCert = _nodeForge.default.util.createBuffer(p12Buffer.toString("binary"));
const p12Asn1 = _nodeForge.default.asn1.fromDer(forgeCert);
- const p12 = _nodeForge.default.pkcs12.pkcs12FromAsn1(p12Asn1, options.asn1StrictParsing, options.passphrase); // Extract safe bags by type.
+ const p12 = _nodeForge.default.pkcs12.pkcs12FromAsn1(
+ p12Asn1,
+ options.asn1StrictParsing,
+ options.passphrase
+ ); // Extract safe bags by type.
// We will need all the certificates and the private key.
-
const certBags = p12.getBags({
- bagType: _nodeForge.default.pki.oids.certBag
+ bagType: _nodeForge.default.pki.oids.certBag,
})[_nodeForge.default.pki.oids.certBag];
const keyBags = p12.getBags({
- bagType: _nodeForge.default.pki.oids.pkcs8ShroudedKeyBag
+ bagType: _nodeForge.default.pki.oids.pkcs8ShroudedKeyBag,
})[_nodeForge.default.pki.oids.pkcs8ShroudedKeyBag];
const privateKey = keyBags[0].key; // Here comes the actual PKCS#7 signing.
const p7 = _nodeForge.default.pkcs7.createSignedData(); // Start off by setting the content.
-
- p7.content = _nodeForge.default.util.createBuffer(pdf.toString('binary')); // Then add all the certificates (-cacerts & -clcerts)
+ p7.content = _nodeForge.default.util.createBuffer(pdf.toString("binary")); // Then add all the certificates (-cacerts & -clcerts)
// Keep track of the last found client certificate.
// This will be the public key that will be bundled in the signature.
let certificate;
- Object.keys(certBags).forEach(i => {
- const {
- publicKey
- } = certBags[i].cert;
+ Object.keys(certBags).forEach((i) => {
+ const { publicKey } = certBags[i].cert;
p7.addCertificate(certBags[i].cert); // Try to find the certificate that matches the private key.
if (privateKey.n.compareTo(publicKey.n) === 0 && privateKey.e.compareTo(publicKey.e) === 0) {
@@ -137,57 +150,69 @@ class SignPdf {
}
});
- if (typeof certificate === 'undefined') {
- throw new _SignPdfError.default('Failed to find a certificate that matches the private key.', _SignPdfError.default.TYPE_INPUT);
+ if (typeof certificate === "undefined") {
+ throw new _SignPdfError.default(
+ "Failed to find a certificate that matches the private key.",
+ _SignPdfError.default.TYPE_INPUT
+ );
} // Add a sha256 signer. That's what Adobe.PPKLite adbe.pkcs7.detached expects.
-
p7.addSigner({
key: privateKey,
certificate,
digestAlgorithm: _nodeForge.default.pki.oids.sha256,
- authenticatedAttributes: [{
- type: _nodeForge.default.pki.oids.contentType,
- value: _nodeForge.default.pki.oids.data
- }, {
- type: _nodeForge.default.pki.oids.signingTime,
- // value can also be auto-populated at signing time
- // We may also support passing this as an option to sign().
- // Would be useful to match the creation time of the document for example.
- value: new Date()
- }, {
- type: _nodeForge.default.pki.oids.messageDigest // value will be auto-populated at signing time
-
- }]
+ authenticatedAttributes: [
+ {
+ type: _nodeForge.default.pki.oids.contentType,
+ value: _nodeForge.default.pki.oids.data,
+ },
+ {
+ type: _nodeForge.default.pki.oids.signingTime,
+ // value can also be auto-populated at signing time
+ // We may also support passing this as an option to sign().
+ // Would be useful to match the creation time of the document for example.
+ value: new Date(),
+ },
+ {
+ type: _nodeForge.default.pki.oids.messageDigest, // value will be auto-populated at signing time
+ },
+ ],
}); // Sign in detached mode.
p7.sign({
- detached: true
+ detached: true,
}); // Check if the PDF has a good enough placeholder to fit the signature.
const raw = _nodeForge.default.asn1.toDer(p7.toAsn1()).getBytes(); // placeholderLength represents the length of the HEXified symbols but we're
// checking the actual lengths.
-
if (raw.length * 2 > placeholderLength) {
- throw new _SignPdfError.default(`Signature exceeds placeholder length: ${raw.length * 2} > ${placeholderLength}`, _SignPdfError.default.TYPE_INPUT);
+ throw new _SignPdfError.default(
+ `Signature exceeds placeholder length: ${raw.length * 2} > ${placeholderLength}`,
+ _SignPdfError.default.TYPE_INPUT
+ );
}
- let signature = Buffer.from(raw, 'binary').toString('hex'); // Store the HEXified signature. At least useful in tests.
+ let signature = Buffer.from(raw, "binary").toString("hex"); // Store the HEXified signature. At least useful in tests.
this.lastSignature = signature; // Pad the signature with zeroes so the it is the same length as the placeholder
- signature += Buffer.from(String.fromCharCode(0).repeat(placeholderLength / 2 - raw.length)).toString('hex'); // Place it in the document.
+ signature += Buffer.from(
+ String.fromCharCode(0).repeat(placeholderLength / 2 - raw.length)
+ ).toString("hex"); // Place it in the document.
- pdf = Buffer.concat([pdf.slice(0, byteRange[1]), Buffer.from(`<${signature}>`), pdf.slice(byteRange[1])]); // Magic. Done.
+ pdf = Buffer.concat([
+ pdf.slice(0, byteRange[1]),
+ Buffer.from(`<${signature}>`),
+ pdf.slice(byteRange[1]),
+ ]); // Magic. Done.
return pdf;
}
-
}
exports.SignPdf = SignPdf;
var _default = new SignPdf();
-exports.default = _default;
\ No newline at end of file
+exports.default = _default;
diff --git a/packages/ui/components/breadcrumb/breadcrumb.tsx b/packages/ui/components/breadcrumb/breadcrumb.tsx
index 1313d322e..d256908c3 100644
--- a/packages/ui/components/breadcrumb/breadcrumb.tsx
+++ b/packages/ui/components/breadcrumb/breadcrumb.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/20/solid";
import Link from "next/link";
+import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/20/solid";
export function Breadcrumb(props: any) {
return (
@@ -8,12 +8,9 @@ export function Breadcrumb(props: any) {
1
- ? props.items[props.items.length - 2].href
- : props.items[0].href
+ props.items.length > 1 ? props.items[props.items.length - 2].href : props.items[0].href
}
- className="flex items-center text-sm font-medium text-gray-500 hover:text-gray-700"
- >
+ className="flex items-center text-sm font-medium text-gray-500 hover:text-gray-700">
+ className="text-sm font-medium text-gray-500 hover:text-gray-700">
{item.title}
diff --git a/packages/ui/components/button/Button.tsx b/packages/ui/components/button/Button.tsx
index d695049e3..fae2fd716 100644
--- a/packages/ui/components/button/Button.tsx
+++ b/packages/ui/components/button/Button.tsx
@@ -1,6 +1,6 @@
-import { classNames } from "@documenso/lib";
-import Link from "next/link";
import React from "react";
+import Link from "next/link";
+import { classNames } from "@documenso/lib";
export function Button(props: any) {
const isLink = typeof props.href !== "undefined" && !props.disabled;
@@ -8,8 +8,7 @@ export function Button(props: any) {
const baseStyles =
"inline-flex items-center justify-center min-w-[80px] rounded-md border border-transparent px-4 py-2 text-sm font-medium shadow-sm disabled:bg-gray-300";
const primaryStyles = "text-white bg-neon hover:bg-neon-dark";
- const secondaryStyles =
- "border-gray-300 bg-white text-gray-700 hover:bg-gray-50";
+ const secondaryStyles = "border-gray-300 bg-white text-gray-700 hover:bg-gray-50";
return isLink ? (
) : (
""
)}
@@ -43,13 +38,9 @@ export function Button(props: any) {
)}
onClick={props.onClick}
disabled={props.disabled || props.loading}
- hidden={props.hidden}
- >
+ hidden={props.hidden}>
{props.icon ? (
-
) : (
""
)}
diff --git a/packages/ui/components/button/IconButton.tsx b/packages/ui/components/button/IconButton.tsx
index e58dea539..2793b6359 100644
--- a/packages/ui/components/button/IconButton.tsx
+++ b/packages/ui/components/button/IconButton.tsx
@@ -1,6 +1,6 @@
-import { classNames } from "@documenso/lib";
-import Link from "next/link";
import React from "react";
+import Link from "next/link";
+import { classNames } from "@documenso/lib";
export function IconButton(props: any) {
const isLink = typeof props.href !== "undefined";
@@ -18,13 +18,9 @@ export function IconButton(props: any) {
color === "primary" ? primaryStyles : secondaryStyles,
props.className
)}
- hidden={props.hidden}
- >
+ hidden={props.hidden}>
{props.icon ? (
-
) : (
""
)}
@@ -40,13 +36,9 @@ export function IconButton(props: any) {
)}
onClick={props.onClick}
disabled={props.disabled}
- hidden={props.hidden}
- >
+ hidden={props.hidden}>
{props.icon ? (
-
) : (
""
)}
diff --git a/packages/ui/components/dialog/Dialog.tsx b/packages/ui/components/dialog/Dialog.tsx
index 5490cfa02..07c92686b 100644
--- a/packages/ui/components/dialog/Dialog.tsx
+++ b/packages/ui/components/dialog/Dialog.tsx
@@ -1,8 +1,8 @@
import React from "react";
-import { Transition, Dialog as DialogComponent } from "@headlessui/react";
import { Fragment } from "react";
-import { Button } from "@documenso/ui";
import { sendSigningRequests } from "@documenso/lib/api";
+import { Button } from "@documenso/ui";
+import { Dialog as DialogComponent, Transition } from "@headlessui/react";
import { Document as PrismaDocument } from "@prisma/client";
type FormValue = {
@@ -44,13 +44,12 @@ export function Dialog({
enterTo="opacity-100"
leave="ease-in duration-200"
leaveFrom="opacity-100"
- leaveTo="opacity-0"
- >
-