@nymbalhq/platform 1.1.0 → 1.2.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/chunk-UBEGSSFI.js +5332 -0
- package/dist/chunk-UBEGSSFI.js.map +1 -0
- package/dist/{chunk-PW6ILJF7.js → chunk-XVUH34US.js} +138 -10
- package/dist/chunk-XVUH34US.js.map +1 -0
- package/dist/db/schema/index.d.ts +3717 -2105
- package/dist/db/schema/index.js +1 -2
- package/dist/index.d.ts +408 -21
- package/dist/index.js +1563 -1867
- package/dist/index.js.map +1 -1
- package/dist/register-NHG3TIRQ.js +8 -0
- package/migrations/postgres/0008_event_correlation.sql +6 -0
- package/migrations/postgres/0009_settings.sql +13 -0
- package/migrations/postgres/0010_catch_up_index.sql +2 -0
- package/migrations/postgres/0011_audit_entries.sql +27 -0
- package/migrations/postgres/meta/0008_snapshot.json +1625 -0
- package/migrations/postgres/meta/0009_snapshot.json +1705 -0
- package/migrations/postgres/meta/0010_snapshot.json +1732 -0
- package/migrations/postgres/meta/0011_snapshot.json +1887 -0
- package/migrations/postgres/meta/_journal.json +28 -0
- package/migrations/sqlite/0008_event_correlation.sql +7 -0
- package/migrations/sqlite/0009_settings.sql +13 -0
- package/migrations/sqlite/0010_catch_up_index.sql +2 -0
- package/migrations/sqlite/0011_audit_entries.sql +26 -0
- package/migrations/sqlite/meta/0008_snapshot.json +1485 -0
- package/migrations/sqlite/meta/0009_snapshot.json +1571 -0
- package/migrations/sqlite/meta/0010_snapshot.json +1580 -0
- package/migrations/sqlite/meta/0011_snapshot.json +1705 -0
- package/migrations/sqlite/meta/_journal.json +28 -0
- package/package.json +29 -23
- package/dist/chunk-2GFZHF5W.js +0 -2647
- package/dist/chunk-2GFZHF5W.js.map +0 -1
- package/dist/chunk-PW6ILJF7.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/register-FJA7YJV3.js +0 -8
- package/dist/register-FJA7YJV3.js.map +0 -1
- /package/dist/{chunk-PZ5AY32C.js.map → register-NHG3TIRQ.js.map} +0 -0
package/dist/db/schema/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NymbalConfig } from '@nymbalhq/config';
|
|
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,
|
|
3
|
-
export { MediaStorage } 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, AuditSubject, AuditActor, AuditOutcome, AuditEntry, HealthReport, PutOptions, QueryParams, QueryResult, EventHandler, SubscriptionConfig, Subscription, NymbalEnvironment, NymbalEventType, NymbalEventMap, RequestAuth, AdapterSetting, CommerceSlotAdapters, SecurityAdapter, AiAdapter, PaymentsAdapter, ProductSnapshot, CartItem, StockStatus, PaymentIntent, CheckoutPayment, SearchParams, SearchResult, SearchAdapter, OrderPayment, Refund, CommerceSlot, HttpAdapter, Slot, ProviderPackageModule, RateLimitAction, EmailAdapter, ReviewsAdapter, AnalyticsAdapter, ShippingAdapter, TaxAdapter, HealthStatus } from '@nymbalhq/types';
|
|
3
|
+
export { MediaStorage, buildSecurityHeaders, isValidCorrelationId } from '@nymbalhq/types';
|
|
4
4
|
import BetterSqlite3 from 'better-sqlite3';
|
|
5
5
|
import pg from 'pg';
|
|
6
6
|
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
@@ -8,6 +8,7 @@ import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
|
8
8
|
import { sqliteSchema, postgresSchema } from './db/schema/index.js';
|
|
9
9
|
import { JWTPayload } from 'jose';
|
|
10
10
|
import { ZodTypeAny } from 'zod';
|
|
11
|
+
import { DestinationStream } from 'pino';
|
|
11
12
|
import 'drizzle-orm/sqlite-core';
|
|
12
13
|
import 'drizzle-orm/pg-core';
|
|
13
14
|
|
|
@@ -172,6 +173,12 @@ declare function createCategoryRepository$1(store: CommandStore): {
|
|
|
172
173
|
insertMany(items: CategoryInsert$1[]): Promise<void>;
|
|
173
174
|
};
|
|
174
175
|
|
|
176
|
+
/** One page of a walk over a table by primary key: the rows whose id is above `after`, at most `limit` of them. */
|
|
177
|
+
interface KeysetPage {
|
|
178
|
+
after?: string;
|
|
179
|
+
limit: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
175
182
|
interface ProductInsert {
|
|
176
183
|
id: string;
|
|
177
184
|
slug: string;
|
|
@@ -207,6 +214,8 @@ interface ProductRepository extends StoreRepository {
|
|
|
207
214
|
limit?: number;
|
|
208
215
|
offset?: number;
|
|
209
216
|
}): Promise<Product[]>;
|
|
217
|
+
/** Rows by id after `page.after`: a walk over the table that a concurrent write cannot make skip a row. */
|
|
218
|
+
listPage(tx: ReadTx, page: KeysetPage): Promise<Product[]>;
|
|
210
219
|
insert(tx: Tx, p: ProductInsert): Promise<void>;
|
|
211
220
|
update(tx: Tx, id: string, patch: ProductUpdate): Promise<void>;
|
|
212
221
|
delete(tx: Tx, id: string): Promise<void>;
|
|
@@ -274,6 +283,8 @@ interface CategoryRepository extends StoreRepository {
|
|
|
274
283
|
findById(tx: ReadTx, id: string): Promise<Category | null>;
|
|
275
284
|
findBySlug(tx: ReadTx, slug: string): Promise<Category | null>;
|
|
276
285
|
list(tx: ReadTx): Promise<Category[]>;
|
|
286
|
+
/** Rows by id after `page.after`: a walk over the table that a concurrent write cannot make skip a row. */
|
|
287
|
+
listPage(tx: ReadTx, page: KeysetPage): Promise<Category[]>;
|
|
277
288
|
insert(tx: Tx, c: CategoryInsert): Promise<void>;
|
|
278
289
|
update(tx: Tx, id: string, patch: CategoryUpdate): Promise<void>;
|
|
279
290
|
delete(tx: Tx, id: string): Promise<void>;
|
|
@@ -326,6 +337,8 @@ interface CustomerRepository extends StoreRepository {
|
|
|
326
337
|
limit?: number;
|
|
327
338
|
offset?: number;
|
|
328
339
|
}): Promise<CustomerWithHash[]>;
|
|
340
|
+
/** Rows by id after `page.after`: a walk over the table that a concurrent write cannot make skip a row. */
|
|
341
|
+
listPage(tx: ReadTx, page: KeysetPage): Promise<CustomerWithHash[]>;
|
|
329
342
|
insert(tx: Tx, c: CustomerInsert): Promise<void>;
|
|
330
343
|
update(tx: Tx, id: string, patch: CustomerUpdate): Promise<void>;
|
|
331
344
|
incrementStats(tx: Tx, id: string, deltaOrders: number, deltaSpentMinor: number, updatedAt: Date): Promise<void>;
|
|
@@ -409,6 +422,8 @@ interface OrderRepository extends StoreRepository {
|
|
|
409
422
|
limit?: number;
|
|
410
423
|
offset?: number;
|
|
411
424
|
}): Promise<Order[]>;
|
|
425
|
+
/** Rows by id after `page.after`: a walk over the table that a concurrent write cannot make skip a row. */
|
|
426
|
+
listPage(tx: ReadTx, page: KeysetPage): Promise<Order[]>;
|
|
412
427
|
insert(tx: Tx, o: OrderInsert): Promise<void>;
|
|
413
428
|
setStatus(tx: Tx, id: string, status: OrderStatus, updatedAt: Date): Promise<void>;
|
|
414
429
|
/** Sets `status` only while the order is still `from`; false when it was not, so a concurrent writer got there
|
|
@@ -518,9 +533,15 @@ interface ReviewInsert {
|
|
|
518
533
|
moderationStatus?: ReviewModerationStatus;
|
|
519
534
|
submittedAt: Date;
|
|
520
535
|
}
|
|
536
|
+
/** Where a page of a product's reviews starts: after this review, in the newest-first, then id-descending order. */
|
|
537
|
+
interface ReviewKey {
|
|
538
|
+
submittedAt: string;
|
|
539
|
+
id: string;
|
|
540
|
+
}
|
|
521
541
|
interface ReviewRepository extends StoreRepository {
|
|
522
542
|
findById(tx: ReadTx, id: string): Promise<Review | null>;
|
|
523
|
-
|
|
543
|
+
/** Newest first, ties by id descending; `after` is the last review of the previous page. */
|
|
544
|
+
listByProduct(tx: ReadTx, productId: string, status?: ReviewModerationStatus, limit?: number, after?: ReviewKey): Promise<Review[]>;
|
|
524
545
|
listByStatus(tx: ReadTx, status: ReviewModerationStatus, limit?: number): Promise<Review[]>;
|
|
525
546
|
insert(tx: Tx, r: ReviewInsert): Promise<void>;
|
|
526
547
|
setModerationStatus(tx: Tx, id: string, status: ReviewModerationStatus, moderatedBy: string, moderatedAt: Date): Promise<void>;
|
|
@@ -548,6 +569,17 @@ interface LoggedEvent {
|
|
|
548
569
|
deliveredAt: Date | null;
|
|
549
570
|
attempts: number;
|
|
550
571
|
deadAt: Date | null;
|
|
572
|
+
createdAt: Date;
|
|
573
|
+
}
|
|
574
|
+
/** Filters for reading the log. A type glob's `*` matches any run of characters, dots included (`order.*`). */
|
|
575
|
+
interface EventLogFilter {
|
|
576
|
+
/** Type globs; an event matches when its type matches any of them. */
|
|
577
|
+
types?: string[];
|
|
578
|
+
/** Appended at or after. */
|
|
579
|
+
since?: Date;
|
|
580
|
+
/** Appended before. */
|
|
581
|
+
until?: Date;
|
|
582
|
+
limit: number;
|
|
551
583
|
}
|
|
552
584
|
interface EventLogRepository extends StoreRepository {
|
|
553
585
|
/** Appends in array order, so `seq` follows publish order. */
|
|
@@ -560,6 +592,24 @@ interface EventLogRepository extends StoreRepository {
|
|
|
560
592
|
/** Deletes delivered events delivered before `at`; returns how many. Undelivered and dead events are never deleted. */
|
|
561
593
|
deleteDeliveredBefore(tx: Tx, at: Date): Promise<number>;
|
|
562
594
|
listAll(tx: ReadTx): Promise<LoggedEvent[]>;
|
|
595
|
+
/** One correlation id's events, by `seq`. */
|
|
596
|
+
queryByCorrelation(tx: ReadTx, correlationId: string, filter: EventLogFilter): Promise<LoggedEvent[]>;
|
|
597
|
+
/** Events above `seq`, by `seq`. */
|
|
598
|
+
listAfter(tx: ReadTx, seq: number, filter: Pick<EventLogFilter, 'types' | 'limit'>): Promise<LoggedEvent[]>;
|
|
599
|
+
/** The highest `seq` in the log, or 0 when it is empty. */
|
|
600
|
+
maxSeq(tx: ReadTx): Promise<number>;
|
|
601
|
+
/**
|
|
602
|
+
* What a read-model rebuild re-applies after its swap: every event that is not dead and was delivered at or after
|
|
603
|
+
* `since`, or not yet delivered, by `seq`. `afterSeq` and `limit` page through them.
|
|
604
|
+
*/
|
|
605
|
+
listForCatchUp(tx: ReadTx, since: Date, page?: {
|
|
606
|
+
afterSeq?: number;
|
|
607
|
+
limit?: number;
|
|
608
|
+
}): Promise<LoggedEvent[]>;
|
|
609
|
+
/** Delivered events delivered before `at`, by `seq`: what retention may archive. Undelivered and dead events never are. */
|
|
610
|
+
listDeliveredBefore(tx: ReadTx, at: Date, limit: number): Promise<LoggedEvent[]>;
|
|
611
|
+
/** Deletes the delivered events with these `seq`s; returns how many. */
|
|
612
|
+
deleteSeqs(tx: Tx, seqs: number[]): Promise<number>;
|
|
563
613
|
}
|
|
564
614
|
declare function createEventLogRepository(store: CommandStore): EventLogRepository;
|
|
565
615
|
|
|
@@ -604,6 +654,91 @@ interface CartRepository extends StoreRepository {
|
|
|
604
654
|
}
|
|
605
655
|
declare function createCartRepository(store: CommandStore): CartRepository;
|
|
606
656
|
|
|
657
|
+
/** A row of `settings`: a secret's ciphertext with its IV, tag and key id, or a non-secret's `plain` value. */
|
|
658
|
+
interface SettingRow {
|
|
659
|
+
slot: string;
|
|
660
|
+
path: string;
|
|
661
|
+
ciphertext: Buffer | null;
|
|
662
|
+
plain: string | null;
|
|
663
|
+
iv: Buffer | null;
|
|
664
|
+
tag: Buffer | null;
|
|
665
|
+
keyId: string | null;
|
|
666
|
+
updatedAt: Date;
|
|
667
|
+
updatedBy: string | null;
|
|
668
|
+
}
|
|
669
|
+
interface SettingsRepository extends StoreRepository {
|
|
670
|
+
list(tx: ReadTx): Promise<SettingRow[]>;
|
|
671
|
+
get(tx: ReadTx, slot: string, path: string): Promise<SettingRow | undefined>;
|
|
672
|
+
/** Inserts the row, or replaces the one at its slot and path. */
|
|
673
|
+
put(tx: Tx, row: SettingRow): Promise<void>;
|
|
674
|
+
/** Whether a row was there to delete. */
|
|
675
|
+
delete(tx: Tx, slot: string, path: string): Promise<boolean>;
|
|
676
|
+
/** Every row, or those of one slot, or one path of it; how many went. */
|
|
677
|
+
clear(tx: Tx, filter?: {
|
|
678
|
+
slot?: string;
|
|
679
|
+
path?: string;
|
|
680
|
+
}): Promise<number>;
|
|
681
|
+
}
|
|
682
|
+
declare function createSettingsRepository(store: CommandStore): SettingsRepository;
|
|
683
|
+
|
|
684
|
+
interface AuditEntryInsert {
|
|
685
|
+
id: string;
|
|
686
|
+
at: Date;
|
|
687
|
+
actor: AuditActor;
|
|
688
|
+
command: string;
|
|
689
|
+
subjects: AuditSubject[];
|
|
690
|
+
correlationId: string | null;
|
|
691
|
+
idempotencyKey: string | null;
|
|
692
|
+
requestHash: string | null;
|
|
693
|
+
outcome: AuditOutcome;
|
|
694
|
+
responseStatus: number | null;
|
|
695
|
+
/** Kept only on a keyed `applied` row, to answer its replays. */
|
|
696
|
+
responseBody: unknown;
|
|
697
|
+
}
|
|
698
|
+
/** A keyed `applied` row: what its replays answer. */
|
|
699
|
+
interface AppliedEntry {
|
|
700
|
+
requestHash: string | null;
|
|
701
|
+
subjects: AuditSubject[];
|
|
702
|
+
responseStatus: number;
|
|
703
|
+
responseBody: unknown;
|
|
704
|
+
}
|
|
705
|
+
/** A position in the (at, id) order the entries are listed in. */
|
|
706
|
+
interface AuditCursor {
|
|
707
|
+
at: string;
|
|
708
|
+
id: string;
|
|
709
|
+
}
|
|
710
|
+
interface AuditQuery {
|
|
711
|
+
/** `kind:id`, a kind alone, or an actor id. */
|
|
712
|
+
actor?: string;
|
|
713
|
+
command?: string;
|
|
714
|
+
/** A subject's id. */
|
|
715
|
+
subject?: string;
|
|
716
|
+
correlation?: string;
|
|
717
|
+
outcome?: AuditOutcome;
|
|
718
|
+
/** From `since` inclusive to `until` exclusive. */
|
|
719
|
+
since?: Date;
|
|
720
|
+
until?: Date;
|
|
721
|
+
/** `desc`: newest first, the entries before `cursor`; `asc`: oldest first, the entries after it. */
|
|
722
|
+
order: 'asc' | 'desc';
|
|
723
|
+
cursor?: AuditCursor;
|
|
724
|
+
limit: number;
|
|
725
|
+
}
|
|
726
|
+
/** Appends one entry in `tx`. Entries are never updated or deleted (the tables' triggers refuse it). */
|
|
727
|
+
declare function appendAuditEntry(tx: Tx, e: AuditEntryInsert): Promise<void>;
|
|
728
|
+
/** The `applied` entry `actorId` made of `command` under `key`, if any. */
|
|
729
|
+
declare function findAppliedByKey(tx: ReadTx, actorId: string, command: string, key: string): Promise<AppliedEntry | null>;
|
|
730
|
+
/** Entries matching `q`, in its order, at most `q.limit`; never a stored response body. */
|
|
731
|
+
declare function listAuditEntries(tx: ReadTx, q: AuditQuery): Promise<AuditEntry[]>;
|
|
732
|
+
type AuditFilter = Omit<AuditQuery, 'order' | 'cursor' | 'limit'>;
|
|
733
|
+
/** Every entry matching `filter`, oldest first, one read per page: what both exports print, a line each. */
|
|
734
|
+
declare function auditEntriesInOrder(store: CommandStore, filter: AuditFilter, pageSize?: number): AsyncGenerator<AuditEntry>;
|
|
735
|
+
interface AuditEntryRepository extends StoreRepository {
|
|
736
|
+
append(tx: Tx, entry: AuditEntryInsert): Promise<void>;
|
|
737
|
+
findAppliedByKey(tx: ReadTx, actorId: string, command: string, key: string): Promise<AppliedEntry | null>;
|
|
738
|
+
list(tx: ReadTx, query: AuditQuery): Promise<AuditEntry[]>;
|
|
739
|
+
}
|
|
740
|
+
declare function createAuditEntryRepository(store: CommandStore): AuditEntryRepository;
|
|
741
|
+
|
|
607
742
|
interface Repositories {
|
|
608
743
|
product: ProductRepository;
|
|
609
744
|
variant: VariantRepository;
|
|
@@ -621,6 +756,8 @@ interface Repositories {
|
|
|
621
756
|
processedEvent: ProcessedEventRepository;
|
|
622
757
|
eventLog: EventLogRepository;
|
|
623
758
|
cart: CartRepository;
|
|
759
|
+
settings: SettingsRepository;
|
|
760
|
+
auditEntry: AuditEntryRepository;
|
|
624
761
|
}
|
|
625
762
|
declare function buildRepositories(commandStore: CommandStore, _documentStore: DocumentStoreAdapter): Repositories;
|
|
626
763
|
|
|
@@ -640,6 +777,8 @@ declare class InMemoryDocumentStore implements DocumentStoreAdapter {
|
|
|
640
777
|
query<T>(collection: string, params: QueryParams): Promise<QueryResult<T>>;
|
|
641
778
|
batchGet<T>(collection: string, keys: string[]): Promise<Map<string, T>>;
|
|
642
779
|
batchPut<T>(collection: string, items: Map<string, T>): Promise<void>;
|
|
780
|
+
/** Builds the new contents in a map of their own and swaps it in, so a reader sees one set or the other. */
|
|
781
|
+
replaceCollection<T>(collection: string, entries: AsyncIterable<[string, T]>): Promise<void>;
|
|
643
782
|
close(): Promise<void>;
|
|
644
783
|
}
|
|
645
784
|
|
|
@@ -724,12 +863,51 @@ interface CreatePublisherOptions {
|
|
|
724
863
|
}
|
|
725
864
|
declare function createEventPublisher(opts: CreatePublisherOptions): EventPublisher;
|
|
726
865
|
|
|
866
|
+
/** Runs `fn` with `id` as the correlation id of every event it publishes, across its awaits, and returns its result. */
|
|
867
|
+
declare function runWithCorrelation<T>(id: string, fn: () => T): T;
|
|
868
|
+
declare function currentCorrelationId(): string | undefined;
|
|
869
|
+
/** A fresh id for one run of work that starts outside HTTP (a sweep, an import): `<origin>:<uuidv7>`. */
|
|
870
|
+
declare function newCorrelationId(origin: string): string;
|
|
871
|
+
|
|
872
|
+
type Actor = AuditActor;
|
|
873
|
+
/** Runs `fn` as `actor`, across its awaits, and returns its result. */
|
|
874
|
+
declare function runAsActor<T>(actor: Actor, fn: () => T): T;
|
|
875
|
+
declare function currentActor(): Actor | undefined;
|
|
876
|
+
/** A request's actor from its principal. A guest is anonymous: a cart's token is a credential, never an id. */
|
|
877
|
+
declare function actorOf(auth: RequestAuth | undefined): Actor;
|
|
878
|
+
|
|
879
|
+
declare const audit: {
|
|
880
|
+
/**
|
|
881
|
+
* A service names the command it runs and the records it touches. It writes nothing itself: the open command's
|
|
882
|
+
* entry carries them. Call it before the command can refuse, so a refusal is recorded as the command's.
|
|
883
|
+
*/
|
|
884
|
+
note(command: string, subjects?: readonly AuditSubject[]): void;
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* Runs `fn` as one command, `command` (or, when undefined, the first command a service notes). Inside an open command
|
|
888
|
+
* it joins that one. A refusal thrown out of `fn` is recorded as the command's `refused` entry.
|
|
889
|
+
*/
|
|
890
|
+
declare function auditedCommand<T>(store: CommandStore, command: string | undefined, fn: () => Promise<T>): Promise<T>;
|
|
891
|
+
|
|
727
892
|
interface IdempotencyOptions {
|
|
728
893
|
repo: ProcessedEventRepository;
|
|
729
894
|
logger?: Logger;
|
|
730
895
|
}
|
|
731
896
|
declare function withIdempotency<T = unknown>(handlerName: string, handler: EventHandler<T>, { repo, logger }: IdempotencyOptions): EventHandler<T>;
|
|
732
897
|
|
|
898
|
+
/** A settings row as the fill uses it: decrypted, or a non-secret's plain value. */
|
|
899
|
+
interface SettingValue {
|
|
900
|
+
slot: string;
|
|
901
|
+
path: string;
|
|
902
|
+
value: string;
|
|
903
|
+
}
|
|
904
|
+
type SettingSource = 'config' | 'env' | 'settings';
|
|
905
|
+
/**
|
|
906
|
+
* The slot's config block with each declared path resolved as block, then its declared env, then this slot's row
|
|
907
|
+
* (the deploy always wins). Nothing undeclared is added and `block` is not changed.
|
|
908
|
+
*/
|
|
909
|
+
declare function fillFromSettings(slot: string, block: Record<string, unknown>, declared: readonly AdapterSetting[], rows: readonly SettingValue[], env: NodeJS.ProcessEnv): Record<string, unknown>;
|
|
910
|
+
|
|
733
911
|
/** One adapter per commerce slot. */
|
|
734
912
|
type CommerceAdapters = CommerceSlotAdapters;
|
|
735
913
|
/** Adapters a project hands `createApp`, each for a slot whose provider is `custom`. */
|
|
@@ -748,6 +926,10 @@ interface BuildAdaptersDeps {
|
|
|
748
926
|
injected?: InjectedAdapters;
|
|
749
927
|
/** The payments adapter `createApp` resolved before it opened the store. */
|
|
750
928
|
payments: PaymentsAdapter;
|
|
929
|
+
/** The security adapter `createApp` resolved before it opened the store. */
|
|
930
|
+
security: SecurityAdapter;
|
|
931
|
+
/** The values Settings hold for the slots' declared fields, decrypted: what fills what the config leaves unset. */
|
|
932
|
+
settings?: readonly SettingValue[];
|
|
751
933
|
}
|
|
752
934
|
declare function buildAdapters(deps: BuildAdaptersDeps): Promise<AdapterRegistry>;
|
|
753
935
|
|
|
@@ -1141,6 +1323,15 @@ interface BuildServicesDeps {
|
|
|
1141
1323
|
}
|
|
1142
1324
|
declare function buildServices(deps: BuildServicesDeps): ServiceRegistry;
|
|
1143
1325
|
|
|
1326
|
+
/** A slot whose provider package declares settings. */
|
|
1327
|
+
interface DeclaredSlot {
|
|
1328
|
+
slot: CommerceSlot;
|
|
1329
|
+
provider: string;
|
|
1330
|
+
declared: readonly AdapterSetting[];
|
|
1331
|
+
}
|
|
1332
|
+
/** A store from before migration 0008 has no `settings` relation: it holds no settings. */
|
|
1333
|
+
declare function isMissingSettingsTable(error: unknown): boolean;
|
|
1334
|
+
|
|
1144
1335
|
interface RegisterAllRoutesDeps {
|
|
1145
1336
|
config: NymbalConfig;
|
|
1146
1337
|
adapter: HttpAdapter;
|
|
@@ -1150,6 +1341,8 @@ interface RegisterAllRoutesDeps {
|
|
|
1150
1341
|
documentStore: DocumentStoreAdapter;
|
|
1151
1342
|
eventBus: EventBusAdapter;
|
|
1152
1343
|
publisher: EventPublisher;
|
|
1344
|
+
/** The slots whose provider packages declare settings, as the store booted with them. */
|
|
1345
|
+
settingsSlots: readonly DeclaredSlot[];
|
|
1153
1346
|
/** The admin's dist directory, or null for a 404 that says how to build it; undefined serves no admin. */
|
|
1154
1347
|
adminRoot?: string | null | undefined;
|
|
1155
1348
|
}
|
|
@@ -1166,6 +1359,16 @@ interface RouteSchema {
|
|
|
1166
1359
|
params?: ZodTypeAny;
|
|
1167
1360
|
query?: ZodTypeAny;
|
|
1168
1361
|
body?: ZodTypeAny;
|
|
1362
|
+
/**
|
|
1363
|
+
* Every route but a GET says what its audit entry names it: the command it runs when it changes the store's records,
|
|
1364
|
+
* or null when it changes none an audit covers (a cart, a session, a ticket).
|
|
1365
|
+
*/
|
|
1366
|
+
command?: string | null;
|
|
1367
|
+
/**
|
|
1368
|
+
* The command moves money through the payments provider. A keyed one does not run inside the key's transaction:
|
|
1369
|
+
* the service commits its own steps around the provider call, so what it holds is committed before money moves.
|
|
1370
|
+
*/
|
|
1371
|
+
provider?: true;
|
|
1169
1372
|
}
|
|
1170
1373
|
declare const routeSchemas: Record<string, RouteSchema>;
|
|
1171
1374
|
|
|
@@ -1240,6 +1443,10 @@ interface CartAbandonmentSweeperDeps {
|
|
|
1240
1443
|
*/
|
|
1241
1444
|
declare function startCartAbandonmentSweeper(deps: CartAbandonmentSweeperDeps): SweeperHandle;
|
|
1242
1445
|
|
|
1446
|
+
/** Where retention writes events before it deletes them: one object per batch, private to the operator. */
|
|
1447
|
+
interface EventArchiveWriter {
|
|
1448
|
+
put(key: string, body: Uint8Array, contentType: string): Promise<void>;
|
|
1449
|
+
}
|
|
1243
1450
|
interface EventRetentionSweeperDeps {
|
|
1244
1451
|
store: CommandStore;
|
|
1245
1452
|
eventLog: EventLogRepository;
|
|
@@ -1247,24 +1454,40 @@ interface EventRetentionSweeperDeps {
|
|
|
1247
1454
|
logger: Logger;
|
|
1248
1455
|
retentionDays?: number;
|
|
1249
1456
|
intervalMs?: number;
|
|
1457
|
+
/** When set, delivered events past retention are archived here first, and deleted only once the put succeeds. */
|
|
1458
|
+
archive?: EventArchiveWriter;
|
|
1250
1459
|
}
|
|
1251
|
-
/**
|
|
1460
|
+
/**
|
|
1461
|
+
* Deletes delivered events and processed-event records older than the window; undelivered and dead events stay. With
|
|
1462
|
+
* an archive, events go to it in `seq`-ordered batches first.
|
|
1463
|
+
*/
|
|
1252
1464
|
declare function startEventRetentionSweeper(deps: EventRetentionSweeperDeps): SweeperHandle;
|
|
1253
1465
|
|
|
1254
1466
|
interface ProviderPackage {
|
|
1255
1467
|
/** The adapter package, which exports `createAdapter(ctx: AdapterContext)`. */
|
|
1256
1468
|
package: string;
|
|
1257
|
-
/** The provider SDK the package peers, which the project installs beside it. */
|
|
1258
|
-
sdk
|
|
1469
|
+
/** The provider SDK the package peers, which the project installs beside it; none when it talks HTTP itself. */
|
|
1470
|
+
sdk?: string;
|
|
1259
1471
|
}
|
|
1472
|
+
type Packages<P extends ProviderPackage> = Readonly<Record<string, P>>;
|
|
1260
1473
|
/**
|
|
1261
1474
|
* The providers that live in their own package, by slot then provider. The kernel imports a package only when the
|
|
1262
1475
|
* config names its provider; `native`, `none`, `custom` and the kernel's own primitives (`in-memory`, `in-process`,
|
|
1263
|
-
* `local-fs`) have no entry.
|
|
1476
|
+
* `local-fs`) have no entry. Every package peers its provider's SDK but the security ones, which call an HTTP API.
|
|
1264
1477
|
*/
|
|
1265
|
-
declare const PROVIDER_PACKAGES: Readonly<Partial<Record<Slot,
|
|
1478
|
+
declare const PROVIDER_PACKAGES: Readonly<Partial<Record<Exclude<Slot, 'security'>, Packages<Required<ProviderPackage>>>>> & {
|
|
1479
|
+
readonly security: Packages<ProviderPackage>;
|
|
1480
|
+
};
|
|
1266
1481
|
/** The command that installs `packages` with the project's package manager, as `packageManager` picks it. */
|
|
1267
1482
|
declare function installLine(packages: readonly string[], env: NodeJS.ProcessEnv, cwd: string): string;
|
|
1483
|
+
type ProviderModule = ProviderPackageModule;
|
|
1484
|
+
/**
|
|
1485
|
+
* The module of a provider that lives in its own package, imported from the kernel as `loadProviderAdapter` imports
|
|
1486
|
+
* it, or `undefined` when the provider is built in. A missing package or SDK is a `ConfigError`
|
|
1487
|
+
* (`adapter.package_missing`) carrying the install line, a module with no `createAdapter` is `adapter.package_invalid`,
|
|
1488
|
+
* and any other load error is rethrown as it is.
|
|
1489
|
+
*/
|
|
1490
|
+
declare function importProviderPackage(slot: Slot, provider: string, env: NodeJS.ProcessEnv): Promise<ProviderModule | undefined>;
|
|
1268
1491
|
|
|
1269
1492
|
/**
|
|
1270
1493
|
* v0.1 security adapter.
|
|
@@ -1294,7 +1517,6 @@ declare class RateLimiter {
|
|
|
1294
1517
|
reset(): void;
|
|
1295
1518
|
}
|
|
1296
1519
|
|
|
1297
|
-
declare function buildSecurityHeaders(security: SecurityConfigLike): Record<string, string>;
|
|
1298
1520
|
declare const CSRF_COOKIE = "nymbal.csrf";
|
|
1299
1521
|
declare const CSRF_HEADER = "x-csrf-token";
|
|
1300
1522
|
|
|
@@ -1347,6 +1569,8 @@ interface CreateLoggerOptions {
|
|
|
1347
1569
|
level?: string;
|
|
1348
1570
|
pretty?: boolean;
|
|
1349
1571
|
base?: Record<string, unknown>;
|
|
1572
|
+
/** Where the JSON lines go instead of stdout; a destination is never pretty-printed. */
|
|
1573
|
+
destination?: DestinationStream;
|
|
1350
1574
|
}
|
|
1351
1575
|
declare function createLogger(options?: CreateLoggerOptions): Logger;
|
|
1352
1576
|
|
|
@@ -1375,9 +1599,9 @@ interface DiagnoseOptions {
|
|
|
1375
1599
|
}
|
|
1376
1600
|
/**
|
|
1377
1601
|
* 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`
|
|
1379
|
-
* registry and constructors, and nothing more: no warm-up, no relay, no sweeper, no migrator,
|
|
1380
|
-
* primitive's `initialize()
|
|
1602
|
+
* migrations, and the health of every commerce slot, the security slot and every primitive. It builds what `createApp`
|
|
1603
|
+
* builds, through the same registry and constructors, and nothing more: no warm-up, no relay, no sweeper, no migrator,
|
|
1604
|
+
* no seed, and no primitive's `initialize()` (the security adapter's makes no request). The command store is opened read-only. Every connection is closed before it returns.
|
|
1381
1605
|
*/
|
|
1382
1606
|
declare function diagnose(input: NymbalConfig, options?: DiagnoseOptions): Promise<DiagnosisReport>;
|
|
1383
1607
|
|
|
@@ -1388,6 +1612,13 @@ interface SeedDeps {
|
|
|
1388
1612
|
eventBus: EventBusAdapter;
|
|
1389
1613
|
logger: Logger;
|
|
1390
1614
|
version: string;
|
|
1615
|
+
/**
|
|
1616
|
+
* When given, each product's image is generated and written here, and the product points at the stored copy
|
|
1617
|
+
* instead of the third-party placeholder host: a store measured or run offline then serves its own images.
|
|
1618
|
+
*/
|
|
1619
|
+
media?: MediaStorage;
|
|
1620
|
+
/** The search index to rebuild with the document store; without it the next start's rebuild fills it. */
|
|
1621
|
+
search?: SearchAdapter;
|
|
1391
1622
|
}
|
|
1392
1623
|
interface SeedResult {
|
|
1393
1624
|
categories: number;
|
|
@@ -1400,19 +1631,174 @@ interface SeedResult {
|
|
|
1400
1631
|
}
|
|
1401
1632
|
declare function runSeed(deps: SeedDeps): Promise<SeedResult>;
|
|
1402
1633
|
|
|
1403
|
-
|
|
1634
|
+
/** The binary columns of an encrypted settings row. */
|
|
1635
|
+
interface EncryptedValue {
|
|
1636
|
+
ciphertext: Buffer;
|
|
1637
|
+
iv: Buffer;
|
|
1638
|
+
tag: Buffer;
|
|
1639
|
+
}
|
|
1640
|
+
/** The same columns as a driver hands them back (a Buffer, or a Uint8Array). */
|
|
1641
|
+
interface StoredCipher {
|
|
1642
|
+
ciphertext: Uint8Array | null;
|
|
1643
|
+
iv: Uint8Array | null;
|
|
1644
|
+
tag: Uint8Array | null;
|
|
1645
|
+
}
|
|
1646
|
+
/** The environment variable holding the master key, and the one `nymbal secrets rotate` reads the old key from. */
|
|
1647
|
+
declare const SECRETS_KEY_ENV = "NYMBAL_SECRETS_KEY";
|
|
1648
|
+
declare const SECRETS_KEY_OLD_ENV = "NYMBAL_SECRETS_KEY_OLD";
|
|
1649
|
+
/** AES-256-GCM under a fresh IV, bound to `aad` (`<slot>:<path>`), so a row moved to another field fails to decrypt. */
|
|
1650
|
+
declare function encrypt(key: Buffer, aad: string, plaintext: string): EncryptedValue;
|
|
1651
|
+
/** The plaintext, or a throw when the key, the AAD or any byte of the row is not what encrypted it. */
|
|
1652
|
+
declare function decrypt(key: Buffer, aad: string, row: StoredCipher): string;
|
|
1653
|
+
/** The first 8 hex characters of the key's SHA-256: which key a row was written under, without the key. */
|
|
1654
|
+
declare function keyId(key: Buffer): string;
|
|
1655
|
+
type SecretsKey = {
|
|
1656
|
+
ok: true;
|
|
1657
|
+
key: Buffer;
|
|
1658
|
+
id: string;
|
|
1659
|
+
} | {
|
|
1660
|
+
ok: false;
|
|
1661
|
+
reason: 'missing' | 'malformed';
|
|
1662
|
+
};
|
|
1663
|
+
/** The master key in `env[name]`: 32 bytes as base64, else why it cannot be used. */
|
|
1664
|
+
declare function readSecretsKey(env: NodeJS.ProcessEnv, name?: string): SecretsKey;
|
|
1665
|
+
/** What to tell an operator about a key `readSecretsKey` refused, naming the variable and never its value. */
|
|
1666
|
+
declare function keyProblem(reason: 'missing' | 'malformed', name?: string): string;
|
|
1667
|
+
/** The AAD of a settings row. */
|
|
1668
|
+
declare function settingAad(slot: string, path: string): string;
|
|
1669
|
+
|
|
1670
|
+
/** `text` with every secret in the set replaced by `***`. */
|
|
1671
|
+
declare function scrub(text: string): string;
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* One subscription of a projection: the bus delivers live events to it, and a read-model rebuild calls it directly in
|
|
1675
|
+
* its catch-up, so a failure there is seen rather than logged by the bus.
|
|
1676
|
+
*/
|
|
1677
|
+
interface DerivedHandler {
|
|
1678
|
+
name: string;
|
|
1679
|
+
types: readonly string[];
|
|
1680
|
+
handle: EventHandler;
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
/** A document of a collection, under its key. */
|
|
1684
|
+
interface DocumentWrite {
|
|
1685
|
+
collection: string;
|
|
1686
|
+
key: string;
|
|
1687
|
+
doc: unknown;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
type ReadModelName = 'catalogue' | 'orders' | 'customers' | 'search';
|
|
1691
|
+
interface RebuildDeps {
|
|
1404
1692
|
config: NymbalConfig;
|
|
1693
|
+
store: CommandStore;
|
|
1405
1694
|
repos: Repositories;
|
|
1406
|
-
|
|
1695
|
+
/** Where the document models are rebuilt and caught up. */
|
|
1696
|
+
documentStore: DocumentStoreAdapter;
|
|
1697
|
+
/** Where the search model is rebuilt and caught up; the search model cannot be rebuilt without it. */
|
|
1698
|
+
search?: SearchAdapter;
|
|
1407
1699
|
logger: Logger;
|
|
1408
|
-
|
|
1700
|
+
/** Rows per page read from the command store. */
|
|
1701
|
+
pageSize?: number;
|
|
1702
|
+
/** Called before each page is read. */
|
|
1703
|
+
onPage?: (page: {
|
|
1704
|
+
model: ReadModelName;
|
|
1705
|
+
table: string;
|
|
1706
|
+
page: number;
|
|
1707
|
+
}) => void | Promise<void>;
|
|
1708
|
+
}
|
|
1709
|
+
/** What a rebuilder reads with: the command store in pages, each page a read of its own. */
|
|
1710
|
+
interface RebuildContext {
|
|
1711
|
+
deps: RebuildDeps;
|
|
1712
|
+
pages<T extends {
|
|
1713
|
+
id: string;
|
|
1714
|
+
}>(table: string, read: (tx: ReadTx, page: KeysetPage) => Promise<T[]>): AsyncIterable<T[]>;
|
|
1715
|
+
}
|
|
1716
|
+
interface ReadModel {
|
|
1717
|
+
name: ReadModelName;
|
|
1718
|
+
/** Where its documents go: document-store collections, or the search adapter. */
|
|
1719
|
+
target: 'documents' | 'search';
|
|
1720
|
+
/** The document-store collections it owns; the search model owns none. */
|
|
1721
|
+
collections: readonly string[];
|
|
1722
|
+
/** Every document of the model, from the authoritative tables. A search model writes to `SEARCH_INDEX`. */
|
|
1723
|
+
rebuild(ctx: RebuildContext): AsyncIterable<DocumentWrite>;
|
|
1724
|
+
/** The live projections that keep the model, bound to `deps`' document store and search adapter. */
|
|
1725
|
+
handlers(deps: RebuildDeps): DerivedHandler[];
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
/** Every derived read model, in the order a rebuild of all of them runs. */
|
|
1729
|
+
declare const READ_MODELS: readonly ReadModel[];
|
|
1730
|
+
declare const READ_MODEL_NAMES: readonly ReadModelName[];
|
|
1731
|
+
/**
|
|
1732
|
+
* How long before the rebuild started a delivery may be stamped and still be caught up. The relay stamps
|
|
1733
|
+
* `delivered_at` on its own host's clock, which can run behind this process's; re-applying an event costs little,
|
|
1734
|
+
* skipping one loses a write.
|
|
1735
|
+
*/
|
|
1736
|
+
declare const CATCH_UP_MARGIN_MS: number;
|
|
1737
|
+
interface CatchUpFailure {
|
|
1738
|
+
seq: number;
|
|
1739
|
+
eventId: string;
|
|
1740
|
+
type: string;
|
|
1741
|
+
handler: string;
|
|
1742
|
+
error: string;
|
|
1743
|
+
}
|
|
1744
|
+
interface RebuildReportEntry {
|
|
1745
|
+
model: ReadModelName;
|
|
1746
|
+
/** Each collection swapped in and the documents it was given (the search model's is `index`). */
|
|
1747
|
+
collections: Array<{
|
|
1748
|
+
name: string;
|
|
1749
|
+
documents: number;
|
|
1750
|
+
}>;
|
|
1751
|
+
/** Logged events re-applied after the swap. */
|
|
1752
|
+
caughtUpEvents: number;
|
|
1753
|
+
/** Catch-up events a handler failed on: the model is swapped all the same. */
|
|
1754
|
+
failures: CatchUpFailure[];
|
|
1755
|
+
ms: number;
|
|
1756
|
+
/** Set when the search adapter has no `replaceAll`: it was given every document, and kept any others it held. */
|
|
1757
|
+
note?: string;
|
|
1409
1758
|
}
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1759
|
+
type RebuildReport = RebuildReportEntry[];
|
|
1760
|
+
/** A rebuilder failed: nothing was swapped, so every read model keeps its old contents. */
|
|
1761
|
+
declare class RebuildError extends Error {
|
|
1762
|
+
readonly model: ReadModelName;
|
|
1763
|
+
constructor(model: ReadModelName, cause: unknown);
|
|
1764
|
+
}
|
|
1765
|
+
/**
|
|
1766
|
+
* Rebuilds `names` from the command store's tables: every model is read first, then each is swapped in (atomically
|
|
1767
|
+
* per collection) and caught up with the events delivered since its read began. A rebuilder that throws rejects with
|
|
1768
|
+
* a `RebuildError` before anything is swapped. Catch-up failures are in the report.
|
|
1769
|
+
*/
|
|
1770
|
+
declare function rebuild(names: readonly ReadModelName[], deps: RebuildDeps): Promise<RebuildReport>;
|
|
1771
|
+
interface CollectionDiff {
|
|
1772
|
+
name: string;
|
|
1773
|
+
added: number;
|
|
1774
|
+
changed: number;
|
|
1775
|
+
removed: number;
|
|
1776
|
+
}
|
|
1777
|
+
interface ReadModelDiff {
|
|
1778
|
+
model: ReadModelName;
|
|
1779
|
+
collections: CollectionDiff[];
|
|
1780
|
+
/** Why the model was not compared, when it was not. */
|
|
1781
|
+
skipped?: string;
|
|
1782
|
+
}
|
|
1783
|
+
/** Rebuilds `name` into memory and counts, per collection, what differs from the live read model; writes nothing. */
|
|
1784
|
+
declare function diffReadModel(name: ReadModelName, deps: RebuildDeps): Promise<ReadModelDiff>;
|
|
1785
|
+
|
|
1786
|
+
interface OpenReadModelsOptions {
|
|
1787
|
+
logger: Logger;
|
|
1788
|
+
/** The project's own adapters, for a `custom` search slot. */
|
|
1789
|
+
adapters?: InjectedAdapters;
|
|
1790
|
+
sqlitePath?: string;
|
|
1791
|
+
postgresUrl?: string;
|
|
1792
|
+
env?: NodeJS.ProcessEnv;
|
|
1414
1793
|
}
|
|
1415
|
-
|
|
1794
|
+
/**
|
|
1795
|
+
* What a rebuild outside the server needs, built as `createApp` builds it: the command store (writable), the document
|
|
1796
|
+
* store and the search adapter. No bus, relay, sweeper or other slot. `close()` closes what it opened.
|
|
1797
|
+
*/
|
|
1798
|
+
declare function openReadModels(config: NymbalConfig, options: OpenReadModelsOptions): Promise<{
|
|
1799
|
+
deps: RebuildDeps;
|
|
1800
|
+
close(): Promise<void>;
|
|
1801
|
+
}>;
|
|
1416
1802
|
|
|
1417
1803
|
interface SeedCategory {
|
|
1418
1804
|
slug: string;
|
|
@@ -1438,4 +1824,5 @@ interface LocalFsMediaStorageOptions {
|
|
|
1438
1824
|
declare const LOCAL_FS_MEDIA_CAPABILITIES: readonly string[];
|
|
1439
1825
|
declare function createLocalFsMediaStorage(options: LocalFsMediaStorageOptions): MediaStorage;
|
|
1440
1826
|
|
|
1441
|
-
export {
|
|
1827
|
+
export { CATCH_UP_MARGIN_MS, CSRF_COOKIE, CSRF_HEADER, InMemoryDocumentStore, InProcessEventBus, LOCAL_FS_MEDIA_CAPABILITIES, PROVIDER_PACKAGES, PROVIDER_REFUND_REASON, READ_MODELS, READ_MODEL_NAMES, REDIS_DEFAULTS, RateLimiter, RebuildError, SECRETS_KEY_ENV, SECRETS_KEY_OLD_ENV, actorOf, appendAuditEntry, audit, auditEntriesInOrder, auditedCommand, buildAdapters, buildRepositories, buildServices, createApp, createAuditEntryRepository, 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, createSettingsRepository, createStockAdjustmentRepository, createVariantRepository, currentActor, currentCorrelationId, decrypt, diagnose, diffReadModel, encodeSearchCursor, encrypt, fillFromSettings, findAppliedByKey, importProviderPackage, installLine, isMissingSettingsTable, keyId, keyProblem, listAuditEntries, newCorrelationId, openReadModels, orderPayment, rawClients, readSecretsKey, rebuild, refreshRefunded, registerAdminStaticRoute, registerAllRoutes, registerHandlers, resolvePrimitives, routeSchemas, runAsActor, runMigrations, runSeed, runWithCorrelation, scrub, seedCategories, seedProducts, settingAad, settlementOf, sqliteFile, startCartAbandonmentSweeper, startEventRetentionSweeper, startInventoryReservationSweeper, withIdempotency };
|
|
1828
|
+
export type { AbandonedCart, AbandonedWindow, Actor, AdapterRegistry, AppliedEntry, AttachHttpOptions, AuditCursor, AuditEntryInsert, AuditEntryRepository, AuditFilter, AuditQuery, AuthService, AuthTokens, BeginCheckoutInput, BeginCheckoutResult, BuildAdaptersDeps, BuildServicesDeps, CapabilitiesReport, CapabilitySlot, CapturedPayment, CartRepository, CartService, CatchUpFailure, CategoryCreateInput, CategoryInsert, CategoryRepository, CategoryService, CategoryUpdate, CategoryUpdateInput, CheckoutService, CollectionDiff, CommandStore, CommandStoreOptions, CommerceAdapters, CreateAppOptions, CreateAuthServiceDeps, CreateCartServiceDeps, CreateCheckoutServiceDeps, CreateInventoryServiceDeps, CreateLoggerOptions, CreateOrderServiceDeps, CreatePlatformOptions, CreateProductServiceDeps, CreatePublisherOptions, CreateRefundServiceDeps, CreateRelayOptions, CustomerInsert, CustomerJwtPayload, CustomerRepository, CustomerService, CustomerUpdate, CustomerWithHash, DiagnoseOptions, DiagnosisCheck, DiagnosisReport, DiagnosisStatus, EncryptedValue, EventArchiveWriter, EventBuilderContext, EventLogFilter, EventLogRepository, EventPublisher, EventRetentionSweeperDeps, FinalizeResult, IdempotencyOptions, ImportCustomerInput, InMemoryDocumentStoreOptions, InProcessEventBusOptions, InjectedAdapters, InventoryReservationRepository, InventoryService, KeysetPage, CategoryInsert$1 as LegacyCategoryInsert, CategoryRow as LegacyCategoryRow, ProductInsert$1 as LegacyProductInsert, ProductRow as LegacyProductRow, LocalFsMediaStorageOptions, LoggedEvent, MakeEventOptions, ManualPayments, MigrateOptions, NativeEmailAdapterConfig, NymbalApp, OpenReadModelsOptions, OrderCapture, OrderCreateDraftInput, OrderHistoryInsert, OrderHistoryRepository, OrderImportInput, OrderInsert, OrderRefundInsert, OrderRefundRepository, OrderRepository, OrderSequenceRepository, OrderService, Platform, PlatformConnectionOptions, PostgresClient, Primitives, ProcessedEventRepository, ProductCategoryRepository, ProductCreateInput, ProductInsert, ProductRepository, ProductService, ProductUpdate, ProductUpdateInput, ProfileUpdate, ProviderPackage, PublishOptions, RawClients, ReadModel, ReadModelDiff, ReadModelName, ReadTx, RebuildDeps, RebuildReport, RebuildReportEntry, RefreshTokenInsert, RefreshTokenRepository, RefreshTokenRow, RefundInput, RefundResult, RefundService, RegisterAllRoutesDeps, RegisterHandlersDeps, RegisterInput, Relay, Repositories, ReservationInsert, ReserveStockResult, ResolvePrimitivesOptions, ReviewInsert, ReviewKey, ReviewRepository, RouteSchema, SearchService, SecretsKey, SeedCategory, SeedDeps, SeedProduct, SeedResult, ServiceRegistry, SettingRow, SettingSource, SettingValue, SettingsRepository, Settlement, SlotCapabilities, SqliteClient, StockAdjustmentInsert, StockAdjustmentRepository, StoreRepository, StoredCipher, SweeperHandle, Tx, VariantInsert, VariantRepository, VariantUpdate };
|