@cfxlabsinc/b2b-services
    Preparing search index...
    Index
    db: B2bDatabase
    redirectCache: ServiceCache<CachedShortUrlLookup>
    • Parameters

      • __namedParameters: {
            customerId: string;
            expiresAt?: Date | null;
            name?: string | null;
            url: string;
        }

      Returns Promise<{ ok: true; value: ShortUrl }>

    • Parameters

      • __namedParameters: { customerId: string; id: string }

      Returns Promise<{ ok: true; value: void } | { error: ServiceError; ok: false }>

    • Resolve an unexpired short URL by its public external id. Used by the public redirect Lambda — intentionally not customer-scoped because the external id is globally unique (sqids-encoded primary key).

      Cache strategy: cache the row including expiresAt so the expiry check remains precise within the TTL window. Negative-cache null to absorb scanner traffic against nonexistent ids.

      Parameters

      • __namedParameters: { id: string }

      Returns Promise<string | null>

    • Parameters

      • __namedParameters: {
            customerId: string;
            expiresAt?: DbTimestampCriteria<Date>;
            ids?: string[];
            page?: number;
            pageSize?: number;
        }
        • customerId: string
        • OptionalexpiresAt?: DbTimestampCriteria<Date>

          Filter on the expiry timestamp; { before: "now" } = expired-only. NULL (never-expiring) rows are excluded whenever this criterion is set.

        • Optionalids?: string[]
        • Optionalpage?: number
        • OptionalpageSize?: number

      Returns Promise<
          {
              ok: true;
              value: { hasNext: boolean; items: ShortUrl[]; total: number };
          },
      >

    • Parameters

      • __namedParameters: {
            customerId: string;
            data: { expiresAt?: Date | null; name?: string | null; url?: string };
            id: string;
        }

      Returns Promise<{ error: ServiceError; ok: false } | { ok: true; value: ShortUrl }>