@zapier/zapier-sdk 0.43.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +75 -73
  3. package/dist/index.cjs +104 -113
  4. package/dist/index.d.mts +2486 -2467
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.mjs +104 -113
  8. package/dist/plugins/apps/index.d.ts +1 -1
  9. package/dist/plugins/apps/index.d.ts.map +1 -1
  10. package/dist/plugins/apps/index.js +4 -0
  11. package/dist/plugins/getInputFieldsSchema/schemas.js +1 -1
  12. package/dist/plugins/listInputFieldChoices/schemas.js +1 -1
  13. package/dist/plugins/listInputFields/schemas.js +1 -1
  14. package/dist/plugins/manifest/schemas.d.ts +2 -2
  15. package/dist/plugins/registry/index.d.ts +11 -16
  16. package/dist/plugins/registry/index.d.ts.map +1 -1
  17. package/dist/plugins/registry/index.js +9 -130
  18. package/dist/plugins/runAction/schemas.js +1 -1
  19. package/dist/registry.d.ts +9 -0
  20. package/dist/registry.d.ts.map +1 -0
  21. package/dist/registry.js +77 -0
  22. package/dist/sdk.d.ts +20 -2
  23. package/dist/sdk.d.ts.map +1 -1
  24. package/dist/sdk.js +25 -9
  25. package/dist/types/connections.d.ts +2 -2
  26. package/dist/types/connections.d.ts.map +1 -1
  27. package/dist/types/connections.js +5 -3
  28. package/dist/types/plugin.d.ts +7 -1
  29. package/dist/types/plugin.d.ts.map +1 -1
  30. package/dist/types/properties.js +1 -1
  31. package/dist/types/registry.d.ts +49 -0
  32. package/dist/types/registry.d.ts.map +1 -0
  33. package/dist/types/registry.js +1 -0
  34. package/dist/types/sdk.d.ts +1 -78
  35. package/dist/types/sdk.d.ts.map +1 -1
  36. package/dist/utils/schema-utils.d.ts +1 -1
  37. package/dist/utils/schema-utils.d.ts.map +1 -1
  38. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.45.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 15dce25: `registryPlugin` is now deprecated, because `getRegistry` is built into the SDK and added after each plugin is added. Plugins will always be registered; there is no need to call `createZapierSdkWithoutRegistry`, add custom plugins, and then `.addPlugin(registryPlugin)`. Because of this, `createZapierSdkWithoutRegistry` is now deprecated, and calling it will still give you an SDK with `getRegistry` on it. Calling `addPlugin(registryPlugin)` on that SDK is a no-op.
8
+
9
+ ## 0.44.0
10
+
11
+ ### Minor Changes
12
+
13
+ - fd8660c: Allow UUID connection IDs in the `.zapierrc` connections map. `ConnectionEntrySchema.connectionId` now accepts either a positive integer (legacy form) or a UUID-format string (returned by the Zapier connections API for newer connections).
14
+
3
15
  ## 0.43.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -338,18 +338,18 @@ const zapier = createZapierSdk({
338
338
  manifest: {
339
339
  apps: { slack: { implementationName: "SlackCLIAPI", version: "1.21.1" } },
340
340
  connections: {
341
- slack_work: { connectionId: 12345 },
341
+ slack_work: { connectionId: "01234567-89ab-cdef-0123-456789abcdef" },
342
342
  google_sheets: { connectionId: 67890 },
343
343
  },
344
344
  },
345
345
  });
346
346
  ```
347
347
 
348
- Each connection entry maps a name to a `connectionId`. App version resolution is handled separately via the `apps` section of `.zapierrc`.
348
+ Each connection entry maps a name to a `connectionId`. The Zapier connections API returns UUID-format IDs (the `id` field on entries from `listConnections`); positive integers from older connections are also accepted. App version resolution is handled separately via the `apps` section of `.zapierrc`.
349
349
 
350
350
  ### Using named connections
351
351
 
352
- Reference connections using the `connection` parameter. Pass a connection name to be resolved from the connections map or a connection ID to be used directly.
352
+ Reference connections using the `connection` parameter. Pass a connection name to be resolved from the connections map, or a connection ID to be used directly.
353
353
 
354
354
  ```typescript
355
355
  // Per-call with alias
@@ -372,8 +372,10 @@ await zapier.fetch("https://slack.com/api/auth.test", {
372
372
  connection: "slack_work",
373
373
  });
374
374
 
