Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions components/expensify/actions/list-policies/list-policies.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { defineAction } from "@pipedream/types";
import expensify from "../../app/expensify.app";

export default defineAction({
key: "expensify-list-policies",
name: "List Policies",
description: "Retrieves a list of policies. [See the documentation](https://integrations.expensify.com/Integration-Server/doc/#policy-list-getter)",
version: "0.0.1",
type: "action",
props: {
expensify,
adminOnly: {
type: "boolean",
label: "Admin Only",
description: "Whether or not to only get policies for which the user is an admin",
optional: true,
},
userEmail: {
type: "string",
label: "User Email",
description: "Specifies the user to gather the policy list for. You must have been granted third-party access by that user/company domain beforehand.",
optional: true,
},
},
async run({ $ }) {
const response = await this.expensify.getPolicyList({
$,
userEmail: this.userEmail,
adminOnly: this.adminOnly,
});

$.export("$summary", `Successfully retrieved ${response?.policyList?.length || 0} policies`);

return response?.policyList || [];
},
})
2 changes: 1 addition & 1 deletion components/expensify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/expensify",
"version": "0.2.0",
"version": "0.3.0",
"description": "Pipedream Expensify Components",
"main": "dist/app/expensify.app.mjs",
"keywords": [
Expand Down
Loading