@zapier/zapier-sdk 0.61.0 → 0.63.0
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/CHANGELOG.md +12 -0
- package/README.md +140 -0
- package/dist/experimental.cjs +317 -2
- package/dist/experimental.d.mts +139 -2
- package/dist/experimental.d.ts +137 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +8 -0
- package/dist/experimental.mjs +317 -3
- package/dist/{index-iKbnOz6r.d.mts → index-3fBEDEsp.d.mts} +25 -1
- package/dist/{index-iKbnOz6r.d.ts → index-3fBEDEsp.d.ts} +25 -1
- package/dist/index.cjs +17 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +17 -2
- package/dist/plugins/codeSubstrate/cancelDurableRun/index.d.ts +40 -0
- package/dist/plugins/codeSubstrate/cancelDurableRun/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/cancelDurableRun/index.js +27 -0
- package/dist/plugins/codeSubstrate/cancelDurableRun/schemas.d.ts +11 -0
- package/dist/plugins/codeSubstrate/cancelDurableRun/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/cancelDurableRun/schemas.js +12 -0
- package/dist/plugins/codeSubstrate/getDurableRun/index.d.ts +89 -0
- package/dist/plugins/codeSubstrate/getDurableRun/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getDurableRun/index.js +20 -0
- package/dist/plugins/codeSubstrate/getDurableRun/schemas.d.ts +178 -0
- package/dist/plugins/codeSubstrate/getDurableRun/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getDurableRun/schemas.js +130 -0
- package/dist/plugins/codeSubstrate/listDurableRuns/index.d.ts +55 -0
- package/dist/plugins/codeSubstrate/listDurableRuns/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listDurableRuns/index.js +27 -0
- package/dist/plugins/codeSubstrate/listDurableRuns/schemas.d.ts +73 -0
- package/dist/plugins/codeSubstrate/listDurableRuns/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listDurableRuns/schemas.js +59 -0
- package/dist/plugins/codeSubstrate/runDurable/index.d.ts +53 -0
- package/dist/plugins/codeSubstrate/runDurable/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/runDurable/index.js +36 -0
- package/dist/plugins/codeSubstrate/runDurable/schemas.d.ts +24 -0
- package/dist/plugins/codeSubstrate/runDurable/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/runDurable/schemas.js +61 -0
- package/dist/resolvers/durableRunId.d.ts +4 -0
- package/dist/resolvers/durableRunId.d.ts.map +1 -0
- package/dist/resolvers/durableRunId.js +14 -0
- package/dist/resolvers/index.d.ts +1 -0
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2588,6 +2588,21 @@ var workflowIdResolver = {
|
|
|
2588
2588
|
})
|
|
2589
2589
|
};
|
|
2590
2590
|
|
|
2591
|
+
// src/resolvers/durableRunId.ts
|
|
2592
|
+
var durableRunIdResolver = {
|
|
2593
|
+
type: "dynamic",
|
|
2594
|
+
fetch: async (sdk) => toIterable(sdk.listDurableRuns()),
|
|
2595
|
+
prompt: (runs) => ({
|
|
2596
|
+
type: "list",
|
|
2597
|
+
name: "run",
|
|
2598
|
+
message: "Select a run:",
|
|
2599
|
+
choices: runs.map((run) => ({
|
|
2600
|
+
name: `${run.id} \u2014 ${run.status}`,
|
|
2601
|
+
value: run.id
|
|
2602
|
+
}))
|
|
2603
|
+
})
|
|
2604
|
+
};
|
|
2605
|
+
|
|
2591
2606
|
// src/resolvers/triggerMessages.ts
|
|
2592
2607
|
var triggerMessagesResolver = {
|
|
2593
2608
|
type: "dynamic",
|
|
@@ -6337,7 +6352,7 @@ async function invalidateCredentialsToken(options) {
|
|
|
6337
6352
|
}
|
|
6338
6353
|
|
|
6339
6354
|
// src/sdk-version.ts
|
|
6340
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6355
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.63.0" : void 0) || "unknown";
|
|
6341
6356
|
|
|
6342
6357
|
// src/utils/open-url.ts
|
|
6343
6358
|
var nodePrefix = "node:";
|
|
@@ -9199,4 +9214,4 @@ var registryPlugin = definePlugin((_sdk) => {
|
|
|
9199
9214
|
return {};
|
|
9200
9215
|
});
|
|
9201
9216
|
|
|
9202
|
-
export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DebugPropertySchema, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, definePlugin, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, eventEmissionPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowIdResolver };
|
|
9217
|
+
export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DebugPropertySchema, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, definePlugin, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, durableRunIdResolver, eventEmissionPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowIdResolver };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const cancelDurableRunPlugin: (sdk: {
|
|
2
|
+
context: {
|
|
3
|
+
api: import("../../..").ApiClient;
|
|
4
|
+
resolveCredentials: () => Promise<string | {
|
|
5
|
+
clientId: string;
|
|
6
|
+
clientSecret: string;
|
|
7
|
+
type?: "client_credentials" | undefined;
|
|
8
|
+
baseUrl?: string | undefined;
|
|
9
|
+
scope?: string | undefined;
|
|
10
|
+
} | {
|
|
11
|
+
clientId: string;
|
|
12
|
+
type?: "pkce" | undefined;
|
|
13
|
+
baseUrl?: string | undefined;
|
|
14
|
+
scope?: string | undefined;
|
|
15
|
+
} | undefined>;
|
|
16
|
+
};
|
|
17
|
+
} & {
|
|
18
|
+
context: import("../../eventEmission").EventEmissionContext;
|
|
19
|
+
} & {
|
|
20
|
+
context: {
|
|
21
|
+
meta: Record<string, import("../../..").PluginMeta>;
|
|
22
|
+
};
|
|
23
|
+
}) => {
|
|
24
|
+
cancelDurableRun: (options?: {
|
|
25
|
+
run: string;
|
|
26
|
+
} | undefined) => Promise<{
|
|
27
|
+
data: {
|
|
28
|
+
id: string;
|
|
29
|
+
status: "cancelled";
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
} & {
|
|
33
|
+
context: {
|
|
34
|
+
meta: {
|
|
35
|
+
cancelDurableRun: import("../../..").PluginMeta;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type CancelDurableRunPluginProvides = ReturnType<typeof cancelDurableRunPlugin>;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/cancelDurableRun/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BlC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,UAAU,CACrD,OAAO,sBAAsB,CAC9B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
|
|
2
|
+
import { durableRunIdResolver } from "../../../resolvers/durableRunId";
|
|
3
|
+
import { codeSubstrateDefaults } from "../shared";
|
|
4
|
+
import { CancelDurableRunOptionsSchema } from "./schemas";
|
|
5
|
+
export const cancelDurableRunPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
6
|
+
...codeSubstrateDefaults,
|
|
7
|
+
name: "cancelDurableRun",
|
|
8
|
+
type: "update",
|
|
9
|
+
itemType: "DurableRun",
|
|
10
|
+
inputSchema: CancelDurableRunOptionsSchema,
|
|
11
|
+
resolvers: { run: durableRunIdResolver },
|
|
12
|
+
handler: async ({ sdk, options }) => {
|
|
13
|
+
// Backend returns 204 on success. 404 (run missing) and 409 (run
|
|
14
|
+
// already terminal) propagate as their respective ZapierErrors so
|
|
15
|
+
// callers can distinguish — we don't soft-fold them into a status
|
|
16
|
+
// enum the way deleteWorkflow does, because cancelling an
|
|
17
|
+
// already-terminal run is a meaningfully different outcome that
|
|
18
|
+
// callers may want to surface to users.
|
|
19
|
+
await sdk.context.api.post(`/sdkdurableapi/api/v0/runs/${encodeURIComponent(options.run)}/cancel`, undefined, {
|
|
20
|
+
authRequired: true,
|
|
21
|
+
resource: { type: "run", id: options.run },
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
data: { id: options.run, status: "cancelled" },
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CancelDurableRunOptionsSchema: z.ZodObject<{
|
|
3
|
+
run: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type CancelDurableRunOptions = z.infer<typeof CancelDurableRunOptionsSchema>;
|
|
6
|
+
export declare const CancelDurableRunResponseSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
status: z.ZodLiteral<"cancelled">;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type CancelDurableRunResponse = z.infer<typeof CancelDurableRunResponseSchema>;
|
|
11
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/cancelDurableRun/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,6BAA6B;;iBAMvC,CAAC;AAEJ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;iBAOzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const CancelDurableRunOptionsSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
run: z.string().uuid().describe("Durable run ID"),
|
|
5
|
+
})
|
|
6
|
+
.describe("Cancel a run-once durable run in initialized or started status. Returns 409 if the run is already terminal.");
|
|
7
|
+
export const CancelDurableRunResponseSchema = z.object({
|
|
8
|
+
id: z.string().describe("Run ID that was targeted"),
|
|
9
|
+
status: z
|
|
10
|
+
.literal("cancelled")
|
|
11
|
+
.describe("Always `cancelled` on a successful call. Synthesized client-side — the backend returns 204; callers needing the run's full state should follow up with getDurableRun."),
|
|
12
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export declare const getDurableRunPlugin: (sdk: {
|
|
2
|
+
context: {
|
|
3
|
+
api: import("../../..").ApiClient;
|
|
4
|
+
resolveCredentials: () => Promise<string | {
|
|
5
|
+
clientId: string;
|
|
6
|
+
clientSecret: string;
|
|
7
|
+
type?: "client_credentials" | undefined;
|
|
8
|
+
baseUrl?: string | undefined;
|
|
9
|
+
scope?: string | undefined;
|
|
10
|
+
} | {
|
|
11
|
+
clientId: string;
|
|
12
|
+
type?: "pkce" | undefined;
|
|
13
|
+
baseUrl?: string | undefined;
|
|
14
|
+
scope?: string | undefined;
|
|
15
|
+
} | undefined>;
|
|
16
|
+
};
|
|
17
|
+
} & {
|
|
18
|
+
context: import("../../eventEmission").EventEmissionContext;
|
|
19
|
+
} & {
|
|
20
|
+
context: {
|
|
21
|
+
meta: Record<string, import("../../..").PluginMeta>;
|
|
22
|
+
};
|
|
23
|
+
}) => {
|
|
24
|
+
getDurableRun: (options?: {
|
|
25
|
+
run: string;
|
|
26
|
+
} | undefined) => Promise<{
|
|
27
|
+
data: {
|
|
28
|
+
id: string;
|
|
29
|
+
status: "initialized" | "started" | "finished" | "failed" | "cancelled";
|
|
30
|
+
input: unknown;
|
|
31
|
+
output: unknown;
|
|
32
|
+
error: {
|
|
33
|
+
[x: string]: unknown;
|
|
34
|
+
code: string;
|
|
35
|
+
message: string;
|
|
36
|
+
} | null;
|
|
37
|
+
execution: {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
status: "failed" | "waiting" | "completed" | "running";
|
|
41
|
+
input: unknown;
|
|
42
|
+
created_at: string;
|
|
43
|
+
output?: unknown;
|
|
44
|
+
error?: unknown;
|
|
45
|
+
metadata?: Record<string, unknown> | undefined;
|
|
46
|
+
summary?: {
|
|
47
|
+
[x: string]: unknown;
|
|
48
|
+
total_attempts: number;
|
|
49
|
+
last_error?: {
|
|
50
|
+
[x: string]: unknown;
|
|
51
|
+
code: string;
|
|
52
|
+
title: string;
|
|
53
|
+
detail?: string | null | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
} | null | undefined;
|
|
56
|
+
operations?: {
|
|
57
|
+
id: string;
|
|
58
|
+
execution_id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
type: "step" | "wait" | "callback";
|
|
61
|
+
status: "pending" | "failed" | "exhausted" | "completed";
|
|
62
|
+
retry_count: number;
|
|
63
|
+
created_at: string;
|
|
64
|
+
result?: unknown;
|
|
65
|
+
error?: unknown;
|
|
66
|
+
max_attempts?: number | undefined;
|
|
67
|
+
next_retry_at?: string | undefined;
|
|
68
|
+
resume_at?: string | undefined;
|
|
69
|
+
callback_token?: string | null | undefined;
|
|
70
|
+
payload_schema?: unknown;
|
|
71
|
+
payload?: unknown;
|
|
72
|
+
expires_at?: string | undefined;
|
|
73
|
+
completed_at?: string | undefined;
|
|
74
|
+
}[] | undefined;
|
|
75
|
+
} | null;
|
|
76
|
+
is_private: boolean;
|
|
77
|
+
created_at: string;
|
|
78
|
+
updated_at: string;
|
|
79
|
+
};
|
|
80
|
+
}>;
|
|
81
|
+
} & {
|
|
82
|
+
context: {
|
|
83
|
+
meta: {
|
|
84
|
+
getDurableRun: import("../../..").PluginMeta;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export type GetDurableRunPluginProvides = ReturnType<typeof getDurableRunPlugin>;
|
|
89
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getDurableRun/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqB/B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAClD,OAAO,mBAAmB,CAC3B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
|
|
2
|
+
import { durableRunIdResolver } from "../../../resolvers/durableRunId";
|
|
3
|
+
import { codeSubstrateDefaults } from "../shared";
|
|
4
|
+
import { GetDurableRunOptionsSchema, GetDurableRunResponseSchema, } from "./schemas";
|
|
5
|
+
export const getDurableRunPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
6
|
+
...codeSubstrateDefaults,
|
|
7
|
+
name: "getDurableRun",
|
|
8
|
+
type: "item",
|
|
9
|
+
itemType: "DurableRun",
|
|
10
|
+
inputSchema: GetDurableRunOptionsSchema,
|
|
11
|
+
outputSchema: GetDurableRunResponseSchema,
|
|
12
|
+
resolvers: { run: durableRunIdResolver },
|
|
13
|
+
handler: async ({ sdk, options }) => {
|
|
14
|
+
const data = await sdk.context.api.get(`/sdkdurableapi/api/v0/runs/${encodeURIComponent(options.run)}`, {
|
|
15
|
+
authRequired: true,
|
|
16
|
+
resource: { type: "run", id: options.run },
|
|
17
|
+
});
|
|
18
|
+
return { data };
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const OperationTypeSchema: z.ZodEnum<{
|
|
3
|
+
step: "step";
|
|
4
|
+
wait: "wait";
|
|
5
|
+
callback: "callback";
|
|
6
|
+
}>;
|
|
7
|
+
export type OperationType = z.infer<typeof OperationTypeSchema>;
|
|
8
|
+
export declare const OperationStatusSchema: z.ZodEnum<{
|
|
9
|
+
pending: "pending";
|
|
10
|
+
failed: "failed";
|
|
11
|
+
exhausted: "exhausted";
|
|
12
|
+
completed: "completed";
|
|
13
|
+
}>;
|
|
14
|
+
export type OperationStatus = z.infer<typeof OperationStatusSchema>;
|
|
15
|
+
export declare const OperationSchema: z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
execution_id: z.ZodString;
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
type: z.ZodEnum<{
|
|
20
|
+
step: "step";
|
|
21
|
+
wait: "wait";
|
|
22
|
+
callback: "callback";
|
|
23
|
+
}>;
|
|
24
|
+
status: z.ZodEnum<{
|
|
25
|
+
pending: "pending";
|
|
26
|
+
failed: "failed";
|
|
27
|
+
exhausted: "exhausted";
|
|
28
|
+
completed: "completed";
|
|
29
|
+
}>;
|
|
30
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
31
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
32
|
+
retry_count: z.ZodNumber;
|
|
33
|
+
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
next_retry_at: z.ZodOptional<z.ZodString>;
|
|
35
|
+
resume_at: z.ZodOptional<z.ZodString>;
|
|
36
|
+
callback_token: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
payload_schema: z.ZodOptional<z.ZodUnknown>;
|
|
38
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
39
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
40
|
+
completed_at: z.ZodOptional<z.ZodString>;
|
|
41
|
+
created_at: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export type Operation = z.infer<typeof OperationSchema>;
|
|
44
|
+
export declare const ExecutionStatusSchema: z.ZodEnum<{
|
|
45
|
+
failed: "failed";
|
|
46
|
+
waiting: "waiting";
|
|
47
|
+
completed: "completed";
|
|
48
|
+
running: "running";
|
|
49
|
+
}>;
|
|
50
|
+
export type ExecutionStatus = z.infer<typeof ExecutionStatusSchema>;
|
|
51
|
+
export declare const ExecutionSummarySchema: z.ZodObject<{
|
|
52
|
+
id: z.ZodString;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
status: z.ZodEnum<{
|
|
55
|
+
failed: "failed";
|
|
56
|
+
waiting: "waiting";
|
|
57
|
+
completed: "completed";
|
|
58
|
+
running: "running";
|
|
59
|
+
}>;
|
|
60
|
+
input: z.ZodUnknown;
|
|
61
|
+
output: z.ZodOptional<z.ZodUnknown>;
|
|
62
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
63
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
64
|
+
created_at: z.ZodString;
|
|
65
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
66
|
+
total_attempts: z.ZodNumber;
|
|
67
|
+
last_error: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
code: z.ZodString;
|
|
69
|
+
title: z.ZodString;
|
|
70
|
+
detail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
+
}, z.core.$loose>>;
|
|
72
|
+
}, z.core.$loose>>>;
|
|
73
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
execution_id: z.ZodString;
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
type: z.ZodEnum<{
|
|
78
|
+
step: "step";
|
|
79
|
+
wait: "wait";
|
|
80
|
+
callback: "callback";
|
|
81
|
+
}>;
|
|
82
|
+
status: z.ZodEnum<{
|
|
83
|
+
pending: "pending";
|
|
84
|
+
failed: "failed";
|
|
85
|
+
exhausted: "exhausted";
|
|
86
|
+
completed: "completed";
|
|
87
|
+
}>;
|
|
88
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
89
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
90
|
+
retry_count: z.ZodNumber;
|
|
91
|
+
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
next_retry_at: z.ZodOptional<z.ZodString>;
|
|
93
|
+
resume_at: z.ZodOptional<z.ZodString>;
|
|
94
|
+
callback_token: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
95
|
+
payload_schema: z.ZodOptional<z.ZodUnknown>;
|
|
96
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
97
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
98
|
+
completed_at: z.ZodOptional<z.ZodString>;
|
|
99
|
+
created_at: z.ZodString;
|
|
100
|
+
}, z.core.$strip>>>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export type ExecutionSummary = z.infer<typeof ExecutionSummarySchema>;
|
|
103
|
+
export declare const GetDurableRunOptionsSchema: z.ZodObject<{
|
|
104
|
+
run: z.ZodString;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
export type GetDurableRunOptions = z.infer<typeof GetDurableRunOptionsSchema>;
|
|
107
|
+
export declare const GetDurableRunResponseSchema: z.ZodObject<{
|
|
108
|
+
id: z.ZodString;
|
|
109
|
+
status: z.ZodEnum<{
|
|
110
|
+
initialized: "initialized";
|
|
111
|
+
started: "started";
|
|
112
|
+
finished: "finished";
|
|
113
|
+
failed: "failed";
|
|
114
|
+
cancelled: "cancelled";
|
|
115
|
+
}>;
|
|
116
|
+
input: z.ZodUnknown;
|
|
117
|
+
output: z.ZodNullable<z.ZodUnknown>;
|
|
118
|
+
error: z.ZodNullable<z.ZodObject<{
|
|
119
|
+
code: z.ZodString;
|
|
120
|
+
message: z.ZodString;
|
|
121
|
+
}, z.core.$loose>>;
|
|
122
|
+
execution: z.ZodNullable<z.ZodObject<{
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
name: z.ZodString;
|
|
125
|
+
status: z.ZodEnum<{
|
|
126
|
+
failed: "failed";
|
|
127
|
+
waiting: "waiting";
|
|
128
|
+
completed: "completed";
|
|
129
|
+
running: "running";
|
|
130
|
+
}>;
|
|
131
|
+
input: z.ZodUnknown;
|
|
132
|
+
output: z.ZodOptional<z.ZodUnknown>;
|
|
133
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
134
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
135
|
+
created_at: z.ZodString;
|
|
136
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
137
|
+
total_attempts: z.ZodNumber;
|
|
138
|
+
last_error: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
code: z.ZodString;
|
|
140
|
+
title: z.ZodString;
|
|
141
|
+
detail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
142
|
+
}, z.core.$loose>>;
|
|
143
|
+
}, z.core.$loose>>>;
|
|
144
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
145
|
+
id: z.ZodString;
|
|
146
|
+
execution_id: z.ZodString;
|
|
147
|
+
name: z.ZodString;
|
|
148
|
+
type: z.ZodEnum<{
|
|
149
|
+
step: "step";
|
|
150
|
+
wait: "wait";
|
|
151
|
+
callback: "callback";
|
|
152
|
+
}>;
|
|
153
|
+
status: z.ZodEnum<{
|
|
154
|
+
pending: "pending";
|
|
155
|
+
failed: "failed";
|
|
156
|
+
exhausted: "exhausted";
|
|
157
|
+
completed: "completed";
|
|
158
|
+
}>;
|
|
159
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
160
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
161
|
+
retry_count: z.ZodNumber;
|
|
162
|
+
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
next_retry_at: z.ZodOptional<z.ZodString>;
|
|
164
|
+
resume_at: z.ZodOptional<z.ZodString>;
|
|
165
|
+
callback_token: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
166
|
+
payload_schema: z.ZodOptional<z.ZodUnknown>;
|
|
167
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
168
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
169
|
+
completed_at: z.ZodOptional<z.ZodString>;
|
|
170
|
+
created_at: z.ZodString;
|
|
171
|
+
}, z.core.$strip>>>;
|
|
172
|
+
}, z.core.$strip>>;
|
|
173
|
+
is_private: z.ZodBoolean;
|
|
174
|
+
created_at: z.ZodString;
|
|
175
|
+
updated_at: z.ZodString;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
export type GetDurableRunResponse = z.infer<typeof GetDurableRunResponseSchema>;
|
|
178
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getDurableRun/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB;;;;EAI7B,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,qBAAqB;;;;;EAI/B,CAAC;AAEJ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyD1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,qBAAqB;;;;;EAI/B,CAAC;AAEJ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqDjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,0BAA0B;;iBAMpC,CAAC;AAEJ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RunErrorSchema, RunStatusSchema } from "../listDurableRuns/schemas";
|
|
3
|
+
export const OperationTypeSchema = z
|
|
4
|
+
.enum(["step", "wait", "callback"])
|
|
5
|
+
.describe("Operation kind: `step` is a journaled function call; `wait` is a time-based suspension; `callback` is a wait on an external callback.");
|
|
6
|
+
export const OperationStatusSchema = z
|
|
7
|
+
.enum(["pending", "completed", "failed", "exhausted"])
|
|
8
|
+
.describe("Operation lifecycle status. `exhausted` means retries were exceeded.");
|
|
9
|
+
export const OperationSchema = z.object({
|
|
10
|
+
id: z.string().describe("Operation ID (UUID)"),
|
|
11
|
+
execution_id: z.string().describe("Parent execution ID"),
|
|
12
|
+
name: z
|
|
13
|
+
.string()
|
|
14
|
+
.describe("Operation name as declared by the workflow author"),
|
|
15
|
+
type: OperationTypeSchema,
|
|
16
|
+
status: OperationStatusSchema,
|
|
17
|
+
result: z
|
|
18
|
+
.unknown()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Result value when the operation completed"),
|
|
21
|
+
error: z
|
|
22
|
+
.unknown()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Error payload when the operation failed"),
|
|
25
|
+
retry_count: z.number().describe("Number of retry attempts so far"),
|
|
26
|
+
max_attempts: z
|
|
27
|
+
.number()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Cap on total attempts for this operation. Absent if no cap applies."),
|
|
30
|
+
next_retry_at: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("When the next retry will be attempted (ISO-8601)"),
|
|
34
|
+
resume_at: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("When a `wait` operation resumes (ISO-8601). Set only for type=wait."),
|
|
38
|
+
callback_token: z
|
|
39
|
+
.string()
|
|
40
|
+
.nullable()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("Token for delivering a callback. Set only for type=callback; null until the callback URL is materialized."),
|
|
43
|
+
payload_schema: z
|
|
44
|
+
.unknown()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("JSON Schema describing the expected callback payload"),
|
|
47
|
+
payload: z
|
|
48
|
+
.unknown()
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Payload delivered to a callback operation, when received"),
|
|
51
|
+
expires_at: z
|
|
52
|
+
.string()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("When a callback or wait operation expires (ISO-8601)"),
|
|
55
|
+
completed_at: z
|
|
56
|
+
.string()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("When the operation reached a terminal state (ISO-8601)"),
|
|
59
|
+
created_at: z.string().describe("When the operation was created (ISO-8601)"),
|
|
60
|
+
});
|
|
61
|
+
export const ExecutionStatusSchema = z
|
|
62
|
+
.enum(["running", "waiting", "completed", "failed"])
|
|
63
|
+
.describe("Execution lifecycle status. `waiting` means blocked on a wait or callback operation.");
|
|
64
|
+
export const ExecutionSummarySchema = z.object({
|
|
65
|
+
id: z.string().describe("Execution ID (UUID)"),
|
|
66
|
+
name: z.string().describe("Durable function name"),
|
|
67
|
+
status: ExecutionStatusSchema,
|
|
68
|
+
input: z.unknown().describe("Input passed when the execution was created"),
|
|
69
|
+
output: z
|
|
70
|
+
.unknown()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("Return value when status is `completed`"),
|
|
73
|
+
error: z
|
|
74
|
+
.unknown()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Error details when status is `failed`"),
|
|
77
|
+
metadata: z
|
|
78
|
+
.record(z.string(), z.unknown())
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("Caller-supplied tags (Zap ID, Step ID, Agent ID, etc.) carried alongside the execution"),
|
|
81
|
+
created_at: z.string().describe("When the execution was created (ISO-8601)"),
|
|
82
|
+
summary: z
|
|
83
|
+
.object({
|
|
84
|
+
total_attempts: z
|
|
85
|
+
.number()
|
|
86
|
+
.describe("Total ticks attempted against this execution across all retries"),
|
|
87
|
+
last_error: z
|
|
88
|
+
.object({
|
|
89
|
+
code: z.string().describe("Machine-readable error category"),
|
|
90
|
+
title: z.string().describe("Short error label"),
|
|
91
|
+
detail: z
|
|
92
|
+
.string()
|
|
93
|
+
.nullable()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe("Longer-form error detail, when provided"),
|
|
96
|
+
})
|
|
97
|
+
.passthrough()
|
|
98
|
+
.optional()
|
|
99
|
+
.describe("The most recent error, if the execution has failed once"),
|
|
100
|
+
})
|
|
101
|
+
.passthrough()
|
|
102
|
+
.nullable()
|
|
103
|
+
.optional()
|
|
104
|
+
.describe("Aggregate health summary. Null when no attempts have been recorded yet."),
|
|
105
|
+
operations: z
|
|
106
|
+
.array(OperationSchema)
|
|
107
|
+
.optional()
|
|
108
|
+
.describe("Operations journal — append-only record of every step/wait/callback the execution made"),
|
|
109
|
+
});
|
|
110
|
+
export const GetDurableRunOptionsSchema = z
|
|
111
|
+
.object({
|
|
112
|
+
run: z.string().uuid().describe("Durable run ID"),
|
|
113
|
+
})
|
|
114
|
+
.describe("Get the full state of a run-once durable run, including its operations journal");
|
|
115
|
+
export const GetDurableRunResponseSchema = z.object({
|
|
116
|
+
id: z.string().describe("Run ID (UUID)"),
|
|
117
|
+
status: RunStatusSchema,
|
|
118
|
+
input: z.unknown().describe("Input data passed to the run"),
|
|
119
|
+
output: z
|
|
120
|
+
.unknown()
|
|
121
|
+
.nullable()
|
|
122
|
+
.describe("Return value, present when status is `finished`"),
|
|
123
|
+
error: RunErrorSchema.nullable().describe("Structured error details when the run failed (null otherwise)"),
|
|
124
|
+
execution: ExecutionSummarySchema.nullable().describe("Linked execution, including the operations journal. Null while the run is still in `initialized` state."),
|
|
125
|
+
is_private: z
|
|
126
|
+
.boolean()
|
|
127
|
+
.describe("When true, the run is visible only to the creating user; otherwise visible across the account."),
|
|
128
|
+
created_at: z.string().describe("When the run was created (ISO-8601)"),
|
|
129
|
+
updated_at: z.string().describe("When the run was last updated (ISO-8601)"),
|
|
130
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const listDurableRunsPlugin: (sdk: {
|
|
2
|
+
context: {
|
|
3
|
+
api: import("../../..").ApiClient;
|
|
4
|
+
resolveCredentials: () => Promise<string | {
|
|
5
|
+
clientId: string;
|
|
6
|
+
clientSecret: string;
|
|
7
|
+
type?: "client_credentials" | undefined;
|
|
8
|
+
baseUrl?: string | undefined;
|
|
9
|
+
scope?: string | undefined;
|
|
10
|
+
} | {
|
|
11
|
+
clientId: string;
|
|
12
|
+
type?: "pkce" | undefined;
|
|
13
|
+
baseUrl?: string | undefined;
|
|
14
|
+
scope?: string | undefined;
|
|
15
|
+
} | undefined>;
|
|
16
|
+
};
|
|
17
|
+
} & {
|
|
18
|
+
context: import("../../eventEmission").EventEmissionContext;
|
|
19
|
+
} & {
|
|
20
|
+
context: {
|
|
21
|
+
meta: Record<string, import("../../..").PluginMeta>;
|
|
22
|
+
};
|
|
23
|
+
}) => {
|
|
24
|
+
listDurableRuns: (options?: ({
|
|
25
|
+
pageSize?: number | undefined;
|
|
26
|
+
cursor?: string | undefined;
|
|
27
|
+
maxItems?: number | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
cursor?: string;
|
|
30
|
+
pageSize?: number;
|
|
31
|
+
maxItems?: number;
|
|
32
|
+
}) | undefined) => import("../../..").PaginatedSdkResult<{
|
|
33
|
+
id: string;
|
|
34
|
+
status: "initialized" | "started" | "finished" | "failed" | "cancelled";
|
|
35
|
+
input: unknown;
|
|
36
|
+
output: unknown;
|
|
37
|
+
error: {
|
|
38
|
+
[x: string]: unknown;
|
|
39
|
+
code: string;
|
|
40
|
+
message: string;
|
|
41
|
+
} | null;
|
|
42
|
+
execution_id: string | null;
|
|
43
|
+
is_private: boolean;
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
}>;
|
|
47
|
+
} & {
|
|
48
|
+
context: {
|
|
49
|
+
meta: {
|
|
50
|
+
listDurableRuns: import("../../..").PluginMeta;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export type ListDurableRunsPluginProvides = ReturnType<typeof listDurableRunsPlugin>;
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listDurableRuns/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BjC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,UAAU,CACpD,OAAO,qBAAqB,CAC7B,CAAC"}
|