Packages narrative
packages / db

db

Functions

NameDescription
cartLineCustomPropertyMaps a
convexIdentityMutationCalls a deployed Convex mutation by path on an identity-authenticated client — the bearer-token companion to
convexIdentityQueryCalls a deployed Convex query by path on an identity-authenticated client — the read-side companion of
convexServerMutationCalls a deployed Convex
convexServerQueryCalls a deployed Convex
createConvexIdentityClientConstructs a FRESH Convex client for identity-authenticated calls — the CONVEXCORE-16 seam the admin app's editor bridge drives. Deliberately NOT the cached module client used by the server-secret transports: an identity client carries a per-request operator bearer token via
deriveCatalogBuckets
isQuotedProductCardKeyReports whether a product-card knob's value is logical content the serializer wraps in CSS quotes on emit (
isSectionFlagKeyReports whether a feature flag key is namespaced as a section toggle.
kebabCaseConverts a camelCase token key to kebab-case for use in a CSS custom-property name.
productCardCustomPropertyMaps a
resolveThemeResolves a shop's authored theme overrides against the platform defaults into a fully-populated token map. This is the single default-resolution entry point: the storefront serializer (P3-2) calls it and never reaches for a literal default itself. A shop with no
sectionFlagKeyBuilds the namespaced storage key for a section toggle from a bare section id.
serializeThemeToCssVarsSerializes a shop's resolved theme into the ordered list of CSS custom-property declarations the storefront emits, so SSR and the admin live-preview compute the same output byte-for-byte. The function is pure and isomorphic (no

Classes

NameDescription
FeatureFlagServiceFeatureFlag service backed by the deployed
ReviewServiceReview service backed by the deployed
ShopServiceRead service for the

Interfaces

NameDescription
FeatureFlagOptionOne selectable option in a feature flag's
FeatureFlagRefEmbedded reference in a shop's
ResolvedCartLineTokensTenant-tunable cart-line knobs. Mirrors the product-card token pattern (a flat map serialized diff-from-default onto
ResolvedProductCardTokensFlat per-knob token map for the product card. Keys are the camelCase mirror of the
ResolvedShopThemeFully-populated, platform-defaulted theme token map for a single shop. Every field carries a concrete platform default (sourced from
ShopBaseRaw document shape for a multi-tenant shop record. Extends
ShopCollaboratorCanonical join row relating a shop to one collaborating user. De-embedded from the prior shape that nested the full
TargetingRuleOne rule in a feature flag's targeting configuration.

Types

NameDescription
AccentTokenA single brand accent swatch. Shared between the required
BaseDocumentBaseline shape for every document in this package: the flat
BaseTimestampsManaged timestamp fields every document carries. The Convex rows persist these as epoch-ms numbers (preserving the source Mongo
CommerceProviderDiscriminated union of all supported commerce provider configurations. Narrow by
CommerceProvidersLiteral union of valid commerce provider type strings, constrained to the same set as the runtime
DocumentExtrasString
DomainVerificationPublic connection state of one routable domain, as surfaced by the admin connect screen. Legacy rows (no stored
DomainVerificationInputWrite payload for
FeatureFlagBaseResolved document shape for a feature flag record. Combines
FeatureFlagKindDiscriminator for a feature flag's intent.
FindOptionsControls how
FontFamilyKeyUnion of valid
IdentifiableMarks an entity as having a URL-safe
IdentityBaseDocument shape for an OAuth provider link attached to a user. Stores the provider name, the provider-scoped identity ID, optional token fields, and the token expiry date. Lives as an element of the embedded
JsonValueJSON-serializable value accepted as a feature flag
LimitFiltersUnion of pagination shapes accepted by service query methods. Callers may pass either a plain
NullableAdds
OnlineShopClient-safe shop shape returned by all
OptionalConverts every key of
PayloadTypeFallback widget kind for a theme token's generic form control — the four kinds the editor's auto-render offers when no richer
ReviewBaseDocument shape for a shop review.
ShopifyCommerceProviderAuth and connection configuration for the Shopify commerce integration. Identifies the storefront via
ShopThemeTokensAuthored, all-optional theme overrides stored on the shop record (
StripeCommerceProviderAuth configuration shape for the Stripe commerce integration. Currently a placeholder — the
ThemeBrandingResolved primary/secondary brand accents fed to
ThemeCssVarOne emitted CSS declaration as a
ThemeGroupTop-level catalog grouping, mirroring the structure of
ThemeResolutionInputMinimal shop shape accepted by
ThemeTokenMetaMetadata describing exactly one
ThemeTokenPathA persisted dotted theme path (
UserBaseDocument shape for a platform user. Carries an embedded list of OAuth identities and satisfies the NextAuth adapter contract — specifically the optional
ValueKindThe kind of value a theme token holds, driving which admin control renders for it.

Variables

NameDescription
CommerceProviders
FeatureFlag
FONT_FAMILIESAllowlist of selectable font families, keyed by a stable slug with a human-readable label. This is the single source of truth shared by the CMS
Review
SECTION_FLAG_PREFIXKey namespace that marks a feature flag as a data-driven page-section toggle. Section flags gate whether a generic, per-shop section renders without a code deploy; the prefix lets the admin UI and key validation recognize them without a separate lookup. Lives in this Mongoose-free leaf module (not
Shop
THEME_DEFAULTSThe single source of truth for platform theme defaults. Mirrors the literal values emitted by
THEME_TOKEN_CATALOGThe complete, declaration-ordered token catalog. Every entry mirrors exactly one
User

On this page