@oddington/sdk 0.1.76 → 0.1.77
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/README.md +9 -0
- package/dist/browser.js +378 -86
- package/dist/index.js +2 -2
- package/dist/types/packages/sdk/src/public.d.ts +1 -1
- package/dist/types/shared/inbox-live.d.ts +11 -0
- package/dist/types/shared/inbox-member-contract.d.ts +3 -2
- package/dist/types/shared/inbox-member-types.d.ts +14 -0
- package/dist/types/shared/inbox-records.d.ts +4 -2
- package/package.json +1 -1
|
@@ -64,7 +64,7 @@ export { FileOperationError } from '../../../shared/files-contract.js';
|
|
|
64
64
|
export { source } from './source.js';
|
|
65
65
|
export type { SourceLocation, OsSourceLocation, GmailSourceLocation, DropboxSourceLocation, OutlookSourceLocation, SharePointSourceLocation } from './source.js';
|
|
66
66
|
export { InboxOperationError } from '../../../shared/inbox-member-contract.js';
|
|
67
|
-
export type { InboxMember, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ActionStatus, QuestionSnapshot, QuestionAvailability, QuestionUnavailableReason, ResponseConsequence, LinkedAskSnapshot, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxRecordOptionsInput } from '../../../shared/inbox-member-types.js';
|
|
67
|
+
export type { InboxMember, InboxBootstrap, InboxItemHydration, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ActionStatus, QuestionSnapshot, QuestionAvailability, QuestionUnavailableReason, ResponseConsequence, LinkedAskSnapshot, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxRecordOptionsInput } from '../../../shared/inbox-member-types.js';
|
|
68
68
|
export type { RecordOptionCatalogue } from '../../../shared/record-selection.js';
|
|
69
69
|
export declare const inbox: import('../../../shared/inbox-member-types.js').InboxMember;
|
|
70
70
|
export type { File, FileInput, FileStorage, FileCreateInput, FileCreateOptions, FileUpdate, FileEnrichment, FileEnrichOptions, FileEnrichResult, FileErrorCode, FileErrorDetail } from '../../../shared/files-contract.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Private transport setup; never a package-root application API. */
|
|
2
|
+
export interface InboxLiveSetup {
|
|
3
|
+
url: string;
|
|
4
|
+
key: string;
|
|
5
|
+
token: string;
|
|
6
|
+
topic: string;
|
|
7
|
+
expiresAt: number;
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
viewerId: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseInboxLiveSetup(value: unknown): InboxLiveSetup;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ResponseAcceptance, QuestionAvailability, QuestionUnavailableReason } from './inbox-member-types.js';
|
|
1
|
+
import type { InboxBootstrap, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ResponseAcceptance, QuestionAvailability, QuestionUnavailableReason } from './inbox-member-types.js';
|
|
2
2
|
export declare class InboxOperationError extends Error {
|
|
3
3
|
readonly status: number;
|
|
4
4
|
readonly reason: 'invalid_input' | 'access_denied' | 'authority_unavailable' | 'conflict' | 'unavailable' | 'client_update_required' | 'action_processing' | 'action_failed' | QuestionUnavailableReason;
|
|
@@ -22,7 +22,7 @@ export declare const INBOX_LOCAL_INPUT_BYTES: number;
|
|
|
22
22
|
export declare const INBOX_QUESTION_CONTRACT: 'question-work-v2';
|
|
23
23
|
export type InboxQuestionContract = 'question-work-v1' | typeof INBOX_QUESTION_CONTRACT;
|
|
24
24
|
export declare const INBOX_UUID: RegExp;
|
|
25
|
-
export type InboxOperation = 'current' | 'items.list' | 'items.read' | 'items.readRecords' | 'items.see' | 'items.markDigestRead' | 'items.rename' | 'items.setLifecycle' | 'items.listRecipientCandidates' | 'items.addRecipient' | 'questions.list' | 'questions.answer' | 'questions.listRecordOptions';
|
|
25
|
+
export type InboxOperation = 'current' | 'bootstrap' | 'live.connect' | 'items.list' | 'items.read' | 'items.readRecords' | 'items.see' | 'items.markDigestRead' | 'items.rename' | 'items.setLifecycle' | 'items.listRecipientCandidates' | 'items.addRecipient' | 'questions.list' | 'questions.answer' | 'questions.listRecordOptions';
|
|
26
26
|
export declare function isAppQuestionOperation(operation: InboxOperation): boolean;
|
|
27
27
|
/** Closed wire vocabulary; both placements require an explicit relevance filter. */
|
|
28
28
|
export declare function parseInboxRequest(value: unknown): {
|
|
@@ -38,3 +38,4 @@ export declare function parseQuestionWork(value: unknown, contract?: InboxQuesti
|
|
|
38
38
|
export declare function parseQuestionStatus(value: unknown): QuestionStatus;
|
|
39
39
|
export declare function parseInboxAcceptance(value: unknown): ResponseAcceptance;
|
|
40
40
|
export declare function parseInboxResult(operation: InboxOperation, value: unknown, contract?: InboxQuestionContract): unknown;
|
|
41
|
+
export declare function parseInboxBootstrap(value: unknown): InboxBootstrap;
|
|
@@ -209,12 +209,26 @@ export type InboxRecordOptionsInput = ItemRevision & {
|
|
|
209
209
|
questionId: string;
|
|
210
210
|
option?: number;
|
|
211
211
|
};
|
|
212
|
+
export type InboxItemHydration = ItemRevision & ({
|
|
213
|
+
status: 'ready';
|
|
214
|
+
result: import('./inbox-records.js').InboxRecords;
|
|
215
|
+
} | {
|
|
216
|
+
status: 'unavailable';
|
|
217
|
+
});
|
|
218
|
+
export interface InboxBootstrap {
|
|
219
|
+
current: InboxCurrent;
|
|
220
|
+
items: InboxItem[];
|
|
221
|
+
hydrations: InboxItemHydration[];
|
|
222
|
+
}
|
|
212
223
|
/** Hosted listing relevance only; local listing uses its bound declaration. */
|
|
213
224
|
export type InboxQuestionListInput = {
|
|
214
225
|
routines: readonly string[];
|
|
215
226
|
};
|
|
216
227
|
export interface InboxMember {
|
|
217
228
|
current(): Promise<InboxCurrent>;
|
|
229
|
+
bootstrap(): Promise<InboxBootstrap>;
|
|
230
|
+
/** Opaque wake-ups only. Cleanup is idempotent; connected includes reconnects. */
|
|
231
|
+
subscribe(onDirty: () => void, onState?: (state: 'connected' | 'unavailable' | 'denied') => void): () => void;
|
|
218
232
|
items: {
|
|
219
233
|
list(): Promise<InboxItem[]>;
|
|
220
234
|
read(itemId: string): Promise<InboxItem>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type QualifiedRecordRef } from './inbox-contract.js';
|
|
1
|
+
import { type QualifiedRecordRef, type InboxBlock } from './inbox-contract.js';
|
|
2
2
|
import type { CollectionSchema, SelectedRecord } from './data-contract.js';
|
|
3
3
|
export type InboxRecord = QualifiedRecordRef & {
|
|
4
4
|
record: SelectedRecord | null;
|
|
@@ -23,6 +23,8 @@ export type InboxRecordsOutcome<Result = InboxRecords> = {
|
|
|
23
23
|
};
|
|
24
24
|
export declare function parseInboxRecordRefs(value: unknown): QualifiedRecordRef[];
|
|
25
25
|
export declare const recordKey: ({ repository, ref }: QualifiedRecordRef) => string;
|
|
26
|
+
/** Only authored Record blocks disclose bootstrap hydration destinations. */
|
|
27
|
+
export declare function authoredInboxRecordRefs(body: InboxBlock[]): QualifiedRecordRef[];
|
|
26
28
|
/** Inbox's existing title policy, shared by full Records and immediate summaries. */
|
|
27
29
|
export declare function inboxRecordTitle(entry: InboxRecord): string;
|
|
28
|
-
export declare function parseInboxRecords(value: unknown): InboxRecords;
|
|
30
|
+
export declare function parseInboxRecords(value: unknown, maximumRecords?: number): InboxRecords;
|