@econ-v1/ports 0.0.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/clock.d.ts +11 -0
- package/dist/clock.d.ts.map +1 -0
- package/dist/clock.js +2 -0
- package/dist/clock.js.map +1 -0
- package/dist/crypto.d.ts +5 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +2 -0
- package/dist/crypto.js.map +1 -0
- package/dist/id.d.ts +4 -0
- package/dist/id.d.ts.map +1 -0
- package/dist/id.js +2 -0
- package/dist/id.js.map +1 -0
- package/dist/identity.d.ts +44 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +2 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/media-preferences.d.ts +47 -0
- package/dist/media-preferences.d.ts.map +1 -0
- package/dist/media-preferences.js +2 -0
- package/dist/media-preferences.js.map +1 -0
- package/dist/network/home-node-candidate.d.ts +10 -0
- package/dist/network/home-node-candidate.d.ts.map +1 -0
- package/dist/network/home-node-candidate.js +2 -0
- package/dist/network/home-node-candidate.js.map +1 -0
- package/dist/network.d.ts +33 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/network.js +2 -0
- package/dist/network.js.map +1 -0
- package/dist/repositories/conversation-repository.d.ts +122 -0
- package/dist/repositories/conversation-repository.d.ts.map +1 -0
- package/dist/repositories/conversation-repository.js +2 -0
- package/dist/repositories/conversation-repository.js.map +1 -0
- package/dist/repositories/durable-event.d.ts +21 -0
- package/dist/repositories/durable-event.d.ts.map +1 -0
- package/dist/repositories/durable-event.js +2 -0
- package/dist/repositories/durable-event.js.map +1 -0
- package/dist/repositories/outbox.d.ts +96 -0
- package/dist/repositories/outbox.d.ts.map +1 -0
- package/dist/repositories/outbox.js +9 -0
- package/dist/repositories/outbox.js.map +1 -0
- package/dist/repositories/repository-mutation.d.ts +5 -0
- package/dist/repositories/repository-mutation.d.ts.map +1 -0
- package/dist/repositories/repository-mutation.js +2 -0
- package/dist/repositories/repository-mutation.js.map +1 -0
- package/dist/repositories/revisioned-repository.d.ts +41 -0
- package/dist/repositories/revisioned-repository.d.ts.map +1 -0
- package/dist/repositories/revisioned-repository.js +2 -0
- package/dist/repositories/revisioned-repository.js.map +1 -0
- package/dist/repositories/settings.d.ts +27 -0
- package/dist/repositories/settings.d.ts.map +1 -0
- package/dist/repositories/settings.js +2 -0
- package/dist/repositories/settings.js.map +1 -0
- package/dist/repositories/sync-ledger.d.ts +30 -0
- package/dist/repositories/sync-ledger.d.ts.map +1 -0
- package/dist/repositories/sync-ledger.js +2 -0
- package/dist/repositories/sync-ledger.js.map +1 -0
- package/dist/repositories/wallet-mirror-repository.d.ts +52 -0
- package/dist/repositories/wallet-mirror-repository.d.ts.map +1 -0
- package/dist/repositories/wallet-mirror-repository.js +53 -0
- package/dist/repositories/wallet-mirror-repository.js.map +1 -0
- package/dist/repositories.d.ts +44 -0
- package/dist/repositories.d.ts.map +1 -0
- package/dist/repositories.js +2 -0
- package/dist/repositories.js.map +1 -0
- package/dist/scheduler.d.ts +12 -0
- package/dist/scheduler.d.ts.map +1 -0
- package/dist/scheduler.js +2 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/storage.d.ts +97 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +14 -0
- package/dist/storage.js.map +1 -0
- package/dist/theme.d.ts +30 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +2 -0
- package/dist/theme.js.map +1 -0
- package/package.json +52 -0
package/dist/clock.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ClockWake {
|
|
2
|
+
cancel(): void;
|
|
3
|
+
}
|
|
4
|
+
export interface ClockPort {
|
|
5
|
+
now(): string;
|
|
6
|
+
wakeAt(dueAt: string, wake: () => void): ClockWake;
|
|
7
|
+
}
|
|
8
|
+
export interface DelayPort {
|
|
9
|
+
wait(milliseconds: number): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=clock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../src/clock.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,IAAI,MAAM,CAAC;IACd,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,SAAS,CAAC;CACpD;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C"}
|
package/dist/clock.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.js","sourceRoot":"","sources":["../src/clock.ts"],"names":[],"mappings":""}
|
package/dist/crypto.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAClG"}
|
package/dist/crypto.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":""}
|
package/dist/id.d.ts
ADDED
package/dist/id.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../src/id.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ,IAAI,MAAM,CAAC;CACpB"}
|
package/dist/id.js
ADDED
package/dist/id.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.js","sourceRoot":"","sources":["../src/id.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface DeviceKeyHandle {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
}
|
|
4
|
+
export type KeyCustodyMode = "non-extractable" | "wrapped";
|
|
5
|
+
export interface DevicePublicIdentity {
|
|
6
|
+
readonly custodyMode: KeyCustodyMode;
|
|
7
|
+
readonly did: string;
|
|
8
|
+
readonly nodeId: string;
|
|
9
|
+
readonly publicKeyMultibase: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DeviceDelegation {
|
|
12
|
+
readonly credential: string;
|
|
13
|
+
readonly expiresAt: string;
|
|
14
|
+
readonly issuedAt: string;
|
|
15
|
+
readonly revocationId: string;
|
|
16
|
+
readonly scopes: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export interface DeviceConnectionMetadata {
|
|
19
|
+
readonly directAddresses: readonly string[];
|
|
20
|
+
readonly lastConnectedAt?: string;
|
|
21
|
+
readonly relayUrl?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DeviceIdentity extends DevicePublicIdentity {
|
|
24
|
+
readonly keyHandle: DeviceKeyHandle;
|
|
25
|
+
}
|
|
26
|
+
export interface IdentityDiagnostics {
|
|
27
|
+
readonly custodyMode?: KeyCustodyMode;
|
|
28
|
+
readonly hasDelegation: boolean;
|
|
29
|
+
readonly keyId?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IdentityPort {
|
|
32
|
+
generate(): Promise<DeviceIdentity>;
|
|
33
|
+
sign(keyHandle: DeviceKeyHandle, payload: Uint8Array): Promise<Uint8Array>;
|
|
34
|
+
publicIdentity(): Promise<DevicePublicIdentity | undefined>;
|
|
35
|
+
loadDelegation(): Promise<DeviceDelegation | undefined>;
|
|
36
|
+
storeDelegation(delegation: DeviceDelegation): Promise<void>;
|
|
37
|
+
loadConnectionMetadata(): Promise<DeviceConnectionMetadata | undefined>;
|
|
38
|
+
storeConnectionMetadata(metadata: DeviceConnectionMetadata): Promise<void>;
|
|
39
|
+
clearDelegation(): Promise<void>;
|
|
40
|
+
clear(): Promise<void>;
|
|
41
|
+
recoverAfterRevocation(): Promise<DeviceIdentity>;
|
|
42
|
+
diagnostics(): Promise<IdentityDiagnostics>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,cAAe,SAAQ,oBAAoB;IAC1D,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IACpC,IAAI,CAAC,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3E,cAAc,IAAI,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;IAC5D,cAAc,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;IACxD,eAAe,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,sBAAsB,IAAI,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAAC;IACxE,uBAAuB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,sBAAsB,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IAClD,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC7C"}
|
package/dist/identity.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type { ClockPort, ClockWake, DelayPort } from "./clock.js";
|
|
2
|
+
export type { CryptoPort } from "./crypto.js";
|
|
3
|
+
export type { IdPort } from "./id.js";
|
|
4
|
+
export type { DeviceConnectionMetadata, DeviceDelegation, DeviceIdentity, DeviceKeyHandle, DevicePublicIdentity, IdentityDiagnostics, IdentityPort, KeyCustodyMode, } from "./identity.js";
|
|
5
|
+
export type { DeltaRequest, CancellationSignal, HomeNodeClient, HomeNodeRequest, PeerTransportPort, TransportPath, TransportState, } from "./network.js";
|
|
6
|
+
export type { HomeNodeCandidate, HomeNodeDialer } from "./network/home-node-candidate.js";
|
|
7
|
+
export type { PreparedStageAsset, StageAssetPort, StageCatalogEntry, StageManifest, StageUiKind, StageUiMetadata, StageUiNav, StageRegistryPort, StageRegistrySnapshot, } from "./repositories.js";
|
|
8
|
+
export { CONVERSATION_MESSAGE_STATES } from "./repositories/conversation-repository.js";
|
|
9
|
+
export type { Conversation, ConversationListParams, ConversationLogDelta, ConversationMessage, ConversationMessageState, ConversationRepository, ConversationRepositoryEvent, MessageListParams, Notification, NotificationListParams, NotificationRepository, NotificationRepositoryEvent, RepositoryEvent, } from "./repositories/conversation-repository.js";
|
|
10
|
+
export type { DurableEvent, DurableRepositoryEvent, DurableRepositoryEventStore, RepositoryWriteResult, } from "./repositories/durable-event.js";
|
|
11
|
+
export { OutboxIdempotencyConflictError } from "./repositories/outbox.js";
|
|
12
|
+
export type { OutboxDeletedEvent, OutboxRecord, OutboxRecordState, OutboxReplayClaim, OutboxReplayStatus, OutboxRepository, OutboxRepositoryEvent, OutboxRepositoryFilter, OutboxSettleInput, OutboxStateChangedEvent, } from "./repositories/outbox.js";
|
|
13
|
+
export type { RepositoryJsonPrimitive, RepositoryJsonValue, } from "./repositories/repository-mutation.js";
|
|
14
|
+
export type { SettingInput, SettingRecord, SettingsRepository, SettingsRepositoryEvent, } from "./repositories/settings.js";
|
|
15
|
+
export type { SyncLedgerInput, SyncLedgerRecord, SyncLedgerRepository, SyncLedgerRepositoryEvent, SyncCursorDeletedEvent, SyncDeltaAppliedEvent, } from "./repositories/sync-ledger.js";
|
|
16
|
+
export { REVISIONED_REPOSITORY_DOMAINS, } from "./repositories/revisioned-repository.js";
|
|
17
|
+
export type { AgentRepository, GraphRepository, RevisionCommand, RevisionCommandResult, RevisionedEntity, RevisionedRepository, RevisionedRepositoryDomain, RevisionedRepositoryEvent, RevisionedSettingsRepository, } from "./repositories/revisioned-repository.js";
|
|
18
|
+
export { isWalletAuthoritativeSnapshot, isWalletCommandResult, isWalletSnapshotValue, } from "./repositories/wallet-mirror-repository.js";
|
|
19
|
+
export type { WalletAuthoritativeSnapshot, WalletCommandResult, WalletL402Receipt, WalletMirrorRepository, WalletPaymentRecord, WalletSnapshotValue, } from "./repositories/wallet-mirror-repository.js";
|
|
20
|
+
export type { MediaPreferencesPort } from "./media-preferences.js";
|
|
21
|
+
export type { ScheduledJob, SchedulerPort } from "./scheduler.js";
|
|
22
|
+
export type { ThemeEnvironmentPort, ThemePreference } from "./theme.js";
|
|
23
|
+
export { RESET_LOCAL_STORAGE_CONFIRMATION, STORAGE_RECOVERY_MESSAGES } from "./storage.js";
|
|
24
|
+
export type { EncryptedStorageDiagnostic, StorageDatabasePort, StoragePort, StorageReadyState, StorageRecoveryCode, StorageRecoveryRequiredState, StorageRecoveryState, StorageRepositoryEvent, StorageRepositoryPort, StorageStartingState, } from "./storage.js";
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,YAAY,EACV,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,cAAc,G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C;AACvC,OAAO,EACL,6BAA6B,GAC9B,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACV,2BAA2B,EAC3B,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,4CAA4C,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAClE,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAC3F,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CONVERSATION_MESSAGE_STATES } from "./repositories/conversation-repository.js";
|
|
2
|
+
export { OutboxIdempotencyConflictError } from "./repositories/outbox.js";
|
|
3
|
+
export { REVISIONED_REPOSITORY_DOMAINS, } from "./repositories/revisioned-repository.js";
|
|
4
|
+
export { isWalletAuthoritativeSnapshot, isWalletCommandResult, isWalletSnapshotValue, } from "./repositories/wallet-mirror-repository.js";
|
|
5
|
+
export { RESET_LOCAL_STORAGE_CONFIRMATION, STORAGE_RECOVERY_MESSAGES } from "./storage.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAsBxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AA+B1E,OAAO,EACL,6BAA6B,GAC9B,MAAM,yCAAyC,CAAC;AAYjD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,4CAA4C,CAAC;AAYpD,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boundary port for the two NON-THEME media queries the shell reads (#1687).
|
|
3
|
+
*
|
|
4
|
+
* `client/ui` may never call `matchMedia` directly (boundary rule B2,
|
|
5
|
+
* `client/scripts/check-boundaries.mjs`) — this is the narrow surface
|
|
6
|
+
* `client/adapters-web`'s `createBrowserMediaPreferences()` implements against the real
|
|
7
|
+
* global, and the composition root (`system/pwa/src/main.ts`) registers it (via
|
|
8
|
+
* `client/ui`'s `configureMediaPreferences`) before the shell's first paint.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately SEPARATE from `ThemeEnvironmentPort` rather than folded into it, even
|
|
11
|
+
* though both end up calling `matchMedia` in their adapters:
|
|
12
|
+
*
|
|
13
|
+
* - `ThemeEnvironmentPort` models the *theme preference* as a whole — a value with
|
|
14
|
+
* PERSISTENCE (`getStoredTheme`/`setStoredTheme` over `localStorage`) where the media
|
|
15
|
+
* query is only the fallback when nothing is stored, plus a live `change`
|
|
16
|
+
* subscription because a theme flip must repaint mid-session. Its concern is
|
|
17
|
+
* `prefers-color-scheme`.
|
|
18
|
+
* - The queries here are neither theme nor persisted nor live: `prefers-reduced-motion`
|
|
19
|
+
* (`stages/waves-stage.ts`, `stages/waves-canvas.ts`) is an accessibility/motion
|
|
20
|
+
* preference, and `(hover: hover) and (pointer: fine)` (`shell/pmenu.ts`) is a
|
|
21
|
+
* pointer-capability probe. Both are read ONCE, at mount/connect time, matching the
|
|
22
|
+
* original skin's own one-shot checks — neither has a stored override to consult nor
|
|
23
|
+
* a subscription to tear down.
|
|
24
|
+
*
|
|
25
|
+
* Folding them into `ThemeEnvironmentPort` would make a port named for theme answer
|
|
26
|
+
* questions about motion and pointers, and would oblige every fake in the test suite (and
|
|
27
|
+
* `theme-environment.ts`'s `NOOP_THEME_ENVIRONMENT`) to stub three unrelated concerns to
|
|
28
|
+
* exercise one. Two narrow ports, one adapter technology.
|
|
29
|
+
*
|
|
30
|
+
* Both methods are synchronous and side-effect-free, for the same reason
|
|
31
|
+
* `ThemeEnvironmentPort`'s are: they are read during `connectedCallback`/`mount`, before
|
|
32
|
+
* the kernel connection (`KernelRpcClient`, an async `SharedWorker`/leader-tab bridge)
|
|
33
|
+
* exists, so they can never be mediated through `@econ-v1/rpc` the way ordinary UI
|
|
34
|
+
* reads are (rule S4).
|
|
35
|
+
*/
|
|
36
|
+
export interface MediaPreferencesPort {
|
|
37
|
+
/** Current `(prefers-reduced-motion: reduce)` match. MUST return `false` when the
|
|
38
|
+
* environment doesn't support media queries — the safe default is the FULL experience,
|
|
39
|
+
* matching the original skin, which only suppresses animation on an explicit match. */
|
|
40
|
+
prefersReducedMotion(): boolean;
|
|
41
|
+
/** Current `(hover: hover) and (pointer: fine)` match — i.e. a real mouse-like pointer
|
|
42
|
+
* that can hover. MUST return `false` when the environment doesn't support media
|
|
43
|
+
* queries, so hover-only affordances stay inert rather than activating on touch (see
|
|
44
|
+
* `shell/pmenu.ts`'s `#finePointer`). */
|
|
45
|
+
hasFinePointer(): boolean;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=media-preferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-preferences.d.ts","sourceRoot":"","sources":["../src/media-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,WAAW,oBAAoB;IACnC;;2FAEuF;IACvF,oBAAoB,IAAI,OAAO,CAAC;IAChC;;;6CAGyC;IACzC,cAAc,IAAI,OAAO,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-preferences.js","sourceRoot":"","sources":["../src/media-preferences.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HomeNodeClient, TransportPath } from "../network.js";
|
|
2
|
+
export interface HomeNodeCandidate {
|
|
3
|
+
readonly address: string;
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly path: Exclude<TransportPath, "offline">;
|
|
6
|
+
}
|
|
7
|
+
export interface HomeNodeDialer {
|
|
8
|
+
dial(candidate: HomeNodeCandidate, signal: AbortSignal): Promise<HomeNodeClient>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=home-node-candidate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-node-candidate.d.ts","sourceRoot":"","sources":["../../src/network/home-node-candidate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAClF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-node-candidate.js","sourceRoot":"","sources":["../../src/network/home-node-candidate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type TransportPath = "iroh-relay" | "lan-direct" | "offline" | "wan-direct";
|
|
2
|
+
export type TransportState = {
|
|
3
|
+
readonly changedAt: string;
|
|
4
|
+
readonly path: "lan-direct" | "wan-direct" | "iroh-relay";
|
|
5
|
+
readonly status: "connected";
|
|
6
|
+
} | {
|
|
7
|
+
readonly changedAt: string;
|
|
8
|
+
readonly path: "offline";
|
|
9
|
+
readonly status: "offline";
|
|
10
|
+
};
|
|
11
|
+
export interface HomeNodeRequest {
|
|
12
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
13
|
+
readonly operation: string;
|
|
14
|
+
readonly payload: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface DeltaRequest {
|
|
17
|
+
readonly cursor?: string;
|
|
18
|
+
readonly domain: string;
|
|
19
|
+
}
|
|
20
|
+
export interface HomeNodeClient {
|
|
21
|
+
deltas<T>(request: DeltaRequest): AsyncIterable<T>;
|
|
22
|
+
invoke<T>(request: HomeNodeRequest): Promise<T>;
|
|
23
|
+
readonly state: TransportState;
|
|
24
|
+
}
|
|
25
|
+
export interface CancellationSignal {
|
|
26
|
+
readonly aborted: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface PeerTransportPort {
|
|
29
|
+
send(peer: string, payload: Uint8Array, signal?: CancellationSignal): Promise<void>;
|
|
30
|
+
publish(topic: string, payload: Uint8Array): Promise<void>;
|
|
31
|
+
subscribe(topic: string, signal?: CancellationSignal): AsyncIterable<Uint8Array>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,YAAY,CAAC;AAEnF,MAAM,MAAM,cAAc,GAC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AS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;CAClF"}
|
package/dist/network.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { RepositoryWriteResult } from "./durable-event.js";
|
|
2
|
+
export declare const CONVERSATION_MESSAGE_STATES: readonly ["pending", "confirmed", "failed"];
|
|
3
|
+
export type ConversationMessageState = (typeof CONVERSATION_MESSAGE_STATES)[number];
|
|
4
|
+
export interface Conversation {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly lastMessagePreview?: string;
|
|
7
|
+
readonly lastMessageAt?: string;
|
|
8
|
+
readonly participantIds: readonly string[];
|
|
9
|
+
readonly title: string;
|
|
10
|
+
readonly unreadCount: number;
|
|
11
|
+
readonly updatedAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ConversationMessage {
|
|
14
|
+
readonly body: string;
|
|
15
|
+
readonly clientMessageId?: string;
|
|
16
|
+
readonly conversationId: string;
|
|
17
|
+
readonly createdAt: string;
|
|
18
|
+
readonly failureReason?: string;
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly senderId: string;
|
|
21
|
+
readonly serverMessageId?: string;
|
|
22
|
+
readonly state: ConversationMessageState;
|
|
23
|
+
}
|
|
24
|
+
export interface Notification {
|
|
25
|
+
readonly body: string;
|
|
26
|
+
readonly createdAt: string;
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly readAt?: string;
|
|
29
|
+
readonly referenceId?: string;
|
|
30
|
+
readonly title: string;
|
|
31
|
+
readonly type: string;
|
|
32
|
+
}
|
|
33
|
+
export type ConversationLogDelta = {
|
|
34
|
+
readonly conversation: Conversation;
|
|
35
|
+
readonly kind: "conversation.upsert";
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: "message.append";
|
|
38
|
+
readonly message: ConversationMessage;
|
|
39
|
+
} | {
|
|
40
|
+
readonly acknowledgedAt: string;
|
|
41
|
+
readonly kind: "message.ack";
|
|
42
|
+
readonly messageId: string;
|
|
43
|
+
readonly serverMessageId?: string;
|
|
44
|
+
} | {
|
|
45
|
+
readonly failedAt: string;
|
|
46
|
+
readonly kind: "message.fail";
|
|
47
|
+
readonly messageId: string;
|
|
48
|
+
readonly reason: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: "notification.upsert";
|
|
51
|
+
readonly notification: Notification;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: "notification.read";
|
|
54
|
+
readonly notificationId: string;
|
|
55
|
+
readonly readAt: string;
|
|
56
|
+
};
|
|
57
|
+
export interface ConversationListParams {
|
|
58
|
+
readonly before?: string;
|
|
59
|
+
readonly limit?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface MessageListParams {
|
|
62
|
+
readonly before?: string;
|
|
63
|
+
readonly limit?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface NotificationListParams {
|
|
66
|
+
readonly limit?: number;
|
|
67
|
+
readonly unreadOnly?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface ConversationRepositoryEvent {
|
|
70
|
+
readonly occurredAt: string;
|
|
71
|
+
readonly payload: {
|
|
72
|
+
readonly action: "created" | "updated";
|
|
73
|
+
readonly entityId: string;
|
|
74
|
+
readonly entityType: "conversation" | "message";
|
|
75
|
+
};
|
|
76
|
+
readonly type: "domain.entity-changed";
|
|
77
|
+
}
|
|
78
|
+
export type NotificationRepositoryEvent = {
|
|
79
|
+
readonly occurredAt: string;
|
|
80
|
+
readonly payload: {
|
|
81
|
+
readonly action: "created" | "updated";
|
|
82
|
+
readonly entityId: string;
|
|
83
|
+
readonly entityType: "notification";
|
|
84
|
+
};
|
|
85
|
+
readonly type: "domain.entity-changed";
|
|
86
|
+
};
|
|
87
|
+
export type RepositoryEvent = ConversationRepositoryEvent | NotificationRepositoryEvent;
|
|
88
|
+
export interface ConversationRepository {
|
|
89
|
+
acknowledgeMessage(input: {
|
|
90
|
+
readonly acknowledgedAt: string;
|
|
91
|
+
readonly messageId: string;
|
|
92
|
+
readonly serverMessageId?: string;
|
|
93
|
+
}): Promise<RepositoryWriteResult<ConversationRepositoryEvent>>;
|
|
94
|
+
appendPendingMessage(input: {
|
|
95
|
+
readonly message: ConversationMessage;
|
|
96
|
+
}): {
|
|
97
|
+
commit(): Promise<RepositoryWriteResult<ConversationRepositoryEvent>>;
|
|
98
|
+
};
|
|
99
|
+
applyDelta(delta: ConversationLogDelta): {
|
|
100
|
+
commit(): Promise<RepositoryWriteResult<RepositoryEvent>>;
|
|
101
|
+
};
|
|
102
|
+
failMessage(input: {
|
|
103
|
+
readonly failedAt: string;
|
|
104
|
+
readonly messageId: string;
|
|
105
|
+
readonly reason: string;
|
|
106
|
+
}): Promise<RepositoryWriteResult<ConversationRepositoryEvent>>;
|
|
107
|
+
listConversations(params?: ConversationListParams): Promise<readonly Conversation[]>;
|
|
108
|
+
listMessages(conversationId: string, params?: MessageListParams): Promise<readonly ConversationMessage[]>;
|
|
109
|
+
}
|
|
110
|
+
export interface NotificationRepository {
|
|
111
|
+
applyDelta(delta: ConversationLogDelta): {
|
|
112
|
+
commit(): Promise<RepositoryWriteResult<RepositoryEvent>>;
|
|
113
|
+
};
|
|
114
|
+
listNotifications(params?: NotificationListParams): Promise<readonly Notification[]>;
|
|
115
|
+
markRead(input: {
|
|
116
|
+
readonly notificationId: string;
|
|
117
|
+
readonly readAt: string;
|
|
118
|
+
}): {
|
|
119
|
+
commit(): Promise<RepositoryWriteResult<NotificationRepositoryEvent>>;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=conversation-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-repository.d.ts","sourceRoot":"","sources":["../../src/repositories/conversation-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EA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AW,EAAE,QAAQ,CAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DurableEvent {
|
|
2
|
+
readonly occurredAt: string;
|
|
3
|
+
readonly payload: unknown;
|
|
4
|
+
readonly type: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DurableRepositoryEvent<TEvent extends DurableEvent = DurableEvent> {
|
|
7
|
+
readonly deliveredAt: string | undefined;
|
|
8
|
+
readonly deliveryAttempts: number;
|
|
9
|
+
readonly event: TEvent;
|
|
10
|
+
readonly sequence: number;
|
|
11
|
+
}
|
|
12
|
+
export interface DurableRepositoryEventStore<TEvent extends DurableEvent = DurableEvent> {
|
|
13
|
+
listUndelivered(): Promise<readonly DurableRepositoryEvent<TEvent>[]>;
|
|
14
|
+
markDelivered(sequence: number, deliveredAt: string): Promise<void>;
|
|
15
|
+
markDeliveryAttempt(sequence: number): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export interface RepositoryWriteResult<TEvent extends DurableEvent = DurableEvent> {
|
|
18
|
+
readonly eventSequences: readonly number[];
|
|
19
|
+
readonly events: readonly TEvent[];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=durable-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-event.d.ts","sourceRoot":"","sources":["../../src/repositories/durable-event.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB,CAAC,MAAM,SAAS,YAAY,GAAG,YAAY;IAChF,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,2BAA2B,CAAC,MAAM,SAAS,YAAY,GAAG,YAAY;IACrF,eAAe,IAAI,OAAO,CAAC,SAAS,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtE,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,qBAAqB,CAAC,MAAM,SAAS,YAAY,GAAG,YAAY;IAC/E,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-event.js","sourceRoot":"","sources":["../../src/repositories/durable-event.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { RepositoryWriteResult } from "./durable-event.js";
|
|
2
|
+
import type { RepositoryJsonValue } from "./repository-mutation.js";
|
|
3
|
+
export type OutboxRecordState = "acknowledged" | "conflict" | "failed" | "pending" | "replaying";
|
|
4
|
+
export interface OutboxRecord {
|
|
5
|
+
readonly createdAt: string;
|
|
6
|
+
readonly domain: string;
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly idempotencyKey: string;
|
|
9
|
+
readonly payload: RepositoryJsonValue;
|
|
10
|
+
readonly state: OutboxRecordState;
|
|
11
|
+
readonly updatedAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface OutboxReplayClaim extends OutboxRecord {
|
|
14
|
+
readonly attemptCount: number;
|
|
15
|
+
readonly leaseExpiresAt: string;
|
|
16
|
+
readonly leaseToken: string;
|
|
17
|
+
readonly state: "replaying";
|
|
18
|
+
}
|
|
19
|
+
export interface OutboxReplayStatus {
|
|
20
|
+
readonly attemptCount: number;
|
|
21
|
+
readonly createdAt: string;
|
|
22
|
+
readonly domain: string;
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly lastErrorCode?: string;
|
|
25
|
+
readonly lastErrorMessage?: string;
|
|
26
|
+
readonly nextAttemptAt?: string;
|
|
27
|
+
readonly settledAt?: string;
|
|
28
|
+
readonly state: OutboxRecordState;
|
|
29
|
+
readonly terminalErrorCode?: string;
|
|
30
|
+
readonly terminalErrorMessage?: string;
|
|
31
|
+
readonly updatedAt: string;
|
|
32
|
+
}
|
|
33
|
+
export type OutboxSettleInput = {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly leaseToken: string;
|
|
36
|
+
readonly outcome: "acknowledged";
|
|
37
|
+
} | {
|
|
38
|
+
readonly error: {
|
|
39
|
+
readonly code: string;
|
|
40
|
+
readonly message: string;
|
|
41
|
+
};
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly leaseToken: string;
|
|
44
|
+
readonly outcome: "conflict" | "failed";
|
|
45
|
+
} | {
|
|
46
|
+
readonly error: {
|
|
47
|
+
readonly code: string;
|
|
48
|
+
readonly message: string;
|
|
49
|
+
};
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly leaseToken: string;
|
|
52
|
+
readonly outcome: "retry";
|
|
53
|
+
readonly retryAt: string;
|
|
54
|
+
};
|
|
55
|
+
export interface OutboxStateChangedEvent {
|
|
56
|
+
readonly occurredAt: string;
|
|
57
|
+
readonly payload: {
|
|
58
|
+
readonly intent: OutboxRecord;
|
|
59
|
+
};
|
|
60
|
+
readonly type: "outbox.state-changed";
|
|
61
|
+
}
|
|
62
|
+
export interface OutboxDeletedEvent {
|
|
63
|
+
readonly occurredAt: string;
|
|
64
|
+
readonly payload: {
|
|
65
|
+
readonly action: "deleted";
|
|
66
|
+
readonly entityId: string;
|
|
67
|
+
readonly entityType: "outbox-intent";
|
|
68
|
+
};
|
|
69
|
+
readonly type: "domain.entity-changed";
|
|
70
|
+
}
|
|
71
|
+
export type OutboxRepositoryEvent = OutboxDeletedEvent | OutboxStateChangedEvent;
|
|
72
|
+
export interface OutboxRepositoryFilter {
|
|
73
|
+
readonly domain?: string;
|
|
74
|
+
readonly state?: OutboxRecordState;
|
|
75
|
+
}
|
|
76
|
+
export declare class OutboxIdempotencyConflictError extends Error {
|
|
77
|
+
readonly idempotencyKey: string;
|
|
78
|
+
constructor(idempotencyKey: string);
|
|
79
|
+
}
|
|
80
|
+
export interface OutboxRepository {
|
|
81
|
+
claimHead?(input: {
|
|
82
|
+
readonly domain: string;
|
|
83
|
+
readonly leaseExpiresAt: string;
|
|
84
|
+
readonly leaseToken: string;
|
|
85
|
+
}): Promise<OutboxReplayClaim | undefined>;
|
|
86
|
+
create(input: OutboxRecord): Promise<RepositoryWriteResult<OutboxRepositoryEvent>>;
|
|
87
|
+
delete(id: string): Promise<RepositoryWriteResult<OutboxRepositoryEvent>>;
|
|
88
|
+
list(filter?: OutboxRepositoryFilter): Promise<readonly OutboxRecord[]>;
|
|
89
|
+
read(id: string): Promise<OutboxRecord | undefined>;
|
|
90
|
+
listStatus?(filter?: {
|
|
91
|
+
readonly domain?: string;
|
|
92
|
+
}): Promise<readonly OutboxReplayStatus[]>;
|
|
93
|
+
settle?(input: OutboxSettleInput): Promise<RepositoryWriteResult<OutboxRepositoryEvent>>;
|
|
94
|
+
updateState(id: string, state: OutboxRecordState): Promise<RepositoryWriteResult<OutboxRepositoryEvent>>;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=outbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbox.d.ts","sourceRoot":"","sources":["../../src/repositories/outbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,MAAM,iBAAiB,GA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,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC,CAAC;CAC1G"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class OutboxIdempotencyConflictError extends Error {
|
|
2
|
+
idempotencyKey;
|
|
3
|
+
constructor(idempotencyKey) {
|
|
4
|
+
super("Outbox idempotency key belongs to a different command");
|
|
5
|
+
this.name = "OutboxIdempotencyConflictError";
|
|
6
|
+
this.idempotencyKey = idempotencyKey;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=outbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbox.js","sourceRoot":"","sources":["../../src/repositories/outbox.ts"],"names":[],"mappings":"AA4EA,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAC9C,cAAc,CAAS;IAEhC,YAAY,cAAsB;QAChC,KAAK,CAAC,uDAAuD,CAAC,CAAC;QAC/D,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;QAC7C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-mutation.d.ts","sourceRoot":"","sources":["../../src/repositories/repository-mutation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAC3B,uBAAuB,GACvB,mBAAmB,EAAE,GACrB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-mutation.js","sourceRoot":"","sources":["../../src/repositories/repository-mutation.ts"],"names":[],"mappings":""}
|