@zapier/zapier-sdk 0.51.0 → 0.53.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +58 -0
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +84 -7
  5. package/dist/api/concurrency.d.ts +28 -0
  6. package/dist/api/concurrency.d.ts.map +1 -0
  7. package/dist/api/concurrency.js +90 -0
  8. package/dist/api/types.d.ts +6 -0
  9. package/dist/api/types.d.ts.map +1 -1
  10. package/dist/constants.d.ts +16 -0
  11. package/dist/constants.d.ts.map +1 -1
  12. package/dist/constants.js +29 -0
  13. package/dist/experimental.cjs +261 -18
  14. package/dist/experimental.d.mts +56 -28
  15. package/dist/experimental.d.ts +28 -0
  16. package/dist/experimental.d.ts.map +1 -1
  17. package/dist/experimental.js +2 -0
  18. package/dist/experimental.mjs +258 -19
  19. package/dist/{index-C52BjTXh.d.mts → index-D2HKNk0N.d.mts} +44 -1
  20. package/dist/{index-C52BjTXh.d.ts → index-D2HKNk0N.d.ts} +44 -1
  21. package/dist/index.cjs +215 -6
  22. package/dist/index.d.mts +1 -1
  23. package/dist/index.mjs +212 -7
  24. package/dist/plugins/api/index.d.ts.map +1 -1
  25. package/dist/plugins/api/index.js +3 -2
  26. package/dist/plugins/triggers/ackTriggerInboxMessages/index.d.ts.map +1 -1
  27. package/dist/plugins/triggers/ackTriggerInboxMessages/index.js +2 -1
  28. package/dist/plugins/triggers/createTriggerInbox/index.d.ts.map +1 -1
  29. package/dist/plugins/triggers/createTriggerInbox/index.js +1 -4
  30. package/dist/plugins/triggers/ensureTriggerInbox/index.d.ts.map +1 -1
  31. package/dist/plugins/triggers/ensureTriggerInbox/index.js +1 -4
  32. package/dist/plugins/triggers/leaseTriggerInboxMessages/index.d.ts.map +1 -1
  33. package/dist/plugins/triggers/leaseTriggerInboxMessages/index.js +5 -1
  34. package/dist/plugins/triggers/listTriggers/index.d.ts +70 -0
  35. package/dist/plugins/triggers/listTriggers/index.d.ts.map +1 -0
  36. package/dist/plugins/triggers/listTriggers/index.js +25 -0
  37. package/dist/plugins/triggers/listTriggers/schemas.d.ts +11 -0
  38. package/dist/plugins/triggers/listTriggers/schemas.d.ts.map +1 -0
  39. package/dist/plugins/triggers/listTriggers/schemas.js +18 -0
  40. package/dist/plugins/triggers/releaseTriggerInboxMessages/index.d.ts.map +1 -1
  41. package/dist/plugins/triggers/releaseTriggerInboxMessages/index.js +2 -1
  42. package/dist/resolvers/index.d.ts +1 -0
  43. package/dist/resolvers/index.d.ts.map +1 -1
  44. package/dist/resolvers/index.js +1 -0
  45. package/dist/resolvers/triggerMessages.d.ts +6 -0
  46. package/dist/resolvers/triggerMessages.d.ts.map +1 -0
  47. package/dist/resolvers/triggerMessages.js +22 -0
  48. package/dist/types/sdk.d.ts +1 -0
  49. package/dist/types/sdk.d.ts.map +1 -1
  50. package/dist/types/sdk.js +25 -0
  51. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -61,6 +61,21 @@ function parseIntEnvVar(name) {
61
61
  }
62
62
  var ZAPIER_MAX_NETWORK_RETRIES = parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRIES") ?? 3;
63
63
  var ZAPIER_MAX_NETWORK_RETRY_DELAY_MS = parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRY_DELAY_MS") ?? 6e4;
