@nextlyhq/storage-s3 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 +51 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +51 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
|
|
3
3
|
let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
|
|
4
4
|
let _aws_sdk_s3_request_presigner = require("@aws-sdk/s3-request-presigner");
|
|
5
|
-
// ../nextly/dist/nextly-error-
|
|
5
|
+
// ../nextly/dist/nextly-error-DetCjZnO.mjs
|
|
6
6
|
function isDbError(err) {
|
|
7
7
|
if (!err || typeof err !== "object") return false;
|
|
8
8
|
const obj = err;
|
|
@@ -415,6 +415,55 @@ var NextlyError = class NextlyError extends Error {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
|
+
* Something only a signed-in person can do, asked by a caller that is not
|
|
419
|
+
* one: an API key, or a request acting as no person. Forbidden, and the
|
|
420
|
+
* message says so, since it is about what kind of caller asked, not about
|
|
421
|
+
* the caller's permissions. `doing` completes "Only a signed-in person can".
|
|
422
|
+
*/
|
|
423
|
+
static personOnly(opts) {
|
|
424
|
+
return new NextlyError({
|
|
425
|
+
code: "FORBIDDEN",
|
|
426
|
+
publicMessage: `Only a signed-in person can ${opts.doing}.`,
|
|
427
|
+
logContext: opts.logContext
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* A role or permission built into Nextly, which is never changed or
|
|
432
|
+
* deleted. Forbidden, and the message says so: it is a fact about the role,
|
|
433
|
+
* not about the caller's permissions.
|
|
434
|
+
*/
|
|
435
|
+
static builtIn(opts) {
|
|
436
|
+
return new NextlyError({
|
|
437
|
+
code: "FORBIDDEN",
|
|
438
|
+
publicMessage: `This ${opts.thing} is built in, so it can't be ${opts.change === "change" ? "changed" : "deleted"}.`,
|
|
439
|
+
logContext: opts.logContext
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* A request from a site not allowed to make it: its own `Origin` names a
|
|
444
|
+
* site the installation does not allow. Forbidden, and the message says so;
|
|
445
|
+
* the origin is the caller's own, so naming its kind tells them nothing.
|
|
446
|
+
*/
|
|
447
|
+
static originRefused(opts) {
|
|
448
|
+
return new NextlyError({
|
|
449
|
+
code: "FORBIDDEN",
|
|
450
|
+
publicMessage: "This request came from a site that isn't allowed to make it.",
|
|
451
|
+
logContext: opts?.logContext
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* A Single deleted without `force`: Singles hold a site's lasting settings,
|
|
456
|
+
* so they are not deleted from here, only by an admin or CLI clean-up that
|
|
457
|
+
* passes `force`. Forbidden, and the message says so.
|
|
458
|
+
*/
|
|
459
|
+
static singleNotDeletable(opts) {
|
|
460
|
+
return new NextlyError({
|
|
461
|
+
code: "FORBIDDEN",
|
|
462
|
+
publicMessage: "A Single can't be deleted from here.",
|
|
463
|
+
logContext: opts?.logContext
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
418
467
|
* A collection, Single or component defined in code, which is changed by
|
|
419
468
|
* changing its code and not from here. Forbidden, and the message says so:
|
|
420
469
|
* it is a fact about the thing, not about the caller's permissions, so it
|
|
@@ -644,7 +693,7 @@ var NextlyError = class NextlyError extends Error {
|
|
|
644
693
|
return NextlyError.isCode(err, "RATE_LIMITED");
|
|
645
694
|
}
|
|
646
695
|
};
|
|
647
|
-
// ../nextly/dist/validate-external-url-
|
|
696
|
+
// ../nextly/dist/validate-external-url-CfT2WjgH.mjs
|
|
648
697
|
/** Default response body cap: reject anything larger before buffering it all. */
|
|
649
698
|
/**
|
|
650
699
|
* How many bytes a bounded external read may buffer, absent a caller's own cap.
|