@zapier/zapier-sdk 0.12.0 → 0.13.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 +12 -0
- package/README.md +336 -128
- package/dist/api/schemas.d.ts +10 -865
- package/dist/api/schemas.d.ts.map +1 -1
- package/dist/api/schemas.js +0 -6
- package/dist/index.cjs +108 -58
- package/dist/index.d.mts +88 -434
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +108 -58
- package/dist/plugins/apps/index.d.ts +2 -2
- package/dist/plugins/apps/index.d.ts.map +1 -1
- package/dist/plugins/apps/index.js +21 -0
- package/dist/plugins/apps/schemas.d.ts +51 -0
- package/dist/plugins/apps/schemas.d.ts.map +1 -0
- package/dist/plugins/apps/schemas.js +13 -0
- package/dist/plugins/findFirstAuthentication/schemas.js +1 -1
- package/dist/plugins/findUniqueAuthentication/schemas.js +1 -1
- package/dist/plugins/getApp/schemas.js +1 -1
- package/dist/plugins/getAuthentication/index.test.js +1 -1
- package/dist/plugins/listActions/index.d.ts +1 -0
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/schemas.d.ts +3 -0
- package/dist/plugins/listActions/schemas.d.ts.map +1 -1
- package/dist/plugins/listActions/schemas.js +2 -1
- package/dist/plugins/listApps/index.d.ts +1 -0
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/schemas.d.ts +3 -0
- package/dist/plugins/listApps/schemas.d.ts.map +1 -1
- package/dist/plugins/listApps/schemas.js +1 -0
- package/dist/plugins/listAuthentications/index.d.ts +1 -0
- package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
- package/dist/plugins/listAuthentications/schemas.d.ts +3 -0
- package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -1
- package/dist/plugins/listAuthentications/schemas.js +2 -1
- package/dist/plugins/listInputFieldChoices/index.d.ts +1 -0
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +3 -0
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/schemas.js +1 -0
- package/dist/plugins/listInputFields/index.d.ts +1 -0
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/schemas.d.ts +3 -0
- package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFields/schemas.js +1 -0
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +12 -1
- package/dist/plugins/runAction/index.d.ts +1 -0
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/schemas.d.ts +3 -0
- package/dist/plugins/runAction/schemas.d.ts.map +1 -1
- package/dist/plugins/runAction/schemas.js +1 -0
- package/dist/schemas/Action.d.ts +4 -206
- package/dist/schemas/Action.d.ts.map +1 -1
- package/dist/schemas/Action.js +3 -2
- package/dist/schemas/App.d.ts.map +1 -1
- package/dist/schemas/App.js +1 -0
- package/dist/schemas/Auth.d.ts +10 -10
- package/dist/schemas/Auth.js +1 -1
- package/dist/types/properties.d.ts.map +1 -1
- package/dist/types/properties.js +4 -1
- package/dist/types/sdk.d.ts +1 -1
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/utils/domain-utils.d.ts +2 -2
- package/dist/utils/domain-utils.d.ts.map +1 -1
- package/dist/utils/domain-utils.js +19 -8
- package/dist/utils/schema-utils.d.ts +1 -0
- package/dist/utils/schema-utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/schemas.ts +0 -6
- package/src/index.ts +1 -0
- package/src/plugins/apps/index.ts +28 -7
- package/src/plugins/apps/{types.ts → schemas.ts} +27 -9
- package/src/plugins/findFirstAuthentication/schemas.ts +1 -1
- package/src/plugins/findUniqueAuthentication/schemas.ts +1 -1
- package/src/plugins/getApp/schemas.ts +1 -1
- package/src/plugins/getAuthentication/index.test.ts +1 -1
- package/src/plugins/listActions/index.ts +1 -0
- package/src/plugins/listActions/schemas.ts +2 -1
- package/src/plugins/listApps/index.ts +4 -1
- package/src/plugins/listApps/schemas.ts +1 -0
- package/src/plugins/listAuthentications/index.ts +1 -0
- package/src/plugins/listAuthentications/schemas.ts +2 -1
- package/src/plugins/listInputFieldChoices/index.ts +1 -0
- package/src/plugins/listInputFieldChoices/schemas.ts +1 -0
- package/src/plugins/listInputFields/index.ts +1 -0
- package/src/plugins/listInputFields/schemas.ts +1 -0
- package/src/plugins/registry/index.ts +12 -1
- package/src/plugins/runAction/index.ts +4 -1
- package/src/plugins/runAction/schemas.ts +1 -0
- package/src/schemas/Action.ts +3 -2
- package/src/schemas/App.ts +1 -0
- package/src/schemas/Auth.ts +1 -1
- package/src/types/properties.ts +4 -1
- package/src/types/sdk.ts +1 -1
- package/src/utils/domain-utils.ts +22 -9
- package/src/utils/schema-utils.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/plugins/apps/types.d.ts +0 -30
- package/dist/plugins/apps/types.d.ts.map +0 -1
- package/dist/plugins/apps/types.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from "./plugins/api";
|
|
|
21
21
|
export type { Action, App, Need, Field, Choice, ActionExecutionResult, ActionField, ActionFieldChoice, NeedsRequest, NeedsResponse, Authentication, AuthenticationsResponse, UserProfile, } from "./api/types";
|
|
22
22
|
export { isPositional, PositionalMetadata } from "./utils/schema-utils";
|
|
23
23
|
export { createFunction } from "./utils/function-utils";
|
|
24
|
+
export type { FormattedItem, FormatMetadata } from "./utils/schema-utils";
|
|
24
25
|
export * from "./resolvers";
|
|
25
26
|
export * from "./auth";
|
|
26
27
|
export { RelayRequestSchema, RelayFetchSchema, } from "./plugins/request/schemas";
|
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,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,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,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
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,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,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,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG1E,cAAc,aAAa,CAAC;AAG5B,cAAc,QAAQ,CAAC;AAIvB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,SAAS,EACT,gBAAgB,GACjB,MAAM,OAAO,CAAC;AAGf,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,YAAY,EACV,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,cAAc,EACd,GAAG,GACJ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -35,7 +35,7 @@ var MAX_PAGE_LIMIT = 1e4;
|
|
|
35
35
|
|
|
36
36
|
// src/types/properties.ts
|
|
37
37
|
var AppKeyPropertySchema = withPositional(
|
|
38
|
-
z.string().min(1).describe("App key (e.g., 'SlackCLIAPI')")
|
|
38
|
+
z.string().min(1).describe("App key (e.g., 'SlackCLIAPI' or slug like 'github')")
|
|
39
39
|
);
|
|
40
40
|
var ActionTypePropertySchema = z.enum([
|
|
41
41
|
"read",
|
|
@@ -190,6 +190,40 @@ HTTP Status: ${error.statusCode}`;
|
|
|
190
190
|
}
|
|
191
191
|
return message;
|
|
192
192
|
}
|
|
193
|
+
var ActionExecutionInputSchema = z.object({
|
|
194
|
+
inputs: z.record(z.unknown()).optional(),
|
|
195
|
+
authenticationId: z.number().optional()
|
|
196
|
+
}).describe(
|
|
197
|
+
"Execute an action with the given inputs for the bound app, as an alternative to runAction"
|
|
198
|
+
);
|
|
199
|
+
var AppFactoryInputSchema = z.object({
|
|
200
|
+
authenticationId: z.number()
|
|
201
|
+
}).describe("Bind an authentication ID to an app");
|
|
202
|
+
function getStringProperty(obj, key) {
|
|
203
|
+
if (typeof obj === "object" && obj !== null && key in obj) {
|
|
204
|
+
const value = obj[key];
|
|
205
|
+
return typeof value === "string" ? value : void 0;
|
|
206
|
+
}
|
|
207
|
+
return void 0;
|
|
208
|
+
}
|
|
209
|
+
function formatActionResult(item) {
|
|
210
|
+
const obj = typeof item === "object" && item !== null ? item : {};
|
|
211
|
+
const title = getStringProperty(obj, "title") || getStringProperty(obj, "name") || getStringProperty(obj, "label") || getStringProperty(obj, "subject") || "Action Result";
|
|
212
|
+
return {
|
|
213
|
+
title,
|
|
214
|
+
id: getStringProperty(obj, "id"),
|
|
215
|
+
key: getStringProperty(obj, "key"),
|
|
216
|
+
description: getStringProperty(obj, "description"),
|
|
217
|
+
data: item,
|
|
218
|
+
// Let formatJsonOutput handle the JSON rendering
|
|
219
|
+
details: []
|
|
220
|
+
// Not used when data is provided
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
var ActionResultItemSchema = withFormatter(
|
|
224
|
+
z.unknown().describe("Action execution result"),
|
|
225
|
+
{ format: formatActionResult }
|
|
226
|
+
);
|
|
193
227
|
|
|
194
228
|
// src/plugins/apps/index.ts
|
|
195
229
|
function createActionFunction(appKey, actionType, actionKey, options, pinnedAuthId) {
|
|
@@ -293,7 +327,26 @@ function createAppsProxy(options) {
|
|
|
293
327
|
}
|
|
294
328
|
var appsPlugin = ({ sdk }) => {
|
|
295
329
|
return {
|
|
296
|
-
apps: createAppsProxy({ sdk })
|
|
330
|
+
apps: createAppsProxy({ sdk }),
|
|
331
|
+
context: {
|
|
332
|
+
meta: {
|
|
333
|
+
"apps.{appKey}": {
|
|
334
|
+
categories: ["app"],
|
|
335
|
+
packages: ["sdk"],
|
|
336
|
+
type: "function",
|
|
337
|
+
inputSchema: AppFactoryInputSchema,
|
|
338
|
+
returnType: "AppProxy"
|
|
339
|
+
},
|
|
340
|
+
"apps.{appKey}.{actionType}.{actionKey}": {
|
|
341
|
+
categories: ["app"],
|
|
342
|
+
packages: ["sdk"],
|
|
343
|
+
type: "list",
|
|
344
|
+
inputSchema: ActionExecutionInputSchema,
|
|
345
|
+
itemType: "ActionResult",
|
|
346
|
+
outputSchema: ActionResultItemSchema
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
297
350
|
};
|
|
298
351
|
};
|
|
299
352
|
var FetchUrlSchema = z.union([z.string(), z.instanceof(URL)]).describe("The URL to fetch");
|
|
@@ -639,7 +692,8 @@ var ListAppsSchema = z.object({
|
|
|
639
692
|
),
|
|
640
693
|
search: z.string().optional().describe("Search for apps by name"),
|
|
641
694
|
pageSize: z.number().min(1).optional().describe("Number of apps per page"),
|
|
642
|
-
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages")
|
|
695
|
+
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
696
|
+
cursor: z.string().optional().describe("Cursor to start from")
|
|
643
697
|
}).describe("List all available apps with optional filtering");
|
|
644
698
|
var NeedChoicesSchema = z.object({
|
|
645
699
|
key: z.string().optional(),
|
|
@@ -688,10 +742,10 @@ var NeedSchema = z.object({
|
|
|
688
742
|
]).optional(),
|
|
689
743
|
list: z.boolean().optional()
|
|
690
744
|
});
|
|
691
|
-
|
|
745
|
+
z.object({
|
|
692
746
|
action_url: z.string().optional()
|
|
693
747
|
});
|
|
694
|
-
|
|
748
|
+
z.object({
|
|
695
749
|
can_use: z.boolean().optional()
|
|
696
750
|
});
|
|
697
751
|
var ActionSchema = z.object({
|
|
@@ -708,16 +762,10 @@ var ActionSchema = z.object({
|
|
|
708
762
|
]),
|
|
709
763
|
key: z.string(),
|
|
710
764
|
name: z.string(),
|
|
711
|
-
noun: z.string().optional(),
|
|
712
765
|
description: z.string(),
|
|
713
|
-
description_html: z.string().optional(),
|
|
714
766
|
is_important: z.boolean().optional(),
|
|
715
767
|
is_hidden: z.boolean().optional(),
|
|
716
|
-
|
|
717
|
-
meta: z.string().optional(),
|
|
718
|
-
selected_api: z.string().optional(),
|
|
719
|
-
links: ActionLinksSchema.optional(),
|
|
720
|
-
permissions: ActionPermissionsSchema.optional()
|
|
768
|
+
selected_api: z.string().optional()
|
|
721
769
|
});
|
|
722
770
|
var ChoiceSchema = z.object({
|
|
723
771
|
value: z.union([z.string(), z.number()]),
|
|
@@ -1047,6 +1095,7 @@ var AppItemSchema = withFormatter(
|
|
|
1047
1095
|
return {
|
|
1048
1096
|
title: item.title,
|
|
1049
1097
|
key: item.key,
|
|
1098
|
+
keys: [item.slug, item.key].filter(Boolean),
|
|
1050
1099
|
description: item.description,
|
|
1051
1100
|
details: []
|
|
1052
1101
|
};
|
|
@@ -1081,7 +1130,7 @@ function normalizeImplementationMetaToAppItem(implementationMeta) {
|
|
|
1081
1130
|
}
|
|
1082
1131
|
function normalizeAuthenticationItem(auth, options = {}) {
|
|
1083
1132
|
let appKey = options.app_key;
|
|
1084
|
-
let
|
|
1133
|
+
let appVersion = options.app_version;
|
|
1085
1134
|
if (auth.selected_api) {
|
|
1086
1135
|
const [extractedAppKey, extractedVersion] = splitVersionedKey(
|
|
1087
1136
|
auth.selected_api
|
|
@@ -1089,8 +1138,8 @@ function normalizeAuthenticationItem(auth, options = {}) {
|
|
|
1089
1138
|
if (!appKey) {
|
|
1090
1139
|
appKey = extractedAppKey;
|
|
1091
1140
|
}
|
|
1092
|
-
if (!
|
|
1093
|
-
|
|
1141
|
+
if (!appVersion) {
|
|
1142
|
+
appVersion = extractedVersion;
|
|
1094
1143
|
}
|
|
1095
1144
|
}
|
|
1096
1145
|
const {
|
|
@@ -1111,17 +1160,25 @@ function normalizeAuthenticationItem(auth, options = {}) {
|
|
|
1111
1160
|
// Map marked_stale_at to expired_at
|
|
1112
1161
|
app_key: appKey,
|
|
1113
1162
|
// App key from implementations endpoint or parsed from selected_api
|
|
1114
|
-
|
|
1163
|
+
app_version: appVersion,
|
|
1115
1164
|
// Version from selected_api or provided
|
|
1116
1165
|
user_id: userId
|
|
1117
1166
|
// Map customuser_id to user_id
|
|
1118
1167
|
};
|
|
1119
1168
|
}
|
|
1120
1169
|
function normalizeActionItem(action) {
|
|
1121
|
-
const { name, type, selected_api:
|
|
1170
|
+
const { name, type, selected_api: selectedApi } = action;
|
|
1171
|
+
const [appKey, appVersion] = selectedApi ? splitVersionedKey(selectedApi) : ["", void 0];
|
|
1122
1172
|
return {
|
|
1123
|
-
|
|
1124
|
-
|
|
1173
|
+
// Only include the fields we want - explicitly list them
|
|
1174
|
+
id: action.id,
|
|
1175
|
+
key: action.key,
|
|
1176
|
+
description: action.description,
|
|
1177
|
+
is_important: action.is_important,
|
|
1178
|
+
is_hidden: action.is_hidden,
|
|
1179
|
+
// Transformed fields
|
|
1180
|
+
app_key: appKey,
|
|
1181
|
+
app_version: appVersion,
|
|
1125
1182
|
action_type: type,
|
|
1126
1183
|
title: name,
|
|
1127
1184
|
// Map name to title
|
|
@@ -1261,18 +1318,21 @@ var listAppsPlugin = ({ context }) => {
|
|
|
1261
1318
|
};
|
|
1262
1319
|
var ListActionsSchema = z.object({
|
|
1263
1320
|
appKey: AppKeyPropertySchema.describe(
|
|
1264
|
-
"App key of actions to list (e.g., 'SlackCLIAPI')"
|
|
1321
|
+
"App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
|
|
1265
1322
|
),
|
|
1266
1323
|
actionType: ActionTypePropertySchema.optional().describe(
|
|
1267
1324
|
"Filter actions by type"
|
|
1268
1325
|
),
|
|
1269
1326
|
pageSize: z.number().min(1).optional().describe("Number of actions per page"),
|
|
1270
|
-
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages")
|
|
1327
|
+
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
1328
|
+
cursor: z.string().optional().describe("Cursor to start from")
|
|
1271
1329
|
}).describe("List all actions for a specific app");
|
|
1272
1330
|
var ActionItemSchema = withFormatter(
|
|
1273
|
-
ActionSchema.omit({ type: true, name: true }).extend({
|
|
1331
|
+
ActionSchema.omit({ type: true, name: true, selected_api: true }).extend({
|
|
1274
1332
|
app_key: z.string(),
|
|
1275
|
-
//
|
|
1333
|
+
// App key without version (extracted from selected_api)
|
|
1334
|
+
app_version: z.string().optional(),
|
|
1335
|
+
// Version extracted from selected_api
|
|
1276
1336
|
action_type: ActionSchema.shape.type,
|
|
1277
1337
|
// Mapped from original 'type' field
|
|
1278
1338
|
title: z.string(),
|
|
@@ -1584,7 +1644,8 @@ var ListInputFieldsSchema = z.object({
|
|
|
1584
1644
|
"Current input values that may affect available fields"
|
|
1585
1645
|
),
|
|
1586
1646
|
pageSize: z.number().min(1).optional().describe("Number of input fields per page"),
|
|
1587
|
-
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages")
|
|
1647
|
+
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
1648
|
+
cursor: z.string().optional().describe("Cursor to start from")
|
|
1588
1649
|
}).describe("Get the input fields required for a specific action");
|
|
1589
1650
|
var BaseFieldItemSchema = z.object({
|
|
1590
1651
|
type: z.string(),
|
|
@@ -1871,7 +1932,7 @@ var listInputFieldsPlugin = ({ context }) => {
|
|
|
1871
1932
|
};
|
|
1872
1933
|
var ListAuthenticationsSchema = z.object({
|
|
1873
1934
|
appKey: AppKeyPropertySchema.optional().describe(
|
|
1874
|
-
"App key of authentications to list (e.g., 'SlackCLIAPI')"
|
|
1935
|
+
"App key of authentications to list (e.g., 'SlackCLIAPI' or slug like 'github')"
|
|
1875
1936
|
),
|
|
1876
1937
|
authenticationIds: z.array(z.string()).optional().describe("List of authentication IDs to filter by"),
|
|
1877
1938
|
search: z.string().optional().describe("Search term to filter authentications by title"),
|
|
@@ -1881,7 +1942,8 @@ var ListAuthenticationsSchema = z.object({
|
|
|
1881
1942
|
"Filter by owner, 'me' for your own authentications or a specific user ID"
|
|
1882
1943
|
),
|
|
1883
1944
|
pageSize: z.number().min(1).optional().describe("Number of authentications per page"),
|
|
1884
|
-
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages")
|
|
1945
|
+
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
1946
|
+
cursor: z.string().optional().describe("Cursor to start from")
|
|
1885
1947
|
}).describe("List available authentications with optional filtering");
|
|
1886
1948
|
var AuthenticationItemSchema = withFormatter(
|
|
1887
1949
|
AuthenticationSchema.omit({ selected_api: true, customuser_id: true }).extend(
|
|
@@ -1894,7 +1956,7 @@ var AuthenticationItemSchema = withFormatter(
|
|
|
1894
1956
|
// Mapped from marked_stale_at
|
|
1895
1957
|
app_key: z.string().optional(),
|
|
1896
1958
|
// App key from implementations endpoint
|
|
1897
|
-
|
|
1959
|
+
app_version: z.string().optional(),
|
|
1898
1960
|
// Version extracted from implementation_id
|
|
1899
1961
|
user_id: z.number().optional()
|
|
1900
1962
|
}
|
|
@@ -2015,7 +2077,7 @@ var listAuthenticationsPlugin = ({ context }) => {
|
|
|
2015
2077
|
};
|
|
2016
2078
|
var GetAppSchema = z.object({
|
|
2017
2079
|
appKey: AppKeyPropertySchema.describe(
|
|
2018
|
-
"App key of app to fetch (e.g., 'SlackCLIAPI')"
|
|
2080
|
+
"App key of app to fetch (e.g., 'SlackCLIAPI' or slug like 'github')"
|
|
2019
2081
|
)
|
|
2020
2082
|
}).describe("Get detailed information about a specific app");
|
|
2021
2083
|
|
|
@@ -2154,7 +2216,7 @@ var getAuthenticationPlugin = ({ context }) => {
|
|
|
2154
2216
|
};
|
|
2155
2217
|
var FindFirstAuthenticationSchema = z.object({
|
|
2156
2218
|
appKey: AppKeyPropertySchema.optional().describe(
|
|
2157
|
-
"App key of authentication to find (e.g., 'SlackCLIAPI')"
|
|
2219
|
+
"App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"
|
|
2158
2220
|
),
|
|
2159
2221
|
search: z.string().optional().describe("Search term to filter authentications by title"),
|
|
2160
2222
|
title: z.string().optional().describe("Filter authentications by exact title match"),
|
|
@@ -2199,7 +2261,7 @@ var findFirstAuthenticationPlugin = ({ sdk }) => {
|
|
|
2199
2261
|
};
|
|
2200
2262
|
var FindUniqueAuthenticationSchema = z.object({
|
|
2201
2263
|
appKey: AppKeyPropertySchema.optional().describe(
|
|
2202
|
-
"App key of authentication to find (e.g., 'SlackCLIAPI')"
|
|
2264
|
+
"App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"
|
|
2203
2265
|
),
|
|
2204
2266
|
search: z.string().optional().describe("Search term to filter authentications by title"),
|
|
2205
2267
|
title: z.string().optional().describe("Filter authentications by exact title match"),
|
|
@@ -2257,33 +2319,9 @@ var RunActionSchema = z.object({
|
|
|
2257
2319
|
"Input parameters for the action"
|
|
2258
2320
|
),
|
|
2259
2321
|
pageSize: z.number().min(1).optional().describe("Number of results per page"),
|
|
2260
|
-
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages")
|
|
2322
|
+
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
2323
|
+
cursor: z.string().optional().describe("Cursor to start from")
|
|
2261
2324
|
}).describe("Execute an action with the given inputs");
|
|
2262
|
-
function getStringProperty(obj, key) {
|
|
2263
|
-
if (typeof obj === "object" && obj !== null && key in obj) {
|
|
2264
|
-
const value = obj[key];
|
|
2265
|
-
return typeof value === "string" ? value : void 0;
|
|
2266
|
-
}
|
|
2267
|
-
return void 0;
|
|
2268
|
-
}
|
|
2269
|
-
function formatActionResult(item) {
|
|
2270
|
-
const obj = typeof item === "object" && item !== null ? item : {};
|
|
2271
|
-
const title = getStringProperty(obj, "title") || getStringProperty(obj, "name") || getStringProperty(obj, "label") || getStringProperty(obj, "subject") || "Action Result";
|
|
2272
|
-
return {
|
|
2273
|
-
title,
|
|
2274
|
-
id: getStringProperty(obj, "id"),
|
|
2275
|
-
key: getStringProperty(obj, "key"),
|
|
2276
|
-
description: getStringProperty(obj, "description"),
|
|
2277
|
-
data: item,
|
|
2278
|
-
// Let formatJsonOutput handle the JSON rendering
|
|
2279
|
-
details: []
|
|
2280
|
-
// Not used when data is provided
|
|
2281
|
-
};
|
|
2282
|
-
}
|
|
2283
|
-
var ActionResultItemSchema = withFormatter(
|
|
2284
|
-
z.unknown().describe("Action execution result"),
|
|
2285
|
-
{ format: formatActionResult }
|
|
2286
|
-
);
|
|
2287
2325
|
|
|
2288
2326
|
// src/plugins/runAction/index.ts
|
|
2289
2327
|
async function executeAction(actionOptions) {
|
|
@@ -3515,7 +3553,18 @@ var registryPlugin = ({ sdk, context }) => {
|
|
|
3515
3553
|
title: "Other"
|
|
3516
3554
|
}
|
|
3517
3555
|
};
|
|
3518
|
-
const functions = metaKeys.filter((key) =>
|
|
3556
|
+
const functions = metaKeys.filter((key) => {
|
|
3557
|
+
const property = sdk[key];
|
|
3558
|
+
if (typeof property === "function") {
|
|
3559
|
+
return true;
|
|
3560
|
+
}
|
|
3561
|
+
const [rootKey] = key.split(".");
|
|
3562
|
+
const rootProperty = sdk[rootKey];
|
|
3563
|
+
if (typeof rootProperty === "object" && rootProperty !== null) {
|
|
3564
|
+
return true;
|
|
3565
|
+
}
|
|
3566
|
+
return false;
|
|
3567
|
+
}).map((key) => {
|
|
3519
3568
|
const meta = context.meta[key];
|
|
3520
3569
|
return {
|
|
3521
3570
|
name: key,
|
|
@@ -3610,7 +3659,8 @@ var ListInputFieldChoicesSchema = z.object({
|
|
|
3610
3659
|
page: z.number().int().min(0).optional().describe("Page number for paginated results"),
|
|
3611
3660
|
// Pagination options (SDK-level)
|
|
3612
3661
|
pageSize: z.number().min(1).optional().describe("Number of choices per page"),
|
|
3613
|
-
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages")
|
|
3662
|
+
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
3663
|
+
cursor: z.string().optional().describe("Cursor to start from")
|
|
3614
3664
|
}).describe("Get the available choices for a dynamic dropdown input field");
|
|
3615
3665
|
|
|
3616
3666
|
// src/plugins/listInputFieldChoices/index.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActionProxy } from "./
|
|
1
|
+
import type { ActionProxy } from "./schemas";
|
|
2
2
|
import type { Plugin, GetSdkType } from "../../types/plugin";
|
|
3
3
|
import type { FetchPluginProvides } from "../fetch/index";
|
|
4
4
|
import type { RunActionPluginProvides } from "../runAction/index";
|
|
@@ -8,7 +8,7 @@ export interface AppsPluginProvides {
|
|
|
8
8
|
export declare const appsPlugin: Plugin<GetSdkType<FetchPluginProvides & RunActionPluginProvides>, // requires fetch + runAction in SDK
|
|
9
9
|
{}, // no context requirements
|
|
10
10
|
AppsPluginProvides>;
|
|
11
|
-
export type { ActionExecutionOptions } from "./
|
|
11
|
+
export type { ActionExecutionOptions } from "./schemas";
|
|
12
12
|
export type { ActionExecutionResult } from "../../api/types";
|
|
13
13
|
export interface ZapierSdkApps {
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/apps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/apps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EAEZ,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAGlE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;CACnB;AAwJD,eAAO,MAAM,UAAU,EAAE,MAAM,CAC7B,UAAU,CAAC,mBAAmB,GAAG,uBAAuB,CAAC,EAAE,oCAAoC;AAC/F,EAAE,EAAE,0BAA0B;AAC9B,kBAAkB,CAyBnB,CAAC;AAGF,YAAY,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACxD,YAAY,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAI7D,MAAM,WAAW,aAAa;CAAG"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ActionExecutionInputSchema, AppFactoryInputSchema } from "./schemas";
|
|
1
2
|
import { ZapierValidationError } from "../../types/errors";
|
|
3
|
+
import { ActionResultItemSchema } from "../../schemas/Run";
|
|
2
4
|
function createActionFunction(appKey, actionType, actionKey, options, pinnedAuthId) {
|
|
3
5
|
return (actionOptions = {}) => {
|
|
4
6
|
const { sdk } = options;
|
|
@@ -87,5 +89,24 @@ export const appsPlugin = ({ sdk }) => {
|
|
|
87
89
|
// Return flat structure - apps goes directly to SDK
|
|
88
90
|
return {
|
|
89
91
|
apps: createAppsProxy({ sdk }),
|
|
92
|
+
context: {
|
|
93
|
+
meta: {
|
|
94
|
+
"apps.{appKey}": {
|
|
95
|
+
categories: ["app"],
|
|
96
|
+
packages: ["sdk"],
|
|
97
|
+
type: "function",
|
|
98
|
+
inputSchema: AppFactoryInputSchema,
|
|
99
|
+
returnType: "AppProxy",
|
|
100
|
+
},
|
|
101
|
+
"apps.{appKey}.{actionType}.{actionKey}": {
|
|
102
|
+
categories: ["app"],
|
|
103
|
+
packages: ["sdk"],
|
|
104
|
+
type: "list",
|
|
105
|
+
inputSchema: ActionExecutionInputSchema,
|
|
106
|
+
itemType: "ActionResult",
|
|
107
|
+
outputSchema: ActionResultItemSchema,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
90
111
|
};
|
|
91
112
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ActionExecutionInputSchema: z.ZodObject<{
|
|
3
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4
|
+
authenticationId: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
authenticationId?: number | undefined;
|
|
7
|
+
inputs?: Record<string, unknown> | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
authenticationId?: number | undefined;
|
|
10
|
+
inputs?: Record<string, unknown> | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type ActionExecutionOptions = z.infer<typeof ActionExecutionInputSchema>;
|
|
13
|
+
export declare const AppFactoryInputSchema: z.ZodObject<{
|
|
14
|
+
authenticationId: z.ZodNumber;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
authenticationId: number;
|
|
17
|
+
}, {
|
|
18
|
+
authenticationId: number;
|
|
19
|
+
}>;
|
|
20
|
+
export type AppFactoryInput = z.infer<typeof AppFactoryInputSchema>;
|
|
21
|
+
interface BaseActionTypeProxy {
|
|
22
|
+
[action: string]: (options?: ActionExecutionOptions) => Promise<{
|
|
23
|
+
data: any[];
|
|
24
|
+
nextCursor?: string;
|
|
25
|
+
}> & AsyncIterable<{
|
|
26
|
+
data: any[];
|
|
27
|
+
nextCursor?: string;
|
|
28
|
+
}> & {
|
|
29
|
+
items(): AsyncIterable<any>;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface FetchActionType {
|
|
33
|
+
fetch: (url: string | URL, init?: RequestInit & {
|
|
34
|
+
authenticationId?: number;
|
|
35
|
+
callbackUrl?: string;
|
|
36
|
+
authenticationTemplate?: string;
|
|
37
|
+
}) => Promise<Response>;
|
|
38
|
+
}
|
|
39
|
+
type ActionTypeProxy = BaseActionTypeProxy & Partial<FetchActionType>;
|
|
40
|
+
interface AppProxy {
|
|
41
|
+
[type: string]: ActionTypeProxy;
|
|
42
|
+
}
|
|
43
|
+
interface AppFactory {
|
|
44
|
+
(options: AppFactoryInput): AppProxy;
|
|
45
|
+
}
|
|
46
|
+
type AppProxyWithFactory = AppFactory & AppProxy;
|
|
47
|
+
export interface ActionProxy {
|
|
48
|
+
[app: string]: AppProxyWithFactory;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/apps/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,0BAA0B;;;;;;;;;EAOpC,CAAC;AAGJ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEhF,eAAO,MAAM,qBAAqB;;;;;;EAIgB,CAAC;AAEnD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAGpE,UAAU,mBAAmB;IAC3B,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC;QAC9D,IAAI,EAAE,GAAG,EAAE,CAAC;QACZ,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACpD,KAAK,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;KAC7B,CAAC;CACL;AAGD,UAAU,eAAe;IACvB,KAAK,EAAE,CACL,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,IAAI,CAAC,EAAE,WAAW,GAAG;QACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,KACE,OAAO,CAAC,QAAQ,CAAC,CAAC;CACxB;AAGD,KAAK,eAAe,GAAG,mBAAmB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEtE,UAAU,QAAQ;IAChB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC;CACjC;AAED,UAAU,UAAU;IAClB,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC;CACtC;AAGD,KAAK,mBAAmB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjD,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACpC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const ActionExecutionInputSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
inputs: z.record(z.unknown()).optional(),
|
|
5
|
+
authenticationId: z.number().optional(),
|
|
6
|
+
})
|
|
7
|
+
.describe("Execute an action with the given inputs for the bound app, as an alternative to runAction");
|
|
8
|
+
export const AppFactoryInputSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
authenticationId: z.number(),
|
|
11
|
+
})
|
|
12
|
+
.describe("Bind an authentication ID to an app");
|
|
13
|
+
// Note: AppsPluginSdkExtension removed - now using AppsPluginProvides in index.ts
|
|
@@ -3,7 +3,7 @@ import { AppKeyPropertySchema } from "../../types/properties";
|
|
|
3
3
|
// Pure Zod schema - no resolver metadata!
|
|
4
4
|
export const FindFirstAuthenticationSchema = z
|
|
5
5
|
.object({
|
|
6
|
-
appKey: AppKeyPropertySchema.optional().describe("App key of authentication to find (e.g., 'SlackCLIAPI')"),
|
|
6
|
+
appKey: AppKeyPropertySchema.optional().describe("App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"),
|
|
7
7
|
search: z
|
|
8
8
|
.string()
|
|
9
9
|
.optional()
|
|
@@ -3,7 +3,7 @@ import { AppKeyPropertySchema } from "../../types/properties";
|
|
|
3
3
|
// Pure Zod schema - no resolver metadata!
|
|
4
4
|
export const FindUniqueAuthenticationSchema = z
|
|
5
5
|
.object({
|
|
6
|
-
appKey: AppKeyPropertySchema.optional().describe("App key of authentication to find (e.g., 'SlackCLIAPI')"),
|
|
6
|
+
appKey: AppKeyPropertySchema.optional().describe("App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"),
|
|
7
7
|
search: z
|
|
8
8
|
.string()
|
|
9
9
|
.optional()
|
|
@@ -3,6 +3,6 @@ import { AppKeyPropertySchema } from "../../types/properties";
|
|
|
3
3
|
// Pure Zod schema - no resolver metadata!
|
|
4
4
|
export const GetAppSchema = z
|
|
5
5
|
.object({
|
|
6
|
-
appKey: AppKeyPropertySchema.describe("App key of app to fetch (e.g., 'SlackCLIAPI')"),
|
|
6
|
+
appKey: AppKeyPropertySchema.describe("App key of app to fetch (e.g., 'SlackCLIAPI' or slug like 'github')"),
|
|
7
7
|
})
|
|
8
8
|
.describe("Get detailed information about a specific app");
|
|
@@ -93,7 +93,7 @@ describe("getAuthentication plugin", () => {
|
|
|
93
93
|
label: "My Slack Workspace",
|
|
94
94
|
title: "My Slack Workspace",
|
|
95
95
|
app_key: "SlackCLIAPI",
|
|
96
|
-
|
|
96
|
+
app_version: "1.21.1",
|
|
97
97
|
user_id: undefined, // customuser_id wasn't in mock data
|
|
98
98
|
is_stale: "false", // Original field preserved
|
|
99
99
|
marked_stale_at: null, // Original field preserved
|
|
@@ -7,6 +7,7 @@ import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
|
7
7
|
export interface ListActionsPluginProvides {
|
|
8
8
|
listActions: (options?: ListActionsOptions) => Promise<{
|
|
9
9
|
data: ActionItem[];
|
|
10
|
+
nextCursor?: string;
|
|
10
11
|
}> & AsyncIterable<{
|
|
11
12
|
data: ActionItem[];
|
|
12
13
|
nextCursor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;AAOnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAGxE,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC;QACrD,IAAI,EAAE,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;AAOnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAGxE,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC;QACrD,IAAI,EAAE,UAAU,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC3D,KAAK,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;KACpC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,OAAO,iBAAiB,CAAC;aACvC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,UAAU,CAAC,sBAAsB,CAAC,EAClC;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,EACD,yBAAyB,CAyF1B,CAAC"}
|
|
@@ -9,16 +9,19 @@ export declare const ListActionsSchema: z.ZodObject<{
|
|
|
9
9
|
actionType: z.ZodOptional<z.ZodEnum<["read", "read_bulk", "write", "run", "search", "search_or_write", "search_and_write", "filter"]>>;
|
|
10
10
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
11
11
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
12
13
|
}, "strip", z.ZodTypeAny, {
|
|
13
14
|
appKey: string;
|
|
14
15
|
actionType?: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write" | undefined;
|
|
15
16
|
pageSize?: number | undefined;
|
|
16
17
|
maxItems?: number | undefined;
|
|
18
|
+
cursor?: string | undefined;
|
|
17
19
|
}, {
|
|
18
20
|
appKey: string;
|
|
19
21
|
actionType?: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write" | undefined;
|
|
20
22
|
pageSize?: number | undefined;
|
|
21
23
|
maxItems?: number | undefined;
|
|
24
|
+
cursor?: string | undefined;
|
|
22
25
|
}>;
|
|
23
26
|
export type ListActionsOptions = z.infer<typeof ListActionsSchema>;
|
|
24
27
|
export interface ListActionsPage {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;EAoBoB,CAAC;AAGnD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAGnE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,gBAAgB,GACxB,yBAAyB,GACzB,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,oBAAoB,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;CACnE"}
|
|
@@ -3,7 +3,7 @@ import { AppKeyPropertySchema, ActionTypePropertySchema, } from "../../types/pro
|
|
|
3
3
|
// Pure Zod schema - no resolver metadata!
|
|
4
4
|
export const ListActionsSchema = z
|
|
5
5
|
.object({
|
|
6
|
-
appKey: AppKeyPropertySchema.describe("App key of actions to list (e.g., 'SlackCLIAPI')"),
|
|
6
|
+
appKey: AppKeyPropertySchema.describe("App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"),
|
|
7
7
|
actionType: ActionTypePropertySchema.optional().describe("Filter actions by type"),
|
|
8
8
|
pageSize: z
|
|
9
9
|
.number()
|
|
@@ -15,5 +15,6 @@ export const ListActionsSchema = z
|
|
|
15
15
|
.min(1)
|
|
16
16
|
.optional()
|
|
17
17
|
.describe("Maximum total items to return across all pages"),
|
|
18
|
+
cursor: z.string().optional().describe("Cursor to start from"),
|
|
18
19
|
})
|
|
19
20
|
.describe("List all actions for a specific app");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAWlD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEhD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAWlD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEhD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC;QAC/C,IAAI,EAAE,OAAO,EAAE,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACxD,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;KACjC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR,WAAW,EAAE,OAAO,cAAc,CAAC;aACpC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,EAAE,EACF,cAAc,CAAC,iBAAiB,GAAG,sBAAsB,CAAC,EAC1D,sBAAsB,CA+GvB,CAAC"}
|
|
@@ -12,15 +12,18 @@ export declare const ListAppsSchema: z.ZodObject<{
|
|
|
12
12
|
search: z.ZodOptional<z.ZodString>;
|
|
13
13
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
14
14
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
15
16
|
}, "strip", z.ZodTypeAny, {
|
|
16
17
|
search?: string | undefined;
|
|
17
18
|
pageSize?: number | undefined;
|
|
18
19
|
maxItems?: number | undefined;
|
|
20
|
+
cursor?: string | undefined;
|
|
19
21
|
appKeys?: string[] | undefined;
|
|
20
22
|
}, {
|
|
21
23
|
search?: string | undefined;
|
|
22
24
|
pageSize?: number | undefined;
|
|
23
25
|
maxItems?: number | undefined;
|
|
26
|
+
cursor?: string | undefined;
|
|
24
27
|
appKeys?: string[] | undefined;
|
|
25
28
|
}>;
|
|
26
29
|
export type ListAppsOptions = z.infer<typeof ListAppsSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGnE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGnE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;EAiBmC,CAAC;AAG/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAG7D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC,eAAe,GAAG,SAAS,EAAE,OAAO,CAAC,CAAC;CACtE"}
|
|
@@ -7,6 +7,7 @@ import type { ManifestPluginProvides } from "../manifest";
|
|
|
7
7
|
export interface ListAuthenticationsPluginProvides {
|
|
8
8
|
listAuthentications: (options?: ListAuthenticationsOptions) => Promise<{
|
|
9
9
|
data: AuthenticationItem[];
|
|
10
|
+
nextCursor?: string;
|
|
10
11
|
}> & AsyncIterable<{
|
|
11
12
|
data: AuthenticationItem[];
|
|
12
13
|
nextCursor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listAuthentications/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,yBAAyB,EACzB,KAAK,0BAA0B,EAEhC,MAAM,WAAW,CAAC;AAUnB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI1D,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,0BAA0B,KAAK,OAAO,CAAC;QACrE,IAAI,EAAE,kBAAkB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listAuthentications/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,yBAAyB,EACzB,KAAK,0BAA0B,EAEhC,MAAM,WAAW,CAAC;AAUnB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI1D,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,0BAA0B,KAAK,OAAO,CAAC;QACrE,IAAI,EAAE,kBAAkB,EAAE,CAAC;QAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACnE,KAAK,IAAI,aAAa,CAAC,kBAAkB,CAAC,CAAC;KAC5C,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,mBAAmB,EAAE;gBACnB,WAAW,EAAE,OAAO,yBAAyB,CAAC;aAC/C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAC5C,UAAU,CAAC,sBAAsB,CAAC,EAClC;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,EACD,iCAAiC,CAyGlC,CAAC"}
|