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

    Constructors

    Properties

    redirectCache: ServiceCache<CachedShortUrlLookup>

    Methods

    • Parameters

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

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

    • 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; ids?: string[]; page?: number; pageSize?: 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 }>