@oddington/sdk 0.1.84 → 0.1.85
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/browser.js +82 -12
- package/dist/index.js +3 -3
- package/dist/types/packages/sdk/src/public.d.ts +1 -1
- package/dist/types/shared/inbox-contract.d.ts +7 -1
- package/dist/types/shared/inbox-member-contract.d.ts +10 -4
- package/dist/types/shared/inbox-member-types.d.ts +21 -0
- package/package.json +1 -1
|
@@ -73,7 +73,7 @@ export { FileOperationError } from '../../../shared/files-contract.js';
|
|
|
73
73
|
export { source } from './source.js';
|
|
74
74
|
export type { SourceLocation, OsSourceLocation, GmailSourceLocation, DropboxSourceLocation, OutlookSourceLocation, SharePointSourceLocation } from './source.js';
|
|
75
75
|
export { InboxOperationError } from '../../../shared/inbox-member-contract.js';
|
|
76
|
-
export type { InboxMember, InboxBootstrap, InboxItemHydration, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ActionStatus, QuestionSnapshot, QuestionAvailability, QuestionUnavailableReason, ResponseConsequence, LinkedAskSnapshot, QueueContinuation, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxRecordOptionsInput } from '../../../shared/inbox-member-types.js';
|
|
76
|
+
export type { InboxMember, InboxBootstrap, InboxItemHydration, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ActionStatus, QuestionSnapshot, QuestionAvailability, QuestionUnavailableReason, ResponseConsequence, LinkedAskSnapshot, QueueContinuation, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxRecordOptionsInput, AssignmentCandidate, QuestionAssignment, QuestionAssignmentInput } from '../../../shared/inbox-member-types.js';
|
|
77
77
|
export type { RecordOptionCatalogue } from '../../../shared/record-selection.js';
|
|
78
78
|
export declare const inbox: import('../../../shared/inbox-member-types.js').InboxMember;
|
|
79
79
|
export type { File, FileInput, FileStorage, FileCreateInput, FileCreateOptions, FileUpdate, FileEnrichment, FileEnrichOptions, FileEnrichResult, FileErrorCode, FileErrorDetail } from '../../../shared/files-contract.js';
|
|
@@ -76,6 +76,10 @@ export type SelectionOptionInput = {
|
|
|
76
76
|
type: 'record-picker';
|
|
77
77
|
label: string;
|
|
78
78
|
source: RecordPickerSource;
|
|
79
|
+
} | {
|
|
80
|
+
type: 'assign';
|
|
81
|
+
label: string;
|
|
82
|
+
assignee?: string;
|
|
79
83
|
};
|
|
80
84
|
/** Publication supplies scoped IDs and preserves authored presentation. */
|
|
81
85
|
export type SelectionOption = SelectionOptionInput & {
|
|
@@ -371,7 +375,7 @@ type ExactSelectionOption<Value> = Value extends {
|
|
|
371
375
|
value: infer Record;
|
|
372
376
|
} ? {
|
|
373
377
|
value: ExactRecordReference<Record>;
|
|
374
|
-
} : never : Value extends {
|
|
378
|
+
} : never : Type extends 'assign' ? {} : Value extends {
|
|
375
379
|
source: infer Source;
|
|
376
380
|
} ? {
|
|
377
381
|
source: ExactAuthorShape<Source, RecordPickerSource> & (Source extends {
|
|
@@ -458,6 +462,8 @@ export type AnsweredAskAnswer<Value, Numbered extends boolean> = {
|
|
|
458
462
|
type SelectionValue<Response> = Response extends {
|
|
459
463
|
options: readonly (infer Option)[];
|
|
460
464
|
} ? Option extends {
|
|
465
|
+
type: 'assign';
|
|
466
|
+
} ? never : Option extends {
|
|
461
467
|
type: 'record-picker';
|
|
462
468
|
} ? RecordReference : Option extends {
|
|
463
469
|
value: infer Value;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { InboxBootstrap, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ResponseAcceptance, QuestionAvailability, QuestionUnavailableReason } from './inbox-member-types.js';
|
|
1
|
+
import type { InboxBootstrap, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ResponseAcceptance, QuestionAvailability, QuestionUnavailableReason, QuestionAssignment, QuestionAssignmentInput, AssignmentCandidate } from './inbox-member-types.js';
|
|
2
2
|
export declare class InboxOperationError extends Error {
|
|
3
3
|
readonly status: number;
|
|
4
|
-
readonly reason: 'invalid_input' | 'access_denied' | 'authority_unavailable' | 'conflict' | 'unavailable' | 'client_update_required' | 'action_processing' | 'action_failed' | QuestionUnavailableReason;
|
|
5
|
-
constructor(status: number, reason: 'invalid_input' | 'access_denied' | 'authority_unavailable' | 'conflict' | 'unavailable' | 'client_update_required' | 'action_processing' | 'action_failed' | QuestionUnavailableReason);
|
|
4
|
+
readonly reason: 'invalid_input' | 'access_denied' | 'authority_unavailable' | 'conflict' | 'unavailable' | 'client_update_required' | 'action_processing' | 'action_failed' | 'question_unavailable' | 'assignment_denied' | 'assignee_unavailable' | QuestionUnavailableReason;
|
|
5
|
+
constructor(status: number, reason: 'invalid_input' | 'access_denied' | 'authority_unavailable' | 'conflict' | 'unavailable' | 'client_update_required' | 'action_processing' | 'action_failed' | 'question_unavailable' | 'assignment_denied' | 'assignee_unavailable' | QuestionUnavailableReason);
|
|
6
6
|
}
|
|
7
7
|
/** Private SQL detail maps to plain public errors, never a new Question state. */
|
|
8
8
|
export declare function parseInboxActionHold(value: unknown): InboxOperationError | undefined;
|
|
@@ -22,7 +22,10 @@ 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
|
|
25
|
+
export declare function isAssignmentTarget(value: unknown): value is string;
|
|
26
|
+
/** Only known diagnostics from the assignment SQL owners have public meaning. */
|
|
27
|
+
export declare function parseInboxAssignmentDiagnostic(value: unknown): InboxOperationError | undefined;
|
|
28
|
+
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' | 'questions.listAssignmentCandidates' | 'questions.assign';
|
|
26
29
|
export declare function isAppQuestionOperation(operation: InboxOperation): boolean;
|
|
27
30
|
/** Closed wire vocabulary; both placements require an explicit relevance filter. */
|
|
28
31
|
export declare function parseInboxRequest(value: unknown): {
|
|
@@ -38,4 +41,7 @@ export declare function parseQuestionWork(value: unknown, contract?: InboxQuesti
|
|
|
38
41
|
export declare function parseQuestionStatus(value: unknown): QuestionStatus;
|
|
39
42
|
export declare function parseInboxAcceptance(value: unknown): ResponseAcceptance;
|
|
40
43
|
export declare function parseInboxResult(operation: InboxOperation, value: unknown, contract?: InboxQuestionContract): unknown;
|
|
44
|
+
/** Correlation is separate from decoding so clients bind success to their request. */
|
|
45
|
+
export declare function assertInboxAssignmentMatches(result: QuestionAssignment, input: QuestionAssignmentInput): void;
|
|
46
|
+
export declare function assignmentTargetId(assignee: string, candidates: AssignmentCandidate[]): string;
|
|
41
47
|
export declare function parseInboxBootstrap(value: unknown): InboxBootstrap;
|
|
@@ -205,6 +205,23 @@ export type ItemRevision = {
|
|
|
205
205
|
itemId: string;
|
|
206
206
|
revision: number;
|
|
207
207
|
};
|
|
208
|
+
export type QuestionAssignmentInput = ItemRevision & {
|
|
209
|
+
questionId: string;
|
|
210
|
+
assignee: string;
|
|
211
|
+
};
|
|
212
|
+
export interface AssignmentCandidate {
|
|
213
|
+
id: string;
|
|
214
|
+
name: string;
|
|
215
|
+
email: string;
|
|
216
|
+
}
|
|
217
|
+
export interface QuestionAssignment {
|
|
218
|
+
item: InboxItem;
|
|
219
|
+
questionId: string;
|
|
220
|
+
previousAssigneeId: string;
|
|
221
|
+
assigneeId: string;
|
|
222
|
+
activityId: number | null;
|
|
223
|
+
assignedAt: string | null;
|
|
224
|
+
}
|
|
208
225
|
export type InboxAnswerInput = ItemRevision & {
|
|
209
226
|
questionId: string;
|
|
210
227
|
response: QuestionResponse;
|
|
@@ -259,6 +276,10 @@ export interface InboxMember {
|
|
|
259
276
|
}): Promise<RecipientAddition>;
|
|
260
277
|
};
|
|
261
278
|
questions: {
|
|
279
|
+
listAssignmentCandidates(input: ItemRevision & {
|
|
280
|
+
questionId: string;
|
|
281
|
+
}): Promise<AssignmentCandidate[]>;
|
|
282
|
+
assign(input: QuestionAssignmentInput): Promise<QuestionAssignment>;
|
|
262
283
|
list(input: InboxQuestionListInput): Promise<QuestionWork[]>;
|
|
263
284
|
answer(input: InboxAnswerInput): Promise<ResponseAcceptance>;
|
|
264
285
|
listRecordOptions(input: InboxRecordOptionsInput): Promise<RecordOptionCatalogue>;
|