@oddington/sdk 0.1.79 → 0.1.81
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 +69 -0
- package/dist/browser.js +4580 -4164
- package/dist/index.js +14 -10
- package/dist/types/packages/sdk/src/public.d.ts +14 -1
- package/dist/types/packages/sdk/src/query-definition-types.d.ts +31 -0
- package/dist/types/packages/sdk/src/routine-reference-types.d.ts +90 -0
- package/dist/types/shared/connection-runtime.d.ts +12 -2
- package/dist/types/shared/connections.d.ts +12 -1
- package/dist/types/shared/routine-ai-contract.d.ts +4 -0
- package/dist/types/shared/routine-ai-error-detail.d.ts +6 -0
- package/dist/types/shared/routine-definition-contract.d.ts +1 -0
- package/dist/types/shared/routine-deployment-contract.d.ts +2 -0
- package/dist/types/shared/routine-error.d.ts +23 -0
- package/dist/types/shared/routine-executable-contract.d.ts +2 -0
- package/dist/types/shared/routine-operation-error.d.ts +10 -0
- package/dist/types/shared/routine-query-contract.d.ts +16 -0
- package/dist/types/shared/routine-query-results.d.ts +41 -0
- package/dist/types/shared/routine-queue-contract.d.ts +30 -0
- package/package.json +1 -1
|
@@ -2,16 +2,25 @@ import type { AskInput, DigestInput, PublicationRequest, PublishedAsk, Published
|
|
|
2
2
|
export type { RoutineSchema, RoutineSchemaValue, RoutineDefinition, RoutineInput, RoutineRuntime, RoutineAccess, RoutineSchedule, RoutineCapabilities, SharedRoutineCapabilities, ResponseCapabilities, ResponseAction, RoutineStep, RoutineSteps, RoutineStepInput, RoutineStepResult, RoutineStepOutput, RoutineArtifactInput, RoutineArtifact, RoutineAI } from './routine-definition-types.js';
|
|
3
3
|
export declare const defineResponse: import('./routine-definition-types.js').DefineResponse;
|
|
4
4
|
export declare const defineRoutine: import('./routine-definition-types.js').DefineRoutine;
|
|
5
|
+
export declare const defineQuery: import('./query-definition-types.js').DefineQuery;
|
|
6
|
+
export declare const routines: import('./routine-reference-types.js').Routines;
|
|
7
|
+
export { RoutineOperationError } from '../../../shared/routine-operation-error.js';
|
|
8
|
+
export type { RoutineOperationCode } from '../../../shared/routine-operation-error.js';
|
|
9
|
+
export type { QueueItem, QueueState, QueueSummary, QueryDescription, QueryExecution, QueryExecutionPage, RoutineListOptions, RoutineRunHandle, RoutineQueryReference, QueryExecutionHandle } from './routine-reference-types.js';
|
|
10
|
+
export type { QueryDefinition, QueryEntry, QueryRuntime, QueryTrigger, QueryTriggerContext } from './query-definition-types.js';
|
|
11
|
+
export type { RoutineReference, RoutineQueueReference } from './routine-reference-types.js';
|
|
5
12
|
export declare const schema: import('./routine-definition-types.js').RoutineSchemaBuilders;
|
|
6
13
|
export declare const file: import('./routine-definition-types.js').RoutineFileSchema;
|
|
7
14
|
export { AIError, RoutineAIError } from '../../../shared/routine-ai-contract.js';
|
|
15
|
+
export { RoutineError } from '../../../shared/routine-error.js';
|
|
16
|
+
export type { RoutineErrorOptions } from '../../../shared/routine-error.js';
|
|
8
17
|
export type { RoutineAIOutputIssue } from '../../../shared/routine-ai-output-detail.js';
|
|
9
18
|
export type { RoutineAIErrorDetail } from '../../../shared/routine-ai-error-detail.js';
|
|
10
19
|
export { InboxContractError, asksBlock, continueAsk, defineHandler, fileBlock, question, recordBlock, recordsBlock, resolveAsk, respond, richTextBlock, selection, } from '../../../shared/inbox-contract.js';
|
|
11
20
|
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
21
|
export { AirtableOperationError } from '../../../shared/airtable-contract.js';
|
|
13
22
|
export type { AirtableField, AirtableTable, AirtableRecord, AirtableListInput, AirtableGetInput, AirtableCreateInput, AirtableUpdateInput, AirtableDeleteInput, AirtableReceipt, AirtableWriteResult, AirtableClient } from '../../../shared/airtable-contract.js';
|
|
14
|
-
export type { GmailRuntimeConnection, AirtableRuntimeConnection, DropboxRuntimeConnection, OutlookRuntimeConnection, SharePointRuntimeConnection, RuntimeConnection, RuntimeConnectionFor } from '../../../shared/connection-runtime.js';
|
|
23
|
+
export type { XeroRuntimeConnection, GmailRuntimeConnection, AirtableRuntimeConnection, DropboxRuntimeConnection, OutlookRuntimeConnection, SharePointRuntimeConnection, RuntimeConnection, RuntimeConnectionFor } from '../../../shared/connection-runtime.js';
|
|
15
24
|
export type { Connections } from '../../../shared/airtable-contract.js';
|
|
16
25
|
export declare const connections: import('../../../shared/airtable-contract.js').Connections;
|
|
17
26
|
export { DataOperationError } from '../../../shared/data-contract.js';
|
|
@@ -219,6 +228,10 @@ export type RunFailure = {
|
|
|
219
228
|
} | import('../../../shared/routine-step-output.js').RoutineStepOutputFailure | {
|
|
220
229
|
code: import('../../../shared/connection-acquisition.js').ConnectionAcquisitionCode;
|
|
221
230
|
detail: import('../../../shared/connection-error.js').ConnectionFailureDetail;
|
|
231
|
+
} | {
|
|
232
|
+
code: string;
|
|
233
|
+
retryable: boolean;
|
|
234
|
+
detail?: never;
|
|
222
235
|
});
|
|
223
236
|
export type RunHandle = {
|
|
224
237
|
current(): Promise<RunSummary>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RoutineAccess, RoutineInput, SharedRoutineCapabilities } from './routine-definition-types.js';
|
|
2
|
+
import type { RoutineSchedule } from '../../../shared/routine-schedule.js';
|
|
3
|
+
import type { RoutineQueueReference } from './routine-reference-types.js';
|
|
4
|
+
export type QueryTrigger = {
|
|
5
|
+
readonly schedule: RoutineSchedule;
|
|
6
|
+
};
|
|
7
|
+
export type QueryTriggerContext = {
|
|
8
|
+
readonly type: 'manual';
|
|
9
|
+
} | {
|
|
10
|
+
readonly type: 'schedule';
|
|
11
|
+
readonly scheduledAt: string;
|
|
12
|
+
};
|
|
13
|
+
export type QueryEntry<Input = unknown> = {
|
|
14
|
+
readonly idempotencyKey: string;
|
|
15
|
+
readonly input: RoutineInput<Input>;
|
|
16
|
+
};
|
|
17
|
+
export type QueryRuntime<Access extends RoutineAccess = RoutineAccess> = SharedRoutineCapabilities<Access> & {
|
|
18
|
+
readonly query: {
|
|
19
|
+
progress(value: {
|
|
20
|
+
total: number;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type QueryDefinition<Input = unknown, Access extends RoutineAccess = RoutineAccess, Id extends string = string> = {
|
|
25
|
+
readonly id: Id;
|
|
26
|
+
readonly queue: RoutineQueueReference<Input>;
|
|
27
|
+
readonly triggers: readonly QueryTrigger[];
|
|
28
|
+
readonly access?: Access;
|
|
29
|
+
readonly run: (trigger: QueryTriggerContext, os: QueryRuntime<Access>) => AsyncIterable<readonly QueryEntry<NoInfer<Input>>[]>;
|
|
30
|
+
};
|
|
31
|
+
export type DefineQuery = <Input, const Access extends RoutineAccess = {}, const Id extends string = string>(definition: QueryDefinition<Input, Access, Id>) => QueryDefinition<Input, Access, Id>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { RoutineSchema, RoutineSchemaValue } from './routine-definition-types.js';
|
|
2
|
+
import type { QueueItem, QueueState, QueueSummary } from '../../../shared/routine-queue-contract.js';
|
|
3
|
+
import type { QueryDescription, QueryExecution, QueryExecutionPage } from '../../../shared/routine-query-results.js';
|
|
4
|
+
import type { RunHandle, RunSummary, StepDetail } from './public.js';
|
|
5
|
+
export type { QueueItem, QueueState, QueueSummary } from '../../../shared/routine-queue-contract.js';
|
|
6
|
+
export type { QueryDescription, QueryExecution, QueryExecutionPage } from '../../../shared/routine-query-results.js';
|
|
7
|
+
export type RoutineListOptions = {
|
|
8
|
+
limit?: number;
|
|
9
|
+
after?: string;
|
|
10
|
+
};
|
|
11
|
+
export type RoutineRunHandle<Result = unknown> = {
|
|
12
|
+
current(): Promise<Omit<RunSummary, 'result'> & {
|
|
13
|
+
result?: Result;
|
|
14
|
+
}>;
|
|
15
|
+
watch(): AsyncIterable<Omit<RunSummary, 'result'> & {
|
|
16
|
+
result?: Result;
|
|
17
|
+
}>;
|
|
18
|
+
step(id: string): Promise<StepDetail>;
|
|
19
|
+
};
|
|
20
|
+
export type QueryExecutionHandle = {
|
|
21
|
+
current(): Promise<QueryExecution>;
|
|
22
|
+
watch(): AsyncIterable<QueryExecution>;
|
|
23
|
+
};
|
|
24
|
+
export type RoutineQueryReference = {
|
|
25
|
+
current(): Promise<QueryDescription>;
|
|
26
|
+
run(): Promise<QueryExecutionHandle>;
|
|
27
|
+
executions: {
|
|
28
|
+
list(options?: RoutineListOptions): Promise<QueryExecutionPage>;
|
|
29
|
+
get(id: string): QueryExecutionHandle;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
declare const queueInput: unique symbol;
|
|
33
|
+
declare const routineResult: unique symbol;
|
|
34
|
+
/** A destination identity, carrying types but no workspace or authority. */
|
|
35
|
+
export type RoutineQueueReference<Input = unknown, Id extends string = string> = {
|
|
36
|
+
readonly routineId: Id;
|
|
37
|
+
readonly [queueInput]: Input;
|
|
38
|
+
current(): Promise<QueueSummary>;
|
|
39
|
+
pause(): Promise<QueueSummary>;
|
|
40
|
+
resume(): Promise<QueueSummary>;
|
|
41
|
+
list(options?: RoutineListOptions & {
|
|
42
|
+
states?: readonly QueueState[];
|
|
43
|
+
}): Promise<{
|
|
44
|
+
items: QueueItem[];
|
|
45
|
+
next?: string;
|
|
46
|
+
}>;
|
|
47
|
+
get(id: string): Promise<QueueItem>;
|
|
48
|
+
add(input: Input, options?: {
|
|
49
|
+
idempotencyKey?: string;
|
|
50
|
+
}): Promise<QueueItem & {
|
|
51
|
+
input: Input;
|
|
52
|
+
}>;
|
|
53
|
+
remove(id: string): Promise<QueueItem>;
|
|
54
|
+
retry(id: string, options: {
|
|
55
|
+
failureId: string;
|
|
56
|
+
}): Promise<QueueItem>;
|
|
57
|
+
};
|
|
58
|
+
export type RoutineReference<Input = unknown, Result = unknown, Id extends string = string> = {
|
|
59
|
+
readonly id: Id;
|
|
60
|
+
readonly queue: RoutineQueueReference<Input, Id>;
|
|
61
|
+
readonly [routineResult]?: Result;
|
|
62
|
+
run(input?: Input): Promise<RoutineRunHandle<Result>>;
|
|
63
|
+
readonly queries: {
|
|
64
|
+
list(): Promise<QueryDescription[]>;
|
|
65
|
+
get(id: string): RoutineQueryReference;
|
|
66
|
+
};
|
|
67
|
+
readonly runs: {
|
|
68
|
+
list(): Promise<RunSummary[]>;
|
|
69
|
+
get(id: string): Promise<RunHandle>;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
type ReferenceDefinition = {
|
|
73
|
+
readonly id: string;
|
|
74
|
+
readonly input?: RoutineSchema<unknown>;
|
|
75
|
+
readonly result?: RoutineSchema<unknown>;
|
|
76
|
+
readonly run: (...args: any[]) => unknown;
|
|
77
|
+
};
|
|
78
|
+
type ReferenceFor<Definition extends ReferenceDefinition> = Omit<RoutineReference<[
|
|
79
|
+
NonNullable<Definition['input']>
|
|
80
|
+
] extends [never] ? Record<string, never> : RoutineSchemaValue<NonNullable<Definition['input']>>, [
|
|
81
|
+
NonNullable<Definition['result']>
|
|
82
|
+
] extends [never] ? undefined : RoutineSchemaValue<NonNullable<Definition['result']>>, Definition['id']>, 'run'> & {
|
|
83
|
+
run(...input: Definition['input'] extends undefined | RoutineSchema<unknown, true> ? [input?: [NonNullable<Definition['input']>] extends [never] ? Record<string, never> : RoutineSchemaValue<NonNullable<Definition['input']>>] : [input: RoutineSchemaValue<NonNullable<Definition['input']>>]): Promise<RoutineRunHandle<[
|
|
84
|
+
NonNullable<Definition['result']>
|
|
85
|
+
] extends [never] ? undefined : RoutineSchemaValue<NonNullable<Definition['result']>>>>;
|
|
86
|
+
};
|
|
87
|
+
export type Routines = {
|
|
88
|
+
get(id: string): RoutineReference;
|
|
89
|
+
get<Definition extends ReferenceDefinition>(id: Definition['id']): ReferenceFor<Definition>;
|
|
90
|
+
};
|
|
@@ -44,5 +44,15 @@ export type SharePointRuntimeConnection = {
|
|
|
44
44
|
accessToken: string;
|
|
45
45
|
expiresAt: string;
|
|
46
46
|
};
|
|
47
|
-
export type
|
|
48
|
-
|
|
47
|
+
export type XeroRuntimeConnection = {
|
|
48
|
+
id: `xero/${string}`;
|
|
49
|
+
provider: 'xero';
|
|
50
|
+
name: string;
|
|
51
|
+
tenantId: string;
|
|
52
|
+
tenantName: string;
|
|
53
|
+
scopes: string[];
|
|
54
|
+
accessToken: string;
|
|
55
|
+
expiresAt: string;
|
|
56
|
+
};
|
|
57
|
+
export type RuntimeConnection = GmailRuntimeConnection | AirtableRuntimeConnection | DropboxRuntimeConnection | OutlookRuntimeConnection | SharePointRuntimeConnection | XeroRuntimeConnection;
|
|
58
|
+
export type RuntimeConnectionFor<Name extends string> = string extends Name ? RuntimeConnection : Name extends `gmail/${string}` ? GmailRuntimeConnection : Name extends `airtable/${string}` ? AirtableRuntimeConnection : Name extends `dropbox/${string}` ? DropboxRuntimeConnection : Name extends `outlook/${string}` ? OutlookRuntimeConnection : Name extends `sharepoint/${string}` ? SharePointRuntimeConnection : Name extends `xero/${string}` ? XeroRuntimeConnection : never;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
/** Public connection metadata only. No credentials, Vault references, or signers. */
|
|
2
|
-
export type ConnectionProvider = 'github' | 'gmail' | 'airtable' | 'dropbox' | 'outlook' | 'sharepoint';
|
|
2
|
+
export type ConnectionProvider = 'github' | 'gmail' | 'airtable' | 'dropbox' | 'outlook' | 'sharepoint' | 'xero';
|
|
3
3
|
export interface ConnectionConfig {
|
|
4
|
+
xero: {
|
|
5
|
+
clientId: string;
|
|
6
|
+
xeroConnectionId: string;
|
|
7
|
+
tenantId: string;
|
|
8
|
+
tenantName: string;
|
|
9
|
+
scopes: string[];
|
|
10
|
+
};
|
|
4
11
|
github: {
|
|
5
12
|
installationId: number;
|
|
6
13
|
accountId: number;
|
|
@@ -71,6 +78,10 @@ export declare function canonicalSharePointSiteUrl(value: unknown): string | und
|
|
|
71
78
|
export declare function validSharePointSiteId(value: unknown, siteUrl: string): value is string;
|
|
72
79
|
/** Explicit Google scope identifiers, not a permission policy or read-only default. */
|
|
73
80
|
export declare function validGoogleScopes(value: unknown): value is string[];
|
|
81
|
+
export declare const XERO_SCOPES: readonly ['offline_access', 'accounting.invoices', 'accounting.payments.read', 'accounting.contacts', 'accounting.settings.read'];
|
|
82
|
+
export declare function validXeroScopes(value: unknown): value is string[];
|
|
83
|
+
/** Verified organisation fields shared by saved metadata and safe test results. */
|
|
84
|
+
export declare function validXeroOrganisation(value: unknown): value is Pick<ConnectionConfig['xero'], 'xeroConnectionId' | 'tenantId' | 'tenantName' | 'scopes'>;
|
|
74
85
|
export declare function validConnectionConfig(provider: unknown, value: unknown): boolean;
|
|
75
86
|
/** Stable authorization root, independent of the human-visible App Folder name.
|
|
76
87
|
* App Folder mode must come from verified backend app registration, never input
|
|
@@ -5,6 +5,10 @@ import { type RoutineAIErrorDetail } from './routine-ai-error-detail.js';
|
|
|
5
5
|
* Raw Files have no universal AI byte cap: adapters must measure their final
|
|
6
6
|
* encoded request against their own transport limit before dispatch. */
|
|
7
7
|
export declare const ROUTINE_AI_VALUE_BYTES: number;
|
|
8
|
+
/** The fixed Sonnet 5.5 model accepts up to 128K generated tokens. Keep local
|
|
9
|
+
* and hosted execution at the provider ceiling rather than imposing a smaller
|
|
10
|
+
* OS-only limit. Thinking tokens count toward this same provider budget. */
|
|
11
|
+
export declare const ROUTINE_AI_MAX_OUTPUT_TOKENS = 128000;
|
|
8
12
|
/** Worst-case JSON escaping is six bytes per UTF-8 answer byte, plus framing. */
|
|
9
13
|
export declare const ROUTINE_AI_RESULT_BYTES: number;
|
|
10
14
|
export declare const ROUTINE_AI_EVIDENCE_BYTES: number;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { RoutineAIErrorCode } from './routine-ai-contract.js';
|
|
2
2
|
import { type RoutineAIOutputIssue } from './routine-ai-output-detail.js';
|
|
3
3
|
export type RoutineAIErrorDetail = RoutineAIOutputIssue | {
|
|
4
|
+
reason: 'model_output_limit';
|
|
5
|
+
limit: number;
|
|
6
|
+
} | {
|
|
7
|
+
reason: 'response_transport_limit' | 'accepted_value_limit';
|
|
8
|
+
limitBytes: number;
|
|
9
|
+
} | {
|
|
4
10
|
reason: 'turn_limit';
|
|
5
11
|
limit: number;
|
|
6
12
|
} | {
|
|
@@ -30,6 +30,7 @@ export declare function assertRoutineJson(value: unknown, ancestors?: Set<object
|
|
|
30
30
|
/** Inspect property descriptors before reading authored metadata or functions. */
|
|
31
31
|
export declare function assertRoutineFields(value: unknown, allowed?: string[]): asserts value is Record<string, any>;
|
|
32
32
|
export declare function parseRoutineAccess(value: unknown): RoutineAccess;
|
|
33
|
+
export declare function parseRoutineSchedule(value: unknown): RoutineSchedule;
|
|
33
34
|
export declare function routineScheduleMetadata(value: unknown, input: AppValueSchema, hasDefault: boolean): RoutineSchedule;
|
|
34
35
|
/** Inert report/admission grammar shared with authoring; imports no runtime or
|
|
35
36
|
* capability modules and never constructs executable customer functions. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DeployedRoutineQuery } from './routine-query-contract.js';
|
|
1
2
|
import type { RoutineSourceProvenance } from './routine-source-provenance.js';
|
|
2
3
|
import type { RoutineContract } from './routine-definition-contract.js';
|
|
3
4
|
export declare const ROUTINE_DECLARATION_SCHEMA = "https://schemas.oddington.ai/routine/v1.json";
|
|
@@ -31,6 +32,7 @@ export type RoutineDeploymentSource = {
|
|
|
31
32
|
definition: {
|
|
32
33
|
entry: string;
|
|
33
34
|
contract: RoutineContract;
|
|
35
|
+
queries?: DeployedRoutineQuery[];
|
|
34
36
|
};
|
|
35
37
|
files: Array<{
|
|
36
38
|
path: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const ROUTINE_ERROR_CODE_PATTERN: RegExp;
|
|
2
|
+
export declare const ROUTINE_ERROR_MESSAGE_BYTES = 512;
|
|
3
|
+
export type RoutineErrorOptions = {
|
|
4
|
+
/** Stable lowercase author code for programmatic Run history. */
|
|
5
|
+
code: string;
|
|
6
|
+
/** Fixed member-safe text; never forward a caught error or provider body. */
|
|
7
|
+
message: string;
|
|
8
|
+
/** Advisory classification only. OS does not retry or replay the Run. */
|
|
9
|
+
retryable?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type RoutineErrorDeclaration = {
|
|
12
|
+
code: string;
|
|
13
|
+
message: string;
|
|
14
|
+
retryable: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** Validate the complete bounded declaration retained at Run boundaries. */
|
|
17
|
+
export declare function parseRoutineErrorDeclaration(value: unknown): RoutineErrorDeclaration;
|
|
18
|
+
/** A deliberate, bounded, member-safe processing Run failure. */
|
|
19
|
+
export declare class RoutineError extends Error {
|
|
20
|
+
readonly code: string;
|
|
21
|
+
readonly retryable: boolean;
|
|
22
|
+
constructor(options: RoutineErrorOptions);
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { QueueItem } from './routine-queue-contract.js';
|
|
2
|
+
export type RoutineOperationCode = 'context_unavailable' | 'unauthenticated' | 'forbidden' | 'not_found' | 'invalid_input' | 'idempotency_conflict' | 'failure_changed' | 'invalid_state' | 'unavailable';
|
|
3
|
+
export declare const routineOperationMessages: Record<RoutineOperationCode, string>;
|
|
4
|
+
export declare class RoutineOperationError extends Error {
|
|
5
|
+
readonly code: RoutineOperationCode;
|
|
6
|
+
readonly item?: QueueItem | undefined;
|
|
7
|
+
readonly location?: string | undefined;
|
|
8
|
+
constructor(code: RoutineOperationCode, item?: QueueItem | undefined, location?: string | undefined);
|
|
9
|
+
}
|
|
10
|
+
export declare function routineOperationFailure(value: unknown): RoutineOperationError;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RoutineAccess } from './routine-definition-contract.js';
|
|
2
|
+
import type { RoutineSchedule } from './routine-schedule.js';
|
|
3
|
+
export type RoutineQueryContract = {
|
|
4
|
+
id: string;
|
|
5
|
+
routineId: string;
|
|
6
|
+
access: RoutineAccess;
|
|
7
|
+
triggers: readonly {
|
|
8
|
+
schedule: RoutineSchedule;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
export type DeployedRoutineQuery = RoutineQueryContract & {
|
|
12
|
+
entry: string;
|
|
13
|
+
exportName: string;
|
|
14
|
+
};
|
|
15
|
+
/** Shared admission/inspection metadata, never an executable or authority source. */
|
|
16
|
+
export declare function parseDeployedRoutineQueries(value: unknown, routineId: string): DeployedRoutineQuery[];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type RoutineAccess } from './routine-definition-contract.js';
|
|
2
|
+
import type { RoutineSchedule } from './routine-schedule.js';
|
|
3
|
+
/** Safe retained member results; executable coordinates and authority stay private. */
|
|
4
|
+
export type QueryExecution = {
|
|
5
|
+
id: string;
|
|
6
|
+
queryId: string;
|
|
7
|
+
deploymentId: string;
|
|
8
|
+
trigger: {
|
|
9
|
+
type: 'manual';
|
|
10
|
+
} | {
|
|
11
|
+
type: 'schedule';
|
|
12
|
+
scheduledAt: string;
|
|
13
|
+
};
|
|
14
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
15
|
+
acceptedAt: string;
|
|
16
|
+
startedAt?: string;
|
|
17
|
+
finishedAt?: string;
|
|
18
|
+
total?: number;
|
|
19
|
+
found: number;
|
|
20
|
+
added: number;
|
|
21
|
+
skipped: number;
|
|
22
|
+
failure?: {
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type QueryDescription = {
|
|
27
|
+
id: string;
|
|
28
|
+
routineId: string;
|
|
29
|
+
access: RoutineAccess;
|
|
30
|
+
triggers: {
|
|
31
|
+
schedule: RoutineSchedule;
|
|
32
|
+
}[];
|
|
33
|
+
latestExecution?: QueryExecution;
|
|
34
|
+
};
|
|
35
|
+
export type QueryExecutionPage = {
|
|
36
|
+
items: QueryExecution[];
|
|
37
|
+
next?: string;
|
|
38
|
+
};
|
|
39
|
+
export declare function parseQueryExecution(value: unknown): QueryExecution;
|
|
40
|
+
export declare function parseQueryDescription(value: unknown): QueryDescription;
|
|
41
|
+
export declare function parseQueryExecutionPage(value: unknown): QueryExecutionPage;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Safe member queue results shared by HTTP and installed transports. */
|
|
2
|
+
export declare const queueStates: readonly ['pending', 'running', 'failed', 'succeeded', 'removed'];
|
|
3
|
+
export type QueueState = typeof queueStates[number];
|
|
4
|
+
export type QueueSummary = {
|
|
5
|
+
routineId: string;
|
|
6
|
+
paused: boolean;
|
|
7
|
+
counts: Record<QueueState, number>;
|
|
8
|
+
activeRunId?: string;
|
|
9
|
+
};
|
|
10
|
+
export type QueueItem = {
|
|
11
|
+
id: string;
|
|
12
|
+
input: unknown;
|
|
13
|
+
idempotencyKey?: string;
|
|
14
|
+
state: QueueState;
|
|
15
|
+
currentRunId?: string;
|
|
16
|
+
associatedRunIds: string[];
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
failureId?: string;
|
|
20
|
+
failure?: {
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type QueuePage = {
|
|
25
|
+
items: QueueItem[];
|
|
26
|
+
next?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare function parseQueueSummary(value: unknown): QueueSummary;
|
|
29
|
+
export declare function parseQueueItem(value: unknown): QueueItem;
|
|
30
|
+
export declare function parseQueuePage(value: unknown): QueuePage;
|