@zapier/zapier-sdk 0.37.0 → 0.39.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 (85) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +56 -49
  3. package/dist/apps.cjs +9036 -0
  4. package/dist/apps.d.mts +23 -0
  5. package/dist/apps.d.ts +23 -0
  6. package/dist/apps.mjs +9034 -0
  7. package/dist/define/apps-entrypoint.d.ts +3 -0
  8. package/dist/define/apps-entrypoint.d.ts.map +1 -0
  9. package/dist/define/apps-entrypoint.js +1 -0
  10. package/dist/define/apps-registry-keys.d.ts +2 -0
  11. package/dist/define/apps-registry-keys.d.ts.map +1 -0
  12. package/dist/define/apps-registry-keys.js +2 -0
  13. package/dist/define/apps-registry.d.ts +13 -0
  14. package/dist/define/apps-registry.d.ts.map +1 -0
  15. package/dist/define/apps-registry.js +31 -0
  16. package/dist/define/apps-registry.json +9010 -0
  17. package/dist/define/apps.d.ts +11 -0
  18. package/dist/define/apps.d.ts.map +1 -0
  19. package/dist/define/apps.js +2 -0
  20. package/dist/define/define.d.ts +13 -0
  21. package/dist/define/define.d.ts.map +1 -0
  22. package/dist/define/define.js +93 -0
  23. package/dist/define/helpers.d.ts +8 -0
  24. package/dist/define/helpers.d.ts.map +1 -0
  25. package/dist/define/helpers.js +6 -0
  26. package/dist/define/index.d.ts +5 -0
  27. package/dist/define/index.d.ts.map +1 -0
  28. package/dist/define/index.js +2 -0
  29. package/dist/define/types.d.ts +235 -0
  30. package/dist/define/types.d.ts.map +1 -0
  31. package/dist/define/types.js +1 -0
  32. package/dist/define.cjs +113 -0
  33. package/dist/define.d.mts +254 -0
  34. package/dist/define.d.ts +254 -0
  35. package/dist/define.mjs +107 -0
  36. package/dist/index.cjs +145 -41
  37. package/dist/index.d.mts +38 -7
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +2 -0
  41. package/dist/index.mjs +145 -42
  42. package/dist/plugins/capabilities/index.d.ts +22 -0
  43. package/dist/plugins/capabilities/index.d.ts.map +1 -0
  44. package/dist/plugins/capabilities/index.js +76 -0
  45. package/dist/plugins/findFirstConnection/schemas.d.ts +1 -0
  46. package/dist/plugins/findFirstConnection/schemas.d.ts.map +1 -1
  47. package/dist/plugins/findUniqueConnection/schemas.d.ts +1 -0
  48. package/dist/plugins/findUniqueConnection/schemas.d.ts.map +1 -1
  49. package/dist/plugins/listConnections/index.d.ts +2 -1
  50. package/dist/plugins/listConnections/index.d.ts.map +1 -1
  51. package/dist/plugins/listConnections/index.js +10 -3
  52. package/dist/plugins/listConnections/schemas.d.ts +1 -0
  53. package/dist/plugins/listConnections/schemas.d.ts.map +1 -1
  54. package/dist/plugins/listConnections/schemas.js +5 -0
  55. package/dist/plugins/manifest/index.d.ts +1 -0
  56. package/dist/plugins/manifest/index.d.ts.map +1 -1
  57. package/dist/plugins/manifest/index.js +1 -0
  58. package/dist/plugins/manifest/schemas.d.ts +9 -0
  59. package/dist/plugins/manifest/schemas.d.ts.map +1 -1
  60. package/dist/plugins/manifest/schemas.js +9 -0
  61. package/dist/plugins/tables/deleteTable/index.d.ts +2 -1
  62. package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
  63. package/dist/plugins/tables/deleteTable/index.js +1 -0
  64. package/dist/plugins/tables/listTables/index.d.ts +2 -1
  65. package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
  66. package/dist/plugins/tables/listTables/index.js +14 -6
  67. package/dist/plugins/tables/listTables/schemas.d.ts +1 -0
  68. package/dist/plugins/tables/listTables/schemas.d.ts.map +1 -1
  69. package/dist/plugins/tables/listTables/schemas.js +5 -1
  70. package/dist/resolvers/connectionId.d.ts.map +1 -1
  71. package/dist/resolvers/connectionId.js +13 -23
  72. package/dist/resolvers/tableId.d.ts.map +1 -1
  73. package/dist/resolvers/tableId.js +17 -6
  74. package/dist/sdk.d.ts +3 -2
  75. package/dist/sdk.d.ts.map +1 -1
  76. package/dist/sdk.js +3 -0
  77. package/dist/types/sdk.d.ts +3 -0
  78. package/dist/types/sdk.d.ts.map +1 -1
  79. package/dist/types/sdk.js +9 -0
  80. package/dist/utils/pagination-utils.d.ts +6 -0
  81. package/dist/utils/pagination-utils.d.ts.map +1 -1
  82. package/dist/utils/pagination-utils.js +8 -0
  83. package/dist/utils/schema-utils.d.ts +6 -1
  84. package/dist/utils/schema-utils.d.ts.map +1 -1
  85. package/package.json +23 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.39.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a20d36a: Add define primitives (defineTool, defineDurable, defineComponent) via @zapier/zapier-sdk/define entrypoint and app registry via @zapier/zapier-sdk/apps entrypoint.
