@zapier/zapier-sdk 0.32.2 → 0.32.4
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 +12 -0
- package/dist/index.cjs +92 -69
- package/dist/index.d.mts +18 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +92 -69
- package/dist/plugins/eventEmission/index.d.ts +1 -0
- package/dist/plugins/eventEmission/index.d.ts.map +1 -1
- package/dist/plugins/eventEmission/index.js +31 -39
- package/dist/plugins/eventEmission/index.test.js +7 -109
- package/dist/plugins/eventEmission/types.d.ts +1 -1
- package/dist/plugins/eventEmission/types.d.ts.map +1 -1
- package/dist/plugins/request/index.test.js +1 -0
- package/dist/resolvers/connectionId.d.ts.map +1 -1
- package/dist/resolvers/connectionId.js +43 -23
- package/dist/resolvers/connectionId.test.d.ts +2 -0
- package/dist/resolvers/connectionId.test.d.ts.map +1 -0
- package/dist/resolvers/connectionId.test.js +61 -0
- package/dist/types/telemetry-events.d.ts +1 -1
- package/dist/types/telemetry-events.d.ts.map +1 -1
- package/dist/utils/schema-utils.d.ts +10 -0
- package/dist/utils/schema-utils.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.32.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1334eac: Emit login_success lifecycle event on CLI login
|
|
8
|
+
|
|
9
|
+
## 0.32.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 04000f6: Skip connection selection for apps that do not require auth
|
|
14
|
+
|
|
3
15
|
## 0.32.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1635,29 +1635,27 @@ var actionKeyResolver = {
|
|
|
1635
1635
|
};
|
|
1636
1636
|
|
|
1637
1637
|
// src/resolvers/connectionId.ts
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
},
|
|
1660
|
-
prompt: (connections, params) => ({
|
|
1638
|
+
async function fetchConnections(sdk, resolvedParams) {
|
|
1639
|
+
const listOptions = {
|
|
1640
|
+
maxItems: 1e3
|
|
1641
|
+
};
|
|
1642
|
+
if (resolvedParams.appKey) {
|
|
1643
|
+
listOptions.appKey = resolvedParams.appKey;
|
|
1644
|
+
}
|
|
1645
|
+
const myConnections = await sdk.listConnections({
|
|
1646
|
+
...listOptions,
|
|
1647
|
+
owner: "me"
|
|
1648
|
+
});
|
|
1649
|
+
const allConnections = await sdk.listConnections(listOptions);
|
|
1650
|
+
const otherConnections = allConnections.data.filter(
|
|
1651
|
+
(connection) => !myConnections.data.some(
|
|
1652
|
+
(myConnection) => myConnection.id === connection.id
|
|
1653
|
+
)
|
|
1654
|
+
);
|
|
1655
|
+
return [...myConnections.data, ...otherConnections];
|
|
1656
|
+
}
|
|
1657
|
+
function promptForConnection(connections, params) {
|
|
1658
|
+
return {
|
|
1661
1659
|
type: "list",
|
|
1662
1660
|
name: "connectionId",
|
|
1663
1661
|
message: params.appKey ? `Select connection for ${params.appKey}:` : "Select connection:",
|
|
@@ -1671,11 +1669,30 @@ var connectionIdResolver = {
|
|
|
1671
1669
|
value: null
|
|
1672
1670
|
}
|
|
1673
1671
|
]
|
|
1674
|
-
}
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
var connectionIdResolver = {
|
|
1675
|
+
type: "dynamic",
|
|
1676
|
+
depends: ["appKey"],
|
|
1677
|
+
tryResolveWithoutPrompt: async (sdk, params) => {
|
|
1678
|
+
if (!params.appKey) return null;
|
|
1679
|
+
try {
|
|
1680
|
+
const app = await sdk.getApp({ appKey: params.appKey });
|
|
1681
|
+
if (!app.data.auth_type) {
|
|
1682
|
+
return { resolvedValue: null };
|
|
1683
|
+
}
|
|
1684
|
+
} catch {
|
|
1685
|
+
}
|
|
1686
|
+
return null;
|
|
1687
|
+
},
|
|
1688
|
+
fetch: fetchConnections,
|
|
1689
|
+
prompt: promptForConnection
|
|
1675
1690
|
};
|
|
1676
1691
|
var connectionIdGenericResolver = {
|
|
1677
|
-
|
|
1678
|
-
depends: []
|
|
1692
|
+
type: "dynamic",
|
|
1693
|
+
depends: [],
|
|
1694
|
+
fetch: fetchConnections,
|
|
1695
|
+
prompt: promptForConnection
|
|
1679
1696
|
};
|
|
1680
1697
|
|
|
1681
1698
|
// src/resolvers/inputs.ts
|
|
@@ -5503,7 +5520,7 @@ function getCpuTime() {
|
|
|
5503
5520
|
|
|
5504
5521
|
// package.json
|
|
5505
5522
|
var package_default = {
|
|
5506
|
-
version: "0.32.
|
|
5523
|
+
version: "0.32.4"};
|
|
5507
5524
|
|
|
5508
5525
|
// src/plugins/eventEmission/builders.ts
|
|
5509
5526
|
function createBaseEvent(context = {}) {
|
|
@@ -5626,7 +5643,6 @@ function removeExistingListeners() {
|
|
|
5626
5643
|
var APPLICATION_LIFECYCLE_EVENT_SUBJECT = "platform.sdk.ApplicationLifecycleEvent";
|
|
5627
5644
|
var ERROR_OCCURRED_EVENT_SUBJECT = "platform.sdk.ErrorOccurredEvent";
|
|
5628
5645
|
var METHOD_CALLED_EVENT_SUBJECT = "platform.sdk.MethodCalledEvent";
|
|
5629
|
-
var transportStates = /* @__PURE__ */ new WeakMap();
|
|
5630
5646
|
async function emitWithTimeout(transport, subject, event) {
|
|
5631
5647
|
try {
|
|
5632
5648
|
await Promise.race([
|
|
@@ -5643,11 +5659,6 @@ async function emitWithTimeout(transport, subject, event) {
|
|
|
5643
5659
|
}
|
|
5644
5660
|
async function silentEmit(transport, subject, event, userContextPromise) {
|
|
5645
5661
|
try {
|
|
5646
|
-
let state = transportStates.get(transport);
|
|
5647
|
-
if (!state) {
|
|
5648
|
-
state = { hasWorked: false, hasLoggedFailure: false };
|
|
5649
|
-
transportStates.set(transport, state);
|
|
5650
|
-
}
|
|
5651
5662
|
let enrichedEvent = event;
|
|
5652
5663
|
if (userContextPromise) {
|
|
5653
5664
|
try {
|
|
@@ -5656,19 +5667,7 @@ async function silentEmit(transport, subject, event, userContextPromise) {
|
|
|
5656
5667
|
} catch {
|
|
5657
5668
|
}
|
|
5658
5669
|
}
|
|
5659
|
-
transport.emit(subject, enrichedEvent)
|
|
5660
|
-
state.hasWorked = true;
|
|
5661
|
-
}).catch((error) => {
|
|
5662
|
-
if (!state.hasWorked && !state.hasLoggedFailure) {
|
|
5663
|
-
state.hasLoggedFailure = true;
|
|
5664
|
-
console.warn(
|
|
5665
|
-
`[zapier-sdk] Tracking failed: ${error.message || "Unknown error"}`
|
|
5666
|
-
);
|
|
5667
|
-
console.warn(
|
|
5668
|
-
`[zapier-sdk] Hint: Set trackingBaseUrl parameter or ZAPIER_TRACKING_BASE_URL environment variable if using custom domains`
|
|
5669
|
-
);
|
|
5670
|
-
}
|
|
5671
|
-
});
|
|
5670
|
+
await transport.emit(subject, enrichedEvent);
|
|
5672
5671
|
} catch {
|
|
5673
5672
|
}
|
|
5674
5673
|
}
|
|
@@ -5706,20 +5705,34 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5706
5705
|
)
|
|
5707
5706
|
};
|
|
5708
5707
|
const getUserContext = (async () => {
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5708
|
+
if (config.enabled) {
|
|
5709
|
+
try {
|
|
5710
|
+
const token = await resolveAuthToken({
|
|
5711
|
+
...context.options
|
|
5712
|
+
});
|
|
5713
|
+
if (token) {
|
|
5714
|
+
return extractUserIdsFromJwt(token);
|
|
5715
|
+
}
|
|
5716
|
+
} catch {
|
|
5715
5717
|
}
|
|
5716
|
-
} catch {
|
|
5717
5718
|
}
|
|
5718
5719
|
return { customuser_id: null, account_id: null };
|
|
5719
5720
|
})();
|
|
5720
5721
|
const startupTime = Date.now();
|
|
5721
5722
|
let shutdownStartTime = null;
|
|
5722
5723
|
let closed = false;
|
|
5724
|
+
const pendingEmissions = /* @__PURE__ */ new Set();
|
|
5725
|
+
function trackEmission(promise) {
|
|
5726
|
+
pendingEmissions.add(promise);
|
|
5727
|
+
promise.finally(() => {
|
|
5728
|
+
pendingEmissions.delete(promise);
|
|
5729
|
+
});
|
|
5730
|
+
}
|
|
5731
|
+
async function flush() {
|
|
5732
|
+
while (pendingEmissions.size > 0) {
|
|
5733
|
+
await Promise.allSettled([...pendingEmissions]);
|
|
5734
|
+
}
|
|
5735
|
+
}
|
|
5723
5736
|
if (!config.enabled) {
|
|
5724
5737
|
return {
|
|
5725
5738
|
context: {
|
|
@@ -5740,6 +5753,8 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5740
5753
|
}),
|
|
5741
5754
|
emitMethodCalled: () => {
|
|
5742
5755
|
},
|
|
5756
|
+
flush: async () => {
|
|
5757
|
+
},
|
|
5743
5758
|
close: async () => {
|
|
5744
5759
|
}
|
|
5745
5760
|
}
|
|
@@ -5774,11 +5789,13 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5774
5789
|
const startupEvent = buildApplicationLifecycleEvent({
|
|
5775
5790
|
lifecycle_event_type: "startup"
|
|
5776
5791
|
});
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5792
|
+
trackEmission(
|
|
5793
|
+
silentEmit(
|
|
5794
|
+
transport,
|
|
5795
|
+
APPLICATION_LIFECYCLE_EVENT_SUBJECT,
|
|
5796
|
+
startupEvent,
|
|
5797
|
+
getUserContext
|
|
5798
|
+
)
|
|
5782
5799
|
);
|
|
5783
5800
|
if (typeof process?.on === "function") {
|
|
5784
5801
|
removeExistingListeners();
|
|
@@ -5793,11 +5810,13 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5793
5810
|
is_graceful_shutdown: code === 0,
|
|
5794
5811
|
shutdown_duration_ms: shutdownDuration
|
|
5795
5812
|
});
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5813
|
+
trackEmission(
|
|
5814
|
+
silentEmit(
|
|
5815
|
+
transport,
|
|
5816
|
+
APPLICATION_LIFECYCLE_EVENT_SUBJECT,
|
|
5817
|
+
exitEvent,
|
|
5818
|
+
getUserContext
|
|
5819
|
+
)
|
|
5801
5820
|
);
|
|
5802
5821
|
};
|
|
5803
5822
|
registeredListeners.exit = exitHandler;
|
|
@@ -5886,6 +5905,7 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5886
5905
|
const close = async (exitCode) => {
|
|
5887
5906
|
if (closed) return;
|
|
5888
5907
|
closed = true;
|
|
5908
|
+
await flush();
|
|
5889
5909
|
const uptime = Date.now() - startupTime;
|
|
5890
5910
|
const shutdownDuration = shutdownStartTime ? Date.now() - shutdownStartTime : null;
|
|
5891
5911
|
let exitEvent = buildApplicationLifecycleEvent({
|
|
@@ -5913,7 +5933,7 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5913
5933
|
transport,
|
|
5914
5934
|
config,
|
|
5915
5935
|
emit: (subject, event) => {
|
|
5916
|
-
silentEmit(transport, subject, event, getUserContext);
|
|
5936
|
+
trackEmission(silentEmit(transport, subject, event, getUserContext));
|
|
5917
5937
|
},
|
|
5918
5938
|
createBaseEvent: createBaseEventHelper,
|
|
5919
5939
|
emitMethodCalled: (data) => {
|
|
@@ -5921,13 +5941,16 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5921
5941
|
...buildMethodCalledEvent(data),
|
|
5922
5942
|
call_context: config.callContext ?? "sdk"
|
|
5923
5943
|
};
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5944
|
+
trackEmission(
|
|
5945
|
+
silentEmit(
|
|
5946
|
+
transport,
|
|
5947
|
+
METHOD_CALLED_EVENT_SUBJECT,
|
|
5948
|
+
event,
|
|
5949
|
+
getUserContext
|
|
5950
|
+
)
|
|
5929
5951
|
);
|
|
5930
5952
|
},
|
|
5953
|
+
flush,
|
|
5931
5954
|
close
|
|
5932
5955
|
}
|
|
5933
5956
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -171,7 +171,7 @@ interface ErrorOccurredEvent extends BaseEvent {
|
|
|
171
171
|
execution_time_before_error_ms?: number | null;
|
|
172
172
|
}
|
|
173
173
|
interface ApplicationLifecycleEvent extends BaseEvent {
|
|
174
|
-
lifecycle_event_type: "startup" | "exit" | "signal_termination";
|
|
174
|
+
lifecycle_event_type: "startup" | "exit" | "signal_termination" | "login_success";
|
|
175
175
|
selected_api?: string | null;
|
|
176
176
|
app_id?: number | null;
|
|
177
177
|
app_version_id?: number | null;
|
|
@@ -286,7 +286,7 @@ interface EnhancedErrorEventData extends ErrorEventData {
|
|
|
286
286
|
execution_start_time?: number | null;
|
|
287
287
|
}
|
|
288
288
|
interface ApplicationLifecycleEventData {
|
|
289
|
-
lifecycle_event_type: "startup" | "exit" | "signal_termination";
|
|
289
|
+
lifecycle_event_type: "startup" | "exit" | "signal_termination" | "login_success";
|
|
290
290
|
exit_code?: number | null;
|
|
291
291
|
signal_name?: string | null;
|
|
292
292
|
uptime_ms?: number | null;
|
|
@@ -388,6 +388,7 @@ interface EventEmissionContext {
|
|
|
388
388
|
emit<T extends any>(subject: string, event: T): void;
|
|
389
389
|
createBaseEvent(): Promise<BaseEvent>;
|
|
390
390
|
emitMethodCalled(data: MethodCalledEventData): void;
|
|
391
|
+
flush(): Promise<void>;
|
|
391
392
|
close(exitCode?: number): Promise<void>;
|
|
392
393
|
};
|
|
393
394
|
}
|
|
@@ -2235,6 +2236,20 @@ interface DynamicResolver<TItem = unknown, TParams = Record<string, unknown>> ex
|
|
|
2235
2236
|
type: "dynamic";
|
|
2236
2237
|
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => Promise<TItem[]>;
|
|
2237
2238
|
prompt: (items: TItem[], params: TParams) => PromptConfig;
|
|
2239
|
+
/**
|
|
2240
|
+
* Optional hook called before fetch/prompt. If it returns a non-null object,
|
|
2241
|
+
* resolvedValue is used directly and fetch/prompt are skipped entirely. Return
|
|
2242
|
+
* null to fall through to the normal resolution flow. Implementations should
|
|
2243
|
+
* catch their own errors and return null on failure rather than throwing, so
|
|
2244
|
+
* that a transient API error does not block the CLI entirely.
|
|
2245
|
+
*/
|
|
2246
|
+
tryResolveWithoutPrompt?: (sdk: ZapierSdk, params: TParams) => Promise<{
|
|
2247
|
+
resolvedValue: unknown;
|
|
2248
|
+
} | null>;
|
|
2249
|
+
}
|
|
2250
|
+
interface FieldsResolver<TParams = Record<string, unknown>> extends Resolver {
|
|
2251
|
+
type: "fields";
|
|
2252
|
+
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => Promise<InputFieldItem$1[]>;
|
|
2238
2253
|
}
|
|
2239
2254
|
interface PositionalMetadata {
|
|
2240
2255
|
positionalMeta: {
|
|
@@ -2959,4 +2974,4 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
|
|
|
2959
2974
|
}>;
|
|
2960
2975
|
declare function createZapierSdk(options?: ZapierSdkOptions): ZapierSdk;
|
|
2961
2976
|
|
|
2962
|
-
export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTimeoutMsProperty, ActionTimeoutMsPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type AuthEvent, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type BaseEvent, BaseSdkOptionsSchema, type BatchOptions, type Choice, type ClientCredentialsObject, ClientCredentialsObjectSchema, type Connection, type ConnectionIdProperty, ConnectionIdPropertySchema, type ConnectionItem, type ConnectionsResponse, type CreateClientCredentialsPluginProvides, type Credentials, type CredentialsFunction, CredentialsFunctionSchema, type CredentialsObject, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type DeleteClientCredentialsPluginProvides, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindFirstConnectionPluginProvides, type FindUniqueAuthenticationPluginProvides, type FindUniqueConnectionPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetConnectionPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListClientCredentialsPluginProvides, type ListConnectionsPluginProvides, type ListInputFieldsPluginProvides, 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 OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type PkceCredentialsObject, PkceCredentialsObjectSchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, type RateLimitInfo, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedCredentials, ResolvedCredentialsSchema, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type StaticResolver, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UserProfile, type UserProfileItem, ZAPIER_AUTH_BASE_URL, ZAPIER_AUTH_CLIENT_ID, ZAPIER_BASE_URL, ZAPIER_CREDENTIALS, ZAPIER_CREDENTIALS_BASE_URL, ZAPIER_CREDENTIALS_CLIENT_ID, ZAPIER_CREDENTIALS_CLIENT_SECRET, ZAPIER_CREDENTIALS_SCOPE, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZAPIER_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, toSnakeCase, toTitleCase };
|
|
2977
|
+
export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTimeoutMsProperty, ActionTimeoutMsPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type AuthEvent, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type BaseEvent, BaseSdkOptionsSchema, type BatchOptions, type Choice, type ClientCredentialsObject, ClientCredentialsObjectSchema, type Connection, type ConnectionIdProperty, ConnectionIdPropertySchema, type ConnectionItem, type ConnectionsResponse, type CreateClientCredentialsPluginProvides, type Credentials, type CredentialsFunction, CredentialsFunctionSchema, type CredentialsObject, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type DeleteClientCredentialsPluginProvides, type DynamicResolver, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsResolver, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindFirstConnectionPluginProvides, type FindUniqueAuthenticationPluginProvides, type FindUniqueConnectionPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetConnectionPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListClientCredentialsPluginProvides, type ListConnectionsPluginProvides, type ListInputFieldsPluginProvides, 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 OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type PkceCredentialsObject, PkceCredentialsObjectSchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, type RateLimitInfo, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedCredentials, ResolvedCredentialsSchema, type Resolver, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type StaticResolver, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UserProfile, type UserProfileItem, ZAPIER_AUTH_BASE_URL, ZAPIER_AUTH_CLIENT_ID, ZAPIER_BASE_URL, ZAPIER_CREDENTIALS, ZAPIER_CREDENTIALS_BASE_URL, ZAPIER_CREDENTIALS_CLIENT_ID, ZAPIER_CREDENTIALS_CLIENT_SECRET, ZAPIER_CREDENTIALS_SCOPE, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZAPIER_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, toSnakeCase, toTitleCase };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export * from "./plugins/api";
|
|
|
25
25
|
export type { Action, App, Need, Field, Choice, ActionExecutionResult, ActionField, ActionFieldChoice, NeedsRequest, NeedsResponse, Connection, ConnectionsResponse, UserProfile, } from "./api/types";
|
|
26
26
|
export { isPositional, PositionalMetadata } from "./utils/schema-utils";
|
|
27
27
|
export { createFunction } from "./utils/function-utils";
|
|
28
|
-
export type { FormattedItem, FormatMetadata, StaticResolver, } from "./utils/schema-utils";
|
|
28
|
+
export type { FormattedItem, FormatMetadata, Resolver, StaticResolver, DynamicResolver, FieldsResolver, } from "./utils/schema-utils";
|
|
29
29
|
export { toSnakeCase, toTitleCase } from "./utils/string-utils";
|
|
30
30
|
export { batch } from "./utils/batch-utils";
|
|
31
31
|
export type { BatchOptions } 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,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,EAC/B,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,sCAAsC,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAG9B,YAAY,EACV,MAAM,EACN,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,EACN,qB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AsB,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
|
@@ -1613,29 +1613,27 @@ var actionKeyResolver = {
|
|
|
1613
1613
|
};
|
|
1614
1614
|
|
|
1615
1615
|
// src/resolvers/connectionId.ts
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
},
|
|
1638
|
-
prompt: (connections, params) => ({
|
|
1616
|
+
async function fetchConnections(sdk, resolvedParams) {
|
|
1617
|
+
const listOptions = {
|
|
1618
|
+
maxItems: 1e3
|
|
1619
|
+
};
|
|
1620
|
+
if (resolvedParams.appKey) {
|
|
1621
|
+
listOptions.appKey = resolvedParams.appKey;
|
|
1622
|
+
}
|
|
1623
|
+
const myConnections = await sdk.listConnections({
|
|
1624
|
+
...listOptions,
|
|
1625
|
+
owner: "me"
|
|
1626
|
+
});
|
|
1627
|
+
const allConnections = await sdk.listConnections(listOptions);
|
|
1628
|
+
const otherConnections = allConnections.data.filter(
|
|
1629
|
+
(connection) => !myConnections.data.some(
|
|
1630
|
+
(myConnection) => myConnection.id === connection.id
|
|
1631
|
+
)
|
|
1632
|
+
);
|
|
1633
|
+
return [...myConnections.data, ...otherConnections];
|
|
1634
|
+
}
|
|
1635
|
+
function promptForConnection(connections, params) {
|
|
1636
|
+
return {
|
|
1639
1637
|
type: "list",
|
|
1640
1638
|
name: "connectionId",
|
|
1641
1639
|
message: params.appKey ? `Select connection for ${params.appKey}:` : "Select connection:",
|
|
@@ -1649,11 +1647,30 @@ var connectionIdResolver = {
|
|
|
1649
1647
|
value: null
|
|
1650
1648
|
}
|
|
1651
1649
|
]
|
|
1652
|
-
}
|
|
1650
|
+
};
|
|
1651
|
+
}
|
|
1652
|
+
var connectionIdResolver = {
|
|
1653
|
+
type: "dynamic",
|
|
1654
|
+
depends: ["appKey"],
|
|
1655
|
+
tryResolveWithoutPrompt: async (sdk, params) => {
|
|
1656
|
+
if (!params.appKey) return null;
|
|
1657
|
+
try {
|
|
1658
|
+
const app = await sdk.getApp({ appKey: params.appKey });
|
|
1659
|
+
if (!app.data.auth_type) {
|
|
1660
|
+
return { resolvedValue: null };
|
|
1661
|
+
}
|
|
1662
|
+
} catch {
|
|
1663
|
+
}
|
|
1664
|
+
return null;
|
|
1665
|
+
},
|
|
1666
|
+
fetch: fetchConnections,
|
|
1667
|
+
prompt: promptForConnection
|
|
1653
1668
|
};
|
|
1654
1669
|
var connectionIdGenericResolver = {
|
|
1655
|
-
|
|
1656
|
-
depends: []
|
|
1670
|
+
type: "dynamic",
|
|
1671
|
+
depends: [],
|
|
1672
|
+
fetch: fetchConnections,
|
|
1673
|
+
prompt: promptForConnection
|
|
1657
1674
|
};
|
|
1658
1675
|
|
|
1659
1676
|
// src/resolvers/inputs.ts
|
|
@@ -5481,7 +5498,7 @@ function getCpuTime() {
|
|
|
5481
5498
|
|
|
5482
5499
|
// package.json
|
|
5483
5500
|
var package_default = {
|
|
5484
|
-
version: "0.32.
|
|
5501
|
+
version: "0.32.4"};
|
|
5485
5502
|
|
|
5486
5503
|
// src/plugins/eventEmission/builders.ts
|
|
5487
5504
|
function createBaseEvent(context = {}) {
|
|
@@ -5604,7 +5621,6 @@ function removeExistingListeners() {
|
|
|
5604
5621
|
var APPLICATION_LIFECYCLE_EVENT_SUBJECT = "platform.sdk.ApplicationLifecycleEvent";
|
|
5605
5622
|
var ERROR_OCCURRED_EVENT_SUBJECT = "platform.sdk.ErrorOccurredEvent";
|
|
5606
5623
|
var METHOD_CALLED_EVENT_SUBJECT = "platform.sdk.MethodCalledEvent";
|
|
5607
|
-
var transportStates = /* @__PURE__ */ new WeakMap();
|
|
5608
5624
|
async function emitWithTimeout(transport, subject, event) {
|
|
5609
5625
|
try {
|
|
5610
5626
|
await Promise.race([
|
|
@@ -5621,11 +5637,6 @@ async function emitWithTimeout(transport, subject, event) {
|
|
|
5621
5637
|
}
|
|
5622
5638
|
async function silentEmit(transport, subject, event, userContextPromise) {
|
|
5623
5639
|
try {
|
|
5624
|
-
let state = transportStates.get(transport);
|
|
5625
|
-
if (!state) {
|
|
5626
|
-
state = { hasWorked: false, hasLoggedFailure: false };
|
|
5627
|
-
transportStates.set(transport, state);
|
|
5628
|
-
}
|
|
5629
5640
|
let enrichedEvent = event;
|
|
5630
5641
|
if (userContextPromise) {
|
|
5631
5642
|
try {
|
|
@@ -5634,19 +5645,7 @@ async function silentEmit(transport, subject, event, userContextPromise) {
|
|
|
5634
5645
|
} catch {
|
|
5635
5646
|
}
|
|
5636
5647
|
}
|
|
5637
|
-
transport.emit(subject, enrichedEvent)
|
|
5638
|
-
state.hasWorked = true;
|
|
5639
|
-
}).catch((error) => {
|
|
5640
|
-
if (!state.hasWorked && !state.hasLoggedFailure) {
|
|
5641
|
-
state.hasLoggedFailure = true;
|
|
5642
|
-
console.warn(
|
|
5643
|
-
`[zapier-sdk] Tracking failed: ${error.message || "Unknown error"}`
|
|
5644
|
-
);
|
|
5645
|
-
console.warn(
|
|
5646
|
-
`[zapier-sdk] Hint: Set trackingBaseUrl parameter or ZAPIER_TRACKING_BASE_URL environment variable if using custom domains`
|
|
5647
|
-
);
|
|
5648
|
-
}
|
|
5649
|
-
});
|
|
5648
|
+
await transport.emit(subject, enrichedEvent);
|
|
5650
5649
|
} catch {
|
|
5651
5650
|
}
|
|
5652
5651
|
}
|
|
@@ -5684,20 +5683,34 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5684
5683
|
)
|
|
5685
5684
|
};
|
|
5686
5685
|
const getUserContext = (async () => {
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5686
|
+
if (config.enabled) {
|
|
5687
|
+
try {
|
|
5688
|
+
const token = await resolveAuthToken({
|
|
5689
|
+
...context.options
|
|
5690
|
+
});
|
|
5691
|
+
if (token) {
|
|
5692
|
+
return extractUserIdsFromJwt(token);
|
|
5693
|
+
}
|
|
5694
|
+
} catch {
|
|
5693
5695
|
}
|
|
5694
|
-
} catch {
|
|
5695
5696
|
}
|
|
5696
5697
|
return { customuser_id: null, account_id: null };
|
|
5697
5698
|
})();
|
|
5698
5699
|
const startupTime = Date.now();
|
|
5699
5700
|
let shutdownStartTime = null;
|
|
5700
5701
|
let closed = false;
|
|
5702
|
+
const pendingEmissions = /* @__PURE__ */ new Set();
|
|
5703
|
+
function trackEmission(promise) {
|
|
5704
|
+
pendingEmissions.add(promise);
|
|
5705
|
+
promise.finally(() => {
|
|
5706
|
+
pendingEmissions.delete(promise);
|
|
5707
|
+
});
|
|
5708
|
+
}
|
|
5709
|
+
async function flush() {
|
|
5710
|
+
while (pendingEmissions.size > 0) {
|
|
5711
|
+
await Promise.allSettled([...pendingEmissions]);
|
|
5712
|
+
}
|
|
5713
|
+
}
|
|
5701
5714
|
if (!config.enabled) {
|
|
5702
5715
|
return {
|
|
5703
5716
|
context: {
|
|
@@ -5718,6 +5731,8 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5718
5731
|
}),
|
|
5719
5732
|
emitMethodCalled: () => {
|
|
5720
5733
|
},
|
|
5734
|
+
flush: async () => {
|
|
5735
|
+
},
|
|
5721
5736
|
close: async () => {
|
|
5722
5737
|
}
|
|
5723
5738
|
}
|
|
@@ -5752,11 +5767,13 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5752
5767
|
const startupEvent = buildApplicationLifecycleEvent({
|
|
5753
5768
|
lifecycle_event_type: "startup"
|
|
5754
5769
|
});
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5770
|
+
trackEmission(
|
|
5771
|
+
silentEmit(
|
|
5772
|
+
transport,
|
|
5773
|
+
APPLICATION_LIFECYCLE_EVENT_SUBJECT,
|
|
5774
|
+
startupEvent,
|
|
5775
|
+
getUserContext
|
|
5776
|
+
)
|
|
5760
5777
|
);
|
|
5761
5778
|
if (typeof process?.on === "function") {
|
|
5762
5779
|
removeExistingListeners();
|
|
@@ -5771,11 +5788,13 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5771
5788
|
is_graceful_shutdown: code === 0,
|
|
5772
5789
|
shutdown_duration_ms: shutdownDuration
|
|
5773
5790
|
});
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5791
|
+
trackEmission(
|
|
5792
|
+
silentEmit(
|
|
5793
|
+
transport,
|
|
5794
|
+
APPLICATION_LIFECYCLE_EVENT_SUBJECT,
|
|
5795
|
+
exitEvent,
|
|
5796
|
+
getUserContext
|
|
5797
|
+
)
|
|
5779
5798
|
);
|
|
5780
5799
|
};
|
|
5781
5800
|
registeredListeners.exit = exitHandler;
|
|
@@ -5864,6 +5883,7 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5864
5883
|
const close = async (exitCode) => {
|
|
5865
5884
|
if (closed) return;
|
|
5866
5885
|
closed = true;
|
|
5886
|
+
await flush();
|
|
5867
5887
|
const uptime = Date.now() - startupTime;
|
|
5868
5888
|
const shutdownDuration = shutdownStartTime ? Date.now() - shutdownStartTime : null;
|
|
5869
5889
|
let exitEvent = buildApplicationLifecycleEvent({
|
|
@@ -5891,7 +5911,7 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5891
5911
|
transport,
|
|
5892
5912
|
config,
|
|
5893
5913
|
emit: (subject, event) => {
|
|
5894
|
-
silentEmit(transport, subject, event, getUserContext);
|
|
5914
|
+
trackEmission(silentEmit(transport, subject, event, getUserContext));
|
|
5895
5915
|
},
|
|
5896
5916
|
createBaseEvent: createBaseEventHelper,
|
|
5897
5917
|
emitMethodCalled: (data) => {
|
|
@@ -5899,13 +5919,16 @@ var eventEmissionPlugin = ({ context }) => {
|
|
|
5899
5919
|
...buildMethodCalledEvent(data),
|
|
5900
5920
|
call_context: config.callContext ?? "sdk"
|
|
5901
5921
|
};
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5922
|
+
trackEmission(
|
|
5923
|
+
silentEmit(
|
|
5924
|
+
transport,
|
|
5925
|
+
METHOD_CALLED_EVENT_SUBJECT,
|
|
5926
|
+
event,
|
|
5927
|
+
getUserContext
|
|
5928
|
+
)
|
|
5907
5929
|
);
|
|
5908
5930
|
},
|
|
5931
|
+
flush,
|
|
5909
5932
|
close
|
|
5910
5933
|
}
|
|
5911
5934
|
}
|
|
@@ -25,6 +25,7 @@ export interface EventEmissionContext {
|
|
|
25
25
|
emit<T extends any>(subject: string, event: T): void;
|
|
26
26
|
createBaseEvent(): Promise<BaseEvent>;
|
|
27
27
|
emitMethodCalled(data: MethodCalledEventData): void;
|
|
28
|
+
flush(): Promise<void>;
|
|
28
29
|
close(exitCode?: number): Promise<void>;
|
|
29
30
|
};
|
|
30
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa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,MAAM,EAAE,mBAAmB,CAAC;QAE5B,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;QAErD,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;QAEtC,gBAAgB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAC;QAEpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QAIvB,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACzC,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AA+ED,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,EAAE,EACF;IACE,OAAO,EAAE;QACP,aAAa,CAAC,EAAE,mBAAmB,CAAC;QACpC,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,EACD,qBAAqB,CAmVtB,CAAC;AAGF,YAAY,EACV,YAAY,EACZ,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,eAAe,EACf,eAAe,EACf,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,cAAc,SAAS,CAAC"}
|
|
@@ -39,8 +39,6 @@ export function cleanupEventListeners() {
|
|
|
39
39
|
const APPLICATION_LIFECYCLE_EVENT_SUBJECT = "platform.sdk.ApplicationLifecycleEvent";
|
|
40
40
|
const ERROR_OCCURRED_EVENT_SUBJECT = "platform.sdk.ErrorOccurredEvent";
|
|
41
41
|
const METHOD_CALLED_EVENT_SUBJECT = "platform.sdk.MethodCalledEvent";
|
|
42
|
-
// Track transport success/failure so we only log failure once.
|
|
43
|
-
const transportStates = new WeakMap();
|
|
44
42
|
async function emitWithTimeout(transport, subject, event) {
|
|
45
43
|
try {
|
|
46
44
|
await Promise.race([
|
|
@@ -57,42 +55,19 @@ async function emitWithTimeout(transport, subject, event) {
|
|
|
57
55
|
// Silently ignore telemetry failures
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
|
-
// Silent emission wrapper with smart first-failure logging
|
|
61
58
|
async function silentEmit(transport, subject, event, userContextPromise) {
|
|
62
59
|
try {
|
|
63
|
-
// Get or initialize state for this transport
|
|
64
|
-
let state = transportStates.get(transport);
|
|
65
|
-
if (!state) {
|
|
66
|
-
state = { hasWorked: false, hasLoggedFailure: false };
|
|
67
|
-
transportStates.set(transport, state);
|
|
68
|
-
}
|
|
69
|
-
// Resolve user context and merge into event
|
|
70
60
|
let enrichedEvent = event;
|
|
71
61
|
if (userContextPromise) {
|
|
72
62
|
try {
|
|
73
63
|
const userContext = await userContextPromise;
|
|
74
|
-
// Use Object.assign to safely merge user context into event
|
|
75
64
|
enrichedEvent = Object.assign({}, event, userContext);
|
|
76
65
|
}
|
|
77
66
|
catch {
|
|
78
67
|
// If user context promise fails, continue with original event
|
|
79
68
|
}
|
|
80
69
|
}
|
|
81
|
-
|
|
82
|
-
transport
|
|
83
|
-
.emit(subject, enrichedEvent)
|
|
84
|
-
.then(() => {
|
|
85
|
-
// Mark as working if any emit succeeds
|
|
86
|
-
state.hasWorked = true;
|
|
87
|
-
})
|
|
88
|
-
.catch((error) => {
|
|
89
|
-
// Only log if we haven't seen it work and haven't logged yet
|
|
90
|
-
if (!state.hasWorked && !state.hasLoggedFailure) {
|
|
91
|
-
state.hasLoggedFailure = true;
|
|
92
|
-
console.warn(`[zapier-sdk] Tracking failed: ${error.message || "Unknown error"}`);
|
|
93
|
-
console.warn(`[zapier-sdk] Hint: Set trackingBaseUrl parameter or ZAPIER_TRACKING_BASE_URL environment variable if using custom domains`);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
70
|
+
await transport.emit(subject, enrichedEvent);
|
|
96
71
|
}
|
|
97
72
|
catch {
|
|
98
73
|
// Silently ignore all errors
|
|
@@ -136,22 +111,36 @@ export const eventEmissionPlugin = ({ context }) => {
|
|
|
136
111
|
};
|
|
137
112
|
// Create getUserContext promise for dynamic user context injection
|
|
138
113
|
const getUserContext = (async () => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
114
|
+
if (config.enabled) {
|
|
115
|
+
try {
|
|
116
|
+
const token = await resolveAuthToken({
|
|
117
|
+
...context.options,
|
|
118
|
+
});
|
|
119
|
+
if (token) {
|
|
120
|
+
return extractUserIdsFromJwt(token);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
// Fall back to null context on any error
|
|
145
125
|
}
|
|
146
|
-
}
|
|
147
|
-
catch {
|
|
148
|
-
// Fall back to null context on any error
|
|
149
126
|
}
|
|
150
127
|
return { customuser_id: null, account_id: null };
|
|
151
128
|
})();
|
|
152
129
|
const startupTime = Date.now();
|
|
153
130
|
let shutdownStartTime = null;
|
|
154
131
|
let closed = false;
|
|
132
|
+
const pendingEmissions = new Set();
|
|
133
|
+
function trackEmission(promise) {
|
|
134
|
+
pendingEmissions.add(promise);
|
|
135
|
+
promise.finally(() => {
|
|
136
|
+
pendingEmissions.delete(promise);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
async function flush() {
|
|
140
|
+
while (pendingEmissions.size > 0) {
|
|
141
|
+
await Promise.allSettled([...pendingEmissions]);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
155
144
|
// If disabled, return noop implementations
|
|
156
145
|
if (!config.enabled) {
|
|
157
146
|
return {
|
|
@@ -171,6 +160,7 @@ export const eventEmissionPlugin = ({ context }) => {
|
|
|
171
160
|
correlation_id: null,
|
|
172
161
|
}),
|
|
173
162
|
emitMethodCalled: () => { },
|
|
163
|
+
flush: async () => { },
|
|
174
164
|
close: async () => { },
|
|
175
165
|
},
|
|
176
166
|
},
|
|
@@ -212,7 +202,7 @@ export const eventEmissionPlugin = ({ context }) => {
|
|
|
212
202
|
const startupEvent = buildApplicationLifecycleEvent({
|
|
213
203
|
lifecycle_event_type: "startup",
|
|
214
204
|
});
|
|
215
|
-
silentEmit(transport, APPLICATION_LIFECYCLE_EVENT_SUBJECT, startupEvent, getUserContext);
|
|
205
|
+
trackEmission(silentEmit(transport, APPLICATION_LIFECYCLE_EVENT_SUBJECT, startupEvent, getUserContext));
|
|
216
206
|
// Register process event handlers (Node.js only)
|
|
217
207
|
if (typeof process?.on === "function") {
|
|
218
208
|
// Remove any existing listeners from previous SDK instances to prevent memory leaks
|
|
@@ -232,7 +222,7 @@ export const eventEmissionPlugin = ({ context }) => {
|
|
|
232
222
|
is_graceful_shutdown: code === 0,
|
|
233
223
|
shutdown_duration_ms: shutdownDuration,
|
|
234
224
|
});
|
|
235
|
-
silentEmit(transport, APPLICATION_LIFECYCLE_EVENT_SUBJECT, exitEvent, getUserContext);
|
|
225
|
+
trackEmission(silentEmit(transport, APPLICATION_LIFECYCLE_EVENT_SUBJECT, exitEvent, getUserContext));
|
|
236
226
|
};
|
|
237
227
|
registeredListeners.exit = exitHandler;
|
|
238
228
|
process.on("exit", exitHandler);
|
|
@@ -327,6 +317,7 @@ export const eventEmissionPlugin = ({ context }) => {
|
|
|
327
317
|
if (closed)
|
|
328
318
|
return;
|
|
329
319
|
closed = true;
|
|
320
|
+
await flush();
|
|
330
321
|
const uptime = Date.now() - startupTime;
|
|
331
322
|
const shutdownDuration = shutdownStartTime
|
|
332
323
|
? Date.now() - shutdownStartTime
|
|
@@ -354,7 +345,7 @@ export const eventEmissionPlugin = ({ context }) => {
|
|
|
354
345
|
transport,
|
|
355
346
|
config,
|
|
356
347
|
emit: (subject, event) => {
|
|
357
|
-
silentEmit(transport, subject, event, getUserContext);
|
|
348
|
+
trackEmission(silentEmit(transport, subject, event, getUserContext));
|
|
358
349
|
},
|
|
359
350
|
createBaseEvent: createBaseEventHelper,
|
|
360
351
|
emitMethodCalled: (data) => {
|
|
@@ -362,8 +353,9 @@ export const eventEmissionPlugin = ({ context }) => {
|
|
|
362
353
|
...buildMethodCalledEvent(data),
|
|
363
354
|
call_context: config.callContext ?? "sdk",
|
|
364
355
|
};
|
|
365
|
-
silentEmit(transport, METHOD_CALLED_EVENT_SUBJECT, event, getUserContext);
|
|
356
|
+
trackEmission(silentEmit(transport, METHOD_CALLED_EVENT_SUBJECT, event, getUserContext));
|
|
366
357
|
},
|
|
358
|
+
flush,
|
|
367
359
|
close,
|
|
368
360
|
},
|
|
369
361
|
},
|
|
@@ -71,8 +71,7 @@ describe("eventEmissionPlugin", () => {
|
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
});
|
|
74
|
-
|
|
75
|
-
await plugin.context.eventEmission.createBaseEvent();
|
|
74
|
+
await plugin.context.eventEmission.flush();
|
|
76
75
|
// Clear startup event calls so we only assert on our test event
|
|
77
76
|
mockTransport.emit.mockClear();
|
|
78
77
|
const testEvent = {
|
|
@@ -81,8 +80,7 @@ describe("eventEmissionPlugin", () => {
|
|
|
81
80
|
};
|
|
82
81
|
const testSubject = "test.event.TestEvent";
|
|
83
82
|
plugin.context.eventEmission.emit(testSubject, testEvent);
|
|
84
|
-
|
|
85
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
83
|
+
await plugin.context.eventEmission.flush();
|
|
86
84
|
// The event will be enriched with user context (null values)
|
|
87
85
|
expect(mockTransport.emit).toHaveBeenCalledWith(testSubject, {
|
|
88
86
|
...testEvent,
|
|
@@ -132,116 +130,16 @@ describe("eventEmissionPlugin", () => {
|
|
|
132
130
|
},
|
|
133
131
|
},
|
|
134
132
|
});
|
|
133
|
+
await plugin.context.eventEmission.flush();
|
|
135
134
|
// Should not throw even if transport fails
|
|
136
135
|
expect(() => {
|
|
137
136
|
plugin.context.eventEmission.emit("test.event.TestEvent", {
|
|
138
137
|
test_event: "data",
|
|
139
138
|
});
|
|
140
139
|
}).not.toThrow();
|
|
141
|
-
|
|
142
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
140
|
+
await plugin.context.eventEmission.flush();
|
|
143
141
|
expect(failingTransport.emit).toHaveBeenCalled();
|
|
144
142
|
});
|
|
145
|
-
it("should log tracking failure only on first occurrence", async () => {
|
|
146
|
-
// Mock console.warn to track logging calls
|
|
147
|
-
const mockConsoleWarn = vi
|
|
148
|
-
.spyOn(console, "warn")
|
|
149
|
-
.mockImplementation(() => { });
|
|
150
|
-
// Mock transport to throw error
|
|
151
|
-
const failingTransport = {
|
|
152
|
-
emit: vi.fn().mockRejectedValue(new Error("Network error")),
|
|
153
|
-
close: vi.fn().mockResolvedValue(undefined),
|
|
154
|
-
};
|
|
155
|
-
vi.mocked(createTransport).mockReturnValueOnce(failingTransport);
|
|
156
|
-
const plugin = eventEmissionPlugin({
|
|
157
|
-
sdk: {},
|
|
158
|
-
context: {
|
|
159
|
-
meta: {},
|
|
160
|
-
options: {
|
|
161
|
-
eventEmission: {
|
|
162
|
-
enabled: true,
|
|
163
|
-
transport: {
|
|
164
|
-
type: "http",
|
|
165
|
-
endpoint: "https://example.com",
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
// First event should trigger logging
|
|
172
|
-
plugin.context.eventEmission.emit("test.event.FirstEvent", {
|
|
173
|
-
data: "first",
|
|
174
|
-
});
|
|
175
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
176
|
-
// Verify logging occurred
|
|
177
|
-
const initialLogCount = mockConsoleWarn.mock.calls.length;
|
|
178
|
-
expect(initialLogCount).toBeGreaterThan(0);
|
|
179
|
-
// Second and third events should not trigger additional logging
|
|
180
|
-
plugin.context.eventEmission.emit("test.event.SecondEvent", {
|
|
181
|
-
data: "second",
|
|
182
|
-
});
|
|
183
|
-
plugin.context.eventEmission.emit("test.event.ThirdEvent", {
|
|
184
|
-
data: "third",
|
|
185
|
-
});
|
|
186
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
187
|
-
// Verify no additional logging occurred
|
|
188
|
-
expect(mockConsoleWarn).toHaveBeenCalledTimes(initialLogCount);
|
|
189
|
-
mockConsoleWarn.mockRestore();
|
|
190
|
-
});
|
|
191
|
-
it("should not log failures after a successful emit", async () => {
|
|
192
|
-
// Mock console.warn to track logging calls
|
|
193
|
-
const mockConsoleWarn = vi
|
|
194
|
-
.spyOn(console, "warn")
|
|
195
|
-
.mockImplementation(() => { });
|
|
196
|
-
// Mock transport that succeeds first, then fails
|
|
197
|
-
let callCount = 0;
|
|
198
|
-
const mixedTransport = {
|
|
199
|
-
emit: vi.fn().mockImplementation(() => {
|
|
200
|
-
callCount++;
|
|
201
|
-
if (callCount === 1) {
|
|
202
|
-
return Promise.resolve(); // First call succeeds
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
return Promise.reject(new Error("Network error")); // Subsequent calls fail
|
|
206
|
-
}
|
|
207
|
-
}),
|
|
208
|
-
close: vi.fn().mockResolvedValue(undefined),
|
|
209
|
-
};
|
|
210
|
-
vi.mocked(createTransport).mockReturnValueOnce(mixedTransport);
|
|
211
|
-
const plugin = eventEmissionPlugin({
|
|
212
|
-
sdk: {},
|
|
213
|
-
context: {
|
|
214
|
-
meta: {},
|
|
215
|
-
options: {
|
|
216
|
-
eventEmission: {
|
|
217
|
-
enabled: true,
|
|
218
|
-
transport: {
|
|
219
|
-
type: "http",
|
|
220
|
-
endpoint: "https://example.com",
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
});
|
|
226
|
-
// First emit should succeed
|
|
227
|
-
plugin.context.eventEmission.emit("test.event.SuccessfulEvent", {
|
|
228
|
-
data: "success",
|
|
229
|
-
});
|
|
230
|
-
// Give time for success to be recorded
|
|
231
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
232
|
-
// Subsequent emits should fail but not log
|
|
233
|
-
plugin.context.eventEmission.emit("test.event.FailingEvent1", {
|
|
234
|
-
data: "fail1",
|
|
235
|
-
});
|
|
236
|
-
plugin.context.eventEmission.emit("test.event.FailingEvent2", {
|
|
237
|
-
data: "fail2",
|
|
238
|
-
});
|
|
239
|
-
// Give async emissions time to complete
|
|
240
|
-
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
241
|
-
// Should not have logged any warnings because tracking worked initially
|
|
242
|
-
expect(mockConsoleWarn).toHaveBeenCalledTimes(0);
|
|
243
|
-
mockConsoleWarn.mockRestore();
|
|
244
|
-
});
|
|
245
143
|
it("should merge options with defaults", () => {
|
|
246
144
|
// Override env var to ensure proper transport is used
|
|
247
145
|
vi.stubEnv("ZAPIER_SDK_TELEMETRY_TRANSPORT", undefined);
|
|
@@ -611,7 +509,7 @@ describe("emitMethodCalled call_context", () => {
|
|
|
611
509
|
success_flag: true,
|
|
612
510
|
argument_count: 0,
|
|
613
511
|
});
|
|
614
|
-
await
|
|
512
|
+
await plugin.context.eventEmission.flush();
|
|
615
513
|
expect(mockTransport.emit).toHaveBeenCalledWith("platform.sdk.MethodCalledEvent", expect.objectContaining({ call_context: "sdk" }));
|
|
616
514
|
});
|
|
617
515
|
it("should set call_context to 'cli' when callContext is 'cli'", async () => {
|
|
@@ -634,7 +532,7 @@ describe("emitMethodCalled call_context", () => {
|
|
|
634
532
|
success_flag: true,
|
|
635
533
|
argument_count: 0,
|
|
636
534
|
});
|
|
637
|
-
await
|
|
535
|
+
await plugin.context.eventEmission.flush();
|
|
638
536
|
expect(mockTransport.emit).toHaveBeenCalledWith("platform.sdk.MethodCalledEvent", expect.objectContaining({ call_context: "cli" }));
|
|
639
537
|
});
|
|
640
538
|
it("should set call_context to 'mcp' when callContext is 'mcp'", async () => {
|
|
@@ -657,7 +555,7 @@ describe("emitMethodCalled call_context", () => {
|
|
|
657
555
|
success_flag: true,
|
|
658
556
|
argument_count: 0,
|
|
659
557
|
});
|
|
660
|
-
await
|
|
558
|
+
await plugin.context.eventEmission.flush();
|
|
661
559
|
expect(mockTransport.emit).toHaveBeenCalledWith("platform.sdk.MethodCalledEvent", expect.objectContaining({ call_context: "mcp" }));
|
|
662
560
|
});
|
|
663
561
|
});
|
|
@@ -39,7 +39,7 @@ export interface EnhancedErrorEventData extends ErrorEventData {
|
|
|
39
39
|
execution_start_time?: number | null;
|
|
40
40
|
}
|
|
41
41
|
export interface ApplicationLifecycleEventData {
|
|
42
|
-
lifecycle_event_type: "startup" | "exit" | "signal_termination";
|
|
42
|
+
lifecycle_event_type: "startup" | "exit" | "signal_termination" | "login_success";
|
|
43
43
|
exit_code?: number | null;
|
|
44
44
|
signal_name?: string | null;
|
|
45
45
|
uptime_ms?: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WA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AAqB,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionId.d.ts","sourceRoot":"","sources":["../../src/resolvers/connectionId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"connectionId.d.ts","sourceRoot":"","sources":["../../src/resolvers/connectionId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,KAAK,oBAAoB,GAAG,eAAe,CACzC,cAAc,EACd;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CACpB,CAAC;AAoDF,eAAO,MAAM,oBAAoB,EAAE,oBAiBlC,CAAC;AAIF,eAAO,MAAM,2BAA2B,EAAE,oBAKzC,CAAC"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return [...myConnections.data, ...otherConnections];
|
|
19
|
-
},
|
|
20
|
-
prompt: (connections, params) => ({
|
|
1
|
+
async function fetchConnections(sdk, resolvedParams) {
|
|
2
|
+
const listOptions = {
|
|
3
|
+
maxItems: 1000,
|
|
4
|
+
};
|
|
5
|
+
if (resolvedParams.appKey) {
|
|
6
|
+
listOptions.appKey = resolvedParams.appKey;
|
|
7
|
+
}
|
|
8
|
+
const myConnections = await sdk.listConnections({
|
|
9
|
+
...listOptions,
|
|
10
|
+
owner: "me",
|
|
11
|
+
});
|
|
12
|
+
const allConnections = await sdk.listConnections(listOptions);
|
|
13
|
+
const otherConnections = allConnections.data.filter((connection) => !myConnections.data.some((myConnection) => myConnection.id === connection.id));
|
|
14
|
+
return [...myConnections.data, ...otherConnections];
|
|
15
|
+
}
|
|
16
|
+
function promptForConnection(connections, params) {
|
|
17
|
+
return {
|
|
21
18
|
type: "list",
|
|
22
19
|
name: "connectionId",
|
|
23
20
|
message: params.appKey
|
|
@@ -33,10 +30,33 @@ export const connectionIdResolver = {
|
|
|
33
30
|
value: null,
|
|
34
31
|
},
|
|
35
32
|
],
|
|
36
|
-
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export const connectionIdResolver = {
|
|
36
|
+
type: "dynamic",
|
|
37
|
+
depends: ["appKey"],
|
|
38
|
+
tryResolveWithoutPrompt: async (sdk, params) => {
|
|
39
|
+
if (!params.appKey)
|
|
40
|
+
return null;
|
|
41
|
+
try {
|
|
42
|
+
const app = await sdk.getApp({ appKey: params.appKey });
|
|
43
|
+
if (!app.data.auth_type) {
|
|
44
|
+
return { resolvedValue: null };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// If we can't determine auth type, fall through to normal connection prompt
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
},
|
|
52
|
+
fetch: fetchConnections,
|
|
53
|
+
prompt: promptForConnection,
|
|
37
54
|
};
|
|
38
|
-
// Generic version without appKey dependency
|
|
55
|
+
// Generic version without appKey dependency. tryResolveWithoutPrompt is intentionally
|
|
56
|
+
// absent: without appKey we cannot look up auth_type to determine if auth is required.
|
|
39
57
|
export const connectionIdGenericResolver = {
|
|
40
|
-
|
|
58
|
+
type: "dynamic",
|
|
41
59
|
depends: [],
|
|
60
|
+
fetch: fetchConnections,
|
|
61
|
+
prompt: promptForConnection,
|
|
42
62
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectionId.test.d.ts","sourceRoot":"","sources":["../../src/resolvers/connectionId.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeAll } from "vitest";
|
|
2
|
+
import { connectionIdResolver } from "./connectionId";
|
|
3
|
+
describe("connectionIdResolver.tryResolveWithoutPrompt", () => {
|
|
4
|
+
let tryResolveWithoutPrompt;
|
|
5
|
+
beforeAll(() => {
|
|
6
|
+
if (!connectionIdResolver.tryResolveWithoutPrompt) {
|
|
7
|
+
throw new Error("connectionIdResolver.tryResolveWithoutPrompt is not defined");
|
|
8
|
+
}
|
|
9
|
+
tryResolveWithoutPrompt = connectionIdResolver.tryResolveWithoutPrompt;
|
|
10
|
+
});
|
|
11
|
+
it("returns null when no appKey is provided, deferring to the normal prompt", async () => {
|
|
12
|
+
const result = await tryResolveWithoutPrompt({}, {});
|
|
13
|
+
expect(result).toBeNull();
|
|
14
|
+
});
|
|
15
|
+
it("returns { resolvedValue: null } when the app has no auth_type, skipping the connection prompt", async () => {
|
|
16
|
+
const mockSdk = {
|
|
17
|
+
getApp: vi.fn().mockResolvedValue({ data: { auth_type: null } }),
|
|
18
|
+
};
|
|
19
|
+
const result = await tryResolveWithoutPrompt(mockSdk, {
|
|
20
|
+
appKey: "web-search-by-zapier",
|
|
21
|
+
});
|
|
22
|
+
expect(mockSdk.getApp).toHaveBeenCalledWith({
|
|
23
|
+
appKey: "web-search-by-zapier",
|
|
24
|
+
});
|
|
25
|
+
expect(result).toEqual({ resolvedValue: null });
|
|
26
|
+
});
|
|
27
|
+
it("returns { resolvedValue: null } when auth_type is absent from the app data", async () => {
|
|
28
|
+
const mockSdk = {
|
|
29
|
+
getApp: vi.fn().mockResolvedValue({ data: {} }),
|
|
30
|
+
};
|
|
31
|
+
const result = await tryResolveWithoutPrompt(mockSdk, {
|
|
32
|
+
appKey: "web-search-by-zapier",
|
|
33
|
+
});
|
|
34
|
+
expect(result).toEqual({ resolvedValue: null });
|
|
35
|
+
});
|
|
36
|
+
it("returns { resolvedValue: null } when auth_type is an empty string", async () => {
|
|
37
|
+
const mockSdk = {
|
|
38
|
+
getApp: vi.fn().mockResolvedValue({ data: { auth_type: "" } }),
|
|
39
|
+
};
|
|
40
|
+
const result = await tryResolveWithoutPrompt(mockSdk, {
|
|
41
|
+
appKey: "formatter",
|
|
42
|
+
});
|
|
43
|
+
expect(result).toEqual({ resolvedValue: null });
|
|
44
|
+
});
|
|
45
|
+
it("returns null for an app with auth_type set, allowing the connection picker to appear", async () => {
|
|
46
|
+
const mockSdk = {
|
|
47
|
+
getApp: vi.fn().mockResolvedValue({ data: { auth_type: "oauth" } }),
|
|
48
|
+
};
|
|
49
|
+
const result = await tryResolveWithoutPrompt(mockSdk, { appKey: "slack" });
|
|
50
|
+
expect(result).toBeNull();
|
|
51
|
+
});
|
|
52
|
+
it("returns null when getApp throws, falling back gracefully to the normal connection prompt", async () => {
|
|
53
|
+
const mockSdk = {
|
|
54
|
+
getApp: vi.fn().mockRejectedValue(new Error("App not found")),
|
|
55
|
+
};
|
|
56
|
+
const result = await tryResolveWithoutPrompt(mockSdk, {
|
|
57
|
+
appKey: "unknown-app",
|
|
58
|
+
});
|
|
59
|
+
expect(result).toBeNull();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -45,7 +45,7 @@ export interface ErrorOccurredEvent extends BaseEvent {
|
|
|
45
45
|
execution_time_before_error_ms?: number | null;
|
|
46
46
|
}
|
|
47
47
|
export interface ApplicationLifecycleEvent extends BaseEvent {
|
|
48
|
-
lifecycle_event_type: "startup" | "exit" | "signal_termination";
|
|
48
|
+
lifecycle_event_type: "startup" | "exit" | "signal_termination" | "login_success";
|
|
49
49
|
selected_api?: string | null;
|
|
50
50
|
app_id?: number | null;
|
|
51
51
|
app_version_id?: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-events.d.ts","sourceRoot":"","sources":["../../src/types/telemetry-events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAGD,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iBAAiB,CAAC,EAAE,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IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAGD,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,yBAAyB,GACzB,iBAAiB,CAAC;AAGtB,MAAM,MAAM,kBAAkB,GAC1B,gBAAgB,GAChB,uBAAuB,GACvB,eAAe,CAAC"}
|
|
@@ -47,6 +47,16 @@ export interface DynamicResolver<TItem = unknown, TParams = Record<string, unkno
|
|
|
47
47
|
type: "dynamic";
|
|
48
48
|
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => Promise<TItem[]>;
|
|
49
49
|
prompt: (items: TItem[], params: TParams) => PromptConfig;
|
|
50
|
+
/**
|
|
51
|
+
* Optional hook called before fetch/prompt. If it returns a non-null object,
|
|
52
|
+
* resolvedValue is used directly and fetch/prompt are skipped entirely. Return
|
|
53
|
+
* null to fall through to the normal resolution flow. Implementations should
|
|
54
|
+
* catch their own errors and return null on failure rather than throwing, so
|
|
55
|
+
* that a transient API error does not block the CLI entirely.
|
|
56
|
+
*/
|
|
57
|
+
tryResolveWithoutPrompt?: (sdk: ZapierSdk, params: TParams) => Promise<{
|
|
58
|
+
resolvedValue: unknown;
|
|
59
|
+
} | null>;
|
|
50
60
|
}
|
|
51
61
|
export interface FieldsResolver<TParams = Record<string, unknown>> extends Resolver {
|
|
52
62
|
type: "fields";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-utils.d.ts","sourceRoot":"","sources":["../../src/utils/schema-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,C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
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.4",
|
|
4
4
|
"description": "Complete Zapier SDK - combines all Zapier SDK packages",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"tsup": "^8.5.0",
|
|
46
46
|
"typescript": "^5.8.3",
|
|
47
47
|
"vitest": "^3.2.3",
|
|
48
|
-
"@zapier/zapier-sdk-cli-login": "0.8.
|
|
48
|
+
"@zapier/zapier-sdk-cli-login": "0.8.1"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup",
|