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