@nextlyhq/storage-s3 0.0.2-alpha.74 → 0.0.2-alpha.76
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 +25 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +25 -3
- 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-CezzIwjj.mjs
|
|
6
6
|
function isDbError(err) {
|
|
7
7
|
if (!err || typeof err !== "object") return false;
|
|
8
8
|
const obj = err;
|
|
@@ -120,6 +120,8 @@ const NEXTLY_ERROR_STATUS = {
|
|
|
120
120
|
NEXTLY_RESOLVE_LOCK_NOT_HELD: 409,
|
|
121
121
|
NEXTLY_BOOT_MIGRATIONS_NOT_RUN: 503,
|
|
122
122
|
NEXTLY_BOOT_MIGRATIONS_PENDING: 503,
|
|
123
|
+
NEXTLY_DATABASE_NOT_SET_UP: 503,
|
|
124
|
+
NEXTLY_DATABASE_NOT_MIGRATED: 503,
|
|
123
125
|
NEXTLY_CORE_DESTRUCTIVE_REFUSED: 409,
|
|
124
126
|
NEXTLY_MIGRATION_DRIFT: 409,
|
|
125
127
|
NEXTLY_MIGRATION_APPLY_FAILED: 500,
|
|
@@ -130,6 +132,8 @@ const NEXTLY_ERROR_STATUS = {
|
|
|
130
132
|
NEXTLY_MIGRATION_SNAPSHOT_MISSING: 404,
|
|
131
133
|
NEXTLY_MIGRATION_RESOLVE_DRIFT: 409,
|
|
132
134
|
NEXTLY_MIGRATION_RESOLVE_PRECONDITION: 409,
|
|
135
|
+
NEXTLY_MIGRATION_HISTORY_REFUSED: 409,
|
|
136
|
+
NEXTLY_SCHEMA_CONVERSION_UNCONFIRMED: 409,
|
|
133
137
|
NEXTLY_UI_SCHEMA_INVALID: 400,
|
|
134
138
|
NEXTLY_SCHEMA_SLUG_COLLISION: 409,
|
|
135
139
|
NEXTLY_SCHEMA_RELATION_TARGET_MISSING: 400,
|
|
@@ -681,10 +685,15 @@ var NextlyError = class NextlyError extends Error {
|
|
|
681
685
|
logContext: opts.logContext
|
|
682
686
|
});
|
|
683
687
|
}
|
|
688
|
+
/**
|
|
689
|
+
* `message` replaces the generic sentence where the caller can name what is
|
|
690
|
+
* already taken without leaking anything, such as a public address and the
|
|
691
|
+
* page holding it.
|
|
692
|
+
*/
|
|
684
693
|
static duplicate(opts) {
|
|
685
694
|
return new NextlyError({
|
|
686
695
|
code: "DUPLICATE",
|
|
687
|
-
publicMessage: "Resource already exists.",
|
|
696
|
+
publicMessage: opts?.message ?? "Resource already exists.",
|
|
688
697
|
logContext: opts?.logContext
|
|
689
698
|
});
|
|
690
699
|
}
|
|
@@ -782,6 +791,19 @@ var NextlyError = class NextlyError extends Error {
|
|
|
782
791
|
logContext: opts.logContext
|
|
783
792
|
});
|
|
784
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* A service outside Nextly failed, such as an email provider, where trying again may help: the
|
|
796
|
+
* job queue records it as an attempt's error and tries again.
|
|
797
|
+
*/
|
|
798
|
+
static externalService(opts) {
|
|
799
|
+
return new NextlyError({
|
|
800
|
+
code: "EXTERNAL_SERVICE_ERROR",
|
|
801
|
+
publicMessage: opts.publicMessage,
|
|
802
|
+
logMessage: opts.logMessage,
|
|
803
|
+
cause: opts.cause,
|
|
804
|
+
logContext: opts.logContext
|
|
805
|
+
});
|
|
806
|
+
}
|
|
785
807
|
static serviceUnavailable(opts) {
|
|
786
808
|
return new NextlyError({
|
|
787
809
|
code: "SERVICE_UNAVAILABLE",
|
|
@@ -854,7 +876,7 @@ var NextlyError = class NextlyError extends Error {
|
|
|
854
876
|
return NextlyError.isCode(err, "RATE_LIMITED");
|
|
855
877
|
}
|
|
856
878
|
};
|
|
857
|
-
// ../nextly/dist/validate-external-url-
|
|
879
|
+
// ../nextly/dist/validate-external-url-BGTmyj1s.mjs
|
|
858
880
|
/** Default response body cap: reject anything larger before buffering it all. */
|
|
859
881
|
/**
|
|
860
882
|
* How many bytes a bounded external read may buffer, absent a caller's own cap.
|