@zapier/zapier-sdk 0.91.1 → 0.92.1

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.
@@ -821,7 +821,8 @@ function isSdkPage(value) {
821
821
  }
822
822
  function createPageFunction(coreFn, {
823
823
  sdk,
824
- adaptPage
824
+ adaptPage,
825
+ finalizePage
825
826
  }) {
826
827
  const functionName = coreFn.name + "Page";
827
828
  const namedFunctions = {
@@ -834,7 +835,7 @@ function createPageFunction(coreFn, {
834
835
  `${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\`.`
835
836
  );
836
837
  }
837
- return page;
838
+ return finalizePage ? finalizePage(page) : page;
838
839
  } catch (error) {
839
840
  throw normalizeError(
840
841
  error,
@@ -853,9 +854,14 @@ function createPaginatedFunction(coreFn, options) {
853
854
  defaultPageSize,
854
855
  adaptPage,
855
856
  annotator,
857
+ finalizePage,
856
858
  getDeprecation
857
859
  } = options;
858
- const pageFunction = createPageFunction(coreFn, { sdk, adaptPage });
860
+ const pageFunction = createPageFunction(coreFn, {
861
+ sdk,
862
+ adaptPage,
863
+ finalizePage
864
+ });
859
865
  const functionName = name || coreFn.name;
860
866
  const namedFunctions = {
861
867
  [functionName]: function(callOptions) {
@@ -1372,6 +1378,7 @@ function defineMethod(config) {
1372
1378
  importBindings: deps.bindings,
1373
1379
  inputSchema: config.inputSchema,
1374
1380
  skipInputValidation: config.skipInputValidation,
1381
+ skipOutputValidation: config.skipOutputValidation,
1375
1382
  meta: collectLeafMeta(config),
1376
1383
  resolvers: config.resolvers,
1377
1384
  formatter: config.formatter,
@@ -1812,6 +1819,95 @@ var getRegistryPlugin = defineMethod({
1812
1819
  inputSchema: z.object({ package: z.string().optional() }).optional(),
1813
1820
  run: ({ imports, input }) => buildSurfaceRegistry(imports.context, input?.package)
1814
1821
  });
1822
+ function isRecord(value) {
1823
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1824
+ }
1825
+ function diffDroppedPaths(raw, parsed, prefix = "") {
1826
+ const paths = [];
1827
+ walkDroppedPaths(raw, parsed, prefix, paths);
1828
+ return paths;
1829
+ }
1830
+ function walkDroppedPaths(raw, parsed, prefix, out) {
1831
+ if (Array.isArray(raw) && Array.isArray(parsed)) {
1832
+ const seen = /* @__PURE__ */ new Set();
1833
+ const length = Math.min(raw.length, parsed.length);
1834
+ for (let index = 0; index < length; index++) {
1835
+ const elementPaths = [];
1836
+ walkDroppedPaths(raw[index], parsed[index], `${prefix}[]`, elementPaths);
1837
+ for (const path of elementPaths) {
1838
+ if (seen.has(path)) continue;
1839
+ seen.add(path);
1840
+ out.push(path);
1841
+ }
1842
+ }
1843
+ return;
1844
+ }
1845
+ if (isRecord(raw) && isRecord(parsed)) {
1846
+ for (const key of Object.keys(raw)) {
1847
+ const path = prefix ? `${prefix}.${key}` : key;
1848
+ if (!(key in parsed)) {
1849
+ out.push(path);
1850
+ continue;
1851
+ }
1852
+ walkDroppedPaths(raw[key], parsed[key], path, out);
1853
+ }
1854
+ return;
1855
+ }
1856
+ }
1857
+ function parseOutput(schema, value, policy, locator) {
1858
+ const result = schema.safeParse(value);
1859
+ if (result.success) return result.data;
1860
+ const issues = result.error.issues.map((issue) => {
1861
+ const path = issue.path.length > 0 ? issue.path.join(".") : "data";
1862
+ return `${path}: ${issue.message}`;
1863
+ });
1864
+ const subject = policy.methodName ? ` for "${policy.methodName}"` : "";
1865
+ const at = locator ? ` at ${locator}` : "";
1866
+ throw createCoreError(
1867
+ {
1868
+ code: CoreErrorCode.Validation,
1869
+ message: `Output validation failed${subject}${at}:
1870
+ ${issues.join("\n ")}
1871
+
1872
+ 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.`,
1873
+ details: { zodErrors: result.error.issues, output: value }
1874
+ },
1875
+ policy.adaptError
1876
+ );
1877
+ }
1878
+ function applyItemOutputPolicy(result, policy) {
1879
+ const schema = policy.outputSchema;
1880
+ if (!schema || policy.skipOutputValidation) return result;
1881
+ if (!isRecord(result) || !("data" in result)) return result;
1882
+ const data = parseOutput(schema, result.data, policy);
1883
+ const next = { ...result, data };
1884
+ if (policy.includeOutputValidationDroppedPaths) {
1885
+ const droppedPaths = diffDroppedPaths(result.data, data);
1886
+ if (droppedPaths.length > 0) {
1887
+ next.meta = withOutputValidation(result.meta, droppedPaths);
1888
+ }
1889
+ }
1890
+ return next;
1891
+ }
1892
+ function withOutputValidation(existing, droppedPaths) {
1893
+ const base = isRecord(existing) ? existing : {};
1894
+ return { ...base, outputValidation: { droppedPaths } };
1895
+ }
1896
+ function applyListOutputPolicy(page, policy) {
1897
+ const schema = policy.outputSchema;
1898
+ if (!schema || policy.skipOutputValidation) return page;
1899
+ const data = page.data.map(
1900
+ (item, index) => parseOutput(schema, item, policy, `data[${index}]`)
1901
+ );
1902
+ const next = { ...page, data };
1903
+ if (policy.includeOutputValidationDroppedPaths) {
1904
+ const droppedPaths = diffDroppedPaths(page.data, data);
1905
+ if (droppedPaths.length > 0) {
1906
+ next.meta = { ...page.meta, outputValidation: { droppedPaths } };
1907
+ }
1908
+ }
1909
+ return next;
1910
+ }
1815
1911
  var FRAMEWORK_CONFIGURATION_IDS = /* @__PURE__ */ new Set([
1816
1912
  CORE_OPTIONS_ID
1817
1913
  ]);
@@ -1874,6 +1970,9 @@ function edgesOf(plugin) {
1874
1970
  function isStandIn(plugin) {
1875
1971
  return (plugin.pluginType === "method" || plugin.pluginType === "property" || plugin.pluginType === "aggregate") && plugin.standIn === true;
1876
1972
  }
1973
+ function isDefault(plugin) {
1974
+ return (plugin.pluginType === "method" || plugin.pluginType === "property") && plugin.defaultSource !== void 0;
1975
+ }
1877
1976
  function topoOrder(descriptors) {
1878
1977
  const order = [];
1879
1978
  const visited = /* @__PURE__ */ new Set();
@@ -1888,28 +1987,89 @@ function topoOrder(descriptors) {
1888
1987
  return order;
1889
1988
  }
1890
1989
  function collectPlugins(root, materialized = /* @__PURE__ */ new Set(), configuration) {
1990
+ const rank = (plugin) => isStandIn(plugin) ? 0 : isDefault(plugin) ? 1 : 2;
1991
+ const allNodes = [];
1992
+ const seen = /* @__PURE__ */ new Set();
1993
+ const collect = (plugin) => {
1994
+ if (materialized.has(plugin.id) || seen.has(plugin)) return;
1995
+ seen.add(plugin);
1996
+ allNodes.push(plugin);
1997
+ for (const edge of edgesOf(plugin)) collect(edge);
1998
+ };
1999
+ collect(root);
2000
+ const childrenOf = /* @__PURE__ */ new Map();
2001
+ const candidatesById = /* @__PURE__ */ new Map();
2002
+ for (const node of allNodes) {
2003
+ childrenOf.set(
2004
+ node,
2005
+ edgesOf(node).filter((edge) => seen.has(edge))
2006
+ );
2007
+ const candidates = candidatesById.get(node.id);
2008
+ if (candidates) candidates.push(node);
2009
+ else candidatesById.set(node.id, [node]);
2010
+ }
2011
+ const live = new Set(allNodes);
2012
+ for (; ; ) {
2013
+ const reachable = /* @__PURE__ */ new Set();
2014
+ if (live.has(root)) reachable.add(root);
2015
+ const queue = reachable.has(root) ? [root] : [];
2016
+ while (queue.length) {
2017
+ const node = queue.pop();
2018
+ for (const child of childrenOf.get(node) ?? []) {
2019
+ if (reachable.has(child)) continue;
2020
+ reachable.add(child);
2021
+ if (live.has(child)) queue.push(child);
2022
+ }
2023
+ }
2024
+ let changed = false;
2025
+ for (const node of live) {
2026
+ if (!reachable.has(node)) {
2027
+ live.delete(node);
2028
+ changed = true;
2029
+ }
2030
+ }
2031
+ for (const candidates of candidatesById.values()) {
2032
+ let maxRank = -1;
2033
+ for (const candidate of candidates) {
2034
+ if (live.has(candidate)) maxRank = Math.max(maxRank, rank(candidate));
2035
+ }
2036
+ if (maxRank < 0) continue;
2037
+ for (const candidate of candidates) {
2038
+ if (live.has(candidate) && rank(candidate) < maxRank) {
2039
+ live.delete(candidate);
2040
+ changed = true;
2041
+ }
2042
+ }
2043
+ }
2044
+ if (!changed) break;
2045
+ }
1891
2046
  const byId = /* @__PURE__ */ new Map();
1892
- const visit = (plugin) => {
1893
- if (materialized.has(plugin.id)) return;
1894
- const existing = byId.get(plugin.id);
1895
- if (existing === plugin) return;
1896
- if (existing) {
1897
- const bothReal = !isStandIn(existing) && !isStandIn(plugin);
1898
- if (bothReal) {
2047
+ const conflictedDefaults = /* @__PURE__ */ new Set();
2048
+ const isOptional = (plugin) => "optional" in plugin && plugin.optional === true;
2049
+ for (const [id, candidates] of candidatesById) {
2050
+ const liveCandidates = candidates.filter(
2051
+ (candidate) => live.has(candidate)
2052
+ );
2053
+ const winner = liveCandidates.find((candidate) => !isOptional(candidate)) ?? liveCandidates[0];
2054
+ if (!winner) continue;
2055
+ if (liveCandidates.length > 1) {
2056
+ const winnerRank = rank(winner);
2057
+ if (winnerRank === 2) {
1899
2058
  throw new Error(
1900
- `createSdk: duplicate plugin id "${plugin.id}". Two different plugins registered under the same id.`
2059
+ `createSdk: duplicate plugin id "${id}". Two different plugins registered under the same id.`
1901
2060
  );
1902
2061
  }
1903
- if (isStandIn(existing) && !isStandIn(plugin)) {
1904
- byId.set(plugin.id, plugin);
1905
- for (const edge of edgesOf(plugin)) visit(edge);
2062
+ if (winnerRank === 1) {
2063
+ const sources = new Set(
2064
+ liveCandidates.map(
2065
+ (candidate) => candidate.defaultSource
2066
+ )
2067
+ );
2068
+ if (sources.size > 1) conflictedDefaults.add(id);
1906
2069
  }
1907
- return;
1908
2070
  }
1909
- byId.set(plugin.id, plugin);
1910
- for (const edge of edgesOf(plugin)) visit(edge);
1911
- };
1912
- visit(root);
2071
+ byId.set(id, winner);
2072
+ }
1913
2073
  if (configuration) {
1914
2074
  for (const [id, value] of Object.entries(configuration)) {
1915
2075
  const existing = byId.get(id);
@@ -1960,6 +2120,14 @@ function collectPlugins(root, materialized = /* @__PURE__ */ new Set(), configur
1960
2120
  );
1961
2121
  }
1962
2122
  }
2123
+ for (const id of conflictedDefaults) {
2124
+ const winner = byId.get(id);
2125
+ if (winner && isDefault(winner)) {
2126
+ throw new Error(
2127
+ `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.`
2128
+ );
2129
+ }
2130
+ }
1963
2131
  return byId;
1964
2132
  }
1965
2133
  function bindValue({
@@ -2282,6 +2450,7 @@ function buildMethodEntries(descriptors, context, states) {
2282
2450
  const plugins = context.plugins;
2283
2451
  for (const [id, descriptor] of descriptors) {
2284
2452
  if (descriptor.pluginType !== "method") continue;
2453
+ if (isStandIn(descriptor)) continue;
2285
2454
  const out = normalizeOutput(descriptor.output);
2286
2455
  const entry = {
2287
2456
  pluginType: "method",
@@ -2334,6 +2503,16 @@ function buildMethodEntries(descriptors, context, states) {
2334
2503
  const sdk = { context };
2335
2504
  const methodAnnotator = descriptor.annotator;
2336
2505
  const boundAnnotator = methodAnnotator ? (input) => methodAnnotator({ input }) : void 0;
2506
+ const outputPolicy = () => {
2507
+ const core = resolveCoreOptions(context);
2508
+ return {
2509
+ outputSchema: descriptor.meta?.outputSchema,
2510
+ skipOutputValidation: descriptor.skipOutputValidation,
2511
+ includeOutputValidationDroppedPaths: core?.includeOutputValidationDroppedPaths,
2512
+ methodName: descriptor.name,
2513
+ adaptError: core?.adaptError
2514
+ };
2515
+ };
2337
2516
  if (out.type === "list") {
2338
2517
  entry.value = createPaginatedFunction(
2339
2518
  fold(callRun),
@@ -2344,11 +2523,15 @@ function buildMethodEntries(descriptors, context, states) {
2344
2523
  defaultPageSize: out.defaultPageSize,
2345
2524
  adaptPage: out.adaptPage,
2346
2525
  annotator: boundAnnotator,
2526
+ // Validate + strip each item against the item `outputSchema`
2527
+ // (item mode's sibling); dropped paths surface as `[].x` in the page's
2528
+ // `meta`, unioned across items.
2529
+ finalizePage: (page) => applyListOutputPolicy(page, outputPolicy()),
2347
2530
  getDeprecation: () => entry.meta?.deprecation
2348
2531
  }
2349
2532
  );
2350
2533
  } else if (out.type === "item") {
2351
- const itemCore = async (input, ctx) => callRun(input, ctx);
2534
+ const itemCore = async (input, ctx) => applyItemOutputPolicy(await callRun(input, ctx), outputPolicy());
2352
2535
  entry.value = createFunction(
2353
2536
  fold(itemCore),
2354
2537
  {
@@ -4288,6 +4471,7 @@ var ZapierConflictError = class extends ZapierError {
4288
4471
  this.name = "ZapierConflictError";
4289
4472
  this.code = "ZAPIER_CONFLICT_ERROR";
4290
4473
  this.resourceType = options.resourceType;
4474
+ this.meta = options.meta;
4291
4475
  }
4292
4476
  };
4293
4477
  var ZapierRateLimitError = class extends ZapierError {
@@ -5997,7 +6181,7 @@ function parseDeprecationDate(value) {
5997
6181
  }
5998
6182
 
5999
6183
  // src/sdk-version.ts
6000
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.91.1" : void 0) || "unknown";
6184
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.92.1" : void 0) || "unknown";
6001
6185
 
6002
6186
  // src/utils/open-url.ts
6003
6187
  var nodePrefix = "node:";
@@ -9958,6 +10142,7 @@ var listActionsPlugin = defineMethod({
9958
10142
  itemType: "Action",
9959
10143
  inputSchema: ListActionsInputSchema,
9960
10144
  outputSchema: ActionItemSchema,
10145
+ skipOutputValidation: true,
9961
10146
  formatter: actionItemFormatter,
9962
10147
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
9963
10148
  // Only `app` carries a resolver: `actionType` is an optional filter, and the
@@ -10022,6 +10207,7 @@ var getActionPlugin = defineMethod({
10022
10207
  itemType: "Action",
10023
10208
  inputSchema: GetActionInputSchema,
10024
10209
  outputSchema: ActionItemSchema,
10210
+ skipOutputValidation: true,
10025
10211
  output: "item",
10026
10212
  formatter: actionItemFormatter,
10027
10213
  resolvers: {
@@ -10113,6 +10299,7 @@ var runActionPlugin = defineMethod({
10113
10299
  itemType: "ActionResult",
10114
10300
  inputSchema: RunActionInputSchema,
10115
10301
  outputSchema: ActionResultItemSchema,
10302
+ skipOutputValidation: true,
10116
10303
  formatter: actionResultItemFormatter,
10117
10304
  // No defaultPageSize — leave the default to the Actions API rather than
10118
10305
  // eagerly running more actions than the user intends (avoids app rate limits).
@@ -10439,7 +10626,8 @@ var appsPlugin = defineProperty({
10439
10626
  type: "list",
10440
10627
  inputSchema: ActionExecutionInputSchema,
10441
10628
  itemType: "ActionResult",
10442
- outputSchema: ActionResultItemSchema
10629
+ outputSchema: ActionResultItemSchema,
10630
+ skipOutputValidation: true
10443
10631
  }
10444
10632
  ]
10445
10633
  });
@@ -10487,6 +10675,7 @@ var listAppsPlugin = defineMethod({
10487
10675
  itemType: "App",
10488
10676
  inputSchema: ListAppsSchema,
10489
10677
  outputSchema: AppItemSchema,
10678
+ skipOutputValidation: true,
10490
10679
  formatter: appItemFormatter,
10491
10680
  output: {
10492
10681
  type: "list",
@@ -10844,6 +11033,7 @@ var listActionInputFieldsPlugin = defineMethod({
10844
11033
  itemType: "RootField",
10845
11034
  inputSchema: ListActionInputFieldsInputSchema,
10846
11035
  outputSchema: RootFieldItemSchema,
11036
+ skipOutputValidation: true,
10847
11037
  formatter: rootFieldItemFormatter,
10848
11038
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
10849
11039
  resolvers: {
@@ -10980,6 +11170,7 @@ var listActionInputFieldChoicesPlugin = defineMethod({
10980
11170
  itemType: "InputFieldChoice",
10981
11171
  inputSchema: ListActionInputFieldChoicesInputSchema,
10982
11172
  outputSchema: InputFieldChoiceItemSchema,
11173
+ skipOutputValidation: true,
10983
11174
  formatter: inputFieldChoiceItemFormatter,
10984
11175
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
10985
11176
  resolvers: {
@@ -11288,6 +11479,7 @@ var listConnectionsPlugin = defineMethod({
11288
11479
  itemType: "Connection",
11289
11480
  inputSchema: ListConnectionsQuerySchema,
11290
11481
  outputSchema: ConnectionItemSchema,
11482
+ skipOutputValidation: true,
11291
11483
  formatter: connectionItemFormatter,
11292
11484
  // `app` is an optional, search-backed filter: the controller offers the app
11293
11485
  // search (skippable) so you can narrow connections to one app.
@@ -11429,6 +11621,7 @@ var listClientCredentialsPlugin = defineMethod({
11429
11621
  itemType: "ClientCredentials",
11430
11622
  inputSchema: ListClientCredentialsQuerySchema,
11431
11623
  outputSchema: ClientCredentialsItemSchema,
11624
+ skipOutputValidation: true,
11432
11625
  formatter: clientCredentialsItemFormatter,
11433
11626
  output: {
11434
11627
  type: "list",
@@ -11469,6 +11662,7 @@ var createClientCredentialsPlugin = defineMethod({
11469
11662
  itemType: "ClientCredentials",
11470
11663
  inputSchema: CreateClientCredentialsSchema,
11471
11664
  outputSchema: ClientCredentialsCreatedItemSchema,
11665
+ skipOutputValidation: true,
11472
11666
  formatter: clientCredentialsCreatedItemFormatter,
11473
11667
  confirm: "create-secret",
11474
11668
  output: "item",
@@ -11535,6 +11729,7 @@ var getAppPlugin = defineMethod({
11535
11729
  itemType: "App",
11536
11730
  inputSchema: GetAppInputSchema,
11537
11731
  outputSchema: AppItemSchema,
11732
+ skipOutputValidation: true,
11538
11733
  output: "item",
11539
11734
  formatter: appItemFormatter,
11540
11735
  resolvers: { app: appKeyResolver },
@@ -11572,6 +11767,7 @@ var getConnectionPlugin = defineMethod({
11572
11767
  itemType: "Connection",
11573
11768
  inputSchema: GetConnectionInputSchema,
11574
11769
  outputSchema: ConnectionItemSchema,
11770
+ skipOutputValidation: true,
11575
11771
  output: "item",
11576
11772
  formatter: connectionItemFormatter,
11577
11773
  resolvers: { connection: connectionIdGenericResolver },
@@ -11609,6 +11805,7 @@ var findFirstConnectionPlugin = defineMethod({
11609
11805
  itemType: "Connection",
11610
11806
  inputSchema: FindFirstConnectionSchema,
11611
11807
  outputSchema: ConnectionItemSchema,
11808
+ skipOutputValidation: true,
11612
11809
  output: "item",
11613
11810
  formatter: connectionItemFormatter,
11614
11811
  run: async ({ imports, input }) => {
@@ -11644,6 +11841,7 @@ var findUniqueConnectionPlugin = defineMethod({
11644
11841
  itemType: "Connection",
11645
11842
  inputSchema: FindUniqueConnectionSchema,
11646
11843
  outputSchema: ConnectionItemSchema,
11844
+ skipOutputValidation: true,
11647
11845
  output: "item",
11648
11846
  formatter: connectionItemFormatter,
11649
11847
  run: async ({ imports, input }) => {
@@ -11772,6 +11970,7 @@ var getProfilePlugin = defineMethod({
11772
11970
  categories: ["account"],
11773
11971
  itemType: "Profile",
11774
11972
  outputSchema: UserProfileItemSchema,
11973
+ skipOutputValidation: true,
11775
11974
  run: async ({ imports }) => {
11776
11975
  const api = imports.api;
11777
11976
  const profile = await api.get("/zapier/api/v4/profile/", {
@@ -11830,6 +12029,7 @@ var getConnectionStartUrlPlugin = defineMethod({
11830
12029
  itemType: "ConnectionStartUrl",
11831
12030
  inputSchema: GetConnectionStartUrlSchema,
11832
12031
  outputSchema: GetConnectionStartUrlItemSchema,
12032
+ skipOutputValidation: true,
11833
12033
  output: "item",
11834
12034
  resolvers: { app: appKeyResolver },
11835
12035
  run: async ({ imports, input, annotate }) => {
@@ -11894,6 +12094,7 @@ var waitForNewConnectionPlugin = defineMethod({
11894
12094
  itemType: "Connection",
11895
12095
  inputSchema: WaitForNewConnectionSchema,
11896
12096
  outputSchema: WaitForNewConnectionItemSchema,
12097
+ skipOutputValidation: true,
11897
12098
  output: "item",
11898
12099
  resolvers: { app: appKeyResolver },
11899
12100
  run: async ({ imports, input, annotate }) => {
@@ -12007,6 +12208,7 @@ var createConnectionPlugin = defineMethod({
12007
12208
  itemType: "Connection",
12008
12209
  inputSchema: CreateConnectionSchema,
12009
12210
  outputSchema: CreateConnectionItemSchema,
12211
+ skipOutputValidation: true,
12010
12212
  output: "item",
12011
12213
  resolvers: { app: appKeyResolver },
12012
12214
  formatter: defineFormatter({
@@ -12072,6 +12274,10 @@ var listAuthenticationsPlugin = defineMethod({
12072
12274
  deprecation: { message: "Use listConnections instead." },
12073
12275
  itemType: "Connection",
12074
12276
  outputSchema: ConnectionItemSchema,
12277
+ // Matches `listConnections`: an alias must not enforce a schema its target
12278
+ // passes through, or the deprecated name strips (or rejects) responses the
12279
+ // supported name returns intact.
12280
+ skipOutputValidation: true,
12075
12281
  formatter: connectionItemFormatter,
12076
12282
  run: async ({ imports, input }) => {
12077
12283
  return await imports.listConnections(input);
@@ -12089,6 +12295,10 @@ var getAuthenticationPlugin = defineMethod({
12089
12295
  type: "item",
12090
12296
  itemType: "Connection",
12091
12297
  outputSchema: ConnectionItemSchema,
12298
+ // Inert while the output is `raw` (that mode never validates), set so every
12299
+ // method declaring an `outputSchema` states its stance, and so switching this
12300
+ // alias to `item` keeps mirroring `getConnection`'s opt-out.
12301
+ skipOutputValidation: true,
12092
12302
  formatter: connectionItemFormatter,
12093
12303
  run: ({ imports, input }) => {
12094
12304
  return imports.getConnection(input);
@@ -12106,6 +12316,7 @@ var findFirstAuthenticationPlugin = defineMethod({
12106
12316
  type: "item",
12107
12317
  itemType: "Connection",
12108
12318
  outputSchema: ConnectionItemSchema,
12319
+ skipOutputValidation: true,
12109
12320
  formatter: connectionItemFormatter,
12110
12321
  run: ({ imports, input }) => {
12111
12322
  return imports.findFirstConnection(input);
@@ -12123,6 +12334,7 @@ var findUniqueAuthenticationPlugin = defineMethod({
12123
12334
  type: "item",
12124
12335
  itemType: "Connection",
12125
12336
  outputSchema: ConnectionItemSchema,
12337
+ skipOutputValidation: true,
12126
12338
  formatter: connectionItemFormatter,
12127
12339
  run: ({ imports, input }) => {
12128
12340
  return imports.findUniqueConnection(input);
@@ -12144,6 +12356,10 @@ var listInputFieldsDeprecatedPlugin = defineMethod({
12144
12356
  deprecation: { message: "Use listActionInputFields instead." },
12145
12357
  itemType: "RootField",
12146
12358
  outputSchema: RootFieldItemSchema,
12359
+ // Matches `listActionInputFields`: an alias must not enforce a schema its
12360
+ // target passes through, or the deprecated name strips (or rejects)
12361
+ // responses the supported name returns intact.
12362
+ skipOutputValidation: true,
12147
12363
  formatter: rootFieldItemFormatter,
12148
12364
  run: async ({ imports, input }) => {
12149
12365
  return await imports.listActionInputFields(input);
@@ -12158,6 +12374,8 @@ var listInputFieldChoicesDeprecatedPlugin = defineMethod({
12158
12374
  deprecation: { message: "Use listActionInputFieldChoices instead." },
12159
12375
  itemType: "InputFieldChoiceItem",
12160
12376
  outputSchema: InputFieldChoiceItemSchema,
12377
+ // See `listInputFields` above: the alias mirrors its target's opt-out.
12378
+ skipOutputValidation: true,
12161
12379
  formatter: inputFieldChoiceItemFormatter,
12162
12380
  run: async ({ imports, input }) => {
12163
12381
  return await imports.listActionInputFieldChoices(input);
@@ -12325,6 +12543,7 @@ var createTriggerInboxPlugin = defineMethod({
12325
12543
  itemType: "TriggerInbox",
12326
12544
  inputSchema: CreateTriggerInboxSchema,
12327
12545
  outputSchema: TriggerInboxItemSchema,
12546
+ skipOutputValidation: true,
12328
12547
  output: "item",
12329
12548
  formatter: triggerInboxItemFormatter,
12330
12549
  annotator: deriveReadOperation,
@@ -12430,6 +12649,7 @@ var ensureTriggerInboxPlugin = defineMethod({
12430
12649
  itemType: "TriggerInbox",
12431
12650
  inputSchema: EnsureTriggerInboxInputSchema,
12432
12651
  outputSchema: TriggerInboxItemSchema,
12652
+ skipOutputValidation: true,
12433
12653
  output: "item",
12434
12654
  formatter: triggerInboxItemFormatter,
12435
12655
  annotator: deriveReadOperation,
@@ -12530,6 +12750,7 @@ var listTriggerInboxesPlugin = defineMethod({
12530
12750
  itemType: "TriggerInbox",
12531
12751
  inputSchema: ListTriggerInboxesSchema,
12532
12752
  outputSchema: TriggerInboxItemSchema,
12753
+ skipOutputValidation: true,
12533
12754
  // The handler returns a raw `{ data, next }` wire envelope, so `adaptPage`
12534
12755
  // normalizes it into an `SdkPage` (cursor pulled from the `next` URL).
12535
12756
  output: {
@@ -12577,6 +12798,7 @@ var getTriggerInboxPlugin = defineMethod({
12577
12798
  itemType: "TriggerInbox",
12578
12799
  inputSchema: GetTriggerInboxSchema,
12579
12800
  outputSchema: TriggerInboxItemSchema,
12801
+ skipOutputValidation: true,
12580
12802
  output: "item",
12581
12803
  formatter: triggerInboxItemFormatter,
12582
12804
  resolvers: { inbox: triggerInboxResolver },
@@ -12610,6 +12832,7 @@ var updateTriggerInboxPlugin = defineMethod({
12610
12832
  itemType: "TriggerInbox",
12611
12833
  inputSchema: UpdateTriggerInboxSchema,
12612
12834
  outputSchema: TriggerInboxItemSchema,
12835
+ skipOutputValidation: true,
12613
12836
  output: "item",
12614
12837
  formatter: triggerInboxItemFormatter,
12615
12838
  resolvers: { inbox: triggerInboxResolver },
@@ -12645,6 +12868,7 @@ var deleteTriggerInboxPlugin = defineMethod({
12645
12868
  itemType: "TriggerInbox",
12646
12869
  inputSchema: DeleteTriggerInboxSchema,
12647
12870
  outputSchema: TriggerInboxItemSchema,
12871
+ skipOutputValidation: true,
12648
12872
  // Delete returns the deleted inbox verbatim (the legacy `{ data }` surface),
12649
12873
  // so `output: "raw"` passes the handler's shape through unwrapped.
12650
12874
  output: "raw",
@@ -12679,6 +12903,7 @@ var pauseTriggerInboxPlugin = defineMethod({
12679
12903
  itemType: "TriggerInbox",
12680
12904
  inputSchema: PauseTriggerInboxSchema,
12681
12905
  outputSchema: TriggerInboxItemSchema,
12906
+ skipOutputValidation: true,
12682
12907
  output: "item",
12683
12908
  formatter: triggerInboxItemFormatter,
12684
12909
  resolvers: { inbox: triggerInboxResolver },
@@ -12710,6 +12935,7 @@ var resumeTriggerInboxPlugin = defineMethod({
12710
12935
  itemType: "TriggerInbox",
12711
12936
  inputSchema: ResumeTriggerInboxSchema,
12712
12937
  outputSchema: TriggerInboxItemSchema,
12938
+ skipOutputValidation: true,
12713
12939
  output: "item",
12714
12940
  formatter: triggerInboxItemFormatter,
12715
12941
  resolvers: { inbox: triggerInboxResolver },
@@ -12804,6 +13030,7 @@ var listTriggerInboxMessagesPlugin = defineMethod({
12804
13030
  itemType: "TriggerMessage",
12805
13031
  inputSchema: ListTriggerInboxMessagesSchema,
12806
13032
  outputSchema: TriggerMessageItemSchema,
13033
+ skipOutputValidation: true,
12807
13034
  // The handler returns a raw `{ data, next }` wire envelope, so `adaptPage`
12808
13035
  // normalizes it into an `SdkPage` (cursor pulled from the `next` URL).
12809
13036
  output: {
@@ -12879,6 +13106,7 @@ var leaseTriggerInboxMessagesPlugin = defineMethod({
12879
13106
  itemType: "TriggerInboxLease",
12880
13107
  inputSchema: LeaseTriggerInboxMessagesSchema,
12881
13108
  outputSchema: LeaseTriggerInboxMessagesItemSchema,
13109
+ skipOutputValidation: true,
12882
13110
  output: "item",
12883
13111
  resolvers: {
12884
13112
  inbox: triggerInboxResolver,
@@ -12940,6 +13168,7 @@ var ackTriggerInboxMessagesPlugin = defineMethod({
12940
13168
  itemType: "TriggerInboxAck",
12941
13169
  inputSchema: AckTriggerInboxMessagesSchema,
12942
13170
  outputSchema: AckTriggerInboxMessagesItemSchema,
13171
+ skipOutputValidation: true,
12943
13172
  output: "item",
12944
13173
  resolvers: {
12945
13174
  inbox: triggerInboxResolver,
@@ -12990,6 +13219,7 @@ var releaseTriggerInboxMessagesPlugin = defineMethod({
12990
13219
  itemType: "TriggerInboxRelease",
12991
13220
  inputSchema: ReleaseTriggerInboxMessagesSchema,
12992
13221
  outputSchema: ReleaseTriggerInboxMessagesItemSchema,
13222
+ skipOutputValidation: true,
12993
13223
  output: "item",
12994
13224
  resolvers: {
12995
13225
  inbox: triggerInboxResolver,
@@ -13702,6 +13932,7 @@ var listTriggersPlugin = defineMethod({
13702
13932
  itemType: "Action",
13703
13933
  inputSchema: ListTriggersSchema,
13704
13934
  outputSchema: ActionItemSchema,
13935
+ skipOutputValidation: true,
13705
13936
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
13706
13937
  formatter: actionItemFormatter,
13707
13938
  resolvers: { app: appKeyResolver },
@@ -13735,6 +13966,7 @@ var listTriggerInputFieldsPlugin = defineMethod({
13735
13966
  itemType: "RootField",
13736
13967
  inputSchema: ListTriggerInputFieldsSchema,
13737
13968
  outputSchema: RootFieldItemSchema,
13969
+ skipOutputValidation: true,
13738
13970
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
13739
13971
  formatter: rootFieldItemFormatter,
13740
13972
  annotator: deriveReadOperation,
@@ -13782,6 +14014,7 @@ var listTriggerInputFieldChoicesPlugin = defineMethod({
13782
14014
  itemType: "InputFieldChoice",
13783
14015
  inputSchema: ListTriggerInputFieldChoicesSchema,
13784
14016
  outputSchema: InputFieldChoiceItemSchema,
14017
+ skipOutputValidation: true,
13785
14018
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
13786
14019
  formatter: inputFieldChoiceItemFormatter,
13787
14020
  annotator: deriveReadOperation,
@@ -13969,6 +14202,7 @@ var listTablesPlugin = defineMethod({
13969
14202
  itemType: "Table",
13970
14203
  inputSchema: ListTablesOptionsSchema,
13971
14204
  outputSchema: TableItemSchema,
14205
+ skipOutputValidation: true,
13972
14206
  output: "list",
13973
14207
  run: async ({ imports, input }) => {
13974
14208
  return await imports.listTablesInternal({
@@ -13997,6 +14231,7 @@ var getTablePlugin = defineMethod({
13997
14231
  itemType: "Table",
13998
14232
  inputSchema: GetTableOptionsInputSchema,
13999
14233
  outputSchema: TableItemSchema,
14234
+ skipOutputValidation: true,
14000
14235
  output: "item",
14001
14236
  resolvers: { table: tableIdResolver },
14002
14237
  run: async ({ imports, input }) => {
@@ -14057,6 +14292,7 @@ var createTablePlugin = defineMethod({
14057
14292
  type: "create",
14058
14293
  inputSchema: CreateTableOptionsSchema,
14059
14294
  outputSchema: TableItemSchema,
14295
+ skipOutputValidation: true,
14060
14296
  output: "item",
14061
14297
  resolvers: { name: tableNameResolver },
14062
14298
  run: async ({ imports, input }) => {
@@ -14093,6 +14329,7 @@ var listTableFieldsPlugin = defineMethod({
14093
14329
  type: "list",
14094
14330
  inputSchema: ListTableFieldsOptionsInputSchema,
14095
14331
  outputSchema: FieldItemSchema,
14332
+ skipOutputValidation: true,
14096
14333
  output: "item",
14097
14334
  formatter: tableFieldItemFormatter,
14098
14335
  resolvers: { table: tableIdResolver },
@@ -14162,6 +14399,7 @@ var createTableFieldsPlugin = defineMethod({
14162
14399
  returnType: "FieldItem[]",
14163
14400
  inputSchema: CreateTableFieldsOptionsInputSchema,
14164
14401
  outputSchema: FieldItemSchema,
14402
+ skipOutputValidation: true,
14165
14403
  // Item output with an array payload: callers get `{ data: FieldItem[] }`
14166
14404
  // directly rather than a paginated list.
14167
14405
  output: "item",
@@ -14301,6 +14539,7 @@ var getTableRecordPlugin = defineMethod({
14301
14539
  itemType: "Record",
14302
14540
  inputSchema: GetTableRecordOptionsInputSchema,
14303
14541
  outputSchema: RecordItemSchema,
14542
+ skipOutputValidation: true,
14304
14543
  output: "item",
14305
14544
  resolvers: { table: tableIdResolver, record: tableRecordIdResolver },
14306
14545
  formatter: tableRecordFormatter,
@@ -14392,6 +14631,7 @@ var listTableRecordsPlugin = defineMethod({
14392
14631
  itemType: "Record",
14393
14632
  inputSchema: ListTableRecordsOptionsInputSchema,
14394
14633
  outputSchema: RecordItemSchema,
14634
+ skipOutputValidation: true,
14395
14635
  // The handler already returns a clean `{ data, nextCursor }` page, so the
14396
14636
  // standard list output (no `adaptPage`) applies.
14397
14637
  output: { type: "list", defaultPageSize: DEFAULT_PAGE_SIZE },
@@ -14501,6 +14741,7 @@ var createTableRecordsPlugin = defineMethod({
14501
14741
  returnType: "RecordItem[]",
14502
14742
  inputSchema: CreateTableRecordsOptionsInputSchema,
14503
14743
  outputSchema: RecordItemSchema,
14744
+ skipOutputValidation: true,
14504
14745
  // Item output with an array payload: callers get `{ data: RecordItem[] }`
14505
14746
  // directly rather than a paginated list.
14506
14747
  output: "item",
@@ -14613,6 +14854,7 @@ var updateTableRecordsPlugin = defineMethod({
14613
14854
  returnType: "RecordItem[]",
14614
14855
  inputSchema: UpdateTableRecordsOptionsInputSchema,
14615
14856
  outputSchema: RecordItemSchema,
14857
+ skipOutputValidation: true,
14616
14858
  // Item output with an array payload: callers get `{ data: RecordItem[] }`
14617
14859
  // directly rather than a paginated list.
14618
14860
  output: "item",