@zapier/zapier-sdk 0.112.0 → 0.112.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.112.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0318d77: _This release contains no user-facing changes._
8
+
9
+ ## 0.112.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 218c461: Added an `is_managed` field to the connections returned by `listConnections`. It indicates whether a connection is managed by account admins (no individual owner) rather than owned by an individual user.
14
+
3
15
  ## 0.112.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -2710,6 +2710,7 @@ Find the first connection matching the criteria
2710
2710
  | ​ ↳ `expired_at` | `string` | ❌ | — | Date when connection expired (mapped from marked_stale_at) |
2711
2711
  | ​ ↳ `app_key` | `string` | ❌ | — | App Key extracted from implementation_id |
2712
2712
  | ​ ↳ `app_version` | `string` | ❌ | — | App Version extracted from implementation_id |
2713
+ | ​ ↳ `is_managed` | `boolean` | ❌ | — | Whether this connection is managed by account admins (no individual owner) |
2713
2714
 
2714
2715
  **Example:**
2715
2716
 
@@ -2767,6 +2768,7 @@ Find a unique connection matching the criteria
2767
2768
  | ​ ↳ `expired_at` | `string` | ❌ | — | Date when connection expired (mapped from marked_stale_at) |
2768
2769
  | ​ ↳ `app_key` | `string` | ❌ | — | App Key extracted from implementation_id |
2769
2770
  | ​ ↳ `app_version` | `string` | ❌ | — | App Version extracted from implementation_id |
2771
+ | ​ ↳ `is_managed` | `boolean` | ❌ | — | Whether this connection is managed by account admins (no individual owner) |
2770
2772
 
2771
2773
  **Example:**
2772
2774
 
@@ -2818,6 +2820,7 @@ Get details for a specific connection
2818
2820
  | ​ ↳ `expired_at` | `string` | ❌ | — | Date when connection expired (mapped from marked_stale_at) |
2819
2821
  | ​ ↳ `app_key` | `string` | ❌ | — | App Key extracted from implementation_id |
2820
2822
  | ​ ↳ `app_version` | `string` | ❌ | — | App Version extracted from implementation_id |
2823
+ | ​ ↳ `is_managed` | `boolean` | ❌ | — | Whether this connection is managed by account admins (no individual owner) |
2821
2824
 
2822
2825
  **Example:**
2823
2826
 
@@ -2922,6 +2925,7 @@ List available connections with optional filtering
2922
2925
  | ​ ↳ `expired_at` | `string` | ❌ | — | Date when connection expired (mapped from marked_stale_at) |
2923
2926
  | ​ ↳ `app_key` | `string` | ❌ | — | App Key extracted from implementation_id |
2924
2927
  | ​ ↳ `app_version` | `string` | ❌ | — | App Version extracted from implementation_id |
2928
+ | ​ ↳ `is_managed` | `boolean` | ❌ | — | Whether this connection is managed by account admins (no individual owner) |
2925
2929
  | `nextCursor` | `string` | ❌ | — | Cursor for the next page; omitted when there are no more pages |
2926
2930
 
2927
2931
  **Example:**
@@ -2,7 +2,7 @@ import { __require } from './chunk-Y6FXYEAI.mjs';
2
2
  import { z } from 'zod';
3
3
  import { withPositional, createDeprecationLogger, createAsyncContext, declareOptionalProperty, defineProperty, definePlugin, sendHttpRequestPlugin, retryHttpRequestPlugin, declareProperty, defineMethod, coreOptionsPluginRef, createValidator, defineFormatter, declareMethod, defineResolver, concatLists, openEnum, defineHook, getRegistryPlugin, paginate, toSnakeCase, isCoreError, toTitleCase, CORE_ERROR_SYMBOL, CoreErrorCode, CORE_SIGNAL_SYMBOL, isCoreSignal, createSdk, CORE_OPTIONS_ID, resolvePlugin } from '@zapier/kitcore';
4
4
  export { CONTEXT, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, addPlugin, createController, createSdk, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineMethod, defineMethodOverride, defineOverride, definePlugin, defineProperty, defineResolver, disposeSdk, getContext, getCoreErrorCause, getCoreErrorCode, getNegatable, getRegistry, getRegistryPlugin, isCoreCancelledSignal, isCoreError, isCoreSignal, isPositional, omitExports, resolvePlugin, runInMethodScope, runWithTelemetryContext, selectExports, toSnakeCase, toTitleCase } from '@zapier/kitcore';
