@zapier/zapier-sdk 0.47.1 → 0.48.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.48.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c7cff63: Adds an extension mechanism that lets the CLI and MCP server load additional plugin packages at runtime. Set `ZAPIER_SDK_EXTENSIONS` to a comma-separated list of package specifiers, or pass them via the new `extensions` option — methods they contribute show up automatically as CLI commands and MCP tools, no per-project wiring required.
8
+
9
+ When a plugin tries to register a method, context field, or meta entry that's already registered by another plugin in the chain, `addPlugin` now logs a warning and skips the duplicate plugin's contribution rather than silently overwriting. This catches the common foot-gun of an extension accidentally shadowing a built-in SDK method. Intentional duplicates can be expressed via `composePlugins(...)`, and meta-only overrides (e.g. tagging a built-in method as deprecated) continue to work unchanged.
10
+
3
11
  ## 0.47.1
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -5631,7 +5631,7 @@ async function invalidateCredentialsToken(options) {
5631
5631
  }
5632
5632
 
5633
5633
  // src/sdk-version.ts
5634
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.47.1" : void 0) || "unknown";
5634
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.48.0" : void 0) || "unknown";
5635
5635
 
5636
5636
  // src/utils/open-url.ts
5637
5637
  var nodePrefix = "node:";
@@ -8485,24 +8485,30 @@ function buildSdk(properties, context) {
8485
8485
  context: frozenContext
8486
8486
  });
8487
8487
  const { context: pluginContext, ...pluginProperties } = pluginResult;
8488
+ const { meta: pluginMeta, ...pluginContextRest } = pluginContext ?? {};
8489
+ const existingProperties = properties;
8490
+ const existingContext = context;
8491
+ const existingMeta = context.meta ?? {};
8492
+ const collisions = [];
8493
+ for (const key of Object.keys(pluginProperties)) {
8494
+ if (key in existingProperties) collisions.push(`method "${key}"`);
8495
+ }
8496
+ for (const key of Object.keys(pluginContextRest)) {
8497
+ if (key in existingContext) collisions.push(`context.${key}`);
8498
+ }
8499
+ if (collisions.length > 0) {
8500
+ const name = plugin.name || "anonymous plugin";
8501
+ console.warn(
8502
+ `[zapier-sdk] Skipping "${name}" \u2014 duplicate registration of: ${collisions.join(", ")}. If the duplicate is intentional, wrap with composePlugins(...). Otherwise rename the method or remove the duplicate.`
8503
+ );
8504
+ return buildSdk(properties, context);
8505
+ }
8488
8506
  const mergedProperties = { ...properties, ...pluginProperties };
