@funcd-dev/shim 0.8.2 → 0.10.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/blob.d.ts CHANGED
@@ -1,5 +1,7 @@
1
- /** Options for a presigned URL: the HTTP method it grants (default GET) and its lifetime (a Go duration
2
- * string, e.g. "15m"; the driver's default when omitted). A PUT/DELETE URL requires s3::write. */
1
+ /** Options for a presigned URL: the HTTP method it grants (default GET) and its lifetime, a duration string
2
+ * such as "10m" or "1h30m" (funcd ADR-0198: units h, m, s, ms in that order, whole seconds from 1s to 168h). The
3
+ * server checks it and answers 400 for a bad value, "" included; only an absent expiry gets the driver's default.
4
+ * A PUT/DELETE URL requires s3::write. */
3
5
  export interface SignOptions {
4
6
  method?: 'GET' | 'PUT' | 'DELETE';
5
7
  expiry?: string;
package/dist/blob.js CHANGED
@@ -78,7 +78,7 @@ export function makeBlob(member) {
78
78
  },
79
79
  async signedUrl(binding, key, opts) {
80
80
  let path = `${keyPath(binding, key)}?sign=1&method=${enc(opts?.method ?? 'GET')}`;
81
- if (opts?.expiry)
81
+ if (opts?.expiry != null)
82
82
  path += `&expiry=${enc(opts.expiry)}`;
83
83
  const r = await request('GET', path);
84
84
  if (!ok(r))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funcd-dev/shim",
3
- "version": "0.8.2",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "Types and the contract build for writing funcd functions in TypeScript",
6
6
  "license": "Apache-2.0",