@nymbalhq/platform 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { NymbalConfig } from '@nymbalhq/config';
2
- import { Logger, DocumentStoreAdapter, EventBusAdapter, Product, ProductStatus, ProductType, ProductMedia, Variant, VariantDimensions, VariantOption, VariantStatus, Category, Customer, Role, CustomerAddress, Order, OrderStatus, Address, OrderLineItem, CaptureMethod, OrderHistoryEntry, OrderRefundStatus, OrderRefund, InventoryReservation, StockAdjustmentReason, StockAdjustment, Review, ReviewModerationStatus, NymbalEvent, Cart, PutOptions, QueryParams, QueryResult, EventHandler, SubscriptionConfig, Subscription, NymbalEnvironment, NymbalEventType, NymbalEventMap, PaymentsAdapter, EmailAdapter, ReviewsAdapter, SearchAdapter, AnalyticsAdapter, ShippingAdapter, TaxAdapter, AiAdapter, SecurityAdapter, ProductSnapshot, CartItem, StockStatus, PaymentIntent, CheckoutPayment, SearchParams, SearchResult, OrderPayment, Refund, HttpAdapter, CommerceSlot, RateLimitAction, SecurityConfigLike } from '@nymbalhq/types';
2
+ import { Logger, DocumentStoreAdapter, EventBusAdapter, MediaStorage, Product, ProductStatus, ProductType, ProductMedia, Variant, VariantDimensions, VariantOption, VariantStatus, Category, Customer, Role, CustomerAddress, Order, OrderStatus, Address, OrderLineItem, CaptureMethod, OrderHistoryEntry, OrderRefundStatus, OrderRefund, InventoryReservation, StockAdjustmentReason, StockAdjustment, Review, ReviewModerationStatus, NymbalEvent, Cart, HealthReport, PutOptions, QueryParams, QueryResult, EventHandler, SubscriptionConfig, Subscription, NymbalEnvironment, NymbalEventType, NymbalEventMap, CommerceSlotAdapters, SecurityAdapter, AiAdapter, PaymentsAdapter, ProductSnapshot, CartItem, StockStatus, PaymentIntent, CheckoutPayment, SearchParams, SearchResult, SearchAdapter, OrderPayment, Refund, HttpAdapter, CommerceSlot, Slot, RateLimitAction, SecurityConfigLike, EmailAdapter, ReviewsAdapter, AnalyticsAdapter, ShippingAdapter, TaxAdapter, HealthStatus } from '@nymbalhq/types';
3
+ export { MediaStorage } from '@nymbalhq/types';
3
4
  import BetterSqlite3 from 'better-sqlite3';
4
5
  import pg from 'pg';
5
6
  import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
6
7
  import { NodePgDatabase } from 'drizzle-orm/node-postgres';
7
- import { postgresSchema, sqliteSchema } from './db/schema/index.js';
8
+ import { sqliteSchema, postgresSchema } from './db/schema/index.js';
8
9
  import { JWTPayload } from 'jose';
9
10
  import { ZodTypeAny } from 'zod';
10
11
  import 'drizzle-orm/sqlite-core';
