import { SizeInBytes, Milliseconds, SizeInMegabytes, AccountQuotasPreset, AccountQuotasValuesDto, UploadLimit, MaxSeats } from "@upload-io/upload-shared-iso-lite"; function fromBandwidth( seats: number, uploads: number, fileSizeBytes: number, gb: number, gbForHours: number = gb ): AccountQuotasValuesDto { return { acceleratedUploadBandwidth: SizeInMegabytes(0), bandwidth: SizeInMegabytes(gb * 1024), // n * 1GB cpu: Milliseconds((gbForHours * 60 * 60 * 1000) / 10), // n * 0.1 CPU hours storage: SizeInBytes(gb * 1024 * 1024 * 1024), // n * 1GB seats: MaxSeats(seats), cacheInvalidations: seats * 10, // Seems sensible. uploads: UploadLimit(uploads), maxFileSize: SizeInBytes(fileSizeBytes) }; } const mb = 1024 * 1024; const gb = mb * 1024; export const accountQuotasPresets: Record = { // Current plans. "10": fromBandwidth(1, 20000, 50 * mb, 10), // The cost of an upload (request) is: $0.00005023 (2 Lambda Requests + 2 Lambda GBsecs + 2 CloudFront Requests + 3 S3 Requests) "50": fromBandwidth(5, 100000, 500 * mb, 50), // SYNC: see "100" plan below and its comment. "300": fromBandwidth(20, 500000, 100 * gb, 300), // Old/unused plans. "freeTrial": fromBandwidth(1, 500, 10 * mb, 1), "free": fromBandwidth(1, 2000, 20 * mb, 10), "100": fromBandwidth(5, 100000, gb, 100), "150": fromBandwidth(5, 50000, 50 * gb, 150), "200": fromBandwidth(5, 40000, 40 * gb, 200), "250": fromBandwidth(5, 50000, 50 * gb, 250), "500": fromBandwidth(20, 20000, 10 * gb, 500), "750": fromBandwidth(20, 30000, 20 * gb, 750), "1024": fromBandwidth(20, 40000, 50 * gb, 1024, 1000) };