@zapier/zapier-sdk 0.26.0 → 0.27.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 +6 -0
- package/CLAUDE.md +6 -6
- package/README.md +217 -222
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/types.d.ts +3 -3
- package/dist/api/types.d.ts.map +1 -1
- package/dist/index.cjs +367 -216
- package/dist/index.d.mts +171 -91
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +359 -211
- package/dist/plugins/apps/index.d.ts.map +1 -1
- package/dist/plugins/apps/index.js +20 -13
- package/dist/plugins/apps/schemas.d.ts +6 -2
- package/dist/plugins/apps/schemas.d.ts.map +1 -1
- package/dist/plugins/apps/schemas.js +7 -3
- package/dist/plugins/deprecated/authentications.d.ts +79 -0
- package/dist/plugins/deprecated/authentications.d.ts.map +1 -0
- package/dist/plugins/deprecated/authentications.js +90 -0
- package/dist/plugins/fetch/index.d.ts +4 -0
- package/dist/plugins/fetch/index.d.ts.map +1 -1
- package/dist/plugins/fetch/index.js +7 -4
- package/dist/plugins/fetch/schemas.d.ts +1 -0
- package/dist/plugins/fetch/schemas.d.ts.map +1 -1
- package/dist/plugins/fetch/schemas.js +3 -1
- package/dist/plugins/findFirstConnection/index.d.ts +21 -0
- package/dist/plugins/findFirstConnection/index.d.ts.map +1 -0
- package/dist/plugins/findFirstConnection/index.js +37 -0
- package/dist/plugins/findFirstConnection/index.test.d.ts.map +1 -0
- package/dist/plugins/{findFirstAuthentication → findFirstConnection}/index.test.js +43 -43
- package/dist/plugins/findFirstConnection/schemas.d.ts +22 -0
- package/dist/plugins/findFirstConnection/schemas.d.ts.map +1 -0
- package/dist/plugins/findFirstConnection/schemas.js +8 -0
- package/dist/plugins/findUniqueConnection/index.d.ts +21 -0
- package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -0
- package/dist/plugins/findUniqueConnection/index.js +40 -0
- package/dist/plugins/findUniqueConnection/index.test.d.ts.map +1 -0
- package/dist/plugins/{findUniqueAuthentication → findUniqueConnection}/index.test.js +41 -41
- package/dist/plugins/findUniqueConnection/schemas.d.ts +22 -0
- package/dist/plugins/findUniqueConnection/schemas.d.ts.map +1 -0
- package/dist/plugins/findUniqueConnection/schemas.js +8 -0
- package/dist/plugins/getApp/index.js +2 -2
- package/dist/plugins/getConnection/index.d.ts +22 -0
- package/dist/plugins/getConnection/index.d.ts.map +1 -0
- package/dist/plugins/getConnection/index.js +35 -0
- package/dist/plugins/getConnection/index.test.d.ts.map +1 -0
- package/dist/plugins/{getAuthentication → getConnection}/index.test.js +46 -28
- package/dist/plugins/getConnection/schemas.d.ts +13 -0
- package/dist/plugins/getConnection/schemas.d.ts.map +1 -0
- package/dist/plugins/getConnection/schemas.js +8 -0
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/index.js +7 -4
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts +1 -0
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/schemas.js +6 -2
- package/dist/plugins/listApps/schemas.js +2 -2
- package/dist/plugins/listClientCredentials/schemas.js +2 -2
- package/dist/plugins/listConnections/index.d.ts +24 -0
- package/dist/plugins/listConnections/index.d.ts.map +1 -0
- package/dist/plugins/{listAuthentications → listConnections}/index.js +28 -21
- package/dist/plugins/listConnections/index.test.d.ts.map +1 -0
- package/dist/plugins/{listAuthentications → listConnections}/index.test.js +219 -198
- package/dist/plugins/{listAuthentications → listConnections}/schemas.d.ts +11 -10
- package/dist/plugins/listConnections/schemas.d.ts.map +1 -0
- package/dist/plugins/listConnections/schemas.js +47 -0
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.js +8 -5
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +1 -0
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/schemas.js +3 -1
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +7 -4
- package/dist/plugins/listInputFields/schemas.d.ts +1 -0
- package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFields/schemas.js +3 -1
- package/dist/plugins/manifest/schemas.d.ts +2 -0
- package/dist/plugins/manifest/schemas.d.ts.map +1 -1
- package/dist/plugins/manifest/schemas.js +3 -1
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +3 -2
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +5 -2
- package/dist/plugins/request/schemas.d.ts +2 -0
- package/dist/plugins/request/schemas.d.ts.map +1 -1
- package/dist/plugins/request/schemas.js +3 -1
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +12 -8
- package/dist/plugins/runAction/schemas.d.ts +1 -0
- package/dist/plugins/runAction/schemas.d.ts.map +1 -1
- package/dist/plugins/runAction/schemas.js +4 -2
- package/dist/resolvers/connectionId.d.ts +9 -0
- package/dist/resolvers/connectionId.d.ts.map +1 -0
- package/dist/resolvers/connectionId.js +42 -0
- package/dist/resolvers/index.d.ts +5 -1
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +6 -1
- package/dist/resolvers/inputFieldKey.d.ts +1 -1
- package/dist/resolvers/inputFieldKey.d.ts.map +1 -1
- package/dist/resolvers/inputFieldKey.js +2 -2
- package/dist/resolvers/inputs.d.ts +1 -1
- package/dist/resolvers/inputs.d.ts.map +1 -1
- package/dist/resolvers/inputs.js +4 -4
- package/dist/schemas/Connection.d.ts +29 -0
- package/dist/schemas/Connection.d.ts.map +1 -0
- package/dist/schemas/{Auth.js → Connection.js} +5 -7
- package/dist/sdk.d.ts +29 -7
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +12 -5
- package/dist/sdk.test.js +9 -8
- package/dist/services/implementations.d.ts +6 -6
- package/dist/services/implementations.d.ts.map +1 -1
- package/dist/services/implementations.js +10 -10
- package/dist/types/domain.d.ts +4 -4
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/properties.d.ts +5 -1
- package/dist/types/properties.d.ts.map +1 -1
- package/dist/types/properties.js +4 -2
- package/dist/types/sdk.d.ts +12 -9
- package/dist/types/sdk.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/plugins/findFirstAuthentication/index.d.ts +0 -21
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/index.js +0 -36
- package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/schemas.d.ts +0 -21
- package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/schemas.js +0 -8
- package/dist/plugins/findUniqueAuthentication/index.d.ts +0 -21
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/index.js +0 -39
- package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts +0 -21
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/schemas.js +0 -8
- package/dist/plugins/getAuthentication/index.d.ts +0 -21
- package/dist/plugins/getAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/index.js +0 -29
- package/dist/plugins/getAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/schemas.d.ts +0 -7
- package/dist/plugins/getAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/schemas.js +0 -1
- package/dist/plugins/listAuthentications/index.d.ts +0 -24
- package/dist/plugins/listAuthentications/index.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/index.test.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/schemas.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/schemas.js +0 -32
- package/dist/resolvers/authenticationId.d.ts +0 -9
- package/dist/resolvers/authenticationId.d.ts.map +0 -1
- package/dist/resolvers/authenticationId.js +0 -42
- package/dist/schemas/Auth.d.ts +0 -55
- package/dist/schemas/Auth.d.ts.map +0 -1
- /package/dist/plugins/{findFirstAuthentication → findFirstConnection}/index.test.d.ts +0 -0
- /package/dist/plugins/{findUniqueAuthentication → findUniqueConnection}/index.test.d.ts +0 -0
- /package/dist/plugins/{getAuthentication → getConnection}/index.test.d.ts +0 -0
- /package/dist/plugins/{listAuthentications → listConnections}/index.test.d.ts +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ListAppsQuerySchema, AppItemSchema as AppItemSchema$1 } from '@zapier/zapier-sdk-core/v0/schemas/apps';
|
|
3
|
-
import {
|
|
3
|
+
import { ListConnectionsQuerySchema as ListConnectionsQuerySchema$1, ConnectionItemSchema as ConnectionItemSchema$1 } from '@zapier/zapier-sdk-core/v0/schemas/connections';
|
|
4
4
|
import { ListClientCredentialsQuerySchema as ListClientCredentialsQuerySchema$1, CreateClientCredentialsRequestSchema, ClientCredentialsItemSchema as ClientCredentialsItemSchema$1, ClientCredentialsCreatedItemSchema as ClientCredentialsCreatedItemSchema$1 } from '@zapier/zapier-sdk-core/v0/schemas/client-credentials';
|
|
5
5
|
import { setTimeout as setTimeout$1 } from 'timers/promises';
|
|
6
6
|
import * as os from 'os';
|
|
@@ -62,7 +62,8 @@ var ActionTypePropertySchema = z.enum([
|
|
|
62
62
|
"filter"
|
|
63
63
|
]).describe("Action type that matches the action's defined type");
|
|
64
64
|
var ActionKeyPropertySchema = z.string().min(1).describe("Action key to execute");
|
|
65
|
-
var
|
|
65
|
+
var ConnectionIdPropertySchema = z.union([z.string(), z.number().int().positive()]).describe("Connection ID to use for this action");
|
|
66
|
+
var AuthenticationIdPropertySchema = ConnectionIdPropertySchema;
|
|
66
67
|
var InputsPropertySchema = z.record(z.string(), z.unknown()).describe("Input parameters for the action");
|
|
67
68
|
var LimitPropertySchema = z.number().int().min(1).max(MAX_PAGE_LIMIT).default(50).describe("Maximum number of items to return");
|
|
68
69
|
var OffsetPropertySchema = z.number().int().min(0).default(0).describe("Number of items to skip for pagination");
|
|
@@ -209,14 +210,18 @@ HTTP Status: ${error.statusCode}`;
|
|
|
209
210
|
}
|
|
210
211
|
var ActionExecutionInputSchema = z.object({
|
|
211
212
|
inputs: z.record(z.string(), z.unknown()).optional(),
|
|
213
|
+
connectionId: ConnectionIdPropertySchema.optional(),
|
|
214
|
+
/** @deprecated Use connectionId instead */
|
|
212
215
|
authenticationId: AuthenticationIdPropertySchema.optional(),
|
|
213
216
|
timeoutMs: ActionTimeoutMsPropertySchema
|
|
214
217
|
}).describe(
|
|
215
218
|
"Execute an action with the given inputs for the bound app, as an alternative to runAction"
|
|
216
219
|
);
|
|
217
220
|
var AppFactoryInputSchema = z.object({
|
|
218
|
-
|
|
219
|
-
|
|
221
|
+
connectionId: ConnectionIdPropertySchema.optional(),
|
|
222
|
+
/** @deprecated Use connectionId instead */
|
|
223
|
+
authenticationId: AuthenticationIdPropertySchema.optional()
|
|
224
|
+
}).describe("Bind a connection ID to an app");
|
|
220
225
|
function getStringProperty(obj, key) {
|
|
221
226
|
if (typeof obj === "object" && obj !== null && key in obj) {
|
|
222
227
|
const value = obj[key];
|
|
@@ -249,13 +254,14 @@ function createActionFunction(appKey, actionType, actionKey, options, pinnedAuth
|
|
|
249
254
|
const { sdk } = options;
|
|
250
255
|
const {
|
|
251
256
|
inputs,
|
|
257
|
+
connectionId: providedConnectionId,
|
|
252
258
|
authenticationId: providedAuthenticationId,
|
|
253
259
|
timeoutMs
|
|
254
260
|
} = actionOptions;
|
|
255
|
-
const
|
|
256
|
-
if (!
|
|
261
|
+
const resolvedConnectionId = pinnedAuthId ?? providedConnectionId ?? providedAuthenticationId;
|
|
262
|
+
if (!resolvedConnectionId) {
|
|
257
263
|
throw new ZapierValidationError(
|
|
258
|
-
`
|
|
264
|
+
`Connection ID is required. Either use the factory pattern: sdk.apps.${appKey}({ connectionId }) or provide connectionId in the action call.`
|
|
259
265
|
);
|
|
260
266
|
}
|
|
261
267
|
return sdk.runAction({
|
|
@@ -263,7 +269,7 @@ function createActionFunction(appKey, actionType, actionKey, options, pinnedAuth
|
|
|
263
269
|
actionType,
|
|
264
270
|
actionKey,
|
|
265
271
|
inputs,
|
|
266
|
-
|
|
272
|
+
connectionId: resolvedConnectionId,
|
|
267
273
|
timeoutMs
|
|
268
274
|
});
|
|
269
275
|
};
|
|
@@ -272,15 +278,15 @@ function createActionTypeProxy(appKey, actionType, options, pinnedAuthId) {
|
|
|
272
278
|
if (actionType === "fetch") {
|
|
273
279
|
return async (url, init) => {
|
|
274
280
|
const { sdk } = options;
|
|
275
|
-
const
|
|
276
|
-
if (!
|
|
281
|
+
const resolvedConnectionId = pinnedAuthId ?? init?.connectionId ?? init?.authenticationId;
|
|
282
|
+
if (!resolvedConnectionId) {
|
|
277
283
|
throw new ZapierValidationError(
|
|
278
|
-
`
|
|
284
|
+
`Connection ID is required for fetch. Either use the factory pattern: sdk.apps.${appKey}({ connectionId }).fetch(...) or provide connectionId in the fetch call.`
|
|
279
285
|
);
|
|
280
286
|
}
|
|
281
287
|
return sdk.fetch(url, {
|
|
282
288
|
...init,
|
|
283
|
-
|
|
289
|
+
connectionId: resolvedConnectionId
|
|
284
290
|
});
|
|
285
291
|
};
|
|
286
292
|
}
|
|
@@ -322,11 +328,13 @@ function createPinnedAppProxy(appKey, options, pinnedAuthId) {
|
|
|
322
328
|
}
|
|
323
329
|
function createAppProxy(appKey, options) {
|
|
324
330
|
const appFactory = (factoryOptions) => {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
331
|
+
const resolvedConnectionId = factoryOptions.connectionId ?? factoryOptions.authenticationId;
|
|
332
|
+
if (!resolvedConnectionId) {
|
|
333
|
+
throw new ZapierValidationError(
|
|
334
|
+
`Connection ID is required. Use sdk.apps.${appKey}({ connectionId: "..." })`
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
return createPinnedAppProxy(appKey, options, resolvedConnectionId);
|
|
330
338
|
};
|
|
331
339
|
return new Proxy(appFactory, {
|
|
332
340
|
get(_, actionType) {
|
|
@@ -358,7 +366,8 @@ var appsPlugin = ({ sdk }) => {
|
|
|
358
366
|
packages: ["sdk"],
|
|
359
367
|
type: "function",
|
|
360
368
|
inputSchema: AppFactoryInputSchema,
|
|
361
|
-
returnType: "AppProxy"
|
|
369
|
+
returnType: "AppProxy",
|
|
370
|
+
deprecatedParameters: ["authenticationId"]
|
|
362
371
|
},
|
|
363
372
|
"apps.{appKey}.{actionType}.{actionKey}": {
|
|
364
373
|
categories: ["app"],
|
|
@@ -366,7 +375,8 @@ var appsPlugin = ({ sdk }) => {
|
|
|
366
375
|
type: "list",
|
|
367
376
|
inputSchema: ActionExecutionInputSchema,
|
|
368
377
|
itemType: "ActionResult",
|
|
369
|
-
outputSchema: ActionResultItemSchema
|
|
378
|
+
outputSchema: ActionResultItemSchema,
|
|
379
|
+
deprecatedParameters: ["authenticationId"]
|
|
370
380
|
}
|
|
371
381
|
}
|
|
372
382
|
}
|
|
@@ -386,6 +396,8 @@ var FetchInitSchema = z.object({
|
|
|
386
396
|
]).optional().describe(
|
|
387
397
|
"Request body \u2014 plain objects and JSON strings are auto-detected and Content-Type is set accordingly"
|
|
388
398
|
),
|
|
399
|
+
connectionId: ConnectionIdPropertySchema.optional(),
|
|
400
|
+
/** @deprecated Use connectionId instead */
|
|
389
401
|
authenticationId: AuthenticationIdPropertySchema.optional(),
|
|
390
402
|
callbackUrl: z.string().optional().describe("URL to send async response to (makes request async)")
|
|
391
403
|
}).optional().describe(
|
|
@@ -457,7 +469,14 @@ var fetchPlugin = ({ context }) => {
|
|
|
457
469
|
const startTime = Date.now();
|
|
458
470
|
const isNested = init?._telemetry?.isNested === true;
|
|
459
471
|
try {
|
|
460
|
-
const {
|
|
472
|
+
const {
|
|
473
|
+
connectionId,
|
|
474
|
+
authenticationId,
|
|
475
|
+
callbackUrl,
|
|
476
|
+
_telemetry,
|
|
477
|
+
...fetchInit
|
|
478
|
+
} = init || {};
|
|
479
|
+
const resolvedConnectionId = connectionId ?? authenticationId;
|
|
461
480
|
const relayPath = transformUrlToRelayPath(url);
|
|
462
481
|
const headers = normalizeHeaders(
|
|
463
482
|
fetchInit.headers
|
|
@@ -473,10 +492,10 @@ var fetchPlugin = ({ context }) => {
|
|
|
473
492
|
headers["Content-Type"] = inferred;
|
|
474
493
|
}
|
|
475
494
|
}
|
|
476
|
-
if (
|
|
495
|
+
if (resolvedConnectionId) {
|
|
477
496
|
headers["X-Relay-Authentication-Id"] = coerceToNumericId(
|
|
478
|
-
"
|
|
479
|
-
|
|
497
|
+
"connectionId",
|
|
498
|
+
resolvedConnectionId
|
|
480
499
|
).toString();
|
|
481
500
|
}
|
|
482
501
|
if (callbackUrl) {
|
|
@@ -518,14 +537,15 @@ var fetchPlugin = ({ context }) => {
|
|
|
518
537
|
context: {
|
|
519
538
|
meta: {
|
|
520
539
|
fetch: {
|
|
521
|
-
description: "Make authenticated HTTP requests to any API through Zapier's Relay service. Pass
|
|
540
|
+
description: "Make authenticated HTTP requests to any API through Zapier's Relay service. Pass a connectionId to automatically inject the user's stored credentials (OAuth tokens, API keys, etc.) into the outgoing request. Mirrors the native fetch(url, init?) signature with additional Zapier-specific options.",
|
|
522
541
|
packages: ["sdk", "cli", "mcp"],
|
|
523
542
|
categories: ["http"],
|
|
524
543
|
returnType: "Response",
|
|
525
544
|
inputParameters: [
|
|
526
545
|
{ name: "url", schema: FetchUrlSchema },
|
|
527
546
|
{ name: "init", schema: FetchInitSchema }
|
|
528
|
-
]
|
|
547
|
+
],
|
|
548
|
+
deprecatedParameters: ["authenticationId"]
|
|
529
549
|
}
|
|
530
550
|
}
|
|
531
551
|
}
|
|
@@ -913,9 +933,9 @@ var ListAppsSchema = ListAppsQuerySchema.omit({
|
|
|
913
933
|
),
|
|
914
934
|
// Override pageSize to make optional (base has default value)
|
|
915
935
|
pageSize: z.number().min(1).optional().describe("Number of apps per page"),
|
|
916
|
-
// SDK specific property for pagination/
|
|
936
|
+
// SDK specific property for pagination/iterable helpers
|
|
917
937
|
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
918
|
-
// SDK specific property for pagination/
|
|
938
|
+
// SDK specific property for pagination/iterable helpers
|
|
919
939
|
cursor: z.string().optional().describe("Cursor to start from")
|
|
920
940
|
}).merge(TelemetryMarkerSchema).describe("List all available apps with optional filtering");
|
|
921
941
|
|
|
@@ -1524,8 +1544,8 @@ var actionKeyResolver = {
|
|
|
1524
1544
|
})
|
|
1525
1545
|
};
|
|
1526
1546
|
|
|
1527
|
-
// src/resolvers/
|
|
1528
|
-
var
|
|
1547
|
+
// src/resolvers/connectionId.ts
|
|
1548
|
+
var connectionIdResolver = {
|
|
1529
1549
|
type: "dynamic",
|
|
1530
1550
|
depends: ["appKey"],
|
|
1531
1551
|
fetch: async (sdk, resolvedParams) => {
|
|
@@ -1535,34 +1555,36 @@ var authenticationIdResolver = {
|
|
|
1535
1555
|
if (resolvedParams.appKey) {
|
|
1536
1556
|
listOptions.appKey = resolvedParams.appKey;
|
|
1537
1557
|
}
|
|
1538
|
-
const
|
|
1558
|
+
const myConnections = await sdk.listConnections({
|
|
1539
1559
|
...listOptions,
|
|
1540
1560
|
owner: "me"
|
|
1541
1561
|
});
|
|
1542
|
-
const
|
|
1543
|
-
const
|
|
1544
|
-
(
|
|
1562
|
+
const allConnections = await sdk.listConnections(listOptions);
|
|
1563
|
+
const otherConnections = allConnections.data.filter(
|
|
1564
|
+
(connection) => !myConnections.data.some(
|
|
1565
|
+
(myConnection) => myConnection.id === connection.id
|
|
1566
|
+
)
|
|
1545
1567
|
);
|
|
1546
|
-
return [...
|
|
1568
|
+
return [...myConnections.data, ...otherConnections];
|
|
1547
1569
|
},
|
|
1548
|
-
prompt: (
|
|
1570
|
+
prompt: (connections, params) => ({
|
|
1549
1571
|
type: "list",
|
|
1550
|
-
name: "
|
|
1551
|
-
message: params.appKey ? `Select
|
|
1572
|
+
name: "connectionId",
|
|
1573
|
+
message: params.appKey ? `Select connection for ${params.appKey}:` : "Select connection:",
|
|
1552
1574
|
choices: [
|
|
1553
|
-
...
|
|
1554
|
-
name: `${
|
|
1555
|
-
value:
|
|
1575
|
+
...connections.map((connection) => ({
|
|
1576
|
+
name: `${connection.title || connection.label || "Connection"} (ID: ${connection.id})`,
|
|
1577
|
+
value: connection.id
|
|
1556
1578
|
})),
|
|
1557
1579
|
{
|
|
1558
|
-
name: "
|
|
1580
|
+
name: "-> Skip connection (may fail)",
|
|
1559
1581
|
value: null
|
|
1560
1582
|
}
|
|
1561
1583
|
]
|
|
1562
1584
|
})
|
|
1563
1585
|
};
|
|
1564
|
-
var
|
|
1565
|
-
...
|
|
1586
|
+
var connectionIdGenericResolver = {
|
|
1587
|
+
...connectionIdResolver,
|
|
1566
1588
|
depends: []
|
|
1567
1589
|
};
|
|
1568
1590
|
|
|
@@ -1586,13 +1608,13 @@ function makeFieldsOptional(fields) {
|
|
|
1586
1608
|
}
|
|
1587
1609
|
var inputsResolver = {
|
|
1588
1610
|
type: "fields",
|
|
1589
|
-
depends: ["appKey", "actionKey", "actionType", "
|
|
1611
|
+
depends: ["appKey", "actionKey", "actionType", "connectionId"],
|
|
1590
1612
|
fetch: async (sdk, resolvedParams) => {
|
|
1591
1613
|
const fieldsResponse = await sdk.listInputFields({
|
|
1592
1614
|
appKey: resolvedParams.appKey,
|
|
1593
1615
|
actionKey: resolvedParams.actionKey,
|
|
1594
1616
|
actionType: resolvedParams.actionType,
|
|
1595
|
-
|
|
1617
|
+
connectionId: resolvedParams.connectionId,
|
|
1596
1618
|
inputs: resolvedParams.inputs
|
|
1597
1619
|
// Pass along currently resolved inputs
|
|
1598
1620
|
});
|
|
@@ -1601,13 +1623,13 @@ var inputsResolver = {
|
|
|
1601
1623
|
};
|
|
1602
1624
|
var inputsAllOptionalResolver = {
|
|
1603
1625
|
type: "fields",
|
|
1604
|
-
depends: ["appKey", "actionKey", "actionType", "
|
|
1626
|
+
depends: ["appKey", "actionKey", "actionType", "connectionId"],
|
|
1605
1627
|
fetch: async (sdk, resolvedParams) => {
|
|
1606
1628
|
const fieldsResponse = await sdk.listInputFields({
|
|
1607
1629
|
appKey: resolvedParams.appKey,
|
|
1608
1630
|
actionKey: resolvedParams.actionKey,
|
|
1609
1631
|
actionType: resolvedParams.actionType,
|
|
1610
|
-
|
|
1632
|
+
connectionId: resolvedParams.connectionId,
|
|
1611
1633
|
inputs: resolvedParams.inputs
|
|
1612
1634
|
// Pass along currently resolved inputs
|
|
1613
1635
|
});
|
|
@@ -1634,13 +1656,13 @@ function flattenRootFieldset(rootFieldset) {
|
|
|
1634
1656
|
}
|
|
1635
1657
|
var inputFieldKeyResolver = {
|
|
1636
1658
|
type: "dynamic",
|
|
1637
|
-
depends: ["appKey", "actionKey", "actionType", "
|
|
1659
|
+
depends: ["appKey", "actionKey", "actionType", "connectionId"],
|
|
1638
1660
|
fetch: async (sdk, resolvedParams) => {
|
|
1639
1661
|
const fieldsResponse = await sdk.listInputFields({
|
|
1640
1662
|
appKey: resolvedParams.appKey,
|
|
1641
1663
|
actionKey: resolvedParams.actionKey,
|
|
1642
1664
|
actionType: resolvedParams.actionType,
|
|
1643
|
-
|
|
1665
|
+
connectionId: resolvedParams.connectionId,
|
|
1644
1666
|
inputs: resolvedParams.inputs
|
|
1645
1667
|
// Pass along currently resolved inputs
|
|
1646
1668
|
});
|
|
@@ -1772,6 +1794,8 @@ var ListInputFieldsSchema = z.object({
|
|
|
1772
1794
|
appKey: AppKeyPropertySchema,
|
|
1773
1795
|
actionType: ActionTypePropertySchema,
|
|
1774
1796
|
actionKey: ActionKeyPropertySchema,
|
|
1797
|
+
connectionId: ConnectionIdPropertySchema.nullable().optional(),
|
|
1798
|
+
/** @deprecated Use connectionId instead */
|
|
1775
1799
|
authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
|
|
1776
1800
|
inputs: InputsPropertySchema.optional().describe(
|
|
1777
1801
|
"Current input values that may affect available fields"
|
|
@@ -1904,7 +1928,7 @@ async function fetchImplementationNeeds({
|
|
|
1904
1928
|
selectedApi,
|
|
1905
1929
|
action,
|
|
1906
1930
|
actionType,
|
|
1907
|
-
|
|
1931
|
+
connectionId,
|
|
1908
1932
|
inputs
|
|
1909
1933
|
}) {
|
|
1910
1934
|
const request = {
|
|
@@ -1913,10 +1937,10 @@ async function fetchImplementationNeeds({
|
|
|
1913
1937
|
type_of: actionType,
|
|
1914
1938
|
params: inputs || {}
|
|
1915
1939
|
};
|
|
1916
|
-
if (
|
|
1940
|
+
if (connectionId !== null) {
|
|
1917
1941
|
request.authentication_id = coerceToNumericId(
|
|
1918
1942
|
"authentication_id",
|
|
1919
|
-
|
|
1943
|
+
connectionId
|
|
1920
1944
|
);
|
|
1921
1945
|
}
|
|
1922
1946
|
const response = await api.post(
|
|
@@ -1934,7 +1958,7 @@ async function fetchImplementationChoices({
|
|
|
1934
1958
|
api,
|
|
1935
1959
|
actionId,
|
|
1936
1960
|
inputFieldId,
|
|
1937
|
-
|
|
1961
|
+
connectionId,
|
|
1938
1962
|
inputs,
|
|
1939
1963
|
page
|
|
1940
1964
|
}) {
|
|
@@ -1944,10 +1968,10 @@ async function fetchImplementationChoices({
|
|
|
1944
1968
|
page,
|
|
1945
1969
|
params: inputs || {}
|
|
1946
1970
|
};
|
|
1947
|
-
if (
|
|
1971
|
+
if (connectionId !== null) {
|
|
1948
1972
|
request.authentication_id = coerceToNumericId(
|
|
1949
1973
|
"authentication_id",
|
|
1950
|
-
|
|
1974
|
+
connectionId
|
|
1951
1975
|
);
|
|
1952
1976
|
}
|
|
1953
1977
|
const response = await api.post(
|
|
@@ -2068,9 +2092,11 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
|
|
|
2068
2092
|
appKey,
|
|
2069
2093
|
actionKey,
|
|
2070
2094
|
actionType,
|
|
2071
|
-
|
|
2095
|
+
connectionId,
|
|
2096
|
+
authenticationId,
|
|
2072
2097
|
inputs
|
|
2073
2098
|
} = options;
|
|
2099
|
+
const resolvedConnectionId = connectionId ?? authenticationId ?? null;
|
|
2074
2100
|
const selectedApi = await getVersionedImplementationId(appKey);
|
|
2075
2101
|
if (!selectedApi) {
|
|
2076
2102
|
throw new ZapierConfigurationError(
|
|
@@ -2088,7 +2114,7 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
|
|
|
2088
2114
|
selectedApi,
|
|
2089
2115
|
action: action.key,
|
|
2090
2116
|
actionType,
|
|
2091
|
-
|
|
2117
|
+
connectionId: resolvedConnectionId,
|
|
2092
2118
|
inputs
|
|
2093
2119
|
});
|
|
2094
2120
|
const rootFieldset = transformNeedsToFields(needsData.needs || []);
|
|
@@ -2119,68 +2145,78 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
|
|
|
2119
2145
|
appKey: appKeyResolver,
|
|
2120
2146
|
actionType: actionTypeResolver,
|
|
2121
2147
|
actionKey: actionKeyResolver,
|
|
2122
|
-
|
|
2148
|
+
connectionId: connectionIdResolver,
|
|
2123
2149
|
inputs: inputsAllOptionalResolver
|
|
2124
|
-
}
|
|
2150
|
+
},
|
|
2151
|
+
deprecatedParameters: ["authenticationId"]
|
|
2125
2152
|
}
|
|
2126
2153
|
}
|
|
2127
2154
|
}
|
|
2128
2155
|
};
|
|
2129
2156
|
};
|
|
2130
|
-
var
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2157
|
+
var ListConnectionsQuerySchema = ListConnectionsQuerySchema$1.omit({
|
|
2158
|
+
offset: true,
|
|
2159
|
+
// Omit snake_case fields, we'll add camelCase versions
|
|
2160
|
+
app_key: true,
|
|
2161
|
+
connection_ids: true,
|
|
2162
|
+
account_id: true,
|
|
2163
|
+
is_expired: true,
|
|
2164
|
+
page_size: true
|
|
2165
|
+
}).extend({
|
|
2135
2166
|
// Override appKey with our custom schema (array type, different description)
|
|
2136
2167
|
appKey: AppKeyPropertySchema.optional().describe(
|
|
2137
|
-
"App key of
|
|
2168
|
+
"App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')"
|
|
2138
2169
|
),
|
|
2139
|
-
// Override
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2170
|
+
// Override connectionIds to be an array instead of comma-separated string
|
|
2171
|
+
connectionIds: z.array(z.string()).optional().describe("List of connection IDs to filter by"),
|
|
2172
|
+
/** @deprecated Use connectionIds instead */
|
|
2173
|
+
authenticationIds: z.array(z.string()).optional().describe(
|
|
2174
|
+
"List of authentication IDs to filter by (deprecated, use connectionIds)"
|
|
2175
|
+
),
|
|
2176
|
+
// camelCase account ID
|
|
2177
|
+
accountId: z.string().optional().describe("Account ID to filter by"),
|
|
2178
|
+
// camelCase isExpired
|
|
2179
|
+
isExpired: z.boolean().optional().describe("Filter by expired status"),
|
|
2180
|
+
// Override pageSize to make optional
|
|
2181
|
+
pageSize: z.number().min(1).optional().describe("Number of connections per page"),
|
|
2182
|
+
// SDK specific property for pagination/iterable helpers
|
|
2144
2183
|
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
2145
|
-
// SDK specific property for pagination/
|
|
2184
|
+
// SDK specific property for pagination/iterable helpers
|
|
2146
2185
|
cursor: z.string().optional().describe("Cursor to start from")
|
|
2147
|
-
}).merge(TelemetryMarkerSchema).describe("List available
|
|
2148
|
-
var
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
const details = [];
|
|
2153
|
-
if (item.identifier) {
|
|
2154
|
-
details.push({
|
|
2155
|
-
text: `Identifier: ${item.identifier}`,
|
|
2156
|
-
style: "accent"
|
|
2157
|
-
});
|
|
2158
|
-
}
|
|
2186
|
+
}).merge(TelemetryMarkerSchema).describe("List available connections with optional filtering");
|
|
2187
|
+
var ConnectionItemSchema = withFormatter(ConnectionItemSchema$1, {
|
|
2188
|
+
format: (item) => {
|
|
2189
|
+
const details = [];
|
|
2190
|
+
if (item.identifier) {
|
|
2159
2191
|
details.push({
|
|
2160
|
-
text: `
|
|
2161
|
-
style: "
|
|
2192
|
+
text: `Identifier: ${item.identifier}`,
|
|
2193
|
+
style: "accent"
|
|
2162
2194
|
});
|
|
2163
|
-
if (item.marked_stale_at) {
|
|
2164
|
-
details.push({
|
|
2165
|
-
text: `\u26A0\uFE0F Marked stale: ${new Date(item.marked_stale_at).toLocaleDateString()}`,
|
|
2166
|
-
style: "warning"
|
|
2167
|
-
});
|
|
2168
|
-
}
|
|
2169
|
-
return {
|
|
2170
|
-
title: item.title || `Authentication ${item.id}`,
|
|
2171
|
-
id: item.id?.toString(),
|
|
2172
|
-
details
|
|
2173
|
-
};
|
|
2174
2195
|
}
|
|
2196
|
+
details.push({
|
|
2197
|
+
text: `Account: ${item.account_id} | Private: ${item.is_private} | Shared: ${item.shared_with_all}`,
|
|
2198
|
+
style: "dim"
|
|
2199
|
+
});
|
|
2200
|
+
if (item.marked_stale_at) {
|
|
2201
|
+
details.push({
|
|
2202
|
+
text: `Warning: Marked stale: ${new Date(item.marked_stale_at).toLocaleDateString()}`,
|
|
2203
|
+
style: "warning"
|
|
2204
|
+
});
|
|
2205
|
+
}
|
|
2206
|
+
return {
|
|
2207
|
+
title: item.title || `Connection ${item.id}`,
|
|
2208
|
+
id: item.id?.toString(),
|
|
2209
|
+
details
|
|
2210
|
+
};
|
|
2175
2211
|
}
|
|
2176
|
-
);
|
|
2212
|
+
});
|
|
2177
2213
|
|
|
2178
|
-
// src/plugins/
|
|
2179
|
-
var
|
|
2180
|
-
async function
|
|
2214
|
+
// src/plugins/listConnections/index.ts
|
|
2215
|
+
var listConnectionsPlugin = ({ context }) => {
|
|
2216
|
+
async function listConnectionsPage(options) {
|
|
2181
2217
|
const { api, getVersionedImplementationId } = context;
|
|
2182
2218
|
const searchParams = {
|
|
2183
|
-
|
|
2219
|
+
page_size: options.pageSize.toString()
|
|
2184
2220
|
};
|
|
2185
2221
|
if (options.appKey) {
|
|
2186
2222
|
const implementationId = await getVersionedImplementationId(
|
|
@@ -2188,11 +2224,14 @@ var listAuthenticationsPlugin = ({ context }) => {
|
|
|
2188
2224
|
);
|
|
2189
2225
|
if (implementationId) {
|
|
2190
2226
|
const [versionlessSelectedApi] = splitVersionedKey(implementationId);
|
|
2191
|
-
searchParams.
|
|
2227
|
+
searchParams.app_key = versionlessSelectedApi;
|
|
2228
|
+
} else {
|
|
2229
|
+
searchParams.app_key = options.appKey;
|
|
2192
2230
|
}
|
|
2193
2231
|
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2232
|
+
const resolvedConnectionIds = options.connectionIds ?? options.authenticationIds;
|
|
2233
|
+
if (resolvedConnectionIds && resolvedConnectionIds.length > 0) {
|
|
2234
|
+
searchParams.connection_ids = resolvedConnectionIds.join(",");
|
|
2196
2235
|
}
|
|
2197
2236
|
if (options.search) {
|
|
2198
2237
|
searchParams.search = options.search;
|
|
@@ -2201,31 +2240,31 @@ var listAuthenticationsPlugin = ({ context }) => {
|
|
|
2201
2240
|
searchParams.title = options.title;
|
|
2202
2241
|
}
|
|
2203
2242
|
if (options.accountId) {
|
|
2204
|
-
searchParams.
|
|
2243
|
+
searchParams.account_id = options.accountId;
|
|
2205
2244
|
}
|
|
2206
2245
|
if (options.owner) {
|
|
2207
2246
|
searchParams.owner = options.owner;
|
|
2208
2247
|
}
|
|
2209
2248
|
if (options.isExpired !== void 0) {
|
|
2210
|
-
searchParams.
|
|
2249
|
+
searchParams.is_expired = options.isExpired.toString();
|
|
2211
2250
|
}
|
|
2212
2251
|
if (options.cursor) {
|
|
2213
2252
|
searchParams.offset = options.cursor;
|
|
2214
2253
|
}
|
|
2215
2254
|
const response = await api.get(
|
|
2216
|
-
"/api/v0/
|
|
2255
|
+
"/api/v0/connections",
|
|
2217
2256
|
{
|
|
2218
2257
|
searchParams,
|
|
2219
2258
|
customErrorHandler: ({ status }) => {
|
|
2220
2259
|
if (status === 401) {
|
|
2221
2260
|
return new ZapierAuthenticationError(
|
|
2222
|
-
`Authentication failed. Your token may not have permission to access
|
|
2261
|
+
`Authentication failed. Your token may not have permission to access connections or may be expired. (HTTP ${status})`,
|
|
2223
2262
|
{ statusCode: status }
|
|
2224
2263
|
);
|
|
2225
2264
|
}
|
|
2226
2265
|
if (status === 403) {
|
|
2227
2266
|
return new ZapierAuthenticationError(
|
|
2228
|
-
`Access forbidden. Your token may not have the required scopes to list
|
|
2267
|
+
`Access forbidden. Your token may not have the required scopes to list connections. (HTTP ${status})`,
|
|
2229
2268
|
{ statusCode: status }
|
|
2230
2269
|
);
|
|
2231
2270
|
}
|
|
@@ -2236,26 +2275,27 @@ var listAuthenticationsPlugin = ({ context }) => {
|
|
|
2236
2275
|
);
|
|
2237
2276
|
return response;
|
|
2238
2277
|
}
|
|
2239
|
-
const methodName = stripPageSuffix(
|
|
2240
|
-
const
|
|
2241
|
-
|
|
2242
|
-
|
|
2278
|
+
const methodName = stripPageSuffix(listConnectionsPage.name);
|
|
2279
|
+
const listConnectionsDefinition = createPaginatedFunction(
|
|
2280
|
+
listConnectionsPage,
|
|
2281
|
+
ListConnectionsQuerySchema,
|
|
2243
2282
|
createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
|
|
2244
2283
|
methodName
|
|
2245
2284
|
);
|
|
2246
2285
|
return {
|
|
2247
|
-
|
|
2286
|
+
listConnections: listConnectionsDefinition,
|
|
2248
2287
|
context: {
|
|
2249
2288
|
meta: {
|
|
2250
|
-
|
|
2251
|
-
categories: ["
|
|
2289
|
+
listConnections: {
|
|
2290
|
+
categories: ["connection"],
|
|
2252
2291
|
type: "list",
|
|
2253
|
-
itemType: "
|
|
2254
|
-
inputSchema:
|
|
2255
|
-
outputSchema:
|
|
2292
|
+
itemType: "Connection",
|
|
2293
|
+
inputSchema: ListConnectionsQuerySchema,
|
|
2294
|
+
outputSchema: ConnectionItemSchema,
|
|
2256
2295
|
resolvers: {
|
|
2257
2296
|
appKey: appKeyResolver
|
|
2258
|
-
}
|
|
2297
|
+
},
|
|
2298
|
+
deprecatedParameters: ["authenticationIds"]
|
|
2259
2299
|
}
|
|
2260
2300
|
}
|
|
2261
2301
|
}
|
|
@@ -2266,9 +2306,9 @@ var ListClientCredentialsQuerySchema = ListClientCredentialsQuerySchema$1.omit({
|
|
|
2266
2306
|
}).extend({
|
|
2267
2307
|
// Override pageSize to make optional
|
|
2268
2308
|
pageSize: z.number().min(1).optional().describe("Number of credentials per page"),
|
|
2269
|
-
// SDK specific property for pagination/
|
|
2309
|
+
// SDK specific property for pagination/iterable helpers
|
|
2270
2310
|
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
2271
|
-
// SDK specific property for pagination/
|
|
2311
|
+
// SDK specific property for pagination/iterable helpers
|
|
2272
2312
|
cursor: z.string().optional().describe("Cursor to start from")
|
|
2273
2313
|
}).merge(TelemetryMarkerSchema).describe("List client credentials for the authenticated user");
|
|
2274
2314
|
var ClientCredentialsItemSchema = withFormatter(
|
|
@@ -2501,11 +2541,11 @@ var GetAppSchema = z.object({
|
|
|
2501
2541
|
// src/plugins/getApp/index.ts
|
|
2502
2542
|
var getAppPlugin = ({ sdk, context }) => {
|
|
2503
2543
|
async function getApp(options) {
|
|
2504
|
-
const
|
|
2544
|
+
const appsIterable = sdk.listApps({
|
|
2505
2545
|
appKeys: [options.appKey],
|
|
2506
2546
|
_telemetry: { isNested: true }
|
|
2507
2547
|
}).items();
|
|
2508
|
-
for await (const app of
|
|
2548
|
+
for await (const app of appsIterable) {
|
|
2509
2549
|
return {
|
|
2510
2550
|
data: app
|
|
2511
2551
|
};
|
|
@@ -2588,142 +2628,156 @@ var getActionPlugin = ({ sdk, context }) => {
|
|
|
2588
2628
|
}
|
|
2589
2629
|
};
|
|
2590
2630
|
};
|
|
2591
|
-
var
|
|
2592
|
-
|
|
2631
|
+
var GetConnectionParamSchema = z.object({
|
|
2632
|
+
connectionId: ConnectionIdPropertySchema.optional(),
|
|
2633
|
+
/** @deprecated Use connectionId instead */
|
|
2634
|
+
authenticationId: ConnectionIdPropertySchema.optional()
|
|
2635
|
+
});
|
|
2636
|
+
|
|
2637
|
+
// src/plugins/getConnection/index.ts
|
|
2638
|
+
var getConnectionPlugin = ({ context }) => {
|
|
2639
|
+
async function getConnection(options) {
|
|
2593
2640
|
const { api } = context;
|
|
2641
|
+
const resolvedConnectionId = options.connectionId ?? options.authenticationId;
|
|
2642
|
+
if (!resolvedConnectionId) {
|
|
2643
|
+
throw new Error("connectionId is required");
|
|
2644
|
+
}
|
|
2594
2645
|
return await api.get(
|
|
2595
|
-
`/api/v0/
|
|
2646
|
+
`/api/v0/connections/${encodeURIComponent(String(resolvedConnectionId))}`
|
|
2596
2647
|
);
|
|
2597
2648
|
}
|
|
2598
|
-
const
|
|
2599
|
-
|
|
2600
|
-
|
|
2649
|
+
const getConnectionDefinition = createFunction(
|
|
2650
|
+
getConnection,
|
|
2651
|
+
GetConnectionParamSchema,
|
|
2601
2652
|
createTelemetryCallback(
|
|
2602
2653
|
context.eventEmission.emitMethodCalled,
|
|
2603
|
-
|
|
2654
|
+
getConnection.name
|
|
2604
2655
|
)
|
|
2605
2656
|
);
|
|
2606
2657
|
return {
|
|
2607
|
-
|
|
2658
|
+
getConnection: getConnectionDefinition,
|
|
2608
2659
|
context: {
|
|
2609
2660
|
meta: {
|
|
2610
|
-
|
|
2611
|
-
categories: ["
|
|
2661
|
+
getConnection: {
|
|
2662
|
+
categories: ["connection"],
|
|
2612
2663
|
type: "item",
|
|
2613
|
-
itemType: "
|
|
2614
|
-
inputSchema:
|
|
2615
|
-
outputSchema:
|
|
2664
|
+
itemType: "Connection",
|
|
2665
|
+
inputSchema: GetConnectionParamSchema,
|
|
2666
|
+
outputSchema: ConnectionItemSchema,
|
|
2616
2667
|
resolvers: {
|
|
2617
|
-
|
|
2618
|
-
}
|
|
2668
|
+
connectionId: connectionIdGenericResolver
|
|
2669
|
+
},
|
|
2670
|
+
deprecatedParameters: ["authenticationId"]
|
|
2619
2671
|
}
|
|
2620
2672
|
}
|
|
2621
2673
|
}
|
|
2622
2674
|
};
|
|
2623
2675
|
};
|
|
2624
2676
|
|
|
2625
|
-
// src/plugins/
|
|
2626
|
-
var
|
|
2627
|
-
|
|
2677
|
+
// src/plugins/findFirstConnection/schemas.ts
|
|
2678
|
+
var FindFirstConnectionSchema = ListConnectionsQuerySchema.omit({
|
|
2679
|
+
connectionIds: true,
|
|
2628
2680
|
pageSize: true,
|
|
2629
2681
|
maxItems: true,
|
|
2630
2682
|
cursor: true,
|
|
2631
2683
|
_telemetry: true
|
|
2632
|
-
}).describe("Find the first
|
|
2684
|
+
}).describe("Find the first connection matching the criteria");
|
|
2633
2685
|
|
|
2634
|
-
// src/plugins/
|
|
2635
|
-
var
|
|
2636
|
-
async function
|
|
2637
|
-
const
|
|
2686
|
+
// src/plugins/findFirstConnection/index.ts
|
|
2687
|
+
var findFirstConnectionPlugin = ({ sdk, context }) => {
|
|
2688
|
+
async function findFirstConnection(options = {}) {
|
|
2689
|
+
const connectionsResponse = await sdk.listConnections({
|
|
2638
2690
|
...options,
|
|
2639
2691
|
maxItems: 1,
|
|
2640
2692
|
_telemetry: { isNested: true }
|
|
2641
2693
|
});
|
|
2642
|
-
if (
|
|
2694
|
+
if (connectionsResponse.data.length === 0) {
|
|
2643
2695
|
throw new ZapierResourceNotFoundError(
|
|
2644
|
-
"No
|
|
2645
|
-
{ resourceType: "
|
|
2696
|
+
"No connection found matching the specified criteria",
|
|
2697
|
+
{ resourceType: "Connection" }
|
|
2646
2698
|
);
|
|
2647
2699
|
}
|
|
2648
2700
|
return {
|
|
2649
|
-
data:
|
|
2701
|
+
data: connectionsResponse.data[0]
|
|
2650
2702
|
};
|
|
2651
2703
|
}
|
|
2652
|
-
const
|
|
2653
|
-
|
|
2654
|
-
|
|
2704
|
+
const findFirstConnectionDefinition = createFunction(
|
|
2705
|
+
findFirstConnection,
|
|
2706
|
+
FindFirstConnectionSchema,
|
|
2655
2707
|
createTelemetryCallback(
|
|
2656
2708
|
context.eventEmission.emitMethodCalled,
|
|
2657
|
-
|
|
2709
|
+
findFirstConnection.name
|
|
2658
2710
|
)
|
|
2659
2711
|
);
|
|
2660
2712
|
return {
|
|
2661
|
-
|
|
2713
|
+
findFirstConnection: findFirstConnectionDefinition,
|
|
2662
2714
|
context: {
|
|
2663
2715
|
meta: {
|
|
2664
|
-
|
|
2665
|
-
categories: ["
|
|
2716
|
+
findFirstConnection: {
|
|
2717
|
+
categories: ["connection"],
|
|
2666
2718
|
type: "item",
|
|
2667
|
-
itemType: "
|
|
2668
|
-
inputSchema:
|
|
2669
|
-
outputSchema:
|
|
2719
|
+
itemType: "Connection",
|
|
2720
|
+
inputSchema: FindFirstConnectionSchema,
|
|
2721
|
+
outputSchema: ConnectionItemSchema,
|
|
2722
|
+
deprecatedParameters: ["authenticationIds"]
|
|
2670
2723
|
}
|
|
2671
2724
|
}
|
|
2672
2725
|
}
|
|
2673
2726
|
};
|
|
2674
2727
|
};
|
|
2675
2728
|
|
|
2676
|
-
// src/plugins/
|
|
2677
|
-
var
|
|
2678
|
-
|
|
2729
|
+
// src/plugins/findUniqueConnection/schemas.ts
|
|
2730
|
+
var FindUniqueConnectionSchema = ListConnectionsQuerySchema.omit({
|
|
2731
|
+
connectionIds: true,
|
|
2679
2732
|
pageSize: true,
|
|
2680
2733
|
maxItems: true,
|
|
2681
2734
|
cursor: true,
|
|
2682
2735
|
_telemetry: true
|
|
2683
|
-
}).describe("Find a unique
|
|
2736
|
+
}).describe("Find a unique connection matching the criteria");
|
|
2684
2737
|
|
|
2685
|
-
// src/plugins/
|
|
2686
|
-
var
|
|
2687
|
-
async function
|
|
2688
|
-
const
|
|
2738
|
+
// src/plugins/findUniqueConnection/index.ts
|
|
2739
|
+
var findUniqueConnectionPlugin = ({ sdk, context }) => {
|
|
2740
|
+
async function findUniqueConnection(options = {}) {
|
|
2741
|
+
const connectionsResponse = await sdk.listConnections({
|
|
2689
2742
|
...options,
|
|
2690
2743
|
maxItems: 2,
|
|
2691
2744
|
// Get up to 2 to check for uniqueness
|
|
2692
2745
|
_telemetry: { isNested: true }
|
|
2693
2746
|
});
|
|
2694
|
-
if (
|
|
2747
|
+
if (connectionsResponse.data.length === 0) {
|
|
2695
2748
|
throw new ZapierResourceNotFoundError(
|
|
2696
|
-
"No
|
|
2697
|
-
{ resourceType: "
|
|
2749
|
+
"No connection found matching the specified criteria",
|
|
2750
|
+
{ resourceType: "Connection" }
|
|
2698
2751
|
);
|
|
2699
2752
|
}
|
|
2700
|
-
if (
|
|
2753
|
+
if (connectionsResponse.data.length > 1) {
|
|
2701
2754
|
throw new ZapierValidationError(
|
|
2702
|
-
"Multiple
|
|
2755
|
+
"Multiple connections found matching the specified criteria. Expected exactly one."
|
|
2703
2756
|
);
|
|
2704
2757
|
}
|
|
2705
2758
|
return {
|
|
2706
|
-
data:
|
|
2759
|
+
data: connectionsResponse.data[0]
|
|
2707
2760
|
};
|
|
2708
2761
|
}
|
|
2709
|
-
const
|
|
2710
|
-
|
|
2711
|
-
|
|
2762
|
+
const findUniqueConnectionDefinition = createFunction(
|
|
2763
|
+
findUniqueConnection,
|
|
2764
|
+
FindUniqueConnectionSchema,
|
|
2712
2765
|
createTelemetryCallback(
|
|
2713
2766
|
context.eventEmission.emitMethodCalled,
|
|
2714
|
-
|
|
2767
|
+
findUniqueConnection.name
|
|
2715
2768
|
)
|
|
2716
2769
|
);
|
|
2717
2770
|
return {
|
|
2718
|
-
|
|
2771
|
+
findUniqueConnection: findUniqueConnectionDefinition,
|
|
2719
2772
|
context: {
|
|
2720
2773
|
meta: {
|
|
2721
|
-
|
|
2722
|
-
categories: ["
|
|
2774
|
+
findUniqueConnection: {
|
|
2775
|
+
categories: ["connection"],
|
|
2723
2776
|
type: "item",
|
|
2724
|
-
itemType: "
|
|
2725
|
-
inputSchema:
|
|
2726
|
-
outputSchema:
|
|
2777
|
+
itemType: "Connection",
|
|
2778
|
+
inputSchema: FindUniqueConnectionSchema,
|
|
2779
|
+
outputSchema: ConnectionItemSchema,
|
|
2780
|
+
deprecatedParameters: ["authenticationIds"]
|
|
2727
2781
|
}
|
|
2728
2782
|
}
|
|
2729
2783
|
}
|
|
@@ -2733,7 +2787,9 @@ var RunActionSchema = z.object({
|
|
|
2733
2787
|
appKey: AppKeyPropertySchema,
|
|
2734
2788
|
actionType: ActionTypePropertySchema,
|
|
2735
2789
|
actionKey: ActionKeyPropertySchema,
|
|
2736
|
-
|
|
2790
|
+
connectionId: ConnectionIdPropertySchema.nullable().optional(),
|
|
2791
|
+
/** @deprecated Use connectionId instead */
|
|
2792
|
+
authenticationId: ConnectionIdPropertySchema.nullable().optional(),
|
|
2737
2793
|
inputs: InputsPropertySchema.optional().describe(
|
|
2738
2794
|
"Input parameters for the action"
|
|
2739
2795
|
),
|
|
@@ -2753,7 +2809,7 @@ async function executeAction(actionOptions) {
|
|
|
2753
2809
|
actionKey,
|
|
2754
2810
|
actionType,
|
|
2755
2811
|
executionOptions,
|
|
2756
|
-
|
|
2812
|
+
connectionId,
|
|
2757
2813
|
timeoutMs
|
|
2758
2814
|
} = actionOptions;
|
|
2759
2815
|
const selectedApi = await context.getVersionedImplementationId(appKey);
|
|
@@ -2770,8 +2826,8 @@ async function executeAction(actionOptions) {
|
|
|
2770
2826
|
action_type: actionType,
|
|
2771
2827
|
inputs: executionOptions.inputs || {}
|
|
2772
2828
|
};
|
|
2773
|
-
if (
|
|
2774
|
-
runRequestData.authentication_id =
|
|
2829
|
+
if (connectionId !== null && connectionId !== void 0) {
|
|
2830
|
+
runRequestData.authentication_id = connectionId;
|
|
2775
2831
|
}
|
|
2776
2832
|
const runRequest = {
|
|
2777
2833
|
data: runRequestData
|
|
@@ -2799,10 +2855,12 @@ var runActionPlugin = ({ sdk, context }) => {
|
|
|
2799
2855
|
appKey,
|
|
2800
2856
|
actionKey,
|
|
2801
2857
|
actionType,
|
|
2858
|
+
connectionId,
|
|
2802
2859
|
authenticationId,
|
|
2803
2860
|
inputs = {},
|
|
2804
2861
|
timeoutMs
|
|
2805
2862
|
} = options;
|
|
2863
|
+
const resolvedConnectionId = connectionId ?? authenticationId;
|
|
2806
2864
|
const actionData = await sdk.getAction({
|
|
2807
2865
|
appKey,
|
|
2808
2866
|
actionKey,
|
|
@@ -2825,7 +2883,7 @@ var runActionPlugin = ({ sdk, context }) => {
|
|
|
2825
2883
|
actionKey,
|
|
2826
2884
|
actionType,
|
|
2827
2885
|
executionOptions: { inputs },
|
|
2828
|
-
|
|
2886
|
+
connectionId: resolvedConnectionId,
|
|
2829
2887
|
timeoutMs
|
|
2830
2888
|
});
|
|
2831
2889
|
if (result.errors && result.errors.length > 0) {
|
|
@@ -2864,9 +2922,10 @@ var runActionPlugin = ({ sdk, context }) => {
|
|
|
2864
2922
|
appKey: appKeyResolver,
|
|
2865
2923
|
actionType: actionTypeResolver,
|
|
2866
2924
|
actionKey: actionKeyResolver,
|
|
2867
|
-
|
|
2925
|
+
connectionId: connectionIdResolver,
|
|
2868
2926
|
inputs: inputsResolver
|
|
2869
|
-
}
|
|
2927
|
+
},
|
|
2928
|
+
deprecatedParameters: ["authenticationId"]
|
|
2870
2929
|
}
|
|
2871
2930
|
}
|
|
2872
2931
|
}
|
|
@@ -2876,6 +2935,8 @@ var RelayRequestSchema = z.object({
|
|
|
2876
2935
|
url: z.string().url().describe("The URL to request (will be proxied through Relay)"),
|
|
2877
2936
|
method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional().describe("HTTP method"),
|
|
2878
2937
|
body: z.any().optional().describe("Request body as a string"),
|
|
2938
|
+
connectionId: ConnectionIdPropertySchema.optional(),
|
|
2939
|
+
/** @deprecated Use connectionId instead */
|
|
2879
2940
|
authenticationId: AuthenticationIdPropertySchema.optional(),
|
|
2880
2941
|
callbackUrl: z.string().url().optional().describe("URL to send async response to (makes request async)"),
|
|
2881
2942
|
headers: z.union([
|
|
@@ -2901,12 +2962,21 @@ function resetDeprecationWarnings() {
|
|
|
2901
2962
|
var requestPlugin = ({ sdk, context }) => {
|
|
2902
2963
|
async function request(options) {
|
|
2903
2964
|
logDeprecation("request() is deprecated. Use fetch() instead.");
|
|
2904
|
-
const {
|
|
2905
|
-
|
|
2965
|
+
const {
|
|
2966
|
+
url,
|
|
2906
2967
|
method,
|
|
2907
2968
|
body,
|
|
2908
2969
|
headers,
|
|
2970
|
+
connectionId,
|
|
2909
2971
|
authenticationId,
|
|
2972
|
+
callbackUrl
|
|
2973
|
+
} = options;
|
|
2974
|
+
const resolvedConnectionId = connectionId ?? authenticationId;
|
|
2975
|
+
return sdk.fetch(url, {
|
|
2976
|
+
method,
|
|
2977
|
+
body,
|
|
2978
|
+
headers,
|
|
2979
|
+
connectionId: resolvedConnectionId,
|
|
2910
2980
|
callbackUrl,
|
|
2911
2981
|
_telemetry: { isNested: true }
|
|
2912
2982
|
});
|
|
@@ -2927,7 +2997,8 @@ var requestPlugin = ({ sdk, context }) => {
|
|
|
2927
2997
|
packages: ["cli", "mcp"],
|
|
2928
2998
|
categories: ["http", "deprecated"],
|
|
2929
2999
|
returnType: "Response",
|
|
2930
|
-
inputSchema: RelayRequestSchema
|
|
3000
|
+
inputSchema: RelayRequestSchema,
|
|
3001
|
+
deprecatedParameters: ["authenticationId"]
|
|
2931
3002
|
}
|
|
2932
3003
|
}
|
|
2933
3004
|
}
|
|
@@ -2998,6 +3069,8 @@ var ActionEntrySchema = z.object({
|
|
|
2998
3069
|
appKey: z.string().describe("App key (slug or implementation name)"),
|
|
2999
3070
|
actionKey: z.string().describe("Action key identifier"),
|
|
3000
3071
|
actionType: z.string().describe("Action type (e.g., 'read', 'write', 'search')"),
|
|
3072
|
+
connectionId: ConnectionIdPropertySchema.nullable().optional(),
|
|
3073
|
+
/** @deprecated Use connectionId instead */
|
|
3001
3074
|
authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
|
|
3002
3075
|
inputs: z.record(z.string(), z.unknown()).optional().describe("Resolved input values"),
|
|
3003
3076
|
schema: z.record(z.string(), z.unknown()).describe(
|
|
@@ -4612,8 +4685,8 @@ var registryPlugin = ({ sdk, context }) => {
|
|
|
4612
4685
|
title: "App",
|
|
4613
4686
|
titlePlural: "Apps"
|
|
4614
4687
|
},
|
|
4615
|
-
|
|
4616
|
-
title: "
|
|
4688
|
+
connection: {
|
|
4689
|
+
title: "Connection"
|
|
4617
4690
|
},
|
|
4618
4691
|
action: {
|
|
4619
4692
|
title: "Action"
|
|
@@ -4659,7 +4732,8 @@ var registryPlugin = ({ sdk, context }) => {
|
|
|
4659
4732
|
resolvers: meta.resolvers,
|
|
4660
4733
|
packages: meta.packages,
|
|
4661
4734
|
// Auto-infer confirm: "delete" from type: "delete" (all deletes should confirm)
|
|
4662
|
-
confirm: meta.confirm ?? (meta.type === "delete" ? "delete" : void 0)
|
|
4735
|
+
confirm: meta.confirm ?? (meta.type === "delete" ? "delete" : void 0),
|
|
4736
|
+
deprecatedParameters: meta.deprecatedParameters
|
|
4663
4737
|
};
|
|
4664
4738
|
}).sort((a, b) => a.name.localeCompare(b.name));
|
|
4665
4739
|
const knownCategories = Object.keys(categoryDefinitions);
|
|
@@ -4707,6 +4781,68 @@ var registryPlugin = ({ sdk, context }) => {
|
|
|
4707
4781
|
getRegistry
|
|
4708
4782
|
};
|
|
4709
4783
|
};
|
|
4784
|
+
|
|
4785
|
+
// src/plugins/deprecated/authentications.ts
|
|
4786
|
+
var listAuthenticationsPlugin = ({ sdk }) => ({
|
|
4787
|
+
listAuthentications: sdk.listConnections,
|
|
4788
|
+
context: {
|
|
4789
|
+
meta: {
|
|
4790
|
+
listAuthentications: {
|
|
4791
|
+
packages: ["cli", "mcp"],
|
|
4792
|
+
categories: ["connection", "deprecated"],
|
|
4793
|
+
type: "list",
|
|
4794
|
+
itemType: "Connection",
|
|
4795
|
+
inputSchema: ListConnectionsQuerySchema,
|
|
4796
|
+
outputSchema: ConnectionItemSchema
|
|
4797
|
+
}
|
|
4798
|
+
}
|
|
4799
|
+
}
|
|
4800
|
+
});
|
|
4801
|
+
var getAuthenticationPlugin = ({ sdk }) => ({
|
|
4802
|
+
getAuthentication: sdk.getConnection,
|
|
4803
|
+
context: {
|
|
4804
|
+
meta: {
|
|
4805
|
+
getAuthentication: {
|
|
4806
|
+
packages: ["cli", "mcp"],
|
|
4807
|
+
categories: ["connection", "deprecated"],
|
|
4808
|
+
type: "item",
|
|
4809
|
+
itemType: "Connection",
|
|
4810
|
+
inputSchema: GetConnectionParamSchema,
|
|
4811
|
+
outputSchema: ConnectionItemSchema
|
|
4812
|
+
}
|
|
4813
|
+
}
|
|
4814
|
+
}
|
|
4815
|
+
});
|
|
4816
|
+
var findFirstAuthenticationPlugin = ({ sdk }) => ({
|
|
4817
|
+
findFirstAuthentication: sdk.findFirstConnection,
|
|
4818
|
+
context: {
|
|
4819
|
+
meta: {
|
|
4820
|
+
findFirstAuthentication: {
|
|
4821
|
+
packages: ["cli", "mcp"],
|
|
4822
|
+
categories: ["connection", "deprecated"],
|
|
4823
|
+
type: "item",
|
|
4824
|
+
itemType: "Connection",
|
|
4825
|
+
inputSchema: FindFirstConnectionSchema,
|
|
4826
|
+
outputSchema: ConnectionItemSchema
|
|
4827
|
+
}
|
|
4828
|
+
}
|
|
4829
|
+
}
|
|
4830
|
+
});
|
|
4831
|
+
var findUniqueAuthenticationPlugin = ({ sdk }) => ({
|
|
4832
|
+
findUniqueAuthentication: sdk.findUniqueConnection,
|
|
4833
|
+
context: {
|
|
4834
|
+
meta: {
|
|
4835
|
+
findUniqueAuthentication: {
|
|
4836
|
+
packages: ["cli", "mcp"],
|
|
4837
|
+
categories: ["connection", "deprecated"],
|
|
4838
|
+
type: "item",
|
|
4839
|
+
itemType: "Connection",
|
|
4840
|
+
inputSchema: FindUniqueConnectionSchema,
|
|
4841
|
+
outputSchema: ConnectionItemSchema
|
|
4842
|
+
}
|
|
4843
|
+
}
|
|
4844
|
+
}
|
|
4845
|
+
});
|
|
4710
4846
|
var GetInputFieldsSchemaSchema = z.object({
|
|
4711
4847
|
appKey: AppKeyPropertySchema.describe(
|
|
4712
4848
|
"App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
|
|
@@ -4717,8 +4853,12 @@ var GetInputFieldsSchemaSchema = z.object({
|
|
|
4717
4853
|
actionKey: ActionKeyPropertySchema.describe(
|
|
4718
4854
|
"Action key to get the input schema for"
|
|
4719
4855
|
),
|
|
4856
|
+
connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
|
|
4857
|
+
"Connection ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
|
|
4858
|
+
),
|
|
4859
|
+
/** @deprecated Use connectionId instead */
|
|
4720
4860
|
authenticationId: AuthenticationIdPropertySchema.nullable().optional().describe(
|
|
4721
|
-
"Authentication ID to use when fetching the schema. Required if the action needs
|
|
4861
|
+
"Authentication ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
|
|
4722
4862
|
),
|
|
4723
4863
|
inputs: InputsPropertySchema.optional().describe(
|
|
4724
4864
|
"Current input values that may affect the schema (e.g., when fields depend on other field values)"
|
|
@@ -4735,9 +4875,11 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
|
|
|
4735
4875
|
appKey,
|
|
4736
4876
|
actionKey,
|
|
4737
4877
|
actionType,
|
|
4738
|
-
|
|
4878
|
+
connectionId,
|
|
4879
|
+
authenticationId,
|
|
4739
4880
|
inputs
|
|
4740
4881
|
} = options;
|
|
4882
|
+
const resolvedConnectionId = connectionId ?? authenticationId ?? null;
|
|
4741
4883
|
const selectedApi = await getVersionedImplementationId(appKey);
|
|
4742
4884
|
if (!selectedApi) {
|
|
4743
4885
|
throw new ZapierConfigurationError(
|
|
@@ -4755,7 +4897,7 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
|
|
|
4755
4897
|
selectedApi,
|
|
4756
4898
|
action: action.key,
|
|
4757
4899
|
actionType,
|
|
4758
|
-
|
|
4900
|
+
connectionId: resolvedConnectionId,
|
|
4759
4901
|
inputs
|
|
4760
4902
|
});
|
|
4761
4903
|
return {
|
|
@@ -4783,9 +4925,10 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
|
|
|
4783
4925
|
appKey: appKeyResolver,
|
|
4784
4926
|
actionType: actionTypeResolver,
|
|
4785
4927
|
actionKey: actionKeyResolver,
|
|
4786
|
-
|
|
4928
|
+
connectionId: connectionIdResolver,
|
|
4787
4929
|
inputs: inputsAllOptionalResolver
|
|
4788
|
-
}
|
|
4930
|
+
},
|
|
4931
|
+
deprecatedParameters: ["authenticationId"]
|
|
4789
4932
|
}
|
|
4790
4933
|
}
|
|
4791
4934
|
}
|
|
@@ -4819,6 +4962,8 @@ var ListInputFieldChoicesSchema = z.object({
|
|
|
4819
4962
|
// Input field specification
|
|
4820
4963
|
inputFieldKey: z.string().min(1).describe("Input field key to get choices for."),
|
|
4821
4964
|
// Common parameters
|
|
4965
|
+
connectionId: ConnectionIdPropertySchema.nullable().optional(),
|
|
4966
|
+
/** @deprecated Use connectionId instead */
|
|
4822
4967
|
authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
|
|
4823
4968
|
inputs: InputsPropertySchema.optional().describe(
|
|
4824
4969
|
"Current input values that may affect available choices"
|
|
@@ -4847,11 +4992,13 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
|
|
|
4847
4992
|
actionType,
|
|
4848
4993
|
actionKey,
|
|
4849
4994
|
inputFieldKey,
|
|
4850
|
-
|
|
4995
|
+
connectionId,
|
|
4996
|
+
authenticationId,
|
|
4851
4997
|
inputs,
|
|
4852
4998
|
page,
|
|
4853
4999
|
cursor
|
|
4854
5000
|
} = options;
|
|
5001
|
+
const resolvedConnectionId = connectionId ?? authenticationId ?? null;
|
|
4855
5002
|
const selectedApi = await getVersionedImplementationId(appKey);
|
|
4856
5003
|
if (!selectedApi) {
|
|
4857
5004
|
throw new ZapierConfigurationError(
|
|
@@ -4869,7 +5016,7 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
|
|
|
4869
5016
|
selectedApi,
|
|
4870
5017
|
action: action.key,
|
|
4871
5018
|
actionType,
|
|
4872
|
-
|
|
5019
|
+
connectionId: resolvedConnectionId,
|
|
4873
5020
|
inputs
|
|
4874
5021
|
});
|
|
4875
5022
|
const targetNeed = needsData.needs?.find(
|
|
@@ -4893,7 +5040,7 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
|
|
|
4893
5040
|
api,
|
|
4894
5041
|
actionId: action.id,
|
|
4895
5042
|
inputFieldId: inputFieldKey,
|
|
4896
|
-
|
|
5043
|
+
connectionId: resolvedConnectionId,
|
|
4897
5044
|
inputs,
|
|
4898
5045
|
page: requestPage
|
|
4899
5046
|
});
|
|
@@ -4940,10 +5087,11 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
|
|
|
4940
5087
|
appKey: appKeyResolver,
|
|
4941
5088
|
actionType: actionTypeResolver,
|
|
4942
5089
|
actionKey: actionKeyResolver,
|
|
4943
|
-
|
|
5090
|
+
connectionId: connectionIdResolver,
|
|
4944
5091
|
inputFieldKey: inputFieldKeyResolver,
|
|
4945
5092
|
inputs: inputsAllOptionalResolver
|
|
4946
|
-
}
|
|
5093
|
+
},
|
|
5094
|
+
deprecatedParameters: ["authenticationId"]
|
|
4947
5095
|
}
|
|
4948
5096
|
}
|
|
4949
5097
|
}
|
|
@@ -5109,7 +5257,7 @@ function getCpuTime() {
|
|
|
5109
5257
|
|
|
5110
5258
|
// package.json
|
|
5111
5259
|
var package_default = {
|
|
5112
|
-
version: "0.
|
|
5260
|
+
version: "0.27.0"};
|
|
5113
5261
|
|
|
5114
5262
|
// src/plugins/eventEmission/builders.ts
|
|
5115
5263
|
function createBaseEvent(context = {}) {
|
|
@@ -5563,10 +5711,10 @@ function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} })
|
|
|
5563
5711
|
};
|
|
5564
5712
|
}
|
|
5565
5713
|
function createZapierSdkWithoutRegistry(options = {}) {
|
|
5566
|
-
return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(getInputFieldsSchemaPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(listClientCredentialsPlugin).addPlugin(createClientCredentialsPlugin).addPlugin(deleteClientCredentialsPlugin).addPlugin(fetchPlugin).addPlugin(requestPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
|
|
5714
|
+
return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(getInputFieldsSchemaPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listConnectionsPlugin).addPlugin(getConnectionPlugin).addPlugin(findFirstConnectionPlugin).addPlugin(findUniqueConnectionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(listClientCredentialsPlugin).addPlugin(createClientCredentialsPlugin).addPlugin(deleteClientCredentialsPlugin).addPlugin(fetchPlugin).addPlugin(requestPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
|
|
5567
5715
|
}
|
|
5568
5716
|
function createZapierSdk(options = {}) {
|
|
5569
5717
|
return createZapierSdkWithoutRegistry(options).addPlugin(registryPlugin);
|
|
5570
5718
|
}
|
|
5571
5719
|
|
|
5572
|
-
export { ActionKeyPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AuthenticationIdPropertySchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DebugPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, RelayFetchSchema, RelayRequestSchema, 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_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, authenticationIdGenericResolver, authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, fetchPlugin,
|
|
5720
|
+
export { ActionKeyPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AuthenticationIdPropertySchema, ConnectionIdPropertySchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DebugPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, RelayFetchSchema, RelayRequestSchema, 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_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierResourceNotFoundError, 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, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, toSnakeCase, toTitleCase };
|