@fluxfiles/node 0.1.24 → 0.1.26
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.d.mts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +4 -0
- package/dist/index.mjs +4 -0
- package/package.json +1 -1
- package/src/token.ts +8 -0
- package/src/types.ts +15 -0
package/dist/index.d.mts
CHANGED
|
@@ -146,7 +146,22 @@ interface BaseTokenOptions {
|
|
|
146
146
|
/** Paid-module claims (3-layer gate: code installed + licensed + this claim).
|
|
147
147
|
* All default off; inert unless the module is installed & licensed on the server. */
|
|
148
148
|
allowShare?: boolean;
|
|
149
|
+
/** Share landing: TTL (seconds) of the presigned S3/R2 URL a download redirects to.
|
|
150
|
+
* Clamped to [10, 300] by the core; `0`/omitted = 60. On S3/R2 the download cap
|
|
151
|
+
* counts **grants**, not GETs — this bounds that window. */
|
|
152
|
+
shareUrlTtl?: number;
|
|
153
|
+
/** Public base the share create response builds the recipient link from
|
|
154
|
+
* (e.g. `https://files.acme.com/public/share.html`). http(s) only; empty = the
|
|
155
|
+
* request origin. */
|
|
156
|
+
shareBaseUrl?: string;
|
|
157
|
+
/** Allow the share landing to render an inline preview (images via /api/fm/img;
|
|
158
|
+
* PDFs only on uncapped shares). Default true; false = download-only. */
|
|
159
|
+
sharePreview?: boolean;
|
|
149
160
|
allowIntake?: boolean;
|
|
161
|
+
/** Public base the intake create response builds the portal link from
|
|
162
|
+
* (e.g. `https://files.acme.com/public/intake.html`). http(s) only; empty = the
|
|
163
|
+
* request origin + `/public/intake.html`. Mirrors `shareBaseUrl`. */
|
|
164
|
+
intakeBaseUrl?: string;
|
|
150
165
|
allowVersioning?: boolean;
|
|
151
166
|
allowAiVision?: boolean;
|
|
152
167
|
allowOcr?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -146,7 +146,22 @@ interface BaseTokenOptions {
|
|
|
146
146
|
/** Paid-module claims (3-layer gate: code installed + licensed + this claim).
|
|
147
147
|
* All default off; inert unless the module is installed & licensed on the server. */
|
|
148
148
|
allowShare?: boolean;
|
|
149
|
+
/** Share landing: TTL (seconds) of the presigned S3/R2 URL a download redirects to.
|
|
150
|
+
* Clamped to [10, 300] by the core; `0`/omitted = 60. On S3/R2 the download cap
|
|
151
|
+
* counts **grants**, not GETs — this bounds that window. */
|
|
152
|
+
shareUrlTtl?: number;
|
|
153
|
+
/** Public base the share create response builds the recipient link from
|
|
154
|
+
* (e.g. `https://files.acme.com/public/share.html`). http(s) only; empty = the
|
|
155
|
+
* request origin. */
|
|
156
|
+
shareBaseUrl?: string;
|
|
157
|
+
/** Allow the share landing to render an inline preview (images via /api/fm/img;
|
|
158
|
+
* PDFs only on uncapped shares). Default true; false = download-only. */
|
|
159
|
+
sharePreview?: boolean;
|
|
149
160
|
allowIntake?: boolean;
|
|
161
|
+
/** Public base the intake create response builds the portal link from
|
|
162
|
+
* (e.g. `https://files.acme.com/public/intake.html`). http(s) only; empty = the
|
|
163
|
+
* request origin + `/public/intake.html`. Mirrors `shareBaseUrl`. */
|
|
164
|
+
intakeBaseUrl?: string;
|
|
150
165
|
allowVersioning?: boolean;
|
|
151
166
|
allowAiVision?: boolean;
|
|
152
167
|
allowOcr?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -178,7 +178,11 @@ function applyTenantOverrides(payload, opts) {
|
|
|
178
178
|
if (opts.esignUrl) payload.esign_url = String(opts.esignUrl);
|
|
179
179
|
if (opts.allowOptimize !== void 0) payload.allow_optimize = !!opts.allowOptimize;
|
|
180
180
|
if (opts.allowShare !== void 0) payload.allow_share = !!opts.allowShare;
|
|
181
|
+
if (opts.shareUrlTtl && opts.shareUrlTtl > 0) payload.share_url_ttl = Math.trunc(opts.shareUrlTtl);
|
|
182
|
+
if (opts.shareBaseUrl) payload.share_base_url = String(opts.shareBaseUrl);
|
|
183
|
+
if (opts.sharePreview !== void 0) payload.share_preview = !!opts.sharePreview;
|
|
181
184
|
if (opts.allowIntake !== void 0) payload.allow_intake = !!opts.allowIntake;
|
|
185
|
+
if (opts.intakeBaseUrl) payload.intake_base_url = String(opts.intakeBaseUrl);
|
|
182
186
|
if (opts.allowVersioning !== void 0) payload.allow_versioning = !!opts.allowVersioning;
|
|
183
187
|
if (opts.versioningMax && opts.versioningMax > 0) payload.versioning_max = Math.trunc(opts.versioningMax);
|
|
184
188
|
if (opts.versioningMaxMb && opts.versioningMaxMb > 0) payload.versioning_max_mb = Math.trunc(opts.versioningMaxMb);
|
package/dist/index.mjs
CHANGED
|
@@ -156,7 +156,11 @@ function applyTenantOverrides(payload, opts) {
|
|
|
156
156
|
if (opts.esignUrl) payload.esign_url = String(opts.esignUrl);
|
|
157
157
|
if (opts.allowOptimize !== void 0) payload.allow_optimize = !!opts.allowOptimize;
|
|
158
158
|
if (opts.allowShare !== void 0) payload.allow_share = !!opts.allowShare;
|
|
159
|
+
if (opts.shareUrlTtl && opts.shareUrlTtl > 0) payload.share_url_ttl = Math.trunc(opts.shareUrlTtl);
|
|
160
|
+
if (opts.shareBaseUrl) payload.share_base_url = String(opts.shareBaseUrl);
|
|
161
|
+
if (opts.sharePreview !== void 0) payload.share_preview = !!opts.sharePreview;
|
|
159
162
|
if (opts.allowIntake !== void 0) payload.allow_intake = !!opts.allowIntake;
|
|
163
|
+
if (opts.intakeBaseUrl) payload.intake_base_url = String(opts.intakeBaseUrl);
|
|
160
164
|
if (opts.allowVersioning !== void 0) payload.allow_versioning = !!opts.allowVersioning;
|
|
161
165
|
if (opts.versioningMax && opts.versioningMax > 0) payload.versioning_max = Math.trunc(opts.versioningMax);
|
|
162
166
|
if (opts.versioningMaxMb && opts.versioningMaxMb > 0) payload.versioning_max_mb = Math.trunc(opts.versioningMaxMb);
|
package/package.json
CHANGED
package/src/token.ts
CHANGED
|
@@ -151,7 +151,15 @@ function applyTenantOverrides(payload: Record<string, unknown>, opts: BaseTokenO
|
|
|
151
151
|
if (opts.allowOptimize !== undefined) payload.allow_optimize = !!opts.allowOptimize;
|
|
152
152
|
// Other paid-module claims (inert unless the module is installed + licensed).
|
|
153
153
|
if (opts.allowShare !== undefined) payload.allow_share = !!opts.allowShare;
|
|
154
|
+
// Share landing config — read at create time and baked into the share record
|
|
155
|
+
// (the core clamps the TTL and drops a non-http(s) base URL on decode).
|
|
156
|
+
if (opts.shareUrlTtl && opts.shareUrlTtl > 0) payload.share_url_ttl = Math.trunc(opts.shareUrlTtl);
|
|
157
|
+
if (opts.shareBaseUrl) payload.share_base_url = String(opts.shareBaseUrl);
|
|
158
|
+
if (opts.sharePreview !== undefined) payload.share_preview = !!opts.sharePreview;
|
|
154
159
|
if (opts.allowIntake !== undefined) payload.allow_intake = !!opts.allowIntake;
|
|
160
|
+
// Intake portal link base — same shape as shareBaseUrl (the core drops a
|
|
161
|
+
// non-http(s) value on decode).
|
|
162
|
+
if (opts.intakeBaseUrl) payload.intake_base_url = String(opts.intakeBaseUrl);
|
|
155
163
|
if (opts.allowVersioning !== undefined) payload.allow_versioning = !!opts.allowVersioning;
|
|
156
164
|
if (opts.versioningMax && opts.versioningMax > 0) payload.versioning_max = Math.trunc(opts.versioningMax);
|
|
157
165
|
if (opts.versioningMaxMb && opts.versioningMaxMb > 0) payload.versioning_max_mb = Math.trunc(opts.versioningMaxMb);
|
package/src/types.ts
CHANGED
|
@@ -150,7 +150,22 @@ export interface BaseTokenOptions {
|
|
|
150
150
|
/** Paid-module claims (3-layer gate: code installed + licensed + this claim).
|
|
151
151
|
* All default off; inert unless the module is installed & licensed on the server. */
|
|
152
152
|
allowShare?: boolean;
|
|
153
|
+
/** Share landing: TTL (seconds) of the presigned S3/R2 URL a download redirects to.
|
|
154
|
+
* Clamped to [10, 300] by the core; `0`/omitted = 60. On S3/R2 the download cap
|
|
155
|
+
* counts **grants**, not GETs — this bounds that window. */
|
|
156
|
+
shareUrlTtl?: number;
|
|
157
|
+
/** Public base the share create response builds the recipient link from
|
|
158
|
+
* (e.g. `https://files.acme.com/public/share.html`). http(s) only; empty = the
|
|
159
|
+
* request origin. */
|
|
160
|
+
shareBaseUrl?: string;
|
|
161
|
+
/** Allow the share landing to render an inline preview (images via /api/fm/img;
|
|
162
|
+
* PDFs only on uncapped shares). Default true; false = download-only. */
|
|
163
|
+
sharePreview?: boolean;
|
|
153
164
|
allowIntake?: boolean;
|
|
165
|
+
/** Public base the intake create response builds the portal link from
|
|
166
|
+
* (e.g. `https://files.acme.com/public/intake.html`). http(s) only; empty = the
|
|
167
|
+
* request origin + `/public/intake.html`. Mirrors `shareBaseUrl`. */
|
|
168
|
+
intakeBaseUrl?: string;
|
|
154
169
|
allowVersioning?: boolean;
|
|
155
170
|
allowAiVision?: boolean;
|
|
156
171
|
allowOcr?: boolean;
|