64
+ var MAX_CONCURRENCY_LIMIT = 1e4;
65
+ function parseConcurrencyEnvVar(name) {
66
+ const value = globalThis.process?.env?.[name];
67
+ if (!value) return void 0;
68
+ if (value === "Infinity") return Infinity;
69
+ if (/^[1-9]\d*$/.test(value)) {
70
+ const parsed = parseInt(value, 10);
71
+ if (parsed <= MAX_CONCURRENCY_LIMIT) return parsed;
72
+ }
73
+ console.warn(
74
+ `[zapier-sdk] Invalid value for ${name}: "${value}" (expected positive integer 1-${MAX_CONCURRENCY_LIMIT} or "Infinity")`
75
+ );
76
+ return void 0;
77
+ }
78
+ var ZAPIER_MAX_CONCURRENT_REQUESTS = parseConcurrencyEnvVar("ZAPIER_MAX_CONCURRENT_REQUESTS") ?? 200;
64
79
  function getZapierApprovalMode() {
65
80
  const value = globalThis.process?.env?.ZAPIER_APPROVAL_MODE;
66
81
  if (value === "disabled" || value === "poll" || value === "throw")
@@ -2525,6 +2540,29 @@ var triggerInboxResolver = {
2525
2540
  }))
2526
2541
  })
2527
2542
  };
2543
+
2544
+ // src/resolvers/triggerMessages.ts
2545
+ var triggerMessagesResolver = {
2546
+ type: "dynamic",
2547
+ depends: ["inbox"],
2548
+ fetch: async (sdk, params) => toIterable(
2549
+ sdk.listTriggerInboxMessages({
2550
+ inbox: params.inbox
2551
+ })
2552
+ ),
2553
+ prompt: (messages) => ({
2554
+ type: "checkbox",
2555
+ name: "messages",
2556
+ message: "Select messages:",
2557
+ // Only leased messages are eligible to ack or release. Acked messages
2558
+ // are gone from the inbox already; available/quarantined ones can't be
2559
+ // operated on by these methods.
2560
+ choices: messages.filter((message) => message.status === "leased").map((message) => ({
2561
+ name: `${message.id} (${message.status}, lease_count: ${message.message_attributes.lease_count})`,
2562
+ value: message.id
2563
+ }))
2564
+ })
2565
+ };
2528
2566
  function formatFieldValue(v) {
2529
2567
  if (v == null) return "";
2530
2568
  if (typeof v === "object") {
@@ -5574,6 +5612,83 @@ async function pollUntilComplete(options) {
5574
5612
  }
5575
5613
  }
5576
5614
  }