8489
- let mergedContext = {
8507
+ const mergedContext = {
8490
8508
  ...context,
8491
- meta: context.meta || {}
8509
+ ...pluginContextRest,
8510
+ meta: { ...existingMeta, ...pluginMeta ?? {} }
8492
8511
  };
8493
- if (pluginContext) {
8494
- const { meta: pluginMeta, ...pluginContextRest } = pluginContext;
8495
- mergedContext = {
8496
- ...mergedContext,
8497
- ...pluginContextRest
8498
- };
8499
- if (pluginMeta) {
8500
- mergedContext = {
8501
- ...mergedContext,
8502
- meta: { ...mergedContext.meta, ...pluginMeta }
8503
- };
8504
- }
8505
- }
8506
8512
  return buildSdk(
8507
8513
  mergedProperties,
8508
8514
  mergedContext
package/dist/index.d.mts CHANGED
@@ -1457,6 +1457,9 @@ interface Plugin<TSdk = {}, TProvides extends PluginProvides = PluginProvides> {
1457
1457
  /**
1458
1458
  * Takes an SDK shape and adds addPlugin and getRegistry methods to it.
1459
1459
  * addPlugin merges a plugin's result into the shape, producing a new SDK.
1460
+ * Use composePlugins(...) to bundle multiple plugins into one before
1461
+ * adding — addPlugin itself is single-plugin only, which keeps inference
1462
+ * stable through long chains.
1460
1463
  * getRegistry is a lazy view over context.meta, available on every sdk
1461
1464
  * produced by buildSdk regardless of plugin order.
1462
1465
  */
@@ -8529,11 +8532,13 @@ type ComposeProvides<T extends readonly Plugin<any, any>[]> = IntersectAll<Provi
8529
8532
  * once). Works fine for homogeneous-deps groups; widens slightly for
8530
8533
  * heterogeneous ones, which keeps the variadic types tractable.
8531
8534
  * 3. **Collision detection.** Throws on duplicate root keys, duplicate
8532
- * `context.meta` keys, and duplicate non-meta `context.*` keys. Note
8533
- * this only applies *inside* a single `composePlugins(...)` call
8534
- * cross-`addPlugin` overrides (e.g. a CLI plugin overriding meta from
8535
- * a core SDK plugin) still go through `addPlugin`'s last-write-wins
8536
- * merge unchanged.
8535
+ * `context.meta` keys, and duplicate non-meta `context.*` keys
8536
+ * *inside* a single `composePlugins(...)` call. Cross-`addPlugin`
8537
+ * collisions are handled separately by `addPlugin` itself, which
8538
+ * warns-and-skips the colliding plugin (the first registration
8539
+ * wins). Pure meta-only overrides (e.g. `cliOverridesPlugin`
8540
+ * patching `meta.fetch.deprecated` without re-registering `fetch`)
8541
+ * stay legitimate in both code paths.
8537
8542
  *
8538
8543
  * Why prefer this over an `addPlugin([...])` array overload: TypeScript's
8539
8544
  * overload resolution interacts badly with arrays carrying a mix of
@@ -8554,4 +8559,4 @@ declare const registryPlugin: (sdk: {
8554
8559
  };
8555
8560
  }) => {};
8556
8561
 
8557
- export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionProperty, ActionPropertySchema, type ActionItem as ActionResolverItem, type ActionTimeoutMsProperty, ActionTimeoutMsPropertySchema, type ActionTypeItem, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppFactoryInput, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type AppProperty, AppPropertySchema, type ApplicationLifecycleEventData, type ApprovalStatus, type AppsPluginProvides, type AppsProperty, AppsPropertySchema, 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 ConnectionsProperty, ConnectionsPropertySchema, type ConnectionsResponse, type CreateClientCredentialsPluginProvides, type CreateTableFieldsPluginProvides, type CreateTablePluginProvides, type CreateTableRecordsPluginProvides, type Credentials, type CredentialsFunction, CredentialsFunctionSchema, type CredentialsObject, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, 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 EventEmissionProvides, type FetchPluginProvides, type Field, type FieldsProperty, FieldsPropertySchema, 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 GetProfilePluginProvides, type GetTablePluginProvides, type GetTableRecordPluginProvides, type InfoFieldItem, type InputFieldItem, type InputFieldProperty, InputFieldPropertySchema, 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 PaginatedSdkResult, type ParamsProperty, ParamsPropertySchema, type PkceCredentialsObject, PkceCredentialsObjectSchema, type Plugin, type PluginMeta, type PluginProvides, type PositionalMetadata, type RateLimitInfo, type RecordProperty, RecordPropertySchema, type RecordsProperty, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedAppLocator, type ResolvedCredentials, ResolvedCredentialsSchema, type Resolver, type ResolverMetadata, type RootFieldItem, type RunActionPluginProvides, type SdkEvent, type SdkPage, type StaticResolver, type TableProperty, TablePropertySchema, type TablesProperty, TablesPropertySchema, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UpdateTableRecordsPluginProvides, type UserProfile, type UserProfileItem, type WithAddPlugin, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, type ZapierCache, type ZapierCacheEntry, type ZapierCacheSetOptions, 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, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, definePlugin, 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, getZapierApprovalMode, getZapierIsInteractive, getZapierSdkService, 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 };
8562
+ export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionProperty, ActionPropertySchema, type ActionItem as ActionResolverItem, type ActionTimeoutMsProperty, ActionTimeoutMsPropertySchema, type ActionTypeItem, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiClient, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppFactoryInput, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type AppProperty, AppPropertySchema, type ApplicationLifecycleEventData, type ApprovalStatus, type AppsPluginProvides, type AppsProperty, AppsPropertySchema, 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 ConnectionsProperty, ConnectionsPropertySchema, type ConnectionsResponse, type CreateClientCredentialsPluginProvides, type CreateTableFieldsPluginProvides, type CreateTablePluginProvides, type CreateTableRecordsPluginProvides, type Credentials, type CredentialsFunction, CredentialsFunctionSchema, type CredentialsObject, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, 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 EventEmissionProvides, type FetchPluginProvides, type Field, type FieldsProperty, FieldsPropertySchema, 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 GetProfilePluginProvides, type GetTablePluginProvides, type GetTableRecordPluginProvides, type InfoFieldItem, type InputFieldItem, type InputFieldProperty, InputFieldPropertySchema, 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 PaginatedSdkResult, type ParamsProperty, ParamsPropertySchema, type PkceCredentialsObject, PkceCredentialsObjectSchema, type Plugin, type PluginMeta, type PluginProvides, type PollOptions, type PositionalMetadata, type RateLimitInfo, type RecordProperty, RecordPropertySchema, type RecordsProperty, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, type RequestOptions, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedAppLocator, type ResolvedCredentials, ResolvedCredentialsSchema, type Resolver, type ResolverMetadata, type RootFieldItem, type RunActionPluginProvides, type SdkEvent, type SdkPage, type StaticResolver, type TableProperty, TablePropertySchema, type TablesProperty, TablesPropertySchema, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UpdateTableRecordsPluginProvides, type UserProfile, type UserProfileItem, type WithAddPlugin, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, type ZapierCache, type ZapierCacheEntry, type ZapierCacheSetOptions, 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, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, definePlugin, 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, getZapierApprovalMode, getZapierIsInteractive, getZapierSdkService, 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
@@ -60,6 +60,7 @@ export { definePlugin, createPluginMethod, createPaginatedPluginMethod, composeP
60
60
  export type { ActionItem as ActionResolverItem } from "./resolvers/actionKey";
61
61
  export type { ActionTypeItem } from "./resolvers/actionType";
62
62
  export type { ResolvedAppLocator } from "./utils/domain-utils";
63
+ export type { ApiClient, RequestOptions, PollOptions } from "./api/types";
63
64
  export { registryPlugin } from "./plugins/registry";
64
65
  export type { ZapierSdk } from "./sdk";
65
66
  export type { BaseEvent, MethodCalledEvent } from "./types/telemetry-events";
@@ -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,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kBA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OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,SAAS,EACT,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,OAAO,CAAC;AAGf,YAAY,EACV,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,YAAY,EACV,MAAM,EACN,UAAU,EACV,cAAc,EACd,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,2BAA2B,EAC3B,cAAc,GACf,MAAM,sBAAsB,CAAC;AAK9B,YAAY,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,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.mjs CHANGED
@@ -5629,7 +5629,7 @@ async function invalidateCredentialsToken(options) {
5629
5629
  }
5630
5630
 
5631
5631
  // src/sdk-version.ts
5632
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.47.1" : void 0) || "unknown";
5632
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.48.0" : void 0) || "unknown";
5633
5633
 
5634
5634
  // src/utils/open-url.ts
5635
5635
  var nodePrefix = "node:";
@@ -8483,24 +8483,30 @@ function buildSdk(properties, context) {
8483
8483
  context: frozenContext
8484
8484
  });
