@byok-sdk/core 0.31.0 → 0.33.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/board.d.ts +2 -0
- package/dist/errors.d.ts +1 -0
- package/dist/in-memory/archive-access.d.ts +25 -0
- package/dist/in-memory/board.d.ts +1 -0
- package/dist/in-memory/mailbox.d.ts +8 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/mailbox.d.ts +83 -12
- package/dist/presence.d.ts +22 -0
- package/dist/sealed-payload/index.js.map +1 -1
- package/dist/sealed-payload/scope-key.d.ts +0 -2
- package/dist/store-compatibility.d.ts +37 -0
- package/package.json +2 -2
package/dist/board.d.ts
CHANGED
|
@@ -117,4 +117,6 @@ export interface BoardStore {
|
|
|
117
117
|
claim(tenant: TenantId, input: BoardClaimInput): Promise<BoardItem>;
|
|
118
118
|
unclaim(tenant: TenantId, input: BoardUnclaimInput): Promise<BoardItem>;
|
|
119
119
|
updateStatus(tenant: TenantId, input: BoardStatusUpdateInput): Promise<BoardItem>;
|
|
120
|
+
/** Removes the item; an absent item is not an error. The Host archive step (#1120) is the caller. */
|
|
121
|
+
remove(tenant: TenantId, itemId: string): Promise<void>;
|
|
120
122
|
}
|
package/dist/errors.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare const CORE_ERROR_CODES: {
|
|
|
47
47
|
readonly mailbox_message_not_found: 'mailbox_message_not_found';
|
|
48
48
|
readonly mailbox_cursor_regression: 'mailbox_cursor_regression';
|
|
49
49
|
readonly mailbox_cursor_ahead_of_delivery: 'mailbox_cursor_ahead_of_delivery';
|
|
50
|
+
readonly mailbox_stream_closed: 'mailbox_stream_closed';
|
|
50
51
|
readonly board_item_not_found: 'board_item_not_found';
|
|
51
52
|
readonly board_item_exists: 'board_item_exists';
|
|
52
53
|
readonly board_transition_invalid: 'board_transition_invalid';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Archive access to the in-memory core stores (#1120).
|
|
3
|
+
*
|
|
4
|
+
* The Host task archive in `@byok-sdk/cloud` rewrites acked and expired mailbox
|
|
5
|
+
* bodies and removes object references in one synchronous step, which the
|
|
6
|
+
* async ports cannot express. Adding methods to the port classes would put
|
|
7
|
+
* them in the port inventory, and exporting functions would put them in this
|
|
8
|
+
* package's API. Each in-memory store instead registers its access here, keyed
|
|
9
|
+
* by the store instance, in a registry under a well-known global symbol. The
|
|
10
|
+
* cloud package reads the same registry by the same key. Nothing here is
|
|
11
|
+
* exported from the package entry.
|
|
12
|
+
*/
|
|
13
|
+
import type { MailboxBody, MailboxMessage } from '../mailbox';
|
|
14
|
+
import type { TenantId } from '../tenant';
|
|
15
|
+
export interface InMemoryMailboxArchiveAccess {
|
|
16
|
+
/** The retained rows of one device. */
|
|
17
|
+
messagesOf(tenant: TenantId, deviceId: string): readonly MailboxMessage[];
|
|
18
|
+
/** Replaces one retained row's body. The row, its seq and its state stay. */
|
|
19
|
+
replaceBody(tenant: TenantId, deviceId: string, seq: number, body: MailboxBody): void;
|
|
20
|
+
}
|
|
21
|
+
export interface InMemoryObjectArchiveAccess {
|
|
22
|
+
/** Removes every reference `(refKind, refId)` holds and returns how many went. */
|
|
23
|
+
releaseReferences(tenant: TenantId, refKind: string, refId: string): number;
|
|
24
|
+
}
|
|
25
|
+
export declare function registerArchiveAccess(store: object, access: InMemoryMailboxArchiveAccess | InMemoryObjectArchiveAccess): void;
|
|
@@ -20,6 +20,7 @@ export declare class InMemoryBoardStore implements BoardStore {
|
|
|
20
20
|
create(tenant: TenantId, input: BoardItemInput): Promise<BoardItem>;
|
|
21
21
|
get(tenant: TenantId, itemId: string): Promise<BoardItem | undefined>;
|
|
22
22
|
list(tenant: TenantId, query: BoardListQuery): Promise<BoardPage>;
|
|
23
|
+
remove(tenant: TenantId, itemId: string): Promise<void>;
|
|
23
24
|
claim(tenant: TenantId, input: BoardClaimInput): Promise<BoardItem>;
|
|
24
25
|
unclaim(tenant: TenantId, input: BoardUnclaimInput): Promise<BoardItem>;
|
|
25
26
|
updateStatus(tenant: TenantId, input: BoardStatusUpdateInput): Promise<BoardItem>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CollectExpiredResult } from '../retention';
|
|
2
|
-
import type { MailboxAdvanceCursorInput, MailboxAppendInput, MailboxCursorState, MailboxMessage, MailboxPage, MailboxReadQuery, MailboxRecordDeliveryInput, MailboxCollectExpiredInput, MailboxStore, MailboxUsage } from '../mailbox';
|
|
2
|
+
import type { MailboxAdvanceCursorInput, MailboxAppendInput, MailboxCloseStreamInput, MailboxCursorState, MailboxMessage, MailboxPage, MailboxReadQuery, MailboxRecordDeliveryInput, MailboxCollectExpiredInput, MailboxExpirePendingInput, MailboxReopenStreamInput, MailboxStore, MailboxUsage } from '../mailbox';
|
|
3
3
|
import type { QuotaStore } from '../quota';
|
|
4
4
|
import type { Clock } from '../stores';
|
|
5
5
|
import { type TenantId } from '../tenant';
|
|
@@ -14,4 +14,11 @@ export declare class InMemoryMailboxStore implements MailboxStore {
|
|
|
14
14
|
recordDelivery(tenant: TenantId, input: MailboxRecordDeliveryInput): Promise<MailboxCursorState>;
|
|
15
15
|
readCursor(tenant: TenantId, deviceId: string): Promise<MailboxCursorState>;
|
|
16
16
|
collectExpired(tenant: TenantId, input: MailboxCollectExpiredInput): Promise<CollectExpiredResult>;
|
|
17
|
+
expirePending(tenant: TenantId, input: MailboxExpirePendingInput): Promise<{
|
|
18
|
+
readonly expired: number;
|
|
19
|
+
}>;
|
|
20
|
+
closeStream(tenant: TenantId, input: MailboxCloseStreamInput): Promise<{
|
|
21
|
+
readonly expired: number;
|
|
22
|
+
}>;
|
|
23
|
+
reopenStream(tenant: TenantId, input: MailboxReopenStreamInput): Promise<void>;
|
|
17
24
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,14 +19,14 @@ export type { ControlPlanePrincipal, DevicePrincipal, Principal, PrincipalKind,
|
|
|
19
19
|
export { ByokCoreError, CoreConflictError, CORE_ERROR_CODES, isCoreError, isCoreConflictError } from './errors';
|
|
20
20
|
export type { CoreErrorCode } from './errors';
|
|
21
21
|
export { CANONICAL_TIMESTAMP_PATTERN, assertCanonicalTimestamp, isCanonicalTimestamp, } from './time';
|
|
22
|
-
export { MAILBOX_MESSAGE_STATES } from './mailbox';
|
|
23
|
-
export type { MailboxAdmission, MailboxAdvanceCursorInput, MailboxAppendInput, MailboxBody, MailboxCursorState, MailboxMessage, MailboxMessageState, MailboxPage, MailboxReadQuery, MailboxRecordDeliveryInput, MailboxCollectExpiredInput, MailboxStore, MailboxUsage, } from './mailbox';
|
|
22
|
+
export { MAILBOX_MESSAGE_STATES, MAILBOX_STREAM_CLOSE_CAUSES, MailboxStreamClosedError } from './mailbox';
|
|
23
|
+
export type { MailboxAdmission, MailboxAdvanceCursorInput, MailboxAppendInput, MailboxBody, MailboxCursorState, MailboxMessage, MailboxMessageState, MailboxPage, MailboxReadQuery, MailboxRecordDeliveryInput, MailboxCloseStreamInput, MailboxCollectExpiredInput, MailboxExpirePendingInput, MailboxReopenStreamInput, MailboxStreamCloseCause, MailboxStore, MailboxUsage, } from './mailbox';
|
|
24
24
|
export { BOARD_STATUSES, BOARD_TRANSITIONS, isLegalBoardTransition } from './board';
|
|
25
25
|
export type { BoardAssignee, BoardClaimInput, BoardItem, BoardItemInput, BoardListQuery, BoardPage, BoardStatus, BoardStatusUpdateInput, BoardStore, BoardUnclaimInput, } from './board';
|
|
26
26
|
export { TRUTH_RECORD_KINDS } from './truth';
|
|
27
27
|
export type { SnapshotWriteInput, TerminalWriteInput, TruthBodyRef, TruthManifestEntry, TruthManifestQuery, TruthRecord, TruthRecordKind, TruthRecordSelector, TruthStore, } from './truth';
|
|
28
|
-
export { PRESENCE_LEVELS } from './presence';
|
|
29
|
-
export type { PresenceHint, PresenceHintInput, PresenceLevel, PresenceRuntimeFact, PresenceStore, TenantReadinessDevice, TenantReadinessPresence, TenantReadiness, } from './presence';
|
|
28
|
+
export { freezePresenceRuntimeFact, PRESENCE_LEVELS } from './presence';
|
|
29
|
+
export type { PresenceHint, PresenceHintInput, PresenceLevel, PresenceRuntimeCapabilities, PresenceRuntimeFact, PresenceStore, TenantReadinessDevice, TenantReadinessPresence, TenantReadiness, } from './presence';
|
|
30
30
|
export { CONTENT_HASH_PATTERN, OBJECT_KEY_PREFIX_PATTERN, OBJECT_STATES, OBJECT_STATE_TRANSITIONS, contentHash, isContentHash, isLegalObjectTransition, objectKeyPrefix, tenantObjectKey, } from './blob';
|
|
31
31
|
export type { ContentHash, ObjectCommitInput, ObjectKeyPrefix, ObjectListQuery, ObjectManifestEntry, ObjectManifestInput, ObjectReference, ObjectReferenceInput, ObjectState, ObjectStore, } from './blob';
|
|
32
32
|
export { STORAGE_ERROR_CODES, STORAGE_ERROR_HTTP_STATUS, STORAGE_RESERVATION_STATES, STORAGE_WRITE_KINDS, STORAGE_WRITE_POSTURES, } from './quota';
|
|
@@ -54,6 +54,7 @@ export { assertCollectExpiredInput, CollectExpiredFailure } from './retention';
|
|
|
54
54
|
export type { CollectExpiredInput, CollectExpiredCounts, CollectExpiredResult } from './retention';
|
|
55
55
|
export type { QuotaCollectExpiredInput } from './quota';
|
|
56
56
|
export type { ObjectCollectExpiredInput } from './blob';
|
|
57
|
+
export type { LocalStoreId, StoreCompatibility, StoreCompatibilityVerdict } from './store-compatibility';
|
|
57
58
|
export { InMemoryStorageLedger } from './in-memory/storage-ledger';
|
|
58
59
|
export type { InMemoryObjectBytes } from './in-memory/blob';
|
|
59
60
|
export * from './routine-schedule';
|