@zapier/zapier-sdk 0.60.0 → 0.62.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 +24 -0
- package/README.md +229 -1
- package/dist/experimental.cjs +384 -10
- package/dist/experimental.d.mts +182 -2
- package/dist/experimental.d.ts +180 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +14 -0
- package/dist/experimental.mjs +384 -11
- 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 +19 -9
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +19 -10
- package/dist/plugins/codeSubstrate/createWorkflow/index.d.ts +45 -0
- package/dist/plugins/codeSubstrate/createWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/createWorkflow/index.js +19 -0
- package/dist/plugins/codeSubstrate/createWorkflow/schemas.d.ts +16 -0
- package/dist/plugins/codeSubstrate/createWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/createWorkflow/schemas.js +25 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts +39 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.js +27 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/schemas.d.ts +6 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/schemas.js +6 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts +40 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/index.js +20 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/schemas.d.ts +11 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/schemas.js +12 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts +40 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/index.js +20 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/schemas.d.ts +11 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/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/updateWorkflow/index.d.ts +47 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/index.js +27 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/schemas.d.ts +18 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/schemas.js +30 -0
- package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.js +1 -4
- package/dist/resolvers/clientId.d.ts.map +1 -1
- package/dist/resolvers/clientId.js +2 -4
- 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.cjs
CHANGED
|
@@ -2512,10 +2512,7 @@ var clientCredentialsNameResolver = {
|
|
|
2512
2512
|
// src/resolvers/clientId.ts
|
|
2513
2513
|
var clientIdResolver = {
|
|
2514
2514
|
type: "dynamic",
|
|
2515
|
-
fetch: async (sdk) => {
|
|
2516
|
-
const result = await sdk.listClientCredentials({ maxItems: 100 });
|
|
2517
|
-
return result.data;
|
|
2518
|
-
},
|
|
2515
|
+
fetch: async (sdk) => toIterable(sdk.listClientCredentials({})),
|
|
2519
2516
|
prompt: (credentials) => ({
|
|
2520
2517
|
type: "list",
|
|
2521
2518
|
name: "clientId",
|
|
@@ -2593,6 +2590,21 @@ var workflowIdResolver = {
|
|
|
2593
2590
|
})
|
|
2594
2591
|
};
|
|
2595
2592
|
|
|
2593
|
+
// src/resolvers/durableRunId.ts
|
|
2594
|
+
var durableRunIdResolver = {
|
|
2595
|
+
type: "dynamic",
|
|
2596
|
+
fetch: async (sdk) => toIterable(sdk.listDurableRuns()),
|
|
2597
|
+
prompt: (runs) => ({
|
|
2598
|
+
type: "list",
|
|
2599
|
+
name: "run",
|
|
2600
|
+
message: "Select a run:",
|
|
2601
|
+
choices: runs.map((run) => ({
|
|
2602
|
+
name: `${run.id} \u2014 ${run.status}`,
|
|
2603
|
+
value: run.id
|
|
2604
|
+
}))
|
|
2605
|
+
})
|
|
2606
|
+
};
|
|
2607
|
+
|
|
2596
2608
|
// src/resolvers/triggerMessages.ts
|
|
2597
2609
|
var triggerMessagesResolver = {
|
|
2598
2610
|
type: "dynamic",
|
|
@@ -4274,10 +4286,7 @@ var deleteClientCredentialsPlugin = definePlugin(
|
|
|
4274
4286
|
{
|
|
4275
4287
|
authRequired: true,
|
|
4276
4288
|
requiredScopes: ["credentials"],
|
|
4277
|
-
resource: {
|
|
4278
|
-
type: "client-credential",
|
|
4279
|
-
id: options.clientId
|
|
4280
|
-
}
|
|
4289
|
+
resource: { type: "client-credential", id: options.clientId }
|
|
4281
4290
|
}
|
|
4282
4291
|
);
|
|
4283
4292
|
return { success: true };
|
|
@@ -6345,7 +6354,7 @@ async function invalidateCredentialsToken(options) {
|
|
|
6345
6354
|
}
|
|
6346
6355
|
|
|
6347
6356
|
// src/sdk-version.ts
|
|
6348
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6357
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.62.0" : void 0) || "unknown";
|
|
6349
6358
|
|
|
6350
6359
|
// src/utils/open-url.ts
|
|
6351
6360
|
var nodePrefix = "node:";
|
|
@@ -9318,6 +9327,7 @@ exports.deleteClientCredentialsPlugin = deleteClientCredentialsPlugin;
|
|
|
9318
9327
|
exports.deleteTableFieldsPlugin = deleteTableFieldsPlugin;
|
|
9319
9328
|
exports.deleteTablePlugin = deleteTablePlugin;
|
|
9320
9329
|
exports.deleteTableRecordsPlugin = deleteTableRecordsPlugin;
|
|
9330
|
+
exports.durableRunIdResolver = durableRunIdResolver;
|
|
9321
9331
|
exports.eventEmissionPlugin = eventEmissionPlugin;
|
|
9322
9332
|
exports.fetchPlugin = fetchPlugin;
|
|
9323
9333
|
exports.findFirstConnectionPlugin = findFirstConnectionPlugin;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { u as Action, d as ActionEntry, bZ as ActionExecutionOptions, y as ActionExecutionResult, z as ActionField, H as ActionFieldChoice, aB as ActionItem, bc as ActionKeyProperty, aM as ActionKeyPropertySchema, bd as ActionProperty, aN as ActionPropertySchema, as as ActionResolverItem, bo as ActionTimeoutMsProperty, aY as ActionTimeoutMsPropertySchema, at as ActionTypeItem, bb as ActionTypeProperty, aL as ActionTypePropertySchema, b as AddActionEntryOptions, c as AddActionEntryResult, A as ApiClient, bB as ApiError,
|
|
1
|
+
export { u as Action, d as ActionEntry, bZ as ActionExecutionOptions, y as ActionExecutionResult, z as ActionField, H as ActionFieldChoice, aB as ActionItem, bc as ActionKeyProperty, aM as ActionKeyPropertySchema, bd as ActionProperty, aN as ActionPropertySchema, as as ActionResolverItem, bo as ActionTimeoutMsProperty, aY as ActionTimeoutMsPropertySchema, at as ActionTypeItem, bb as ActionTypeProperty, aL as ActionTypePropertySchema, b as AddActionEntryOptions, c as AddActionEntryResult, A as ApiClient, bB as ApiError, dk as ApiEvent, cH as ApiPluginOptions, cJ as ApiPluginProvides, v as App, b_ as AppFactoryInput, az as AppItem, b9 as AppKeyProperty, aJ as AppKeyPropertySchema, ba as AppProperty, aK as AppPropertySchema, eu as ApplicationLifecycleEventData, bS as ApprovalStatus, bY as AppsPluginProvides, bt as AppsProperty, b1 as AppsPropertySchema, a0 as ArrayResolver, dj as AuthEvent, bh as AuthenticationIdProperty, aQ as AuthenticationIdPropertySchema, eC as BaseEvent, al as BaseSdkOptionsSchema, aa as BatchOptions, cu as CONTEXT_CACHE_MAX_SIZE, ct as CONTEXT_CACHE_TTL_MS, x as Choice, dr as ClientCredentialsObject, dC as ClientCredentialsObjectSchema, K as Connection, dK as ConnectionEntry, dJ as ConnectionEntrySchema, bf as ConnectionIdProperty, aP as ConnectionIdPropertySchema, aA as ConnectionItem, bg as ConnectionProperty, aR as ConnectionPropertySchema, dM as ConnectionsMap, dL as ConnectionsMapSchema, dO as ConnectionsPluginProvides, bv as ConnectionsProperty, b3 as ConnectionsPropertySchema, O as ConnectionsResponse, cg as CreateClientCredentialsPluginProvides, ec as CreateTableFieldsPluginProvides, e6 as CreateTablePluginProvides, ek as CreateTableRecordsPluginProvides, dn as Credentials, dH as CredentialsFunction, dG as CredentialsFunctionSchema, dq as CredentialsObject, dE as CredentialsObjectSchema, dI as CredentialsSchema, dT as DEFAULT_ACTION_TIMEOUT_MS, d$ as DEFAULT_APPROVAL_TIMEOUT_MS, cD as DEFAULT_CONFIG_PATH, e0 as DEFAULT_MAX_APPROVAL_RETRIES, dS as DEFAULT_PAGE_SIZE, bm as DebugProperty, aW as DebugPropertySchema, ci as DeleteClientCredentialsPluginProvides, ee as DeleteTableFieldsPluginProvides, e8 as DeleteTablePluginProvides, em as DeleteTableRecordsPluginProvides, o as DrainTriggerInboxCallback, p as DrainTriggerInboxErrorObserver, D as DrainTriggerInboxOptions, a3 as DynamicListResolver, i as DynamicResolver, a4 as DynamicSearchResolver, ev as EnhancedErrorEventData, bC as ErrorOptions, dm as EventCallback, et as EventContext, eq as EventEmissionConfig, E as EventEmissionContext, es as EventEmissionProvides, c0 as FetchPluginProvides, w as Field, bs as FieldsProperty, b0 as FieldsPropertySchema, a5 as FieldsResolver, F as FieldsetItem, s as FindFirstAuthenticationPluginProvides, cq as FindFirstConnectionPluginProvides, t as FindUniqueAuthenticationPluginProvides, cs as FindUniqueConnectionPluginProvides, Y as FormatMetadata, X as FormattedItem, ak as FunctionDeprecation, aG as FunctionOptions, aj as FunctionRegistryEntry, ca as GetActionInputFieldsSchemaPluginProvides, cm as GetActionPluginProvides, ck as GetAppPluginProvides, G as GetAuthenticationPluginProvides, co as GetConnectionPluginProvides, cG as GetProfilePluginProvides, e4 as GetTablePluginProvides, eg as GetTableRecordPluginProvides, aD as InfoFieldItem, aC as InputFieldItem, be as InputFieldProperty, aO as InputFieldPropertySchema, bi as InputsProperty, aS as InputsPropertySchema, bA as LeaseLimitProperty, b8 as LeaseLimitPropertySchema, by as LeaseProperty, b6 as LeasePropertySchema, bz as LeaseSecondsProperty, b7 as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bj as LimitProperty, aT as LimitPropertySchema, c8 as ListActionInputFieldChoicesPluginProvides, c6 as ListActionInputFieldsPluginProvides, c4 as ListActionsPluginProvides, c2 as ListAppsPluginProvides, q as ListAuthenticationsPluginProvides, ce as ListClientCredentialsPluginProvides, cc as ListConnectionsPluginProvides, ea as ListTableFieldsPluginProvides, ei as ListTableRecordsPluginProvides, e2 as ListTablesPluginProvides, dl as LoadingEvent, dW as MAX_CONCURRENCY_LIMIT, dR as MAX_PAGE_LIMIT, M as Manifest, cE as ManifestEntry, cz as ManifestPluginOptions, cC as ManifestPluginProvides, eD as MethodCalledEvent, ew as MethodCalledEventData, N as Need, I as NeedsRequest, J as NeedsResponse, bk as OffsetProperty, aU as OffsetPropertySchema, _ as OutputFormatter, bl as OutputProperty, aV as OutputPropertySchema, aI as PaginatedSdkFunction, e as PaginatedSdkResult, bn as ParamsProperty, aX as ParamsPropertySchema, ds as PkceCredentialsObject, dD as PkceCredentialsObjectSchema, am as Plugin, P as PluginMeta, an as PluginProvides, aw as PollOptions, g as PositionalMetadata, bQ as RateLimitInfo, bq as RecordProperty, a_ as RecordPropertySchema, br as RecordsProperty, a$ as RecordsPropertySchema, af as RelayFetchSchema, ae as RelayRequestSchema, av as RequestOptions, cy as RequestPluginProvides, d6 as ResolveAuthTokenOptions, dx as ResolveCredentialsOptions, R as ResolvedAppLocator, dp as ResolvedCredentials, dF as ResolvedCredentialsSchema, $ as Resolver, a1 as ResolverMetadata, aE as RootFieldItem, cw as RunActionPluginProvides, di as SdkEvent, aH as SdkPage, a2 as StaticResolver, bp as TableProperty, aZ as TablePropertySchema, bu as TablesProperty, b2 as TablesPropertySchema, bx as TriggerInboxNameProperty, b5 as TriggerInboxNamePropertySchema, bw as TriggerInboxProperty, b4 as TriggerInboxPropertySchema, T as TriggerMessageStatus, U as UpdateManifestEntryOptions, a as UpdateManifestEntryResult, eo as UpdateTableRecordsPluginProvides, Q as UserProfile, aF as UserProfileItem, j as WatchTriggerInboxOptions, W as WithAddPlugin, dP as ZAPIER_BASE_URL, dY as ZAPIER_MAX_CONCURRENT_REQUESTS, dU as ZAPIER_MAX_NETWORK_RETRIES, dV as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, m as ZapierAbortDrainSignal, bO as ZapierActionError, bE as ZapierApiError, bF as ZapierAppNotFoundError, bT as ZapierApprovalError, bI as ZapierAuthenticationError, bM as ZapierBundleError, de as ZapierCache, df as ZapierCacheEntry, dg as ZapierCacheSetOptions, bL as ZapierConfigurationError, bP as ZapierConflictError, bD as ZapierError, h as ZapierFetchInitOptions, bJ as ZapierNotFoundError, bR as ZapierRateLimitError, bU as ZapierRelayError, n as ZapierReleaseTriggerMessageSignal, bK as ZapierResourceNotFoundError, eO as ZapierSdk, l as ZapierSdkApps, Z as ZapierSdkOptions, bW as ZapierSignal, bN as ZapierTimeoutError, bH as ZapierUnknownError, bG as ZapierValidationError, cM as actionKeyResolver, cL as actionTypeResolver, cI as apiPlugin, cK as appKeyResolver, bX as appsPlugin, cO as authenticationIdGenericResolver, cN as authenticationIdResolver, a9 as batch, ex as buildApplicationLifecycleEvent, ab as buildCapabilityMessage, ez as buildErrorEvent, ey as buildErrorEventWithContext, eB as buildMethodCalledEvent, ep as cleanupEventListeners, d7 as clearTokenCache, cS as clientCredentialsNameResolver, cT as clientIdResolver, ar as composePlugins, cO as connectionIdGenericResolver, cN as connectionIdResolver, dN as connectionsPlugin, eA as createBaseEvent, cf as createClientCredentialsPlugin, V as createFunction, dh as createMemoryCache, ai as createOptionsPlugin, aq as createPaginatedPluginMethod, ap as createPluginMethod, ah as createSdk, eb as createTableFieldsPlugin, e5 as createTablePlugin, ej as createTableRecordsPlugin, ax as createZapierApi, eN as createZapierSdk, ag as createZapierSdkWithoutRegistry, ao as definePlugin, ch as deleteClientCredentialsPlugin, ed as deleteTableFieldsPlugin, e7 as deleteTablePlugin, el as deleteTableRecordsPlugin, cX as durableRunIdResolver, er as eventEmissionPlugin, b$ as fetchPlugin, cp as findFirstConnectionPlugin, f as findManifestEntry, cr as findUniqueConnectionPlugin, bV as formatErrorMessage, eE as generateEventId, c9 as getActionInputFieldsSchemaPlugin, cl as getActionPlugin, cj as getAppPlugin, dA as getBaseUrlFromCredentials, eK as getCiPlatform, dB as getClientIdFromCredentials, cn as getConnectionPlugin, eM as getCpuTime, eF as getCurrentTimestamp, eL as getMemoryUsage, ay as getOrCreateApiClient, eH as getOsInfo, eI as getPlatformVersions, cA as getPreferredManifestEntryKey, cF as getProfilePlugin, eG as getReleaseId, e3 as getTablePlugin, ef as getTableRecordPlugin, db as getTokenFromCliLogin, dZ as getZapierApprovalMode, d_ as getZapierDefaultApprovalMode, dQ as getZapierSdkService, d9 as injectCliLogin, cR as inputFieldKeyResolver, cQ as inputsAllOptionalResolver, cP as inputsResolver, d8 as invalidateCachedToken, dd as invalidateCredentialsToken, eJ as isCi, da as isCliLoginAvailable, dt as isClientCredentials, dw as isCredentialsFunction, dv as isCredentialsObject, du as isPkceCredentials, S as isPositional, c7 as listActionInputFieldChoicesPlugin, c5 as listActionInputFieldsPlugin, c3 as listActionsPlugin, c1 as listAppsPlugin, cd as listClientCredentialsPlugin, cb as listConnectionsPlugin, e9 as listTableFieldsPlugin, eh as listTableRecordsPlugin, e1 as listTablesPlugin, ac as logDeprecation, cB as manifestPlugin, dX as parseConcurrencyEnvVar, r as readManifestFromFile, au as registryPlugin, cx as requestPlugin, ad as resetDeprecationWarnings, dc as resolveAuthToken, dz as resolveCredentials, dy as resolveCredentialsFromEnv, cv as runActionPlugin, a6 as runWithTelemetryContext, c$ as tableFieldIdsResolver, d1 as tableFieldsResolver, d4 as tableFiltersResolver, cU as tableIdResolver, d0 as tableNameResolver, cZ as tableRecordIdResolver, c_ as tableRecordIdsResolver, d2 as tableRecordsResolver, d5 as tableSortResolver, d3 as tableUpdateRecordsResolver, a7 as toSnakeCase, a8 as toTitleCase, cV as triggerInboxResolver, cY as triggerMessagesResolver, en as updateTableRecordsPlugin, cW as workflowIdResolver } from './index-3fBEDEsp.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '@zapier/zapier-sdk-core/v0/schemas/connections';
|
|
4
4
|
import '@zapier/policy-context';
|
package/dist/index.mjs
CHANGED
|
@@ -2510,10 +2510,7 @@ var clientCredentialsNameResolver = {
|
|
|
2510
2510
|
// src/resolvers/clientId.ts
|
|
2511
2511
|
var clientIdResolver = {
|
|
2512
2512
|
type: "dynamic",
|
|
2513
|
-
fetch: async (sdk) => {
|
|
2514
|
-
const result = await sdk.listClientCredentials({ maxItems: 100 });
|
|
2515
|
-
return result.data;
|
|
2516
|
-
},
|
|
2513
|
+
fetch: async (sdk) => toIterable(sdk.listClientCredentials({})),
|
|
2517
2514
|
prompt: (credentials) => ({
|
|
2518
2515
|
type: "list",
|
|
2519
2516
|
name: "clientId",
|
|
@@ -2591,6 +2588,21 @@ var workflowIdResolver = {
|
|
|
2591
2588
|
})
|
|
2592
2589
|
};
|
|
2593
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
|
+
|
|
2594
2606
|
// src/resolvers/triggerMessages.ts
|
|
2595
2607
|
var triggerMessagesResolver = {
|
|
2596
2608
|
type: "dynamic",
|
|
@@ -4272,10 +4284,7 @@ var deleteClientCredentialsPlugin = definePlugin(
|
|
|
4272
4284
|
{
|
|
4273
4285
|
authRequired: true,
|
|
4274
4286
|
requiredScopes: ["credentials"],
|
|
4275
|
-
resource: {
|
|
4276
|
-
type: "client-credential",
|
|
4277
|
-
id: options.clientId
|
|
4278
|
-
}
|
|
4287
|
+
resource: { type: "client-credential", id: options.clientId }
|
|
4279
4288
|
}
|
|
4280
4289
|
);
|
|
4281
4290
|
return { success: true };
|
|
@@ -6343,7 +6352,7 @@ async function invalidateCredentialsToken(options) {
|
|
|
6343
6352
|
}
|
|
6344
6353
|
|
|
6345
6354
|
// src/sdk-version.ts
|
|
6346
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6355
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.62.0" : void 0) || "unknown";
|
|
6347
6356
|
|
|
6348
6357
|
// src/utils/open-url.ts
|
|
6349
6358
|
var nodePrefix = "node:";
|
|
@@ -9205,4 +9214,4 @@ var registryPlugin = definePlugin((_sdk) => {
|
|
|
9205
9214
|
return {};
|
|
9206
9215
|
});
|
|
9207
9216
|
|
|
9208
|
-
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,45 @@
|
|
|
1
|
+
export declare const createWorkflowPlugin: (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
|
+
createWorkflow: (options?: {
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string | undefined;
|
|
27
|
+
} | undefined) => Promise<{
|
|
28
|
+
data: {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string | null;
|
|
32
|
+
trigger_url: string;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
created_at: string;
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
} & {
|
|
38
|
+
context: {
|
|
39
|
+
meta: {
|
|
40
|
+
createWorkflow: import("../../..").PluginMeta;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type CreateWorkflowPluginProvides = ReturnType<typeof createWorkflowPlugin>;
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/createWorkflow/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBhC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,oBAAoB,CAC5B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
|
|
2
|
+
import { codeSubstrateDefaults } from "../shared";
|
|
3
|
+
import { CreateWorkflowOptionsSchema, CreateWorkflowResponseSchema, } from "./schemas";
|
|
4
|
+
export const createWorkflowPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
5
|
+
...codeSubstrateDefaults,
|
|
6
|
+
name: "createWorkflow",
|
|
7
|
+
type: "create",
|
|
8
|
+
itemType: "Workflow",
|
|
9
|
+
inputSchema: CreateWorkflowOptionsSchema,
|
|
10
|
+
outputSchema: CreateWorkflowResponseSchema,
|
|
11
|
+
handler: async ({ sdk, options }) => {
|
|
12
|
+
const body = { name: options.name };
|
|
13
|
+
if (options.description !== undefined) {
|
|
14
|
+
body.description = options.description;
|
|
15
|
+
}
|
|
16
|
+
const data = await sdk.context.api.post("/durableworkflowzaps/api/v0/workflows", body, { authRequired: true });
|
|
17
|
+
return { data };
|
|
18
|
+
},
|
|
19
|
+
}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CreateWorkflowOptionsSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
description: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type CreateWorkflowOptions = z.infer<typeof CreateWorkflowOptionsSchema>;
|
|
7
|
+
export declare const CreateWorkflowResponseSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
description: z.ZodNullable<z.ZodString>;
|
|
11
|
+
trigger_url: z.ZodString;
|
|
12
|
+
enabled: z.ZodBoolean;
|
|
13
|
+
created_at: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type CreateWorkflowResponse = z.infer<typeof CreateWorkflowResponseSchema>;
|
|
16
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/createWorkflow/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,2BAA2B;;;iBAUrC,CAAC;AAEJ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,4BAA4B;;;;;;;iBAkBvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const CreateWorkflowOptionsSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
name: z.string().min(1).describe("Workflow name"),
|
|
5
|
+
description: z
|
|
6
|
+
.string()
|
|
7
|
+
.optional()
|
|
8
|
+
.describe("Optional description for the workflow"),
|
|
9
|
+
})
|
|
10
|
+
.describe("Create a durable workflow container. Starts disabled with no version; publish a version to add code.");
|
|
11
|
+
export const CreateWorkflowResponseSchema = z.object({
|
|
12
|
+
id: z.string().describe("Workflow ID (UUID)"),
|
|
13
|
+
name: z.string().describe("Workflow name"),
|
|
14
|
+
description: z
|
|
15
|
+
.string()
|
|
16
|
+
.nullable()
|
|
17
|
+
.describe("Workflow description (null if unset)"),
|
|
18
|
+
trigger_url: z
|
|
19
|
+
.string()
|
|
20
|
+
.describe("Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path — treat as sensitive."),
|
|
21
|
+
enabled: z
|
|
22
|
+
.boolean()
|
|
23
|
+
.describe("Whether the workflow currently accepts triggers. Always false on a new workflow until enabled."),
|
|
24
|
+
created_at: z.string().describe("When the workflow was created (ISO-8601)"),
|
|
25
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const deleteWorkflowPlugin: (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
|
+
deleteWorkflow: (options?: {
|
|
25
|
+
workflow: string;
|
|
26
|
+
} | undefined) => Promise<{
|
|
27
|
+
data: {
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
} & {
|
|
32
|
+
context: {
|
|
33
|
+
meta: {
|
|
34
|
+
deleteWorkflow: import("../../..").PluginMeta;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type DeleteWorkflowPluginProvides = ReturnType<typeof deleteWorkflowPlugin>;
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/deleteWorkflow/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BhC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,oBAAoB,CAC5B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
|
|
2
|
+
import { workflowIdResolver } from "../../../resolvers/workflowId";
|
|
3
|
+
import { codeSubstrateDefaults } from "../shared";
|
|
4
|
+
import { DeleteWorkflowOptionsSchema } from "./schemas";
|
|
5
|
+
export const deleteWorkflowPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
6
|
+
...codeSubstrateDefaults,
|
|
7
|
+
name: "deleteWorkflow",
|
|
8
|
+
type: "delete",
|
|
9
|
+
itemType: "Workflow",
|
|
10
|
+
confirm: "delete",
|
|
11
|
+
inputSchema: DeleteWorkflowOptionsSchema,
|
|
12
|
+
resolvers: { workflow: workflowIdResolver },
|
|
13
|
+
handler: async ({ sdk, options }) => {
|
|
14
|
+
// Backend returns 204 on success. 404 (workflow missing) propagates
|
|
15
|
+
// as ZapierNotFoundError. We intentionally don't fold 404 into a
|
|
16
|
+
// synthesized "already-deleted" outcome — the resource hint is
|
|
17
|
+
// caller-supplied (the SDK tagged the request itself), so an
|
|
18
|
+
// upstream / proxy / gateway 404 would falsely tell the caller
|
|
19
|
+
// the workflow was deleted. Callers wanting idempotency can
|
|
20
|
+
// catch ZapierNotFoundError themselves.
|
|
21
|
+
await sdk.context.api.delete(`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}`, undefined, {
|
|
22
|
+
authRequired: true,
|
|
23
|
+
resource: { type: "workflow", id: options.workflow },
|
|
24
|
+
});
|
|
25
|
+
return { data: { id: options.workflow } };
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/deleteWorkflow/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,2BAA2B;;iBAMrC,CAAC;AAEJ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const DeleteWorkflowOptionsSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
workflow: z.string().uuid().describe("Durable workflow ID"),
|
|
5
|
+
})
|
|
6
|
+
.describe("Delete a durable workflow. Throws `ZapierNotFoundError` if the workflow doesn't exist; callers wanting idempotency should catch that themselves.");
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const disableWorkflowPlugin: (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
|
+
disableWorkflow: (options?: {
|
|
25
|
+
workflow: string;
|
|
26
|
+
} | undefined) => Promise<{
|
|
27
|
+
data: {
|
|
28
|
+
id: string;
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
} & {
|
|
33
|
+
context: {
|
|
34
|
+
meta: {
|
|
35
|
+
disableWorkflow: import("../../..").PluginMeta;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type DisableWorkflowPluginProvides = ReturnType<typeof disableWorkflowPlugin>;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/disableWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBjC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,UAAU,CACpD,OAAO,qBAAqB,CAC7B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
|
|
2
|
+
import { workflowIdResolver } from "../../../resolvers/workflowId";
|
|
3
|
+
import { codeSubstrateDefaults } from "../shared";
|
|
4
|
+
import { DisableWorkflowOptionsSchema, DisableWorkflowResponseSchema, } from "./schemas";
|
|
5
|
+
export const disableWorkflowPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
6
|
+
...codeSubstrateDefaults,
|
|
7
|
+
name: "disableWorkflow",
|
|
8
|
+
type: "update",
|
|
9
|
+
itemType: "Workflow",
|
|
10
|
+
inputSchema: DisableWorkflowOptionsSchema,
|
|
11
|
+
outputSchema: DisableWorkflowResponseSchema,
|
|
12
|
+
resolvers: { workflow: workflowIdResolver },
|
|
13
|
+
handler: async ({ sdk, options }) => {
|
|
14
|
+
const data = await sdk.context.api.post(`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}/disable`, undefined, {
|
|
15
|
+
authRequired: true,
|
|
16
|
+
resource: { type: "workflow", id: options.workflow },
|
|
17
|
+
});
|
|
18
|
+
return { data };
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const DisableWorkflowOptionsSchema: z.ZodObject<{
|
|
3
|
+
workflow: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type DisableWorkflowOptions = z.infer<typeof DisableWorkflowOptionsSchema>;
|
|
6
|
+
export declare const DisableWorkflowResponseSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
enabled: z.ZodBoolean;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type DisableWorkflowResponse = z.infer<typeof DisableWorkflowResponseSchema>;
|
|
11
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/disableWorkflow/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,4BAA4B;;iBAI+B,CAAC;AAEzE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;iBAOxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const DisableWorkflowOptionsSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
workflow: z.string().uuid().describe("Durable workflow ID"),
|
|
5
|
+
})
|
|
6
|
+
.describe("Disable a durable workflow so it stops accepting triggers");
|
|
7
|
+
export const DisableWorkflowResponseSchema = z.object({
|
|
8
|
+
id: z.string().describe("Workflow ID (UUID)"),
|
|
9
|
+
enabled: z
|
|
10
|
+
.boolean()
|
|
11
|
+
.describe("Workflow's enabled state after the operation. Typically false; mirrors the row's true state in case a concurrent enable raced with this call."),
|
|
12
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const enableWorkflowPlugin: (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
|
+
enableWorkflow: (options?: {
|
|
25
|
+
workflow: string;
|
|
26
|
+
} | undefined) => Promise<{
|
|
27
|
+
data: {
|
|
28
|
+
id: string;
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
} & {
|
|
33
|
+
context: {
|
|
34
|
+
meta: {
|
|
35
|
+
enableWorkflow: import("../../..").PluginMeta;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type EnableWorkflowPluginProvides = ReturnType<typeof enableWorkflowPlugin>;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/enableWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBhC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,oBAAoB,CAC5B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
|
|
2
|
+
import { workflowIdResolver } from "../../../resolvers/workflowId";
|
|
3
|
+
import { codeSubstrateDefaults } from "../shared";
|
|
4
|
+
import { EnableWorkflowOptionsSchema, EnableWorkflowResponseSchema, } from "./schemas";
|
|
5
|
+
export const enableWorkflowPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
6
|
+
...codeSubstrateDefaults,
|
|
7
|
+
name: "enableWorkflow",
|
|
8
|
+
type: "update",
|
|
9
|
+
itemType: "Workflow",
|
|
10
|
+
inputSchema: EnableWorkflowOptionsSchema,
|
|
11
|
+
outputSchema: EnableWorkflowResponseSchema,
|
|
12
|
+
resolvers: { workflow: workflowIdResolver },
|
|
13
|
+
handler: async ({ sdk, options }) => {
|
|
14
|
+
const data = await sdk.context.api.post(`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}/enable`, undefined, {
|
|
15
|
+
authRequired: true,
|
|
16
|
+
resource: { type: "workflow", id: options.workflow },
|
|
17
|
+
});
|
|
18
|
+
return { data };
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const EnableWorkflowOptionsSchema: z.ZodObject<{
|
|
3
|
+
workflow: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type EnableWorkflowOptions = z.infer<typeof EnableWorkflowOptionsSchema>;
|
|
6
|
+
export declare const EnableWorkflowResponseSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
enabled: z.ZodBoolean;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type EnableWorkflowResponse = z.infer<typeof EnableWorkflowResponseSchema>;
|
|
11
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/enableWorkflow/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,2BAA2B;;iBAIuB,CAAC;AAEhE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,4BAA4B;;;iBAKvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const EnableWorkflowOptionsSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
workflow: z.string().uuid().describe("Durable workflow ID"),
|
|
5
|
+
})
|
|
6
|
+
.describe("Enable a durable workflow so it accepts triggers");
|
|
7
|
+
export const EnableWorkflowResponseSchema = z.object({
|
|
8
|
+
id: z.string().describe("Workflow ID (UUID)"),
|
|
9
|
+
enabled: z
|
|
10
|
+
.boolean()
|
|
11
|
+
.describe("Workflow's enabled state after the operation (always true)"),
|
|
12
|
+
});
|