8485
8485
  const { context: pluginContext, ...pluginProperties } = pluginResult;
8486
+ const { meta: pluginMeta, ...pluginContextRest } = pluginContext ?? {};
8487
+ const existingProperties = properties;
8488
+ const existingContext = context;
8489
+ const existingMeta = context.meta ?? {};
8490
+ const collisions = [];
8491
+ for (const key of Object.keys(pluginProperties)) {
8492
+ if (key in existingProperties) collisions.push(`method "${key}"`);
8493
+ }
8494
+ for (const key of Object.keys(pluginContextRest)) {
8495
+ if (key in existingContext) collisions.push(`context.${key}`);
8496
+ }
8497
+ if (collisions.length > 0) {
8498
+ const name = plugin.name || "anonymous plugin";
8499
+ console.warn(
8500
+ `[zapier-sdk] Skipping "${name}" \u2014 duplicate registration of: ${collisions.join(", ")}. If the duplicate is intentional, wrap with composePlugins(...). Otherwise rename the method or remove the duplicate.`
8501
+ );
8502
+ return buildSdk(properties, context);
8503
+ }
8486
8504
  const mergedProperties = { ...properties, ...pluginProperties };
8487
- let mergedContext = {
8505
+ const mergedContext = {
8488
8506
  ...context,
8489
- meta: context.meta || {}
8507
+ ...pluginContextRest,
8508
+ meta: { ...existingMeta, ...pluginMeta ?? {} }
8490
8509
  };
8491
- if (pluginContext) {
8492
- const { meta: pluginMeta, ...pluginContextRest } = pluginContext;
8493
- mergedContext = {
8494
- ...mergedContext,
8495
- ...pluginContextRest
8496
- };
8497
- if (pluginMeta) {
8498
- mergedContext = {
8499
- ...mergedContext,
8500
- meta: { ...mergedContext.meta, ...pluginMeta }
8501
- };
8502
- }
8503
- }
8504
8510
  return buildSdk(
8505
8511
  mergedProperties,
8506
8512
  mergedContext
@@ -11,7 +11,7 @@ export declare const apiPlugin: (sdk: {
11
11
  };
12
12
  }) => {
13
13
  context: {
14
- api: import("../../api").ApiClient;
14
+ api: import("../..").ApiClient;
15
15
  resolveCredentials: () => Promise<string | {
16
16
  clientId: string;
17
17
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const listAppsPlugin: (sdk: {
2
2
  context: {
3
- api: import("../../api").ApiClient;
3
+ api: import("../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const createTablePlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const createTableFieldsPlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const createTableRecordsPlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,7 +1,7 @@
1
1
  import type { CapabilitiesContext } from "../../capabilities";
2
2
  export declare const deleteTablePlugin: (sdk: {
3
3
  context: {
4
- api: import("../../../api").ApiClient;
4
+ api: import("../../..").ApiClient;
5
5
  resolveCredentials: () => Promise<string | {
6
6
  clientId: string;
7
7
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const deleteTableFieldsPlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const deleteTableRecordsPlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const getTablePlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const getTableRecordPlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const listTableFieldsPlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const listTableRecordsPlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
@@ -1,7 +1,7 @@
1
1
  import type { CapabilitiesContext } from "../../capabilities";
2
2
  export declare const listTablesPlugin: (sdk: {
3
3
  context: {
4
- api: import("../../../api").ApiClient;
4
+ api: import("../../..").ApiClient;
5
5
  resolveCredentials: () => Promise<string | {
6
6
  clientId: string;
7
7
  clientSecret: string;
@@ -1,6 +1,6 @@
1
1
  export declare const updateTableRecordsPlugin: (sdk: {
2
2
  context: {
3
- api: import("../../../api").ApiClient;
3
+ api: import("../../..").ApiClient;
4
4
  resolveCredentials: () => Promise<string | {
5
5
  clientId: string;
6
6
  clientSecret: string;
package/dist/sdk.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAH/3K;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
package/dist/sdk.js CHANGED
@@ -71,24 +71,45 @@ function buildSdk(properties, context) {
71
71
  context: frozenContext,
72
72
  });
73
73
  const { context: pluginContext, ...pluginProperties } = pluginResult;
74
+ const { meta: pluginMeta, ...pluginContextRest } = pluginContext ?? {};
75
+ const existingProperties = properties;
76
+ const existingContext = context;
77
+ const existingMeta = context.meta ?? {};
78
+ // Detect collisions on the two shapes that matter: root-level
79
+ // methods and non-meta context fields. Meta entries don't need
80
+ // their own check — by convention a method comes with its meta,
81
+ // so a method-bearing meta collision is already caught by the
82
+ // root-key loop above. Pure meta-only overrides (e.g.
83
+ // cliOverridesPlugin tagging `meta.fetch.deprecated`) stay
84
+ // legitimate and last-win because their pluginProperties is
85
+ // empty, so no method collision fires.
86
+ const collisions = [];
87
+ for (const key of Object.keys(pluginProperties)) {
88
+ if (key in existingProperties)
89
+ collisions.push(`method "${key}"`);
90
+ }
91
+ for (const key of Object.keys(pluginContextRest)) {
92
+ if (key in existingContext)
93
+ collisions.push(`context.${key}`);
94
+ }
95
+ if (collisions.length > 0) {
96
+ const name = plugin.name || "anonymous plugin";
97
+ console.warn(`[zapier-sdk] Skipping "${name}" — duplicate registration of: ${collisions.join(", ")}. ` +
98
+ `If the duplicate is intentional, wrap with composePlugins(...). ` +
99
+ `Otherwise rename the method or remove the duplicate.`);
100
+ // Whole-plugin skip: return the chain unchanged. The type
101
+ // assertion lies about the skipped contributions; getRegistry-based
102
+ // consumers (CLI, MCP) see an unchanged surface, and direct
103
+ // typed callers will see TypeError on the missing method (the
104
+ // upstream warn names the cause).
105
+ return buildSdk(properties, context);
106
+ }
74
107
  const mergedProperties = { ...properties, ...pluginProperties };
75
- let mergedContext = {
108
+ const mergedContext = {
76
109
  ...context,
77
- meta: context.meta || {},
110
+ ...pluginContextRest,
111
+ meta: { ...existingMeta, ...(pluginMeta ?? {}) },
78
112
  };
79
- if (pluginContext) {
80
- const { meta: pluginMeta, ...pluginContextRest } = pluginContext;
81
- mergedContext = {
82
- ...mergedContext,
83
- ...pluginContextRest,
84
- };
85
- if (pluginMeta) {
86
- mergedContext = {
87
- ...mergedContext,
88
- meta: { ...mergedContext.meta, ...pluginMeta },
89
- };
90
- }
91
- }
92
113
  return buildSdk(mergedProperties, mergedContext);
93
114
  },
94
115
  };
@@ -54,6 +54,9 @@ export interface Plugin<TSdk = {}, TProvides extends PluginProvides = PluginProv
54
54
  /**
55
55
  * Takes an SDK shape and adds addPlugin and getRegistry methods to it.
56
56
  * addPlugin merges a plugin's result into the shape, producing a new SDK.
57
+ * Use composePlugins(...) to bundle multiple plugins into one before
58
+ * adding — addPlugin itself is single-plugin only, which keeps inference
59
+ * stable through long chains.
57
60
  * getRegistry is a lazy view over context.meta, available on every sdk
58
61
  * produced by buildSdk regardless of plugin order.
59
62
  */
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,MAAM,WAAW,cAAe,SAAQ,M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WAAW,MAAM,CACrB,IAAI,GAAG,EAAE,EACT,SAAS,SAAS,cAAc,GAAG,cAAc;IAEjD,CACE,GAAG,EAAE,IAAI,GAAG;QACV,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;SAClC,CAAC;KACH,GACA,SAAS,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,CACvB,CAAC,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;KAAE,CAAA;CAAE,IACnD,CAAC,GAAG;IACN,SAAS,CAAC,SAAS,SAAS,cAAc,EACxC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,GAC3B,aAAa,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAChC,WAAW,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,cAAc,CAAC;CAC7D,CAAC"}
@@ -226,11 +226,13 @@ type ComposeProvides<T extends readonly Plugin<any, any>[]> = IntersectAll<Provi
226
226
  * once). Works fine for homogeneous-deps groups; widens slightly for
227
227
  * heterogeneous ones, which keeps the variadic types tractable.
228
228
  * 3. **Collision detection.** Throws on duplicate root keys, duplicate
229
- * `context.meta` keys, and duplicate non-meta `context.*` keys. Note
230
- * this only applies *inside* a single `composePlugins(...)` call
231
- * cross-`addPlugin` overrides (e.g. a CLI plugin overriding meta from
232
- * a core SDK plugin) still go through `addPlugin`'s last-write-wins
233
- * merge unchanged.
229
+ * `context.meta` keys, and duplicate non-meta `context.*` keys
230
+ * *inside* a single `composePlugins(...)` call. Cross-`addPlugin`
231
+ * collisions are handled separately by `addPlugin` itself, which
232
+ * warns-and-skips the colliding plugin (the first registration
233
+ * wins). Pure meta-only overrides (e.g. `cliOverridesPlugin`
234
+ * patching `meta.fetch.deprecated` without re-registering `fetch`)
235
+ * stay legitimate in both code paths.
234
236
  *
235
237
  * Why prefer this over an `addPlugin([...])` array overload: TypeScript's
236
238
  * overload resolution interacts badly with arrays carrying a mix of
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-utils.d.ts","sourceRoot":"","sources":["../../src/utils/plugin-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAM1E;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,SAAS,cAAc,EACjE,EAAE,EAAE,CACF,GAAG,EAAE,IAAI,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;KAAE,CAAA;CAAE,KAC1D,SAAS,GACb,CACD,GAAG,EAAE,IAAI,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;KAAE,CAAA;CAAE,KAC1D,SAAS,CAEb;AAkBD;;;;GAIG;AACH,KAAK,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAElD,UAAU,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,SAAS,MAAM,CACtE,SAAQ,UAAU;IAClB,IAAI,EAAE,KAAK,CAAC;IACZ;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC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C,GAAG,EAAE,MAAM,QAAQ,CAAC,GAAG,QAAQ,GAAG,KAAK;CAC5E,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,KAAK,YAAY,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,IAAI,CAAC,SAAS,SAAS;IACnE,MAAM,IAAI;IACV,GAAG,MAAM,IAAI;CACd,GACG,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,GACzB,EAAE,CAAC;AAEP;;;;GAIG;AACH,KAAK,UAAU,CAAC,CAAC,SAAS,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,YAAY,CACnE,iBAAiB,CAAC,CAAC,CAAC,CACrB,CAAC;AAEF;;;;GAIG;AACH,KAAK,eAAe,CAAC,CAAC,SAAS,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,YAAY,CACxE,UAAU,CAAC,CAAC,CAAC,CACd,CAAC;AA4EF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,SAAS,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EACzE,GAAG,OAAO,EAAE,EAAE,GACb,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC,CA4B7C"}
@@ -198,11 +198,13 @@ function mergeContextKeysWithCollisionCheck(target, source, seen) {
198
198
  * once). Works fine for homogeneous-deps groups; widens slightly for
199
199
  * heterogeneous ones, which keeps the variadic types tractable.
200
200
  * 3. **Collision detection.** Throws on duplicate root keys, duplicate
201
- * `context.meta` keys, and duplicate non-meta `context.*` keys. Note
202
- * this only applies *inside* a single `composePlugins(...)` call
203
- * cross-`addPlugin` overrides (e.g. a CLI plugin overriding meta from
204
- * a core SDK plugin) still go through `addPlugin`'s last-write-wins
205
- * merge unchanged.
201
+ * `context.meta` keys, and duplicate non-meta `context.*` keys
202
+ * *inside* a single `composePlugins(...)` call. Cross-`addPlugin`
203
+ * collisions are handled separately by `addPlugin` itself, which
204
+ * warns-and-skips the colliding plugin (the first registration
205
+ * wins). Pure meta-only overrides (e.g. `cliOverridesPlugin`
206
+ * patching `meta.fetch.deprecated` without re-registering `fetch`)
207
+ * stay legitimate in both code paths.
206
208
  *
207
209
  * Why prefer this over an `addPlugin([...])` array overload: TypeScript's
208
210
  * overload resolution interacts badly with arrays carrying a mix of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.47.1",
3
+ "version": "0.48.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",