@zapier/zapier-sdk 0.119.2 → 0.119.4
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/dist/beta.cjs +290 -286
- package/dist/beta.d.mts +248 -248
- package/dist/beta.d.ts +248 -248
- package/dist/beta.mjs +2 -2
- package/dist/{chunk-2SMGG6P2.mjs → chunk-56RRYPYW.mjs} +28 -10
- package/dist/{chunk-BRN2FTOU.cjs → chunk-CJW5CHQW.cjs} +28 -9
- package/dist/{chunk-D32GR5A3.mjs → chunk-FYONS27B.mjs} +1 -1
- package/dist/{chunk-7LKCPH55.cjs → chunk-KFLZWAIL.cjs} +88 -88
- package/dist/experimental.cjs +321 -317
- package/dist/experimental.d.mts +290 -290
- package/dist/experimental.d.ts +290 -290
- package/dist/experimental.mjs +4 -4
- package/dist/{index-DIWpTc5e.d.mts → index-DR_2xqqX.d.mts} +453 -451
- package/dist/{index-DIWpTc5e.d.ts → index-DR_2xqqX.d.ts} +453 -451
- package/dist/index.cjs +284 -280
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/beta.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { CreateWorkflowOptionsSchema, CreateWorkflowResponseSchema, ImportWorkflowOptionsSchema, ImportWorkflowResponseSchema, createZapierSdk, zapierBetaSdkPlugin } from './chunk-
|
|
2
|
-
export { ACTION_RUNS_PATH, API_ID, ActionIdempotencyKeyPropertySchema, 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, 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, STABILITY_DEFINITIONS, STABILITY_LEVELS, STABILITY_TITLES, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, 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, applyStabilityLabel, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createActionRunPlugin, createBaseEvent, createClientCredentialsPlugin, createController, createMemoryCache, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineMethod, defineMethodOverride, defineOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, descriptionFor, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, formatExtensionPluginFailure, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getActionRunPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getNegatable, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistry, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierCausationId, getZapierCorrelationId, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isInternalField, 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, 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, taxonomy, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowDraftRevisionResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin } from './chunk-
|
|
1
|
+
export { CreateWorkflowOptionsSchema, CreateWorkflowResponseSchema, ImportWorkflowOptionsSchema, ImportWorkflowResponseSchema, createZapierSdk, zapierBetaSdkPlugin } from './chunk-FYONS27B.mjs';
|
|
2
|
+
export { ACTION_RUNS_PATH, API_ID, ActionIdempotencyKeyPropertySchema, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CALLER_CONTEXT_HEADERS_SUPPORTED, 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, 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, STABILITY_DEFINITIONS, STABILITY_LEVELS, STABILITY_TITLES, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, 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, applyStabilityLabel, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createActionRunPlugin, createBaseEvent, createClientCredentialsPlugin, createController, createMemoryCache, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineMethod, defineMethodOverride, defineOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, descriptionFor, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, formatExtensionPluginFailure, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getActionRunPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getNegatable, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistry, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierCausationId, getZapierCorrelationId, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isInternalField, 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, 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, taxonomy, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowDraftRevisionResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin } from './chunk-56RRYPYW.mjs';
|
|
3
3
|
import './chunk-Y6FXYEAI.mjs';
|
|
@@ -1844,7 +1844,10 @@ async function invalidateCredentialsToken(options) {
|
|
|
1844
1844
|
});
|
|
1845
1845
|
}
|
|
1846
1846
|
}
|
|
1847
|
-
var
|
|
1847
|
+
var CALLER_CONTEXT_HEADERS_SUPPORTED = true;
|
|
1848
|
+
var contextKey = Symbol.for("@zapier/zapier-sdk/caller-context");
|
|
1849
|
+
var shared = globalThis;
|
|
1850
|
+
var callerContext = shared[contextKey] ?? (shared[contextKey] = createAsyncContext());
|
|
1848
1851
|
function runWithCallerContext(context, fn) {
|
|
1849
1852
|
let parent;
|
|
1850
1853
|
try {
|
|
@@ -1852,7 +1855,19 @@ function runWithCallerContext(context, fn) {
|
|
|
1852
1855
|
} catch {
|
|
1853
1856
|
return fn();
|
|
1854
1857
|
}
|
|
1855
|
-
|
|
1858
|
+
const merged = { ...parent, ...context };
|
|
1859
|
+
if (context.headers === null) {
|
|
1860
|
+
merged.headers = void 0;
|
|
1861
|
+
} else if (context.headers !== void 0) {
|
|
1862
|
+
const headers = new Headers(parent.headers ?? void 0);
|
|
1863
|
+
new Headers(context.headers).forEach((value, name) => {
|
|
1864
|
+
headers.set(name, value);
|
|
1865
|
+
});
|
|
1866
|
+
merged.headers = headers;
|
|
1867
|
+
} else if (parent.headers != null) {
|
|
1868
|
+
merged.headers = new Headers(parent.headers);
|
|
1869
|
+
}
|
|
1870
|
+
return callerContext.run(merged, fn);
|
|
1856
1871
|
}
|
|
1857
1872
|
function getCallerContext() {
|
|
1858
1873
|
try {
|
|
@@ -2827,7 +2842,7 @@ function logRouteOverride({
|
|
|
2827
2842
|
}
|
|
2828
2843
|
|
|
2829
2844
|
// src/sdk-version.ts
|
|
2830
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.119.
|
|
2845
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.119.4" : void 0) || "unknown";
|
|
2831
2846
|
|
|
2832
2847
|
// src/utils/open-url.ts
|
|
2833
2848
|
var nodePrefix = "node:";
|
|
@@ -3541,7 +3556,10 @@ var ZapierApiClient = class {
|
|
|
3541
3556
|
}
|
|
3542
3557
|
// Helper to build headers
|
|
3543
3558
|
async buildHeaders(options = {}, pathConfig2) {
|
|
3544
|
-
const headers = new Headers(
|
|
3559
|
+
const headers = new Headers(getCallerContext().headers ?? void 0);
|
|
3560
|
+
new Headers(options.headers).forEach((value, name) => {
|
|
3561
|
+
headers.set(name, value);
|
|
3562
|
+
});
|
|
3545
3563
|
const authToken = await this.getAuthToken({
|
|
3546
3564
|
requiredScopes: options.requiredScopes
|
|
3547
3565
|
});
|
|
@@ -7366,20 +7384,20 @@ var createActionRunPlugin = defineMethod({
|
|
|
7366
7384
|
return { implementationId, actionId: actionData.data.id };
|
|
7367
7385
|
}
|
|
7368
7386
|
function getActionRunContext(options) {
|
|
7369
|
-
const
|
|
7370
|
-
const cached = cache.get(
|
|
7387
|
+
const contextKey2 = `${options.appKey}:${options.actionKey}:${options.actionType}`;
|
|
7388
|
+
const cached = cache.get(contextKey2);
|
|
7371
7389
|
if (cached && Date.now() < cached.expiresAt) {
|
|
7372
7390
|
return cached.promise;
|
|
7373
7391
|
}
|
|
7374
7392
|
const pending = resolveActionRunContext(options).catch((error) => {
|
|
7375
|
-
const current = cache.get(
|
|
7393
|
+
const current = cache.get(contextKey2);
|
|
7376
7394
|
if (current?.promise === pending) {
|
|
7377
|
-
cache.delete(
|
|
7395
|
+
cache.delete(contextKey2);
|
|
7378
7396
|
}
|
|
7379
7397
|
throw error;
|
|
7380
7398
|
});
|
|
7381
7399
|
evictIfNeeded();
|
|
7382
|
-
cache.set(
|
|
7400
|
+
cache.set(contextKey2, {
|
|
7383
7401
|
promise: pending,
|
|
7384
7402
|
expiresAt: Date.now() + CONTEXT_CACHE_TTL_MILLISECONDS
|
|
7385
7403
|
});
|
|
@@ -13527,4 +13545,4 @@ function isInternalField(schema) {
|
|
|
13527
13545
|
return false;
|
|
13528
13546
|
}
|
|
13529
13547
|
|
|
13530
|
-
export { ACTION_RUNS_PATH, API_ID, ActionIdempotencyKeyPropertySchema, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, 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, SDK_VERSION, STABILITY_DEFINITIONS, 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, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createActionRunPlugin, createBaseEvent, createClientCredentialsPlugin, createMemoryCache, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, descriptionFor, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, extractErrorDetail, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, formatExtensionPluginFailure, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getActionRunPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierCausationId, getZapierCorrelationId, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isInternalField, isPermanentHttpError, isPkceCredentials, 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, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, requestPlugin, resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, runActionPlugin, runWithCallerContext, sdkOptionsPluginRef, sleep, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, taxonomy, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowDraftRevisionResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin };
|
|
13548
|
+
export { ACTION_RUNS_PATH, API_ID, ActionIdempotencyKeyPropertySchema, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CALLER_CONTEXT_HEADERS_SUPPORTED, CONNECTIONS_ID, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, 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, SDK_VERSION, STABILITY_DEFINITIONS, 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, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createActionRunPlugin, createBaseEvent, createClientCredentialsPlugin, createMemoryCache, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, descriptionFor, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, extractErrorDetail, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, formatExtensionPluginFailure, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getActionRunPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierCausationId, getZapierCorrelationId, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isInternalField, isPermanentHttpError, isPkceCredentials, 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, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, requestPlugin, resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, runActionPlugin, runWithCallerContext, sdkOptionsPluginRef, sleep, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, taxonomy, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowDraftRevisionResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin };
|
|
@@ -1845,7 +1845,10 @@ async function invalidateCredentialsToken(options) {
|
|
|
1845
1845
|
});
|
|
1846
1846
|
}
|
|
1847
1847
|
}
|
|
1848
|
-
var
|
|
1848
|
+
var CALLER_CONTEXT_HEADERS_SUPPORTED = true;
|
|
1849
|
+
var contextKey = Symbol.for("@zapier/zapier-sdk/caller-context");
|
|
1850
|
+
var shared = globalThis;
|
|
1851
|
+
var callerContext = shared[contextKey] ?? (shared[contextKey] = kitcore.createAsyncContext());
|
|
1849
1852
|
function runWithCallerContext(context, fn) {
|
|
1850
1853
|
let parent;
|
|
1851
1854
|
try {
|
|
@@ -1853,7 +1856,19 @@ function runWithCallerContext(context, fn) {
|
|
|
1853
1856
|
} catch {
|
|
1854
1857
|
return fn();
|
|
1855
1858
|
}
|
|
1856
|
-
|
|
1859
|
+
const merged = { ...parent, ...context };
|
|
1860
|
+
if (context.headers === null) {
|
|
1861
|
+
merged.headers = void 0;
|
|
1862
|
+
} else if (context.headers !== void 0) {
|
|
1863
|
+
const headers = new Headers(parent.headers ?? void 0);
|
|
1864
|
+
new Headers(context.headers).forEach((value, name) => {
|
|
1865
|
+
headers.set(name, value);
|
|
1866
|
+
});
|
|
1867
|
+
merged.headers = headers;
|
|
1868
|
+
} else if (parent.headers != null) {
|
|
1869
|
+
merged.headers = new Headers(parent.headers);
|
|
1870
|
+
}
|
|
1871
|
+
return callerContext.run(merged, fn);
|
|
1857
1872
|
}
|
|
1858
1873
|
function getCallerContext() {
|
|
1859
1874
|
try {
|
|
@@ -2828,7 +2843,7 @@ function logRouteOverride({
|
|
|
2828
2843
|
}
|
|
2829
2844
|
|
|
2830
2845
|
// src/sdk-version.ts
|
|
2831
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.119.
|
|
2846
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.119.4" : void 0) || "unknown";
|
|
2832
2847
|
|
|
2833
2848
|
// src/utils/open-url.ts
|
|
2834
2849
|
var nodePrefix = "node:";
|
|
@@ -3542,7 +3557,10 @@ var ZapierApiClient = class {
|
|
|
3542
3557
|
}
|
|
3543
3558
|
// Helper to build headers
|
|
3544
3559
|
async buildHeaders(options = {}, pathConfig2) {
|
|
3545
|
-
const headers = new Headers(
|
|
3560
|
+
const headers = new Headers(getCallerContext().headers ?? void 0);
|
|
3561
|
+
new Headers(options.headers).forEach((value, name) => {
|
|
3562
|
+
headers.set(name, value);
|
|
3563
|
+
});
|
|
3546
3564
|
const authToken = await this.getAuthToken({
|
|
3547
3565
|
requiredScopes: options.requiredScopes
|
|
3548
3566
|
});
|
|
@@ -7367,20 +7385,20 @@ var createActionRunPlugin = kitcore.defineMethod({
|
|
|
7367
7385
|
return { implementationId, actionId: actionData.data.id };
|
|
7368
7386
|
}
|
|
7369
7387
|
function getActionRunContext(options) {
|
|
7370
|
-
const
|
|
7371
|
-
const cached = cache.get(
|
|
7388
|
+
const contextKey2 = `${options.appKey}:${options.actionKey}:${options.actionType}`;
|
|
7389
|
+
const cached = cache.get(contextKey2);
|
|
7372
7390
|
if (cached && Date.now() < cached.expiresAt) {
|
|
7373
7391
|
return cached.promise;
|
|
7374
7392
|
}
|
|
7375
7393
|
const pending = resolveActionRunContext(options).catch((error) => {
|
|
7376
|
-
const current = cache.get(
|
|
7394
|
+
const current = cache.get(contextKey2);
|
|
7377
7395
|
if (current?.promise === pending) {
|
|
7378
|
-
cache.delete(
|
|
7396
|
+
cache.delete(contextKey2);
|
|
7379
7397
|
}
|
|
7380
7398
|
throw error;
|
|
7381
7399
|
});
|
|
7382
7400
|
evictIfNeeded();
|
|
7383
|
-
cache.set(
|
|
7401
|
+
cache.set(contextKey2, {
|
|
7384
7402
|
promise: pending,
|
|
7385
7403
|
expiresAt: Date.now() + CONTEXT_CACHE_TTL_MILLISECONDS
|
|
7386
7404
|
});
|
|
@@ -13714,6 +13732,7 @@ exports.AppsPropertySchema = AppsPropertySchema;
|
|
|
13714
13732
|
exports.AuthMechanism = AuthMechanism;
|
|
13715
13733
|
exports.AuthenticationIdPropertySchema = AuthenticationIdPropertySchema;
|
|
13716
13734
|
exports.BaseSdkOptionsSchema = BaseSdkOptionsSchema;
|
|
13735
|
+
exports.CALLER_CONTEXT_HEADERS_SUPPORTED = CALLER_CONTEXT_HEADERS_SUPPORTED;
|
|
13717
13736
|
exports.CONNECTIONS_ID = CONNECTIONS_ID;
|
|
13718
13737
|
exports.CONTEXT_CACHE_MAX_SIZE = CONTEXT_CACHE_MAX_SIZE;
|
|
13719
13738
|
exports.CONTEXT_CACHE_TTL_MILLISECONDS = CONTEXT_CACHE_TTL_MILLISECONDS;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { taxonomy, DEFAULT_PAGE_SIZE, apiPluginRef, workflowIdResolver, extractErrorDetail, ZapierApiError, durableRunIdResolver, ZapierConflictError, workflowVersionIdResolver, workflowDraftIdResolver, workflowRunIdResolver, workflowDraftRevisionResolver, isZapierNotFoundError, ZapierTimeoutError, zapierSdkPlugin, SDK_VERSION, ZapierValidationError, sleep, zapierCoreOptions, SDK_OPTIONS_ID } from './chunk-
|
|
1
|
+
import { taxonomy, DEFAULT_PAGE_SIZE, apiPluginRef, workflowIdResolver, extractErrorDetail, ZapierApiError, durableRunIdResolver, ZapierConflictError, workflowVersionIdResolver, workflowDraftIdResolver, workflowRunIdResolver, workflowDraftRevisionResolver, isZapierNotFoundError, ZapierTimeoutError, zapierSdkPlugin, SDK_VERSION, ZapierValidationError, sleep, zapierCoreOptions, SDK_OPTIONS_ID } from './chunk-56RRYPYW.mjs';
|
|
2
2
|
import { defineMethod, openEnum, defineResolver, definePlugin, createSdk, CORE_OPTIONS_ID } from '@zapier/kitcore';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|