@oddington/sdk 0.1.73 → 0.1.75
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 +45 -0
- package/dist/browser.js +343 -233
- package/dist/index.js +4 -4
- package/dist/types/packages/sdk/src/public.d.ts +19 -3
- 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 +4 -0
- package/dist/types/shared/inbox-member-contract.d.ts +1 -1
- package/dist/types/shared/inbox-member-types.d.ts +5 -6
- package/dist/types/shared/record-display.d.ts +11 -0
- package/dist/types/shared/record-selection.d.ts +9 -14
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ export type { GmailRuntimeConnection, AirtableRuntimeConnection, DropboxRuntimeC
|
|
|
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: {
|
|
@@ -279,3 +279,19 @@ export type RoutinePublicationClient = {
|
|
|
279
279
|
check(body: PublicationRequest): Promise<void>;
|
|
280
280
|
};
|
|
281
281
|
export declare function routinePublicationClient(options?: RoutinePublicationClientOptions): RoutinePublicationClient;
|
|
282
|
+
export type ApiClientOptions = {
|
|
283
|
+
workspace: string;
|
|
284
|
+
token: string;
|
|
285
|
+
};
|
|
286
|
+
export type ApiClient = {
|
|
287
|
+
inbox: {
|
|
288
|
+
checkDigest(value: DigestInput, options: {
|
|
289
|
+
requestKey: string;
|
|
290
|
+
}): Promise<void>;
|
|
291
|
+
publishDigest(value: DigestInput, options: {
|
|
292
|
+
requestKey: string;
|
|
293
|
+
}): Promise<PublishedDigest>;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
/** Explicit API-client credentials for trusted server-side Digest publication. */
|
|
297
|
+
export declare function createClient(options: ApiClientOptions): ApiClient;
|
|
@@ -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;
|
|
@@ -313,6 +313,10 @@ export interface InboxPublicationTransport {
|
|
|
313
313
|
resolution: ResolutionInput;
|
|
314
314
|
}): Promise<void>;
|
|
315
315
|
}
|
|
316
|
+
/** Shared Digest serialization for publication and its effect-free check. */
|
|
317
|
+
export declare function digestPublicationRequest(value: DigestInput, options: {
|
|
318
|
+
requestKey: string;
|
|
319
|
+
}): PublicationRequest;
|
|
316
320
|
export declare function createInboxPublisher(transport: InboxPublicationTransport): {
|
|
317
321
|
publishAsk(value: AskInput, options: {
|
|
318
322
|
requestKey: string;
|
|
@@ -21,7 +21,7 @@ export declare const INBOX_INPUT_BYTES = 8192;
|
|
|
21
21
|
export declare const INBOX_LOCAL_INPUT_BYTES: number;
|
|
22
22
|
export declare const INBOX_QUESTION_CONTRACT: 'question-work-v1';
|
|
23
23
|
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.
|
|
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.listRecordOptions';
|
|
25
25
|
export declare function isAppQuestionOperation(operation: InboxOperation): boolean;
|
|
26
26
|
/** Closed wire vocabulary; both placements require an explicit relevance filter. */
|
|
27
27
|
export declare function parseInboxRequest(value: 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;
|
|
@@ -96,6 +96,7 @@ interface InboxItemSnapshot {
|
|
|
96
96
|
title: string;
|
|
97
97
|
description: string;
|
|
98
98
|
author: string;
|
|
99
|
+
apiClientId?: string | null;
|
|
99
100
|
revision: number;
|
|
100
101
|
publishedAt: string;
|
|
101
102
|
outcome: {
|
|
@@ -204,10 +205,8 @@ export type InboxAnswerInput = ItemRevision & {
|
|
|
204
205
|
/** Picker name for display only; the Record reference is the answer. */
|
|
205
206
|
label?: string;
|
|
206
207
|
};
|
|
207
|
-
export type
|
|
208
|
+
export type InboxRecordOptionsInput = ItemRevision & {
|
|
208
209
|
questionId: string;
|
|
209
|
-
query: string;
|
|
210
|
-
selected?: RecordReference;
|
|
211
210
|
};
|
|
212
211
|
/** Hosted listing relevance only; local listing uses its bound declaration. */
|
|
213
212
|
export type InboxQuestionListInput = {
|
|
@@ -239,7 +238,7 @@ export interface InboxMember {
|
|
|
239
238
|
questions: {
|
|
240
239
|
list(input: InboxQuestionListInput): Promise<QuestionWork[]>;
|
|
241
240
|
answer(input: InboxAnswerInput): Promise<ResponseAcceptance>;
|
|
242
|
-
|
|
241
|
+
listRecordOptions(input: InboxRecordOptionsInput): Promise<RecordOptionCatalogue>;
|
|
243
242
|
};
|
|
244
243
|
}
|
|
245
244
|
export {};
|
|
@@ -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,23 +1,19 @@
|
|
|
1
1
|
import { InboxContractError, type RecordSource, type RecordReference } from './inbox-contract.js';
|
|
2
|
-
export
|
|
3
|
-
source: RecordSource;
|
|
4
|
-
query: string;
|
|
5
|
-
selected?: RecordReference;
|
|
6
|
-
};
|
|
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.
|
|
@@ -26,5 +22,4 @@ export declare class RecordSelectionError extends InboxContractError {
|
|
|
26
22
|
readonly problem: RecordSelectionProblem;
|
|
27
23
|
constructor(problem: RecordSelectionProblem, source: RecordSource);
|
|
28
24
|
}
|
|
29
|
-
export declare function validateRecordSelectionInput(value: unknown): RecordSelectionInput;
|
|
30
25
|
export {};
|