8
+
9
+ ## 0.38.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 2906101: Default `listConnections` and `listTables` to only return your own items. Gate shared access and table deletion behind boolean flags: `canIncludeSharedConnections`, `canIncludeSharedTables`, `canDeleteTables`. Set via SDK options, `.zapierrc`, CLI flags (`--can-delete-tables`), or env vars (`ZAPIER_CAN_DELETE_TABLES=true`).
14
+
3
15
  ## 0.37.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -320,14 +320,17 @@ console.log(emojiData.emoji);
320
320
 
321
321
  The `createZapierSdk(...)` factory function is the main entry point for the SDK. It provides methods for managing connections, listing apps, running actions, and more.
322
322
 
323
- | Name | Type | Required | Default | Possible Values | Description |
324
- | ------------------------ | -------------------------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
325
- | `credentials` | `string, object, function` | ❌ | — | — | Authentication credentials. Can be a string (token or API key), a client credentials object ({ clientId, clientSecret }), a PKCE object ({ clientId }), or a function returning any of those. |
326
- | `debug` | `boolean` | ❌ | — | — | Enable debug logging. |
327
- | `baseUrl` | `string` | ❌ | — | — | Base URL for Zapier API endpoints. |
328
- | `trackingBaseUrl` | `string` | ❌ | — | — | Base URL for Zapier tracking endpoints. |
329
- | `maxNetworkRetries` | `number` | ❌ | — | — | Max retries for rate-limited requests (default: 3). |
330
- | `maxNetworkRetryDelayMs` | `number` | ❌ | — | — | Max delay in ms to wait for retry (default: 60000). |
323
+ | Name | Type | Required | Default | Possible Values | Description |
324
+ | ----------------------------- | -------------------------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
325
+ | `credentials` | `string, object, function` | ❌ | — | — | Authentication credentials. Can be a string (token or API key), a client credentials object ({ clientId, clientSecret }), a PKCE object ({ clientId }), or a function returning any of those. |
326
+ | `debug` | `boolean` | ❌ | — | — | Enable debug logging. |
327
+ | `baseUrl` | `string` | ❌ | — | — | Base URL for Zapier API endpoints. |
328
+ | `trackingBaseUrl` | `string` | ❌ | — | — | Base URL for Zapier tracking endpoints. |
329
+ | `maxNetworkRetries` | `number` | ❌ | — | — | Max retries for rate-limited requests (default: 3). |
330
+ | `maxNetworkRetryDelayMs` | `number` | ❌ | — | — | Max delay in ms to wait for retry (default: 60000). |
331
+ | `canIncludeSharedConnections` | `boolean` | ❌ | — | — | Allow listing shared connections. |
332
+ | `canIncludeSharedTables` | `boolean` | ❌ | — | — | Allow listing shared tables. |
333
+ | `canDeleteTables` | `boolean` | ❌ | — | — | Allow deleting tables. |
331
334
 
332
335
  ## Named Connections
333
336
 
@@ -862,15 +865,16 @@ Find the first connection matching the criteria
862
865
 
863
866
  **Parameters:**
864
867
 
865
- | Name | Type | Required | Default | Possible Values | Description |
866
- | ------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------ |
867
- | `options` | `object` | ✅ | — | — | |
868
- | ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
869
- | ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
870
- | ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
871
- | ↳ `appKey` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
872
- | ↳ `accountId` | `string` | ❌ | — | — | Account ID to filter by |
873
- | ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status |
868
+ | Name | Type | Required | Default | Possible Values | Description |
869
+ | ----------------- | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
870
+ | `options` | `object` | ✅ | — | — | |
871
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
872
+ | ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
873
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
874
+ | ↳ `appKey` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
875
+ | ↳ `accountId` | `string` | ❌ | — | — | Account ID to filter by |
876
+ | ↳ `includeShared` | `boolean` | ❌ | — | — | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
877
+ | ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status |
874
878
 
