@fluxfiles/node 0.1.11 → 0.1.12

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 CHANGED
@@ -96,6 +96,14 @@ interface BaseTokenOptions {
96
96
  /** Allow editing a file's text content (GET/PUT /api/fm/content). Default **false** — editing
97
97
  * config/executable files (wp-config.php, .env, nginx.conf, deploy.sh) is powerful, so it's opt-in. */
98
98
  allowCodeEdit?: boolean;
99
+ /** Allow downloading a multi-file/-folder selection as a zip (POST /api/fm/zip). Default true. */
100
+ allowZip?: boolean;
101
+ /** Allow extracting a zip in place (POST /api/fm/extract). Default true. */
102
+ allowExtract?: boolean;
103
+ /** Max total uncompressed size (MB) for a zip/extract. `0`/omitted = inherit (1024). */
104
+ zipMaxMb?: number;
105
+ /** Max file count for a zip/extract. `0`/omitted = inherit (10000). */
106
+ zipMaxFiles?: number;
99
107
  /** Enable on-the-fly watermark on `/api/fm/img` (source file is never modified). Default off. */
100
108
  watermarkEnabled?: boolean;
101
109
  /** Watermark kind: 'text' or 'logo' (a PNG path in storage). Default 'text'. */
package/dist/index.d.ts CHANGED
@@ -96,6 +96,14 @@ interface BaseTokenOptions {
96
96
  /** Allow editing a file's text content (GET/PUT /api/fm/content). Default **false** — editing
97
97
  * config/executable files (wp-config.php, .env, nginx.conf, deploy.sh) is powerful, so it's opt-in. */
98
98
  allowCodeEdit?: boolean;
99
+ /** Allow downloading a multi-file/-folder selection as a zip (POST /api/fm/zip). Default true. */
100
+ allowZip?: boolean;
101
+ /** Allow extracting a zip in place (POST /api/fm/extract). Default true. */
102
+ allowExtract?: boolean;
103
+ /** Max total uncompressed size (MB) for a zip/extract. `0`/omitted = inherit (1024). */
104
+ zipMaxMb?: number;
105
+ /** Max file count for a zip/extract. `0`/omitted = inherit (10000). */
106
+ zipMaxFiles?: number;
99
107
  /** Enable on-the-fly watermark on `/api/fm/img` (source file is never modified). Default off. */
100
108
  watermarkEnabled?: boolean;
101
109
  /** Watermark kind: 'text' or 'logo' (a PNG path in storage). Default 'text'. */
package/dist/index.js CHANGED
@@ -162,6 +162,10 @@ function applyTenantOverrides(payload, opts) {
162
162
  if (opts.allowDownload !== void 0) payload.allow_download = !!opts.allowDownload;
163
163
  if (opts.allowChmod !== void 0) payload.allow_chmod = !!opts.allowChmod;
164
164
  if (opts.allowCodeEdit !== void 0) payload.allow_code_edit = !!opts.allowCodeEdit;
165
+ if (opts.allowZip !== void 0) payload.allow_zip = !!opts.allowZip;
166
+ if (opts.allowExtract !== void 0) payload.allow_extract = !!opts.allowExtract;
167
+ if (opts.zipMaxMb && opts.zipMaxMb > 0) payload.zip_max_mb = Math.trunc(opts.zipMaxMb);
168
+ if (opts.zipMaxFiles && opts.zipMaxFiles > 0) payload.zip_max_files = Math.trunc(opts.zipMaxFiles);
165
169
  if (opts.watermarkEnabled) {
166
170
  payload.watermark_enabled = true;
167
171
  if (opts.watermarkType) payload.watermark_type = opts.watermarkType;
package/dist/index.mjs CHANGED
@@ -140,6 +140,10 @@ function applyTenantOverrides(payload, opts) {
140
140
  if (opts.allowDownload !== void 0) payload.allow_download = !!opts.allowDownload;
141
141
  if (opts.allowChmod !== void 0) payload.allow_chmod = !!opts.allowChmod;
142
142
  if (opts.allowCodeEdit !== void 0) payload.allow_code_edit = !!opts.allowCodeEdit;
143
+ if (opts.allowZip !== void 0) payload.allow_zip = !!opts.allowZip;
144
+ if (opts.allowExtract !== void 0) payload.allow_extract = !!opts.allowExtract;
145
+ if (opts.zipMaxMb && opts.zipMaxMb > 0) payload.zip_max_mb = Math.trunc(opts.zipMaxMb);
146
+ if (opts.zipMaxFiles && opts.zipMaxFiles > 0) payload.zip_max_files = Math.trunc(opts.zipMaxFiles);
143
147
  if (opts.watermarkEnabled) {
144
148
  payload.watermark_enabled = true;
145
149
  if (opts.watermarkType) payload.watermark_type = opts.watermarkType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluxfiles/node",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Server-side Node/TypeScript SDK for minting FluxFiles JWTs (plain + BYOB), byte-compatible with the PHP core",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
package/src/token.ts CHANGED
@@ -132,6 +132,10 @@ function applyTenantOverrides(payload: Record<string, unknown>, opts: BaseTokenO
132
132
  if (opts.allowDownload !== undefined) payload.allow_download = !!opts.allowDownload;
133
133
  if (opts.allowChmod !== undefined) payload.allow_chmod = !!opts.allowChmod;
134
134
  if (opts.allowCodeEdit !== undefined) payload.allow_code_edit = !!opts.allowCodeEdit;
135
+ if (opts.allowZip !== undefined) payload.allow_zip = !!opts.allowZip;
136
+ if (opts.allowExtract !== undefined) payload.allow_extract = !!opts.allowExtract;
137
+ if (opts.zipMaxMb && opts.zipMaxMb > 0) payload.zip_max_mb = Math.trunc(opts.zipMaxMb);
138
+ if (opts.zipMaxFiles && opts.zipMaxFiles > 0) payload.zip_max_files = Math.trunc(opts.zipMaxFiles);
135
139
  if (opts.watermarkEnabled) {
136
140
  payload.watermark_enabled = true;
137
141
  if (opts.watermarkType) payload.watermark_type = opts.watermarkType;
package/src/types.ts CHANGED
@@ -100,6 +100,14 @@ export interface BaseTokenOptions {
100
100
  /** Allow editing a file's text content (GET/PUT /api/fm/content). Default **false** — editing
101
101
  * config/executable files (wp-config.php, .env, nginx.conf, deploy.sh) is powerful, so it's opt-in. */
102
102
  allowCodeEdit?: boolean;
103
+ /** Allow downloading a multi-file/-folder selection as a zip (POST /api/fm/zip). Default true. */
104
+ allowZip?: boolean;
105
+ /** Allow extracting a zip in place (POST /api/fm/extract). Default true. */
106
+ allowExtract?: boolean;
107
+ /** Max total uncompressed size (MB) for a zip/extract. `0`/omitted = inherit (1024). */
108
+ zipMaxMb?: number;
109
+ /** Max file count for a zip/extract. `0`/omitted = inherit (10000). */
110
+ zipMaxFiles?: number;
103
111
  /** Enable on-the-fly watermark on `/api/fm/img` (source file is never modified). Default off. */
104
112
  watermarkEnabled?: boolean;
105
113
  /** Watermark kind: 'text' or 'logo' (a PNG path in storage). Default 'text'. */