@fluxfiles/node 0.1.20 → 0.1.21
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 +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4 -0
- package/dist/index.mjs +4 -0
- package/package.json +1 -1
- package/src/token.ts +4 -0
- package/src/types.ts +8 -0
package/dist/index.d.mts
CHANGED
|
@@ -148,6 +148,14 @@ interface BaseTokenOptions {
|
|
|
148
148
|
versioningMax?: number;
|
|
149
149
|
/** Skip versioning files bigger than this many MB. `0`/omitted = default (25). */
|
|
150
150
|
versioningMaxMb?: number;
|
|
151
|
+
/** Webhooks module: fire a signed HTTP POST on file events. */
|
|
152
|
+
allowWebhooks?: boolean;
|
|
153
|
+
/** Endpoint the signed event is POSTed to (http/s only). */
|
|
154
|
+
webhookUrl?: string;
|
|
155
|
+
/** Only these event names fire the webhook (e.g. `['upload','delete']`). Empty = all. */
|
|
156
|
+
webhookEvents?: string[];
|
|
157
|
+
/** HMAC signing secret for the payload (`X-FluxFiles-Signature`). Empty = server secret. */
|
|
158
|
+
webhookSecret?: string;
|
|
151
159
|
/** Allow downloading a multi-file/-folder selection as a zip (POST /api/fm/zip). Default true. */
|
|
152
160
|
allowZip?: boolean;
|
|
153
161
|
/** Allow extracting a zip in place (POST /api/fm/extract). Default true. */
|
package/dist/index.d.ts
CHANGED
|
@@ -148,6 +148,14 @@ interface BaseTokenOptions {
|
|
|
148
148
|
versioningMax?: number;
|
|
149
149
|
/** Skip versioning files bigger than this many MB. `0`/omitted = default (25). */
|
|
150
150
|
versioningMaxMb?: number;
|
|
151
|
+
/** Webhooks module: fire a signed HTTP POST on file events. */
|
|
152
|
+
allowWebhooks?: boolean;
|
|
153
|
+
/** Endpoint the signed event is POSTed to (http/s only). */
|
|
154
|
+
webhookUrl?: string;
|
|
155
|
+
/** Only these event names fire the webhook (e.g. `['upload','delete']`). Empty = all. */
|
|
156
|
+
webhookEvents?: string[];
|
|
157
|
+
/** HMAC signing secret for the payload (`X-FluxFiles-Signature`). Empty = server secret. */
|
|
158
|
+
webhookSecret?: string;
|
|
151
159
|
/** Allow downloading a multi-file/-folder selection as a zip (POST /api/fm/zip). Default true. */
|
|
152
160
|
allowZip?: boolean;
|
|
153
161
|
/** Allow extracting a zip in place (POST /api/fm/extract). Default true. */
|
package/dist/index.js
CHANGED
|
@@ -179,6 +179,10 @@ function applyTenantOverrides(payload, opts) {
|
|
|
179
179
|
if (opts.allowVersioning !== void 0) payload.allow_versioning = !!opts.allowVersioning;
|
|
180
180
|
if (opts.versioningMax && opts.versioningMax > 0) payload.versioning_max = Math.trunc(opts.versioningMax);
|
|
181
181
|
if (opts.versioningMaxMb && opts.versioningMaxMb > 0) payload.versioning_max_mb = Math.trunc(opts.versioningMaxMb);
|
|
182
|
+
if (opts.allowWebhooks !== void 0) payload.allow_webhooks = !!opts.allowWebhooks;
|
|
183
|
+
if (opts.webhookUrl) payload.webhook_url = String(opts.webhookUrl);
|
|
184
|
+
if (opts.webhookEvents && opts.webhookEvents.length) payload.webhook_events = opts.webhookEvents;
|
|
185
|
+
if (opts.webhookSecret) payload.webhook_secret = String(opts.webhookSecret);
|
|
182
186
|
if (opts.allowAiVision !== void 0) payload.allow_ai_vision = !!opts.allowAiVision;
|
|
183
187
|
if (opts.allowOcr !== void 0) payload.allow_ocr = !!opts.allowOcr;
|
|
184
188
|
if (opts.allowVirusScan !== void 0) payload.allow_virus_scan = !!opts.allowVirusScan;
|
package/dist/index.mjs
CHANGED
|
@@ -157,6 +157,10 @@ function applyTenantOverrides(payload, opts) {
|
|
|
157
157
|
if (opts.allowVersioning !== void 0) payload.allow_versioning = !!opts.allowVersioning;
|
|
158
158
|
if (opts.versioningMax && opts.versioningMax > 0) payload.versioning_max = Math.trunc(opts.versioningMax);
|
|
159
159
|
if (opts.versioningMaxMb && opts.versioningMaxMb > 0) payload.versioning_max_mb = Math.trunc(opts.versioningMaxMb);
|
|
160
|
+
if (opts.allowWebhooks !== void 0) payload.allow_webhooks = !!opts.allowWebhooks;
|
|
161
|
+
if (opts.webhookUrl) payload.webhook_url = String(opts.webhookUrl);
|
|
162
|
+
if (opts.webhookEvents && opts.webhookEvents.length) payload.webhook_events = opts.webhookEvents;
|
|
163
|
+
if (opts.webhookSecret) payload.webhook_secret = String(opts.webhookSecret);
|
|
160
164
|
if (opts.allowAiVision !== void 0) payload.allow_ai_vision = !!opts.allowAiVision;
|
|
161
165
|
if (opts.allowOcr !== void 0) payload.allow_ocr = !!opts.allowOcr;
|
|
162
166
|
if (opts.allowVirusScan !== void 0) payload.allow_virus_scan = !!opts.allowVirusScan;
|
package/package.json
CHANGED
package/src/token.ts
CHANGED
|
@@ -152,6 +152,10 @@ function applyTenantOverrides(payload: Record<string, unknown>, opts: BaseTokenO
|
|
|
152
152
|
if (opts.allowVersioning !== undefined) payload.allow_versioning = !!opts.allowVersioning;
|
|
153
153
|
if (opts.versioningMax && opts.versioningMax > 0) payload.versioning_max = Math.trunc(opts.versioningMax);
|
|
154
154
|
if (opts.versioningMaxMb && opts.versioningMaxMb > 0) payload.versioning_max_mb = Math.trunc(opts.versioningMaxMb);
|
|
155
|
+
if (opts.allowWebhooks !== undefined) payload.allow_webhooks = !!opts.allowWebhooks;
|
|
156
|
+
if (opts.webhookUrl) payload.webhook_url = String(opts.webhookUrl);
|
|
157
|
+
if (opts.webhookEvents && opts.webhookEvents.length) payload.webhook_events = opts.webhookEvents;
|
|
158
|
+
if (opts.webhookSecret) payload.webhook_secret = String(opts.webhookSecret);
|
|
155
159
|
if (opts.allowAiVision !== undefined) payload.allow_ai_vision = !!opts.allowAiVision;
|
|
156
160
|
if (opts.allowOcr !== undefined) payload.allow_ocr = !!opts.allowOcr;
|
|
157
161
|
if (opts.allowVirusScan !== undefined) payload.allow_virus_scan = !!opts.allowVirusScan;
|
package/src/types.ts
CHANGED
|
@@ -152,6 +152,14 @@ export interface BaseTokenOptions {
|
|
|
152
152
|
versioningMax?: number;
|
|
153
153
|
/** Skip versioning files bigger than this many MB. `0`/omitted = default (25). */
|
|
154
154
|
versioningMaxMb?: number;
|
|
155
|
+
/** Webhooks module: fire a signed HTTP POST on file events. */
|
|
156
|
+
allowWebhooks?: boolean;
|
|
157
|
+
/** Endpoint the signed event is POSTed to (http/s only). */
|
|
158
|
+
webhookUrl?: string;
|
|
159
|
+
/** Only these event names fire the webhook (e.g. `['upload','delete']`). Empty = all. */
|
|
160
|
+
webhookEvents?: string[];
|
|
161
|
+
/** HMAC signing secret for the payload (`X-FluxFiles-Signature`). Empty = server secret. */
|
|
162
|
+
webhookSecret?: string;
|
|
155
163
|
/** Allow downloading a multi-file/-folder selection as a zip (POST /api/fm/zip). Default true. */
|
|
156
164
|
allowZip?: boolean;
|
|
157
165
|
/** Allow extracting a zip in place (POST /api/fm/extract). Default true. */
|