875
879
  **Returns:** `Promise<ConnectionItem>`
876
880
 
@@ -886,15 +890,16 @@ Find a unique connection matching the criteria
886
890
 
887
891
  **Parameters:**
888
892
 
889
- | Name | Type | Required | Default | Possible Values | Description |
890
- | ------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------ |
891
- | `options` | `object` | ✅ | — | — | |
892
- | ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
893
- | ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
894
- | ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
895
- | ↳ `appKey` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
896
- | ↳ `accountId` | `string` | ❌ | — | — | Account ID to filter by |
897
- | ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status |
893
+ | Name | Type | Required | Default | Possible Values | Description |
894
+ | ----------------- | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
895
+ | `options` | `object` | ✅ | — | — | |
896
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
897
+ | ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
898
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
899
+ | ↳ `appKey` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
900
+ | ↳ `accountId` | `string` | ❌ | — | — | Account ID to filter by |
901
+ | ↳ `includeShared` | `boolean` | ❌ | — | — | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
902
+ | ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status |
898
903
 
899
904
  **Returns:** `Promise<ConnectionItem>`
900
905
 
@@ -929,19 +934,20 @@ List available connections with optional filtering
929
934
 
930
935
  **Parameters:**
931
936
 
932
- | Name | Type | Required | Default | Possible Values | Description |
933
- | ----------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------ |
934
- | `options` | `object` | ✅ | — | — | |
935
- | ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
936
- | ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
937
- | ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
938
- | ↳ `appKey` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
939
- | ↳ `connectionIds` | `array` | ❌ | — | — | List of connection IDs to filter by |
940
- | ↳ `accountId` | `string` | ❌ | — | — | Account ID to filter by |
941
- | ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status |
942
- | ↳ `pageSize` | `number` | ❌ | — | — | Number of connections per page |
943
- | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
944
- | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
937
+ | Name | Type | Required | Default | Possible Values | Description |
938
+ | ----------------- | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
939
+ | `options` | `object` | ✅ | — | — | |
940
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
941
+ | ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
942
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
943
+ | ↳ `appKey` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
944
+ | ↳ `connectionIds` | `array` | ❌ | — | — | List of connection IDs to filter by |
945
+ | ↳ `accountId` | `string` | ❌ | — | — | Account ID to filter by |
946
+ | ↳ `includeShared` | `boolean` | ❌ | — | — | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
947
+ | ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status |
948
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of connections per page |
949
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
950
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
945
951
 
946
952
  **Returns:** `Promise<PaginatedResult<ConnectionItem>>`
947
953
 
@@ -1263,16 +1269,17 @@ List tables available to the authenticated user
1263
1269
 
1264
1270
  **Parameters:**
1265
1271
 
1266
- | Name | Type | Required | Default | Possible Values | Description |
1267
- | ------------ | -------- | -------- | ------- | -------------------------------- | --------------------------------------------------------------------------- |
1268
- | `options` | `object` | ✅ | — | — | |
1269
- | ↳ `tableIds` | `array` | ❌ | — | — | Filter by specific table IDs |
1270
- | ↳ `kind` | `string` | ❌ | — | `table`, `virtual_table`, `both` | Filter by table type |
1271
- | ↳ `search` | `string` | ❌ | — | — | Search term to filter tables by name |
1272
- | ↳ `owner` | `string` | ❌ | — | — | Filter by table owner. Use "me" for the current user, or a numeric user ID. |
1273
- | ↳ `pageSize` | `number` | ❌ | — | — | Number of tables per page |
1274
- | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
1275
- | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
1272
+ | Name | Type | Required | Default | Possible Values | Description |
1273
+ | ----------------- | --------- | -------- | ------- | -------------------------------- | -------------------------------------------------------------------------------------------------------------- |
1274
+ | `options` | `object` | ✅ | — | — | |
1275
+ | ↳ `tableIds` | `array` | ❌ | — | — | Filter by specific table IDs |
1276
+ | ↳ `kind` | `string` | ❌ | — | `table`, `virtual_table`, `both` | Filter by table type |
1277
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter tables by name |
1278
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by table owner. Use "me" for the current user, or a numeric user ID. Requires includeShared to be true. |
1279
+ | ↳ `includeShared` | `boolean` | ❌ | — | — | Include tables shared with you. Without this, only your own tables are returned. |
1280
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of tables per page |
1281
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
1282
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
1276
1283
 
1277
1284
  **Returns:** `Promise<PaginatedResult<TableItem>>`
1278
1285