5
- import { ConnectionSchema, ConnectionsResponseSchema, ListConnectionsQuerySchema as ListConnectionsQuerySchema$1, ConnectionItemSchema } from '@zapier/zapier-sdk-core/v0/schemas/connections';
5
+ import { ConnectionItemSchema as ConnectionItemSchema$1, ConnectionSchema, ConnectionsResponseSchema, ListConnectionsQuerySchema as ListConnectionsQuerySchema$1 } from '@zapier/zapier-sdk-core/v0/schemas/connections';
6
6
  import { buildHttpRequestContext, buildActionRunContext } from '@zapier/policy-context';
7
7
  import { ListAppsQuerySchema, AppItemSchema as AppItemSchema$1 } from '@zapier/zapier-sdk-core/v0/schemas/apps';
8
8
  import { ImplementationMetaSchema, ImplementationsMetaResponseSchema } from '@zapier/zapier-sdk-core/v0/schemas/implementations';
@@ -1861,8 +1861,19 @@ var isNonEmpty = (value) => value !== "";
1861
1861
  var agentDetectors = [
1862
1862
  { name: "claude-code", key: "CLAUDECODE", predicate: isTruthy },
1863
1863
  { name: "github-copilot", key: "COPILOT_AGENT", predicate: isTruthy },
1864
+ // Copilot CLI doesn't export `COPILOT_AGENT` (that marker belongs to the
1865
+ // Copilot coding agent on GitHub Actions); its shell commands do see a
1866
+ // session id.
1867
+ {
1868
+ name: "github-copilot",
1869
+ key: "COPILOT_AGENT_SESSION_ID",
1870
+ predicate: isNonEmpty
1871
+ },
1864
1872
  { name: "cursor", key: "CURSOR_AGENT", predicate: isTruthy },
1865
1873
  { name: "codex", key: "CODEX_SANDBOX", predicate: isNonEmpty },
1874
+ // `CODEX_SANDBOX` only exists inside Codex's no-network sandbox; runs that
1875
+ // reach an API ran approved/escalated, where only `CODEX_THREAD_ID` is set.
1876
+ { name: "codex", key: "CODEX_THREAD_ID", predicate: isNonEmpty },
1866
1877
  { name: "gemini-cli", key: "GEMINI_CLI", predicate: isTruthy },
1867
1878
  { name: "augment", key: "AUGMENT_AGENT", predicate: isTruthy },
1868
1879
  { name: "cline", key: "CLINE_ACTIVE", predicate: isTruthy },
@@ -2806,7 +2817,7 @@ function logRouteOverride({
2806
2817
  }
2807
2818
 
2808
2819
  // src/sdk-version.ts
2809
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.112.0" : void 0) || "unknown";
2820
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.112.2" : void 0) || "unknown";
2810
2821
 
2811
2822
  // src/utils/open-url.ts
2812
2823
  var nodePrefix = "node:";
@@ -4411,6 +4422,7 @@ function transformConnectionItem(item) {
4411
4422
  lastchanged: item.lastchanged,
4412
4423
  is_stale: item.is_stale,
4413
4424
  is_shared: item.is_shared,
4425
+ is_managed: item.is_managed,
4414
4426
  identifier: item.identifier,
4415
4427
  groups: item.groups,
4416
4428
  members: item.members,
@@ -4549,9 +4561,15 @@ function normalizeAppItem({
4549
4561
  }
4550
4562
  });
4551
4563
  }
4564
+ var ConnectionItemSchema = ConnectionItemSchema$1.extend({
4565
+ is_managed: z.boolean().optional().describe(
4566
+ "Whether this connection is managed by account admins (no individual owner)"
4567
+ )
4568
+ });
4552
4569
  var RawConnectionSchema = ConnectionSchema.extend({
4553
4570
  is_stale: z.boolean().optional(),
4554
4571
  is_shared: z.boolean().optional(),
4572
+ is_managed: z.boolean().optional(),
4555
4573
  members: z.array(z.record(z.string(), z.any())).optional(),
4556
4574
  customuser_id: z.number().nullable().optional(),
4557
4575
  customuser_public_id: z.string().nullable().optional()
@@ -1862,8 +1862,19 @@ var isNonEmpty = (value) => value !== "";
1862
1862
  var agentDetectors = [
1863
1863
  { name: "claude-code", key: "CLAUDECODE", predicate: isTruthy },
1864
1864
  { name: "github-copilot", key: "COPILOT_AGENT", predicate: isTruthy },
1865
+ // Copilot CLI doesn't export `COPILOT_AGENT` (that marker belongs to the
1866
+ // Copilot coding agent on GitHub Actions); its shell commands do see a
1867
+ // session id.
1868
+ {
1869
+ name: "github-copilot",
1870
+ key: "COPILOT_AGENT_SESSION_ID",
1871
+ predicate: isNonEmpty
1872
+ },
1865
1873
  { name: "cursor", key: "CURSOR_AGENT", predicate: isTruthy },
1866
1874
  { name: "codex", key: "CODEX_SANDBOX", predicate: isNonEmpty },
1875
+ // `CODEX_SANDBOX` only exists inside Codex's no-network sandbox; runs that
1876
+ // reach an API ran approved/escalated, where only `CODEX_THREAD_ID` is set.
1877
+ { name: "codex", key: "CODEX_THREAD_ID", predicate: isNonEmpty },
1867
1878
  { name: "gemini-cli", key: "GEMINI_CLI", predicate: isTruthy },
1868
1879
  { name: "augment", key: "AUGMENT_AGENT", predicate: isTruthy },
1869
1880
  { name: "cline", key: "CLINE_ACTIVE", predicate: isTruthy },
@@ -2807,7 +2818,7 @@ function logRouteOverride({
2807
2818
  }
2808
2819
 
2809
2820
  // src/sdk-version.ts
2810
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.112.0" : void 0) || "unknown";
2821
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.112.2" : void 0) || "unknown";
2811
2822
 
2812
2823
  // src/utils/open-url.ts
2813
2824
  var nodePrefix = "node:";
@@ -4412,6 +4423,7 @@ function transformConnectionItem(item) {
4412
4423
  lastchanged: item.lastchanged,
4413
4424
  is_stale: item.is_stale,
4414
4425
  is_shared: item.is_shared,
4426
+ is_managed: item.is_managed,
4415
4427
  identifier: item.identifier,
4416
4428
  groups: item.groups,
4417
4429
  members: item.members,
@@ -4550,9 +4562,15 @@ function normalizeAppItem({
4550
4562
  }
4551
4563
  });
4552
4564
  }
4565
+ var ConnectionItemSchema = connections.ConnectionItemSchema.extend({
4566
+ is_managed: zod.z.boolean().optional().describe(
4567
+ "Whether this connection is managed by account admins (no individual owner)"
4568
+ )
4569
+ });
4553
4570
  var RawConnectionSchema = connections.ConnectionSchema.extend({
4554
4571
  is_stale: zod.z.boolean().optional(),
4555
4572
  is_shared: zod.z.boolean().optional(),
4573
+ is_managed: zod.z.boolean().optional(),
4556
4574
  members: zod.z.array(zod.z.record(zod.z.string(), zod.z.any())).optional(),
4557
4575
  customuser_id: zod.z.number().nullable().optional(),
4558
4576
  customuser_public_id: zod.z.string().nullable().optional()
@@ -4604,7 +4622,7 @@ function normalizeConnectionItem({
4604
4622
  app_version: appVersion,
4605
4623
  profile_id: profileId != null ? String(profileId) : void 0
4606
4624
  };
4607
- return kitcore.createValidator(connections.ConnectionItemSchema, { adaptError })(normalized);
4625
+ return kitcore.createValidator(ConnectionItemSchema, { adaptError })(normalized);
4608
4626
  }
4609
4627
 
4610
4628
  // src/utils/pagination.ts
@@ -8574,7 +8592,7 @@ var listConnectionsPlugin = kitcore.defineMethod({
8574
8592
  categories: ["connection"],
8575
8593
  itemType: "Connection",
8576
8594
  inputSchema: ListConnectionsQuerySchema,
8577
- outputSchema: connections.ConnectionItemSchema,
8595
+ outputSchema: ConnectionItemSchema,
8578
8596
  skipOutputValidation: true,
8579
8597
  formatter: connectionItemFormatter,
8580
8598
  // `app` is an optional, search-backed filter: the controller offers the app
@@ -8876,7 +8894,7 @@ var getConnectionPlugin = kitcore.defineMethod({
8876
8894
  categories: ["connection"],
8877
8895
  itemType: "Connection",
8878
8896
  inputSchema: GetConnectionInputSchema,
8879
- outputSchema: connections.ConnectionItemSchema,
8897
+ outputSchema: ConnectionItemSchema,
8880
8898
  skipOutputValidation: true,
8881
8899
  output: "item",
8882
8900
  formatter: connectionItemFormatter,
@@ -8921,7 +8939,7 @@ var findFirstConnectionPlugin = kitcore.defineMethod({
8921
8939
  categories: ["connection"],
8922
8940
  itemType: "Connection",
8923
8941
  inputSchema: FindFirstConnectionSchema,
8924
- outputSchema: connections.ConnectionItemSchema,
8942
+ outputSchema: ConnectionItemSchema,
8925
8943
  skipOutputValidation: true,
8926
8944
  output: "item",
8927
8945
  formatter: connectionItemFormatter,
@@ -8957,7 +8975,7 @@ var findUniqueConnectionPlugin = kitcore.defineMethod({
8957
8975
  categories: ["connection"],
8958
8976
  itemType: "Connection",
8959
8977
  inputSchema: FindUniqueConnectionSchema,
8960
- outputSchema: connections.ConnectionItemSchema,
8978
+ outputSchema: ConnectionItemSchema,
8961
8979
  skipOutputValidation: true,
8962
8980
  output: "item",
8963
8981
  formatter: connectionItemFormatter,
@@ -9459,7 +9477,7 @@ var listAuthenticationsPlugin = kitcore.defineMethod({
9459
9477
  categories: ["connection"],
9460
9478
  deprecation: { message: "Use listConnections instead." },
9461
9479
  itemType: "Connection",
9462
- outputSchema: connections.ConnectionItemSchema,
9480
+ outputSchema: ConnectionItemSchema,
9463
9481
  // Matches `listConnections`: an alias must not enforce a schema its target
9464
9482
  // passes through, or the deprecated name strips (or rejects) responses the
9465
9483
  // supported name returns intact.
@@ -9480,7 +9498,7 @@ var getAuthenticationPlugin = kitcore.defineMethod({
9480
9498
  deprecation: { message: "Use getConnection instead." },
9481
9499
  type: "item",
9482
9500
  itemType: "Connection",
9483
- outputSchema: connections.ConnectionItemSchema,
9501
+ outputSchema: ConnectionItemSchema,
9484
9502
  // Inert while the output is `raw` (that mode never validates), set so every
9485
9503
  // method declaring an `outputSchema` states its stance, and so switching this
9486
9504
  // alias to `item` keeps mirroring `getConnection`'s opt-out.
@@ -9501,7 +9519,7 @@ var findFirstAuthenticationPlugin = kitcore.defineMethod({
9501
9519
  deprecation: { message: "Use findFirstConnection instead." },
9502
9520
  type: "item",
9503
9521
  itemType: "Connection",
9504
- outputSchema: connections.ConnectionItemSchema,
9522
+ outputSchema: ConnectionItemSchema,
9505
9523
  skipOutputValidation: true,
9506
9524
  formatter: connectionItemFormatter,
9507
9525
  run: ({ imports, input }) => {
@@ -9519,7 +9537,7 @@ var findUniqueAuthenticationPlugin = kitcore.defineMethod({
9519
9537
  deprecation: { message: "Use findUniqueConnection instead." },
9520
9538
  type: "item",
9521
9539
  itemType: "Connection",
9522
- outputSchema: connections.ConnectionItemSchema,
9540
+ outputSchema: ConnectionItemSchema,
9523
9541
  skipOutputValidation: true,
9524
9542
  formatter: connectionItemFormatter,
9525
9543
  run: ({ imports, input }) => {