diff --git a/lib/types/pax8.ts b/lib/types/pax8.ts new file mode 100644 index 0000000..c62e6d8 --- /dev/null +++ b/lib/types/pax8.ts @@ -0,0 +1,80 @@ +/** + * Type definitions for the PAX8 REST API (v1) and the shapes Pulse persists. + * Source spec lives at `https://devx.pax8.com`. + * + * Only the slices Pulse consumes are typed — PAX8 exposes a much larger + * surface (marketplace/provisioning endpoints Pulse never calls as a + * partner/reseller). Long-tail fields fall back to the `[key: string]: + * unknown` escape hatch on each interface, matching lib/types/appgate.ts. + */ + +// ─── API response shapes ────────────────────────────────────────────────── + +export interface Pax8PageEnvelope { + content: T[]; + page: { + size: number; + totalElements: number; + totalPages: number; + number: number; + }; +} + +export interface Pax8Company { + id: string; + name: string; + externalId: string | null; + website: string | null; + status: string | null; + city: string | null; + stateOrProvince: string | null; + postalCode: string | null; + country: string | null; + [key: string]: unknown; // escape hatch for fields not yet modeled +} + +export interface Pax8Subscription { + id: string; + companyId: string; + productId: string; + quantity: number; + billingTerm: string | null; + status: string | null; + startDate: string | null; + [key: string]: unknown; // escape hatch for fields not yet modeled +} + +export interface Pax8Product { + id: string; + sku: string; + vendorSku: string | null; + name: string; + category: string | null; + [key: string]: unknown; // escape hatch for fields not yet modeled + // NOTE: the deprecated alternate-vendor-SKU field per PAX8's own schema is intentionally omitted. +} + +// Modeled on PAX8's Invoice object (not the bare Order object, which lacks +// pricing/status) — see 10-RESEARCH.md Pitfall 1. +export interface Pax8Order { + id: string; + companyId: string; + orderDate: string | null; + total: number | null; + status: string | null; + currencyCode: string | null; + [key: string]: unknown; // escape hatch for fields not yet modeled +} + +// Modeled on PAX8's Invoice Item object (not the bare LineItem object, +// which lacks pricing) — see 10-RESEARCH.md Pitfall 1. +export interface Pax8OrderItem { + id: string; + orderId: string; + productId: string; + quantity: number; + price: number | null; + subTotal: number | null; + currencyCode: string | null; + [key: string]: unknown; // escape hatch for fields not yet modeled +}