JavaScript SDKModulesInventory
Types
Public Inventory SDK TypeScript types.
The SDK exports public types that mirror the public API model, not the internal Convex table implementation. These types are generated into the SDK from the public Inventory field contract and validated against the Convex inventory schema.
import type {
InventoryItem,
InventoryItemField,
InventoryItemKind,
InventoryItemStatus,
InventoryItemSummary,
InventoryItemSummaryField,
ListInventoryItemsParams,
ListInventoryItemsResponse,
GetInventoryItemParams,
} from "@karybase/sdk";The package also exports field constants when you want to build selectors from the allowed model fields:
import {
INVENTORY_ITEM_FIELDS,
INVENTORY_ITEM_SUMMARY_FIELDS,
} from "@karybase/sdk";InventoryItemStatus
type InventoryItemStatus =
| "Draft"
| "Active"
| "Inactive"
| "Discontinued";InventoryItemSummary
List calls return summaries by default.
type InventoryItemSummary = {
_id: string;
_creationTime: number;
organizationId: string;
name: string;
description?: string;
sku?: string;
barcode?: string;
itemKind?: InventoryItemKind;
status?: InventoryItemStatus;
quantity?: number;
price?: number;
costPrice?: number;
brandId?: string;
supplierId?: string;
tags?: string[];
updatedAt?: number;
};InventoryItem
Detail calls return the full public item model by default.
type InventoryItem = InventoryItemSummary & {
parentItemId?: string;
variantAttributes?: InventoryVariantAttribute[];
variantOptions?: InventoryVariantOption[];
variantLabel?: string;
variantSignature?: string;
unit?: string;
storageLocation?: string;
lowStockThreshold?: number;
costUpdatedAt?: number;
currency?: string;
weight?: number;
weightUnit?: "kg" | "g" | "lb" | "oz";
customFields?: unknown;
images?: string[];
primaryImage?: string;
isConsumable?: boolean;
quickbooksItemId?: string;
quickbooksSyncToken?: string;
notes?: string;
};Generated Alignment
These public types are aligned to the Convex inventory item model fields that are intentionally exposed through the public API. Internal-only implementation details stay out of the SDK contract.