@fluxfiles/node 0.1.23 → 0.1.25
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 +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +4 -0
- package/dist/index.mjs +4 -0
- package/package.json +1 -1
- package/src/token.ts +6 -0
- package/src/types.ts +14 -0
package/dist/index.d.mts
CHANGED
|
@@ -111,6 +111,9 @@ interface BaseTokenOptions {
|
|
|
111
111
|
/** Optional self-hosted office suite URL (Collabora/OnlyOffice) for .docx/.xlsx/.pptx…. May
|
|
112
112
|
* carry a `{url}` placeholder the UI substitutes with the selected file's URL. Free; http(s). */
|
|
113
113
|
officeUrl?: string;
|
|
114
|
+
/** Optional self-hosted e-signature URL (DocuSeal) for signing PDFs/docs. May carry a `{url}`
|
|
115
|
+
* placeholder the UI substitutes with the selected file's URL. Free; http(s). */
|
|
116
|
+
esignUrl?: string;
|
|
114
117
|
/** Allow the Optimization feature (POST /api/fm/optimize) — recompress images to WebP +
|
|
115
118
|
* compress PDFs. **Free/core**; default **false** because it replaces/deletes originals, so
|
|
116
119
|
* it's an opt-in capability. */
|
|
@@ -143,6 +146,17 @@ interface BaseTokenOptions {
|
|
|
143
146
|
/** Paid-module claims (3-layer gate: code installed + licensed + this claim).
|
|
144
147
|
* All default off; inert unless the module is installed & licensed on the server. */
|
|
145
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;
|
|
146
160
|
allowIntake?: boolean;
|
|
147
161
|
allowVersioning?: boolean;
|
|
148
162
|
allowAiVision?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -111,6 +111,9 @@ interface BaseTokenOptions {
|
|
|
111
111
|
/** Optional self-hosted office suite URL (Collabora/OnlyOffice) for .docx/.xlsx/.pptx…. May
|
|
112
112
|
* carry a `{url}` placeholder the UI substitutes with the selected file's URL. Free; http(s). */
|
|
113
113
|
officeUrl?: string;
|
|
114
|
+
/** Optional self-hosted e-signature URL (DocuSeal) for signing PDFs/docs. May carry a `{url}`
|
|
115
|
+
* placeholder the UI substitutes with the selected file's URL. Free; http(s). */
|
|
116
|
+
esignUrl?: string;
|
|
114
117
|
/** Allow the Optimization feature (POST /api/fm/optimize) — recompress images to WebP +
|
|
115
118
|
* compress PDFs. **Free/core**; default **false** because it replaces/deletes originals, so
|
|
116
119
|
* it's an opt-in capability. */
|
|
@@ -143,6 +146,17 @@ interface BaseTokenOptions {
|
|
|
143
146
|
/** Paid-module claims (3-layer gate: code installed + licensed + this claim).
|
|
144
147
|
* All default off; inert unless the module is installed & licensed on the server. */
|
|
145
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;
|
|
146
160
|
allowIntake?: boolean;
|
|
147
161
|
allowVersioning?: boolean;
|
|
148
162
|
allowAiVision?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -175,8 +175,12 @@ function applyTenantOverrides(payload, opts) {
|
|
|
175
175
|
if (opts.terminalPtyUrl) payload.terminal_pty_url = String(opts.terminalPtyUrl);
|
|
176
176
|
if (opts.pdfToolsUrl) payload.pdf_tools_url = String(opts.pdfToolsUrl);
|
|
177
177
|
if (opts.officeUrl) payload.office_url = String(opts.officeUrl);
|
|
178
|
+
if (opts.esignUrl) payload.esign_url = String(opts.esignUrl);
|
|
178
179
|
if (opts.allowOptimize !== void 0) payload.allow_optimize = !!opts.allowOptimize;
|
|
179
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;
|
|
180
184
|
if (opts.allowIntake !== void 0) payload.allow_intake = !!opts.allowIntake;
|
|
181
185
|
if (opts.allowVersioning !== void 0) payload.allow_versioning = !!opts.allowVersioning;
|
|
182
186
|
if (opts.versioningMax && opts.versioningMax > 0) payload.versioning_max = Math.trunc(opts.versioningMax);
|
package/dist/index.mjs
CHANGED
|
@@ -153,8 +153,12 @@ function applyTenantOverrides(payload, opts) {
|
|
|
153
153
|
if (opts.terminalPtyUrl) payload.terminal_pty_url = String(opts.terminalPtyUrl);
|
|
154
154
|
if (opts.pdfToolsUrl) payload.pdf_tools_url = String(opts.pdfToolsUrl);
|
|
155
155
|
if (opts.officeUrl) payload.office_url = String(opts.officeUrl);
|
|
156
|
+
if (opts.esignUrl) payload.esign_url = String(opts.esignUrl);
|
|
156
157
|
if (opts.allowOptimize !== void 0) payload.allow_optimize = !!opts.allowOptimize;
|
|
157
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;
|
|
158
162
|
if (opts.allowIntake !== void 0) payload.allow_intake = !!opts.allowIntake;
|
|
159
163
|
if (opts.allowVersioning !== void 0) payload.allow_versioning = !!opts.allowVersioning;
|
|
160
164
|
if (opts.versioningMax && opts.versioningMax > 0) payload.versioning_max = Math.trunc(opts.versioningMax);
|
package/package.json
CHANGED
package/src/token.ts
CHANGED
|
@@ -147,9 +147,15 @@ function applyTenantOverrides(payload: Record<string, unknown>, opts: BaseTokenO
|
|
|
147
147
|
if (opts.terminalPtyUrl) payload.terminal_pty_url = String(opts.terminalPtyUrl);
|
|
148
148
|
if (opts.pdfToolsUrl) payload.pdf_tools_url = String(opts.pdfToolsUrl);
|
|
149
149
|
if (opts.officeUrl) payload.office_url = String(opts.officeUrl);
|
|
150
|
+
if (opts.esignUrl) payload.esign_url = String(opts.esignUrl);
|
|
150
151
|
if (opts.allowOptimize !== undefined) payload.allow_optimize = !!opts.allowOptimize;
|
|
151
152
|
// Other paid-module claims (inert unless the module is installed + licensed).
|
|
152
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;
|
|
153
159
|
if (opts.allowIntake !== undefined) payload.allow_intake = !!opts.allowIntake;
|
|
154
160
|
if (opts.allowVersioning !== undefined) payload.allow_versioning = !!opts.allowVersioning;
|
|
155
161
|
if (opts.versioningMax && opts.versioningMax > 0) payload.versioning_max = Math.trunc(opts.versioningMax);
|
package/src/types.ts
CHANGED
|
@@ -115,6 +115,9 @@ export interface BaseTokenOptions {
|
|
|
115
115
|
/** Optional self-hosted office suite URL (Collabora/OnlyOffice) for .docx/.xlsx/.pptx…. May
|
|
116
116
|
* carry a `{url}` placeholder the UI substitutes with the selected file's URL. Free; http(s). */
|
|
117
117
|
officeUrl?: string;
|
|
118
|
+
/** Optional self-hosted e-signature URL (DocuSeal) for signing PDFs/docs. May carry a `{url}`
|
|
119
|
+
* placeholder the UI substitutes with the selected file's URL. Free; http(s). */
|
|
120
|
+
esignUrl?: string;
|
|
118
121
|
/** Allow the Optimization feature (POST /api/fm/optimize) — recompress images to WebP +
|
|
119
122
|
* compress PDFs. **Free/core**; default **false** because it replaces/deletes originals, so
|
|
120
123
|
* it's an opt-in capability. */
|
|
@@ -147,6 +150,17 @@ export interface BaseTokenOptions {
|
|
|
147
150
|
/** Paid-module claims (3-layer gate: code installed + licensed + this claim).
|
|
148
151
|
* All default off; inert unless the module is installed & licensed on the server. */
|
|
149
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;
|
|
150
164
|
allowIntake?: boolean;
|
|
151
165
|
allowVersioning?: boolean;
|
|
152
166
|
allowAiVision?: boolean;
|