5615
+
5616
+ // src/api/concurrency.ts
5617
+ var NO_OP_RELEASE = () => {
5618
+ };
5619
+ var NO_OP_SEMAPHORE = {
5620
+ acquire: async () => NO_OP_RELEASE,
5621
+ tryAcquire: () => NO_OP_RELEASE
5622
+ };
5623
+ function createSemaphore(maxPermits) {
5624
+ if (maxPermits === Infinity) {
5625
+ return NO_OP_SEMAPHORE;
5626
+ }
5627
+ if (!Number.isInteger(maxPermits) || maxPermits <= 0) {
5628
+ throw new Error(
5629
+ `maxPermits must be a positive integer or Infinity, got: ${maxPermits}`
5630
+ );
5631
+ }
5632
+ let permits = maxPermits;
5633
+ const waiters = [];
5634
+ const release = () => {
5635
+ const next = waiters.shift();
5636
+ if (next) {
5637
+ next.grant();
5638
+ } else {
5639
+ permits++;
5640
+ }
5641
+ };
5642
+ const makeReleaseOnce = () => {
5643
+ let released = false;
5644
+ return () => {
5645
+ if (released) return;
5646
+ released = true;
5647
+ release();
5648
+ };
5649
+ };
5650
+ return {
5651
+ tryAcquire() {
5652
+ if (permits > 0) {
5653
+ permits--;
5654
+ return makeReleaseOnce();
5655
+ }
5656
+ return null;
5657
+ },
5658
+ async acquire(signal) {
5659
+ if (signal?.aborted) {
5660
+ throw signal.reason ?? new DOMException("Aborted", "AbortError");
5661
+ }
5662
+ if (permits > 0) {
5663
+ permits--;
5664
+ return makeReleaseOnce();
5665
+ }
5666
+ return new Promise((resolve2, reject) => {
5667
+ const onAbort = () => {
5668
+ const idx = waiters.indexOf(waiter);
5669
+ if (idx !== -1) {
5670
+ waiters.splice(idx, 1);
5671
+ waiter.cancel(
5672
+ signal?.reason ?? new DOMException("Aborted", "AbortError")
5673
+ );
5674
+ }
5675
+ };
5676
+ const waiter = {
5677
+ grant: () => {
5678
+ signal?.removeEventListener("abort", onAbort);
5679
+ resolve2(makeReleaseOnce());
5680
+ },
5681
+ cancel: (reason) => {
5682
+ signal?.removeEventListener("abort", onAbort);
5683
+ reject(reason);
5684
+ }
5685
+ };
5686
+ signal?.addEventListener("abort", onAbort);
5687
+ waiters.push(waiter);
5688
+ });
5689
+ }
5690
+ };
5691
+ }
5577
5692
  var ClientCredentialsObjectSchema = z.object({
5578
5693
  type: z.enum(["client_credentials"]).optional().meta({ internal: true }),
5579
5694
  clientId: z.string().describe("OAuth client ID for authentication.").meta({ valueHint: "id" }),
@@ -6168,7 +6283,7 @@ async function invalidateCredentialsToken(options) {
6168
6283
  }
6169
6284
 
6170
6285
  // src/sdk-version.ts
6171
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.51.0" : void 0) || "unknown";
6286
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.53.0" : void 0) || "unknown";
6172
6287
 
6173
6288
  // src/utils/open-url.ts
6174
6289
  var nodePrefix = "node:";
@@ -6378,9 +6493,61 @@ var ZapierApiClient = class {
6378
6493
  await sleep(delayMs, init?.signal ?? void 0);
6379
6494
  }
6380
6495
  };
6496
+ /**
6497
+ * Wrap an outbound HTTP call with the concurrency semaphore. Used by both
6498
+ * `rawFetch` (path-based) and the approval-poll path (absolute URL); each
6499
+ * caller acquires per-attempt, so 429 retry sleep is held but the gap
6500
+ * between approval polls and the human-approval wait are not.
6501
+ *
6502
+ * The release is registered in a finally that wraps the entire post-
6503
+ * acquire flow — including the `wait_end` event emission — so a throwing
6504
+ * `onEvent` handler can never leak a permit.
6505
+ *
6506
+ * Slot lifetime is intentionally tied to "fetch resolves" (headers
6507
+ * received), NOT to "response body fully consumed". WHATWG `fetch()`
6508
+ * resolves once headers are in; the body is still streaming. We rely on
6509
+ * that boundary so streaming responses (SSE, long-running chunked reads)
6510
+ * don't pin a permit for the lifetime of the stream — a single SSE
6511
+ * consumer would otherwise hold one of N slots for as long as the
6512
+ * connection stays open. Do not move the release into a path that awaits
6513
+ * body consumption (e.g. `parseResult` / `response.text()`); doing so
6514
+ * would silently break streaming consumers without failing any of the
6515
+ * short-request tests.
6516
+ */
6517
+ this.withSemaphore = async (context, fn) => {
6518
+ const fastRelease = this.semaphore.tryAcquire();
6519
+ let waitStart = null;
6520
+ let release = fastRelease;
6521
+ if (release === null) {
6522
+ waitStart = Date.now();
6523
+ this.emitEvent("api:concurrency_wait_start", {
6524
+ url: context.url,
6525
+ method: context.method
6526
+ });
6527
+ release = await this.semaphore.acquire(context.signal ?? void 0);
6528
+ }
6529
+ const acquiredRelease = release;
6530
+ try {
6531
+ if (waitStart !== null) {
6532
+ this.emitEvent("api:concurrency_wait_end", {
6533
+ url: context.url,
6534
+ method: context.method,
6535
+ waitedMs: Date.now() - waitStart
6536
+ });
6537
+ }
6538
+ return await fn();
6539
+ } finally {
6540
+ acquiredRelease();
6541
+ }
6542
+ };
6381
6543
  /**
6382
6544
  * Perform a request with auth, header merging, and rate-limit (429) retries.
6383
6545
  * Does NOT handle 403 approval_required — that's routed by `fetch`.
6546
+ *
6547
+ * Concurrency: a semaphore slot is held across the entire call, including
6548
+ * the 429 retry sleep inside `rawFetchUrl`. That keeps backpressure
6549
+ * coherent — when the server is rate-limiting us, we don't dump more
6550
+ * parallelism into the queue.
6384
6551
  */
6385
6552
  this.rawFetch = async (path, init) => {
6386
6553
  if (!path.startsWith("/")) {
@@ -6389,7 +6556,10 @@ var ZapierApiClient = class {
6389
6556
  );
6390
6557
  }
6391
6558
  const { url, pathConfig: pathConfig2 } = this.buildUrl(path, init?.searchParams);
6392
- return this.rawFetchUrl(url, init, pathConfig2);
6559
+ return this.withSemaphore(
6560
+ { url, method: init?.method ?? "GET", signal: init?.signal },
6561
+ () => this.rawFetchUrl(url, init, pathConfig2)
6562
+ );
6393
6563
  };
6394
6564
  /**
6395
6565
  * Approval-aware HTTP fetch.
@@ -6497,6 +6667,15 @@ var ZapierApiClient = class {
6497
6667
  };
6498
6668
  this.maxNetworkRetries = options.maxNetworkRetries ?? ZAPIER_MAX_NETWORK_RETRIES;
6499
6669
  this.maxNetworkRetryDelayMs = options.maxNetworkRetryDelayMs ?? ZAPIER_MAX_NETWORK_RETRY_DELAY_MS;
6670
+ const requested = options.maxConcurrentRequests;
6671
+ const limit = requested === void 0 || Number.isNaN(requested) ? ZAPIER_MAX_CONCURRENT_REQUESTS : requested;
6672
+ if (limit !== Infinity && (!Number.isInteger(limit) || limit < 1 || limit > MAX_CONCURRENCY_LIMIT)) {
6673
+ throw new ZapierConfigurationError(
6674
+ `Invalid maxConcurrentRequests: ${limit} (expected positive integer 1-${MAX_CONCURRENCY_LIMIT} or Infinity)`,
6675
+ { configType: "maxConcurrentRequests" }
6676
+ );
6677
+ }
6678
+ this.semaphore = createSemaphore(limit);
6500
6679
  }
6501
6680
  // Emit an event if onEvent handler is configured
6502
6681
  emitEvent(type, payload) {
@@ -6874,10 +7053,16 @@ var ZapierApiClient = class {
6874
7053
  // poll_url is an absolute URL supplied by the server, so we use
6875
7054
  // rawFetchUrl directly (skipping path resolution) but still share
6876
7055
  // auth + interactive-header + 429-retry with the rest of the SDK.
6877
- fetchPoll: () => this.rawFetchUrl(approval.poll_url, {
6878
- method: "GET",
6879
- headers: { Accept: "application/json" }
6880
- }),
7056
+ // Each individual poll request goes through the concurrency
7057
+ // semaphore — but we deliberately do not hold a slot across the
7058
+ // sleep between polls or across the human-approval wait.
7059
+ fetchPoll: () => this.withSemaphore(
7060
+ { url: approval.poll_url, method: "GET" },
7061
+ () => this.rawFetchUrl(approval.poll_url, {
7062
+ method: "GET",
7063
+ headers: { Accept: "application/json" }
7064
+ })
7065
+ ),
6881
7066
  timeoutMs,
6882
7067
  isPending: (body2) => {
6883
7068
  const parsed = PollApprovalResponseSchema.safeParse(body2);
@@ -6979,6 +7164,7 @@ var apiPlugin = definePlugin(
6979
7164
  debug = false,
6980
7165
  maxNetworkRetries = ZAPIER_MAX_NETWORK_RETRIES,
6981
7166
  maxNetworkRetryDelayMs = ZAPIER_MAX_NETWORK_RETRY_DELAY_MS,
7167
+ maxConcurrentRequests = ZAPIER_MAX_CONCURRENT_REQUESTS,
6982
7168
  approvalTimeoutMs,
6983
7169
  maxApprovalRetries,
6984
7170
  approvalMode,
@@ -6993,6 +7179,7 @@ var apiPlugin = definePlugin(
6993
7179
  onEvent,
6994
7180
  maxNetworkRetries,
6995
7181
  maxNetworkRetryDelayMs,
7182
+ maxConcurrentRequests,
6996
7183
  approvalTimeoutMs,
6997
7184
  maxApprovalRetries,
6998
7185
  approvalMode,
@@ -8878,6 +9065,24 @@ var BaseSdkOptionsSchema = z.object({
8878
9065
  * Default is 60000 (60 seconds).
8879
9066
  */
8880
9067
  maxNetworkRetryDelayMs: z.number().optional().describe("Max delay in ms to wait for retry (default: 60000).").meta({ valueHint: "ms" }),
9068
+ /**
9069
+ * Maximum number of concurrent in-flight HTTP requests per client.
9070
+ * Requests beyond this limit queue in FIFO order until a slot frees.
9071
+ * Pass `Infinity` to disable. Default: 200.
9072
+ *
9073
+ * The description and meta are duplicated across the outer wrapper and
9074
+ * the inner numeric branch because the SDK and CLI doc generators walk
9075
+ * the schema differently — the SDK reader looks at wrappers only, while
9076
+ * the CLI reader recurses into union branches.
9077
+ */
9078
+ maxConcurrentRequests: z.union([
9079
+ z.number().int().min(1).max(MAX_CONCURRENCY_LIMIT).describe(
9080
+ `Max concurrent in-flight HTTP requests (default: 200, max: ${MAX_CONCURRENCY_LIMIT}).`
9081
+ ).meta({ valueHint: "count" }),
9082
+ z.literal(Infinity)
9083
+ ]).optional().describe(
9084
+ `Max concurrent in-flight HTTP requests (default: 200, max: ${MAX_CONCURRENCY_LIMIT}).`
9085
+ ).meta({ valueHint: "count" }),
8881
9086
  approvalTimeoutMs: z.number().optional().describe("Timeout in ms for approval polling. Default: 600000 (10 min).").meta({ valueHint: "ms" }),
8882
9087
  maxApprovalRetries: z.number().optional().describe(
8883
9088
  "Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2."
@@ -8909,4 +9114,4 @@ var registryPlugin = definePlugin((_sdk) => {
8909
9114
  return {};
8910
9115
  });
8911
9116
 
8912
- 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_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, 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, 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, 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, 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, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, updateTableRecordsPlugin };
9117
+ 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, 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, 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, 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 };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/api/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAStD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CAAG;AAE3D,eAAO,MAAM,SAAS;aACH;QAAE,OAAO,EAAE,cAAc,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;CA6C7C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/api/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAUtD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CAAG;AAE3D,eAAO,MAAM,SAAS;aACH;QAAE,OAAO,EAAE,cAAc,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;CA+C7C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { createZapierApi } from "../../api";
2
2
  import { definePlugin } from "../../utils/plugin-utils";
