@oddington/sdk 0.1.33 → 0.1.35
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 +11 -7
- package/dist/browser.js +289 -284
- package/dist/index.js +3 -3
- package/dist/types/packages/sdk/src/public.d.ts +2 -26
- package/dist/types/shared/files-contract.d.ts +30 -1
- package/dist/types/shared/routine-deployment-contract.d.ts +4 -4
- package/package.json +1 -1
- package/dist/types/shared/record-write.d.ts +0 -33
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { AskInput,
|
|
1
|
+
import type { AskInput, DigestInput, InboxFile, PublicationRequest, PublishedAsk, PublishedDigest, ResolutionInput } from '../../../shared/inbox-contract.js';
|
|
2
2
|
import type { FileAddOptions } from '../../../shared/inbox-files.js';
|
|
3
|
-
import type { RecordReadInput } from '../../../shared/record-capture.js';
|
|
4
|
-
import type { RecordDeleteRequest, RecordUpdateRequest, RecordWriteRequest } from '../../../shared/record-write.js';
|
|
5
3
|
export type { RoutineSchema, RoutineSchemaValue, RoutineDefinition, RoutineInput, RoutineRuntime, RoutineAccess, RoutineCapabilities, RoutineStep, RoutineSteps, RoutineStepInput, RoutineStepResult, RoutineStepOutput, RoutineArtifactInput, RoutineArtifact, RoutineAI } from './routine-definition-types.js';
|
|
6
4
|
export declare const defineRoutine: import('./routine-definition-types.js').DefineRoutine;
|
|
7
5
|
export declare const schema: import('./routine-definition-types.js').RoutineSchemaBuilders;
|
|
@@ -10,9 +8,6 @@ export { InboxContractError, asksBlock, continueAsk, defineHandler, fileBlock, q
|
|
|
10
8
|
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
9
|
export type { CapturedRecordTableInput, RecordField, RecordTableInput, RecordValue, RecordViewInput, TableColumn, ViewRecord, } from '../../../shared/inbox-views.js';
|
|
12
10
|
export type { FileAddOptions } from '../../../shared/inbox-files.js';
|
|
13
|
-
export type { RecordReadInput } from '../../../shared/record-capture.js';
|
|
14
|
-
export type { RecordDeleteRequest, RecordUpdateRequest, RecordWriteRequest } from '../../../shared/record-write.js';
|
|
15
|
-
export { RoutineRecordWriteError } from '../../../shared/record-write.js';
|
|
16
11
|
export { AirtableOperationError } from '../../../shared/airtable-contract.js';
|
|
17
12
|
export type { AirtableField, AirtableTable, AirtableRecord, AirtableListInput, AirtableGetInput, AirtableCreateInput, AirtableUpdateInput, AirtableDeleteInput, AirtableReceipt, AirtableWriteResult, AirtableClient } from '../../../shared/airtable-contract.js';
|
|
18
13
|
export type { GmailRuntimeConnection, AirtableRuntimeConnection, DropboxRuntimeConnection, RuntimeConnection } from '../../../shared/connection-runtime.js';
|
|
@@ -40,7 +35,7 @@ export { InboxOperationError } from '../../../shared/inbox-member-contract.js';
|
|
|
40
35
|
export type { InboxMember, InboxCurrent, InboxItem, AnswerableQuestion, QuestionSnapshot, ResponseConsequence, LinkedAskSnapshot, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxSearchInput } from '../../../shared/inbox-member-types.js';
|
|
41
36
|
export type { RecordSelectionResult } from '../../../shared/record-selection.js';
|
|
42
37
|
export declare const inbox: import('../../../shared/inbox-member-types.js').InboxMember;
|
|
43
|
-
export type { File, FileInput, FileStorage, FileCreateInput, FileCreateOptions, FileEnrichment, FileEnrichOptions, FileEnrichResult, FileErrorCode } from '../../../shared/files-contract.js';
|
|
38
|
+
export type { File, FileInput, FileStorage, FileCreateInput, FileCreateOptions, FileEnrichment, FileEnrichOptions, FileEnrichResult, FileErrorCode, FileErrorDetail } from '../../../shared/files-contract.js';
|
|
44
39
|
export declare const files: {
|
|
45
40
|
create(input: import('../../../shared/files-contract.js').FileCreateInput, options?: import('../../../shared/files-contract.js').FileCreateOptions): Promise<import('../../../shared/files-contract.js').File>;
|
|
46
41
|
get(id: string): Promise<import('../../../shared/files-contract.js').File>;
|
|
@@ -222,25 +217,6 @@ export type RoutinePublicationClient = {
|
|
|
222
217
|
requestKey: string;
|
|
223
218
|
}): Promise<PublishedDigest>;
|
|
224
219
|
publishResolution(askId: string, value: ResolutionInput): Promise<void>;
|
|
225
|
-
readRecords(input: RecordReadInput): Promise<CapturedRecords>;
|
|
226
|
-
repository: {
|
|
227
|
-
readRecords(input: RecordReadInput): Promise<CapturedRecords>;
|
|
228
|
-
updateRecords(input: RecordUpdateRequest, options: {
|
|
229
|
-
requestKey: string;
|
|
230
|
-
}): Promise<{
|
|
231
|
-
receipt: RepositoryReceipt;
|
|
232
|
-
}>;
|
|
233
|
-
writeRecords(input: RecordWriteRequest, options: {
|
|
234
|
-
requestKey: string;
|
|
235
|
-
}): Promise<{
|
|
236
|
-
receipt: RepositoryReceipt;
|
|
237
|
-
}>;
|
|
238
|
-
deleteRecords(input: RecordDeleteRequest, options: {
|
|
239
|
-
requestKey: string;
|
|
240
|
-
}): Promise<{
|
|
241
|
-
receipt: RepositoryReceipt;
|
|
242
|
-
}>;
|
|
243
|
-
};
|
|
244
220
|
files: {
|
|
245
221
|
add(value: FileAddOptions): Promise<InboxFile>;
|
|
246
222
|
};
|
|
@@ -37,12 +37,40 @@ export type File = {
|
|
|
37
37
|
enrichments: Record<string, FileEnrichment>;
|
|
38
38
|
};
|
|
39
39
|
export type FileErrorCode = 'invalid_input' | 'unsupported_context' | 'unauthenticated' | 'access_denied' | 'request_too_large' | 'conflict' | 'local_only' | 'integrity' | 'unavailable' | 'capacity' | 'method_not_allowed';
|
|
40
|
+
declare const fileValidationReasons: {
|
|
41
|
+
invalid_metadata: string;
|
|
42
|
+
invalid_name: string;
|
|
43
|
+
invalid_path: string;
|
|
44
|
+
invalid_storage: string;
|
|
45
|
+
invalid_media_type: string;
|
|
46
|
+
invalid_size: string;
|
|
47
|
+
invalid_request_key: string;
|
|
48
|
+
invalid_enrichment_name: string;
|
|
49
|
+
invalid_replacement: string;
|
|
50
|
+
invalid_bytes: string;
|
|
51
|
+
};
|
|
52
|
+
export type FileErrorDetail = {
|
|
53
|
+
reason: keyof typeof fileValidationReasons | 'size_mismatch' | 'size_limit';
|
|
54
|
+
expectedBytes?: number;
|
|
55
|
+
receivedBytes?: number;
|
|
56
|
+
limitBytes?: number;
|
|
57
|
+
receivedAtLeast?: true;
|
|
58
|
+
};
|
|
59
|
+
/** Only inert, bounded facts cross Files and Run error boundaries. */
|
|
60
|
+
export declare function parseFileErrorDetail(value: unknown): FileErrorDetail | undefined;
|
|
61
|
+
export declare function fileErrorExplanation(detail: FileErrorDetail): string;
|
|
40
62
|
export declare class FileOperationError extends Error {
|
|
41
63
|
readonly code: FileErrorCode;
|
|
42
64
|
readonly status: number;
|
|
43
65
|
readonly retryable: boolean;
|
|
44
|
-
|
|
66
|
+
readonly detail?: FileErrorDetail;
|
|
67
|
+
constructor(code: FileErrorCode, status: number, retryable?: boolean, detail?: FileErrorDetail);
|
|
45
68
|
}
|
|
69
|
+
export declare function fileErrorFacts(error: FileOperationError): {
|
|
70
|
+
code: FileErrorCode;
|
|
71
|
+
retryable?: boolean | undefined;
|
|
72
|
+
detail?: FileErrorDetail | undefined;
|
|
73
|
+
};
|
|
46
74
|
export declare const FILE_ID_PATTERN: RegExp;
|
|
47
75
|
/** Descriptor admission is independent of each runtime's supported writes. */
|
|
48
76
|
export declare const FILE_ORIGINAL_MAX_BYTES: number;
|
|
@@ -74,3 +102,4 @@ export type FileCreateMetadata = {
|
|
|
74
102
|
requestKey: string;
|
|
75
103
|
};
|
|
76
104
|
export declare function parseFileCreateMetadata(value: unknown, maxBytes: number): FileCreateMetadata;
|
|
105
|
+
export {};
|
|
@@ -16,12 +16,12 @@ export type RoutineDeclaration = {
|
|
|
16
16
|
publish: Array<'asks' | 'digests'>;
|
|
17
17
|
};
|
|
18
18
|
runtime: {
|
|
19
|
-
features:
|
|
20
|
-
resources: 'standard'
|
|
21
|
-
maxDuration:
|
|
19
|
+
features: [];
|
|
20
|
+
resources: 'standard';
|
|
21
|
+
maxDuration: '15m';
|
|
22
22
|
};
|
|
23
23
|
retry: {
|
|
24
|
-
maxAttempts:
|
|
24
|
+
maxAttempts: 1;
|
|
25
25
|
};
|
|
26
26
|
assets: string[];
|
|
27
27
|
};
|
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type RecordCreate, type RecordDelete, type RecordUpdate } from './inbox-contract.js';
|
|
2
|
-
export type RecordWrite = RecordCreate | RecordUpdate;
|
|
3
|
-
export type RecordUpdateRequest = {
|
|
4
|
-
repository: string;
|
|
5
|
-
records: RecordUpdate[];
|
|
6
|
-
};
|
|
7
|
-
export type RecordWriteRequest = {
|
|
8
|
-
repository: string;
|
|
9
|
-
records: RecordWrite[];
|
|
10
|
-
};
|
|
11
|
-
export type RecordDeleteRequest = {
|
|
12
|
-
repository: string;
|
|
13
|
-
records: RecordDelete[];
|
|
14
|
-
};
|
|
15
|
-
export type RecordChange = RecordWrite | RecordDelete;
|
|
16
|
-
export type RecordChangeRequest = {
|
|
17
|
-
repository: string;
|
|
18
|
-
records: RecordChange[];
|
|
19
|
-
};
|
|
20
|
-
export type RoutineRecordWriteRequest = {
|
|
21
|
-
input: RecordChangeRequest;
|
|
22
|
-
requestKey: string;
|
|
23
|
-
};
|
|
24
|
-
export declare const RECORD_WRITE_INPUT_LIMIT: number;
|
|
25
|
-
export declare class RoutineRecordWriteError extends Error {
|
|
26
|
-
readonly effect: 'unapplied' | 'uncertain' | 'pending';
|
|
27
|
-
constructor(message: string, effect: 'unapplied' | 'uncertain' | 'pending');
|
|
28
|
-
}
|
|
29
|
-
export declare function validateRecordWrite(value: unknown): RecordWriteRequest;
|
|
30
|
-
export declare function validateRecordUpdate(value: unknown): RecordUpdateRequest;
|
|
31
|
-
export declare function validateRecordDelete(value: unknown): RecordDeleteRequest;
|
|
32
|
-
export declare function validateRecordChange(value: unknown): RecordChangeRequest;
|
|
33
|
-
export declare function validateRoutineRecordWrite(value: unknown): RoutineRecordWriteRequest;
|