@oddington/sdk 0.1.16 → 0.1.18
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 +31 -7
- package/dist/browser.js +299 -131
- package/dist/index.js +1 -1
- package/dist/types/packages/sdk/src/auth-types.d.ts +2 -0
- package/dist/types/packages/sdk/src/public.d.ts +2 -2
- package/dist/types/shared/inbox-member-contract.d.ts +8 -3
- package/dist/types/shared/inbox-member-types.d.ts +25 -5
- package/package.json +1 -1
|
@@ -35,6 +35,8 @@ export interface BrowserAuthHandle {
|
|
|
35
35
|
subscribe(listener: (state: BrowserAuthState) => void): () => void;
|
|
36
36
|
sendCode(email: string): Promise<void>;
|
|
37
37
|
verifyCode(email: string, code: string): Promise<void>;
|
|
38
|
+
/** End the browser session and invalidate installed capabilities, including local app access. */
|
|
38
39
|
signOut(): Promise<void>;
|
|
40
|
+
/** Release this handle and its installed context; preserve the local app credential for a fresh document. */
|
|
39
41
|
dispose(): void;
|
|
40
42
|
}
|
|
@@ -23,7 +23,7 @@ export declare const data: {
|
|
|
23
23
|
};
|
|
24
24
|
export { FileOperationError } from '../../../shared/files-contract.js';
|
|
25
25
|
export { InboxOperationError } from '../../../shared/inbox-member-contract.js';
|
|
26
|
-
export type { InboxMember, InboxCurrent,
|
|
26
|
+
export type { InboxMember, InboxCurrent, InboxItem, AnswerableQuestion, QuestionSnapshot, ResponseConsequence, LinkedAskSnapshot, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxSearchInput } from '../../../shared/inbox-member-types.js';
|
|
27
27
|
export type { RecordSelectionResult } from '../../../shared/record-selection.js';
|
|
28
28
|
export declare const inbox: import('../../../shared/inbox-member-types.js').InboxMember;
|
|
29
29
|
export type { File, FileInput, FileStorage, FileCreateInput, FileCreateOptions, FileEnrichment, FileEnrichOptions, FileEnrichResult, FileErrorCode } from '../../../shared/files-contract.js';
|
|
@@ -67,7 +67,7 @@ export type HostedSessionSource = {
|
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
-
/** OS-owned hosted or exact-origin local browser bootstrap. Reinitialization replaces the context. */
|
|
70
|
+
/** OS-owned hosted or exact-origin local browser bootstrap. Reinitialization replaces the context; a new document uses a fresh auth handle. */
|
|
71
71
|
export declare const os: {
|
|
72
72
|
init(options: {
|
|
73
73
|
auth: HostedSessionSource | import('./auth-types.js').BrowserAuthHandle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InboxCurrent,
|
|
1
|
+
import type { InboxCurrent, InboxItem, AnswerableQuestion, ResponseAcceptance } 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';
|
|
@@ -6,14 +6,19 @@ export declare class InboxOperationError extends Error {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const INBOX_RESULT_BYTES: number;
|
|
8
8
|
export declare const INBOX_INPUT_BYTES = 8192;
|
|
9
|
+
/** Includes the exact declaration only on the private CLI-authenticated ingress. */
|
|
10
|
+
export declare const INBOX_LOCAL_INPUT_BYTES: number;
|
|
9
11
|
export declare const INBOX_UUID: RegExp;
|
|
10
|
-
export type InboxOperation = 'current' | 'items.list' | 'items.read' | 'items.see' | 'items.markDigestRead' | 'items.rename' | 'items.setLifecycle' | 'items.listRecipientCandidates' | 'items.addRecipient' | 'questions.answer' | 'questions.searchRecords' | 'files.read';
|
|
12
|
+
export type InboxOperation = 'current' | 'items.list' | 'items.read' | 'items.see' | 'items.markDigestRead' | 'items.rename' | 'items.setLifecycle' | 'items.listRecipientCandidates' | 'items.addRecipient' | 'questions.list' | 'questions.answer' | 'questions.searchRecords' | 'files.read';
|
|
13
|
+
export declare function isAppQuestionOperation(operation: InboxOperation): boolean;
|
|
11
14
|
/** Closed wire vocabulary, shared by the SDK and its owning Worker. */
|
|
12
15
|
export declare function parseInboxRequest(value: unknown): {
|
|
13
16
|
operation: InboxOperation;
|
|
14
17
|
input: Record<string, unknown>;
|
|
15
18
|
};
|
|
16
19
|
export declare function parseInboxCurrent(value: unknown): InboxCurrent;
|
|
17
|
-
export declare function parseInboxItem(value: unknown):
|
|
20
|
+
export declare function parseInboxItem(value: unknown): InboxItem;
|
|
21
|
+
/** Exact app-facing vocabulary: an upstream snapshot cannot widen it. */
|
|
22
|
+
export declare function parseAnswerableQuestion(value: unknown): AnswerableQuestion;
|
|
18
23
|
export declare function parseInboxAcceptance(value: unknown): ResponseAcceptance;
|
|
19
24
|
export declare function parseInboxResult(operation: InboxOperation, value: unknown): unknown;
|
|
@@ -63,7 +63,7 @@ export type LinkedAskSnapshot = {
|
|
|
63
63
|
state: 'unavailable';
|
|
64
64
|
done: boolean;
|
|
65
65
|
};
|
|
66
|
-
export interface
|
|
66
|
+
export interface InboxItem {
|
|
67
67
|
id: string;
|
|
68
68
|
workspaceId: string;
|
|
69
69
|
number: number;
|
|
@@ -115,8 +115,27 @@ export interface ResponseAcceptance {
|
|
|
115
115
|
label?: string;
|
|
116
116
|
acceptanceOrder?: number;
|
|
117
117
|
}
|
|
118
|
+
export interface AnswerableQuestion {
|
|
119
|
+
item: {
|
|
120
|
+
id: string;
|
|
121
|
+
number: number;
|
|
122
|
+
revision: number;
|
|
123
|
+
title: string;
|
|
124
|
+
href: string;
|
|
125
|
+
};
|
|
126
|
+
origin: {
|
|
127
|
+
routine: string;
|
|
128
|
+
};
|
|
129
|
+
question: {
|
|
130
|
+
id: string;
|
|
131
|
+
prompt: string;
|
|
132
|
+
instructions: string | null;
|
|
133
|
+
response: ResponseDefinition;
|
|
134
|
+
};
|
|
135
|
+
recordRefs: string[];
|
|
136
|
+
}
|
|
118
137
|
export interface AskUpdate {
|
|
119
|
-
item:
|
|
138
|
+
item: InboxItem;
|
|
120
139
|
activityId: number | null;
|
|
121
140
|
changedAt: string | null;
|
|
122
141
|
}
|
|
@@ -126,7 +145,7 @@ export interface RecipientCandidate {
|
|
|
126
145
|
email: string;
|
|
127
146
|
}
|
|
128
147
|
export interface RecipientAddition {
|
|
129
|
-
item:
|
|
148
|
+
item: InboxItem;
|
|
130
149
|
addedPersonId: string;
|
|
131
150
|
}
|
|
132
151
|
export type ItemRevision = {
|
|
@@ -145,8 +164,8 @@ export type InboxSearchInput = ItemRevision & {
|
|
|
145
164
|
export interface InboxMember {
|
|
146
165
|
current(): Promise<InboxCurrent>;
|
|
147
166
|
items: {
|
|
148
|
-
list(): Promise<
|
|
149
|
-
read(itemId: string): Promise<
|
|
167
|
+
list(): Promise<InboxItem[]>;
|
|
168
|
+
read(itemId: string): Promise<InboxItem>;
|
|
150
169
|
see(itemId: string): Promise<void>;
|
|
151
170
|
markDigestRead(itemId: string): Promise<DigestReadConfirmation>;
|
|
152
171
|
rename(input: ItemRevision & {
|
|
@@ -162,6 +181,7 @@ export interface InboxMember {
|
|
|
162
181
|
}): Promise<RecipientAddition>;
|
|
163
182
|
};
|
|
164
183
|
questions: {
|
|
184
|
+
list(): Promise<AnswerableQuestion[]>;
|
|
165
185
|
answer(input: InboxAnswerInput): Promise<ResponseAcceptance>;
|
|
166
186
|
searchRecords(input: InboxSearchInput): Promise<RecordSelectionResult>;
|
|
167
187
|
};
|