375
- // Direct connection ID also works
376
- await zapier.apps.slack.read.channels({ connection: 12345 });
375
+ // Direct connection ID also works (UUID or legacy positive integer)
376
+ await zapier.apps.slack.read.channels({
377
+ connection: "01234567-89ab-cdef-0123-456789abcdef",
378
+ });
377
379
  ```
378
380
 
379
381
  ## Available Functions
@@ -431,14 +433,14 @@ Get the JSON Schema representation of input fields for an action. Returns a JSON
431
433
 
432
434
  **Parameters:**
433
435
 
434
- | Name | Type | Required | Default | Possible Values | Description |
435
- | -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
436
- | `options` | `object` | ✅ | — | — | |
437
- | ↳ `app` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for |
438
- | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
439
- | ↳ `action` | `string` | ✅ | — | — | Action key to get the input schema for |
440
- | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId. |
441
- | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect the schema (e.g., when fields depend on other field values) |
436
+ | Name | Type | Required | Default | Possible Values | Description |
437
+ | -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
438
+ | `options` | `object` | ✅ | — | — | |
439
+ | ↳ `app` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for |
440
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
441
+ | ↳ `action` | `string` | ✅ | — | — | Action key to get the input schema for |
442
+ | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
443
+ | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect the schema (e.g., when fields depend on other field values) |
442
444
 
443
445
  **Returns:** `Promise<InputSchemaItem>`
444
446
 
@@ -500,19 +502,19 @@ Get the available choices for a dynamic dropdown input field
500
502
 
501
503
  **Parameters:**
502
504
 
503
- | Name | Type | Required | Default | Possible Values | Description |
504
- | -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
505
- | `options` | `object` | ✅ | — | — | |
506
- | ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
507
- | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
508
- | ↳ `action` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
509
- | ↳ `inputField` | `string` | ✅ | — | — | Input field key to get choices for |
510
- | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId. |
511
- | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available choices |
512
- | ↳ `page` | `number` | ❌ | — | — | Page number for paginated results |
513
- | ↳ `pageSize` | `number` | ❌ | — | — | Number of choices per page |
514
- | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
515
- | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
505
+ | Name | Type | Required | Default | Possible Values | Description |
506
+ | -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
507
+ | `options` | `object` | ✅ | — | — | |
508
+ | ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
509
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
510
+ | ↳ `action` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
511
+ | ↳ `inputField` | `string` | ✅ | — | — | Input field key to get choices for |
512
+ | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
513
+ | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available choices |
514
+ | ↳ `page` | `number` | ❌ | — | — | Page number for paginated results |
515
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of choices per page |
516
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
517
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
516
518
 
517
519
  **Returns:** `Promise<PaginatedResult<InputFieldChoiceItem>>`
518
520
 
@@ -557,17 +559,17 @@ Get the input fields required for a specific action
557
559
 
558
560
  **Parameters:**
559
561
 
560
- | Name | Type | Required | Default | Possible Values | Description |
561
- | -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
562
- | `options` | `object` | ✅ | — | — | |
563
- | ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
564
- | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
565
- | ↳ `action` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
566
- | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId. |
567
- | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available fields |
568
- | ↳ `pageSize` | `number` | ❌ | — | — | Number of input fields per page |
569
- | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
570
- | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
562
+ | Name | Type | Required | Default | Possible Values | Description |
563
+ | -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
564
+ | `options` | `object` | ✅ | — | — | |
565
+ | ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
566
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
567
+ | ↳ `action` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
568
+ | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
569
+ | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available fields |
570
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of input fields per page |
571
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
572
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
571
573
 
572
574
  **Returns:** `Promise<PaginatedResult<RootFieldItemItem>>`
573
575
 
@@ -608,18 +610,18 @@ Execute an action with the given inputs
608
610
 
609
611
  **Parameters:**
610
612
 
611
- | Name | Type | Required | Default | Possible Values | Description |
612
- | -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
613
- | `options` | `object` | ✅ | — | — | |
614
- | ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
615
- | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
616
- | ↳ `action` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
617
- | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId. |
618
- | ↳ `inputs` | `object` | ❌ | — | — | Input parameters for the action |
619
- | ↳ `timeoutMs` | `number` | ❌ | — | — | Maximum time to wait for action completion in milliseconds (default: 180000) |
620
- | ↳ `pageSize` | `number` | ❌ | — | — | Number of results per page |
621
- | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
622
- | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
613
+ | Name | Type | Required | Default | Possible Values | Description |
614
+ | -------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
615
+ | `options` | `object` | ✅ | — | — | |
616
+ | ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
617
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
618
+ | ↳ `action` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
619
+ | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
620
+ | ↳ `inputs` | `object` | ❌ | — | — | Input parameters for the action |
621
+ | ↳ `timeoutMs` | `number` | ❌ | — | — | Maximum time to wait for action completion in milliseconds (default: 180000) |
622
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of results per page |
623
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
624
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
623
625
 
624
626
  **Returns:** `Promise<PaginatedResult<ActionResultItem>>`
625
627
 
@@ -662,10 +664,10 @@ Bind a connection alias or numeric connectionId to an app
662
664
 
663
665
  **Parameters:**
664
666
 
665
- | Name | Type | Required | Default | Possible Values | Description |
666
- | -------------- | ---------------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------- |
667
- | `options` | `object` | ✅ | — | — | |
668
- | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. |
667
+ | Name | Type | Required | Default | Possible Values | Description |
668
+ | -------------- | ---------------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
669
+ | `options` | `object` | ✅ | — | — | |
670
+ | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
669
671
 
670
672
  **Returns:** `Promise<AppProxy>`
671
673
 
@@ -681,12 +683,12 @@ Execute an action with the given inputs for the bound app, as an alternative to
681
683
 
682
684
  **Parameters:**
683
685
 
684
- | Name | Type | Required | Default | Possible Values | Description |
685
- | -------------- | ---------------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------- |
686
- | `options` | `object` | ✅ | — | — | |
687
- | ↳ `inputs` | `object` | ❌ | — | — | |
688
- | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. |
689
- | ↳ `timeoutMs` | `number` | ❌ | — | — | Maximum time to wait for action completion in milliseconds (default: 180000) |
686
+ | Name | Type | Required | Default | Possible Values | Description |
687
+ | -------------- | ---------------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
688
+ | `options` | `object` | ✅ | — | — | |
689
+ | ↳ `inputs` | `object` | ❌ | — | — | |
690
+ | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
691
+ | ↳ `timeoutMs` | `number` | ❌ | — | — | Maximum time to wait for action completion in milliseconds (default: 180000) |
690
692
 
691
693
  **Returns:** `Promise<PaginatedResult<ActionResultItem>>`
692
694
 
@@ -901,10 +903,10 @@ Execute getConnection
901
903
 
902
904
  **Parameters:**
903
905
 
904
- | Name | Type | Required | Default | Possible Values | Description |
905
- | -------------- | ---------------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------- |
906
- | `options` | `object` | ✅ | — | — | |
907
- | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. |
906
+ | Name | Type | Required | Default | Possible Values | Description |
907
+ | -------------- | ---------------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
908
+ | `options` | `object` | ✅ | — | — | |
909
+ | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
908
910
 
909
911
  **Returns:** `Promise<ConnectionItem>`
910
912
 
@@ -962,16 +964,16 @@ Make authenticated HTTP requests to any API through Zapier. Pass a connectionId
962
964
 
963
965
  **Parameters:**
964
966
 
965
- | Name | Type | Required | Default | Possible Values | Description |
966
- | --------------- | ------------------------ | -------- | ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
967
- | `url` | `string, custom` | ✅ | — | — | The full URL of the API endpoint to call (proxied through Zapier's Relay service) |
968
- | `init` | `object` | ❌ | — | — | Request options including method, headers, body, and authentication |
969
- | ↳ `method` | `string` | ❌ | — | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | HTTP method for the request (defaults to GET) |
970
- | ↳ `headers` | `object` | ❌ | — | — | HTTP headers to include in the request |
971
- | ↳ `body` | `string, custom, record` | ❌ | — | — | Request body — plain objects and JSON strings are auto-detected and Content-Type is set accordingly |
972
- | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. |
973
- | ↳ `callbackUrl` | `string` | ❌ | — | — | URL to send async response to (makes request async) |
974
- | ↳ `maxTime` | `number` | ❌ | — | — | Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling. |
967
+ | Name | Type | Required | Default | Possible Values | Description |
968
+ | --------------- | ------------------------ | -------- | ------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
969
+ | `url` | `string, custom` | ✅ | — | — | The full URL of the API endpoint to call (proxied through Zapier's Relay service) |
970
+ | `init` | `object` | ❌ | — | — | Request options including method, headers, body, and authentication |
971
+ | ↳ `method` | `string` | ❌ | — | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | HTTP method for the request (defaults to GET) |
972
+ | ↳ `headers` | `object` | ❌ | — | — | HTTP headers to include in the request |
973
+ | ↳ `body` | `string, custom, record` | ❌ | — | — | Request body — plain objects and JSON strings are auto-detected and Content-Type is set accordingly |
974
+ | ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
975
+ | ↳ `callbackUrl` | `string` | ❌ | — | — | URL to send async response to (makes request async) |
976
+ | ↳ `maxTime` | `number` | ❌ | — | — | Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling. |
975
977
 
976
978
  **Returns:** `Promise<Response>`
977
979