@zapier/zapier-sdk 0.94.1 → 0.95.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.
@@ -3208,6 +3208,7 @@ declare const zapierExperimentalSdkPlugin: AggregatePlugin<"experimental-sdk", {
3208
3208
  authentication_id?: string | null | undefined;
3209
3209
  params?: Record<string, unknown> | undefined;
3210
3210
  } | undefined;
3211
+ manual?: boolean | undefined;
3211
3212
  } | {
3212
3213
  workflow: string;
3213
3214
  source_files: Record<string, string>;
@@ -3238,6 +3239,7 @@ declare const zapierExperimentalSdkPlugin: AggregatePlugin<"experimental-sdk", {
3238
3239
  authentication_id?: string | null | undefined;
3239
3240
  params?: Record<string, unknown> | undefined;
3240
3241
  } | undefined;
3242
+ manual?: boolean | undefined;
3241
3243
  }, Promise<{
3242
3244
  data: {
3243
3245
  id: string;
@@ -5483,6 +5485,7 @@ declare function createZapierSdk(options?: ZapierSdkOptions): {
5483
5485
  authentication_id?: string | null | undefined;
5484
5486
  params?: Record<string, unknown> | undefined;
5485
5487
  } | undefined;
5488
+ manual?: boolean | undefined;
5486
5489
  } | {
5487
5490
  workflow: string;
5488
5491
  source_files: Record<string, string>;
@@ -5513,6 +5516,7 @@ declare function createZapierSdk(options?: ZapierSdkOptions): {
5513
5516
  authentication_id?: string | null | undefined;
5514
5517
  params?: Record<string, unknown> | undefined;
5515
5518
  } | undefined;
5519
+ manual?: boolean | undefined;
5516
5520
  }) => Promise<{
5517
5521
  data: {
5518
5522
  id: string;
@@ -3208,6 +3208,7 @@ declare const zapierExperimentalSdkPlugin: AggregatePlugin<"experimental-sdk", {
3208
3208
  authentication_id?: string | null | undefined;
3209
3209
  params?: Record<string, unknown> | undefined;
3210
3210
  } | undefined;
3211
+ manual?: boolean | undefined;
3211
3212
  } | {
3212
3213
  workflow: string;
3213
3214
  source_files: Record<string, string>;
@@ -3238,6 +3239,7 @@ declare const zapierExperimentalSdkPlugin: AggregatePlugin<"experimental-sdk", {
3238
3239
  authentication_id?: string | null | undefined;
3239
3240
  params?: Record<string, unknown> | undefined;
3240
3241
  } | undefined;
3242
+ manual?: boolean | undefined;
3241
3243
  }, Promise<{
3242
3244
  data: {
3243
3245
  id: string;
@@ -5483,6 +5485,7 @@ declare function createZapierSdk(options?: ZapierSdkOptions): {
5483
5485
  authentication_id?: string | null | undefined;
5484
5486
  params?: Record<string, unknown> | undefined;
5485
5487
  } | undefined;
5488
+ manual?: boolean | undefined;
5486
5489
  } | {
5487
5490
  workflow: string;
5488
5491
  source_files: Record<string, string>;
@@ -5513,6 +5516,7 @@ declare function createZapierSdk(options?: ZapierSdkOptions): {
5513
5516
  authentication_id?: string | null | undefined;
5514
5517
  params?: Record<string, unknown> | undefined;
5515
5518
  } | undefined;
5519
+ manual?: boolean | undefined;
5516
5520
  }) => Promise<{
5517
5521
  data: {
5518
5522
  id: string;
@@ -1,5 +1,5 @@
1
- import { defineMethod, DEFAULT_PAGE_SIZE, apiPluginRef, workflowIdResolver, openEnum, durableRunIdResolver, defineResolver, ZapierConflictError, extractErrorDetail, workflowVersionIdResolver, workflowDraftIdResolver, ZapierApiError, workflowRunIdResolver, definePlugin, zapierSdkPlugin, ZapierValidationError, createSdk, zapierCoreOptions, CORE_OPTIONS_ID, SDK_OPTIONS_ID } from './chunk-XETAS26U.mjs';
2
- export { ACTION_RUNS_PATH, API_ID, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MILLISECONDS, DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DEPRECATION_NOTICE_EVENT, DebugPropertySchema, DrainTriggerInboxSchema, EVENT_EMISSION_ID, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MANIFEST_ID, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RESOLVE_CREDENTIALS_ID, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, SDK_OPTIONS_ID, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, WatchTriggerInboxSchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, addPlugin, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createActionRunPlugin, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getActionRunPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getNegatable, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, isZapierAbortDrainSignal, isZapierActionError, isZapierAppNotFoundError, isZapierApprovalError, isZapierAuthenticationError, isZapierBundleError, isZapierConflictError, isZapierError, isZapierNotFoundError, isZapierRateLimitError, isZapierReleaseTriggerMessageSignal, isZapierResourceNotFoundError, isZapierSignal, isZapierTimeoutError, isZapierValidationError, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, manifestPluginRef, omitExports, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, resolvePlugin, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, sdkOptionsPluginRef, selectExports, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin } from './chunk-XETAS26U.mjs';
1
+ import { defineMethod, DEFAULT_PAGE_SIZE, apiPluginRef, workflowIdResolver, openEnum, durableRunIdResolver, defineResolver, ZapierConflictError, extractErrorDetail, workflowVersionIdResolver, workflowDraftIdResolver, ZapierApiError, workflowRunIdResolver, definePlugin, zapierSdkPlugin, ZapierValidationError, createSdk, zapierCoreOptions, CORE_OPTIONS_ID, SDK_OPTIONS_ID } from './chunk-JZDH3POI.mjs';
2
+ export { ACTION_RUNS_PATH, API_ID, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MILLISECONDS, DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DEPRECATION_NOTICE_EVENT, DebugPropertySchema, DrainTriggerInboxSchema, EVENT_EMISSION_ID, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MANIFEST_ID, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RESOLVE_CREDENTIALS_ID, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, SDK_OPTIONS_ID, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, WatchTriggerInboxSchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, addPlugin, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createActionRunPlugin, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getActionRunPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getNegatable, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, isZapierAbortDrainSignal, isZapierActionError, isZapierAppNotFoundError, isZapierApprovalError, isZapierAuthenticationError, isZapierBundleError, isZapierConflictError, isZapierError, isZapierNotFoundError, isZapierRateLimitError, isZapierReleaseTriggerMessageSignal, isZapierResourceNotFoundError, isZapierSignal, isZapierTimeoutError, isZapierValidationError, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, manifestPluginRef, omitExports, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, resolvePlugin, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, sdkOptionsPluginRef, selectExports, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin } from './chunk-JZDH3POI.mjs';
3
3
  import './chunk-Y6FXYEAI.mjs';
4
4
  import { z } from 'zod';
5
5
 
@@ -953,14 +953,23 @@ var PublishWorkflowVersionBaseSchema = z.object({
953
953
  /** @deprecated Use `appVersions` instead. */
954
954
  app_versions: z.record(z.string(), AppVersionBindingSchema).nullish().meta({ deprecated: true }),
955
955
  trigger: TriggerConfigSchema.optional().describe(
956
- "Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; omit for webhook-only workflows."
956
+ "Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; for an on-demand, triggerless workflow, omit this and pass `manual: true` instead."
957
+ ),
958
+ manual: z.boolean().optional().describe(
959
+ "Declare this an on-demand, triggerless workflow version. Pass `manual: true` only when omitting `trigger`; passing both is a contradiction the API rejects with a 400."
957
960
  )
958
961
  });
959
962
  var WorkflowPropertySchema = z.string().uuid().describe("Durable workflow ID");
963
+ function hasNoTriggerManualConflict(data) {
964
+ return !(data.trigger !== void 0 && data.manual === true);
965
+ }
966
+ var TRIGGER_MANUAL_CONFLICT_MESSAGE = "Provide `trigger` or `manual: true`, not both \u2014 a trigger together with manual: true is a contradiction.";
960
967
  var PublishWorkflowVersionSchema = z.object({
961
968
  workflow: WorkflowPropertySchema,
962
969
  sourceFiles: SourceFilesSchema
963
- }).merge(PublishWorkflowVersionBaseSchema).describe(PublishWorkflowVersionDescription).meta({
970
+ }).merge(PublishWorkflowVersionBaseSchema).refine(hasNoTriggerManualConflict, {
971
+ message: TRIGGER_MANUAL_CONFLICT_MESSAGE
972
+ }).describe(PublishWorkflowVersionDescription).meta({
964
973
  aliases: {
965
974
  source_files: "sourceFiles",
966
975
  zapier_durable_version: "zapierDurableVersion",
@@ -970,7 +979,9 @@ var PublishWorkflowVersionSchema = z.object({
970
979
  var PublishWorkflowVersionSchemaDeprecated = z.object({
971
980
  workflow: WorkflowPropertySchema,
972
981
  source_files: SourceFilesSchema
973
- }).merge(PublishWorkflowVersionBaseSchema);
982
+ }).merge(PublishWorkflowVersionBaseSchema).refine(hasNoTriggerManualConflict, {
983
+ message: TRIGGER_MANUAL_CONFLICT_MESSAGE
984
+ });
974
985
  var PublishWorkflowVersionOptionsSchema = z.union([PublishWorkflowVersionSchema, PublishWorkflowVersionSchemaDeprecated]).describe(PublishWorkflowVersionDescription);
975
986
  var PublishWorkflowVersionResponseSchema = WorkflowVersionSchema;
976
987
 
@@ -1057,6 +1068,9 @@ var publishWorkflowVersionPlugin = defineMethod({
1057
1068
  if (input.trigger !== void 0) {
1058
1069
  body.trigger = toWireTrigger(input.trigger);
1059
1070
  }
1071
+ if (input.manual !== void 0) {
1072
+ body.manual = input.manual;
1073
+ }
1060
1074
  const raw = await api.post(
1061
1075
  `${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/versions`,
1062
1076
  body,