@zapier/zapier-sdk 0.73.1 → 0.74.1
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 +33 -29
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +5 -0
- package/dist/experimental.cjs +71 -16
- package/dist/experimental.d.mts +10 -2
- package/dist/experimental.d.ts +8 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.mjs +70 -17
- package/dist/{index-D1O7Pcex.d.mts → index-B_Fr4RAt.d.mts} +32 -1
- package/dist/{index-D1O7Pcex.d.ts → index-B_Fr4RAt.d.ts} +32 -1
- package/dist/index.cjs +53 -16
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.mjs +52 -17
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts +4 -0
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts +4 -0
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.js +7 -1
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts +8 -0
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.js +6 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/shared-schemas.d.ts +4 -0
- package/dist/plugins/codeSubstrate/shared-schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/shared-schemas.js +14 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts.map +1 -1
- package/dist/utils/caller-context.d.ts +21 -0
- package/dist/utils/caller-context.d.ts.map +1 -0
- package/dist/utils/caller-context.js +35 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export { createFunction } from "kitcore";
|
|
|
34
34
|
export { createPluginStack, createCorePlugin, addPlugin } from "kitcore";
|
|
35
35
|
export type { FormattedItem, OutputFormatter, Resolver, ArrayResolver, ResolverMetadata, StaticResolver, DynamicResolver, DynamicListResolver, DynamicSearchResolver, FieldsResolver, } from "kitcore";
|
|
36
36
|
export { runInMethodScope, runWithTelemetryContext } from "kitcore";
|
|
37
|
+
export { getCallerContext, runWithCallerContext, type CallerContext, } from "./utils/caller-context";
|
|
37
38
|
export { toSnakeCase, toTitleCase } from "kitcore";
|
|
38
39
|
export { batch } from "./utils/batch-utils";
|
|
39
40
|
export type { BatchOptions } from "./utils/batch-utils";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACV,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAG/C,YAAY,EACV,iCAAiC,EACjC,+BAA+B,EAC/B,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,sCAAsC,CAAC;AAC9C,cAAc,qBAAqB,CAA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iB,EACjB,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,MAAM,EACN,UAAU,EACV,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,2BAA2B,EAC3B,cAAc,GACf,MAAM,SAAS,CAAC;AAKjB,YAAY,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGxD,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,cAAc,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ export { createPluginStack, createCorePlugin, addPlugin } from "kitcore";
|
|
|
36
36
|
// Export method-scope utilities for CLI; `runWithTelemetryContext` is kept
|
|
37
37
|
// as a back-compat alias for the previous name.
|
|
38
38
|
export { runInMethodScope, runWithTelemetryContext } from "kitcore";
|
|
39
|
+
export { getCallerContext, runWithCallerContext, } from "./utils/caller-context";
|
|
39
40
|
// Export string utilities
|
|
40
41
|
export { toSnakeCase, toTitleCase } from "kitcore";
|
|
41
42
|
// Export batch utilities
|
package/dist/index.mjs
CHANGED
|
@@ -473,22 +473,34 @@ function createValidator(schema, { adaptError } = {}) {
|
|
|
473
473
|
};
|
|
474
474
|
}
|
|
475
475
|
var validateOptions = (schema, options, { adaptError } = {}) => parseOrThrow(schema, options, { adaptError });
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
476
|
+
function createAsyncContext() {
|
|
477
|
+
let store = null;
|
|
478
|
+
try {
|
|
479
|
+
store = new AsyncLocalStorage();
|
|
480
|
+
} catch {
|
|
481
|
+
store = null;
|
|
482
|
+
}
|
|
483
|
+
return {
|
|
484
|
+
available: store !== null,
|
|
485
|
+
run(value, fn) {
|
|
486
|
+
return store ? store.run(value, fn) : fn();
|
|
487
|
+
},
|
|
488
|
+
get() {
|
|
489
|
+
return store?.getStore();
|
|
490
|
+
}
|
|
491
|
+
};
|
|
480
492
|
}
|
|
493
|
+
var scope = createAsyncContext();
|
|
481
494
|
function getCurrentScope() {
|
|
482
|
-
|
|
483
|
-
return scopeStore.getStore();
|
|
495
|
+
return scope.get();
|
|
484
496
|
}
|
|
485
497
|
function getCurrentDepth() {
|
|
486
498
|
return getCurrentScope()?.depth ?? 0;
|
|
487
499
|
}
|
|
488
500
|
function runInMethodScope(fn) {
|
|
489
|
-
if (!
|
|
490
|
-
const currentDepth =
|
|
491
|
-
return
|
|
501
|
+
if (!scope.available) return fn();
|
|
502
|
+
const currentDepth = scope.get()?.depth ?? -1;
|
|
503
|
+
return scope.run({ depth: currentDepth + 1 }, fn);
|
|
492
504
|
}
|
|
493
505
|
var runWithTelemetryContext = runInMethodScope;
|
|
494
506
|
function normalizeError(error, adaptError) {
|
|
@@ -3605,10 +3617,10 @@ var tableSortResolver = {
|
|
|
3605
3617
|
// src/plugins/eventEmission/method-metadata.ts
|
|
3606
3618
|
var SCOPE_KEY = "methodMetadata";
|
|
3607
3619
|
function setMethodMetadata(metadata) {
|
|
3608
|
-
const
|
|
3609
|
-
if (!
|
|
3610
|
-
const existing =
|
|
3611
|
-
|
|
3620
|
+
const scope2 = getCurrentScope();
|
|
3621
|
+
if (!scope2) return;
|
|
3622
|
+
const existing = scope2[SCOPE_KEY];
|
|
3623
|
+
scope2[SCOPE_KEY] = { ...existing, ...metadata };
|
|
3612
3624
|
}
|
|
3613
3625
|
function getMethodMetadata() {
|
|
3614
3626
|
return getCurrentScope()?.[SCOPE_KEY];
|
|
@@ -6459,10 +6471,10 @@ function mergeScopes(credentialsScope, requiredScopes) {
|
|
|
6459
6471
|
return [...scopeSet].sort();
|
|
6460
6472
|
}
|
|
6461
6473
|
async function exchangeClientCredentials(options) {
|
|
6462
|
-
const { clientId, clientSecret, baseUrl, scope, requiredScopes, onEvent } = options;
|
|
6474
|
+
const { clientId, clientSecret, baseUrl, scope: scope2, requiredScopes, onEvent } = options;
|
|
6463
6475
|
const fetchFn = options.fetch || globalThis.fetch;
|
|
6464
6476
|
const tokenUrl = getTokenEndpointUrl(baseUrl);
|
|
6465
|
-
const mergedScopes = mergeScopes(
|
|
6477
|
+
const mergedScopes = mergeScopes(scope2, requiredScopes);
|
|
6466
6478
|
const scopeString = mergedScopes.join(" ");
|
|
6467
6479
|
onEvent?.({
|
|
6468
6480
|
type: "auth_exchanging",
|
|
@@ -6727,6 +6739,25 @@ async function invalidateCredentialsToken(options) {
|
|
|
6727
6739
|
}
|
|
6728
6740
|
}
|
|
6729
6741
|
|
|
6742
|
+
// src/utils/caller-context.ts
|
|
6743
|
+
var callerContext = createAsyncContext();
|
|
6744
|
+
function runWithCallerContext(context, fn) {
|
|
6745
|
+
let parent;
|
|
6746
|
+
try {
|
|
6747
|
+
parent = callerContext.get() ?? {};
|
|
6748
|
+
} catch {
|
|
6749
|
+
return fn();
|
|
6750
|
+
}
|
|
6751
|
+
return callerContext.run({ ...parent, ...context }, fn);
|
|
6752
|
+
}
|
|
6753
|
+
function getCallerContext() {
|
|
6754
|
+
try {
|
|
6755
|
+
return callerContext.get() ?? {};
|
|
6756
|
+
} catch {
|
|
6757
|
+
return {};
|
|
6758
|
+
}
|
|
6759
|
+
}
|
|
6760
|
+
|
|
6730
6761
|
// src/api/sse-parser.ts
|
|
6731
6762
|
async function* jsonFrames(source) {
|
|
6732
6763
|
for await (const { data } of source) {
|
|
@@ -6878,7 +6909,7 @@ function parseApprovalReviewStreamPayload(parsed, toolNames) {
|
|
|
6878
6909
|
}
|
|
6879
6910
|
|
|
6880
6911
|
// src/sdk-version.ts
|
|
6881
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6912
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.74.1" : void 0) || "unknown";
|
|
6882
6913
|
|
|
6883
6914
|
// src/utils/open-url.ts
|
|
6884
6915
|
var nodePrefix = "node:";
|
|
@@ -7602,6 +7633,10 @@ var ZapierApiClient = class {
|
|
|
7602
7633
|
headers.set("x-zapier-sdk-package", callerPackage.name);
|
|
7603
7634
|
headers.set("zapier-sdk-package-version", callerPackage.version);
|
|
7604
7635
|
headers.set("x-zapier-sdk-package-version", callerPackage.version);
|
|
7636
|
+
const { packageOperation } = getCallerContext();
|
|
7637
|
+
if (packageOperation) {
|
|
7638
|
+
headers.set("zapier-sdk-package-operation", packageOperation);
|
|
7639
|
+
}
|
|
7605
7640
|
}
|
|
7606
7641
|
}
|
|
7607
7642
|
// Helper to perform HTTP requests with JSON handling
|
|
@@ -10276,4 +10311,4 @@ var registryPlugin = definePlugin((_sdk) => {
|
|
|
10276
10311
|
return {};
|
|
10277
10312
|
});
|
|
10278
10313
|
|
|
10279
|
-
export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, CORE_ERROR_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreErrorCode, 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, addPlugin, 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, createCorePlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierCoreStack, createZapierSdk, createZapierSdkStack, createZapierSdkWithoutRegistry, definePlugin, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, durableRunIdResolver, eventEmissionPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreError, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation2 as logDeprecation, manifestPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings2 as resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runInMethodScope, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError };
|
|
10314
|
+
export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, CORE_ERROR_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreErrorCode, 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, addPlugin, 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, createCorePlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierCoreStack, createZapierSdk, createZapierSdkStack, createZapierSdkWithoutRegistry, definePlugin, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, durableRunIdResolver, eventEmissionPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreError, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation2 as logDeprecation, manifestPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings2 as resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError };
|
|
@@ -40,9 +40,11 @@ export declare const deleteWorkflowPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/deleteWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/deleteWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkChC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,oBAAoB,CAC5B,CAAC"}
|
|
@@ -40,9 +40,11 @@ export declare const disableWorkflowPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/disableWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/disableWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BjC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,UAAU,CACpD,OAAO,qBAAqB,CAC7B,CAAC"}
|
|
@@ -40,9 +40,11 @@ export declare const enableWorkflowPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/enableWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/enableWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BhC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,oBAAoB,CAC5B,CAAC"}
|
|
@@ -40,9 +40,11 @@ export declare const getWorkflowPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -72,9 +74,11 @@ export declare const getWorkflowPlugin: (sdk: {
|
|
|
72
74
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
73
75
|
authentication_id?: string | null | undefined;
|
|
74
76
|
params?: Record<string, unknown> | undefined;
|
|
77
|
+
error?: string | null | undefined;
|
|
75
78
|
}[];
|
|
76
79
|
created_at: string;
|
|
77
80
|
updated_at: string;
|
|
81
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
78
82
|
current_version?: {
|
|
79
83
|
id: string;
|
|
80
84
|
workflow_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflow/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflow/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B7B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -32,6 +32,9 @@ export declare const GetWorkflowResponseSchema: z.ZodObject<{
|
|
|
32
32
|
description: z.ZodNullable<z.ZodString>;
|
|
33
33
|
trigger_url: z.ZodString;
|
|
34
34
|
enabled: z.ZodBoolean;
|
|
35
|
+
disabled_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
36
|
+
trigger_claim_failed: "trigger_claim_failed";
|
|
37
|
+
}>>>;
|
|
35
38
|
is_private: z.ZodBoolean;
|
|
36
39
|
created_by_user_id: z.ZodNullable<z.ZodString>;
|
|
37
40
|
current_version: z.ZodOptional<z.ZodObject<{
|
|
@@ -69,6 +72,7 @@ export declare const GetWorkflowResponseSchema: z.ZodObject<{
|
|
|
69
72
|
releasing: "releasing";
|
|
70
73
|
released: "released";
|
|
71
74
|
}>;
|
|
75
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
76
|
}, z.core.$strip>>;
|
|
73
77
|
created_at: z.ZodString;
|
|
74
78
|
updated_at: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflow/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflow/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;iBAgChC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,wBAAwB;;iBAMlC,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4CpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { AppVersionBindingSchema, ConnectionBindingSchema, WorkflowTriggerSchema, WorkflowVersionTriggerConfigSchema, } from "../shared-schemas";
|
|
2
|
+
import { AppVersionBindingSchema, ConnectionBindingSchema, WorkflowDisabledReasonSchema, WorkflowTriggerSchema, WorkflowVersionTriggerConfigSchema, } from "../shared-schemas";
|
|
3
3
|
export const WorkflowVersionSchema = z.object({
|
|
4
4
|
id: z.string().describe("Workflow version ID (UUID)"),
|
|
5
5
|
workflow_id: z.string().describe("Parent workflow ID"),
|
|
@@ -47,6 +47,12 @@ export const GetWorkflowResponseSchema = z.object({
|
|
|
47
47
|
enabled: z
|
|
48
48
|
.boolean()
|
|
49
49
|
.describe("Whether the workflow currently accepts triggers"),
|
|
50
|
+
// Optional until COSUB-630 ships the field server-side; afterwards the API
|
|
51
|
+
// always sends it (null unless the workflow was system-disabled). Kept
|
|
52
|
+
// independent of per-trigger status+error — see WorkflowDisabledReasonSchema.
|
|
53
|
+
disabled_reason: WorkflowDisabledReasonSchema.nullable()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe("Why the workflow is off, when system-disabled. Null when not system-disabled. Independent of per-trigger claim status: an enabled workflow can still have a failed trigger."),
|
|
50
56
|
is_private: z
|
|
51
57
|
.boolean()
|
|
52
58
|
.describe("Whether the workflow is private to the creating user. False means account-visible."),
|
|
@@ -40,9 +40,11 @@ export declare const getWorkflowRunPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflowRun/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflowRun/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BhC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,oBAAoB,CAC5B,CAAC"}
|
|
@@ -40,9 +40,11 @@ export declare const getWorkflowVersionPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflowVersion/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflowVersion/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BpC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC"}
|
|
@@ -40,9 +40,11 @@ export declare const listWorkflowRunsPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflowRuns/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflowRuns/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsClC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,UAAU,CACrD,OAAO,sBAAsB,CAC9B,CAAC"}
|
|
@@ -40,9 +40,11 @@ export declare const listWorkflowVersionsPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflowVersions/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflowVersions/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCtC,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,UAAU,CACzD,OAAO,0BAA0B,CAClC,CAAC"}
|
|
@@ -44,9 +44,11 @@ export declare const listWorkflowsPlugin: (sdk: {
|
|
|
44
44
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
45
45
|
authentication_id?: string | null | undefined;
|
|
46
46
|
params?: Record<string, unknown> | undefined;
|
|
47
|
+
error?: string | null | undefined;
|
|
47
48
|
}[];
|
|
48
49
|
created_at: string;
|
|
49
50
|
updated_at: string;
|
|
51
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
50
52
|
}>;
|
|
51
53
|
} & {
|
|
52
54
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflows/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflows/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B/B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAClD,OAAO,mBAAmB,CAC3B,CAAC"}
|
|
@@ -5,6 +5,9 @@ export declare const WorkflowItemSchema: z.ZodObject<{
|
|
|
5
5
|
description: z.ZodNullable<z.ZodString>;
|
|
6
6
|
trigger_url: z.ZodString;
|
|
7
7
|
enabled: z.ZodBoolean;
|
|
8
|
+
disabled_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
9
|
+
trigger_claim_failed: "trigger_claim_failed";
|
|
10
|
+
}>>>;
|
|
8
11
|
is_private: z.ZodBoolean;
|
|
9
12
|
created_by_user_id: z.ZodNullable<z.ZodString>;
|
|
10
13
|
current_version_id: z.ZodNullable<z.ZodString>;
|
|
@@ -21,6 +24,7 @@ export declare const WorkflowItemSchema: z.ZodObject<{
|
|
|
21
24
|
releasing: "releasing";
|
|
22
25
|
released: "released";
|
|
23
26
|
}>;
|
|
27
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
28
|
}, z.core.$strip>>;
|
|
25
29
|
created_at: z.ZodString;
|
|
26
30
|
updated_at: z.ZodString;
|
|
@@ -45,6 +49,9 @@ export declare const ListWorkflowsApiResponseSchema: z.ZodObject<{
|
|
|
45
49
|
description: z.ZodNullable<z.ZodString>;
|
|
46
50
|
trigger_url: z.ZodString;
|
|
47
51
|
enabled: z.ZodBoolean;
|
|
52
|
+
disabled_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
53
|
+
trigger_claim_failed: "trigger_claim_failed";
|
|
54
|
+
}>>>;
|
|
48
55
|
is_private: z.ZodBoolean;
|
|
49
56
|
created_by_user_id: z.ZodNullable<z.ZodString>;
|
|
50
57
|
current_version_id: z.ZodNullable<z.ZodString>;
|
|
@@ -61,6 +68,7 @@ export declare const ListWorkflowsApiResponseSchema: z.ZodObject<{
|
|
|
61
68
|
releasing: "releasing";
|
|
62
69
|
released: "released";
|
|
63
70
|
}>;
|
|
71
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
72
|
}, z.core.$strip>>;
|
|
65
73
|
created_at: z.ZodString;
|
|
66
74
|
updated_at: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflows/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflows/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8C7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,0BAA0B;;;;iBAoBuC,CAAC;AAE/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { WorkflowTriggerSchema } from "../shared-schemas";
|
|
2
|
+
import { WorkflowDisabledReasonSchema, WorkflowTriggerSchema, } from "../shared-schemas";
|
|
3
3
|
export const WorkflowItemSchema = z.object({
|
|
4
4
|
id: z.string().describe("Workflow ID (UUID)"),
|
|
5
5
|
name: z.string().describe("Workflow name"),
|
|
@@ -13,6 +13,11 @@ export const WorkflowItemSchema = z.object({
|
|
|
13
13
|
enabled: z
|
|
14
14
|
.boolean()
|
|
15
15
|
.describe("Whether the workflow currently accepts triggers"),
|
|
16
|
+
// Optional until COSUB-630 ships the field server-side; afterwards the API
|
|
17
|
+
// always sends it (null unless the workflow was system-disabled).
|
|
18
|
+
disabled_reason: WorkflowDisabledReasonSchema.nullable()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Why the workflow is off, when system-disabled. Null when not system-disabled."),
|
|
16
21
|
is_private: z
|
|
17
22
|
.boolean()
|
|
18
23
|
.describe("Whether the workflow is private to the creating user. False means account-visible."),
|
|
@@ -40,9 +40,11 @@ export declare const publishWorkflowVersionPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/publishWorkflowVersion/index.ts"],"names":[],"mappings":"AA6CA,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/publishWorkflowVersion/index.ts"],"names":[],"mappings":"AA6CA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DxC,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG,UAAU,CAC3D,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -20,6 +20,9 @@ export declare const WorkflowTriggerStatusSchema: z.ZodEnum<{
|
|
|
20
20
|
releasing: "releasing";
|
|
21
21
|
released: "released";
|
|
22
22
|
}>;
|
|
23
|
+
export declare const WorkflowDisabledReasonSchema: z.ZodEnum<{
|
|
24
|
+
trigger_claim_failed: "trigger_claim_failed";
|
|
25
|
+
}>;
|
|
23
26
|
export declare const WorkflowTriggerSchema: z.ZodObject<{
|
|
24
27
|
selected_api: z.ZodString;
|
|
25
28
|
action: z.ZodString;
|
|
@@ -33,5 +36,6 @@ export declare const WorkflowTriggerSchema: z.ZodObject<{
|
|
|
33
36
|
releasing: "releasing";
|
|
34
37
|
released: "released";
|
|
35
38
|
}>;
|
|
39
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
40
|
}, z.core.$strip>;
|
|
37
41
|
//# sourceMappingURL=shared-schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/codeSubstrate/shared-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;iBAcjC,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;iBAUsC,CAAC;AAK3E,eAAO,MAAM,kCAAkC;;;;;iBAiBsB,CAAC;AAItE,eAAO,MAAM,2BAA2B;;;;;;;EAOtC,CAAC;
|
|
1
|
+
{"version":3,"file":"shared-schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/codeSubstrate/shared-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;iBAcjC,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;iBAUsC,CAAC;AAK3E,eAAO,MAAM,kCAAkC;;;;;iBAiBsB,CAAC;AAItE,eAAO,MAAM,2BAA2B;;;;;;;EAOtC,CAAC;AAOH,eAAO,MAAM,4BAA4B;;EAAmC,CAAC;AAE7E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;iBAgC/B,CAAC"}
|
|
@@ -50,6 +50,12 @@ export const WorkflowTriggerStatusSchema = z.enum([
|
|
|
50
50
|
"released",
|
|
51
51
|
"failed",
|
|
52
52
|
]);
|
|
53
|
+
// Why a workflow is currently off. `trigger_claim_failed` is a system
|
|
54
|
+
// auto-disable; null/absent means the workflow was not system-disabled.
|
|
55
|
+
// Independent of the per-trigger claim status+error: a post-active claim
|
|
56
|
+
// failure (e.g. auth) leaves the workflow enabled with disabled_reason null
|
|
57
|
+
// but its trigger status=failed, so the two signals must not be collapsed.
|
|
58
|
+
export const WorkflowDisabledReasonSchema = z.enum(["trigger_claim_failed"]);
|
|
53
59
|
export const WorkflowTriggerSchema = z
|
|
54
60
|
.object({
|
|
55
61
|
selected_api: z
|
|
@@ -65,5 +71,13 @@ export const WorkflowTriggerSchema = z
|
|
|
65
71
|
.optional()
|
|
66
72
|
.describe("Trigger parameters as a JSON object"),
|
|
67
73
|
status: WorkflowTriggerStatusSchema.describe("Live trigger claim status — whether the trigger is currently subscribed to its source."),
|
|
74
|
+
// Optional until COSUB-630 ships the field server-side; afterwards the API
|
|
75
|
+
// always sends it (null unless status=failed). Already sanitized at write
|
|
76
|
+
// time — surface verbatim.
|
|
77
|
+
error: z
|
|
78
|
+
.string()
|
|
79
|
+
.nullable()
|
|
80
|
+
.optional()
|
|
81
|
+
.describe("Failure reason for the latest claim. Present (non-null) only when status is 'failed'."),
|
|
68
82
|
})
|
|
69
83
|
.describe("Trigger from a workflow's current version, combined with the live claim status.");
|
|
@@ -40,9 +40,11 @@ export declare const triggerWorkflowPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/triggerWorkflow/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/triggerWorkflow/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAKjB;QAAE,OAAO,EAAE;YAAE,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;SAAE,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;CA4DhE,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,UAAU,CACpD,OAAO,qBAAqB,CAC7B,CAAC"}
|
|
@@ -40,9 +40,11 @@ export declare const updateWorkflowPlugin: (sdk: {
|
|
|
40
40
|
status: "failed" | "pending" | "active" | "unclaimed" | "releasing" | "released";
|
|
41
41
|
authentication_id?: string | null | undefined;
|
|
42
42
|
params?: Record<string, unknown> | undefined;
|
|
43
|
+
error?: string | null | undefined;
|
|
43
44
|
}[];
|
|
44
45
|
created_at: string;
|
|
45
46
|
updated_at: string;
|
|
47
|
+
disabled_reason?: "trigger_claim_failed" | null | undefined;
|
|
46
48
|
}>;
|
|
47
49
|
} & {
|
|
48
50
|
context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/updateWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/updateWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkChC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,oBAAoB,CAC5B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface CallerContext {
|
|
2
|
+
packageOperation?: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Run `fn` with the given caller context merged onto any parent context, so
|
|
6
|
+
* the operation that initiated the call (e.g. a CLI command or MCP tool) stays
|
|
7
|
+
* observable through every SDK call it makes.
|
|
8
|
+
*
|
|
9
|
+
* Caller context is telemetry-only: reading the parent scope is wrapped so a
|
|
10
|
+
* broken ALS store can never crash the wrapped command. Errors thrown by `fn`
|
|
11
|
+
* itself are intentionally NOT caught — they propagate.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runWithCallerContext<T>(context: CallerContext, fn: () => T): T;
|
|
14
|
+
/**
|
|
15
|
+
* Read the active caller context, or an empty object outside any caller scope.
|
|
16
|
+
*
|
|
17
|
+
* Read on the outbound HTTP path to set a telemetry header, so a failure here
|
|
18
|
+
* must never break the request — it falls back to an empty context.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getCallerContext(): CallerContext;
|
|
21
|
+
//# sourceMappingURL=caller-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caller-context.d.ts","sourceRoot":"","sources":["../../src/utils/caller-context.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,OAAO,EAAE,aAAa,EACtB,EAAE,EAAE,MAAM,CAAC,GACV,CAAC,CAQH;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAMhD"}
|