Skip to content

Commit 047fc84

Browse files
committed
new action list-policies
1 parent 6e80efa commit 047fc84

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { defineAction } from "@pipedream/types";
2+
import expensify from "../../app/expensify.app";
3+
4+
export default defineAction({
5+
key: "expensify-list-policies",
6+
name: "List Policies",
7+
description: "Retrieves a list of policies. [See the documentation](https://integrations.expensify.com/Integration-Server/doc/#policy-list-getter)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
expensify,
12+
adminOnly: {
13+
type: "boolean",
14+
label: "Admin Only",
15+
description: "Whether or not to only get policies for which the user is an admin",
16+
optional: true,
17+
},
18+
userEmail: {
19+
type: "string",
20+
label: "User Email",
21+
description: "Specifies the user to gather the policy list for. You must have been granted third-party access by that user/company domain beforehand.",
22+
optional: true,
23+
},
24+
},
25+
async run({ $ }) {
26+
const response = await this.expensify.getPolicyList({
27+
$,
28+
userEmail: this.userEmail,
29+
adminOnly: this.adminOnly,
30+
});
31+
32+
$.export("$summary", `Successfully retrieved ${response?.policyList?.length || 0} policies`);
33+
34+
return response?.policyList || [];
35+
},
36+
})

components/expensify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/expensify",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Pipedream Expensify Components",
55
"main": "dist/app/expensify.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)