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

    Manage the per-customer origin allowlist and reconcile the aggregate allowlist onto the entity-document S3 buckets' CORS configuration.

    Hierarchy (View Summary)

    Index
    db: B2bDatabase
    • Add an origin to the customer's allowlist and reconcile the buckets. The origin is canonicalized (lower-cased scheme/host) before storage.

      Parameters

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

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

    • Push the aggregate origin allowlist (all customers' origins merged with the base origins) onto both entity-document buckets' CORS configuration.

      Standalone repair entrypoint: opens its own transaction, acquires the advisory lock, and reconciles. create/update/delete do NOT call this — they run the reconcile INLINE within their own mutation tx (via reconcileWithin) so the row write and the CORS write are atomic.

      Returns Promise<{ ok: true; value: { origins: string[] } }>

    • Parameters

      • __namedParameters: { customerId: string; origin?: string; page?: number; pageSize?: number }
        • customerId: string
        • Optionalorigin?: string

          Exact-match filter on the canonical origin

        • Optionalpage?: number

          Defaults to 1

        • OptionalpageSize?: number

          Defaults to 50

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

      The customer's allowlisted origins, ordered by origin, paginated.

    • Replace an allowlist entry's origin and reconcile the buckets.

      Parameters

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

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