@vxil/sdk 0.36.0 → 0.37.0
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.ts +9 -1
- package/dist/index.js +7 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -341,6 +341,10 @@ export interface FeatureConfig {
|
|
|
341
341
|
/** cms writes only (PUT /v1/config/cms): what the write changed in
|
|
342
342
|
* `features.cms.rules[]` (the App builder apps' rules). */
|
|
343
343
|
rules_summary?: ConfigRulesSummary;
|
|
344
|
+
/** A config write whose body had top-level keys the feature does not declare
|
|
345
|
+
* (every feature but cms, which answers 422): those keys were not stored,
|
|
346
|
+
* and a setting sent under a misspelled key keeps its default. */
|
|
347
|
+
warnings?: string[];
|
|
344
348
|
}
|
|
345
349
|
/** One rules[] entry as a cms config write reports it. */
|
|
346
350
|
export interface ConfigRuleLine {
|
|
@@ -6734,10 +6738,14 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
|
|
|
6734
6738
|
* download; omitted = raster images inline, everything else attachment.
|
|
6735
6739
|
* `filename` sets the name the browser saves (sanitised server-side:
|
|
6736
6740
|
* control/bidi characters dropped, `/` → `_`, ≤ 200 characters; sent as
|
|
6737
|
-
* RFC 6266 `filename*`), default the upload's filename.
|
|
6741
|
+
* RFC 6266 `filename*`), default the upload's filename. `user_id`
|
|
6742
|
+
* (narrowing only): minted only when the object is that end user's
|
|
6743
|
+
* personal upload, else 404 — a server acting for one user never hands
|
|
6744
|
+
* out someone else's file. */
|
|
6738
6745
|
downloadUrl: (objectId: string, opts?: {
|
|
6739
6746
|
disposition?: "inline" | "attachment";
|
|
6740
6747
|
filename?: string;
|
|
6748
|
+
user_id?: string;
|
|
6741
6749
|
}) => Promise<string>;
|
|
6742
6750
|
/** Mint up to 100 presigned GETs in ONE call (`GET /v1/files/download-urls`)
|
|
6743
6751
|
* — a gallery page costs one request, not one per image. `urls[]` keeps
|
package/dist/index.js
CHANGED
|
@@ -2532,13 +2532,19 @@ export class Vxil {
|
|
|
2532
2532
|
* download; omitted = raster images inline, everything else attachment.
|
|
2533
2533
|
* `filename` sets the name the browser saves (sanitised server-side:
|
|
2534
2534
|
* control/bidi characters dropped, `/` → `_`, ≤ 200 characters; sent as
|
|
2535
|
-
* RFC 6266 `filename*`), default the upload's filename.
|
|
2535
|
+
* RFC 6266 `filename*`), default the upload's filename. `user_id`
|
|
2536
|
+
* (narrowing only): minted only when the object is that end user's
|
|
2537
|
+
* personal upload, else 404 — a server acting for one user never hands
|
|
2538
|
+
* out someone else's file. */
|
|
2536
2539
|
downloadUrl: async (objectId, opts = {}) => {
|
|
2537
2540
|
const q = [];
|
|
2538
2541
|
if (opts.disposition !== undefined)
|
|
2539
2542
|
q.push(`disposition=${encodeURIComponent(opts.disposition)}`);
|
|
2540
2543
|
if (opts.filename !== undefined)
|
|
2541
2544
|
q.push(`filename=${encodeURIComponent(opts.filename)}`);
|
|
2545
|
+
// narrowing only: minted only when the object is this end user's personal upload (else 404)
|
|
2546
|
+
if (opts.user_id !== undefined)
|
|
2547
|
+
q.push(`user_id=${encodeURIComponent(opts.user_id)}`);
|
|
2542
2548
|
const qs = q.join('&');
|
|
2543
2549
|
return (await this.call('GET', `/v1/files/${encodeURIComponent(objectId)}/download-url${qs ? `?${qs}` : ''}`)).data.download_url;
|
|
2544
2550
|
},
|
package/package.json
CHANGED