@nextlyhq/storage-vercel-blob 0.0.2-alpha.71 → 0.0.2-alpha.72

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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _vercel_blob = require("@vercel/blob");
3
- // ../nextly/dist/nextly-error-CwDiSPDF.mjs
3
+ // ../nextly/dist/nextly-error-DetCjZnO.mjs
4
4
  function isDbError(err) {
5
5
  if (!err || typeof err !== "object") return false;
6
6
  const obj = err;
@@ -413,6 +413,55 @@ var NextlyError = class NextlyError extends Error {
413
413
  });
414
414
  }
415
415
  /**
416
+ * Something only a signed-in person can do, asked by a caller that is not
417
+ * one: an API key, or a request acting as no person. Forbidden, and the
418
+ * message says so, since it is about what kind of caller asked, not about
419
+ * the caller's permissions. `doing` completes "Only a signed-in person can".
420
+ */
421
+ static personOnly(opts) {
422
+ return new NextlyError({
423
+ code: "FORBIDDEN",
424
+ publicMessage: `Only a signed-in person can ${opts.doing}.`,
425
+ logContext: opts.logContext
426
+ });
427
+ }
428
+ /**
429
+ * A role or permission built into Nextly, which is never changed or
430
+ * deleted. Forbidden, and the message says so: it is a fact about the role,
431
+ * not about the caller's permissions.
432
+ */
433
+ static builtIn(opts) {
434
+ return new NextlyError({
435
+ code: "FORBIDDEN",
436
+ publicMessage: `This ${opts.thing} is built in, so it can't be ${opts.change === "change" ? "changed" : "deleted"}.`,
437
+ logContext: opts.logContext
438
+ });
439
+ }
440
+ /**
441
+ * A request from a site not allowed to make it: its own `Origin` names a
442
+ * site the installation does not allow. Forbidden, and the message says so;
443
+ * the origin is the caller's own, so naming its kind tells them nothing.
444
+ */
445
+ static originRefused(opts) {
446
+ return new NextlyError({
447
+ code: "FORBIDDEN",
448
+ publicMessage: "This request came from a site that isn't allowed to make it.",
449
+ logContext: opts?.logContext
450
+ });
451
+ }
452
+ /**
453
+ * A Single deleted without `force`: Singles hold a site's lasting settings,
454
+ * so they are not deleted from here, only by an admin or CLI clean-up that
455
+ * passes `force`. Forbidden, and the message says so.
456
+ */
457
+ static singleNotDeletable(opts) {
458
+ return new NextlyError({
459
+ code: "FORBIDDEN",
460
+ publicMessage: "A Single can't be deleted from here.",
461
+ logContext: opts?.logContext
462
+ });
463
+ }
464
+ /**
416
465
  * A collection, Single or component defined in code, which is changed by
417
466
  * changing its code and not from here. Forbidden, and the message says so:
418
467
  * it is a fact about the thing, not about the caller's permissions, so it
@@ -659,7 +708,7 @@ function ipv4ToInt(ip) {
659
708
  }
660
709
  return acc >>> 0;
661
710
  }
662
- // ../nextly/dist/validate-external-url-CnZrcJdP.mjs
711
+ // ../nextly/dist/validate-external-url-CfT2WjgH.mjs
663
712
  const IPV4_RE = /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;
664
713
  /**
665
714
  * IPv4 CIDR ranges that must NEVER be the destination of an outbound