@oddington/sdk 0.1.83 → 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 +516 -218
- package/dist/index.js +3 -3
- package/dist/types/packages/sdk/src/data-schema-types.d.ts +4 -1
- package/dist/types/packages/sdk/src/public.d.ts +2 -2
- package/dist/types/shared/data-contract.d.ts +15 -0
- 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
|
@@ -98,6 +98,9 @@ type RefField = {
|
|
|
98
98
|
many: false;
|
|
99
99
|
nullable: false;
|
|
100
100
|
};
|
|
101
|
+
type LinkRefCondition = string | {
|
|
102
|
+
$in: string[];
|
|
103
|
+
};
|
|
101
104
|
type Options<Schema extends Collection, Mode> = {
|
|
102
105
|
fields?: Array<Fields<Schema>['name'] | '$ref' | '$version'>;
|
|
103
106
|
timeline?: true;
|
|
@@ -120,7 +123,7 @@ type ExactUnion<Actual, Allowed> = Allowed extends unknown ? Exact<Actual, Allow
|
|
|
120
123
|
type CheckWhere<Schema extends Collection, Actual> = {
|
|
121
124
|
[Key in keyof Actual]: Key extends '$signals' ? {
|
|
122
125
|
[Signal in keyof Actual[Key]]: ExactUnion<Actual[Key][Signal], SignalCondition>;
|
|
123
|
-
} : Key extends (FilterField<Schema> | RefField)['name'] ? Actual[Key] extends object ? ExactUnion<Actual[Key], Condition<Extract<FilterField<Schema> | RefField, {
|
|
126
|
+
} : Key extends `${string}.$ref` ? Actual[Key] extends object ? ExactUnion<Actual[Key], LinkRefCondition> : unknown : Key extends (FilterField<Schema> | RefField)['name'] ? Actual[Key] extends object ? ExactUnion<Actual[Key], Condition<Extract<FilterField<Schema> | RefField, {
|
|
124
127
|
name: Key;
|
|
125
128
|
}>>> : unknown : never;
|
|
126
129
|
};
|
|
@@ -24,7 +24,7 @@ export type { XeroRuntimeConnection, GmailRuntimeConnection, AirtableRuntimeConn
|
|
|
24
24
|
export type { Connections } from '../../../shared/airtable-contract.js';
|
|
25
25
|
export declare const connections: import('../../../shared/airtable-contract.js').Connections;
|
|
26
26
|
export { DataOperationError } from '../../../shared/data-contract.js';
|
|
27
|
-
export type { RecordSignal, TimelineEntry, SignalRelated, SignalRelatedInput, SignalInput, TimelineInput, SignalCondition, DataRepository, DataErrorCode, DataValidationDetail, DataFieldExpectation, PublicValueDefinition, PublicField, CollectionSummary, RecordDisplay, CollectionSchema, QueryScalar, SelectionOptions, RecordSelection, RecordsQuery, DataValue, SelectedRecord, SelectionMetadata, SnapshotChange, RecordsResult, RecordsReadInput, RecordsReadResult, RecordsSearchOptions, RecordsSearchResult, RecordIdentity, RecordCreation, RecordUpdateSet, AppliedChanges, PublishedChanges, DataChangeOptions, DataChangeSet, DataEffect, DataFailureDetail, DataPublicationDetail, DataFailureCauseCode, LocalDataFileAction } from '../../../shared/data-contract.js';
|
|
27
|
+
export type { RecordSignal, TimelineEntry, SignalRelated, SignalRelatedInput, SignalInput, TimelineInput, SignalCondition, DataRepository, DataErrorCode, DataValidationDetail, DataFieldExpectation, PublicValueDefinition, PublicField, CollectionSummary, RecordDisplay, CollectionSchema, QueryScalar, SelectionOptions, RecordSelection, RecordsQuery, DataValue, SelectedRecord, SelectionMetadata, SnapshotChange, RecordsResult, RecordsReadInput, RecordsReadResult, RecordsBacklinksOptions, BacklinkRecord, RecordsBacklinksResult, RecordsSearchOptions, RecordsSearchResult, RecordIdentity, RecordCreation, RecordUpdateSet, AppliedChanges, PublishedChanges, DataChangeOptions, DataChangeSet, DataEffect, DataFailureDetail, DataPublicationDetail, DataFailureCauseCode, LocalDataFileAction } from '../../../shared/data-contract.js';
|
|
28
28
|
declare global {
|
|
29
29
|
namespace __OddingtonOS {
|
|
30
30
|
/** Import-free OS-generated metadata; no runtime namespace is created. */
|
|
@@ -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';
|
|
@@ -151,6 +151,20 @@ export type RecordsReadResult = {
|
|
|
151
151
|
};
|
|
152
152
|
records: Array<SelectedRecord | null>;
|
|
153
153
|
};
|
|
154
|
+
export type RecordsBacklinksOptions = {
|
|
155
|
+
limit?: number;
|
|
156
|
+
after?: string;
|
|
157
|
+
};
|
|
158
|
+
export type BacklinkRecord = SelectedRecord & {
|
|
159
|
+
$backlinks: string[];
|
|
160
|
+
};
|
|
161
|
+
export type RecordsBacklinksResult = {
|
|
162
|
+
$meta: {
|
|
163
|
+
version: string;
|
|
164
|
+
next?: string;
|
|
165
|
+
};
|
|
166
|
+
records: BacklinkRecord[];
|
|
167
|
+
};
|
|
154
168
|
export type RecordsSearchOptions = {
|
|
155
169
|
collections?: string[];
|
|
156
170
|
limit?: number;
|
|
@@ -215,6 +229,7 @@ export interface DataRepository {
|
|
|
215
229
|
read(ref: string, options?: RecordsReadOptions): Promise<SelectedRecord | null>;
|
|
216
230
|
read(refs: readonly string[], options?: RecordsReadOptions): Promise<RecordsReadResult>;
|
|
217
231
|
read(input: RecordsReadInput, options?: RecordsReadOptions): Promise<SelectedRecord | null | RecordsReadResult>;
|
|
232
|
+
backlinks(ref: string, options?: RecordsBacklinksOptions): Promise<RecordsBacklinksResult>;
|
|
218
233
|
search(query: string, options?: RecordsSearchOptions): Promise<RecordsSearchResult>;
|
|
219
234
|
};
|
|
220
235
|
changes(options?: DataChangeOptions): DataChangeSet;
|
|
@@ -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>;
|