@nextlyhq/storage-s3 0.0.2-alpha.75 → 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.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-BElDQWyI.mjs
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,
@@ -788,6 +790,19 @@ var NextlyError = class NextlyError extends Error {
788
790
  logContext: opts.logContext
789
791
  });
790
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
+ }
791
806
  static serviceUnavailable(opts) {
792
807
  return new NextlyError({
793
808
  code: "SERVICE_UNAVAILABLE",
@@ -860,7 +875,7 @@ var NextlyError = class NextlyError extends Error {
860
875
  return NextlyError.isCode(err, "RATE_LIMITED");
861
876
  }
862
877
  };
863
- // ../nextly/dist/validate-external-url-DNl_UEVd.mjs
878
+ // ../nextly/dist/validate-external-url-BGTmyj1s.mjs
864
879
  /** Default response body cap: reject anything larger before buffering it all. */
865
880
  /**
866
881
  * How many bytes a bounded external read may buffer, absent a caller's own cap.