/** * @aquienpz/sdk/server — server-safe entry point. * * Use this subpath from Node.js, Bun, Cloud Run, Lambda, Vercel Functions, * edge runtimes, agents, cron jobs, BFFs — anywhere there's no `window` * and you want a hard guarantee that no browser-only code lands in your * bundle. The constructor REQUIRES `apiKey`; the type from `/web` omits * it, so the two modes never confuse each other. * * import { AquienpzClient } from "@aquienpz/sdk/server"; * * const aq = new AquienpzClient({ * endpoint: process.env.ASSET_MANAGER_URL!, * apiKey: process.env.ASSET_MANAGER_API_KEY!, // <- required * tenantCode: "realtyone-cr", * tenantId: 1, * // signingKey: optional, only for `aq.transform(..., { sign: true })` * }); * * const asset = await aq.assets.byHash(sha256); * const hero = aq.transform(asset, { width: 1920 }); * * // Typical BFF use: proxy a browser request through to aquienpz. * // The browser side calls `@aquienpz/sdk/web` against `/api/am/...` * // and your route handler forwards here with the real API key. * * What you get: * - `AquienpzClient` (slots/assets/usage APIs over plain fetch) * - URL builders: `getAssetUrl`, `getTransformUrl`, `getTransformSrcSet`, * `getHlsStreamingUrl`, `extractAssetSha`, `signTransformUrl` * - `aq.upload(bytes)` works with `Uint8Array` (Node 18+ / Bun ship Blob * globally; File-API workflows are documented on the /web subpath instead) * * What's NOT here (use `@aquienpz/sdk/web` instead): * - `createWebUploader` (multipart UploadTask with IndexedDB resume) * - `compressImage` (browser-side compressorjs + heic2any) * * Stripe/Cloudinary historically shipped two separate packages * (`stripe` vs `@stripe/stripe-js`, `cloudinary` vs `@cloudinary/url-gen`) * for this split. Modern providers (Vercel Blob, Uploadthing, Better * Auth, AI SDK) use subpaths within one package — same tree-shaking * guarantees, single version, no drift. We follow that pattern. */ import { type AquienpzClientOptions, AquienpzClient as BaseAquienpzClient, } from ".."; /** * Server-side constructor options — `apiKey` is REQUIRED here. Use this * type whenever you build a client behind a process boundary (Node, Bun, * Cloud Run, Vercel Functions, edge runtimes, BFFs). * * const aq = new AquienpzClient({ * endpoint: process.env.ASSET_MANAGER_URL!, * apiKey: process.env.ASSET_MANAGER_API_KEY!, * tenantCode: "realtyone-cr", * tenantId: 1, * }); */ export type ServerClientOptions = Required< Pick > & Pick; /** * Server-safe `AquienpzClient` — same runtime as the root class, but the * constructor type enforces `apiKey` so misconfiguration is a TS build * error, not a runtime 401. */ export class AquienpzClient extends BaseAquienpzClient { constructor(opts: ServerClientOptions) { super(opts); } } export { type AquienpzClientOptions, type AssetDTO, type AssetVariant, type ComposeMarketingComposition, type ComposeMarketingOptions, type ComposeMarketingResult, type ComposeMarketingSegment, type CompressOptions, // URL builders & related types (re-export from asset-client via root). computeVariantDimensions, extractAssetSha, getAssetDimensions, getAssetSrcSet, getAssetUrl, getHlsStreamingUrl, getSignedTransformUrl, getTenantId, getTransformSrcSet, getTransformUrl, getVideoTransformUrl, hasPreset, type PresignUploadUrlOptions, type RegenerateResult, type ResolveSlotOptions, type SignedTransformOptions, type SlotDTO, type SlotHistoryEntry, type SlotResolution, serializeTransform, setTenantId, signTransformUrl, type TransformEffect, type TransformFit, type TransformFormat, type TransformGravity, type TransformOptions, type UploadOptions, type UploadResult, type UploadUrlResult, type UsageDailyPoint, type UsagePerKey, type UsageSnapshot, type UsageWindow, type VariantPreset, } from "..";