@zapier/zapier-sdk 0.112.4 → 0.112.6

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,21 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.112.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 5a62cba: `listApps` no longer throws when a page of results contains an app with no
8
+ recorded age. Such an app failed validation and rejected the whole page rather
9
+ than the single record, so the same call succeeded or failed depending on which
10
+ apps landed on the page. `age_in_days` is now absent for those apps. An app
11
+ returned without a version no longer rejects its page either.
12
+
13
+ ## 0.112.5
14
+
15
+ ### Patch Changes
16
+
17
+ - 51116a0: Added a `permissions` field to actions returned by `listActions`, `getAction` and `listTriggers`. It passes through every flag the API returns, including `can_use`, which is `false` when an account admin has restricted the action.
18
+
3
19
  ## 0.112.4
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -554,6 +554,7 @@ Get detailed information about a specific action
554
554
  | ​ ↳ `description` | `string` | ✅ | — | |
555
555
  | ​ ↳ `is_important` | `boolean` | ❌ | — | |
556
556
  | ​ ↳ `is_hidden` | `boolean` | ❌ | — | |
557
+ | ​ ↳ `permissions` | `object` | ❌ | — | |
557
558
  | ​ ↳ `app_key` | `string` | ✅ | — | |
558
559
  | ​ ↳ `app_version` | `string` | ❌ | — | |
559
560
  | ​ ↳ `action_type` | `string` | ✅ | `filter`, `read`, `read_bulk`, `run`, `search`, `search_and_write`, `search_or_write`, `write` | |
@@ -817,6 +818,7 @@ List all actions for a specific app
817
818
  | ​ ↳ `description` | `string` | ✅ | — | |
818
819
  | ​ ↳ `is_important` | `boolean` | ❌ | — | |
819
820
  | ​ ↳ `is_hidden` | `boolean` | ❌ | — | |
821
+ | ​ ↳ `permissions` | `object` | ❌ | — | |
820
822
  | ​ ↳ `app_key` | `string` | ✅ | — | |
821
823
  | ​ ↳ `app_version` | `string` | ❌ | — | |
822
824
  | ​ ↳ `action_type` | `string` | ✅ | `filter`, `read`, `read_bulk`, `run`, `search`, `search_and_write`, `search_or_write`, `write` | |
@@ -4136,6 +4138,7 @@ List all triggers for a specific app
4136
4138
  | ​ ↳ `description` | `string` | ✅ | — | |
4137
4139
  | ​ ↳ `is_important` | `boolean` | ❌ | — | |
4138
4140
  | ​ ↳ `is_hidden` | `boolean` | ❌ | — | |
4141
+ | ​ ↳ `permissions` | `object` | ❌ | — | |
4139
4142
  | ​ ↳ `app_key` | `string` | ✅ | — | |
4140
4143
  | ​ ↳ `app_version` | `string` | ❌ | — | |
4141
4144
  | ​ ↳ `action_type` | `string` | ✅ | `filter`, `read`, `read_bulk`, `run`, `search`, `search_and_write`, `search_or_write`, `write` | |
