@zapier/zapier-sdk 0.47.1 → 0.48.1
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 +14 -0
- package/README.md +740 -283
- package/dist/index.cjs +26 -17
- package/dist/index.d.mts +11 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +26 -17
- package/dist/plugins/api/index.d.ts +1 -1
- package/dist/plugins/listApps/index.d.ts +1 -1
- package/dist/plugins/listInputFields/index.js +1 -1
- package/dist/plugins/tables/createTable/index.d.ts +1 -1
- package/dist/plugins/tables/createTableFields/index.d.ts +1 -1
- package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableFields/index.js +1 -0
- package/dist/plugins/tables/createTableRecords/index.d.ts +1 -1
- package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableRecords/index.js +1 -0
- package/dist/plugins/tables/deleteTable/index.d.ts +1 -1
- package/dist/plugins/tables/deleteTableFields/index.d.ts +1 -1
- package/dist/plugins/tables/deleteTableRecords/index.d.ts +1 -1
- package/dist/plugins/tables/getTable/index.d.ts +1 -1
- package/dist/plugins/tables/getTableRecord/index.d.ts +1 -1
- package/dist/plugins/tables/listTableFields/index.d.ts +1 -1
- package/dist/plugins/tables/listTableRecords/index.d.ts +1 -1
- package/dist/plugins/tables/listTables/index.d.ts +1 -1
- package/dist/plugins/tables/updateTableRecords/index.d.ts +1 -1
- package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/updateTableRecords/index.js +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +36 -15
- package/dist/types/plugin.d.ts +3 -0
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/utils/plugin-utils.d.ts +7 -5
- package/dist/utils/plugin-utils.d.ts.map +1 -1
- package/dist/utils/plugin-utils.js +7 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3411,7 +3411,7 @@ var listInputFieldsPlugin = definePlugin(
|
|
|
3411
3411
|
name: "listInputFields",
|
|
3412
3412
|
categories: ["action"],
|
|
3413
3413
|
type: "list",
|
|
3414
|
-
itemType: "
|
|
3414
|
+
itemType: "RootField",
|
|
3415
3415
|
inputSchema: ListInputFieldsInputSchema,
|
|
3416
3416
|
outputSchema: RootFieldItemSchema,
|
|
3417
3417
|
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
@@ -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.
|
|
5634
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.48.1" : void 0) || "unknown";
|
|
5635
5635
|
|
|
5636
5636
|
// src/utils/open-url.ts
|
|
5637
5637
|
var nodePrefix = "node:";
|
|
@@ -6910,6 +6910,7 @@ var createTableFieldsPlugin = definePlugin(
|
|
|
6910
6910
|
name: "createTableFields",
|
|
6911
6911
|
type: "create",
|
|
6912
6912
|
itemType: "Field",
|
|
6913
|
+
returnType: "FieldItem[]",
|
|
6913
6914
|
inputSchema: CreateTableFieldsOptionsInputSchema,
|
|
6914
6915
|
outputSchema: FieldItemSchema,
|
|
6915
6916
|
resolvers: { table: tableIdResolver, fields: tableFieldsResolver },
|
|
@@ -7247,6 +7248,7 @@ var createTableRecordsPlugin = definePlugin(
|
|
|
7247
7248
|
name: "createTableRecords",
|
|
7248
7249
|
type: "create",
|
|
7249
7250
|
itemType: "Record",
|
|
7251
|
+
returnType: "RecordItem[]",
|
|
7250
7252
|
inputSchema: CreateTableRecordsOptionsInputSchema,
|
|
7251
7253
|
outputSchema: RecordItemSchema,
|
|
7252
7254
|
resolvers: { table: tableIdResolver, records: tableRecordsResolver },
|
|
@@ -7358,6 +7360,7 @@ var updateTableRecordsPlugin = definePlugin(
|
|
|
7358
7360
|
name: "updateTableRecords",
|
|
7359
7361
|
type: "update",
|
|
7360
7362
|
itemType: "Record",
|
|
7363
|
+
returnType: "RecordItem[]",
|
|
7361
7364
|
inputSchema: UpdateTableRecordsOptionsInputSchema,
|
|
7362
7365
|
outputSchema: RecordItemSchema,
|
|
7363
7366
|
resolvers: {
|
|
@@ -8485,24 +8488,30 @@ function buildSdk(properties, context) {
|
|
|
8485
8488
|
context: frozenContext
|
|
8486
8489
|
});
|
|
8487
8490
|
const { context: pluginContext, ...pluginProperties } = pluginResult;
|
|
8491
|
+
const { meta: pluginMeta, ...pluginContextRest } = pluginContext ?? {};
|
|
8492
|
+
const existingProperties = properties;
|
|
8493
|
+
const existingContext = context;
|
|
8494
|
+
const existingMeta = context.meta ?? {};
|
|
8495
|
+
const collisions = [];
|
|
8496
|
+
for (const key of Object.keys(pluginProperties)) {
|
|
8497
|
+
if (key in existingProperties) collisions.push(`method "${key}"`);
|
|
8498
|
+
}
|
|
8499
|
+
for (const key of Object.keys(pluginContextRest)) {
|
|
8500
|
+
if (key in existingContext) collisions.push(`context.${key}`);
|
|
8501
|
+
}
|
|
8502
|
+
if (collisions.length > 0) {
|
|
8503
|
+
const name = plugin.name || "anonymous plugin";
|
|
8504
|
+
console.warn(
|
|
8505
|
+
`[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.`
|
|
8506
|
+
);
|
|
8507
|
+
return buildSdk(properties, context);
|
|
8508
|
+
}
|
|
8488
8509
|
const mergedProperties = { ...properties, ...pluginProperties };
|
|
8489
|
-
|
|
8510
|
+
const mergedContext = {
|
|
8490
8511
|
...context,
|
|
8491
|
-
|
|
8512
|
+
...pluginContextRest,
|
|
8513
|
+
meta: { ...existingMeta, ...pluginMeta ?? {} }
|
|
8492
8514
|
};
|
|
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
8515
|
return buildSdk(
|
|
8507
8516
|
mergedProperties,
|
|
8508
8517
|
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
|
|
8533
|
-
*
|
|
8534
|
-
*
|
|
8535
|
-
*
|
|
8536
|
-
*
|
|
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";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAG/C,YAAY,EACV,iCAAiC,EACjC,+BAA+B,EA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AE,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
|
@@ -3409,7 +3409,7 @@ var listInputFieldsPlugin = definePlugin(
|
|
|
3409
3409
|
name: "listInputFields",
|
|
3410
3410
|
categories: ["action"],
|
|
3411
3411
|
type: "list",
|
|
3412
|
-
itemType: "
|
|
3412
|
+
itemType: "RootField",
|
|
3413
3413
|
inputSchema: ListInputFieldsInputSchema,
|
|
3414
3414
|
outputSchema: RootFieldItemSchema,
|
|
3415
3415
|
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
@@ -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.
|
|
5632
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.48.1" : void 0) || "unknown";
|
|
5633
5633
|
|
|
5634
5634
|
// src/utils/open-url.ts
|
|
5635
5635
|
var nodePrefix = "node:";
|
|
@@ -6908,6 +6908,7 @@ var createTableFieldsPlugin = definePlugin(
|
|
|
6908
6908
|
name: "createTableFields",
|
|
6909
6909
|
type: "create",
|
|
6910
6910
|
itemType: "Field",
|
|
6911
|
+
returnType: "FieldItem[]",
|
|
6911
6912
|
inputSchema: CreateTableFieldsOptionsInputSchema,
|
|
6912
6913
|
outputSchema: FieldItemSchema,
|
|
6913
6914
|
resolvers: { table: tableIdResolver, fields: tableFieldsResolver },
|
|
@@ -7245,6 +7246,7 @@ var createTableRecordsPlugin = definePlugin(
|
|
|
7245
7246
|
name: "createTableRecords",
|
|
7246
7247
|
type: "create",
|
|
7247
7248
|
itemType: "Record",
|
|
7249
|
+
returnType: "RecordItem[]",
|
|
7248
7250
|
inputSchema: CreateTableRecordsOptionsInputSchema,
|
|
7249
7251
|
outputSchema: RecordItemSchema,
|
|
7250
7252
|
resolvers: { table: tableIdResolver, records: tableRecordsResolver },
|
|
@@ -7356,6 +7358,7 @@ var updateTableRecordsPlugin = definePlugin(
|
|
|
7356
7358
|
name: "updateTableRecords",
|
|
7357
7359
|
type: "update",
|
|
7358
7360
|
itemType: "Record",
|
|
7361
|
+
returnType: "RecordItem[]",
|
|
7359
7362
|
inputSchema: UpdateTableRecordsOptionsInputSchema,
|
|
7360
7363
|
outputSchema: RecordItemSchema,
|
|
7361
7364
|
resolvers: {
|
|
@@ -8483,24 +8486,30 @@ function buildSdk(properties, context) {
|
|
|
8483
8486
|
context: frozenContext
|
|
8484
8487
|
});
|
|
8485
8488
|
const { context: pluginContext, ...pluginProperties } = pluginResult;
|
|
8489
|
+
const { meta: pluginMeta, ...pluginContextRest } = pluginContext ?? {};
|
|
8490
|
+
const existingProperties = properties;
|
|
8491
|
+
const existingContext = context;
|
|
8492
|
+
const existingMeta = context.meta ?? {};
|
|
8493
|
+
const collisions = [];
|
|
8494
|
+
for (const key of Object.keys(pluginProperties)) {
|
|
8495
|
+
if (key in existingProperties) collisions.push(`method "${key}"`);
|
|
8496
|
+
}
|
|
8497
|
+
for (const key of Object.keys(pluginContextRest)) {
|
|
8498
|
+
if (key in existingContext) collisions.push(`context.${key}`);
|
|
8499
|
+
}
|
|
8500
|
+
if (collisions.length > 0) {
|
|
8501
|
+
const name = plugin.name || "anonymous plugin";
|
|
8502
|
+
console.warn(
|
|
8503
|
+
`[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.`
|
|
8504
|
+
);
|
|
8505
|
+
return buildSdk(properties, context);
|
|
8506
|
+
}
|
|
8486
8507
|
const mergedProperties = { ...properties, ...pluginProperties };
|
|
8487
|
-
|
|
8508
|
+
const mergedContext = {
|
|
8488
8509
|
...context,
|
|
8489
|
-
|
|
8510
|
+
...pluginContextRest,
|
|
8511
|
+
meta: { ...existingMeta, ...pluginMeta ?? {} }
|
|
8490
8512
|
};
|
|
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
8513
|
return buildSdk(
|
|
8505
8514
|
mergedProperties,
|
|
8506
8515
|
mergedContext
|
|
@@ -151,7 +151,7 @@ export const listInputFieldsPlugin = definePlugin((sdk) => createPaginatedPlugin
|
|
|
151
151
|
name: "listInputFields",
|
|
152
152
|
categories: ["action"],
|
|
153
153
|
type: "list",
|
|
154
|
-
itemType: "
|
|
154
|
+
itemType: "RootField",
|
|
155
155
|
inputSchema: ListInputFieldsInputSchema,
|
|
156
156
|
outputSchema: RootFieldItemSchema,
|
|
157
157
|
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableFields/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableFields/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BnC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,UAAU,CACtD,OAAO,uBAAuB,CAC/B,CAAC"}
|
|
@@ -9,6 +9,7 @@ export const createTableFieldsPlugin = definePlugin((sdk) => createPluginMethod(
|
|
|
9
9
|
name: "createTableFields",
|
|
10
10
|
type: "create",
|
|
11
11
|
itemType: "Field",
|
|
12
|
+
returnType: "FieldItem[]",
|
|
12
13
|
inputSchema: CreateTableFieldsOptionsInputSchema,
|
|
13
14
|
outputSchema: FieldItemSchema,
|
|
14
15
|
resolvers: { table: tableIdResolver, fields: tableFieldsResolver },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableRecords/index.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableRecords/index.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CpC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC"}
|
|
@@ -10,6 +10,7 @@ export const createTableRecordsPlugin = definePlugin((sdk) => createPluginMethod
|
|
|
10
10
|
name: "createTableRecords",
|
|
11
11
|
type: "create",
|
|
12
12
|
itemType: "Record",
|
|
13
|
+
returnType: "RecordItem[]",
|
|
13
14
|
inputSchema: CreateTableRecordsOptionsInputSchema,
|
|
14
15
|
outputSchema: RecordItemSchema,
|
|
15
16
|
resolvers: { table: tableIdResolver, records: tableRecordsResolver },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CapabilitiesContext } from "../../capabilities";
|
|
2
2
|
export declare const deleteTablePlugin: (sdk: {
|
|
3
3
|
context: {
|
|
4
|
-
api: import("
|
|
4
|
+
api: import("../../..").ApiClient;
|
|
5
5
|
resolveCredentials: () => Promise<string | {
|
|
6
6
|
clientId: string;
|
|
7
7
|
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("
|
|
4
|
+
api: import("../../..").ApiClient;
|
|
5
5
|
resolveCredentials: () => Promise<string | {
|
|
6
6
|
clientId: string;
|
|
7
7
|
clientSecret: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/updateTableRecords/index.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/updateTableRecords/index.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDpC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC"}
|
|
@@ -10,6 +10,7 @@ export const updateTableRecordsPlugin = definePlugin((sdk) => createPluginMethod
|
|
|
10
10
|
name: "updateTableRecords",
|
|
11
11
|
type: "update",
|
|
12
12
|
itemType: "Record",
|
|
13
|
+
returnType: "RecordItem[]",
|
|
13
14
|
inputSchema: UpdateTableRecordsOptionsInputSchema,
|
|
14
15
|
outputSchema: RecordItemSchema,
|
|
15
16
|
resolvers: {
|
package/dist/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,MAAM,EACN,cAAc,EACd,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AA8ChE,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CAAG;AAE3D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB;;;;EAE5D;AAED,wBAAgB,SAAS;;cACW,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;;;cAA1B,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;;;kBAqBxB,MAAM;oBAAK,cAAc;cAcjD,SAAS,SAAS,cAAc;;kBAnCV,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;;;;kBAA1B,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;;;EAC7D;
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,MAAM,EACN,cAAc,EACd,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AA8ChE,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CAAG;AAE3D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB;;;;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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
|
-
|
|
108
|
+
const mergedContext = {
|
|
76
109
|
...context,
|
|
77
|
-
|
|
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
|
};
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -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,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACzD,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,eAAe,GAAG,QAA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AAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CAAC;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,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
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
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,CAA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;;;;;;;;;;;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
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
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
|