@fluxfiles/node 0.1.6 → 0.1.7
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 +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +5 -0
- package/dist/index.mjs +5 -0
- package/package.json +1 -1
- package/src/token.ts +7 -0
- package/src/types.ts +10 -0
package/dist/index.d.mts
CHANGED
|
@@ -83,6 +83,16 @@ interface BaseTokenOptions {
|
|
|
83
83
|
watermarkOpacity?: number;
|
|
84
84
|
/** Font size for text watermark. Default 24. */
|
|
85
85
|
watermarkFontSize?: number;
|
|
86
|
+
/** Usage-summary cache TTL (seconds). `0`/omitted = inherit (900). */
|
|
87
|
+
usageCacheTtl?: number;
|
|
88
|
+
/** Percent at which quota status becomes "warning". `0`/omitted = inherit (70). */
|
|
89
|
+
usageWarningThreshold?: number;
|
|
90
|
+
/** Percent at which quota status becomes "critical". `0`/omitted = inherit (90). */
|
|
91
|
+
usageCriticalThreshold?: number;
|
|
92
|
+
/** Number of largest folders the usage dashboard returns. `0`/omitted = inherit (10). */
|
|
93
|
+
usageTopFoldersCount?: number;
|
|
94
|
+
/** Folder grouping depth for the usage breakdown. `0`/omitted = inherit (1). */
|
|
95
|
+
usageFolderDepth?: number;
|
|
86
96
|
}
|
|
87
97
|
interface CreateTokenOptions extends BaseTokenOptions {
|
|
88
98
|
/** Disk names the token may access. */
|
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,16 @@ interface BaseTokenOptions {
|
|
|
83
83
|
watermarkOpacity?: number;
|
|
84
84
|
/** Font size for text watermark. Default 24. */
|
|
85
85
|
watermarkFontSize?: number;
|
|
86
|
+
/** Usage-summary cache TTL (seconds). `0`/omitted = inherit (900). */
|
|
87
|
+
usageCacheTtl?: number;
|
|
88
|
+
/** Percent at which quota status becomes "warning". `0`/omitted = inherit (70). */
|
|
89
|
+
usageWarningThreshold?: number;
|
|
90
|
+
/** Percent at which quota status becomes "critical". `0`/omitted = inherit (90). */
|
|
91
|
+
usageCriticalThreshold?: number;
|
|
92
|
+
/** Number of largest folders the usage dashboard returns. `0`/omitted = inherit (10). */
|
|
93
|
+
usageTopFoldersCount?: number;
|
|
94
|
+
/** Folder grouping depth for the usage breakdown. `0`/omitted = inherit (1). */
|
|
95
|
+
usageFolderDepth?: number;
|
|
86
96
|
}
|
|
87
97
|
interface CreateTokenOptions extends BaseTokenOptions {
|
|
88
98
|
/** Disk names the token may access. */
|
package/dist/index.js
CHANGED
|
@@ -167,6 +167,11 @@ function applyTenantOverrides(payload, opts) {
|
|
|
167
167
|
if (opts.watermarkOpacity !== void 0) payload.watermark_opacity = opts.watermarkOpacity;
|
|
168
168
|
if (opts.watermarkFontSize && opts.watermarkFontSize > 0) payload.watermark_font_size = Math.trunc(opts.watermarkFontSize);
|
|
169
169
|
}
|
|
170
|
+
if (opts.usageCacheTtl && opts.usageCacheTtl > 0) payload.usage_cache_ttl = Math.trunc(opts.usageCacheTtl);
|
|
171
|
+
if (opts.usageWarningThreshold && opts.usageWarningThreshold > 0) payload.usage_warning_threshold = Math.trunc(opts.usageWarningThreshold);
|
|
172
|
+
if (opts.usageCriticalThreshold && opts.usageCriticalThreshold > 0) payload.usage_critical_threshold = Math.trunc(opts.usageCriticalThreshold);
|
|
173
|
+
if (opts.usageTopFoldersCount && opts.usageTopFoldersCount > 0) payload.usage_top_folders_count = Math.trunc(opts.usageTopFoldersCount);
|
|
174
|
+
if (opts.usageFolderDepth && opts.usageFolderDepth > 0) payload.usage_folder_depth = Math.trunc(opts.usageFolderDepth);
|
|
170
175
|
}
|
|
171
176
|
function validateByobDisk(name, config) {
|
|
172
177
|
if (!config || config.driver !== "s3") {
|
package/dist/index.mjs
CHANGED
|
@@ -145,6 +145,11 @@ function applyTenantOverrides(payload, opts) {
|
|
|
145
145
|
if (opts.watermarkOpacity !== void 0) payload.watermark_opacity = opts.watermarkOpacity;
|
|
146
146
|
if (opts.watermarkFontSize && opts.watermarkFontSize > 0) payload.watermark_font_size = Math.trunc(opts.watermarkFontSize);
|
|
147
147
|
}
|
|
148
|
+
if (opts.usageCacheTtl && opts.usageCacheTtl > 0) payload.usage_cache_ttl = Math.trunc(opts.usageCacheTtl);
|
|
149
|
+
if (opts.usageWarningThreshold && opts.usageWarningThreshold > 0) payload.usage_warning_threshold = Math.trunc(opts.usageWarningThreshold);
|
|
150
|
+
if (opts.usageCriticalThreshold && opts.usageCriticalThreshold > 0) payload.usage_critical_threshold = Math.trunc(opts.usageCriticalThreshold);
|
|
151
|
+
if (opts.usageTopFoldersCount && opts.usageTopFoldersCount > 0) payload.usage_top_folders_count = Math.trunc(opts.usageTopFoldersCount);
|
|
152
|
+
if (opts.usageFolderDepth && opts.usageFolderDepth > 0) payload.usage_folder_depth = Math.trunc(opts.usageFolderDepth);
|
|
148
153
|
}
|
|
149
154
|
function validateByobDisk(name, config) {
|
|
150
155
|
if (!config || config.driver !== "s3") {
|
package/package.json
CHANGED
package/src/token.ts
CHANGED
|
@@ -137,6 +137,13 @@ function applyTenantOverrides(payload: Record<string, unknown>, opts: BaseTokenO
|
|
|
137
137
|
if (opts.watermarkOpacity !== undefined) payload.watermark_opacity = opts.watermarkOpacity;
|
|
138
138
|
if (opts.watermarkFontSize && opts.watermarkFontSize > 0) payload.watermark_font_size = Math.trunc(opts.watermarkFontSize);
|
|
139
139
|
}
|
|
140
|
+
|
|
141
|
+
// Usage-dashboard claims.
|
|
142
|
+
if (opts.usageCacheTtl && opts.usageCacheTtl > 0) payload.usage_cache_ttl = Math.trunc(opts.usageCacheTtl);
|
|
143
|
+
if (opts.usageWarningThreshold && opts.usageWarningThreshold > 0) payload.usage_warning_threshold = Math.trunc(opts.usageWarningThreshold);
|
|
144
|
+
if (opts.usageCriticalThreshold && opts.usageCriticalThreshold > 0) payload.usage_critical_threshold = Math.trunc(opts.usageCriticalThreshold);
|
|
145
|
+
if (opts.usageTopFoldersCount && opts.usageTopFoldersCount > 0) payload.usage_top_folders_count = Math.trunc(opts.usageTopFoldersCount);
|
|
146
|
+
if (opts.usageFolderDepth && opts.usageFolderDepth > 0) payload.usage_folder_depth = Math.trunc(opts.usageFolderDepth);
|
|
140
147
|
}
|
|
141
148
|
|
|
142
149
|
/**
|
package/src/types.ts
CHANGED
|
@@ -85,6 +85,16 @@ export interface BaseTokenOptions {
|
|
|
85
85
|
watermarkOpacity?: number;
|
|
86
86
|
/** Font size for text watermark. Default 24. */
|
|
87
87
|
watermarkFontSize?: number;
|
|
88
|
+
/** Usage-summary cache TTL (seconds). `0`/omitted = inherit (900). */
|
|
89
|
+
usageCacheTtl?: number;
|
|
90
|
+
/** Percent at which quota status becomes "warning". `0`/omitted = inherit (70). */
|
|
91
|
+
usageWarningThreshold?: number;
|
|
92
|
+
/** Percent at which quota status becomes "critical". `0`/omitted = inherit (90). */
|
|
93
|
+
usageCriticalThreshold?: number;
|
|
94
|
+
/** Number of largest folders the usage dashboard returns. `0`/omitted = inherit (10). */
|
|
95
|
+
usageTopFoldersCount?: number;
|
|
96
|
+
/** Folder grouping depth for the usage breakdown. `0`/omitted = inherit (1). */
|
|
97
|
+
usageFolderDepth?: number;
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
export interface CreateTokenOptions extends BaseTokenOptions {
|