@oddington/sdk 0.1.14 → 0.1.16
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.
|
@@ -2,7 +2,7 @@ import type { AskInput, CapturedRecords, DigestInput, InboxFile, PublicationRequ
|
|
|
2
2
|
import type { FileAddOptions } from '../../../shared/inbox-files.js';
|
|
3
3
|
import type { RecordReadInput } from '../../../shared/record-capture.js';
|
|
4
4
|
import type { RecordDeleteRequest, RecordUpdateRequest, RecordWriteRequest } from '../../../shared/record-write.js';
|
|
5
|
-
export type { RoutineSchema, RoutineSchemaValue, RoutineDefinition, RoutineInput, RoutineRuntime } from './routine-definition-types.js';
|
|
5
|
+
export type { RoutineSchema, RoutineSchemaValue, RoutineDefinition, RoutineInput, RoutineRuntime, RoutineArtifactInput, RoutineArtifact } from './routine-definition-types.js';
|
|
6
6
|
export declare const defineRoutine: import('./routine-definition-types.js').DefineRoutine;
|
|
7
7
|
export declare const schema: import('./routine-definition-types.js').RoutineSchemaBuilders;
|
|
8
8
|
export declare const file: import('./routine-definition-types.js').RoutineFileSchema;
|
|
@@ -84,7 +84,7 @@ export declare const auth: {
|
|
|
84
84
|
/** Customer-owned module augmentation supplies types, never runtime authority. */
|
|
85
85
|
export interface AppRoutineTypes {
|
|
86
86
|
}
|
|
87
|
-
export type AppRoutineErrorReason = 'authority_unavailable' | 'execution_unavailable' | 'invalid_input';
|
|
87
|
+
export type AppRoutineErrorReason = 'not_enabled' | 'authority_unavailable' | 'execution_unavailable' | 'invalid_input';
|
|
88
88
|
export declare class AppRoutineError extends Error {
|
|
89
89
|
readonly reason: AppRoutineErrorReason;
|
|
90
90
|
constructor(reason: AppRoutineErrorReason);
|
|
@@ -125,7 +125,7 @@ export type AppRoutineBinding<Input, Result, Steps> = {
|
|
|
125
125
|
steps: Extract<keyof Steps, string>[];
|
|
126
126
|
} | {
|
|
127
127
|
available: false;
|
|
128
|
-
reason: 'authority_unavailable' | 'execution_unavailable';
|
|
128
|
+
reason: 'not_enabled' | 'authority_unavailable' | 'execution_unavailable';
|
|
129
129
|
}>;
|
|
130
130
|
run(input: Input): Promise<AppRoutineHandle<Result, Steps>>;
|
|
131
131
|
recover(): Promise<AppRoutineHandle<Result, Steps>[]>;
|
|
@@ -13,6 +13,22 @@ export type RoutineSteps = Record<string, RoutineSchema<unknown> | null>;
|
|
|
13
13
|
export type RoutineInput<Value> = Value extends object ? {
|
|
14
14
|
readonly [Key in keyof Value]: RoutineInput<Value[Key]>;
|
|
15
15
|
} : Value;
|
|
16
|
+
export type RoutineArtifactInput = Readonly<{
|
|
17
|
+
requestKey: string;
|
|
18
|
+
name: string;
|
|
19
|
+
mediaType: string;
|
|
20
|
+
size: number;
|
|
21
|
+
sha256: string;
|
|
22
|
+
content: Uint8Array | Blob | ReadableStream<Uint8Array>;
|
|
23
|
+
}>;
|
|
24
|
+
export type RoutineArtifact = Readonly<{
|
|
25
|
+
id: string;
|
|
26
|
+
attempt: string;
|
|
27
|
+
name: string;
|
|
28
|
+
mediaType: string;
|
|
29
|
+
size: number;
|
|
30
|
+
sha256: string;
|
|
31
|
+
}>;
|
|
16
32
|
export type RoutineRuntime<Steps extends RoutineSteps> = {
|
|
17
33
|
readonly run: {
|
|
18
34
|
readonly id: string;
|
|
@@ -23,6 +39,7 @@ export type RoutineRuntime<Steps extends RoutineSteps> = {
|
|
|
23
39
|
readonly files: typeof files;
|
|
24
40
|
readonly connections: Connections;
|
|
25
41
|
readonly inbox: RoutinePublicationClient;
|
|
42
|
+
artifact(input: RoutineArtifactInput): Promise<RoutineArtifact>;
|
|
26
43
|
step<Key extends Extract<keyof Steps, string>>(id: Key, ...summary: Steps[Key] extends null ? [] : [summary: RoutineSchemaValue<Steps[Key]>]): Promise<void>;
|
|
27
44
|
};
|
|
28
45
|
export type RoutineDefinition<Input extends RoutineSchema<unknown> | undefined, Steps extends RoutineSteps, Result extends RoutineSchema<unknown> | undefined> = {
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/** Safe member-scoped service facts; local runtime readiness is checked by the host. */
|
|
2
|
+
export type AppRoutineAvailability = {
|
|
3
|
+
available: true;
|
|
4
|
+
} | {
|
|
5
|
+
available: false;
|
|
6
|
+
reason: 'not_enabled' | 'authority_unavailable';
|
|
7
|
+
};
|
|
8
|
+
export declare class AppRoutineNotEnabled extends Error {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
export declare function parseAppRoutineAvailability(value: unknown): AppRoutineAvailability;
|
|
1
12
|
export type AppValueSchema = {
|
|
2
13
|
type: 'object';
|
|
3
14
|
properties: Record<string, AppValueSchema>;
|