@@ -2818,7 +2818,7 @@ function logRouteOverride({
2818
2818
  }
2819
2819
 
2820
2820
  // src/sdk-version.ts
2821
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.112.4" : void 0) || "unknown";
2821
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.112.6" : void 0) || "unknown";
2822
2822
 
2823
2823
  // src/utils/open-url.ts
2824
2824
  var nodePrefix = "node:";
@@ -4397,6 +4397,7 @@ function normalizeActionItem(action) {
4397
4397
  description: action.description,
4398
4398
  is_important: action.is_important,
4399
4399
  is_hidden: action.is_hidden,
4400
+ permissions: action.permissions,
4400
4401
  // Transformed fields
4401
4402
  app_key: appKey,
4402
4403
  app_version: appVersion,
@@ -6656,9 +6657,7 @@ var NeedSchema = zod.z.object({
6656
6657
  zod.z.object({
6657
6658
  action_url: zod.z.string().optional()
6658
6659
  });
6659
- zod.z.object({
6660
- can_use: zod.z.boolean().optional()
6661
- });
6660
+ var ActionPermissionsSchema = zod.z.partialRecord(zod.z.string(), zod.z.boolean());
6662
6661
  var ActionSchema = zod.z.object({
6663
6662
  id: zod.z.string().optional(),
6664
6663
  type: zod.z.enum([
@@ -6676,7 +6675,8 @@ var ActionSchema = zod.z.object({
6676
6675
  description: zod.z.string(),
6677
6676
  is_important: zod.z.boolean().optional(),
6678
6677
  is_hidden: zod.z.boolean().optional(),
6679
- selected_api: zod.z.string().optional()
6678
+ selected_api: zod.z.string().optional(),
6679
+ permissions: ActionPermissionsSchema.optional()
6680
6680
  });
6681
6681
  var ChoiceSchema = zod.z.object({
6682
6682
  value: zod.z.union([zod.z.string(), zod.z.number()]),
@@ -7533,7 +7533,21 @@ var RawImplementationMetaLookupSchema = implementations.ImplementationMetaSchema
7533
7533
  classification: zod.z.string().nullish(),
7534
7534
  api_docs_url: zod.z.string().nullish(),
7535
7535
  image: zod.z.string().nullish(),
7536
- visibility: zod.z.string().nullish()
7536
+ visibility: zod.z.string().nullish(),
7537
+ // The lookup route builds its response dict by hand and falls back to `""`
7538
+ // for anything it cannot fill, so `age_in_days` arrives as an empty string
7539
+ // for every implementation with no backing service. Read that sentinel as
7540
+ // "unknown" rather than coercing it: `Number("")` is `0`, which would claim
7541
+ // the app launched today.
7542
+ age_in_days: zod.z.preprocess(
7543
+ (value) => value === "" ? void 0 : value,
7544
+ zod.z.number().optional()
7545
+ ),
7546
+ // Same route, same reason as the nullish strings above: `version` is read
7547
+ // off the implementation with a `None` default. Fold it back to `undefined`
7548
+ // because `normalizeAppItem` passes it on as a plain optional string — and
7549
+ // then overwrites it with the version parsed out of `id`.
7550
+ version: zod.z.preprocess((value) => value ?? void 0, zod.z.string().optional())
7537
7551
  });
7538
7552
  var RawImplementationsMetaLookupResponseSchema = implementations.ImplementationsMetaResponseSchema.extend({
7539
7553
  results: zod.z.array(RawImplementationMetaLookupSchema)
@@ -2817,7 +2817,7 @@ function logRouteOverride({
2817
2817
  }
2818
2818
 
2819
2819
  // src/sdk-version.ts
2820
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.112.4" : void 0) || "unknown";
2820
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.112.6" : void 0) || "unknown";
2821
2821
 
2822
2822
  // src/utils/open-url.ts
2823
2823
  var nodePrefix = "node:";
@@ -4396,6 +4396,7 @@ function normalizeActionItem(action) {
4396
4396
  description: action.description,
4397
4397
  is_important: action.is_important,
4398
4398
  is_hidden: action.is_hidden,
4399
+ permissions: action.permissions,
4399
4400
  // Transformed fields
4400
4401
  app_key: appKey,
4401
4402
  app_version: appVersion,
@@ -6655,9 +6656,7 @@ var NeedSchema = z.object({
6655
6656
  z.object({
6656
6657
  action_url: z.string().optional()
6657
6658
  });
6658
- z.object({
6659
- can_use: z.boolean().optional()
6660
- });
6659
+ var ActionPermissionsSchema = z.partialRecord(z.string(), z.boolean());
6661
6660
  var ActionSchema = z.object({
6662
6661
  id: z.string().optional(),
6663
6662
  type: z.enum([
@@ -6675,7 +6674,8 @@ var ActionSchema = z.object({
6675
6674
  description: z.string(),
6676
6675
  is_important: z.boolean().optional(),
6677
6676
  is_hidden: z.boolean().optional(),
6678
- selected_api: z.string().optional()
6677
+ selected_api: z.string().optional(),
6678
+ permissions: ActionPermissionsSchema.optional()
6679
6679
  });
6680
6680
  var ChoiceSchema = z.object({
6681
6681
  value: z.union([z.string(), z.number()]),
@@ -7532,7 +7532,21 @@ var RawImplementationMetaLookupSchema = ImplementationMetaSchema.extend({
7532
7532
  classification: z.string().nullish(),
7533
7533
  api_docs_url: z.string().nullish(),
7534
7534
  image: z.string().nullish(),
7535
- visibility: z.string().nullish()
7535
+ visibility: z.string().nullish(),
7536
+ // The lookup route builds its response dict by hand and falls back to `""`
7537
+ // for anything it cannot fill, so `age_in_days` arrives as an empty string
7538
+ // for every implementation with no backing service. Read that sentinel as
7539
+ // "unknown" rather than coercing it: `Number("")` is `0`, which would claim
7540
+ // the app launched today.
7541
+ age_in_days: z.preprocess(
7542
+ (value) => value === "" ? void 0 : value,
7543
+ z.number().optional()
7544
+ ),
7545
+ // Same route, same reason as the nullish strings above: `version` is read
7546
+ // off the implementation with a `None` default. Fold it back to `undefined`
7547
+ // because `normalizeAppItem` passes it on as a plain optional string — and
7548
+ // then overwrites it with the version parsed out of `id`.
7549
+ version: z.preprocess((value) => value ?? void 0, z.string().optional())
7536
7550
  });
7537
7551
  var RawImplementationsMetaLookupResponseSchema = ImplementationsMetaResponseSchema.extend({
7538
7552
  results: z.array(RawImplementationMetaLookupSchema)