papermark 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +47 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2579,11 +2579,31 @@ More results: --cursor ${res.next_cursor}`) : out;
|
|
|
2579
2579
|
links.command("create").description("Create a share link for a document or dataroom").option("--document <id>", "document id").option("--dataroom <id>", "dataroom id").option(
|
|
2580
2580
|
"--group <gid>",
|
|
2581
2581
|
"scope to a dataroom group (dataroom links only; forces email protection)"
|
|
2582
|
-
).option("-n, --name <name>", "link name").option("--expires <iso-date>", "expiration date (ISO 8601)").option("--password <pw>", "require a password to view").option("--email-protected", "require email before viewing", false).option(
|
|
2582
|
+
).option("-n, --name <name>", "link name").option("--expires <iso-date>", "expiration date (ISO 8601)").option("--password <pw>", "require a password to view").option("--email-protected", "require email before viewing", false).option(
|
|
2583
|
+
"--email-authenticated",
|
|
2584
|
+
"require viewers to verify their email via a one-time code",
|
|
2585
|
+
false
|
|
2586
|
+
).option("--allow-download", "allow viewer to download the file", false).option(
|
|
2587
|
+
"--allow-list <items>",
|
|
2588
|
+
"comma-separated email/domain allow list (e.g. '@acme.com,bob@x.com')"
|
|
2589
|
+
).option("--deny-list <items>", "comma-separated email/domain deny list").option(
|
|
2583
2590
|
"--confidential-view",
|
|
2584
2591
|
"reveal only a narrow band of each page at a time; blurs the rest to prevent full-page screenshots",
|
|
2585
2592
|
false
|
|
2586
|
-
).option("--watermark", "enable watermark overlay (use with --watermark-*)", false)
|
|
2593
|
+
).option("--watermark", "enable watermark overlay (use with --watermark-*)", false).option(
|
|
2594
|
+
"--screenshot-protection",
|
|
2595
|
+
"block common screenshot/screen-recording shortcuts",
|
|
2596
|
+
false
|
|
2597
|
+
).option(
|
|
2598
|
+
"--agreement <id>",
|
|
2599
|
+
"require viewers to accept this agreement (NDA) before viewing"
|
|
2600
|
+
).option(
|
|
2601
|
+
"--domain <domain>",
|
|
2602
|
+
"verified custom domain to host the link on (requires --slug and a plan that supports custom domains)"
|
|
2603
|
+
).option(
|
|
2604
|
+
"--slug <slug>",
|
|
2605
|
+
"path segment on the custom domain (requires --domain)"
|
|
2606
|
+
)
|
|
2587
2607
|
).action(
|
|
2588
2608
|
async (opts) => {
|
|
2589
2609
|
try {
|
|
@@ -2593,6 +2613,7 @@ More results: --cursor ${res.next_cursor}`) : out;
|
|
|
2593
2613
|
if (opts.group && !opts.dataroom) {
|
|
2594
2614
|
throw new Error("--group requires --dataroom <id>.");
|
|
2595
2615
|
}
|
|
2616
|
+
const list = (v) => v === void 0 ? void 0 : v === "" ? [] : v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
2596
2617
|
const watermarkConfig = parseWatermarkConfig(opts);
|
|
2597
2618
|
const enableWatermark = opts.watermark || watermarkConfig !== void 0;
|
|
2598
2619
|
const link = await api.createLink({
|
|
@@ -2604,10 +2625,20 @@ More results: --cursor ${res.next_cursor}`) : out;
|
|
|
2604
2625
|
expires_at: opts.expires,
|
|
2605
2626
|
password: opts.password,
|
|
2606
2627
|
email_protected: opts.emailProtected,
|
|
2628
|
+
email_authenticated: opts.emailAuthenticated,
|
|
2607
2629
|
allow_download: opts.allowDownload,
|
|
2630
|
+
allow_list: list(opts.allowList),
|
|
2631
|
+
deny_list: list(opts.denyList),
|
|
2608
2632
|
enable_confidential_view: opts.confidentialView,
|
|
2609
2633
|
enable_watermark: enableWatermark || void 0,
|
|
2610
|
-
watermark_config: watermarkConfig
|
|
2634
|
+
watermark_config: watermarkConfig,
|
|
2635
|
+
enable_screenshot_protection: opts.screenshotProtection,
|
|
2636
|
+
// A single --agreement <id> both enables the gate and sets the id,
|
|
2637
|
+
// mirroring how --group implies audience_type=group.
|
|
2638
|
+
enable_agreement: opts.agreement ? true : void 0,
|
|
2639
|
+
agreement_id: opts.agreement,
|
|
2640
|
+
domain: opts.domain,
|
|
2641
|
+
slug: opts.slug
|
|
2611
2642
|
});
|
|
2612
2643
|
emit(
|
|
2613
2644
|
link,
|
|
@@ -2631,7 +2662,13 @@ More results: --cursor ${res.next_cursor}`) : out;
|
|
|
2631
2662
|
).option("--deny-list <items>", "comma-separated email/domain deny list").option("--watermark <on|off>", "enable watermark overlay").option("--watermark-clear", "clear the existing watermark config", false).option("--screenshot-protection <on|off>", "blur on screenshot").option(
|
|
2632
2663
|
"--confidential-view <on|off>",
|
|
2633
2664
|
"reveal only a narrow band of each page at a time; blurs the rest to prevent full-page screenshots"
|
|
2634
|
-
)
|
|
2665
|
+
).option("--enable-agreement <on|off>", "require viewers to accept an agreement (NDA)").option(
|
|
2666
|
+
"--agreement-id <id>",
|
|
2667
|
+
"agreement (NDA) id viewers must accept, or empty string to clear"
|
|
2668
|
+
).option(
|
|
2669
|
+
"--domain <domain>",
|
|
2670
|
+
"verified custom domain to host the link on (with --slug); pass 'papermark.com' to reset to the default domain"
|
|
2671
|
+
).option("--slug <slug>", "path segment on the custom domain (with --domain)")
|
|
2635
2672
|
).action(
|
|
2636
2673
|
async (id, opts) => {
|
|
2637
2674
|
try {
|
|
@@ -2689,6 +2726,12 @@ More results: --cursor ${res.next_cursor}`) : out;
|
|
|
2689
2726
|
if (sp !== void 0) body.enable_screenshot_protection = sp;
|
|
2690
2727
|
const cv = tri(opts.confidentialView, "--confidential-view");
|
|
2691
2728
|
if (cv !== void 0) body.enable_confidential_view = cv;
|
|
2729
|
+
const ag = tri(opts.enableAgreement, "--enable-agreement");
|
|
2730
|
+
if (ag !== void 0) body.enable_agreement = ag;
|
|
2731
|
+
if (opts.agreementId !== void 0)
|
|
2732
|
+
body.agreement_id = opts.agreementId === "" ? null : opts.agreementId;
|
|
2733
|
+
if (opts.domain !== void 0) body.domain = opts.domain;
|
|
2734
|
+
if (opts.slug !== void 0) body.slug = opts.slug;
|
|
2692
2735
|
if (Object.keys(body).length === 0) {
|
|
2693
2736
|
throw new Error(
|
|
2694
2737
|
"Pass at least one field to update (e.g. --name, --expires, --password)."
|