@fluxfiles/node 0.1.11 → 0.1.13

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,17 @@ 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 the paid Optimization module (POST /api/fm/optimize). Default **false** — opt-in.
100
+ * Even when true, the optimize module must be installed + licensed on the server. */
101
+ allowOptimize?: boolean;
102
+ /** Allow downloading a multi-file/-folder selection as a zip (POST /api/fm/zip). Default true. */
103
+ allowZip?: boolean;
104
+ /** Allow extracting a zip in place (POST /api/fm/extract). Default true. */
105
+ allowExtract?: boolean;
106
+ /** Max total uncompressed size (MB) for a zip/extract. `0`/omitted = inherit (1024). */
107
+ zipMaxMb?: number;
108
+ /** Max file count for a zip/extract. `0`/omitted = inherit (10000). */
109
+ zipMaxFiles?: number;
99
110
  /** Enable on-the-fly watermark on `/api/fm/img` (source file is never modified). Default off. */
100
111
  watermarkEnabled?: boolean;
101
112
  /** Watermark kind: 'text' or 'logo' (a PNG path in storage). Default 'text'. */
package/dist/index.d.ts CHANGED
@@ -96,6 +96,17 @@ 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 the paid Optimization module (POST /api/fm/optimize). Default **false** — opt-in.
100
+ * Even when true, the optimize module must be installed + licensed on the server. */
101
+ allowOptimize?: boolean;
102
+ /** Allow downloading a multi-file/-folder selection as a zip (POST /api/fm/zip). Default true. */
103
+ allowZip?: boolean;
104
+ /** Allow extracting a zip in place (POST /api/fm/extract). Default true. */
105
+ allowExtract?: boolean;
106
+ /** Max total uncompressed size (MB) for a zip/extract. `0`/omitted = inherit (1024). */
107
+ zipMaxMb?: number;
108
+ /** Max file count for a zip/extract. `0`/omitted = inherit (10000). */
109
+ zipMaxFiles?: number;
99
110
  /** Enable on-the-fly watermark on `/api/fm/img` (source file is never modified). Default off. */
100
111
  watermarkEnabled?: boolean;
101
112
  /** Watermark kind: 'text' or 'logo' (a PNG path in storage). Default 'text'. */
package/dist/index.js CHANGED
@@ -162,6 +162,11 @@ 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.allowOptimize !== void 0) payload.allow_optimize = !!opts.allowOptimize;
166
+ if (opts.allowZip !== void 0) payload.allow_zip = !!opts.allowZip;
167
+ if (opts.allowExtract !== void 0) payload.allow_extract = !!opts.allowExtract;
168
+ if (opts.zipMaxMb && opts.zipMaxMb > 0) payload.zip_max_mb = Math.trunc(opts.zipMaxMb);
169
+ if (opts.zipMaxFiles && opts.zipMaxFiles > 0) payload.zip_max_files = Math.trunc(opts.zipMaxFiles);
165
170
  if (opts.watermarkEnabled) {
166
171
  payload.watermark_enabled = true;
167
172
  if (opts.watermarkType) payload.watermark_type = opts.watermarkType;
package/dist/index.mjs CHANGED
@@ -140,6 +140,11 @@ 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.allowOptimize !== void 0) payload.allow_optimize = !!opts.allowOptimize;
144
+ if (opts.allowZip !== void 0) payload.allow_zip = !!opts.allowZip;
145
+ if (opts.allowExtract !== void 0) payload.allow_extract = !!opts.allowExtract;
146
+ if (opts.zipMaxMb && opts.zipMaxMb > 0) payload.zip_max_mb = Math.trunc(opts.zipMaxMb);
147
+ if (opts.zipMaxFiles && opts.zipMaxFiles > 0) payload.zip_max_files = Math.trunc(opts.zipMaxFiles);
143
148
  if (opts.watermarkEnabled) {
144
149
  payload.watermark_enabled = true;
145
150
  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.13",
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,11 @@ 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.allowOptimize !== undefined) payload.allow_optimize = !!opts.allowOptimize;
136
+ if (opts.allowZip !== undefined) payload.allow_zip = !!opts.allowZip;
137
+ if (opts.allowExtract !== undefined) payload.allow_extract = !!opts.allowExtract;
138
+ if (opts.zipMaxMb && opts.zipMaxMb > 0) payload.zip_max_mb = Math.trunc(opts.zipMaxMb);
139
+ if (opts.zipMaxFiles && opts.zipMaxFiles > 0) payload.zip_max_files = Math.trunc(opts.zipMaxFiles);
135
140
  if (opts.watermarkEnabled) {
136
141
  payload.watermark_enabled = true;
137
142
  if (opts.watermarkType) payload.watermark_type = opts.watermarkType;
package/src/types.ts CHANGED
@@ -100,6 +100,17 @@ 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 the paid Optimization module (POST /api/fm/optimize). Default **false** — opt-in.
104
+ * Even when true, the optimize module must be installed + licensed on the server. */
105
+ allowOptimize?: boolean;
106
+ /** Allow downloading a multi-file/-folder selection as a zip (POST /api/fm/zip). Default true. */
107
+ allowZip?: boolean;
108
+ /** Allow extracting a zip in place (POST /api/fm/extract). Default true. */
109
+ allowExtract?: boolean;
110
+ /** Max total uncompressed size (MB) for a zip/extract. `0`/omitted = inherit (1024). */
111
+ zipMaxMb?: number;
112
+ /** Max file count for a zip/extract. `0`/omitted = inherit (10000). */
113
+ zipMaxFiles?: number;
103
114
  /** Enable on-the-fly watermark on `/api/fm/img` (source file is never modified). Default off. */
104
115
  watermarkEnabled?: boolean;
105
116
  /** Watermark kind: 'text' or 'logo' (a PNG path in storage). Default 'text'. */