@@ -54,9 +55,16 @@ type RawClients = {
54
55
  interface CommandStoreOptions {
55
56
  sqlitePath?: string;
56
57
  postgresUrl?: string;
58
+ /**
59
+ * For a caller that must change nothing: SQLite opens `readonly` on a file that must already exist, with no pragma
60
+ * (`journal_mode = WAL` rewrites a rollback-mode file's header); Postgres runs every transaction read-only.
61
+ */
62
+ readOnly?: boolean;
57
63
  }
58
64
  /** For migrations, seeding and tests only; no repository or service imports it. */
59
65
  declare function rawClients(store: CommandStore): RawClients;
66
+ /** The SQLite file a store opens: `sqlitePath`, else `NYMBAL_SQLITE_PATH`, else `./nymbal.db`. */
67
+ declare function sqliteFile(options?: CommandStoreOptions): string;
60
68
  declare function createCommandStore(config: NymbalConfig, options?: CommandStoreOptions): CommandStore;
61
69
 
62
70
  interface Platform {
@@ -64,15 +72,41 @@ interface Platform {
64
72
  commandStore: CommandStore;
65
73
  documentStore: DocumentStoreAdapter;
66
74
  eventBus: EventBusAdapter;
75
+ media: MediaStorage;
67
76
  logger: Logger;
68
77
  close(): Promise<void>;
69
78
  }
70
- interface CreatePlatformOptions {
79
+ /** Where the command store is, and the logger; what `createApp` and `resolvePrimitives` take as well. */
80
+ interface PlatformConnectionOptions {
71
81
  logger?: Logger;
72
82
  sqlitePath?: string;
73
83
  postgresUrl?: string;
74
84
  }
75
- declare function createPlatform(config: NymbalConfig, options?: CreatePlatformOptions): Platform;
85
+ /** The infrastructure primitives, as instances: `resolvePrimitives` builds them from the config. */
86
+ interface Primitives {
87
+ documentStore: DocumentStoreAdapter;
88
+ eventBus: EventBusAdapter;
89
+ media: MediaStorage;
90
+ }
91
+ interface CreatePlatformOptions extends PlatformConnectionOptions, Primitives {
92
+ }
93
+ interface ResolvePrimitivesOptions extends PlatformConnectionOptions {
94
+ /** Where local-fs media is written; `public/imported-media` under the working directory by default. */
95
+ mediaRoot?: string;
96
+ env?: NodeJS.ProcessEnv;
97
+ }
98
+ declare const REDIS_DEFAULTS: {
99
+ readonly prefix: "nymbal";
100
+ readonly ackTimeoutMs: 15000;
101
+ readonly claimIdleMs: 5000;
102
+ readonly streamMaxLen: 10000;
103
+ };
104
+ /**
105
+ * The document store, event bus and media storage the config names. A primitive that lives in its own package is
106
+ * imported only when named; a missing package fails `adapter.package_missing` with the install line.
107
+ */
108
+ declare function resolvePrimitives(config: NymbalConfig, options?: ResolvePrimitivesOptions): Promise<Primitives>;
109
+ declare function createPlatform(config: NymbalConfig, options: CreatePlatformOptions): Platform;
76
110
 
77
111
  interface MigrateOptions {
78
112
  migrationsRoot?: string;
@@ -598,6 +632,8 @@ declare class InMemoryDocumentStore implements DocumentStoreAdapter {
598
632
  #private;
599
633
  constructor(options?: InMemoryDocumentStoreOptions);
600
634
  capabilities(): readonly string[];
635
+ /** The process's own memory: healthy whenever it can answer. */
636
+ healthCheck(): Promise<HealthReport>;
601
637
  get<T>(collection: string, key: string): Promise<T | null>;
602
638
  put<T>(collection: string, key: string, document: T, options?: PutOptions): Promise<void>;
603
639
  delete(collection: string, key: string): Promise<void>;
@@ -607,8 +643,6 @@ declare class InMemoryDocumentStore implements DocumentStoreAdapter {
607
643
  close(): Promise<void>;
608
644
  }
609
645
 
610
- declare function createDocumentStore(config: NymbalConfig): DocumentStoreAdapter;
611
-
612
646
  interface InProcessEventBusOptions {
613
647
  logger?: Logger;
614
648
  }
@@ -616,6 +650,8 @@ declare class InProcessEventBus implements EventBusAdapter {
616
650
  #private;
617
651
  constructor(options?: InProcessEventBusOptions);
618
652
  capabilities(): readonly string[];
653
+ /** Delivery within the process: healthy whenever it can answer. */
654
+ healthCheck(): Promise<HealthReport>;
619
655
  publish<T>(event: NymbalEvent<T>): Promise<void>;
620
656
  publishBatch(events: NymbalEvent<unknown>[]): Promise<void>;
621
657
  replay(events: NymbalEvent<unknown>[]): Promise<void>;
@@ -624,8 +660,6 @@ declare class InProcessEventBus implements EventBusAdapter {
624
660
  close(): Promise<void>;
625
661
  }
626
662
 
627
- declare function createEventBus(config: NymbalConfig, logger?: Logger): EventBusAdapter;
628
-
629
663
  interface EventBuilderContext {
630
664
  storeId: string;
631
665
  environment: NymbalEnvironment;
@@ -648,6 +682,12 @@ interface Relay {
648
682
  /** Stops the interval and starts no new pass; resolves when the pass in flight, if any, has finished, so the
649
683
  * store can be closed without cutting a delivery off between the handler and its bookkeeping. */
650
684
  stop(): Promise<void>;
685
+ /**
686
+ * `handler`, run as part of a delivery: a drain it asks for (by running a command) returns at once instead of
687
+ * waiting on the pass that waits on it. The app wraps every subscribed handler in it, so this holds whether the bus
688
+ * calls the handler inside `publish` or from a consumer loop of its own.
689
+ */
690
+ asDelivery(handler: EventHandler): EventHandler;
651
691
  }
652
692
  interface CreateRelayOptions {
653
693
  store: CommandStore;
@@ -691,16 +731,7 @@ interface IdempotencyOptions {
691
731
  declare function withIdempotency<T = unknown>(handlerName: string, handler: EventHandler<T>, { repo, logger }: IdempotencyOptions): EventHandler<T>;
692
732
 
693
733
  /** One adapter per commerce slot. */
694
- interface CommerceAdapters {
695
- payments: PaymentsAdapter;
696
- email: EmailAdapter;
697
- reviews: ReviewsAdapter;
698
- search: SearchAdapter;
699
- analytics: AnalyticsAdapter;
700
- shipping: ShippingAdapter;
701
- tax: TaxAdapter;
702
- ai: AiAdapter;
703
- }
734
+ type CommerceAdapters = CommerceSlotAdapters;
704
735
  /** Adapters a project hands `createApp`, each for a slot whose provider is `custom`. */
705
736
  type InjectedAdapters = Partial<CommerceAdapters>;
706
737
  interface AdapterRegistry extends Omit<CommerceAdapters, 'ai'> {
@@ -711,7 +742,8 @@ interface AdapterRegistry extends Omit<CommerceAdapters, 'ai'> {
711
742
  interface BuildAdaptersDeps {
712
743
  config: NymbalConfig;
713
744
  logger: Logger;
714
- documentStore: DocumentStoreAdapter;
745
+ /** The command store's own connection: the native search index lives in its database. */
746
+ sql: RawClients;
715
747
  repos: Repositories;
716
748
  injected?: InjectedAdapters;
717
749
  /** The payments adapter `createApp` resolved before it opened the store. */
@@ -1163,7 +1195,7 @@ type CapabilitiesReport = Record<CapabilitySlot, SlotCapabilities>;
1163
1195
  interface AttachHttpOptions {
1164
1196
  adminRoot?: string | null;
1165
1197
  }
1166
- interface CreateAppOptions extends CreatePlatformOptions {
1198
+ interface CreateAppOptions extends ResolvePrimitivesOptions {
1167
1199
  version?: string;
1168
1200
  /** The project's own adapters, one per slot whose provider is `custom`. */
1169
1201
  adapters?: InjectedAdapters;
@@ -1227,9 +1259,12 @@ interface ProviderPackage {
1227
1259
  }
1228
1260
  /**
1229
1261
  * The providers that live in their own package, by slot then provider. The kernel imports a package only when the
1230
- * config names its provider; `native`, `none` and `custom` have no entry.
1262
+ * config names its provider; `native`, `none`, `custom` and the kernel's own primitives (`in-memory`, `in-process`,
1263
+ * `local-fs`) have no entry.
1231
1264
  */
1232
- declare const PROVIDER_PACKAGES: Readonly<Partial<Record<CommerceSlot, Readonly<Record<string, ProviderPackage>>>>>;
1265
+ declare const PROVIDER_PACKAGES: Readonly<Partial<Record<Slot, Readonly<Record<string, ProviderPackage>>>>>;
1266
+ /** The command that installs `packages` with the project's package manager, as `packageManager` picks it. */
1267
+ declare function installLine(packages: readonly string[], env: NodeJS.ProcessEnv, cwd: string): string;
1233
1268
 
1234
1269
  /**
1235
1270
  * v0.1 security adapter.
@@ -1283,8 +1318,15 @@ declare function createNativeEmailAdapter(deps: {
1283
1318
  config?: NativeEmailAdapterConfig;
1284
1319
  }): EmailAdapter;
1285
1320
 
1321
+ /** The cursor for a page starting at `offset`. It encodes any number; `search` rejects one that is not an offset. */
1322
+ declare function encodeSearchCursor(offset: number): string;
1323
+ /**
1324
+ * Full-text search in the command store's own database: FTS5 on SQLite, a GIN-indexed tsvector on Postgres. Both
1325
+ * match by `searchTerms` (every query term a prefix of a term in the name, a SKU, a variant name or the description)
1326
+ * and rank every-term-in-the-name matches first, then name/SKU/variant-name matches, then by the engine's score.
1327
+ */
1286
1328
  declare function createNativeSearchAdapter(deps: {
1287
- documentStore: DocumentStoreAdapter;
1329
+ sql: RawClients;
1288
1330
  logger: Logger;
1289
1331
  }): SearchAdapter;
1290
1332
 
@@ -1308,6 +1350,37 @@ interface CreateLoggerOptions {
1308
1350
  }
1309
1351
  declare function createLogger(options?: CreateLoggerOptions): Logger;
1310
1352
 
1353
+ /** `ok` is a check with no health semantics (config, a package, migrations); the rest are a health report's. */
1354
+ type DiagnosisStatus = HealthStatus | 'ok';
1355
+ interface DiagnosisCheck {
1356
+ name: string;
1357
+ status: DiagnosisStatus;
1358
+ detail: string;
1359
+ }
1360
+ interface DiagnosisReport {
1361
+ checks: DiagnosisCheck[];
1362
+ }
1363
+ interface DiagnoseOptions {
1364
+ /** The project's adapters, one per slot whose provider is `custom`, as `createApp` takes them. */
1365
+ adapters?: InjectedAdapters;
1366
+ logger?: Logger;
1367
+ /** Each check's bound; `HEALTH_CHECK_TIMEOUT_MS` when not given. */
1368
+ timeoutMs?: number;
1369
+ env?: NodeJS.ProcessEnv;
1370
+ sqlitePath?: string;
1371
+ postgresUrl?: string;
1372
+ mediaRoot?: string;
1373
+ /** Where the migrations journal is read; the platform's own migrations when not given. */
1374
+ migrationsRoot?: string;
1375
+ }
1376
+ /**
1377
+ * Checks a project without changing it: its config, the packages its providers live in, the command store and its
1378
+ * migrations, and the health of every commerce slot and primitive. It builds what `createApp` builds, through the same
1379
+ * registry and constructors, and nothing more: no warm-up, no relay, no sweeper, no migrator, no seed, and no
1380
+ * primitive's `initialize()`. The command store is opened read-only. Every connection is closed before it returns.
1381
+ */
1382
+ declare function diagnose(input: NymbalConfig, options?: DiagnoseOptions): Promise<DiagnosisReport>;
1383
+
1311
1384
  interface SeedDeps {
1312
1385
  config: NymbalConfig;
1313
1386
  commandStore: CommandStore;
@@ -1357,17 +1430,12 @@ interface SeedProduct {
1357
1430
  declare const seedCategories: SeedCategory[];
1358
1431
  declare const seedProducts: SeedProduct[];
1359
1432
 
1360
- interface MediaStorage {
1361
- capabilities(): readonly string[];
1362
- put(key: string, body: Uint8Array, contentType: string): Promise<{
1363
- url: string;
1364
- }>;
1365
- }
1366
-
1367
1433
  interface LocalFsMediaStorageOptions {
1368
1434
  root: string;
1369
1435
  urlPrefix?: string;
1370
1436
  }
1437
+ /** What the local filesystem storage offers, whatever its root: the app reports it for the media slot. */
1438
+ declare const LOCAL_FS_MEDIA_CAPABILITIES: readonly string[];
1371
1439
  declare function createLocalFsMediaStorage(options: LocalFsMediaStorageOptions): MediaStorage;
1372
1440
 
1373
- export { type AbandonedCart, type AbandonedWindow, type AdapterRegistry, type AttachHttpOptions, type AuthService, type AuthTokens, type BeginCheckoutInput, type BeginCheckoutResult, type BuildAdaptersDeps, type BuildServicesDeps, CSRF_COOKIE, CSRF_HEADER, type CapabilitiesReport, type CapabilitySlot, type CapturedPayment, type CartRepository, type CartService, type CategoryCreateInput, type CategoryInsert, type CategoryRepository, type CategoryService, type CategoryUpdate, type CategoryUpdateInput, type CheckoutService, type CommandStore, type CommerceAdapters, type CreateAppOptions, type CreateAuthServiceDeps, type CreateCartServiceDeps, type CreateCheckoutServiceDeps, type CreateInventoryServiceDeps, type CreateLoggerOptions, type CreateOrderServiceDeps, type CreatePlatformOptions, type CreateProductServiceDeps, type CreatePublisherOptions, type CreateRefundServiceDeps, type CreateRelayOptions, type CustomerInsert, type CustomerJwtPayload, type CustomerRepository, type CustomerService, type CustomerUpdate, type CustomerWithHash, type EventBuilderContext, type EventLogRepository, type EventPublisher, type EventRetentionSweeperDeps, type FinalizeResult, type IdempotencyOptions, type ImportCustomerInput, InMemoryDocumentStore, type InMemoryDocumentStoreOptions, InProcessEventBus, type InProcessEventBusOptions, type InjectedAdapters, type InventoryReservationRepository, type InventoryService, type CategoryInsert$1 as LegacyCategoryInsert, type CategoryRow as LegacyCategoryRow, type ProductInsert$1 as LegacyProductInsert, type ProductRow as LegacyProductRow, type LocalFsMediaStorageOptions, type LoggedEvent, type MakeEventOptions, type ManualPayments, type MediaStorage, type MigrateOptions, type NativeEmailAdapterConfig, type NymbalApp, type OrderCapture, type OrderCreateDraftInput, type OrderHistoryInsert, type OrderHistoryRepository, type OrderImportInput, type OrderInsert, type OrderRefundInsert, type OrderRefundRepository, type OrderRepository, type OrderSequenceRepository, type OrderService, PROVIDER_PACKAGES, PROVIDER_REFUND_REASON, type Platform, type PostgresClient, type ProcessedEventRepository, type ProductCategoryRepository, type ProductCreateInput, type ProductInsert, type ProductRepository, type ProductService, type ProductUpdate, type ProductUpdateInput, type ProfileUpdate, type ProviderPackage, type PublishOptions, RateLimiter, type RawClients, type ReadTx, type RefreshTokenInsert, type RefreshTokenRepository, type RefreshTokenRow, type RefundInput, type RefundResult, type RefundService, type RegisterAllRoutesDeps, type RegisterHandlersDeps, type RegisterInput, type Relay, type Repositories, type ReservationInsert, type ReserveStockResult, type ReviewInsert, type ReviewRepository, type RouteSchema, type SearchService, type SeedCategory, type SeedDeps, type SeedProduct, type SeedResult, type ServiceRegistry, type Settlement, type SlotCapabilities, type SqliteClient, type StockAdjustmentInsert, type StockAdjustmentRepository, type StoreRepository, type SweeperHandle, type Tx, type VariantInsert, type VariantRepository, type VariantUpdate, type WarmDocumentStoreDeps, type WarmResult, buildAdapters, buildRepositories, buildSecurityHeaders, buildServices, createApp, createAuthService, createCartRepository, createCartService, createCategoryRepository, createCategoryService, createCheckoutService, createCommandStore, createCustomerRepository, createCustomerService, createDocumentStore, createEventBuilder, createEventBus, createEventLogRepository, createEventPublisher, createInventoryReservationRepository, createInventoryService, createCategoryRepository$1 as createLegacyCategoryRepository, createProductRepository$1 as createLegacyProductRepository, createLocalFsMediaStorage, createLogger, createMiddlewareSecurityAdapter, createNativeAiAdapter, createNativeAnalyticsAdapter, createNativeEmailAdapter, createNativeReviewsAdapter, createNativeSearchAdapter, createNativeShippingAdapter, createNativeStubPaymentsAdapter, createNativeTaxAdapter, createOrderHistoryRepository, createOrderRefundRepository, createOrderRepository, createOrderSequenceRepository, createOrderService, createPlatform, createProcessedEventRepository, createProductCategoryRepository, createProductRepository, createProductService, createRefreshTokenRepository, createRefundService, createRelay, createReviewRepository, createSearchService, createStockAdjustmentRepository, createVariantRepository, orderPayment, rawClients, refreshRefunded, registerAdminStaticRoute, registerAllRoutes, registerHandlers, routeSchemas, runMigrations, runSeed, seedCategories, seedProducts, settlementOf, startCartAbandonmentSweeper, startEventRetentionSweeper, startInventoryReservationSweeper, warmDocumentStore, withIdempotency };
1441
+ export { type AbandonedCart, type AbandonedWindow, type AdapterRegistry, type AttachHttpOptions, type AuthService, type AuthTokens, type BeginCheckoutInput, type BeginCheckoutResult, type BuildAdaptersDeps, type BuildServicesDeps, CSRF_COOKIE, CSRF_HEADER, type CapabilitiesReport, type CapabilitySlot, type CapturedPayment, type CartRepository, type CartService, type CategoryCreateInput, type CategoryInsert, type CategoryRepository, type CategoryService, type CategoryUpdate, type CategoryUpdateInput, type CheckoutService, type CommandStore, type CommandStoreOptions, type CommerceAdapters, type CreateAppOptions, type CreateAuthServiceDeps, type CreateCartServiceDeps, type CreateCheckoutServiceDeps, type CreateInventoryServiceDeps, type CreateLoggerOptions, type CreateOrderServiceDeps, type CreatePlatformOptions, type CreateProductServiceDeps, type CreatePublisherOptions, type CreateRefundServiceDeps, type CreateRelayOptions, type CustomerInsert, type CustomerJwtPayload, type CustomerRepository, type CustomerService, type CustomerUpdate, type CustomerWithHash, type DiagnoseOptions, type DiagnosisCheck, type DiagnosisReport, type DiagnosisStatus, type EventBuilderContext, type EventLogRepository, type EventPublisher, type EventRetentionSweeperDeps, type FinalizeResult, type IdempotencyOptions, type ImportCustomerInput, InMemoryDocumentStore, type InMemoryDocumentStoreOptions, InProcessEventBus, type InProcessEventBusOptions, type InjectedAdapters, type InventoryReservationRepository, type InventoryService, LOCAL_FS_MEDIA_CAPABILITIES, type CategoryInsert$1 as LegacyCategoryInsert, type CategoryRow as LegacyCategoryRow, type ProductInsert$1 as LegacyProductInsert, type ProductRow as LegacyProductRow, type LocalFsMediaStorageOptions, type LoggedEvent, type MakeEventOptions, type ManualPayments, type MigrateOptions, type NativeEmailAdapterConfig, type NymbalApp, type OrderCapture, type OrderCreateDraftInput, type OrderHistoryInsert, type OrderHistoryRepository, type OrderImportInput, type OrderInsert, type OrderRefundInsert, type OrderRefundRepository, type OrderRepository, type OrderSequenceRepository, type OrderService, PROVIDER_PACKAGES, PROVIDER_REFUND_REASON, type Platform, type PlatformConnectionOptions, type PostgresClient, type Primitives, type ProcessedEventRepository, type ProductCategoryRepository, type ProductCreateInput, type ProductInsert, type ProductRepository, type ProductService, type ProductUpdate, type ProductUpdateInput, type ProfileUpdate, type ProviderPackage, type PublishOptions, REDIS_DEFAULTS, RateLimiter, type RawClients, type ReadTx, type RefreshTokenInsert, type RefreshTokenRepository, type RefreshTokenRow, type RefundInput, type RefundResult, type RefundService, type RegisterAllRoutesDeps, type RegisterHandlersDeps, type RegisterInput, type Relay, type Repositories, type ReservationInsert, type ReserveStockResult, type ResolvePrimitivesOptions, type ReviewInsert, type ReviewRepository, type RouteSchema, type SearchService, type SeedCategory, type SeedDeps, type SeedProduct, type SeedResult, type ServiceRegistry, type Settlement, type SlotCapabilities, type SqliteClient, type StockAdjustmentInsert, type StockAdjustmentRepository, type StoreRepository, type SweeperHandle, type Tx, type VariantInsert, type VariantRepository, type VariantUpdate, type WarmDocumentStoreDeps, type WarmResult, buildAdapters, buildRepositories, buildSecurityHeaders, buildServices, createApp, createAuthService, createCartRepository, createCartService, createCategoryRepository, createCategoryService, createCheckoutService, createCommandStore, createCustomerRepository, createCustomerService, createEventBuilder, createEventLogRepository, createEventPublisher, createInventoryReservationRepository, createInventoryService, createCategoryRepository$1 as createLegacyCategoryRepository, createProductRepository$1 as createLegacyProductRepository, createLocalFsMediaStorage, createLogger, createMiddlewareSecurityAdapter, createNativeAiAdapter, createNativeAnalyticsAdapter, createNativeEmailAdapter, createNativeReviewsAdapter, createNativeSearchAdapter, createNativeShippingAdapter, createNativeStubPaymentsAdapter, createNativeTaxAdapter, createOrderHistoryRepository, createOrderRefundRepository, createOrderRepository, createOrderSequenceRepository, createOrderService, createPlatform, createProcessedEventRepository, createProductCategoryRepository, createProductRepository, createProductService, createRefreshTokenRepository, createRefundService, createRelay, createReviewRepository, createSearchService, createStockAdjustmentRepository, createVariantRepository, diagnose, encodeSearchCursor, installLine, orderPayment, rawClients, refreshRefunded, registerAdminStaticRoute, registerAllRoutes, registerHandlers, resolvePrimitives, routeSchemas, runMigrations, runSeed, seedCategories, seedProducts, settlementOf, sqliteFile, startCartAbandonmentSweeper, startEventRetentionSweeper, startInventoryReservationSweeper, warmDocumentStore, withIdempotency };