@zapier/zapier-sdk 0.53.0 → 0.54.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 +10 -0
- package/dist/experimental.cjs +51 -27
- package/dist/experimental.d.mts +3 -2
- package/dist/experimental.mjs +51 -27
- package/dist/{index-D2HKNk0N.d.mts → index-SDDmBk2j.d.mts} +85 -10
- package/dist/{index-D2HKNk0N.d.ts → index-SDDmBk2j.d.ts} +85 -10
- package/dist/index.cjs +51 -27
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +51 -27
- package/dist/resolvers/appKey.d.ts +7 -2
- package/dist/resolvers/appKey.d.ts.map +1 -1
- package/dist/resolvers/appKey.js +46 -3
- package/dist/schemas/App.d.ts.map +1 -1
- package/dist/schemas/App.js +2 -11
- package/dist/utils/domain-utils.d.ts +4 -0
- package/dist/utils/domain-utils.d.ts.map +1 -1
- package/dist/utils/domain-utils.js +5 -0
- package/dist/utils/schema-utils.d.ts +80 -8
- package/dist/utils/schema-utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { ConnectionSchema, ConnectionsResponseSchema } from '@zapier/zapier-sdk-core/v0/schemas/connections';
|
|
4
4
|
import { RequestContext } from '@zapier/policy-context';
|
|
5
5
|
import * as zod_v4_core from 'zod/v4/core';
|
|
6
|
+
import { AppItem as AppItem$1 } from '@zapier/zapier-sdk-core/v0/schemas/apps';
|
|
6
7
|
import * as _zapier_zapier_sdk_cli_login from '@zapier/zapier-sdk-cli/login';
|
|
7
8
|
|
|
8
9
|
declare const AppKeyPropertySchema: z.ZodString & {
|
|
@@ -5238,8 +5239,17 @@ interface PromptConfig {
|
|
|
5238
5239
|
}>;
|
|
5239
5240
|
default?: unknown;
|
|
5240
5241
|
filter?: (value: unknown) => unknown;
|
|
5242
|
+
/**
|
|
5243
|
+
* Return `true` for valid; a string for a custom invalid message; or
|
|
5244
|
+
* `false` for invalid with a generic fallback message ("X: invalid
|
|
5245
|
+
* value."). Prefer returning a string so users see something specific.
|
|
5246
|
+
*/
|
|
5241
5247
|
validate?: (value: unknown) => boolean | string;
|
|
5242
5248
|
}
|
|
5249
|
+
/** A PromptConfig narrowed to single-select list mode. */
|
|
5250
|
+
type ListPromptConfig = PromptConfig & {
|
|
5251
|
+
type: "list";
|
|
5252
|
+
};
|
|
5243
5253
|
interface Resolver {
|
|
5244
5254
|
type: string;
|
|
5245
5255
|
depends?: readonly string[] | string[];
|
|
@@ -5267,15 +5277,11 @@ interface ConstantResolver extends Resolver {
|
|
|
5267
5277
|
type: "constant";
|
|
5268
5278
|
value: unknown;
|
|
5269
5279
|
}
|
|
5270
|
-
|
|
5280
|
+
/**
|
|
5281
|
+
* Fields shared by both variants of {@link DynamicResolver}.
|
|
5282
|
+
*/
|
|
5283
|
+
interface DynamicResolverBase<TItem, TParams> extends Resolver {
|
|
5271
5284
|
type: "dynamic";
|
|
5272
|
-
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => PromiseLike<TItem[] | {
|
|
5273
|
-
data: TItem[];
|
|
5274
|
-
nextCursor?: string;
|
|
5275
|
-
} | AsyncIterable<{
|
|
5276
|
-
data: TItem[];
|
|
5277
|
-
nextCursor?: string;
|
|
5278
|
-
}>>;
|
|
5279
5285
|
prompt: (items: TItem[], params: TParams) => PromptConfig;
|
|
5280
5286
|
/** Capabilities that expand results. The parameter resolver shows a hint for any that aren't enabled. */
|
|
5281
5287
|
requireCapabilities?: string[];
|
|
@@ -5290,6 +5296,72 @@ interface DynamicResolver<TItem = unknown, TParams = Record<string, unknown>> ex
|
|
|
5290
5296
|
resolvedValue: unknown;
|
|
5291
5297
|
} | null>;
|
|
5292
5298
|
}
|
|
5299
|
+
/**
|
|
5300
|
+
* The classic dynamic-resolver variant: `fetch` returns a list of items
|
|
5301
|
+
* that the CLI renders as a search-filterable dropdown. The user picks one.
|
|
5302
|
+
*/
|
|
5303
|
+
interface DynamicListResolver<TItem, TParams> extends DynamicResolverBase<TItem, TParams> {
|
|
5304
|
+
/** Explicitly absent on the list variant — set `inputType: "search"` to opt into the search variant. */
|
|
5305
|
+
inputType?: never;
|
|
5306
|
+
/** Only meaningful for the search variant; set to `never` here so TS catches misuse. */
|
|
5307
|
+
placeholder?: never;
|
|
5308
|
+
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => PromiseLike<TItem[] | {
|
|
5309
|
+
data: TItem[];
|
|
5310
|
+
nextCursor?: string;
|
|
5311
|
+
} | AsyncIterable<{
|
|
5312
|
+
data: TItem[];
|
|
5313
|
+
nextCursor?: string;
|
|
5314
|
+
}>>;
|
|
5315
|
+
}
|
|
5316
|
+
/**
|
|
5317
|
+
* The search-input variant: the CLI prompts the user for free-form text
|
|
5318
|
+
* first, then calls `fetch` with `{ ...resolvedParams, search }`.
|
|
5319
|
+
*
|
|
5320
|
+
* `fetch` can short-circuit by returning a primitive (`string | number`),
|
|
5321
|
+
* which the CLI treats as an exact match — no dropdown is rendered. Any
|
|
5322
|
+
* other return (array, page, async iterable) is rendered as the normal
|
|
5323
|
+
* search-filterable dropdown.
|
|
5324
|
+
*
|
|
5325
|
+
* The `search` key is injected by the CLI at call time; it isn't part of
|
|
5326
|
+
* `TParams` because callers that invoke `fetch` directly (outside the CLI)
|
|
5327
|
+
* are responsible for passing it themselves. Search-mode resolvers should
|
|
5328
|
+
* type `TParams` as `{ search?: string; ...otherDeps }` to make this
|
|
5329
|
+
* explicit.
|
|
5330
|
+
*/
|
|
5331
|
+
interface DynamicSearchResolver<TItem, TParams> extends Omit<DynamicResolverBase<TItem, TParams>, "prompt"> {
|
|
5332
|
+
inputType: "search";
|
|
5333
|
+
/**
|
|
5334
|
+
* Hint text appended to the search prompt's message. NOT used as
|
|
5335
|
+
* inquirer's `default` value, because inquirer prefills `default` as
|
|
5336
|
+
* editable text that the user has to delete before typing.
|
|
5337
|
+
*/
|
|
5338
|
+
placeholder?: string;
|
|
5339
|
+
/**
|
|
5340
|
+
* Search-mode always renders a single-select @inquirer/search dropdown,
|
|
5341
|
+
* so `prompt` must return a list-typed PromptConfig. Checkbox/confirm
|
|
5342
|
+
* configs would be silently ignored at runtime; the type narrows so
|
|
5343
|
+
* misuse fails at compile time.
|
|
5344
|
+
*
|
|
5345
|
+
* Note: a primitive return from `fetch` (string | number) is treated
|
|
5346
|
+
* as an exact match and short-circuits without running this prompt or
|
|
5347
|
+
* the resolver's validate/filter. Canonicalize inside `fetch` if the
|
|
5348
|
+
* exact-match path needs normalization.
|
|
5349
|
+
*/
|
|
5350
|
+
prompt: (items: TItem[], params: TParams) => ListPromptConfig;
|
|
5351
|
+
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => PromiseLike<string | number | TItem[] | {
|
|
5352
|
+
data: TItem[];
|
|
5353
|
+
nextCursor?: string;
|
|
5354
|
+
} | AsyncIterable<{
|
|
5355
|
+
data: TItem[];
|
|
5356
|
+
nextCursor?: string;
|
|
5357
|
+
}>>;
|
|
5358
|
+
}
|
|
5359
|
+
/**
|
|
5360
|
+
* A dynamic resolver — either a classic list (`inputType` absent) or a
|
|
5361
|
+
* search-input variant (`inputType: "search"`). The discriminator is the
|
|
5362
|
+
* `inputType` field; TS narrows to the right variant when you check it.
|
|
5363
|
+
*/
|
|
5364
|
+
type DynamicResolver<TItem = unknown, TParams = Record<string, unknown>> = DynamicListResolver<TItem, TParams> | DynamicSearchResolver<TItem, TParams>;
|
|
5293
5365
|
interface ResolverFieldItem {
|
|
5294
5366
|
type: string;
|
|
5295
5367
|
key: string;
|
|
@@ -8355,7 +8427,10 @@ interface BatchOptions {
|
|
|
8355
8427
|
*/
|
|
8356
8428
|
declare function batch<T>(tasks: (() => Promise<T>)[], options?: BatchOptions): Promise<PromiseSettledResult<T>[]>;
|
|
8357
8429
|
|
|
8358
|
-
|
|
8430
|
+
type AppKeyResolver = DynamicResolver<AppItem$1, {
|
|
8431
|
+
search?: string;
|
|
8432
|
+
}>;
|
|
8433
|
+
declare const appKeyResolver: AppKeyResolver;
|
|
8359
8434
|
|
|
8360
8435
|
interface ActionTypeItem {
|
|
8361
8436
|
key: string;
|
|
@@ -9685,4 +9760,4 @@ declare const registryPlugin: (sdk: {
|
|
|
9685
9760
|
};
|
|
9686
9761
|
}) => {};
|
|
9687
9762
|
|
|
9688
|
-
export { type Resolver as $, type ApiClient as A, type BaseSdkOptions as B, type CapabilitiesContext as C, type DrainTriggerInboxOptions as D, type EventEmissionContext as E, type FieldsetItem as F, type GetAuthenticationPluginProvides as G, type ActionFieldChoice as H, type NeedsRequest as I, type NeedsResponse as J, type Connection as K, type LeasedTriggerMessageItem as L, type Manifest as M, type Need as N, type ConnectionsResponse as O, type PluginMeta as P, type UserProfile as Q, type ResolvedAppLocator as R, isPositional as S, type TriggerMessageStatus as T, type UpdateManifestEntryOptions as U, createFunction as V, type WithAddPlugin as W, type FormattedItem as X, type FormatMetadata as Y, type ZapierSdkOptions as Z, type OutputFormatter as _, type UpdateManifestEntryResult as a, type PaginatedSdkFunction as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type FieldsResolver as a3, runWithTelemetryContext as a4, toSnakeCase as a5, toTitleCase as a6, batch as a7, type BatchOptions as a8, buildCapabilityMessage as a9, type EventContext as aA, type ApplicationLifecycleEventData as aB, type EnhancedErrorEventData as aC, type MethodCalledEventData as aD, generateEventId as aE, getCurrentTimestamp as aF, getReleaseId as aG, getOsInfo as aH, getPlatformVersions as aI, isCi as aJ, getCiPlatform as aK, getMemoryUsage as aL, getCpuTime as aM, buildApplicationLifecycleEvent as aN, buildErrorEventWithContext as aO, buildErrorEvent as aP, createBaseEvent as aQ, buildMethodCalledEvent as aR, type AppItem as aS, type ConnectionItem as aT, type ActionItem$1 as aU, type InputFieldItem as aV, type InfoFieldItem as aW, type RootFieldItem as aX, type UserProfileItem as aY, type FunctionOptions as aZ, type SdkPage as a_, logDeprecation as aa, resetDeprecationWarnings as ab, RelayRequestSchema as ac, RelayFetchSchema as ad, createZapierSdkWithoutRegistry as ae, createSdk as af, createOptionsPlugin as ag, type FunctionRegistryEntry as ah, type FunctionDeprecation as ai, BaseSdkOptionsSchema as aj, type Plugin as ak, type PluginProvides as al, definePlugin as am, createPluginMethod as an, createPaginatedPluginMethod as ao, composePlugins as ap, type ActionItem as aq, type ActionTypeItem as ar, registryPlugin as as, type RequestOptions as at, type PollOptions as au, createZapierApi as av, getOrCreateApiClient as aw, type BaseEvent as ax, type MethodCalledEvent as ay, type EventEmissionProvides as az, type AddActionEntryOptions as b, ZapierAuthenticationError as b$, AppKeyPropertySchema as b0, AppPropertySchema as b1, ActionTypePropertySchema as b2, ActionKeyPropertySchema as b3, ActionPropertySchema as b4, InputFieldPropertySchema as b5, ConnectionIdPropertySchema as b6, AuthenticationIdPropertySchema as b7, ConnectionPropertySchema as b8, InputsPropertySchema as b9, type AuthenticationIdProperty as bA, type InputsProperty as bB, type LimitProperty as bC, type OffsetProperty as bD, type OutputProperty as bE, type DebugProperty as bF, type ParamsProperty as bG, type ActionTimeoutMsProperty as bH, type TableProperty as bI, type RecordProperty as bJ, type RecordsProperty as bK, type FieldsProperty as bL, type AppsProperty as bM, type TablesProperty as bN, type ConnectionsProperty as bO, type TriggerInboxProperty as bP, type TriggerInboxNameProperty as bQ, type LeaseProperty as bR, type LeaseSecondsProperty as bS, type LeaseLimitProperty as bT, type ApiError as bU, type ErrorOptions as bV, ZapierError as bW, ZapierApiError as bX, ZapierAppNotFoundError as bY, ZapierValidationError as bZ, ZapierUnknownError as b_, LimitPropertySchema as ba, OffsetPropertySchema as bb, OutputPropertySchema as bc, DebugPropertySchema as bd, ParamsPropertySchema as be, ActionTimeoutMsPropertySchema as bf, TablePropertySchema as bg, RecordPropertySchema as bh, RecordsPropertySchema as bi, FieldsPropertySchema as bj, AppsPropertySchema as bk, TablesPropertySchema as bl, ConnectionsPropertySchema as bm, TriggerInboxPropertySchema as bn, TriggerInboxNamePropertySchema as bo, LeasePropertySchema as bp, LeaseSecondsPropertySchema as bq, LeaseLimitPropertySchema as br, type AppKeyProperty as bs, type AppProperty as bt, type ActionTypeProperty as bu, type ActionKeyProperty as bv, type ActionProperty as bw, type InputFieldProperty as bx, type ConnectionIdProperty as by, type ConnectionProperty as bz, type AddActionEntryResult as c, apiPlugin as c$, ZapierNotFoundError as c0, ZapierResourceNotFoundError as c1, ZapierConfigurationError as c2, ZapierBundleError as c3, ZapierTimeoutError as c4, ZapierActionError as c5, ZapierConflictError as c6, type RateLimitInfo as c7, ZapierRateLimitError as c8, type ApprovalStatus as c9, deleteClientCredentialsPlugin as cA, type DeleteClientCredentialsPluginProvides as cB, getAppPlugin as cC, type GetAppPluginProvides as cD, getActionPlugin as cE, type GetActionPluginProvides as cF, getConnectionPlugin as cG, type GetConnectionPluginProvides as cH, findFirstConnectionPlugin as cI, type FindFirstConnectionPluginProvides as cJ, findUniqueConnectionPlugin as cK, type FindUniqueConnectionPluginProvides as cL, CONTEXT_CACHE_TTL_MS as cM, CONTEXT_CACHE_MAX_SIZE as cN, runActionPlugin as cO, type RunActionPluginProvides as cP, requestPlugin as cQ, type RequestPluginProvides as cR, type ManifestPluginOptions as cS, getPreferredManifestEntryKey as cT, manifestPlugin as cU, type ManifestPluginProvides as cV, DEFAULT_CONFIG_PATH as cW, type ManifestEntry as cX, getProfilePlugin as cY, type GetProfilePluginProvides as cZ, type ApiPluginOptions as c_, ZapierApprovalError as ca, ZapierRelayError as cb, formatErrorMessage as cc, ZapierSignal as cd, appsPlugin as ce, type AppsPluginProvides as cf, type ActionExecutionOptions as cg, type AppFactoryInput as ch, fetchPlugin as ci, type FetchPluginProvides as cj, listAppsPlugin as ck, type ListAppsPluginProvides as cl, listActionsPlugin as cm, type ListActionsPluginProvides as cn, listActionInputFieldsPlugin as co, type ListActionInputFieldsPluginProvides as cp, listActionInputFieldChoicesPlugin as cq, type ListActionInputFieldChoicesPluginProvides as cr, getActionInputFieldsSchemaPlugin as cs, type GetActionInputFieldsSchemaPluginProvides as ct, listConnectionsPlugin as cu, type ListConnectionsPluginProvides as cv, listClientCredentialsPlugin as cw, type ListClientCredentialsPluginProvides as cx, createClientCredentialsPlugin as cy, type CreateClientCredentialsPluginProvides as cz, type ActionEntry as d, type ConnectionEntry as d$, type ApiPluginProvides as d0, appKeyResolver as d1, actionTypeResolver as d2, actionKeyResolver as d3, connectionIdResolver as d4, connectionIdGenericResolver as d5, inputsResolver as d6, inputsAllOptionalResolver as d7, inputFieldKeyResolver as d8, clientCredentialsNameResolver as d9, type SdkEvent as dA, type AuthEvent as dB, type ApiEvent as dC, type LoadingEvent as dD, type EventCallback as dE, type Credentials as dF, type ResolvedCredentials as dG, type CredentialsObject as dH, type ClientCredentialsObject as dI, type PkceCredentialsObject as dJ, isClientCredentials as dK, isPkceCredentials as dL, isCredentialsObject as dM, isCredentialsFunction as dN, type ResolveCredentialsOptions as dO, resolveCredentialsFromEnv as dP, resolveCredentials as dQ, getBaseUrlFromCredentials as dR, getClientIdFromCredentials as dS, ClientCredentialsObjectSchema as dT, PkceCredentialsObjectSchema as dU, CredentialsObjectSchema as dV, ResolvedCredentialsSchema as dW, CredentialsFunctionSchema as dX, type CredentialsFunction as dY, CredentialsSchema as dZ, ConnectionEntrySchema as d_, clientIdResolver as da, tableIdResolver as db, triggerInboxResolver as dc, triggerMessagesResolver as dd, tableRecordIdResolver as de, tableRecordIdsResolver as df, tableFieldIdsResolver as dg, tableNameResolver as dh, tableFieldsResolver as di, tableRecordsResolver as dj, tableUpdateRecordsResolver as dk, tableFiltersResolver as dl, tableSortResolver as dm, type ResolveAuthTokenOptions as dn, clearTokenCache as dp, invalidateCachedToken as dq, injectCliLogin as dr, isCliLoginAvailable as ds, getTokenFromCliLogin as dt, resolveAuthToken as du, invalidateCredentialsToken as dv, type ZapierCache as dw, type ZapierCacheEntry as dx, type ZapierCacheSetOptions as dy, createMemoryCache as dz, type PaginatedSdkResult as e, ConnectionsMapSchema as e0, type ConnectionsMap as e1, connectionsPlugin as e2, type ConnectionsPluginProvides as e3, ZAPIER_BASE_URL as e4, getZapierSdkService as e5, MAX_PAGE_LIMIT as e6, DEFAULT_PAGE_SIZE as e7, DEFAULT_ACTION_TIMEOUT_MS as e8, ZAPIER_MAX_NETWORK_RETRIES as e9, type CreateTableRecordsPluginProvides as eA, deleteTableRecordsPlugin as eB, type DeleteTableRecordsPluginProvides as eC, updateTableRecordsPlugin as eD, type UpdateTableRecordsPluginProvides as eE, createZapierSdk as eF, type ZapierSdk as eG, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as ea, MAX_CONCURRENCY_LIMIT as eb, parseConcurrencyEnvVar as ec, ZAPIER_MAX_CONCURRENT_REQUESTS as ed, getZapierApprovalMode as ee, DEFAULT_APPROVAL_TIMEOUT_MS as ef, DEFAULT_MAX_APPROVAL_RETRIES as eg, listTablesPlugin as eh, type ListTablesPluginProvides as ei, getTablePlugin as ej, type GetTablePluginProvides as ek, createTablePlugin as el, type CreateTablePluginProvides as em, deleteTablePlugin as en, type DeleteTablePluginProvides as eo, listTableFieldsPlugin as ep, type ListTableFieldsPluginProvides as eq, createTableFieldsPlugin as er, type CreateTableFieldsPluginProvides as es, deleteTableFieldsPlugin as et, type DeleteTableFieldsPluginProvides as eu, getTableRecordPlugin as ev, type GetTableRecordPluginProvides as ew, listTableRecordsPlugin as ex, type ListTableRecordsPluginProvides as ey, createTableRecordsPlugin as ez, findManifestEntry as f, type PositionalMetadata as g, type ZapierFetchInitOptions as h, type DynamicResolver as i, type WatchTriggerInboxOptions as j, type ActionProxy as k, type ZapierSdkApps as l, ZapierAbortDrainSignal as m, ZapierReleaseTriggerMessageSignal as n, type DrainTriggerInboxCallback as o, type DrainTriggerInboxErrorObserver as p, type ListAuthenticationsPluginProvides as q, readManifestFromFile as r, type FindFirstAuthenticationPluginProvides as s, type FindUniqueAuthenticationPluginProvides as t, type Action as u, type App as v, type Field as w, type Choice as x, type ActionExecutionResult as y, type ActionField as z };
|
|
9763
|
+
export { type Resolver as $, type ApiClient as A, type BaseSdkOptions as B, type CapabilitiesContext as C, type DrainTriggerInboxOptions as D, type EventEmissionContext as E, type FieldsetItem as F, type GetAuthenticationPluginProvides as G, type ActionFieldChoice as H, type NeedsRequest as I, type NeedsResponse as J, type Connection as K, type LeasedTriggerMessageItem as L, type Manifest as M, type Need as N, type ConnectionsResponse as O, type PluginMeta as P, type UserProfile as Q, type ResolvedAppLocator as R, isPositional as S, type TriggerMessageStatus as T, type UpdateManifestEntryOptions as U, createFunction as V, type WithAddPlugin as W, type FormattedItem as X, type FormatMetadata as Y, type ZapierSdkOptions as Z, type OutputFormatter as _, type UpdateManifestEntryResult as a, type FunctionOptions as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type DynamicListResolver as a3, type DynamicSearchResolver as a4, type FieldsResolver as a5, runWithTelemetryContext as a6, toSnakeCase as a7, toTitleCase as a8, batch as a9, type MethodCalledEvent as aA, type EventEmissionProvides as aB, type EventContext as aC, type ApplicationLifecycleEventData as aD, type EnhancedErrorEventData as aE, type MethodCalledEventData as aF, generateEventId as aG, getCurrentTimestamp as aH, getReleaseId as aI, getOsInfo as aJ, getPlatformVersions as aK, isCi as aL, getCiPlatform as aM, getMemoryUsage as aN, getCpuTime as aO, buildApplicationLifecycleEvent as aP, buildErrorEventWithContext as aQ, buildErrorEvent as aR, createBaseEvent as aS, buildMethodCalledEvent as aT, type AppItem as aU, type ConnectionItem as aV, type ActionItem$1 as aW, type InputFieldItem as aX, type InfoFieldItem as aY, type RootFieldItem as aZ, type UserProfileItem as a_, type BatchOptions as aa, buildCapabilityMessage as ab, logDeprecation as ac, resetDeprecationWarnings as ad, RelayRequestSchema as ae, RelayFetchSchema as af, createZapierSdkWithoutRegistry as ag, createSdk as ah, createOptionsPlugin as ai, type FunctionRegistryEntry as aj, type FunctionDeprecation as ak, BaseSdkOptionsSchema as al, type Plugin as am, type PluginProvides as an, definePlugin as ao, createPluginMethod as ap, createPaginatedPluginMethod as aq, composePlugins as ar, type ActionItem as as, type ActionTypeItem as at, registryPlugin as au, type RequestOptions as av, type PollOptions as aw, createZapierApi as ax, getOrCreateApiClient as ay, type BaseEvent as az, type AddActionEntryOptions as b, ZapierValidationError as b$, type SdkPage as b0, type PaginatedSdkFunction as b1, AppKeyPropertySchema as b2, AppPropertySchema as b3, ActionTypePropertySchema as b4, ActionKeyPropertySchema as b5, ActionPropertySchema as b6, InputFieldPropertySchema as b7, ConnectionIdPropertySchema as b8, AuthenticationIdPropertySchema as b9, type ConnectionIdProperty as bA, type ConnectionProperty as bB, type AuthenticationIdProperty as bC, type InputsProperty as bD, type LimitProperty as bE, type OffsetProperty as bF, type OutputProperty as bG, type DebugProperty as bH, type ParamsProperty as bI, type ActionTimeoutMsProperty as bJ, type TableProperty as bK, type RecordProperty as bL, type RecordsProperty as bM, type FieldsProperty as bN, type AppsProperty as bO, type TablesProperty as bP, type ConnectionsProperty as bQ, type TriggerInboxProperty as bR, type TriggerInboxNameProperty as bS, type LeaseProperty as bT, type LeaseSecondsProperty as bU, type LeaseLimitProperty as bV, type ApiError as bW, type ErrorOptions as bX, ZapierError as bY, ZapierApiError as bZ, ZapierAppNotFoundError as b_, ConnectionPropertySchema as ba, InputsPropertySchema as bb, LimitPropertySchema as bc, OffsetPropertySchema as bd, OutputPropertySchema as be, DebugPropertySchema as bf, ParamsPropertySchema as bg, ActionTimeoutMsPropertySchema as bh, TablePropertySchema as bi, RecordPropertySchema as bj, RecordsPropertySchema as bk, FieldsPropertySchema as bl, AppsPropertySchema as bm, TablesPropertySchema as bn, ConnectionsPropertySchema as bo, TriggerInboxPropertySchema as bp, TriggerInboxNamePropertySchema as bq, LeasePropertySchema as br, LeaseSecondsPropertySchema as bs, LeaseLimitPropertySchema as bt, type AppKeyProperty as bu, type AppProperty as bv, type ActionTypeProperty as bw, type ActionKeyProperty as bx, type ActionProperty as by, type InputFieldProperty as bz, type AddActionEntryResult as c, type GetProfilePluginProvides as c$, ZapierUnknownError as c0, ZapierAuthenticationError as c1, ZapierNotFoundError as c2, ZapierResourceNotFoundError as c3, ZapierConfigurationError as c4, ZapierBundleError as c5, ZapierTimeoutError as c6, ZapierActionError as c7, ZapierConflictError as c8, type RateLimitInfo as c9, createClientCredentialsPlugin as cA, type CreateClientCredentialsPluginProvides as cB, deleteClientCredentialsPlugin as cC, type DeleteClientCredentialsPluginProvides as cD, getAppPlugin as cE, type GetAppPluginProvides as cF, getActionPlugin as cG, type GetActionPluginProvides as cH, getConnectionPlugin as cI, type GetConnectionPluginProvides as cJ, findFirstConnectionPlugin as cK, type FindFirstConnectionPluginProvides as cL, findUniqueConnectionPlugin as cM, type FindUniqueConnectionPluginProvides as cN, CONTEXT_CACHE_TTL_MS as cO, CONTEXT_CACHE_MAX_SIZE as cP, runActionPlugin as cQ, type RunActionPluginProvides as cR, requestPlugin as cS, type RequestPluginProvides as cT, type ManifestPluginOptions as cU, getPreferredManifestEntryKey as cV, manifestPlugin as cW, type ManifestPluginProvides as cX, DEFAULT_CONFIG_PATH as cY, type ManifestEntry as cZ, getProfilePlugin as c_, ZapierRateLimitError as ca, type ApprovalStatus as cb, ZapierApprovalError as cc, ZapierRelayError as cd, formatErrorMessage as ce, ZapierSignal as cf, appsPlugin as cg, type AppsPluginProvides as ch, type ActionExecutionOptions as ci, type AppFactoryInput as cj, fetchPlugin as ck, type FetchPluginProvides as cl, listAppsPlugin as cm, type ListAppsPluginProvides as cn, listActionsPlugin as co, type ListActionsPluginProvides as cp, listActionInputFieldsPlugin as cq, type ListActionInputFieldsPluginProvides as cr, listActionInputFieldChoicesPlugin as cs, type ListActionInputFieldChoicesPluginProvides as ct, getActionInputFieldsSchemaPlugin as cu, type GetActionInputFieldsSchemaPluginProvides as cv, listConnectionsPlugin as cw, type ListConnectionsPluginProvides as cx, listClientCredentialsPlugin as cy, type ListClientCredentialsPluginProvides as cz, type ActionEntry as d, CredentialsSchema as d$, type ApiPluginOptions as d0, apiPlugin as d1, type ApiPluginProvides as d2, appKeyResolver as d3, actionTypeResolver as d4, actionKeyResolver as d5, connectionIdResolver as d6, connectionIdGenericResolver as d7, inputsResolver as d8, inputsAllOptionalResolver as d9, type ZapierCacheSetOptions as dA, createMemoryCache as dB, type SdkEvent as dC, type AuthEvent as dD, type ApiEvent as dE, type LoadingEvent as dF, type EventCallback as dG, type Credentials as dH, type ResolvedCredentials as dI, type CredentialsObject as dJ, type ClientCredentialsObject as dK, type PkceCredentialsObject as dL, isClientCredentials as dM, isPkceCredentials as dN, isCredentialsObject as dO, isCredentialsFunction as dP, type ResolveCredentialsOptions as dQ, resolveCredentialsFromEnv as dR, resolveCredentials as dS, getBaseUrlFromCredentials as dT, getClientIdFromCredentials as dU, ClientCredentialsObjectSchema as dV, PkceCredentialsObjectSchema as dW, CredentialsObjectSchema as dX, ResolvedCredentialsSchema as dY, CredentialsFunctionSchema as dZ, type CredentialsFunction as d_, inputFieldKeyResolver as da, clientCredentialsNameResolver as db, clientIdResolver as dc, tableIdResolver as dd, triggerInboxResolver as de, triggerMessagesResolver as df, tableRecordIdResolver as dg, tableRecordIdsResolver as dh, tableFieldIdsResolver as di, tableNameResolver as dj, tableFieldsResolver as dk, tableRecordsResolver as dl, tableUpdateRecordsResolver as dm, tableFiltersResolver as dn, tableSortResolver as dp, type ResolveAuthTokenOptions as dq, clearTokenCache as dr, invalidateCachedToken as ds, injectCliLogin as dt, isCliLoginAvailable as du, getTokenFromCliLogin as dv, resolveAuthToken as dw, invalidateCredentialsToken as dx, type ZapierCache as dy, type ZapierCacheEntry as dz, type PaginatedSdkResult as e, ConnectionEntrySchema as e0, type ConnectionEntry as e1, ConnectionsMapSchema as e2, type ConnectionsMap as e3, connectionsPlugin as e4, type ConnectionsPluginProvides as e5, ZAPIER_BASE_URL as e6, getZapierSdkService as e7, MAX_PAGE_LIMIT as e8, DEFAULT_PAGE_SIZE as e9, type ListTableRecordsPluginProvides as eA, createTableRecordsPlugin as eB, type CreateTableRecordsPluginProvides as eC, deleteTableRecordsPlugin as eD, type DeleteTableRecordsPluginProvides as eE, updateTableRecordsPlugin as eF, type UpdateTableRecordsPluginProvides as eG, createZapierSdk as eH, type ZapierSdk as eI, DEFAULT_ACTION_TIMEOUT_MS as ea, ZAPIER_MAX_NETWORK_RETRIES as eb, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as ec, MAX_CONCURRENCY_LIMIT as ed, parseConcurrencyEnvVar as ee, ZAPIER_MAX_CONCURRENT_REQUESTS as ef, getZapierApprovalMode as eg, DEFAULT_APPROVAL_TIMEOUT_MS as eh, DEFAULT_MAX_APPROVAL_RETRIES as ei, listTablesPlugin as ej, type ListTablesPluginProvides as ek, getTablePlugin as el, type GetTablePluginProvides as em, createTablePlugin as en, type CreateTablePluginProvides as eo, deleteTablePlugin as ep, type DeleteTablePluginProvides as eq, listTableFieldsPlugin as er, type ListTableFieldsPluginProvides as es, createTableFieldsPlugin as et, type CreateTableFieldsPluginProvides as eu, deleteTableFieldsPlugin as ev, type DeleteTableFieldsPluginProvides as ew, getTableRecordPlugin as ex, type GetTableRecordPluginProvides as ey, listTableRecordsPlugin as ez, findManifestEntry as f, type PositionalMetadata as g, type ZapierFetchInitOptions as h, type DynamicResolver as i, type WatchTriggerInboxOptions as j, type ActionProxy as k, type ZapierSdkApps as l, ZapierAbortDrainSignal as m, ZapierReleaseTriggerMessageSignal as n, type DrainTriggerInboxCallback as o, type DrainTriggerInboxErrorObserver as p, type ListAuthenticationsPluginProvides as q, readManifestFromFile as r, type FindFirstAuthenticationPluginProvides as s, type FindUniqueAuthenticationPluginProvides as t, type Action as u, type App as v, type Field as w, type Choice as x, type ActionExecutionResult as y, type ActionField as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1371,6 +1371,18 @@ var FetchInitSchema = zod.z.object({
|
|
|
1371
1371
|
aliases: { connectionId: "connection", authenticationId: "connection" }
|
|
1372
1372
|
});
|
|
1373
1373
|
|
|
1374
|
+
// src/utils/string-utils.ts
|
|
1375
|
+
function toTitleCase(input) {
|
|
1376
|
+
return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
1377
|
+
}
|
|
1378
|
+
function toSnakeCase(input) {
|
|
1379
|
+
let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
|
|
1380
|
+
if (/^[0-9]/.test(result)) {
|
|
1381
|
+
result = "_" + result;
|
|
1382
|
+
}
|
|
1383
|
+
return result;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1374
1386
|
// src/utils/domain-utils.ts
|
|
1375
1387
|
function isConnectionId(value) {
|
|
1376
1388
|
return /^\d+$/.test(value) || isUuid(value);
|
|
@@ -1517,6 +1529,12 @@ function toAppLocator(appKey) {
|
|
|
1517
1529
|
function isResolvedAppLocator(appLocator) {
|
|
1518
1530
|
return !!appLocator.implementationName;
|
|
1519
1531
|
}
|
|
1532
|
+
function getAppKeyList(app) {
|
|
1533
|
+
const keys = new Set(
|
|
1534
|
+
[app.slug, toSnakeCase(app.slug), app.key].filter(Boolean)
|
|
1535
|
+
);
|
|
1536
|
+
return Array.from(keys);
|
|
1537
|
+
}
|
|
1520
1538
|
|
|
1521
1539
|
// src/utils/abort-utils.ts
|
|
1522
1540
|
function getAbortSignalApi() {
|
|
@@ -1822,34 +1840,12 @@ var ListAppsSchema = apps.ListAppsQuerySchema.omit({
|
|
|
1822
1840
|
// SDK specific property for pagination/iterable helpers
|
|
1823
1841
|
cursor: zod.z.string().optional().describe("Cursor to start from")
|
|
1824
1842
|
}).describe("List all available apps with optional filtering");
|
|
1825
|
-
|
|
1826
|
-
// src/utils/string-utils.ts
|
|
1827
|
-
function toTitleCase(input) {
|
|
1828
|
-
return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
1829
|
-
}
|
|
1830
|
-
function toSnakeCase(input) {
|
|
1831
|
-
let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
|
|
1832
|
-
if (/^[0-9]/.test(result)) {
|
|
1833
|
-
result = "_" + result;
|
|
1834
|
-
}
|
|
1835
|
-
return result;
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
|
-
// src/schemas/App.ts
|
|
1839
1843
|
var AppItemSchema = withFormatter(apps.AppItemSchema, {
|
|
1840
1844
|
format: (item) => {
|
|
1841
|
-
const additionalKeys = [];
|
|
1842
|
-
if (item.slug && item.slug !== item.key) {
|
|
1843
|
-
additionalKeys.push(item.slug);
|
|
1844
|
-
const snakeCaseSlug = toSnakeCase(item.slug);
|
|
1845
|
-
if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
|
|
1846
|
-
additionalKeys.push(snakeCaseSlug);
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
1845
|
return {
|
|
1850
1846
|
title: item.title,
|
|
1851
1847
|
key: item.key,
|
|
1852
|
-
keys:
|
|
1848
|
+
keys: getAppKeyList(item),
|
|
1853
1849
|
description: item.description,
|
|
1854
1850
|
details: []
|
|
1855
1851
|
};
|
|
@@ -2275,9 +2271,37 @@ var ActionItemSchema = withFormatter(
|
|
|
2275
2271
|
|
|
2276
2272
|
// src/resolvers/appKey.ts
|
|
2277
2273
|
var appKeyResolver = {
|
|
2278
|
-
type: "
|
|
2279
|
-
inputType: "
|
|
2280
|
-
placeholder: "
|
|
2274
|
+
type: "dynamic",
|
|
2275
|
+
inputType: "search",
|
|
2276
|
+
placeholder: "e.g., 'slack' or 'SlackCLIAPI' or 'mail'",
|
|
2277
|
+
// Try the user's typed string as an exact app locator first; getApp accepts
|
|
2278
|
+
// a slug, key, or implementation id. If that hits, short-circuit with the
|
|
2279
|
+
// input — every variant the user could have typed is already a valid value
|
|
2280
|
+
// anywhere else app is required, so no canonicalization needed here. If
|
|
2281
|
+
// getApp 404s, fall back to a search; any other error (auth, network,
|
|
2282
|
+
// rate-limit) propagates so the user sees the real problem.
|
|
2283
|
+
fetch: async (sdk, { search }) => {
|
|
2284
|
+
if (!search) return [];
|
|
2285
|
+
try {
|
|
2286
|
+
await sdk.getApp({ app: search });
|
|
2287
|
+
return search;
|
|
2288
|
+
} catch (err) {
|
|
2289
|
+
if (!(err instanceof ZapierAppNotFoundError) && !(err instanceof ZapierNotFoundError)) {
|
|
2290
|
+
throw err;
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
const page = await sdk.listApps({ search });
|
|
2294
|
+
return page.data;
|
|
2295
|
+
},
|
|
2296
|
+
prompt: (apps) => ({
|
|
2297
|
+
type: "list",
|
|
2298
|
+
name: "app",
|
|
2299
|
+
message: "Select app:",
|
|
2300
|
+
choices: apps.map((app) => ({
|
|
2301
|
+
name: app.title ? `${app.title} (${getAppKeyList(app).join(", ")})` : app.key,
|
|
2302
|
+
value: app.key
|
|
2303
|
+
}))
|
|
2304
|
+
})
|
|
2281
2305
|
};
|
|
2282
2306
|
|
|
2283
2307
|
// src/resolvers/actionType.ts
|
|
@@ -6285,7 +6309,7 @@ async function invalidateCredentialsToken(options) {
|
|
|
6285
6309
|
}
|
|
6286
6310
|
|
|
6287
6311
|
// src/sdk-version.ts
|
|
6288
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6312
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.54.0" : void 0) || "unknown";
|
|
6289
6313
|
|
|
6290
6314
|
// src/utils/open-url.ts
|
|
6291
6315
|
var nodePrefix = "node:";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { u as Action, d as ActionEntry,
|
|
1
|
+
export { u as Action, d as ActionEntry, ci as ActionExecutionOptions, y as ActionExecutionResult, z as ActionField, H as ActionFieldChoice, aW as ActionItem, bx as ActionKeyProperty, b5 as ActionKeyPropertySchema, by as ActionProperty, b6 as ActionPropertySchema, as as ActionResolverItem, bJ as ActionTimeoutMsProperty, bh as ActionTimeoutMsPropertySchema, at as ActionTypeItem, bw as ActionTypeProperty, b4 as ActionTypePropertySchema, b as AddActionEntryOptions, c as AddActionEntryResult, A as ApiClient, bW as ApiError, dE as ApiEvent, d0 as ApiPluginOptions, d2 as ApiPluginProvides, v as App, cj as AppFactoryInput, aU as AppItem, bu as AppKeyProperty, b2 as AppKeyPropertySchema, bv as AppProperty, b3 as AppPropertySchema, aD as ApplicationLifecycleEventData, cb as ApprovalStatus, ch as AppsPluginProvides, bO as AppsProperty, bm as AppsPropertySchema, a0 as ArrayResolver, dD as AuthEvent, bC as AuthenticationIdProperty, b9 as AuthenticationIdPropertySchema, az as BaseEvent, al as BaseSdkOptionsSchema, aa as BatchOptions, cP as CONTEXT_CACHE_MAX_SIZE, cO as CONTEXT_CACHE_TTL_MS, x as Choice, dK as ClientCredentialsObject, dV as ClientCredentialsObjectSchema, K as Connection, e1 as ConnectionEntry, e0 as ConnectionEntrySchema, bA as ConnectionIdProperty, b8 as ConnectionIdPropertySchema, aV as ConnectionItem, bB as ConnectionProperty, ba as ConnectionPropertySchema, e3 as ConnectionsMap, e2 as ConnectionsMapSchema, e5 as ConnectionsPluginProvides, bQ as ConnectionsProperty, bo as ConnectionsPropertySchema, O as ConnectionsResponse, cB as CreateClientCredentialsPluginProvides, eu as CreateTableFieldsPluginProvides, eo as CreateTablePluginProvides, eC as CreateTableRecordsPluginProvides, dH as Credentials, d_ as CredentialsFunction, dZ as CredentialsFunctionSchema, dJ as CredentialsObject, dX as CredentialsObjectSchema, d$ as CredentialsSchema, ea as DEFAULT_ACTION_TIMEOUT_MS, eh as DEFAULT_APPROVAL_TIMEOUT_MS, cY as DEFAULT_CONFIG_PATH, ei as DEFAULT_MAX_APPROVAL_RETRIES, e9 as DEFAULT_PAGE_SIZE, bH as DebugProperty, bf as DebugPropertySchema, cD as DeleteClientCredentialsPluginProvides, ew as DeleteTableFieldsPluginProvides, eq as DeleteTablePluginProvides, eE as DeleteTableRecordsPluginProvides, o as DrainTriggerInboxCallback, p as DrainTriggerInboxErrorObserver, D as DrainTriggerInboxOptions, a3 as DynamicListResolver, i as DynamicResolver, a4 as DynamicSearchResolver, aE as EnhancedErrorEventData, bX as ErrorOptions, dG as EventCallback, aC as EventContext, E as EventEmissionContext, aB as EventEmissionProvides, cl as FetchPluginProvides, w as Field, bN as FieldsProperty, bl as FieldsPropertySchema, a5 as FieldsResolver, F as FieldsetItem, s as FindFirstAuthenticationPluginProvides, cL as FindFirstConnectionPluginProvides, t as FindUniqueAuthenticationPluginProvides, cN as FindUniqueConnectionPluginProvides, Y as FormatMetadata, X as FormattedItem, ak as FunctionDeprecation, a$ as FunctionOptions, aj as FunctionRegistryEntry, cv as GetActionInputFieldsSchemaPluginProvides, cH as GetActionPluginProvides, cF as GetAppPluginProvides, G as GetAuthenticationPluginProvides, cJ as GetConnectionPluginProvides, c$ as GetProfilePluginProvides, em as GetTablePluginProvides, ey as GetTableRecordPluginProvides, aY as InfoFieldItem, aX as InputFieldItem, bz as InputFieldProperty, b7 as InputFieldPropertySchema, bD as InputsProperty, bb as InputsPropertySchema, bV as LeaseLimitProperty, bt as LeaseLimitPropertySchema, bT as LeaseProperty, br as LeasePropertySchema, bU as LeaseSecondsProperty, bs as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bE as LimitProperty, bc as LimitPropertySchema, ct as ListActionInputFieldChoicesPluginProvides, cr as ListActionInputFieldsPluginProvides, cp as ListActionsPluginProvides, cn as ListAppsPluginProvides, q as ListAuthenticationsPluginProvides, cz as ListClientCredentialsPluginProvides, cx as ListConnectionsPluginProvides, es as ListTableFieldsPluginProvides, eA as ListTableRecordsPluginProvides, ek as ListTablesPluginProvides, dF as LoadingEvent, ed as MAX_CONCURRENCY_LIMIT, e8 as MAX_PAGE_LIMIT, M as Manifest, cZ as ManifestEntry, cU as ManifestPluginOptions, cX as ManifestPluginProvides, aA as MethodCalledEvent, aF as MethodCalledEventData, N as Need, I as NeedsRequest, J as NeedsResponse, bF as OffsetProperty, bd as OffsetPropertySchema, _ as OutputFormatter, bG as OutputProperty, be as OutputPropertySchema, b1 as PaginatedSdkFunction, e as PaginatedSdkResult, bI as ParamsProperty, bg as ParamsPropertySchema, dL as PkceCredentialsObject, dW as PkceCredentialsObjectSchema, am as Plugin, P as PluginMeta, an as PluginProvides, aw as PollOptions, g as PositionalMetadata, c9 as RateLimitInfo, bL as RecordProperty, bj as RecordPropertySchema, bM as RecordsProperty, bk as RecordsPropertySchema, af as RelayFetchSchema, ae as RelayRequestSchema, av as RequestOptions, cT as RequestPluginProvides, dq as ResolveAuthTokenOptions, dQ as ResolveCredentialsOptions, R as ResolvedAppLocator, dI as ResolvedCredentials, dY as ResolvedCredentialsSchema, $ as Resolver, a1 as ResolverMetadata, aZ as RootFieldItem, cR as RunActionPluginProvides, dC as SdkEvent, b0 as SdkPage, a2 as StaticResolver, bK as TableProperty, bi as TablePropertySchema, bP as TablesProperty, bn as TablesPropertySchema, bS as TriggerInboxNameProperty, bq as TriggerInboxNamePropertySchema, bR as TriggerInboxProperty, bp as TriggerInboxPropertySchema, T as TriggerMessageStatus, U as UpdateManifestEntryOptions, a as UpdateManifestEntryResult, eG as UpdateTableRecordsPluginProvides, Q as UserProfile, a_ as UserProfileItem, j as WatchTriggerInboxOptions, W as WithAddPlugin, e6 as ZAPIER_BASE_URL, ef as ZAPIER_MAX_CONCURRENT_REQUESTS, eb as ZAPIER_MAX_NETWORK_RETRIES, ec as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, m as ZapierAbortDrainSignal, c7 as ZapierActionError, bZ as ZapierApiError, b_ as ZapierAppNotFoundError, cc as ZapierApprovalError, c1 as ZapierAuthenticationError, c5 as ZapierBundleError, dy as ZapierCache, dz as ZapierCacheEntry, dA as ZapierCacheSetOptions, c4 as ZapierConfigurationError, c8 as ZapierConflictError, bY as ZapierError, h as ZapierFetchInitOptions, c2 as ZapierNotFoundError, ca as ZapierRateLimitError, cd as ZapierRelayError, n as ZapierReleaseTriggerMessageSignal, c3 as ZapierResourceNotFoundError, eI as ZapierSdk, l as ZapierSdkApps, Z as ZapierSdkOptions, cf as ZapierSignal, c6 as ZapierTimeoutError, c0 as ZapierUnknownError, b$ as ZapierValidationError, d5 as actionKeyResolver, d4 as actionTypeResolver, d1 as apiPlugin, d3 as appKeyResolver, cg as appsPlugin, d7 as authenticationIdGenericResolver, d6 as authenticationIdResolver, a9 as batch, aP as buildApplicationLifecycleEvent, ab as buildCapabilityMessage, aR as buildErrorEvent, aQ as buildErrorEventWithContext, aT as buildMethodCalledEvent, dr as clearTokenCache, db as clientCredentialsNameResolver, dc as clientIdResolver, ar as composePlugins, d7 as connectionIdGenericResolver, d6 as connectionIdResolver, e4 as connectionsPlugin, aS as createBaseEvent, cA as createClientCredentialsPlugin, V as createFunction, dB as createMemoryCache, ai as createOptionsPlugin, aq as createPaginatedPluginMethod, ap as createPluginMethod, ah as createSdk, et as createTableFieldsPlugin, en as createTablePlugin, eB as createTableRecordsPlugin, ax as createZapierApi, eH as createZapierSdk, ag as createZapierSdkWithoutRegistry, ao as definePlugin, cC as deleteClientCredentialsPlugin, ev as deleteTableFieldsPlugin, ep as deleteTablePlugin, eD as deleteTableRecordsPlugin, ck as fetchPlugin, cK as findFirstConnectionPlugin, f as findManifestEntry, cM as findUniqueConnectionPlugin, ce as formatErrorMessage, aG as generateEventId, cu as getActionInputFieldsSchemaPlugin, cG as getActionPlugin, cE as getAppPlugin, dT as getBaseUrlFromCredentials, aM as getCiPlatform, dU as getClientIdFromCredentials, cI as getConnectionPlugin, aO as getCpuTime, aH as getCurrentTimestamp, aN as getMemoryUsage, ay as getOrCreateApiClient, aJ as getOsInfo, aK as getPlatformVersions, cV as getPreferredManifestEntryKey, c_ as getProfilePlugin, aI as getReleaseId, el as getTablePlugin, ex as getTableRecordPlugin, dv as getTokenFromCliLogin, eg as getZapierApprovalMode, e7 as getZapierSdkService, dt as injectCliLogin, da as inputFieldKeyResolver, d9 as inputsAllOptionalResolver, d8 as inputsResolver, ds as invalidateCachedToken, dx as invalidateCredentialsToken, aL as isCi, du as isCliLoginAvailable, dM as isClientCredentials, dP as isCredentialsFunction, dO as isCredentialsObject, dN as isPkceCredentials, S as isPositional, cs as listActionInputFieldChoicesPlugin, cq as listActionInputFieldsPlugin, co as listActionsPlugin, cm as listAppsPlugin, cy as listClientCredentialsPlugin, cw as listConnectionsPlugin, er as listTableFieldsPlugin, ez as listTableRecordsPlugin, ej as listTablesPlugin, ac as logDeprecation, cW as manifestPlugin, ee as parseConcurrencyEnvVar, r as readManifestFromFile, au as registryPlugin, cS as requestPlugin, ad as resetDeprecationWarnings, dw as resolveAuthToken, dS as resolveCredentials, dR as resolveCredentialsFromEnv, cQ as runActionPlugin, a6 as runWithTelemetryContext, di as tableFieldIdsResolver, dk as tableFieldsResolver, dn as tableFiltersResolver, dd as tableIdResolver, dj as tableNameResolver, dg as tableRecordIdResolver, dh as tableRecordIdsResolver, dl as tableRecordsResolver, dp as tableSortResolver, dm as tableUpdateRecordsResolver, a7 as toSnakeCase, a8 as toTitleCase, de as triggerInboxResolver, df as triggerMessagesResolver, eF as updateTableRecordsPlugin } from './index-SDDmBk2j.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '@zapier/zapier-sdk-core/v0/schemas/connections';
|
|
4
4
|
import '@zapier/policy-context';
|
|
5
5
|
import 'zod/v4/core';
|
|
6
|
+
import '@zapier/zapier-sdk-core/v0/schemas/apps';
|
|
6
7
|
import '@zapier/zapier-sdk-cli/login';
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export * from "./plugins/api";
|
|
|
31
31
|
export type { Action, App, Need, Field, Choice, ActionExecutionResult, ActionField, ActionFieldChoice, NeedsRequest, NeedsResponse, Connection, ConnectionsResponse, UserProfile, } from "./api/types";
|
|
32
32
|
export { isPositional, PositionalMetadata } from "./utils/schema-utils";
|
|
33
33
|
export { createFunction } from "./utils/function-utils";
|
|
34
|
-
export type { FormattedItem, FormatMetadata, OutputFormatter, Resolver, ArrayResolver, ResolverMetadata, StaticResolver, DynamicResolver, FieldsResolver, } from "./utils/schema-utils";
|
|
34
|
+
export type { FormattedItem, FormatMetadata, OutputFormatter, Resolver, ArrayResolver, ResolverMetadata, StaticResolver, DynamicResolver, DynamicListResolver, DynamicSearchResolver, FieldsResolver, } from "./utils/schema-utils";
|
|
35
35
|
export { runWithTelemetryContext } from "./utils/telemetry-context";
|
|
36
36
|
export { toSnakeCase, toTitleCase } from "./utils/string-utils";
|
|
37
37
|
export { batch } from "./utils/batch-utils";
|
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,iBAAiB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACV,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cA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oB,EAAE,MAAM,OAAO,CAAC;AAG9D,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
|
@@ -1369,6 +1369,18 @@ var FetchInitSchema = z.object({
|
|
|
1369
1369
|
aliases: { connectionId: "connection", authenticationId: "connection" }
|
|
1370
1370
|
});
|
|
1371
1371
|
|
|
1372
|
+
// src/utils/string-utils.ts
|
|
1373
|
+
function toTitleCase(input) {
|
|
1374
|
+
return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
1375
|
+
}
|
|
1376
|
+
function toSnakeCase(input) {
|
|
1377
|
+
let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
|
|
1378
|
+
if (/^[0-9]/.test(result)) {
|
|
1379
|
+
result = "_" + result;
|
|
1380
|
+
}
|
|
1381
|
+
return result;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1372
1384
|
// src/utils/domain-utils.ts
|
|
1373
1385
|
function isConnectionId(value) {
|
|
1374
1386
|
return /^\d+$/.test(value) || isUuid(value);
|
|
@@ -1515,6 +1527,12 @@ function toAppLocator(appKey) {
|
|
|
1515
1527
|
function isResolvedAppLocator(appLocator) {
|
|
1516
1528
|
return !!appLocator.implementationName;
|
|
1517
1529
|
}
|
|
1530
|
+
function getAppKeyList(app) {
|
|
1531
|
+
const keys = new Set(
|
|
1532
|
+
[app.slug, toSnakeCase(app.slug), app.key].filter(Boolean)
|
|
1533
|
+
);
|
|
1534
|
+
return Array.from(keys);
|
|
1535
|
+
}
|
|
1518
1536
|
|
|
1519
1537
|
// src/utils/abort-utils.ts
|
|
1520
1538
|
function getAbortSignalApi() {
|
|
@@ -1820,34 +1838,12 @@ var ListAppsSchema = ListAppsQuerySchema.omit({
|
|
|
1820
1838
|
// SDK specific property for pagination/iterable helpers
|
|
1821
1839
|
cursor: z.string().optional().describe("Cursor to start from")
|
|
1822
1840
|
}).describe("List all available apps with optional filtering");
|
|
1823
|
-
|
|
1824
|
-
// src/utils/string-utils.ts
|
|
1825
|
-
function toTitleCase(input) {
|
|
1826
|
-
return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
1827
|
-
}
|
|
1828
|
-
function toSnakeCase(input) {
|
|
1829
|
-
let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
|
|
1830
|
-
if (/^[0-9]/.test(result)) {
|
|
1831
|
-
result = "_" + result;
|
|
1832
|
-
}
|
|
1833
|
-
return result;
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
// src/schemas/App.ts
|
|
1837
1841
|
var AppItemSchema = withFormatter(AppItemSchema$1, {
|
|
1838
1842
|
format: (item) => {
|
|
1839
|
-
const additionalKeys = [];
|
|
1840
|
-
if (item.slug && item.slug !== item.key) {
|
|
1841
|
-
additionalKeys.push(item.slug);
|
|
1842
|
-
const snakeCaseSlug = toSnakeCase(item.slug);
|
|
1843
|
-
if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
|
|
1844
|
-
additionalKeys.push(snakeCaseSlug);
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
1843
|
return {
|
|
1848
1844
|
title: item.title,
|
|
1849
1845
|
key: item.key,
|
|
1850
|
-
keys:
|
|
1846
|
+
keys: getAppKeyList(item),
|
|
1851
1847
|
description: item.description,
|
|
1852
1848
|
details: []
|
|
1853
1849
|
};
|
|
@@ -2273,9 +2269,37 @@ var ActionItemSchema = withFormatter(
|
|
|
2273
2269
|
|
|
2274
2270
|
// src/resolvers/appKey.ts
|
|
2275
2271
|
var appKeyResolver = {
|
|
2276
|
-
type: "
|
|
2277
|
-
inputType: "
|
|
2278
|
-
placeholder: "
|
|
2272
|
+
type: "dynamic",
|
|
2273
|
+
inputType: "search",
|
|
2274
|
+
placeholder: "e.g., 'slack' or 'SlackCLIAPI' or 'mail'",
|
|
2275
|
+
// Try the user's typed string as an exact app locator first; getApp accepts
|
|
2276
|
+
// a slug, key, or implementation id. If that hits, short-circuit with the
|
|
2277
|
+
// input — every variant the user could have typed is already a valid value
|
|
2278
|
+
// anywhere else app is required, so no canonicalization needed here. If
|
|
2279
|
+
// getApp 404s, fall back to a search; any other error (auth, network,
|
|
2280
|
+
// rate-limit) propagates so the user sees the real problem.
|
|
2281
|
+
fetch: async (sdk, { search }) => {
|
|
2282
|
+
if (!search) return [];
|
|
2283
|
+
try {
|
|
2284
|
+
await sdk.getApp({ app: search });
|
|
2285
|
+
return search;
|
|
2286
|
+
} catch (err) {
|
|
2287
|
+
if (!(err instanceof ZapierAppNotFoundError) && !(err instanceof ZapierNotFoundError)) {
|
|
2288
|
+
throw err;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
const page = await sdk.listApps({ search });
|
|
2292
|
+
return page.data;
|
|
2293
|
+
},
|
|
2294
|
+
prompt: (apps) => ({
|
|
2295
|
+
type: "list",
|
|
2296
|
+
name: "app",
|
|
2297
|
+
message: "Select app:",
|
|
2298
|
+
choices: apps.map((app) => ({
|
|
2299
|
+
name: app.title ? `${app.title} (${getAppKeyList(app).join(", ")})` : app.key,
|
|
2300
|
+
value: app.key
|
|
2301
|
+
}))
|
|
2302
|
+
})
|
|
2279
2303
|
};
|
|
2280
2304
|
|
|
2281
2305
|
// src/resolvers/actionType.ts
|
|
@@ -6283,7 +6307,7 @@ async function invalidateCredentialsToken(options) {
|
|
|
6283
6307
|
}
|
|
6284
6308
|
|
|
6285
6309
|
// src/sdk-version.ts
|
|
6286
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6310
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.54.0" : void 0) || "unknown";
|
|
6287
6311
|
|
|
6288
6312
|
// src/utils/open-url.ts
|
|
6289
6313
|
var nodePrefix = "node:";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { DynamicResolver } from "../utils/schema-utils";
|
|
2
|
+
import type { AppItem } from "../plugins/listApps/schemas";
|
|
3
|
+
type AppKeyResolver = DynamicResolver<AppItem, {
|
|
4
|
+
search?: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const appKeyResolver: AppKeyResolver;
|
|
7
|
+
export {};
|
|
3
8
|
//# sourceMappingURL=appKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/appKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"appKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/appKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAI3D,KAAK,cAAc,GAAG,eAAe,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEpE,eAAO,MAAM,cAAc,EAAE,cA6C5B,CAAC"}
|
package/dist/resolvers/appKey.js
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
|
+
import { ZapierAppNotFoundError, ZapierNotFoundError } from "../types/errors";
|
|
2
|
+
import { getAppKeyList } from "../utils/domain-utils";
|
|
1
3
|
export const appKeyResolver = {
|
|
2
|
-
type: "
|
|
3
|
-
inputType: "
|
|
4
|
-
placeholder: "
|
|
4
|
+
type: "dynamic",
|
|
5
|
+
inputType: "search",
|
|
6
|
+
placeholder: "e.g., 'slack' or 'SlackCLIAPI' or 'mail'",
|
|
7
|
+
// Try the user's typed string as an exact app locator first; getApp accepts
|
|
8
|
+
// a slug, key, or implementation id. If that hits, short-circuit with the
|
|
9
|
+
// input — every variant the user could have typed is already a valid value
|
|
10
|
+
// anywhere else app is required, so no canonicalization needed here. If
|
|
11
|
+
// getApp 404s, fall back to a search; any other error (auth, network,
|
|
12
|
+
// rate-limit) propagates so the user sees the real problem.
|
|
13
|
+
fetch: async (sdk, { search }) => {
|
|
14
|
+
if (!search)
|
|
15
|
+
return [];
|
|
16
|
+
try {
|
|
17
|
+
await sdk.getApp({ app: search });
|
|
18
|
+
return search;
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
// ZapierAppNotFoundError and ZapierNotFoundError are independent
|
|
22
|
+
// siblings under ZapierError, not parent/child — so neither
|
|
23
|
+
// instanceof check subsumes the other. getApp throws the
|
|
24
|
+
// app-specific class today; the generic one stays here for 404s
|
|
25
|
+
// that arrive through other layers (e.g. an intermediate plugin
|
|
26
|
+
// wrapping the error, or a future endpoint refactor that drops
|
|
27
|
+
// the app-specific class). Any other class (auth, network, rate
|
|
28
|
+
// limit) propagates so the user sees the real problem.
|
|
29
|
+
if (!(err instanceof ZapierAppNotFoundError) &&
|
|
30
|
+
!(err instanceof ZapierNotFoundError)) {
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const page = await sdk.listApps({ search });
|
|
35
|
+
return page.data;
|
|
36
|
+
},
|
|
37
|
+
prompt: (apps) => ({
|
|
38
|
+
type: "list",
|
|
39
|
+
name: "app",
|
|
40
|
+
message: "Select app:",
|
|
41
|
+
choices: apps.map((app) => ({
|
|
42
|
+
name: app.title
|
|
43
|
+
? `${app.title} (${getAppKeyList(app).join(", ")})`
|
|
44
|
+
: app.key,
|
|
45
|
+
value: app.key,
|
|
46
|
+
})),
|
|
47
|
+
}),
|
|
5
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/schemas/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMtE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/schemas/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMtE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUxB,CAAC;AAMH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/schemas/App.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
import { withFormatter } from "../utils/schema-utils";
|
|
2
2
|
import { AppItemSchema as AppItemSchemaBase } from "@zapier/zapier-sdk-core/v0/schemas/apps";
|
|
3
|
-
import {
|
|
3
|
+
import { getAppKeyList } from "../utils/domain-utils";
|
|
4
4
|
// ============================================================================
|
|
5
5
|
// App Item Schema (wraps core schema with SDK-specific formatting)
|
|
6
6
|
// ============================================================================
|
|
7
7
|
export const AppItemSchema = withFormatter(AppItemSchemaBase, {
|
|
8
8
|
format: (item) => {
|
|
9
|
-
// Create additional keys if slug exists
|
|
10
|
-
const additionalKeys = [];
|
|
11
|
-
if (item.slug && item.slug !== item.key) {
|
|
12
|
-
additionalKeys.push(item.slug);
|
|
13
|
-
const snakeCaseSlug = toSnakeCase(item.slug);
|
|
14
|
-
if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
|
|
15
|
-
additionalKeys.push(snakeCaseSlug);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
9
|
return {
|
|
19
10
|
title: item.title,
|
|
20
11
|
key: item.key,
|
|
21
|
-
keys:
|
|
12
|
+
keys: getAppKeyList(item),
|
|
22
13
|
description: item.description,
|
|
23
14
|
details: [],
|
|
24
15
|
};
|
|
@@ -89,4 +89,8 @@ export declare function isUuid(appKey: string): boolean;
|
|
|
89
89
|
export declare function toAppLocator(appKey: string): AppLocator;
|
|
90
90
|
export declare function isResolvedAppLocator(appLocator: AppLocator): appLocator is ResolvedAppLocator;
|
|
91
91
|
export declare function toImplementationId(appLocator: ResolvedAppLocator): string;
|
|
92
|
+
export declare function getAppKeyList(app: {
|
|
93
|
+
key: string;
|
|
94
|
+
slug: string;
|
|
95
|
+
}): string[];
|
|
92
96
|
//# sourceMappingURL=domain-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-utils.d.ts","sourceRoot":"","sources":["../../src/utils/domain-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KA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