@oddington/sdk 0.1.29 → 0.1.31
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 +7 -20
- package/dist/browser.js +152 -197
- package/dist/index.js +3 -62
- package/dist/types/packages/sdk/src/public.d.ts +10 -15
- package/dist/types/shared/files-contract.d.ts +6 -36
- package/dist/types/shared/inbox-contract.d.ts +0 -13
- package/dist/types/shared/inbox-files.d.ts +5 -10
- package/dist/types/shared/routine-deployment-contract.d.ts +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ export declare const defineRoutine: import('./routine-definition-types.js').Defi
|
|
|
7
7
|
export declare const schema: import('./routine-definition-types.js').RoutineSchemaBuilders;
|
|
8
8
|
export declare const file: import('./routine-definition-types.js').RoutineFileSchema;
|
|
9
9
|
export { InboxContractError, asksBlock, continueAsk, defineHandler, fileBlock, question, recordBlock, recordsBlock, resolveAsk, respond, richTextBlock, selection, } from '../../../shared/inbox-contract.js';
|
|
10
|
-
export type { AskInput, AuthoredSource, CapturedRecords,
|
|
10
|
+
export type { AskInput, AuthoredSource, CapturedRecords, DigestInput, Handler, HandlerReference, HandlerRuntime, HandlerTransition, InboxBlock, InboxFile, JsonObject, JsonValue, PresentedField, PresentedRecord, PresentedRecordSummary, PublishedAsk, PublishedDigest, PublishedView, PublicationRequest, Question, QuestionInput, QuestionResponse, RecordCreate, RecordDelete, RecordReference, RecordSource, RecordUpdate, RepositoryCapabilities, RepositoryReceipt, Resolution, ResolutionInput, ResponseDefinition, } from '../../../shared/inbox-contract.js';
|
|
11
11
|
export type { CapturedRecordTableInput, RecordField, RecordTableInput, RecordValue, RecordViewInput, TableColumn, ViewRecord, } from '../../../shared/inbox-views.js';
|
|
12
12
|
export type { FileAddOptions } from '../../../shared/inbox-files.js';
|
|
13
13
|
export type { RecordReadInput } from '../../../shared/record-capture.js';
|
|
@@ -20,8 +20,15 @@ export type { Connections } from '../../../shared/airtable-contract.js';
|
|
|
20
20
|
export declare const connections: import('../../../shared/airtable-contract.js').Connections;
|
|
21
21
|
export { DataOperationError } from '../../../shared/data-contract.js';
|
|
22
22
|
export type { DataRepository, DataErrorCode, PublicValueDefinition, PublicField, CollectionSummary, CollectionSchema, QueryScalar, SelectionOptions, RecordSelection, RecordsQuery, DataValue, SelectedRecord, SelectionMetadata, RecordsResult, RecordsReadInput, RecordsReadResult, RecordsSearchOptions, RecordsSearchResult, HistoryListOptions, HistoryEntry, HistoryChangesOptions, HistoryChange, HistoryChangesResult, RecordIdentity, RecordCreation, RecordUpdateSet, DataPublication, DataChangeSet, DataEffect } from '../../../shared/data-contract.js';
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
declare global {
|
|
24
|
+
namespace __OddingtonOS {
|
|
25
|
+
/** Import-free OS-generated metadata; no runtime namespace is created. */
|
|
26
|
+
interface DataRepositorySchemas {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Reserved for OS-generated snapshots, including legacy module augmentations. */
|
|
31
|
+
export interface DataRepositorySchemas extends __OddingtonOS.DataRepositorySchemas {
|
|
25
32
|
}
|
|
26
33
|
export declare const data: {
|
|
27
34
|
repository<const Name extends string>(name: Name): import('./data-schema-types.js').RepositoryFor<Name>;
|
|
@@ -198,18 +205,6 @@ export declare const app: {
|
|
|
198
205
|
};
|
|
199
206
|
routines: AppRoutineTypes;
|
|
200
207
|
};
|
|
201
|
-
/** A declared stage without a summary takes no second argument. */
|
|
202
|
-
export type AppRunContext<Input, Result, Steps> = {
|
|
203
|
-
readonly input: AppRunInput<Input>;
|
|
204
|
-
step<Key extends Extract<keyof Steps, string>>(id: Key, ...summary: Steps[Key] extends undefined ? [] : [summary: Steps[Key]]): Promise<void>;
|
|
205
|
-
finish(...result: [Result] extends [undefined] ? [] : [result: Result]): Promise<void>;
|
|
206
|
-
};
|
|
207
|
-
export type AppRunInput<Value> = Value extends object ? {
|
|
208
|
-
readonly [Key in keyof Value]: AppRunInput<Value[Key]>;
|
|
209
|
-
} : Value;
|
|
210
|
-
export declare const appRun: {
|
|
211
|
-
current<Input = unknown, Result = undefined, Steps = Record<string, undefined>>(): AppRunContext<Input, Result, Steps> | undefined;
|
|
212
|
-
};
|
|
213
208
|
export type InboxRequester = (path: string, init?: RequestInit) => Promise<Response>;
|
|
214
209
|
export type RoutinePublicationClientOptions = {
|
|
215
210
|
workspace?: string;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
/** Provider-neutral authored contract. Registries and object locations stay server-side. */
|
|
2
2
|
export type FileStorage = 'local' | 'remote';
|
|
3
3
|
export type FileInput = Blob | Uint8Array | ReadableStream<Uint8Array>;
|
|
4
|
-
export type FileCsvHints = {
|
|
5
|
-
encoding?: 'utf-8' | 'windows-1252';
|
|
6
|
-
delimiter?: ',' | ';' | '\t';
|
|
7
|
-
headerRow?: number;
|
|
8
|
-
};
|
|
9
4
|
export type FileCreateInput = {
|
|
10
5
|
file: FileInput;
|
|
11
6
|
size?: number;
|
|
12
7
|
path?: string;
|
|
13
8
|
name?: string;
|
|
14
9
|
storage?: FileStorage;
|
|
15
|
-
|
|
10
|
+
mediaType?: string;
|
|
16
11
|
};
|
|
17
12
|
export type FileCreateOptions = {
|
|
18
13
|
requestKey?: string;
|
|
@@ -40,18 +35,6 @@ export type File = {
|
|
|
40
35
|
size: number;
|
|
41
36
|
sha256: string;
|
|
42
37
|
enrichments: Record<string, FileEnrichment>;
|
|
43
|
-
details: {
|
|
44
|
-
kind: 'csv';
|
|
45
|
-
encoding: 'utf-8' | 'windows-1252';
|
|
46
|
-
delimiter: ',' | ';' | '\t';
|
|
47
|
-
headerRow: number;
|
|
48
|
-
dataRows: number;
|
|
49
|
-
} | {
|
|
50
|
-
kind: 'pdf';
|
|
51
|
-
pages?: number;
|
|
52
|
-
} | {
|
|
53
|
-
kind: 'other';
|
|
54
|
-
};
|
|
55
38
|
};
|
|
56
39
|
export type FileErrorCode = 'invalid_input' | 'unsupported_context' | 'unauthenticated' | 'access_denied' | 'request_too_large' | 'conflict' | 'local_only' | 'integrity' | 'unavailable' | 'capacity' | 'method_not_allowed';
|
|
57
40
|
export declare class FileOperationError extends Error {
|
|
@@ -77,30 +60,17 @@ export declare function parseFileEnrichMetadata(value: unknown, maxBytes: number
|
|
|
77
60
|
export declare function safeFileName(value: unknown): value is string;
|
|
78
61
|
export declare function safeFilePath(value: unknown): value is string;
|
|
79
62
|
export declare function safeManagedFilePath(value: unknown): value is string;
|
|
80
|
-
/** Private transport metadata: normalized material options exclude the request key and size declaration. */
|
|
81
|
-
export declare const ORIGINAL_MEDIA_TYPES: readonly ['application/pdf', 'text/plain', 'text/markdown', 'application/json', 'image/png', 'image/jpeg'];
|
|
82
|
-
export type OriginalMediaType = typeof ORIGINAL_MEDIA_TYPES[number];
|
|
83
63
|
/** Normalize declarations only; no byte interpretation or filename inference. */
|
|
84
|
-
export
|
|
64
|
+
export type OriginalMediaType = string;
|
|
65
|
+
export declare function declaredOriginalMediaType(value: unknown): string;
|
|
66
|
+
export declare function isCanonicalOriginalMediaType(value: unknown): value is string;
|
|
67
|
+
/** Private transport metadata: normalized material options exclude the request key and size declaration. */
|
|
85
68
|
export type FileCreateMetadata = {
|
|
86
69
|
name: string;
|
|
87
70
|
path: string;
|
|
88
71
|
storage?: FileStorage;
|
|
89
|
-
|
|
90
|
-
inputMediaType?: OriginalMediaType;
|
|
72
|
+
mediaType: string;
|
|
91
73
|
size: number;
|
|
92
74
|
requestKey: string;
|
|
93
75
|
};
|
|
94
|
-
/** Declared types are descriptive metadata; this rule never reads original bytes. */
|
|
95
|
-
export declare function declaredOriginalFormat(input: Pick<FileCreateMetadata, 'name' | 'inputMediaType'>): {
|
|
96
|
-
mediaType: 'application/pdf';
|
|
97
|
-
details: {
|
|
98
|
-
kind: 'pdf';
|
|
99
|
-
};
|
|
100
|
-
} | {
|
|
101
|
-
mediaType: "application/json" | "image/jpeg" | "image/png" | "text/markdown" | "text/plain";
|
|
102
|
-
details: {
|
|
103
|
-
kind: 'other';
|
|
104
|
-
};
|
|
105
|
-
} | undefined;
|
|
106
76
|
export declare function parseFileCreateMetadata(value: unknown, maxBytes: number): FileCreateMetadata;
|
|
@@ -87,25 +87,12 @@ export type PresentedRecordSummary = {
|
|
|
87
87
|
facts?: PresentedField[];
|
|
88
88
|
view?: string;
|
|
89
89
|
};
|
|
90
|
-
export type CsvDetails = {
|
|
91
|
-
kind: 'csv';
|
|
92
|
-
encoding: 'utf-8' | 'windows-1252';
|
|
93
|
-
delimiter: ',' | ';' | '\t';
|
|
94
|
-
headerRow: number;
|
|
95
|
-
dataRows: number;
|
|
96
|
-
};
|
|
97
90
|
export type InboxFile = {
|
|
98
91
|
id: string;
|
|
99
92
|
name: string;
|
|
100
93
|
mediaType: string;
|
|
101
94
|
size: number;
|
|
102
95
|
sha256: string;
|
|
103
|
-
details: CsvDetails | {
|
|
104
|
-
kind: 'pdf';
|
|
105
|
-
pages?: number;
|
|
106
|
-
} | {
|
|
107
|
-
kind: 'other';
|
|
108
|
-
};
|
|
109
96
|
};
|
|
110
97
|
export type InboxBlock = {
|
|
111
98
|
kind: 'rich-text';
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import { type InboxFile
|
|
1
|
+
import { type InboxFile } from './inbox-contract.js';
|
|
2
2
|
export type FileAddOptions = {
|
|
3
3
|
path: string;
|
|
4
4
|
name?: string;
|
|
5
|
-
csv?: {
|
|
6
|
-
encoding?: CsvDetails['encoding'];
|
|
7
|
-
delimiter?: CsvDetails['delimiter'];
|
|
8
|
-
headerRow?: number;
|
|
9
|
-
};
|
|
10
5
|
};
|
|
11
6
|
export declare function validateFileAddOptions(value: unknown): FileAddOptions;
|
|
12
|
-
|
|
13
|
-
export declare function
|
|
14
|
-
export declare function deriveInboxFile(bytes: Uint8Array, name: string
|
|
15
|
-
/**
|
|
7
|
+
/** Consumer interpretation only: no parsing facts become File metadata. */
|
|
8
|
+
export declare function previewCsvRows(bytes: Uint8Array): string[][];
|
|
9
|
+
export declare function deriveInboxFile(bytes: Uint8Array, name: string): Promise<Omit<InboxFile, 'id'>>;
|
|
10
|
+
/** Original integrity is independent of consumer format interpretation. */
|
|
16
11
|
export declare function verifyInboxFile(bytes: Uint8Array, value: unknown): Promise<InboxFile>;
|
|
17
12
|
export declare function publicationFiles(body?: import('./inbox-contract.js').InboxBlock[]): InboxFile[];
|