@zapier/zapier-sdk 0.91.0 → 0.92.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.
@@ -823,7 +823,8 @@ function isSdkPage(value) {
823
823
  }
824
824
  function createPageFunction(coreFn, {
825
825
  sdk,
826
- adaptPage
826
+ adaptPage,
827
+ finalizePage
827
828
  }) {
828
829
  const functionName = coreFn.name + "Page";
829
830
  const namedFunctions = {
@@ -836,7 +837,7 @@ function createPageFunction(coreFn, {
836
837
  `${functionName}: paginated result must be exactly { data: TItem[], nextCursor? } (produced by the handler or its \`adaptPage\`); got keys [${page && typeof page === "object" ? Object.keys(page).join(", ") : typeof page}]. If the handler returns a raw shape, set \`adaptPage\` to translate it; if \`adaptPage\` already runs, it must return only \`data\`/\`nextCursor\`.`
837
838
  );
838
839
  }
839
- return page;
840
+ return finalizePage ? finalizePage(page) : page;
840
841
  } catch (error) {
841
842
  throw normalizeError(
842
843
  error,
@@ -855,9 +856,14 @@ function createPaginatedFunction(coreFn, options) {
855
856
  defaultPageSize,
856
857
  adaptPage,
857
858
  annotator,
859
+ finalizePage,
858
860
  getDeprecation
859
861
  } = options;
860
- const pageFunction = createPageFunction(coreFn, { sdk, adaptPage });
862
+ const pageFunction = createPageFunction(coreFn, {
863
+ sdk,
864
+ adaptPage,
865
+ finalizePage
866
+ });
861
867
  const functionName = name || coreFn.name;
862
868
  const namedFunctions = {
863
869
  [functionName]: function(callOptions) {
@@ -1374,6 +1380,7 @@ function defineMethod(config) {
1374
1380
  importBindings: deps.bindings,
1375
1381
  inputSchema: config.inputSchema,
1376
1382
  skipInputValidation: config.skipInputValidation,
1383
+ skipOutputValidation: config.skipOutputValidation,
1377
1384
  meta: collectLeafMeta(config),
1378
1385
  resolvers: config.resolvers,
1379
1386
  formatter: config.formatter,
@@ -1814,6 +1821,95 @@ var getRegistryPlugin = defineMethod({
1814
1821
  inputSchema: zod.z.object({ package: zod.z.string().optional() }).optional(),
1815
1822
  run: ({ imports, input }) => buildSurfaceRegistry(imports.context, input?.package)
1816
1823
  });
1824
+ function isRecord(value) {
1825
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1826
+ }
1827
+ function diffDroppedPaths(raw, parsed, prefix = "") {
1828
+ const paths = [];
1829
+ walkDroppedPaths(raw, parsed, prefix, paths);
1830
+ return paths;
1831
+ }
1832
+ function walkDroppedPaths(raw, parsed, prefix, out) {
1833
+ if (Array.isArray(raw) && Array.isArray(parsed)) {
1834
+ const seen = /* @__PURE__ */ new Set();
1835
+ const length = Math.min(raw.length, parsed.length);
1836
+ for (let index = 0; index < length; index++) {
1837
+ const elementPaths = [];
1838
+ walkDroppedPaths(raw[index], parsed[index], `${prefix}[]`, elementPaths);
1839
+ for (const path of elementPaths) {
1840
+ if (seen.has(path)) continue;
1841
+ seen.add(path);
1842
+ out.push(path);
1843
+ }
1844
+ }
1845
+ return;
1846
+ }
1847
+ if (isRecord(raw) && isRecord(parsed)) {
1848
+ for (const key of Object.keys(raw)) {
1849
+ const path = prefix ? `${prefix}.${key}` : key;
1850
+ if (!(key in parsed)) {
1851
+ out.push(path);
1852
+ continue;
1853
+ }
1854
+ walkDroppedPaths(raw[key], parsed[key], path, out);
1855
+ }
1856
+ return;
1857
+ }
1858
+ }
1859
+ function parseOutput(schema, value, policy, locator) {
1860
+ const result = schema.safeParse(value);
1861
+ if (result.success) return result.data;
1862
+ const issues = result.error.issues.map((issue) => {
1863
+ const path = issue.path.length > 0 ? issue.path.join(".") : "data";
1864
+ return `${path}: ${issue.message}`;
1865
+ });
1866
+ const subject = policy.methodName ? ` for "${policy.methodName}"` : "";
1867
+ const at = locator ? ` at ${locator}` : "";
1868
+ throw createCoreError(
1869
+ {
1870
+ code: CoreErrorCode.Validation,
1871
+ message: `Output validation failed${subject}${at}:
1872
+ ${issues.join("\n ")}
1873
+
1874
+ The response does not match the method's \`outputSchema\`. Correct the schema, or set \`skipOutputValidation: true\` on the method to pass the response through unvalidated.`,
1875
+ details: { zodErrors: result.error.issues, output: value }
1876
+ },
1877
+ policy.adaptError
1878
+ );
1879
+ }
1880
+ function applyItemOutputPolicy(result, policy) {
1881
+ const schema = policy.outputSchema;
1882
+ if (!schema || policy.skipOutputValidation) return result;
1883
+ if (!isRecord(result) || !("data" in result)) return result;
1884
+ const data = parseOutput(schema, result.data, policy);
1885
+ const next = { ...result, data };
1886
+ if (policy.includeOutputValidationDroppedPaths) {
1887
+ const droppedPaths = diffDroppedPaths(result.data, data);
1888
+ if (droppedPaths.length > 0) {
1889
+ next.meta = withOutputValidation(result.meta, droppedPaths);
1890
+ }
1891
+ }
1892
+ return next;
1893
+ }
1894
+ function withOutputValidation(existing, droppedPaths) {
1895
+ const base = isRecord(existing) ? existing : {};
1896
+ return { ...base, outputValidation: { droppedPaths } };
1897
+ }
1898
+ function applyListOutputPolicy(page, policy) {
1899
+ const schema = policy.outputSchema;
1900
+ if (!schema || policy.skipOutputValidation) return page;
1901
+ const data = page.data.map(
1902
+ (item, index) => parseOutput(schema, item, policy, `data[${index}]`)
1903
+ );
1904
+ const next = { ...page, data };
1905
+ if (policy.includeOutputValidationDroppedPaths) {
1906
+ const droppedPaths = diffDroppedPaths(page.data, data);
1907
+ if (droppedPaths.length > 0) {
1908
+ next.meta = { ...page.meta, outputValidation: { droppedPaths } };
1909
+ }
1910
+ }
1911
+ return next;
1912
+ }
1817
1913
  var FRAMEWORK_CONFIGURATION_IDS = /* @__PURE__ */ new Set([
1818
1914
  CORE_OPTIONS_ID
1819
1915
  ]);
@@ -1876,6 +1972,9 @@ function edgesOf(plugin) {
1876
1972
  function isStandIn(plugin) {
1877
1973
  return (plugin.pluginType === "method" || plugin.pluginType === "property" || plugin.pluginType === "aggregate") && plugin.standIn === true;
1878
1974
  }
1975
+ function isDefault(plugin) {
1976
+ return (plugin.pluginType === "method" || plugin.pluginType === "property") && plugin.defaultSource !== void 0;
1977
+ }
1879
1978
  function topoOrder(descriptors) {
1880
1979
  const order = [];
1881
1980
  const visited = /* @__PURE__ */ new Set();
@@ -1890,28 +1989,89 @@ function topoOrder(descriptors) {
1890
1989
  return order;
1891
1990
  }
1892
1991
  function collectPlugins(root, materialized = /* @__PURE__ */ new Set(), configuration) {
1992
+ const rank = (plugin) => isStandIn(plugin) ? 0 : isDefault(plugin) ? 1 : 2;
1993
+ const allNodes = [];
1994
+ const seen = /* @__PURE__ */ new Set();
1995
+ const collect = (plugin) => {
1996
+ if (materialized.has(plugin.id) || seen.has(plugin)) return;
1997
+ seen.add(plugin);
1998
+ allNodes.push(plugin);
1999
+ for (const edge of edgesOf(plugin)) collect(edge);
2000
+ };
2001
+ collect(root);
2002
+ const childrenOf = /* @__PURE__ */ new Map();
2003
+ const candidatesById = /* @__PURE__ */ new Map();
2004
+ for (const node of allNodes) {
2005
+ childrenOf.set(
2006
+ node,
2007
+ edgesOf(node).filter((edge) => seen.has(edge))
2008
+ );
2009
+ const candidates = candidatesById.get(node.id);
2010
+ if (candidates) candidates.push(node);
2011
+ else candidatesById.set(node.id, [node]);
2012
+ }
2013
+ const live = new Set(allNodes);
2014
+ for (; ; ) {
2015
+ const reachable = /* @__PURE__ */ new Set();
2016
+ if (live.has(root)) reachable.add(root);
2017
+ const queue = reachable.has(root) ? [root] : [];
2018
+ while (queue.length) {
2019
+ const node = queue.pop();
2020
+ for (const child of childrenOf.get(node) ?? []) {
2021
+ if (reachable.has(child)) continue;
2022
+ reachable.add(child);
2023
+ if (live.has(child)) queue.push(child);
2024
+ }
2025
+ }
2026
+ let changed = false;
2027
+ for (const node of live) {
2028
+ if (!reachable.has(node)) {
2029
+ live.delete(node);
2030
+ changed = true;
2031
+ }
2032
+ }
2033
+ for (const candidates of candidatesById.values()) {
2034
+ let maxRank = -1;
2035
+ for (const candidate of candidates) {
2036
+ if (live.has(candidate)) maxRank = Math.max(maxRank, rank(candidate));
2037
+ }
2038
+ if (maxRank < 0) continue;
2039
+ for (const candidate of candidates) {
2040
+ if (live.has(candidate) && rank(candidate) < maxRank) {
2041
+ live.delete(candidate);
2042
+ changed = true;
2043
+ }
2044
+ }
2045
+ }
2046
+ if (!changed) break;
2047
+ }
1893
2048
  const byId = /* @__PURE__ */ new Map();
1894
- const visit = (plugin) => {
1895
- if (materialized.has(plugin.id)) return;
1896
- const existing = byId.get(plugin.id);
1897
- if (existing === plugin) return;
1898
- if (existing) {
1899
- const bothReal = !isStandIn(existing) && !isStandIn(plugin);
1900
- if (bothReal) {
2049
+ const conflictedDefaults = /* @__PURE__ */ new Set();
2050
+ const isOptional = (plugin) => "optional" in plugin && plugin.optional === true;
2051
+ for (const [id, candidates] of candidatesById) {
2052
+ const liveCandidates = candidates.filter(
2053
+ (candidate) => live.has(candidate)
2054
+ );
2055
+ const winner = liveCandidates.find((candidate) => !isOptional(candidate)) ?? liveCandidates[0];
2056
+ if (!winner) continue;
2057
+ if (liveCandidates.length > 1) {
2058
+ const winnerRank = rank(winner);
2059
+ if (winnerRank === 2) {
1901
2060
  throw new Error(
1902
- `createSdk: duplicate plugin id "${plugin.id}". Two different plugins registered under the same id.`
2061
+ `createSdk: duplicate plugin id "${id}". Two different plugins registered under the same id.`
1903
2062
  );
1904
2063
  }
1905
- if (isStandIn(existing) && !isStandIn(plugin)) {
1906
- byId.set(plugin.id, plugin);
1907
- for (const edge of edgesOf(plugin)) visit(edge);
2064
+ if (winnerRank === 1) {
2065
+ const sources = new Set(
2066
+ liveCandidates.map(
2067
+ (candidate) => candidate.defaultSource
2068
+ )
2069
+ );
2070
+ if (sources.size > 1) conflictedDefaults.add(id);
1908
2071
  }
1909
- return;
1910
2072
  }
1911
- byId.set(plugin.id, plugin);
1912
- for (const edge of edgesOf(plugin)) visit(edge);
1913
- };
1914
- visit(root);
2073
+ byId.set(id, winner);
2074
+ }
1915
2075
  if (configuration) {
1916
2076
  for (const [id, value] of Object.entries(configuration)) {
1917
2077
  const existing = byId.get(id);
@@ -1962,6 +2122,14 @@ function collectPlugins(root, materialized = /* @__PURE__ */ new Set(), configur
1962
2122
  );
1963
2123
  }
1964
2124
  }
2125
+ for (const id of conflictedDefaults) {
2126
+ const winner = byId.get(id);
2127
+ if (winner && isDefault(winner)) {
2128
+ throw new Error(
2129
+ `createSdk: conflicting defaults for "${id}". Two different plugins were declared as defaults for the same id and nothing else provides it. Register an explicit (non-default) plugin for this id to choose the winner, or give the implementations distinct ids if they are meant to coexist.`
2130
+ );
2131
+ }
2132
+ }
1965
2133
  return byId;
1966
2134
  }
1967
2135
  function bindValue({
@@ -2284,6 +2452,7 @@ function buildMethodEntries(descriptors, context, states) {
2284
2452
  const plugins = context.plugins;
2285
2453
  for (const [id, descriptor] of descriptors) {
2286
2454
  if (descriptor.pluginType !== "method") continue;
2455
+ if (isStandIn(descriptor)) continue;
2287
2456
  const out = normalizeOutput(descriptor.output);
2288
2457
  const entry = {
2289
2458
  pluginType: "method",
@@ -2336,6 +2505,16 @@ function buildMethodEntries(descriptors, context, states) {
2336
2505
  const sdk = { context };
2337
2506
  const methodAnnotator = descriptor.annotator;
2338
2507
  const boundAnnotator = methodAnnotator ? (input) => methodAnnotator({ input }) : void 0;
2508
+ const outputPolicy = () => {
2509
+ const core = resolveCoreOptions(context);
2510
+ return {
2511
+ outputSchema: descriptor.meta?.outputSchema,
2512
+ skipOutputValidation: descriptor.skipOutputValidation,
2513
+ includeOutputValidationDroppedPaths: core?.includeOutputValidationDroppedPaths,
2514
+ methodName: descriptor.name,
2515
+ adaptError: core?.adaptError
2516
+ };
2517
+ };
2339
2518
  if (out.type === "list") {
2340
2519
  entry.value = createPaginatedFunction(
2341
2520
  fold(callRun),
@@ -2346,11 +2525,15 @@ function buildMethodEntries(descriptors, context, states) {
2346
2525
  defaultPageSize: out.defaultPageSize,
2347
2526
  adaptPage: out.adaptPage,
2348
2527
  annotator: boundAnnotator,
2528
+ // Validate + strip each item against the item `outputSchema`
2529
+ // (item mode's sibling); dropped paths surface as `[].x` in the page's
2530
+ // `meta`, unioned across items.
2531
+ finalizePage: (page) => applyListOutputPolicy(page, outputPolicy()),
2349
2532
  getDeprecation: () => entry.meta?.deprecation
2350
2533
  }
2351
2534
  );
2352
2535
  } else if (out.type === "item") {
2353
- const itemCore = async (input, ctx) => callRun(input, ctx);
2536
+ const itemCore = async (input, ctx) => applyItemOutputPolicy(await callRun(input, ctx), outputPolicy());
2354
2537
  entry.value = createFunction(
2355
2538
  fold(itemCore),
2356
2539
  {
@@ -4290,6 +4473,7 @@ var ZapierConflictError = class extends ZapierError {
4290
4473
  this.name = "ZapierConflictError";
4291
4474
  this.code = "ZAPIER_CONFLICT_ERROR";
4292
4475
  this.resourceType = options.resourceType;
4476
+ this.meta = options.meta;
4293
4477
  }
4294
4478
  };
4295
4479
  var ZapierRateLimitError = class extends ZapierError {
@@ -5999,7 +6183,7 @@ function parseDeprecationDate(value) {
5999
6183
  }
6000
6184
 
6001
6185
  // src/sdk-version.ts
6002
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.91.0" : void 0) || "unknown";
6186
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.92.0" : void 0) || "unknown";
6003
6187
 
6004
6188
  // src/utils/open-url.ts
6005
6189
  var nodePrefix = "node:";
@@ -9960,6 +10144,7 @@ var listActionsPlugin = defineMethod({
9960
10144
  itemType: "Action",
9961
10145
  inputSchema: ListActionsInputSchema,
9962
10146
  outputSchema: ActionItemSchema,
10147
+ skipOutputValidation: true,
9963
10148
  formatter: actionItemFormatter,
9964
10149
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
9965
10150
  // Only `app` carries a resolver: `actionType` is an optional filter, and the
@@ -10024,6 +10209,7 @@ var getActionPlugin = defineMethod({
10024
10209
  itemType: "Action",
10025
10210
  inputSchema: GetActionInputSchema,
10026
10211
  outputSchema: ActionItemSchema,
10212
+ skipOutputValidation: true,
10027
10213
  output: "item",
10028
10214
  formatter: actionItemFormatter,
10029
10215
  resolvers: {
@@ -10115,6 +10301,7 @@ var runActionPlugin = defineMethod({
10115
10301
  itemType: "ActionResult",
10116
10302
  inputSchema: RunActionInputSchema,
10117
10303
  outputSchema: ActionResultItemSchema,
10304
+ skipOutputValidation: true,
10118
10305
  formatter: actionResultItemFormatter,
10119
10306
  // No defaultPageSize — leave the default to the Actions API rather than
10120
10307
  // eagerly running more actions than the user intends (avoids app rate limits).
@@ -10230,12 +10417,18 @@ var runActionPlugin = defineMethod({
10230
10417
  timeoutMilliseconds
10231
10418
  });
10232
10419
  if (result.errors && result.errors.length > 0) {
10233
- const errorMessage2 = result.errors.map(
10234
- (error) => error.detail || error.title || "Unknown error"
10235
- ).join("; ");
10420
+ const errorMessage2 = result.errors.map((error) => error.detail || error.title || "Unknown error").join("; ");
10236
10421
  throw new ZapierActionError(`Action execution failed: ${errorMessage2}`, {
10237
10422
  appKey,
10238
- actionKey
10423
+ actionKey,
10424
+ errors: result.errors.map(
10425
+ (error) => ({
10426
+ status: 200,
10427
+ code: error.code ?? "unknown",
10428
+ title: error.title ?? "",
10429
+ detail: error.detail ?? ""
10430
+ })
10431
+ )
10239
10432
  });
10240
10433
  }
10241
10434
  return {
@@ -10435,7 +10628,8 @@ var appsPlugin = defineProperty({
10435
10628
  type: "list",
10436
10629
  inputSchema: ActionExecutionInputSchema,
10437
10630
  itemType: "ActionResult",
10438
- outputSchema: ActionResultItemSchema
10631
+ outputSchema: ActionResultItemSchema,
10632
+ skipOutputValidation: true
10439
10633
  }
10440
10634
  ]
10441
10635
  });
@@ -10483,6 +10677,7 @@ var listAppsPlugin = defineMethod({
10483
10677
  itemType: "App",
10484
10678
  inputSchema: ListAppsSchema,
10485
10679
  outputSchema: AppItemSchema,
10680
+ skipOutputValidation: true,
10486
10681
  formatter: appItemFormatter,
10487
10682
  output: {
10488
10683
  type: "list",
@@ -10840,6 +11035,7 @@ var listActionInputFieldsPlugin = defineMethod({
10840
11035
  itemType: "RootField",
10841
11036
  inputSchema: ListActionInputFieldsInputSchema,
10842
11037
  outputSchema: RootFieldItemSchema,
11038
+ skipOutputValidation: true,
10843
11039
  formatter: rootFieldItemFormatter,
10844
11040
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
10845
11041
  resolvers: {
@@ -10976,6 +11172,7 @@ var listActionInputFieldChoicesPlugin = defineMethod({
10976
11172
  itemType: "InputFieldChoice",
10977
11173
  inputSchema: ListActionInputFieldChoicesInputSchema,
10978
11174
  outputSchema: InputFieldChoiceItemSchema,
11175
+ skipOutputValidation: true,
10979
11176
  formatter: inputFieldChoiceItemFormatter,
10980
11177
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
10981
11178
  resolvers: {
@@ -11284,6 +11481,7 @@ var listConnectionsPlugin = defineMethod({
11284
11481
  itemType: "Connection",
11285
11482
  inputSchema: ListConnectionsQuerySchema,
11286
11483
  outputSchema: connections.ConnectionItemSchema,
11484
+ skipOutputValidation: true,
11287
11485
  formatter: connectionItemFormatter,
11288
11486
  // `app` is an optional, search-backed filter: the controller offers the app
11289
11487
  // search (skippable) so you can narrow connections to one app.
@@ -11425,6 +11623,7 @@ var listClientCredentialsPlugin = defineMethod({
11425
11623
  itemType: "ClientCredentials",
11426
11624
  inputSchema: ListClientCredentialsQuerySchema,
11427
11625
  outputSchema: ClientCredentialsItemSchema,
11626
+ skipOutputValidation: true,
11428
11627
  formatter: clientCredentialsItemFormatter,
11429
11628
  output: {
11430
11629
  type: "list",
@@ -11465,6 +11664,7 @@ var createClientCredentialsPlugin = defineMethod({
11465
11664
  itemType: "ClientCredentials",
11466
11665
  inputSchema: CreateClientCredentialsSchema,
11467
11666
  outputSchema: ClientCredentialsCreatedItemSchema,
11667
+ skipOutputValidation: true,
11468
11668
  formatter: clientCredentialsCreatedItemFormatter,
11469
11669
  confirm: "create-secret",
11470
11670
  output: "item",
@@ -11531,6 +11731,7 @@ var getAppPlugin = defineMethod({
11531
11731
  itemType: "App",
11532
11732
  inputSchema: GetAppInputSchema,
11533
11733
  outputSchema: AppItemSchema,
11734
+ skipOutputValidation: true,
11534
11735
  output: "item",
11535
11736
  formatter: appItemFormatter,
11536
11737
  resolvers: { app: appKeyResolver },
@@ -11568,6 +11769,7 @@ var getConnectionPlugin = defineMethod({
11568
11769
  itemType: "Connection",
11569
11770
  inputSchema: GetConnectionInputSchema,
11570
11771
  outputSchema: connections.ConnectionItemSchema,
11772
+ skipOutputValidation: true,
11571
11773
  output: "item",
11572
11774
  formatter: connectionItemFormatter,
11573
11775
  resolvers: { connection: connectionIdGenericResolver },
@@ -11605,6 +11807,7 @@ var findFirstConnectionPlugin = defineMethod({
11605
11807
  itemType: "Connection",
11606
11808
  inputSchema: FindFirstConnectionSchema,
11607
11809
  outputSchema: connections.ConnectionItemSchema,
11810
+ skipOutputValidation: true,
11608
11811
  output: "item",
11609
11812
  formatter: connectionItemFormatter,
11610
11813
  run: async ({ imports, input }) => {
@@ -11640,6 +11843,7 @@ var findUniqueConnectionPlugin = defineMethod({
11640
11843
  itemType: "Connection",
11641
11844
  inputSchema: FindUniqueConnectionSchema,
11642
11845
  outputSchema: connections.ConnectionItemSchema,
11846
+ skipOutputValidation: true,
11643
11847
  output: "item",
11644
11848
  formatter: connectionItemFormatter,
11645
11849
  run: async ({ imports, input }) => {
@@ -11768,6 +11972,7 @@ var getProfilePlugin = defineMethod({
11768
11972
  categories: ["account"],
11769
11973
  itemType: "Profile",
11770
11974
  outputSchema: UserProfileItemSchema,
11975
+ skipOutputValidation: true,
11771
11976
  run: async ({ imports }) => {
11772
11977
  const api = imports.api;
11773
11978
  const profile = await api.get("/zapier/api/v4/profile/", {
@@ -11826,6 +12031,7 @@ var getConnectionStartUrlPlugin = defineMethod({
11826
12031
  itemType: "ConnectionStartUrl",
11827
12032
  inputSchema: GetConnectionStartUrlSchema,
11828
12033
  outputSchema: GetConnectionStartUrlItemSchema,
12034
+ skipOutputValidation: true,
11829
12035
  output: "item",
11830
12036
  resolvers: { app: appKeyResolver },
11831
12037
  run: async ({ imports, input, annotate }) => {
@@ -11890,6 +12096,7 @@ var waitForNewConnectionPlugin = defineMethod({
11890
12096
  itemType: "Connection",
11891
12097
  inputSchema: WaitForNewConnectionSchema,
11892
12098
  outputSchema: WaitForNewConnectionItemSchema,
12099
+ skipOutputValidation: true,
11893
12100
  output: "item",
11894
12101
  resolvers: { app: appKeyResolver },
11895
12102
  run: async ({ imports, input, annotate }) => {
@@ -12003,6 +12210,7 @@ var createConnectionPlugin = defineMethod({
12003
12210
  itemType: "Connection",
12004
12211
  inputSchema: CreateConnectionSchema,
12005
12212
  outputSchema: CreateConnectionItemSchema,
12213
+ skipOutputValidation: true,
12006
12214
  output: "item",
12007
12215
  resolvers: { app: appKeyResolver },
12008
12216
  formatter: defineFormatter({
@@ -12068,6 +12276,10 @@ var listAuthenticationsPlugin = defineMethod({
12068
12276
  deprecation: { message: "Use listConnections instead." },
12069
12277
  itemType: "Connection",
12070
12278
  outputSchema: connections.ConnectionItemSchema,
12279
+ // Matches `listConnections`: an alias must not enforce a schema its target
12280
+ // passes through, or the deprecated name strips (or rejects) responses the
12281
+ // supported name returns intact.
12282
+ skipOutputValidation: true,
12071
12283
  formatter: connectionItemFormatter,
12072
12284
  run: async ({ imports, input }) => {
12073
12285
  return await imports.listConnections(input);
@@ -12085,6 +12297,10 @@ var getAuthenticationPlugin = defineMethod({
12085
12297
  type: "item",
12086
12298
  itemType: "Connection",
12087
12299
  outputSchema: connections.ConnectionItemSchema,
12300
+ // Inert while the output is `raw` (that mode never validates), set so every
12301
+ // method declaring an `outputSchema` states its stance, and so switching this
12302
+ // alias to `item` keeps mirroring `getConnection`'s opt-out.
12303
+ skipOutputValidation: true,
12088
12304
  formatter: connectionItemFormatter,
12089
12305
  run: ({ imports, input }) => {
12090
12306
  return imports.getConnection(input);
@@ -12102,6 +12318,7 @@ var findFirstAuthenticationPlugin = defineMethod({
12102
12318
  type: "item",
12103
12319
  itemType: "Connection",
12104
12320
  outputSchema: connections.ConnectionItemSchema,
12321
+ skipOutputValidation: true,
12105
12322
  formatter: connectionItemFormatter,
12106
12323
  run: ({ imports, input }) => {
12107
12324
  return imports.findFirstConnection(input);
@@ -12119,6 +12336,7 @@ var findUniqueAuthenticationPlugin = defineMethod({
12119
12336
  type: "item",
12120
12337
  itemType: "Connection",
12121
12338
  outputSchema: connections.ConnectionItemSchema,
12339
+ skipOutputValidation: true,
12122
12340
  formatter: connectionItemFormatter,
12123
12341
  run: ({ imports, input }) => {
12124
12342
  return imports.findUniqueConnection(input);
@@ -12140,6 +12358,10 @@ var listInputFieldsDeprecatedPlugin = defineMethod({
12140
12358
  deprecation: { message: "Use listActionInputFields instead." },
12141
12359
  itemType: "RootField",
12142
12360
  outputSchema: RootFieldItemSchema,
12361
+ // Matches `listActionInputFields`: an alias must not enforce a schema its
12362
+ // target passes through, or the deprecated name strips (or rejects)
12363
+ // responses the supported name returns intact.
12364
+ skipOutputValidation: true,
12143
12365
  formatter: rootFieldItemFormatter,
12144
12366
  run: async ({ imports, input }) => {
12145
12367
  return await imports.listActionInputFields(input);
@@ -12154,6 +12376,8 @@ var listInputFieldChoicesDeprecatedPlugin = defineMethod({
12154
12376
  deprecation: { message: "Use listActionInputFieldChoices instead." },
12155
12377
  itemType: "InputFieldChoiceItem",
12156
12378
  outputSchema: InputFieldChoiceItemSchema,
12379
+ // See `listInputFields` above: the alias mirrors its target's opt-out.
12380
+ skipOutputValidation: true,
12157
12381
  formatter: inputFieldChoiceItemFormatter,
12158
12382
  run: async ({ imports, input }) => {
12159
12383
  return await imports.listActionInputFieldChoices(input);
@@ -12321,6 +12545,7 @@ var createTriggerInboxPlugin = defineMethod({
12321
12545
  itemType: "TriggerInbox",
12322
12546
  inputSchema: CreateTriggerInboxSchema,
12323
12547
  outputSchema: TriggerInboxItemSchema,
12548
+ skipOutputValidation: true,
12324
12549
  output: "item",
12325
12550
  formatter: triggerInboxItemFormatter,
12326
12551
  annotator: deriveReadOperation,
@@ -12426,6 +12651,7 @@ var ensureTriggerInboxPlugin = defineMethod({
12426
12651
  itemType: "TriggerInbox",
12427
12652
  inputSchema: EnsureTriggerInboxInputSchema,
12428
12653
  outputSchema: TriggerInboxItemSchema,
12654
+ skipOutputValidation: true,
12429
12655
  output: "item",
12430
12656
  formatter: triggerInboxItemFormatter,
12431
12657
  annotator: deriveReadOperation,
@@ -12526,6 +12752,7 @@ var listTriggerInboxesPlugin = defineMethod({
12526
12752
  itemType: "TriggerInbox",
12527
12753
  inputSchema: ListTriggerInboxesSchema,
12528
12754
  outputSchema: TriggerInboxItemSchema,
12755
+ skipOutputValidation: true,
12529
12756
  // The handler returns a raw `{ data, next }` wire envelope, so `adaptPage`
12530
12757
  // normalizes it into an `SdkPage` (cursor pulled from the `next` URL).
12531
12758
  output: {
@@ -12573,6 +12800,7 @@ var getTriggerInboxPlugin = defineMethod({
12573
12800
  itemType: "TriggerInbox",
12574
12801
  inputSchema: GetTriggerInboxSchema,
12575
12802
  outputSchema: TriggerInboxItemSchema,
12803
+ skipOutputValidation: true,
12576
12804
  output: "item",
12577
12805
  formatter: triggerInboxItemFormatter,
12578
12806
  resolvers: { inbox: triggerInboxResolver },
@@ -12606,6 +12834,7 @@ var updateTriggerInboxPlugin = defineMethod({
12606
12834
  itemType: "TriggerInbox",
12607
12835
  inputSchema: UpdateTriggerInboxSchema,
12608
12836
  outputSchema: TriggerInboxItemSchema,
12837
+ skipOutputValidation: true,
12609
12838
  output: "item",
12610
12839
  formatter: triggerInboxItemFormatter,
12611
12840
  resolvers: { inbox: triggerInboxResolver },
@@ -12641,6 +12870,7 @@ var deleteTriggerInboxPlugin = defineMethod({
12641
12870
  itemType: "TriggerInbox",
12642
12871
  inputSchema: DeleteTriggerInboxSchema,
12643
12872
  outputSchema: TriggerInboxItemSchema,
12873
+ skipOutputValidation: true,
12644
12874
  // Delete returns the deleted inbox verbatim (the legacy `{ data }` surface),
12645
12875
  // so `output: "raw"` passes the handler's shape through unwrapped.
12646
12876
  output: "raw",
@@ -12675,6 +12905,7 @@ var pauseTriggerInboxPlugin = defineMethod({
12675
12905
  itemType: "TriggerInbox",
12676
12906
  inputSchema: PauseTriggerInboxSchema,
12677
12907
  outputSchema: TriggerInboxItemSchema,
12908
+ skipOutputValidation: true,
12678
12909
  output: "item",
12679
12910
  formatter: triggerInboxItemFormatter,
12680
12911
  resolvers: { inbox: triggerInboxResolver },
@@ -12706,6 +12937,7 @@ var resumeTriggerInboxPlugin = defineMethod({
12706
12937
  itemType: "TriggerInbox",
12707
12938
  inputSchema: ResumeTriggerInboxSchema,
12708
12939
  outputSchema: TriggerInboxItemSchema,
12940
+ skipOutputValidation: true,
12709
12941
  output: "item",
12710
12942
  formatter: triggerInboxItemFormatter,
12711
12943
  resolvers: { inbox: triggerInboxResolver },
@@ -12800,6 +13032,7 @@ var listTriggerInboxMessagesPlugin = defineMethod({
12800
13032
  itemType: "TriggerMessage",
12801
13033
  inputSchema: ListTriggerInboxMessagesSchema,
12802
13034
  outputSchema: TriggerMessageItemSchema,
13035
+ skipOutputValidation: true,
12803
13036
  // The handler returns a raw `{ data, next }` wire envelope, so `adaptPage`
12804
13037
  // normalizes it into an `SdkPage` (cursor pulled from the `next` URL).
12805
13038
  output: {
@@ -12875,6 +13108,7 @@ var leaseTriggerInboxMessagesPlugin = defineMethod({
12875
13108
  itemType: "TriggerInboxLease",
12876
13109
  inputSchema: LeaseTriggerInboxMessagesSchema,
12877
13110
  outputSchema: LeaseTriggerInboxMessagesItemSchema,
13111
+ skipOutputValidation: true,
12878
13112
  output: "item",
12879
13113
  resolvers: {
12880
13114
  inbox: triggerInboxResolver,
@@ -12936,6 +13170,7 @@ var ackTriggerInboxMessagesPlugin = defineMethod({
12936
13170
  itemType: "TriggerInboxAck",
12937
13171
  inputSchema: AckTriggerInboxMessagesSchema,
12938
13172
  outputSchema: AckTriggerInboxMessagesItemSchema,
13173
+ skipOutputValidation: true,
12939
13174
  output: "item",
12940
13175
  resolvers: {
12941
13176
  inbox: triggerInboxResolver,
@@ -12986,6 +13221,7 @@ var releaseTriggerInboxMessagesPlugin = defineMethod({
12986
13221
  itemType: "TriggerInboxRelease",
12987
13222
  inputSchema: ReleaseTriggerInboxMessagesSchema,
12988
13223
  outputSchema: ReleaseTriggerInboxMessagesItemSchema,
13224
+ skipOutputValidation: true,
12989
13225
  output: "item",
12990
13226
  resolvers: {
12991
13227
  inbox: triggerInboxResolver,
@@ -13698,6 +13934,7 @@ var listTriggersPlugin = defineMethod({
13698
13934
  itemType: "Action",
13699
13935
  inputSchema: ListTriggersSchema,
13700
13936
  outputSchema: ActionItemSchema,
13937
+ skipOutputValidation: true,
13701
13938
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
13702
13939
  formatter: actionItemFormatter,
13703
13940
  resolvers: { app: appKeyResolver },
@@ -13731,6 +13968,7 @@ var listTriggerInputFieldsPlugin = defineMethod({
13731
13968
  itemType: "RootField",
13732
13969
  inputSchema: ListTriggerInputFieldsSchema,
13733
13970
  outputSchema: RootFieldItemSchema,
13971
+ skipOutputValidation: true,
13734
13972
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
13735
13973
  formatter: rootFieldItemFormatter,
13736
13974
  annotator: deriveReadOperation,
@@ -13778,6 +14016,7 @@ var listTriggerInputFieldChoicesPlugin = defineMethod({
13778
14016
  itemType: "InputFieldChoice",
13779
14017
  inputSchema: ListTriggerInputFieldChoicesSchema,
13780
14018
  outputSchema: InputFieldChoiceItemSchema,
14019
+ skipOutputValidation: true,
13781
14020
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
13782
14021
  formatter: inputFieldChoiceItemFormatter,
13783
14022
  annotator: deriveReadOperation,
@@ -13965,6 +14204,7 @@ var listTablesPlugin = defineMethod({
13965
14204
  itemType: "Table",
13966
14205
  inputSchema: ListTablesOptionsSchema,
13967
14206
  outputSchema: TableItemSchema,
14207
+ skipOutputValidation: true,
13968
14208
  output: "list",
13969
14209
  run: async ({ imports, input }) => {
13970
14210
  return await imports.listTablesInternal({
@@ -13993,6 +14233,7 @@ var getTablePlugin = defineMethod({
13993
14233
  itemType: "Table",
13994
14234
  inputSchema: GetTableOptionsInputSchema,
13995
14235
  outputSchema: TableItemSchema,
14236
+ skipOutputValidation: true,
13996
14237
  output: "item",
13997
14238
  resolvers: { table: tableIdResolver },
13998
14239
  run: async ({ imports, input }) => {
@@ -14053,6 +14294,7 @@ var createTablePlugin = defineMethod({
14053
14294
  type: "create",
14054
14295
  inputSchema: CreateTableOptionsSchema,
14055
14296
  outputSchema: TableItemSchema,
14297
+ skipOutputValidation: true,
14056
14298
  output: "item",
14057
14299
  resolvers: { name: tableNameResolver },
14058
14300
  run: async ({ imports, input }) => {
@@ -14089,6 +14331,7 @@ var listTableFieldsPlugin = defineMethod({
14089
14331
  type: "list",
14090
14332
  inputSchema: ListTableFieldsOptionsInputSchema,
14091
14333
  outputSchema: FieldItemSchema,
14334
+ skipOutputValidation: true,
14092
14335
  output: "item",
14093
14336
  formatter: tableFieldItemFormatter,
14094
14337
  resolvers: { table: tableIdResolver },
@@ -14158,6 +14401,7 @@ var createTableFieldsPlugin = defineMethod({
14158
14401
  returnType: "FieldItem[]",
14159
14402
  inputSchema: CreateTableFieldsOptionsInputSchema,
14160
14403
  outputSchema: FieldItemSchema,
14404
+ skipOutputValidation: true,
14161
14405
  // Item output with an array payload: callers get `{ data: FieldItem[] }`
14162
14406
  // directly rather than a paginated list.
14163
14407
  output: "item",
@@ -14297,6 +14541,7 @@ var getTableRecordPlugin = defineMethod({
14297
14541
  itemType: "Record",
14298
14542
  inputSchema: GetTableRecordOptionsInputSchema,
14299
14543
  outputSchema: RecordItemSchema,
14544
+ skipOutputValidation: true,
14300
14545
  output: "item",
14301
14546
  resolvers: { table: tableIdResolver, record: tableRecordIdResolver },
14302
14547
  formatter: tableRecordFormatter,
@@ -14388,6 +14633,7 @@ var listTableRecordsPlugin = defineMethod({
14388
14633
  itemType: "Record",
14389
14634
  inputSchema: ListTableRecordsOptionsInputSchema,
14390
14635
  outputSchema: RecordItemSchema,
14636
+ skipOutputValidation: true,
14391
14637
  // The handler already returns a clean `{ data, nextCursor }` page, so the
14392
14638
  // standard list output (no `adaptPage`) applies.
14393
14639
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
@@ -14497,6 +14743,7 @@ var createTableRecordsPlugin = defineMethod({
14497
14743
  returnType: "RecordItem[]",
14498
14744
  inputSchema: CreateTableRecordsOptionsInputSchema,
14499
14745
  outputSchema: RecordItemSchema,
14746
+ skipOutputValidation: true,
14500
14747
  // Item output with an array payload: callers get `{ data: RecordItem[] }`
14501
14748
  // directly rather than a paginated list.
14502
14749
  output: "item",
@@ -14609,6 +14856,7 @@ var updateTableRecordsPlugin = defineMethod({
14609
14856
  returnType: "RecordItem[]",
14610
14857
  inputSchema: UpdateTableRecordsOptionsInputSchema,
14611
14858
  outputSchema: RecordItemSchema,
14859
+ skipOutputValidation: true,
14612
14860
  // Item output with an array payload: callers get `{ data: RecordItem[] }`
14613
14861
  // directly rather than a paginated list.
14614
14862
  output: "item",