@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/dist/index.cjs CHANGED
@@ -1075,6 +1075,9 @@ function concatPaginated({
1075
1075
  }
1076
1076
  });
1077
1077
  }
1078
+ function toIterable(source) {
1079
+ return { [Symbol.asyncIterator]: () => source[Symbol.asyncIterator]() };
1080
+ }
1078
1081
 
1079
1082
  // src/utils/validation.ts
1080
1083
  var validate = (schema, input) => {
@@ -1852,44 +1855,32 @@ var actionKeyResolver = {
1852
1855
 
1853
1856
  // src/resolvers/connectionId.ts
1854
1857
  async function fetchConnections(sdk, resolvedParams) {
1855
- const listOptions = {
1856
- maxItems: 1e3
1857
- };
1858
- if (resolvedParams.appKey) {
1859
- listOptions.appKey = resolvedParams.appKey;
1860
- }
1861
- const myConnections = await sdk.listConnections({
1862
- ...listOptions,
1863
- owner: "me"
1864
- });
1865
- const allConnections = await sdk.listConnections(listOptions);
1866
- const otherConnections = allConnections.data.filter(
1867
- (connection) => !myConnections.data.some(
1868
- (myConnection) => myConnection.id === connection.id
1869
- )
1858
+ const context = sdk.getContext();
1859
+ const includeShared = await context.hasCapability?.(
1860
+ "canIncludeSharedConnections"
1861
+ );
1862
+ return toIterable(
1863
+ sdk.listConnections({
1864
+ appKey: resolvedParams.appKey,
1865
+ includeShared: includeShared || void 0
1866
+ })
1870
1867
  );
1871
- return [...myConnections.data, ...otherConnections];
1872
1868
  }
1873
1869
  function promptForConnection(connections, params) {
1874
1870
  return {
1875
1871
  type: "list",
1876
1872
  name: "connectionId",
1877
1873
  message: params.appKey ? `Select connection for ${params.appKey}:` : "Select connection:",
1878
- choices: [
1879
- ...connections.map((connection) => ({
1880
- name: `${connection.title || connection.label || "Connection"} (ID: ${connection.id})`,
1881
- value: connection.id
1882
- })),
1883
- {
1884
- name: "-> Skip connection (may fail)",
1885
- value: null
1886
- }
1887
- ]
1874
+ choices: connections.map((connection) => ({
1875
+ name: `${connection.title || connection.label || "Connection"} (ID: ${connection.id})`,
1876
+ value: connection.id
1877
+ }))
1888
1878
  };
1889
1879
  }
1890
1880
  var connectionIdResolver = {
1891
1881
  type: "dynamic",
1892
1882
  depends: ["appKey"],
1883
+ requireCapabilities: ["canIncludeSharedConnections"],
1893
1884
  tryResolveWithoutPrompt: async (sdk, params) => {
1894
1885
  if (!params.appKey) return null;
1895
1886
  try {
@@ -1907,6 +1898,7 @@ var connectionIdResolver = {
1907
1898
  var connectionIdGenericResolver = {
1908
1899
  type: "dynamic",
1909
1900
  depends: [],
1901
+ requireCapabilities: ["canIncludeSharedConnections"],
1910
1902
  fetch: fetchConnections,
1911
1903
  prompt: promptForConnection
1912
1904
  };
@@ -2030,11 +2022,24 @@ var clientIdResolver = {
2030
2022
  // src/resolvers/tableId.ts
2031
2023
  var tableIdResolver = {
2032
2024
  type: "dynamic",
2033
- fetch: (sdk) => {
2034
- return concatPaginated({
2035
- sources: [() => sdk.listTables({ owner: "me" }), () => sdk.listTables()],
2036
- dedupe: (table) => table.id
2037
- });
2025
+ requireCapabilities: ["canIncludeSharedTables"],
2026
+ fetch: async (sdk) => {
2027
+ const context = sdk.getContext();
2028
+ const includeShared = await context.hasCapability?.(
2029
+ "canIncludeSharedTables"
2030
+ );
2031
+ if (includeShared) {
2032
+ return toIterable(
2033
+ concatPaginated({
2034
+ sources: [
2035
+ () => sdk.listTables(),
2036
+ () => sdk.listTables({ includeShared: true })
2037
+ ],
2038
+ dedupe: (table) => table.id
2039
+ })
2040
+ );
2041
+ }
2042
+ return toIterable(sdk.listTables());
2038
2043
  },
2039
2044
  prompt: (tables) => ({
2040
2045
  type: "list",
@@ -3130,6 +3135,10 @@ var ListConnectionsQuerySchema = connections.ListConnectionsQuerySchema.omit({
3130
3135
  ),
3131
3136
  // camelCase account ID
3132
3137
  accountId: zod.z.string().optional().describe("Account ID to filter by"),
3138
+ // Include shared connections (overrides default owner=me filter)
3139
+ includeShared: zod.z.boolean().optional().describe(
3140
+ "Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections."
3141
+ ),
3133
3142
  // camelCase isExpired
3134
3143
  isExpired: zod.z.boolean().optional().describe("Filter by expired status"),
3135
3144
  // Override pageSize to make optional
@@ -3169,6 +3178,9 @@ var ConnectionItemSchema = withFormatter(connections.ConnectionItemSchema, {
3169
3178
  // src/plugins/listConnections/index.ts
3170
3179
  var listConnectionsPlugin = ({ context }) => {
3171
3180
  async function listConnectionsPage(options) {
3181
+ if (options.includeShared) {
3182
+ await context.checkCapability("canIncludeSharedConnections");
3183
+ }
3172
3184
  const { api, getVersionedImplementationId } = context;
3173
3185
  const searchParams = {};
3174
3186
  if (options.pageSize !== void 0) {
@@ -3199,8 +3211,14 @@ var listConnectionsPlugin = ({ context }) => {
3199
3211
  if (options.accountId) {
3200
3212
  searchParams.account_id = options.accountId;
3201
3213
  }
3202
- if (options.owner) {
3203
- searchParams.owner = options.owner;
3214
+ if (options.owner && options.owner !== "me" && !options.includeShared) {
3215
+ throw new ZapierValidationError(
3216
+ 'The "owner" option requires "includeShared" to be true. Without includeShared, only your own connections are returned.'
3217
+ );
3218
+ }
3219
+ const owner = options.includeShared ? options.owner : "me";
3220
+ if (owner) {
3221
+ searchParams.owner = owner;
3204
3222
  }
3205
3223
  if (options.isExpired !== void 0) {
3206
3224
  searchParams.is_expired = options.isExpired.toString();
@@ -4122,6 +4140,9 @@ var ManifestSchema = zod.z.object({
4122
4140
  })
4123
4141
  ).optional(),
4124
4142
  actions: zod.z.record(zod.z.string(), ActionEntrySchema).optional().describe("Saved action configurations with their schemas"),
4143
+ canIncludeSharedConnections: zod.z.boolean().optional().describe("Allow listing shared connections"),
4144
+ canIncludeSharedTables: zod.z.boolean().optional().describe("Allow listing shared tables"),
4145
+ canDeleteTables: zod.z.boolean().optional().describe("Allow deleting tables"),
4125
4146
  connections: ConnectionsMapSchema.optional().describe(
4126
4147
  "Named connections map. Keys are connection names, values contain a connectionId."
4127
4148
  )
@@ -4477,6 +4498,7 @@ var manifestPlugin = (params) => {
4477
4498
  };
4478
4499
  return {
4479
4500
  context: {
4501
+ getResolvedManifest,
4480
4502
  getVersionedImplementationId,
4481
4503
  resolveAppKeys: async ({ appKeys }) => resolveAppKeys({
4482
4504
  appKeys,
@@ -5880,6 +5902,69 @@ var connectionsPlugin = (params) => {
5880
5902
  }
5881
5903
  };
5882
5904
  };
5905
+
5906
+ // src/plugins/capabilities/index.ts
5907
+ function toDescription(key) {
5908
+ const words = key.replace(/^can/, "").replace(/([A-Z])/g, " $1").trim().toLowerCase();
5909
+ return `To ${words}`;
5910
+ }
5911
+ function toEnvVar(key) {
5912
+ return "ZAPIER_" + key.replace(/([A-Z])/g, "_$1").toUpperCase();
5913
+ }
5914
+ function toCliFlag(key) {
5915
+ return "--" + key.replace(/([A-Z])/g, "-$1").toLowerCase();
5916
+ }
5917
+ function buildCapabilityMessage(key) {
5918
+ return [
5919
+ `${toDescription(key)}, use ${toCliFlag(key)} in the CLI,`,
5920
+ `set ${key}: true in SDK options or .zapierrc,`,
5921
+ `or set ${toEnvVar(key)}=true.`
5922
+ ].join(" ");
5923
+ }
5924
+ var GATED_FLAGS = [
5925
+ "canIncludeSharedConnections",
5926
+ "canIncludeSharedTables",
5927
+ "canDeleteTables"
5928
+ ];
5929
+ function isEnabledByEnv(key) {
5930
+ if (typeof process === "undefined") return void 0;
5931
+ const value = process.env[toEnvVar(key)];
5932
+ if (value === void 0) return void 0;
5933
+ if (value === "true" || value === "1") return true;
5934
+ if (value === "false" || value === "0") return false;
5935
+ return void 0;
5936
+ }
5937
+ var capabilitiesPlugin = ({ context }) => {
5938
+ const options = context.options ?? {};
5939
+ let cached;
5940
+ async function resolveFlags() {
5941
+ if (cached) return cached;
5942
+ const manifest = await context.getResolvedManifest();
5943
+ cached = {};
5944
+ for (const flag of GATED_FLAGS) {
5945
+ cached[flag] = Boolean(
5946
+ options[flag] ?? isEnabledByEnv(flag) ?? manifest?.[flag]
5947
+ );
5948
+ }
5949
+ return cached;
5950
+ }
5951
+ return {
5952
+ context: {
5953
+ checkCapability: async (key) => {
5954
+ const flags = await resolveFlags();
5955
+ if (flags[key]) return;
5956
+ throw new ZapierConfigurationError(
5957
+ buildCapabilityMessage(key) + " (If you are an AI agent, you MUST NOT retry. Ask the user if they want to enable this.)",
5958
+ { configType: key }
5959
+ );
5960
+ },
5961
+ hasCapability: async (key) => {
5962
+ const flags = await resolveFlags();
5963
+ return flags[key];
5964
+ }
5965
+ }
5966
+ };
5967
+ };
5883
5968
  var TableApiItemSchema = zod.z.object({
5884
5969
  id: zod.z.string(),
5885
5970
  name: zod.z.string(),
@@ -5914,7 +5999,10 @@ var ListTablesOptionsSchema = zod.z.object({
5914
5999
  kind: zod.z.enum(["table", "virtual_table", "both"]).optional().describe("Filter by table type"),
5915
6000
  search: zod.z.string().optional().describe("Search term to filter tables by name"),
5916
6001
  owner: zod.z.string().optional().describe(
5917
- 'Filter by table owner. Use "me" for the current user, or a numeric user ID.'
6002
+ 'Filter by table owner. Use "me" for the current user, or a numeric user ID. Requires includeShared to be true.'
6003
+ ),
6004
+ includeShared: zod.z.boolean().optional().describe(
6005
+ "Include tables shared with you. Without this, only your own tables are returned."
5918
6006
  ),
5919
6007
  pageSize: zod.z.number().min(1).optional().describe("Number of tables per page"),
5920
6008
  maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
@@ -5936,6 +6024,9 @@ function extractNextCursor(links) {
5936
6024
  }
5937
6025
  var listTablesPlugin = ({ context }) => {
5938
6026
  async function listTablesPage(options) {
6027
+ if (options.includeShared) {
6028
+ await context.checkCapability("canIncludeSharedTables");
6029
+ }
5939
6030
  const { api } = context;
5940
6031
  const searchParams = {};
5941
6032
  if (options.pageSize !== void 0) {
@@ -5950,15 +6041,23 @@ var listTablesPlugin = ({ context }) => {
5950
6041
  if (options?.search) {
5951
6042
  searchParams.q = options.search;
5952
6043
  }
5953
- if (options?.owner) {
5954
- let ownerId = options.owner;
5955
- if (ownerId === "me") {
6044
+ if (options?.owner && options.owner !== "me" && !options.includeShared) {
6045
+ throw new ZapierValidationError(
6046
+ 'The "owner" option requires "includeShared" to be true. Without includeShared, only your own tables are returned.'
6047
+ );
6048
+ }
6049
+ const owner = options.includeShared ? options.owner : "me";
6050
+ if (owner) {
6051
+ if (owner === "me") {
5956
6052
  const profile = await api.get("/zapier/api/v4/profile/", {
5957
6053
  authRequired: true
5958
6054
  });
5959
- ownerId = String(profile.id);
6055
+ searchParams.owner_customuser_id = String(
6056
+ profile.id
6057
+ );
6058
+ } else {
6059
+ searchParams.owner_customuser_id = owner;
5960
6060
  }
5961
- searchParams.owner_customuser_id = ownerId;
5962
6061
  }
5963
6062
  if (options.cursor) {
5964
6063
  searchParams.offset = options.cursor;
@@ -6152,6 +6251,7 @@ var DeleteTableOptionsSchema = zod.z.object({
6152
6251
  // src/plugins/tables/deleteTable/index.ts
6153
6252
  var deleteTablePlugin = ({ context }) => {
6154
6253
  async function deleteTable(options) {
6254
+ await context.checkCapability("canDeleteTables");
6155
6255
  const { api } = context;
6156
6256
  await api.delete(`/tables/api/v1/tables/${options.tableId}`, void 0, {
6157
6257
  customErrorHandler: ({ status }) => {
@@ -7561,7 +7661,7 @@ function getCpuTime() {
7561
7661
  }
7562
7662
 
7563
7663
  // src/plugins/eventEmission/builders.ts
7564
- var SDK_VERSION = "0.37.0";
7664
+ var SDK_VERSION = "0.39.0";
7565
7665
  function createBaseEvent(context = {}) {
7566
7666
  return {
7567
7667
  event_id: generateEventId(),
@@ -8054,7 +8154,7 @@ function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} })
8054
8154
  };
8055
8155
  }
8056
8156
  function createZapierSdkWithoutRegistry(options = {}) {
8057
- return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(connectionsPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(getInputFieldsSchemaPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listConnectionsPlugin).addPlugin(getConnectionPlugin).addPlugin(findFirstConnectionPlugin).addPlugin(findUniqueConnectionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(listClientCredentialsPlugin).addPlugin(createClientCredentialsPlugin).addPlugin(deleteClientCredentialsPlugin).addPlugin(fetchPlugin).addPlugin(requestPlugin).addPlugin(listTablesPlugin).addPlugin(getTablePlugin).addPlugin(deleteTablePlugin).addPlugin(createTablePlugin).addPlugin(listTableFieldsPlugin).addPlugin(createTableFieldsPlugin).addPlugin(deleteTableFieldsPlugin).addPlugin(getTableRecordPlugin).addPlugin(listTableRecordsPlugin).addPlugin(createTableRecordsPlugin).addPlugin(deleteTableRecordsPlugin).addPlugin(updateTableRecordsPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
8157
+ return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(capabilitiesPlugin).addPlugin(connectionsPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(getInputFieldsSchemaPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listConnectionsPlugin).addPlugin(getConnectionPlugin).addPlugin(findFirstConnectionPlugin).addPlugin(findUniqueConnectionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(listClientCredentialsPlugin).addPlugin(createClientCredentialsPlugin).addPlugin(deleteClientCredentialsPlugin).addPlugin(fetchPlugin).addPlugin(requestPlugin).addPlugin(listTablesPlugin).addPlugin(getTablePlugin).addPlugin(deleteTablePlugin).addPlugin(createTablePlugin).addPlugin(listTableFieldsPlugin).addPlugin(createTableFieldsPlugin).addPlugin(deleteTableFieldsPlugin).addPlugin(getTableRecordPlugin).addPlugin(listTableRecordsPlugin).addPlugin(createTableRecordsPlugin).addPlugin(deleteTableRecordsPlugin).addPlugin(updateTableRecordsPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
8058
8158
  }
8059
8159
  function createZapierSdk(options = {}) {
8060
8160
  return createZapierSdkWithoutRegistry(options).addPlugin(registryPlugin);
@@ -8083,6 +8183,9 @@ var BaseSdkOptionsSchema = zod.z.object({
8083
8183
  onEvent: zod.z.custom().optional().meta({ internal: true }),
8084
8184
  fetch: zod.z.custom().optional().meta({ internal: true }),
8085
8185
  eventEmission: zod.z.custom().optional().meta({ internal: true }),
8186
+ canIncludeSharedConnections: zod.z.boolean().optional().describe("Allow listing shared connections."),
8187
+ canIncludeSharedTables: zod.z.boolean().optional().describe("Allow listing shared tables."),
8188
+ canDeleteTables: zod.z.boolean().optional().describe("Allow deleting tables."),
8086
8189
  // Deprecated
8087
8190
  token: zod.z.string().optional().meta({ deprecated: true })
8088
8191
  // Use credentials instead
@@ -8144,6 +8247,7 @@ exports.authenticationIdGenericResolver = connectionIdGenericResolver;
8144
8247
  exports.authenticationIdResolver = connectionIdResolver;
8145
8248
  exports.batch = batch;
8146
8249
  exports.buildApplicationLifecycleEvent = buildApplicationLifecycleEvent;
8250
+ exports.buildCapabilityMessage = buildCapabilityMessage;
8147
8251
  exports.buildErrorEvent = buildErrorEvent;
8148
8252
  exports.buildErrorEventWithContext = buildErrorEventWithContext;
8149
8253
  exports.buildMethodCalledEvent = buildMethodCalledEvent;
package/dist/index.d.mts CHANGED
@@ -955,6 +955,9 @@ type ActionEntry = z.infer<typeof ActionEntrySchema>;
955
955
  type Manifest = {
956
956
  apps?: Record<string, ManifestEntry>;
957
957
  actions?: Record<string, ActionEntry>;
958
+ canIncludeSharedConnections?: boolean;
959
+ canIncludeSharedTables?: boolean;
960
+ canDeleteTables?: boolean;
958
961
  connections?: ConnectionsMap;
959
962
  };
960
963
  type ResolveAppKeys = ({ appKeys, }: {
@@ -977,6 +980,9 @@ declare const ManifestPluginOptionsSchema: z.ZodObject<{
977
980
  schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
978
981
  createdAt: z.ZodString;
979
982
  }, z.core.$strip>>>;
983
+ canIncludeSharedConnections: z.ZodOptional<z.ZodBoolean>;
984
+ canIncludeSharedTables: z.ZodOptional<z.ZodBoolean>;
985
+ canDeleteTables: z.ZodOptional<z.ZodBoolean>;
980
986
  connections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
981
987
  connectionId: z.ZodNumber;
982
988
  }, z.core.$strip>>>;
@@ -1010,6 +1016,7 @@ interface AddActionEntryResult {
1010
1016
  }
1011
1017
  interface ManifestPluginProvides {
1012
1018
  context: {
1019
+ getResolvedManifest: () => Promise<Manifest | null>;
1013
1020
  getVersionedImplementationId: GetVersionedImplementationId;
1014
1021
  resolveAppKeys: ResolveAppKeys;
1015
1022
  getManifestConnections: () => Promise<ConnectionsMap | null>;
@@ -1318,6 +1325,7 @@ declare const FindFirstConnectionSchema: z.ZodObject<{
1318
1325
  owner: z.ZodOptional<z.ZodString>;
1319
1326
  authenticationIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1320
1327
  accountId: z.ZodOptional<z.ZodString>;
1328
+ includeShared: z.ZodOptional<z.ZodBoolean>;
1321
1329
  isExpired: z.ZodOptional<z.ZodBoolean>;
1322
1330
  }, z.core.$strip>;
1323
1331
  type FindFirstConnectionOptions = z.infer<typeof FindFirstConnectionSchema>;
@@ -1331,6 +1339,7 @@ declare const FindUniqueConnectionSchema: z.ZodObject<{
1331
1339
  owner: z.ZodOptional<z.ZodString>;
1332
1340
  authenticationIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1333
1341
  accountId: z.ZodOptional<z.ZodString>;
1342
+ includeShared: z.ZodOptional<z.ZodBoolean>;
1334
1343
  isExpired: z.ZodOptional<z.ZodBoolean>;
1335
1344
  }, z.core.$strip>;
1336
1345
  type FindUniqueConnectionOptions = z.infer<typeof FindUniqueConnectionSchema>;
@@ -1778,6 +1787,7 @@ declare const ListConnectionsQuerySchema: z.ZodObject<{
1778
1787
  connectionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1779
1788
  authenticationIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1780
1789
  accountId: z.ZodOptional<z.ZodString>;
1790
+ includeShared: z.ZodOptional<z.ZodBoolean>;
1781
1791
  isExpired: z.ZodOptional<z.ZodBoolean>;
1782
1792
  pageSize: z.ZodOptional<z.ZodNumber>;
1783
1793
  maxItems: z.ZodOptional<z.ZodNumber>;
@@ -1789,6 +1799,17 @@ interface ListConnectionsPage {
1789
1799
  nextCursor?: string;
1790
1800
  }
1791
1801
 
1802
+ declare function buildCapabilityMessage(key: string): string;
1803
+ declare const GATED_FLAGS: readonly ["canIncludeSharedConnections", "canIncludeSharedTables", "canDeleteTables"];
1804
+ type GatedFlag = (typeof GATED_FLAGS)[number];
1805
+ interface CapabilitiesContext {
1806
+ checkCapability: (key: GatedFlag) => Promise<void>;
1807
+ hasCapability: (key: GatedFlag) => Promise<boolean>;
1808
+ }
1809
+ interface CapabilitiesPluginProvides {
1810
+ context: CapabilitiesContext;
1811
+ }
1812
+
1792
1813
  interface ListConnectionsPluginProvides {
1793
1814
  listConnections: (options?: ListConnectionsOptions) => Promise<ListConnectionsPage> & AsyncIterable<ListConnectionsPage> & {
1794
1815
  items(): AsyncIterable<ConnectionItem$2>;
@@ -1804,7 +1825,7 @@ interface ListConnectionsPluginProvides {
1804
1825
  declare const listConnectionsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, {
1805
1826
  api: ApiClient;
1806
1827
  getVersionedImplementationId: GetVersionedImplementationId;
1807
- } & EventEmissionContext, ListConnectionsPluginProvides>;
1828
+ } & EventEmissionContext & CapabilitiesContext, ListConnectionsPluginProvides>;
1808
1829
 
1809
1830
  interface GetConnectionPluginProvides {
1810
1831
  getConnection: (options: GetConnectionParam) => Promise<GetConnectionResponse>;
@@ -2139,6 +2160,7 @@ declare const ListTablesOptionsSchema: z.ZodObject<{
2139
2160
  }>>;
2140
2161
  search: z.ZodOptional<z.ZodString>;
2141
2162
  owner: z.ZodOptional<z.ZodString>;
2163
+ includeShared: z.ZodOptional<z.ZodBoolean>;
2142
2164
  pageSize: z.ZodOptional<z.ZodNumber>;
2143
2165
  maxItems: z.ZodOptional<z.ZodNumber>;
2144
2166
  cursor: z.ZodOptional<z.ZodString>;
@@ -2163,7 +2185,7 @@ interface ListTablesPluginProvides {
2163
2185
  };
2164
2186
  };
2165
2187
  }
2166
- declare const listTablesPlugin: Plugin<{}, GetContextType<ApiPluginProvides> & EventEmissionContext, ListTablesPluginProvides>;
2188
+ declare const listTablesPlugin: Plugin<{}, GetContextType<ApiPluginProvides> & EventEmissionContext & CapabilitiesContext, ListTablesPluginProvides>;
2167
2189
 
2168
2190
  declare const GetTableOptionsSchema: z.ZodObject<{
2169
2191
  tableId: z.ZodString;
@@ -2206,7 +2228,7 @@ interface DeleteTablePluginProvides {
2206
2228
  }
2207
2229
  declare const deleteTablePlugin: Plugin<{}, {
2208
2230
  api: ApiClient;
2209
- } & EventEmissionContext, DeleteTablePluginProvides>;
2231
+ } & EventEmissionContext & CapabilitiesContext, DeleteTablePluginProvides>;
2210
2232
 
2211
2233
  declare const CreateTableOptionsSchema: z.ZodObject<{
2212
2234
  name: z.ZodString;
@@ -2613,6 +2635,9 @@ declare const BaseSdkOptionsSchema: z.ZodObject<{
2613
2635
  onEvent: z.ZodOptional<z.ZodCustom<EventCallback, EventCallback>>;
2614
2636
  fetch: z.ZodOptional<z.ZodCustom<typeof fetch, typeof fetch>>;
2615
2637
  eventEmission: z.ZodOptional<z.ZodCustom<EventEmissionConfig, EventEmissionConfig>>;
2638
+ canIncludeSharedConnections: z.ZodOptional<z.ZodBoolean>;
2639
+ canIncludeSharedTables: z.ZodOptional<z.ZodBoolean>;
2640
+ canDeleteTables: z.ZodOptional<z.ZodBoolean>;
2616
2641
  token: z.ZodOptional<z.ZodString>;
2617
2642
  }, z.core.$strip>;
2618
2643
  type BaseSdkOptions = z.infer<typeof BaseSdkOptionsSchema>;
@@ -2706,8 +2731,13 @@ interface DynamicResolver<TItem = unknown, TParams = Record<string, unknown>> ex
2706
2731
  fetch: (sdk: ZapierSdk, resolvedParams: TParams) => PromiseLike<TItem[] | {
2707
2732
  data: TItem[];
2708
2733
  nextCursor?: string;
2709
- }>;
2734
+ } | AsyncIterable<{
2735
+ data: TItem[];
2736
+ nextCursor?: string;
2737
+ }>>;
2710
2738
  prompt: (items: TItem[], params: TParams) => PromptConfig;
2739
+ /** Capabilities that expand results. The parameter resolver shows a hint for any that aren't enabled. */
2740
+ requireCapabilities?: string[];
2711
2741
  /**
2712
2742
  * Optional hook called before fetch/prompt. If it returns a non-null object,
2713
2743
  * resolvedValue is used directly and fetch/prompt are skipped entirely. Return
@@ -3370,12 +3400,13 @@ declare function createSdk<TCurrentSdk = {}, TCurrentContext extends {
3370
3400
  getContext(): TCurrentContext;
3371
3401
  }, TRequiresContext, TProvides>, addPluginOptions?: Record<string, unknown>): Sdk<TCurrentSdk & ExtractSdkProperties<TProvides>, TCurrentContext & NonNullable<ExtractContextProperties<TProvides>>>;
3372
3402
  };
3373
- declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk<ExtractSdkProperties<EventEmissionProvides> & ExtractSdkProperties<ApiPluginProvides> & ExtractSdkProperties<ManifestPluginProvides> & ExtractSdkProperties<ConnectionsPluginProvides> & ExtractSdkProperties<ListAppsPluginProvides> & ExtractSdkProperties<GetAppPluginProvides> & ExtractSdkProperties<ListActionsPluginProvides> & ExtractSdkProperties<GetActionPluginProvides> & ExtractSdkProperties<ListInputFieldsPluginProvides> & ExtractSdkProperties<GetInputFieldsSchemaPluginProvides> & ExtractSdkProperties<ListInputFieldChoicesPluginProvides> & ExtractSdkProperties<RunActionPluginProvides> & ExtractSdkProperties<ListConnectionsPluginProvides> & ExtractSdkProperties<GetConnectionPluginProvides> & ExtractSdkProperties<FindFirstConnectionPluginProvides> & ExtractSdkProperties<FindUniqueConnectionPluginProvides> & ExtractSdkProperties<ListAuthenticationsPluginProvides> & ExtractSdkProperties<GetAuthenticationPluginProvides> & ExtractSdkProperties<FindFirstAuthenticationPluginProvides> & ExtractSdkProperties<FindUniqueAuthenticationPluginProvides> & ExtractSdkProperties<ListClientCredentialsPluginProvides> & ExtractSdkProperties<CreateClientCredentialsPluginProvides> & ExtractSdkProperties<DeleteClientCredentialsPluginProvides> & ExtractSdkProperties<FetchPluginProvides> & ExtractSdkProperties<RequestPluginProvides> & ExtractSdkProperties<ListTablesPluginProvides> & ExtractSdkProperties<GetTablePluginProvides> & ExtractSdkProperties<DeleteTablePluginProvides> & ExtractSdkProperties<CreateTablePluginProvides> & ExtractSdkProperties<ListTableFieldsPluginProvides> & ExtractSdkProperties<CreateTableFieldsPluginProvides> & ExtractSdkProperties<DeleteTableFieldsPluginProvides> & ExtractSdkProperties<GetTableRecordPluginProvides> & ExtractSdkProperties<ListTableRecordsPluginProvides> & ExtractSdkProperties<CreateTableRecordsPluginProvides> & ExtractSdkProperties<DeleteTableRecordsPluginProvides> & ExtractSdkProperties<UpdateTableRecordsPluginProvides> & ExtractSdkProperties<AppsPluginProvides> & ExtractSdkProperties<GetProfilePluginProvides>, {
3403
+ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk<ExtractSdkProperties<EventEmissionProvides> & ExtractSdkProperties<ApiPluginProvides> & ExtractSdkProperties<ManifestPluginProvides> & ExtractSdkProperties<CapabilitiesPluginProvides> & ExtractSdkProperties<ConnectionsPluginProvides> & ExtractSdkProperties<ListAppsPluginProvides> & ExtractSdkProperties<GetAppPluginProvides> & ExtractSdkProperties<ListActionsPluginProvides> & ExtractSdkProperties<GetActionPluginProvides> & ExtractSdkProperties<ListInputFieldsPluginProvides> & ExtractSdkProperties<GetInputFieldsSchemaPluginProvides> & ExtractSdkProperties<ListInputFieldChoicesPluginProvides> & ExtractSdkProperties<RunActionPluginProvides> & ExtractSdkProperties<ListConnectionsPluginProvides> & ExtractSdkProperties<GetConnectionPluginProvides> & ExtractSdkProperties<FindFirstConnectionPluginProvides> & ExtractSdkProperties<FindUniqueConnectionPluginProvides> & ExtractSdkProperties<ListAuthenticationsPluginProvides> & ExtractSdkProperties<GetAuthenticationPluginProvides> & ExtractSdkProperties<FindFirstAuthenticationPluginProvides> & ExtractSdkProperties<FindUniqueAuthenticationPluginProvides> & ExtractSdkProperties<ListClientCredentialsPluginProvides> & ExtractSdkProperties<CreateClientCredentialsPluginProvides> & ExtractSdkProperties<DeleteClientCredentialsPluginProvides> & ExtractSdkProperties<FetchPluginProvides> & ExtractSdkProperties<RequestPluginProvides> & ExtractSdkProperties<ListTablesPluginProvides> & ExtractSdkProperties<GetTablePluginProvides> & ExtractSdkProperties<DeleteTablePluginProvides> & ExtractSdkProperties<CreateTablePluginProvides> & ExtractSdkProperties<ListTableFieldsPluginProvides> & ExtractSdkProperties<CreateTableFieldsPluginProvides> & ExtractSdkProperties<DeleteTableFieldsPluginProvides> & ExtractSdkProperties<GetTableRecordPluginProvides> & ExtractSdkProperties<ListTableRecordsPluginProvides> & ExtractSdkProperties<CreateTableRecordsPluginProvides> & ExtractSdkProperties<DeleteTableRecordsPluginProvides> & ExtractSdkProperties<UpdateTableRecordsPluginProvides> & ExtractSdkProperties<AppsPluginProvides> & ExtractSdkProperties<GetProfilePluginProvides>, {
3374
3404
  meta: Record<string, PluginMeta>;
3375
3405
  } & EventEmissionContext & {
3376
3406
  api: ApiClient;
3377
3407
  resolveCredentials: () => Promise<ResolvedCredentials | undefined>;
3378
3408
  } & {
3409
+ getResolvedManifest: () => Promise<Manifest | null>;
3379
3410
  getVersionedImplementationId: GetVersionedImplementationId;
3380
3411
  resolveAppKeys: ResolveAppKeys;
3381
3412
  getManifestConnections: () => Promise<ConnectionsMap | null>;
@@ -3402,7 +3433,7 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
3402
3433
  manifest: Manifest;
3403
3434
  }) => [string, ManifestEntry] | null;
3404
3435
  readManifestFromFile: (filePath: string) => Promise<Manifest | null>;
3405
- } & {
3436
+ } & CapabilitiesContext & {
3406
3437
  resolveConnection: (name: string) => Promise<ConnectionEntry | undefined>;
3407
3438
  getConnectionsMap: () => Promise<ConnectionsMap | null>;
3408
3439
  } & {
@@ -3619,4 +3650,4 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
3619
3650
  }>;
3620
3651
  declare function createZapierSdk(options?: ZapierSdkOptions): ZapierSdk;
3621
3652
 
3622
- export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTimeoutMsProperty, ActionTimeoutMsPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type ArrayResolver, type AuthEvent, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type BaseEvent, BaseSdkOptionsSchema, type BatchOptions, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, type Choice, type ClientCredentialsObject, ClientCredentialsObjectSchema, type Connection, type ConnectionEntry, ConnectionEntrySchema, type ConnectionIdProperty, ConnectionIdPropertySchema, type ConnectionItem, type ConnectionProperty, ConnectionPropertySchema, type ConnectionsMap, ConnectionsMapSchema, type ConnectionsPluginProvides, type ConnectionsResponse, type CreateClientCredentialsPluginProvides, type CreateTableFieldsPluginProvides, type CreateTablePluginProvides, type CreateTableRecordsPluginProvides, type Credentials, type CredentialsFunction, CredentialsFunctionSchema, type CredentialsObject, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_PAGE_SIZE, type DebugProperty, DebugPropertySchema, type DeleteClientCredentialsPluginProvides, type DeleteTableFieldsPluginProvides, type DeleteTablePluginProvides, type DeleteTableRecordsPluginProvides, type DynamicResolver, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsResolver, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindFirstConnectionPluginProvides, type FindUniqueAuthenticationPluginProvides, type FindUniqueConnectionPluginProvides, type FormatMetadata, type FormattedItem, type FunctionDeprecation, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetConnectionPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type GetTablePluginProvides, type GetTableRecordPluginProvides, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListClientCredentialsPluginProvides, type ListConnectionsPluginProvides, type ListInputFieldsPluginProvides, type ListTableFieldsPluginProvides, type ListTableRecordsPluginProvides, type ListTablesPluginProvides, type LoadingEvent, MAX_PAGE_LIMIT, type Manifest, type ManifestEntry, type ManifestPluginOptions, type ManifestPluginProvides, type MethodCalledEvent, type MethodCalledEventData, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputFormatter, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type PkceCredentialsObject, PkceCredentialsObjectSchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, type RateLimitInfo, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedCredentials, ResolvedCredentialsSchema, type Resolver, type ResolverMetadata, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type SdkPage, type StaticResolver, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UpdateTableRecordsPluginProvides, type UserProfile, type UserProfileItem, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, updateTableRecordsPlugin };
3653
+ export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTimeoutMsProperty, ActionTimeoutMsPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type ArrayResolver, type AuthEvent, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type BaseEvent, BaseSdkOptionsSchema, type BatchOptions, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, type Choice, type ClientCredentialsObject, ClientCredentialsObjectSchema, type Connection, type ConnectionEntry, ConnectionEntrySchema, type ConnectionIdProperty, ConnectionIdPropertySchema, type ConnectionItem, type ConnectionProperty, ConnectionPropertySchema, type ConnectionsMap, ConnectionsMapSchema, type ConnectionsPluginProvides, type ConnectionsResponse, type CreateClientCredentialsPluginProvides, type CreateTableFieldsPluginProvides, type CreateTablePluginProvides, type CreateTableRecordsPluginProvides, type Credentials, type CredentialsFunction, CredentialsFunctionSchema, type CredentialsObject, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_PAGE_SIZE, type DebugProperty, DebugPropertySchema, type DeleteClientCredentialsPluginProvides, type DeleteTableFieldsPluginProvides, type DeleteTablePluginProvides, type DeleteTableRecordsPluginProvides, type DynamicResolver, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsResolver, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindFirstConnectionPluginProvides, type FindUniqueAuthenticationPluginProvides, type FindUniqueConnectionPluginProvides, type FormatMetadata, type FormattedItem, type FunctionDeprecation, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetConnectionPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type GetTablePluginProvides, type GetTableRecordPluginProvides, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListClientCredentialsPluginProvides, type ListConnectionsPluginProvides, type ListInputFieldsPluginProvides, type ListTableFieldsPluginProvides, type ListTableRecordsPluginProvides, type ListTablesPluginProvides, type LoadingEvent, MAX_PAGE_LIMIT, type Manifest, type ManifestEntry, type ManifestPluginOptions, type ManifestPluginProvides, type MethodCalledEvent, type MethodCalledEventData, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputFormatter, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type PkceCredentialsObject, PkceCredentialsObjectSchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, type RateLimitInfo, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedCredentials, ResolvedCredentialsSchema, type Resolver, type ResolverMetadata, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type SdkPage, type StaticResolver, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UpdateTableRecordsPluginProvides, type UserProfile, type UserProfileItem, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, updateTableRecordsPlugin };
package/dist/index.d.ts CHANGED
@@ -36,6 +36,7 @@ export * from "./credentials";
36
36
  export * from "./types/credentials";
37
37
  export * from "./types/connections";
38
38
  export * from "./plugins/connections";
39
+ export { buildCapabilityMessage } from "./plugins/capabilities";
39
40
  export { logDeprecation, resetDeprecationWarnings } from "./utils/logging";
40
41
  export * from "./constants";
41
42
  export { RelayRequestSchema, RelayFetchSchema, } from "./plugins/request/schemas";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,c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ClB,aAAa,EACb,UAAU,EACV,cAAc,EACd,GAAG,GACJ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EACV,oBAAoB,EACpB,YAAY,EACZ,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,IAAI,EACJ,aAAa,EACb,cAAc,EACd,UAAU,EACV,8BAA8B,EAC9B,0BAA0B,EAC1B,eAAe,EACf,eAAe,EACf,sBAAsB,GACvB,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -41,6 +41,8 @@ export * from "./types/credentials";
41
41
  // Export connections types and utilities
42
42
  export * from "./types/connections";
43
43
  export * from "./plugins/connections";
44
+ // Export capabilities
45
+ export { buildCapabilityMessage } from "./plugins/capabilities";
44
46
  // Export logging utilities
45
47
  export { logDeprecation, resetDeprecationWarnings } from "./utils/logging";
46
48
  // Export constants