@oddington/sdk 0.1.74 → 0.1.76
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 +59 -6
- package/dist/browser.js +435 -271
- package/dist/index.js +4 -4
- package/dist/types/packages/sdk/src/public.d.ts +4 -4
- package/dist/types/shared/data-contract.d.ts +10 -1
- package/dist/types/shared/data-validation-message.d.ts +3 -2
- package/dist/types/shared/inbox-contract.d.ts +63 -5
- package/dist/types/shared/inbox-member-contract.d.ts +6 -5
- package/dist/types/shared/inbox-member-types.d.ts +5 -6
- package/dist/types/shared/inbox-records.d.ts +13 -4
- package/dist/types/shared/record-display.d.ts +11 -0
- package/dist/types/shared/record-selection.d.ts +11 -16
- package/package.json +1 -1
|
@@ -8,14 +8,14 @@ export { AIError, RoutineAIError } from '../../../shared/routine-ai-contract.js'
|
|
|
8
8
|
export type { RoutineAIOutputIssue } from '../../../shared/routine-ai-output-detail.js';
|
|
9
9
|
export type { RoutineAIErrorDetail } from '../../../shared/routine-ai-error-detail.js';
|
|
10
10
|
export { InboxContractError, asksBlock, continueAsk, defineHandler, fileBlock, question, recordBlock, recordsBlock, resolveAsk, respond, richTextBlock, selection, } from '../../../shared/inbox-contract.js';
|
|
11
|
-
export type { AskInput, AuthoredSource, DigestInput, Handler, HandlerReference, HandlerRuntime, HandlerTransition, InboxBlock, InboxFile, JsonObject, JsonValue, QualifiedRecordRef, PublishedAsk, PublishedDigest, PublishedView, PublicationRequest, Question, QuestionInput, QuestionResponse, RecordReference, RecordSource, RepositoryReceipt, Resolution, ResolutionInput, ResponseDefinition, } from '../../../shared/inbox-contract.js';
|
|
11
|
+
export type { AskInput, AuthoredSource, DigestInput, Handler, HandlerReference, HandlerRuntime, HandlerTransition, InboxBlock, InboxFile, JsonObject, JsonValue, QualifiedRecordRef, PublishedAsk, PublishedDigest, PublishedView, PublicationRequest, Question, QuestionInput, QuestionResponse, RecordReference, RecordSource, RepositoryReceipt, Resolution, ResolutionInput, ResponseDefinition, LegacyResponseDefinition, LegacyQuestionResponse, RecordPickerSource, SelectionOptionInput, SelectionOption, SelectionDefinitionInput, SelectionDefinition, SelectionResponse, ResponseDefinitionInput, } from '../../../shared/inbox-contract.js';
|
|
12
12
|
export { AirtableOperationError } from '../../../shared/airtable-contract.js';
|
|
13
13
|
export type { AirtableField, AirtableTable, AirtableRecord, AirtableListInput, AirtableGetInput, AirtableCreateInput, AirtableUpdateInput, AirtableDeleteInput, AirtableReceipt, AirtableWriteResult, AirtableClient } from '../../../shared/airtable-contract.js';
|
|
14
14
|
export type { GmailRuntimeConnection, AirtableRuntimeConnection, DropboxRuntimeConnection, OutlookRuntimeConnection, SharePointRuntimeConnection, RuntimeConnection, RuntimeConnectionFor } from '../../../shared/connection-runtime.js';
|
|
15
15
|
export type { Connections } from '../../../shared/airtable-contract.js';
|
|
16
16
|
export declare const connections: import('../../../shared/airtable-contract.js').Connections;
|
|
17
17
|
export { DataOperationError } from '../../../shared/data-contract.js';
|
|
18
|
-
export type { RecordSignal, TimelineEntry, SignalRelated, SignalRelatedInput, SignalInput, TimelineInput, SignalCondition, DataRepository, DataErrorCode, DataValidationDetail, DataFieldExpectation, PublicValueDefinition, PublicField, CollectionSummary, 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';
|
|
18
|
+
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';
|
|
19
19
|
declare global {
|
|
20
20
|
namespace __OddingtonOS {
|
|
21
21
|
/** Import-free OS-generated metadata; no runtime namespace is created. */
|
|
@@ -64,8 +64,8 @@ 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,
|
|
68
|
-
export type {
|
|
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';
|
|
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';
|
|
71
71
|
export declare const files: {
|
|
@@ -42,8 +42,12 @@ export type CollectionSummary = {
|
|
|
42
42
|
type: string;
|
|
43
43
|
description?: string;
|
|
44
44
|
};
|
|
45
|
+
export type RecordDisplay = {
|
|
46
|
+
title: string[];
|
|
47
|
+
};
|
|
45
48
|
export type CollectionSchema = CollectionSummary & {
|
|
46
49
|
fields: PublicField[];
|
|
50
|
+
display?: RecordDisplay;
|
|
47
51
|
};
|
|
48
52
|
export type QueryScalar = string | number | boolean | null;
|
|
49
53
|
type LowerBound = {
|
|
@@ -318,7 +322,12 @@ export type DataPublicationDetail = {
|
|
|
318
322
|
preflight?: 'dirty_repository';
|
|
319
323
|
};
|
|
320
324
|
export declare function dataPublicationFailureMessage(detail: DataPublicationDetail): string;
|
|
321
|
-
export type
|
|
325
|
+
export type DataPublicationConflictDetail = {
|
|
326
|
+
code: 'publication_conflict';
|
|
327
|
+
conflict: 'record_version_changed' | 'record_missing' | 'create_identity_conflict' | 'filing_conflict' | 'schema_changed';
|
|
328
|
+
record: string;
|
|
329
|
+
};
|
|
330
|
+
export type DataOperationDetail = DataPublicationConflictDetail | DataPublicationDetail | DataFailureDetail | DataRecordLimitDetail | DataValidationDetail;
|
|
322
331
|
/** Parse the only local checkout detail allowed to cross the private SDK and
|
|
323
332
|
* retained-Run boundary. It contains no values, raw exceptions or host paths. */
|
|
324
333
|
export declare function parseDataFailureDetail(value: unknown): DataFailureDetail;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DataFieldExpectation, DataValidationDetail } from './data-contract.js';
|
|
1
|
+
import type { DataFieldExpectation, DataValidationDetail, DataPublicationConflictDetail } from './data-contract.js';
|
|
2
2
|
type FieldProblem = 'unknown' | 'missing' | 'invalid' | 'source_schema';
|
|
3
3
|
export type FieldExpectation = DataFieldExpectation;
|
|
4
4
|
/** Detach and validate only the approved bounded facts at every trust boundary. */
|
|
@@ -8,13 +8,14 @@ export declare function recordFieldDetail(record: string, field: string, problem
|
|
|
8
8
|
* public messages. Values and arbitrary upstream prose stay private. */
|
|
9
9
|
export declare function recordFieldMessage(record: string, field: string, problem: FieldProblem, schemaPath?: string, expected?: FieldExpectation): string | undefined;
|
|
10
10
|
export declare function safeRecordFieldMessage(value: unknown): string | undefined;
|
|
11
|
+
export declare function parsePublicationConflict(value: unknown): DataPublicationConflictDetail;
|
|
11
12
|
export declare function dataValidationMessageFacts(error: {
|
|
12
13
|
code: string;
|
|
13
14
|
message: string;
|
|
14
15
|
detail?: unknown;
|
|
15
16
|
}): {
|
|
16
17
|
message?: string;
|
|
17
|
-
detail?: DataValidationDetail;
|
|
18
|
+
detail?: DataValidationDetail | DataPublicationConflictDetail;
|
|
18
19
|
};
|
|
19
20
|
export declare function explainDataValidation<T extends {
|
|
20
21
|
code: string;
|
|
@@ -3,6 +3,7 @@ export type JsonValue = null | boolean | number | string | JsonValue[] | JsonObj
|
|
|
3
3
|
export type JsonObject = {
|
|
4
4
|
[key: string]: JsonValue;
|
|
5
5
|
};
|
|
6
|
+
/** @deprecated Author new selections with per-option definitions. */
|
|
6
7
|
export type AuthoredSource = {
|
|
7
8
|
type: 'authored';
|
|
8
9
|
options: Array<{
|
|
@@ -24,6 +25,7 @@ export type RecordReference = {
|
|
|
24
25
|
repository: string;
|
|
25
26
|
ref: string;
|
|
26
27
|
};
|
|
28
|
+
/** @deprecated Record pickers inherit schema display.title. */
|
|
27
29
|
export type RecordSource = {
|
|
28
30
|
type: 'records';
|
|
29
31
|
collection: {
|
|
@@ -40,14 +42,62 @@ export type RecordSource = {
|
|
|
40
42
|
reason?: string;
|
|
41
43
|
}>;
|
|
42
44
|
};
|
|
43
|
-
export type
|
|
45
|
+
export type LegacyResponseDefinition = {
|
|
44
46
|
type: 'selection';
|
|
45
47
|
source: AuthoredSource | RecordSource;
|
|
46
48
|
};
|
|
47
|
-
export type
|
|
49
|
+
export type LegacyQuestionResponse = {
|
|
48
50
|
selection: string | RecordReference;
|
|
49
51
|
note?: string;
|
|
50
52
|
};
|
|
53
|
+
export type RecordPickerSource = {
|
|
54
|
+
collection: {
|
|
55
|
+
repository: string;
|
|
56
|
+
name: string;
|
|
57
|
+
};
|
|
58
|
+
refPrefix?: string;
|
|
59
|
+
where?: Record<string, string | number | boolean | null>;
|
|
60
|
+
};
|
|
61
|
+
export type SelectionOptionInput = {
|
|
62
|
+
type: 'choice';
|
|
63
|
+
value: string;
|
|
64
|
+
label: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
note?: {
|
|
67
|
+
placeholder: string;
|
|
68
|
+
};
|
|
69
|
+
} | {
|
|
70
|
+
type: 'record';
|
|
71
|
+
value: RecordReference;
|
|
72
|
+
label: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'record-picker';
|
|
76
|
+
label: string;
|
|
77
|
+
source: RecordPickerSource;
|
|
78
|
+
};
|
|
79
|
+
/** Publication supplies scoped IDs and preserves authored presentation. */
|
|
80
|
+
export type SelectionOption = SelectionOptionInput & {
|
|
81
|
+
id: number;
|
|
82
|
+
};
|
|
83
|
+
export type SelectionDefinitionInput = {
|
|
84
|
+
type: 'selection';
|
|
85
|
+
options: SelectionOptionInput[];
|
|
86
|
+
};
|
|
87
|
+
export type SelectionDefinition = {
|
|
88
|
+
type: 'selection';
|
|
89
|
+
options: SelectionOption[];
|
|
90
|
+
};
|
|
91
|
+
export type ResponseDefinitionInput = SelectionDefinitionInput | LegacyResponseDefinition;
|
|
92
|
+
export type ResponseDefinition = SelectionDefinition | LegacyResponseDefinition;
|
|
93
|
+
export type SelectionResponse = {
|
|
94
|
+
option: number;
|
|
95
|
+
value: string | RecordReference;
|
|
96
|
+
note?: string;
|
|
97
|
+
/** Absent on new answers; keeps existing handlers' selection checks typed. */
|
|
98
|
+
selection?: never;
|
|
99
|
+
};
|
|
100
|
+
export type QuestionResponse = SelectionResponse | LegacyQuestionResponse;
|
|
51
101
|
export type HandlerReference = {
|
|
52
102
|
id: string;
|
|
53
103
|
input: JsonValue;
|
|
@@ -58,7 +108,7 @@ export type Question = {
|
|
|
58
108
|
allowedResponders: string[];
|
|
59
109
|
prompt: string;
|
|
60
110
|
instructions?: string;
|
|
61
|
-
response:
|
|
111
|
+
response: ResponseDefinitionInput;
|
|
62
112
|
handler?: HandlerReference;
|
|
63
113
|
};
|
|
64
114
|
export type QuestionInput = Omit<Question, 'allowedResponders'> & {
|
|
@@ -266,12 +316,20 @@ export declare function asksBlock(value: Omit<Extract<InboxBlock, {
|
|
|
266
316
|
}>, 'kind'>): Extract<InboxBlock, {
|
|
267
317
|
kind: 'asks';
|
|
268
318
|
}>;
|
|
319
|
+
export declare function selection(value: {
|
|
320
|
+
options: SelectionOptionInput[];
|
|
321
|
+
}): SelectionDefinitionInput;
|
|
322
|
+
/** @deprecated Use options; retained for existing routine authoring. */
|
|
269
323
|
export declare function selection(value: {
|
|
270
324
|
source: AuthoredSource | RecordSource;
|
|
271
|
-
}):
|
|
325
|
+
}): LegacyResponseDefinition;
|
|
272
326
|
export declare function validateRecordReference(value: unknown): RecordReference;
|
|
327
|
+
export declare function validateRecordPickerSource(value: unknown): RecordPickerSource;
|
|
273
328
|
export declare function validateRecordSource(value: unknown): RecordSource;
|
|
274
|
-
|
|
329
|
+
/** Authoring validation never accepts publication-owned IDs. */
|
|
330
|
+
export declare function validateResponseDefinition(value: unknown): ResponseDefinitionInput;
|
|
331
|
+
export declare function validatePublishedSelectionDefinition(value: unknown): SelectionDefinition;
|
|
332
|
+
export declare function validatePublishedResponseDefinition(value: unknown): ResponseDefinition;
|
|
275
333
|
export declare function validateResponse(definition: unknown, value: unknown): QuestionResponse;
|
|
276
334
|
export declare function defineHandler<Input extends JsonValue, const Id extends string = string>(value: Handler<Input> & {
|
|
277
335
|
id: Id;
|
|
@@ -19,21 +19,22 @@ export declare const INBOX_RESULT_BYTES: number;
|
|
|
19
19
|
export declare const INBOX_INPUT_BYTES = 8192;
|
|
20
20
|
/** Includes the exact declaration only on the private CLI-authenticated ingress. */
|
|
21
21
|
export declare const INBOX_LOCAL_INPUT_BYTES: number;
|
|
22
|
-
export declare const INBOX_QUESTION_CONTRACT: 'question-work-
|
|
22
|
+
export declare const INBOX_QUESTION_CONTRACT: 'question-work-v2';
|
|
23
|
+
export type InboxQuestionContract = 'question-work-v1' | typeof INBOX_QUESTION_CONTRACT;
|
|
23
24
|
export declare const INBOX_UUID: RegExp;
|
|
24
|
-
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.
|
|
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
26
|
export declare function isAppQuestionOperation(operation: InboxOperation): boolean;
|
|
26
27
|
/** Closed wire vocabulary; both placements require an explicit relevance filter. */
|
|
27
28
|
export declare function parseInboxRequest(value: unknown): {
|
|
28
29
|
operation: InboxOperation;
|
|
29
30
|
input: Record<string, unknown>;
|
|
30
|
-
contract?:
|
|
31
|
+
contract?: InboxQuestionContract;
|
|
31
32
|
};
|
|
32
33
|
export declare function parseInboxCurrent(value: unknown): InboxCurrent;
|
|
33
34
|
export declare function parseInboxItem(value: unknown): InboxItem;
|
|
34
35
|
/** Exact app-facing vocabulary: an upstream snapshot cannot widen it. */
|
|
35
|
-
export declare function parseQuestionWork(value: unknown): QuestionWork;
|
|
36
|
+
export declare function parseQuestionWork(value: unknown, contract?: InboxQuestionContract): QuestionWork;
|
|
36
37
|
/** Validate the owner's closed vocabulary; never classify infrastructure in a client. */
|
|
37
38
|
export declare function parseQuestionStatus(value: unknown): QuestionStatus;
|
|
38
39
|
export declare function parseInboxAcceptance(value: unknown): ResponseAcceptance;
|
|
39
|
-
export declare function parseInboxResult(operation: InboxOperation, value: unknown): unknown;
|
|
40
|
+
export declare function parseInboxResult(operation: InboxOperation, value: unknown, contract?: InboxQuestionContract): unknown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { InboxBlock, QuestionResponse, ResponseDefinition,
|
|
1
|
+
import type { InboxBlock, QuestionResponse, ResponseDefinition, RecordReference, RepositoryReceipt } from './inbox-contract.js';
|
|
2
2
|
import type { AirtableReceipt } from './airtable-contract.js';
|
|
3
3
|
import type { ResolvedView } from './inbox-views.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { RecordOptionCatalogue } from './record-selection.js';
|
|
5
5
|
export interface InboxCurrent {
|
|
6
6
|
workspace: {
|
|
7
7
|
id: string;
|
|
@@ -205,10 +205,9 @@ export type InboxAnswerInput = ItemRevision & {
|
|
|
205
205
|
/** Picker name for display only; the Record reference is the answer. */
|
|
206
206
|
label?: string;
|
|
207
207
|
};
|
|
208
|
-
export type
|
|
208
|
+
export type InboxRecordOptionsInput = ItemRevision & {
|
|
209
209
|
questionId: string;
|
|
210
|
-
|
|
211
|
-
selected?: RecordReference;
|
|
210
|
+
option?: number;
|
|
212
211
|
};
|
|
213
212
|
/** Hosted listing relevance only; local listing uses its bound declaration. */
|
|
214
213
|
export type InboxQuestionListInput = {
|
|
@@ -240,7 +239,7 @@ export interface InboxMember {
|
|
|
240
239
|
questions: {
|
|
241
240
|
list(input: InboxQuestionListInput): Promise<QuestionWork[]>;
|
|
242
241
|
answer(input: InboxAnswerInput): Promise<ResponseAcceptance>;
|
|
243
|
-
|
|
242
|
+
listRecordOptions(input: InboxRecordOptionsInput): Promise<RecordOptionCatalogue>;
|
|
244
243
|
};
|
|
245
244
|
}
|
|
246
245
|
export {};
|
|
@@ -4,16 +4,25 @@ export type InboxRecord = QualifiedRecordRef & {
|
|
|
4
4
|
record: SelectedRecord | null;
|
|
5
5
|
schema: CollectionSchema | null;
|
|
6
6
|
};
|
|
7
|
-
export type
|
|
7
|
+
export type InboxRecordLink = QualifiedRecordRef & {
|
|
8
|
+
title: string;
|
|
9
|
+
};
|
|
10
|
+
export type LegacyInboxRecords = {
|
|
8
11
|
records: InboxRecord[];
|
|
9
12
|
};
|
|
10
|
-
export type
|
|
11
|
-
|
|
13
|
+
export type InboxRecords = LegacyInboxRecords & {
|
|
14
|
+
links: InboxRecordLink[];
|
|
15
|
+
};
|
|
16
|
+
export type InboxRecordsSummaryMode = 'links-v1';
|
|
17
|
+
export type ReadInboxRecords = (workspace: string, repository: string, refs: string[], authorization: string, summaryMode?: InboxRecordsSummaryMode) => Promise<InboxRecords>;
|
|
18
|
+
export type InboxRecordsOutcome<Result = InboxRecords> = {
|
|
12
19
|
status: 200;
|
|
13
|
-
result:
|
|
20
|
+
result: Result;
|
|
14
21
|
} | {
|
|
15
22
|
status: 403 | 503;
|
|
16
23
|
};
|
|
17
24
|
export declare function parseInboxRecordRefs(value: unknown): QualifiedRecordRef[];
|
|
18
25
|
export declare const recordKey: ({ repository, ref }: QualifiedRecordRef) => string;
|
|
26
|
+
/** Inbox's existing title policy, shared by full Records and immediate summaries. */
|
|
27
|
+
export declare function inboxRecordTitle(entry: InboxRecord): string;
|
|
19
28
|
export declare function parseInboxRecords(value: unknown): InboxRecords;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RecordDisplay } from './data-contract.js';
|
|
2
|
+
type DisplayField = {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly kind: string;
|
|
5
|
+
readonly many: boolean;
|
|
6
|
+
};
|
|
7
|
+
type InvalidDisplay = (message: string) => never;
|
|
8
|
+
export declare function parseRecordDisplay(value: unknown, definitions: readonly DisplayField[], fail?: InvalidDisplay): RecordDisplay | undefined;
|
|
9
|
+
/** Resolve the schema-owned short presentation title without changing Record identity. */
|
|
10
|
+
export declare function recordDisplayTitle(record: Record<string, unknown>, display?: Readonly<RecordDisplay>): string | undefined;
|
|
11
|
+
export {};
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
import { InboxContractError, type RecordSource, type RecordReference } from './inbox-contract.js';
|
|
2
|
-
export
|
|
3
|
-
source: RecordSource;
|
|
4
|
-
query: string;
|
|
5
|
-
selected?: RecordReference;
|
|
6
|
-
};
|
|
1
|
+
import { InboxContractError, type RecordSource, type RecordPickerSource, type RecordReference } from './inbox-contract.js';
|
|
2
|
+
export declare const recordOptionCatalogueByteLimit = 7000000;
|
|
7
3
|
export type LabeledRecord = RecordReference & {
|
|
8
4
|
label: string;
|
|
9
5
|
};
|
|
10
|
-
export type
|
|
6
|
+
export type RecordOption = LabeledRecord & {
|
|
7
|
+
searchText: string;
|
|
8
|
+
};
|
|
9
|
+
export type RecordOptionCatalogue = {
|
|
11
10
|
recordType: string;
|
|
12
11
|
eligibleCount: number;
|
|
13
|
-
|
|
14
|
-
matches: LabeledRecord[];
|
|
15
|
-
suggestions: Array<LabeledRecord & {
|
|
16
|
-
reason?: string;
|
|
17
|
-
}>;
|
|
18
|
-
selected?: LabeledRecord;
|
|
12
|
+
options: RecordOption[];
|
|
19
13
|
};
|
|
20
|
-
|
|
14
|
+
/** Locale-independent case normalization and whitespace matching, shared with Inbox. */
|
|
15
|
+
export declare function normalizeRecordOptionSearch(text: string): string;
|
|
16
|
+
declare const selectionProblems: readonly ['collection_unavailable', 'display_fields_invalid', 'filter_fields_invalid', 'ref_prefix_invalid', 'suggestion_unavailable', 'label_unavailable'];
|
|
21
17
|
export type RecordSelectionProblem = typeof selectionProblems[number];
|
|
22
18
|
export declare function isRecordSelectionProblem(value: unknown): value is RecordSelectionProblem;
|
|
23
19
|
/** Only these known definition failures cross the private Data boundary.
|
|
24
20
|
* Record values, provider errors and credentials never enter the envelope. */
|
|
25
21
|
export declare class RecordSelectionError extends InboxContractError {
|
|
26
22
|
readonly problem: RecordSelectionProblem;
|
|
27
|
-
constructor(problem: RecordSelectionProblem, source: RecordSource);
|
|
23
|
+
constructor(problem: RecordSelectionProblem, source: RecordSource | RecordPickerSource);
|
|
28
24
|
}
|
|
29
|
-
export declare function validateRecordSelectionInput(value: unknown): RecordSelectionInput;
|
|
30
25
|
export {};
|