import { Order } from '@platform-modules/commerce-orders';
export { Actor, BuyerRef, Order, OrderLine, ProductKind } from '@platform-modules/commerce-orders';
import { F as FulfillmentPorts } from './seams-DLXi9hfQ.js';
export { B as BuyLabelArgs, C as CarrierAdapter, a as CarrierCapabilities, S as StorageAdapter } from './seams-DLXi9hfQ.js';
import { c as FulfillmentResult, d as FulfillmentSchema } from './schema-BKDZ5rS8.js';
export { e as AccessGrant, A as Address, C as CarrierTrackResult, a as CarrierWebhookResult, b as FulfillmentDbSchema, f as FulfillmentKind, F as FulfillmentNotification, g as FulfillmentOverall, L as Label, h as LineFulfillmentOutcome, S as SHIPMENT_STATUSES, i as Shipment, j as ShipmentStatus, U as UUID_RE, V as VOUCHER_STATES, k as Voucher, l as VoucherState, m as accessGrant, n as assertPositiveInt, o as assertUuid, p as carrierWebhookEvent, q as fulfillmentDbSchema, r as fulfillmentSchema, s as normalizeEmail, t as ownerKeyOf, u as shipment, v as voucher } from './schema-BKDZ5rS8.js';
import { Querier } from '@platform-modules/db';
export { grantDigitalAccess, issueDownloadToken } from './digital.js';
export { RedeemDecision, RedeemEvent, decideRedemption, issueVoucher, redeemVoucher } from './voucher.js';
export { buyShippingLabel, createShipment, handleCarrierWebhook, trackShipment } from './physical.js';
import 'drizzle-orm/pg-core';

declare function fulfillOrder(ports: FulfillmentPorts, order: Order): Promise<FulfillmentResult>;

declare class FulfillmentMigrateError extends Error {
    readonly detail: string;
    readonly name = "FulfillmentMigrateError";
    readonly code: "FULFILLMENT_MIGRATE";
    constructor(detail: string);
}
declare function isFulfillmentMigrateError(e: unknown): e is FulfillmentMigrateError;
declare function pushSchema(db: Querier<FulfillmentSchema>): Promise<void>;

declare class FulfillmentValidationError extends Error {
    readonly field: string;
    readonly name = "FulfillmentValidationError";
    readonly code: "FULFILLMENT_VALIDATION";
    constructor(field: string);
}
declare class VoucherAlreadyRedeemedError extends Error {
    readonly voucherId: string;
    readonly name = "VoucherAlreadyRedeemedError";
    readonly code: "VOUCHER_ALREADY_REDEEMED";
    readonly httpStatus: 409;
    constructor(voucherId: string);
}
declare class VoucherExpiredError extends Error {
    readonly voucherId: string;
    readonly name = "VoucherExpiredError";
    readonly code: "VOUCHER_EXPIRED";
    readonly httpStatus: 422;
    constructor(voucherId: string);
}
declare class VoucherWrongVendorError extends Error {
    readonly context: {
        voucherId: string;
        scanningVendorId: string;
    };
    readonly name = "VoucherWrongVendorError";
    readonly code: "VOUCHER_WRONG_VENDOR";
    readonly httpStatus: 403;
    constructor(context: {
        voucherId: string;
        scanningVendorId: string;
    });
}
declare class LabelPurchaseError extends Error {
    readonly shipmentId: string;
    readonly detail: string;
    readonly name = "LabelPurchaseError";
    readonly code: "LABEL_PURCHASE";
    readonly httpStatus: 502;
    constructor(shipmentId: string, detail: string);
}
declare class UnfulfillableLineError extends Error {
    readonly context: {
        orderId: string;
        lineId: string;
        kind: string;
    };
    readonly name = "UnfulfillableLineError";
    readonly code: "UNFULFILLABLE_LINE";
    readonly httpStatus: 422;
    constructor(context: {
        orderId: string;
        lineId: string;
        kind: string;
    });
}
declare class DownloadNotFoundError extends Error {
    readonly grantId: string;
    readonly name = "DownloadNotFoundError";
    readonly code: "DOWNLOAD_NOT_FOUND";
    readonly httpStatus: 404;
    constructor(grantId: string);
}
declare function isFulfillmentValidationError(e: unknown): e is FulfillmentValidationError;
declare function isVoucherAlreadyRedeemedError(e: unknown): e is VoucherAlreadyRedeemedError;
declare function isVoucherExpiredError(e: unknown): e is VoucherExpiredError;
declare function isVoucherWrongVendorError(e: unknown): e is VoucherWrongVendorError;
declare function isLabelPurchaseError(e: unknown): e is LabelPurchaseError;
declare function isUnfulfillableLineError(e: unknown): e is UnfulfillableLineError;
declare function isDownloadNotFoundError(e: unknown): e is DownloadNotFoundError;

export { DownloadNotFoundError, FulfillmentMigrateError, FulfillmentPorts, FulfillmentResult, FulfillmentSchema, FulfillmentValidationError, LabelPurchaseError, UnfulfillableLineError, VoucherAlreadyRedeemedError, VoucherExpiredError, VoucherWrongVendorError, fulfillOrder, isDownloadNotFoundError, isFulfillmentMigrateError, isFulfillmentValidationError, isLabelPurchaseError, isUnfulfillableLineError, isVoucherAlreadyRedeemedError, isVoucherExpiredError, isVoucherWrongVendorError, pushSchema };
