@cfxlabsinc/b2b-services
    Preparing search index...
    Index
    • Parameters

      • __namedParameters: { s3AccessKey?: string; s3Bucket: string; s3Region: string; s3Secret?: string }

      Returns AchFileS3Service

    s3Bucket: string
    • Read the object at key.

      An absent object comes back as S3_OBJECT_NOT_FOUND; a read S3 refused or could not serve comes back as S3_READ_FAILED. Callers get to tell those apart — the previous Buffer | null could not, so a denied permission and a wrong bucket both read as "missing".

      Parameters

      • key: string

      Returns Promise<{ ok: true; value: Buffer } | { error: FileS3ReadError; ok: false }>

    • Presigned GET URL for key, valid for expiresIn seconds.

      Existence is confirmed with a HEAD before signing. S3 signs a URL for any key, present or not, so signing blind hands the operator a link that looks good and lands on an S3 XML error page whenever the recorded path and the stored object disagree.

      Parameters

      • key: string
      • expiresIn: number = 3600

      Returns Promise<{ error: FileS3ReadError; ok: false } | { ok: true; value: string }>

    • Returns {
          s3AccessKey: string | undefined;
          s3Bucket: string;
          s3Region: string;
          s3Secret: string | undefined;
      }

    • Relocate the object at sourceKey to destinationKey. S3 has no rename, so this is a copy followed by a delete and it is not atomic.

      Re-runnable on purpose. An ACH file's key is derived from its status, so a relocation that died partway has to be finishable by running the same operation again — a source that is already gone with the object sitting at the destination is a completed move, not a failure, and resolves as ALREADY_AT_DESTINATION.

      An object at neither key throws. That is the one state no retry repairs: the record would advertise a key nothing is stored under, so the caller must not write a status on top of it.

      Parameters

      • sourceKey: string
      • destinationKey: string

      Returns Promise<S3MoveOutcome>