3
3
  import { resolveCredentials } from "../../credentials";
4
- import { ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, } from "../../constants";
4
+ import { ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, } from "../../constants";
5
5
  export const apiPlugin = definePlugin((sdk) => {
6
6
  // Extract all options - everything passed to the plugin
7
- const { fetch: customFetch = globalThis.fetch, baseUrl = ZAPIER_BASE_URL, credentials, token, onEvent, debug = false, maxNetworkRetries = ZAPIER_MAX_NETWORK_RETRIES, maxNetworkRetryDelayMs = ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, approvalTimeoutMs, maxApprovalRetries, approvalMode, callerPackage, } = sdk.context.options;
7
+ const { fetch: customFetch = globalThis.fetch, baseUrl = ZAPIER_BASE_URL, credentials, token, onEvent, debug = false, maxNetworkRetries = ZAPIER_MAX_NETWORK_RETRIES, maxNetworkRetryDelayMs = ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, maxConcurrentRequests = ZAPIER_MAX_CONCURRENT_REQUESTS, approvalTimeoutMs, maxApprovalRetries, approvalMode, callerPackage, } = sdk.context.options;
8
8
  // Create the API client - it will handle token resolution internally
9
9
  const api = createZapierApi({
10
10
  baseUrl,
@@ -15,6 +15,7 @@ export const apiPlugin = definePlugin((sdk) => {
15
15
  onEvent,
16
16
  maxNetworkRetries,
17
17
  maxNetworkRetryDelayMs,
18
+ maxConcurrentRequests,
18
19
  approvalTimeoutMs,
19
20
  maxApprovalRetries,
20
21
  approvalMode,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/ackTriggerInboxMessages/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCzC,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG,UAAU,CAC5D,OAAO,6BAA6B,CACrC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/ackTriggerInboxMessages/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCzC,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG,UAAU,CAC5D,OAAO,6BAA6B,CACrC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
2
2
  import { AckTriggerInboxMessagesSchema, AckTriggerInboxMessagesItemSchema, } from "./schemas";
3
- import { triggerInboxResolver } from "../../../resolvers";
3
+ import { triggerInboxResolver, triggerMessagesResolver, } from "../../../resolvers";
4
4
  import { resolveTriggerInboxId } from "../utils";
5
5
  import { triggersDefaults } from "../shared";
6
6
  export const ackTriggerInboxMessagesPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
@@ -16,6 +16,7 @@ export const ackTriggerInboxMessagesPlugin = definePlugin((sdk) => createPluginM
16
16
  // most recent leaseTriggerInboxMessages caller knows the ID.
17
17
  // Static resolver prompts for free-text input.
18
18
  lease: { type: "static", inputType: "text" },
19
+ messages: triggerMessagesResolver,
19
20
  },
20
21
  handler: async ({ sdk, options }) => {
21
22
  const { inbox, lease, messages } = options;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/createTriggerInbox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,WAAW,CAAC;AAU7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAInE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;aAIpB;QACP,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgF/C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/createTriggerInbox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,WAAW,CAAC;AAU7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAInE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;aAIpB;QACP,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2E/C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -38,15 +38,12 @@ export const createTriggerInboxPlugin = definePlugin((sdk) => createPluginMethod
38
38
  app_key: selectedApi,
39
39
  action_key: actionKey,
40
40
  inputs,
41
+ connection_id: resolvedConnectionId ?? null,
41
42
  },
42
43
  };
43
44
  if (notificationUrl !== undefined) {
44
45
  requestBody.notification_url = notificationUrl;
45
46
  }
46
- if (resolvedConnectionId !== undefined &&
47
- resolvedConnectionId !== null) {
48
- requestBody.subscription.connection_id = resolvedConnectionId;
49
- }
50
47
  const rawResponse = await api.post("/trigger-inbox/api/v1/inboxes", requestBody, { authRequired: true });
51
48
  return { data: TriggerInboxItemSchema.parse(rawResponse) };
52
49
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/ensureTriggerInbox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,WAAW,CAAC;AAa7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAcnE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;aAIpB;QACP,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgG/C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/ensureTriggerInbox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,WAAW,CAAC;AAa7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAcnE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;aAIpB;QACP,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F/C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -51,15 +51,12 @@ export const ensureTriggerInboxPlugin = definePlugin((sdk) => createPluginMethod
51
51
  app_key: selectedApi,
52
52
  action_key: actionKey,
53
53
  inputs,
54
+ connection_id: resolvedConnectionId ?? null,
54
55
  },
55
56
  };
56
57
  if (notificationUrl !== undefined) {
57
58
  requestBody.notification_url = notificationUrl;
58
59
  }
59
- if (resolvedConnectionId !== undefined &&
60
- resolvedConnectionId !== null) {
61
- requestBody.subscription.connection_id = resolvedConnectionId;
62
- }
63
60
  const rawResponse = await api.post("/trigger-inbox/api/v1/inboxes", requestBody, {
64
61
  authRequired: true,
65
62
  customErrorHandler: ({ status, data }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/leaseTriggerInboxMessages/index.ts"],"names":[],"mappings":"AAqCA,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkD3C,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG,UAAU,CAC9D,OAAO,+BAA+B,CACvC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/leaseTriggerInboxMessages/index.ts"],"names":[],"mappings":"AAqCA,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsD3C,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG,UAAU,CAC9D,OAAO,+BAA+B,CACvC,CAAC"}
@@ -34,7 +34,11 @@ export const leaseTriggerInboxMessagesPlugin = definePlugin((sdk) => createPlugi
34
34
  itemType: "TriggerInboxLease",
35
35
  inputSchema: LeaseTriggerInboxMessagesSchema,
36
36
  outputSchema: LeaseTriggerInboxMessagesItemSchema,
37
- resolvers: { inbox: triggerInboxResolver },
37
+ resolvers: {
38
+ inbox: triggerInboxResolver,
39
+ leaseLimit: { type: "static", inputType: "text" },
40
+ leaseSeconds: { type: "static", inputType: "text" },
41
+ },
38
42
  handler: async ({ sdk, options }) => {
39
43
  const { inbox, leaseLimit, leaseSeconds, signal } = options;
40
44
  const inboxId = await resolveTriggerInboxId({
@@ -0,0 +1,70 @@
1
+ export declare const listTriggersPlugin: (sdk: {
2
+ listActions: (options?: (({
3
+ app: string;
4
+ actionType?: "filter" | "write" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | undefined;
5
+ pageSize?: number | undefined;
6
+ maxItems?: number | undefined;
7
+ cursor?: string | undefined;
8
+ } | {
9
+ appKey: string;
10
+ actionType?: "filter" | "write" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | undefined;
11
+ pageSize?: number | undefined;
12
+ maxItems?: number | undefined;
13
+ cursor?: string | undefined;
14
+ }) & {
15
+ cursor?: string;
16
+ pageSize?: number;
17
+ maxItems?: number;
18
+ }) | undefined) => import("../../..").PaginatedSdkResult<{
19
+ description: string;
20
+ key: string;
21
+ app_key: string;
22
+ action_type: "filter" | "write" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write";
23
+ title: string;
24
+ type: "action";
25
+ id?: string | undefined;
26
+ is_important?: boolean | undefined;
27
+ is_hidden?: boolean | undefined;
28
+ app_version?: string | undefined;
29
+ }>;
30
+ } & {
31
+ context: {
32
+ meta: {
33
+ listActions: import("../../..").PluginMeta;
34
+ };
35
+ };
36
+ } & {
37
+ context: {
38
+ meta: Record<string, import("../../..").PluginMeta>;
39
+ };
40
+ }) => {
41
+ listTriggers: (options?: ({
42
+ app: string;
43
+ pageSize?: number | undefined;
44
+ maxItems?: number | undefined;
45
+ cursor?: string | undefined;
46
+ } & {
47
+ cursor?: string;
48
+ pageSize?: number;
49
+ maxItems?: number;
50
+ }) | undefined) => import("../../..").PaginatedSdkResult<{
51
+ description: string;
52
+ key: string;
53
+ app_key: string;
54
+ action_type: "filter" | "write" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write";
55
+ title: string;
56
+ type: "action";
57
+ id?: string | undefined;
58
+ is_important?: boolean | undefined;
59
+ is_hidden?: boolean | undefined;
60
+ app_version?: string | undefined;
61
+ }>;
62
+ } & {
63
+ context: {
64
+ meta: {
65
+ listTriggers: import("../../..").PluginMeta;
66
+ };
67
+ };
68
+ };
69
+ export type ListTriggersPluginProvides = ReturnType<typeof listTriggersPlugin>;
70
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/listTriggers/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwB9B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { definePlugin, createPaginatedPluginMethod, } from "../../../utils/plugin-utils";
2
+ import { ListTriggersSchema } from "./schemas";
3
+ import { ActionItemSchema } from "../../../schemas/Action";
4
+ import { appKeyResolver } from "../../../resolvers";
5
+ import { triggersDefaults } from "../shared";
6
+ import { DEFAULT_PAGE_SIZE } from "../../../constants";
7
+ export const listTriggersPlugin = definePlugin((sdk) => createPaginatedPluginMethod(sdk, {
8
+ ...triggersDefaults,
9
+ name: "listTriggers",
10
+ type: "list",
11
+ itemType: "Action",
12
+ inputSchema: ListTriggersSchema,
13
+ outputSchema: ActionItemSchema,
14
+ defaultPageSize: DEFAULT_PAGE_SIZE,
15
+ resolvers: { app: appKeyResolver },
16
+ handler: async ({ sdk, options, }) => {
17
+ // Thin pass-through to listActions with actionType pinned to "read".
18
+ // Awaiting the paginated method returns the first page.
19
+ const result = await sdk.listActions({
20
+ ...options,
21
+ actionType: "read",
22
+ });
23
+ return { data: result.data, nextCursor: result.nextCursor };
24
+ },
25
+ }));
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ export declare const ListTriggersSchema: z.ZodObject<{
3
+ app: z.ZodString & {
4
+ _def: z.core.$ZodStringDef & import("../../..").PositionalMetadata;
5
+ };
6
+ pageSize: z.ZodOptional<z.ZodNumber>;
7
+ maxItems: z.ZodOptional<z.ZodNumber>;
8
+ cursor: z.ZodOptional<z.ZodString>;
9
+ }, z.core.$strip>;
10
+ export type ListTriggersOptions = z.infer<typeof ListTriggersSchema>;
11
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/listTriggers/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;;;iBAiBoB,CAAC;AAEpD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ import { AppPropertySchema } from "../../../types/properties";
3
+ export const ListTriggersSchema = z
4
+ .object({
5
+ app: AppPropertySchema.describe("App key of triggers to list (e.g., 'SlackCLIAPI' or slug like 'github')"),
6
+ pageSize: z
7
+ .number()
8
+ .min(1)
9
+ .optional()
10
+ .describe("Number of triggers per page"),
11
+ maxItems: z
12
+ .number()
13
+ .min(1)
14
+ .optional()
15
+ .describe("Maximum total items to return across all pages"),
16
+ cursor: z.string().optional().describe("Cursor to start from"),
17
+ })
18
+ .describe("List all triggers for a specific app");
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/releaseTriggerInboxMessages/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC7C,CAAC;AAEF,MAAM,MAAM,yCAAyC,GAAG,UAAU,CAChE,OAAO,iCAAiC,CACzC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/releaseTriggerInboxMessages/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C7C,CAAC;AAEF,MAAM,MAAM,yCAAyC,GAAG,UAAU,CAChE,OAAO,iCAAiC,CACzC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
2
2
  import { ReleaseTriggerInboxMessagesSchema, ReleaseTriggerInboxMessagesItemSchema, } from "./schemas";
3
- import { triggerInboxResolver } from "../../../resolvers";
3
+ import { triggerInboxResolver, triggerMessagesResolver, } from "../../../resolvers";
4
4
  import { resolveTriggerInboxId } from "../utils";
5
5
  import { triggersDefaults } from "../shared";
6
6
  export const releaseTriggerInboxMessagesPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
@@ -16,6 +16,7 @@ export const releaseTriggerInboxMessagesPlugin = definePlugin((sdk) => createPlu
16
16
  // most recent leaseTriggerInboxMessages caller knows the ID.
17
17
  // Static resolver prompts for free-text input.
18
18
  lease: { type: "static", inputType: "text" },
19
+ messages: triggerMessagesResolver,
19
20
  },
20
21
  handler: async ({ sdk, options }) => {
21
22
  const { inbox, lease, messages } = options;
@@ -12,6 +12,7 @@ export { clientCredentialsNameResolver } from "./clientCredentialsName";
12
12
  export { clientIdResolver } from "./clientId";
13
13
  export { tableIdResolver } from "./tableId";
14
14
  export { triggerInboxResolver } from "./triggerInbox";
15
+ export { triggerMessagesResolver } from "./triggerMessages";
15
16
  export { tableRecordIdResolver, tableRecordIdsResolver } from "./tableRecordId";
16
17
  export { tableFieldIdsResolver } from "./tableFieldIds";
17
18
  export { tableNameResolver } from "./tableName";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAGxB,mDAAmD;AACnD,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAClF,0DAA0D;AAC1D,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAGxB,mDAAmD;AACnD,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAClF,0DAA0D;AAC1D,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -14,6 +14,7 @@ export { clientCredentialsNameResolver } from "./clientCredentialsName";
14
14
  export { clientIdResolver } from "./clientId";
15
15
  export { tableIdResolver } from "./tableId";
16
16
  export { triggerInboxResolver } from "./triggerInbox";
17
+ export { triggerMessagesResolver } from "./triggerMessages";
17
18
  export { tableRecordIdResolver, tableRecordIdsResolver } from "./tableRecordId";
18
19
  export { tableFieldIdsResolver } from "./tableFieldIds";
19
20
  export { tableNameResolver } from "./tableName";
@@ -0,0 +1,6 @@
1
+ import type { DynamicResolver } from "../utils/schema-utils";
2
+ import type { TriggerMessageItem } from "../schemas/TriggerMessage";
3
+ export declare const triggerMessagesResolver: DynamicResolver<TriggerMessageItem, {
4
+ inbox: string;
5
+ }>;
6
+ //# sourceMappingURL=triggerMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggerMessages.d.ts","sourceRoot":"","sources":["../../src/resolvers/triggerMessages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAcpE,eAAO,MAAM,uBAAuB,EAAE,eAAe,CACnD,kBAAkB,EAClB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAwBlB,CAAC"}