Skip to content

Commit 01cef9f

Browse files
some new get-current-user actions (#19553)
* some new get-current-user actions none have been tested yet * Improve get-current-user action descriptions and trim response shapes Update descriptions across 10 get-current-user actions and box list-folder-items to be AI-agent-friendly: explain when to call, what fields to use downstream, and how they connect to other actions. Trim Microsoft Graph and ServiceNow responses to return only relevant fields. Use Confluence app's _makeRequest instead of raw axios. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix {{ts}} version placeholder in box list-folder-items Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Bump package versions for new get-current-user actions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix Microsoft Graph actions to use client() SDK and trim noisy return fields - Outlook, Outlook Calendar, SharePoint: replace _makeRequest() (doesn't exist on these apps) with client().api("/me").select(...).get() - Gmail: drop redundant `email` field (keep `emailAddress`), drop `historyId` - Jira: drop `avatarUrls` and `accountType` - Salesforce: drop `nickname` (auto-generated) and `picture` (placeholder) - Zoom: drop `type` (opaque number) and `language` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix confluence get-current-user to use /me endpoint The /wiki/rest/api/user/current endpoint requires read:confluence-user scope. Switch to the Atlassian platform /me endpoint which only needs read:me (already granted). Returns the same accountId needed for downstream filtering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Bump confluence package version to 0.4.2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 558e9bc commit 01cef9f

29 files changed

Lines changed: 500 additions & 18 deletions

File tree

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import app from "../../box.app.mjs";
2+
import constants from "../../common/constants.mjs";
3+
4+
export default {
5+
key: "box-list-folder-items",
6+
name: "List Folder Items",
7+
description: "Lists files, folders, and web links in a Box folder. Use `0` for the root folder. Returns one page of results (default 100, max 1000). To find items by name or metadata across all folders, use **Search Content** instead. [See the documentation](https://developer.box.com/reference/get-folders-id-items/).",
8+
version: "0.0.1",
9+
type: "action",
10+
annotations: {
11+
destructiveHint: false,
12+
openWorldHint: true,
13+
readOnlyHint: true,
14+
},
15+
props: {
16+
app,
17+
folderId: {
18+
propDefinition: [
19+
app,
20+
"parentId",
21+
],
22+
label: "Folder",
23+
description: "The folder to list items from. Use `0` for the root folder.",
24+
optional: false,
25+
},
26+
fields: {
27+
propDefinition: [
28+
app,
29+
"fields",
30+
],
31+
description: "A comma-separated list of attributes to include in the response (e.g. `id,type,name,size,created_at`). [See available fields](https://developer.box.com/reference/get-folders-id-items/#param-fields).",
32+
},
33+
sort: {
34+
type: "string",
35+
label: "Sort",
36+
description: "Defines the attribute by which items are sorted",
37+
optional: true,
38+
options: [
39+
{
40+
label: "ID",
41+
value: "id",
42+
},
43+
{
44+
label: "Name",
45+
value: "name",
46+
},
47+
{
48+
label: "Date",
49+
value: "date",
50+
},
51+
{
52+
label: "Size",
53+
value: "size",
54+
},
55+
],
56+
},
57+
direction: {
58+
type: "string",
59+
label: "Direction",
60+
description: "The direction to sort results in",
61+
optional: true,
62+
options: [
63+
{
64+
label: "Ascending",
65+
value: "ASC",
66+
},
67+
{
68+
label: "Descending",
69+
value: "DESC",
70+
},
71+
],
72+
},
73+
limit: {
74+
type: "integer",
75+
label: "Limit",
76+
description: "The maximum number of items to return per page (max 1000)",
77+
optional: true,
78+
default: 100,
79+
max: 1000,
80+
},
81+
},
82+
async run({ $ }) {
83+
const params = {
84+
limit: this.limit || constants.pageSize,
85+
usemarker: true,
86+
};
87+
88+
if (this.fields?.length) {
89+
params.fields = Array.isArray(this.fields)
90+
? this.fields.join(",")
91+
: this.fields;
92+
}
93+
if (this.sort) {
94+
params.sort = this.sort;
95+
}
96+
if (this.direction) {
97+
params.direction = this.direction;
98+
}
99+
100+
const response = await this.app.getItems({
101+
$,
102+
folderId: this.folderId,
103+
params,
104+
});
105+
106+
const itemCount = response.entries?.length || 0;
107+
$.export("$summary", `Retrieved ${itemCount} item${itemCount === 1
108+
? ""
109+
: "s"} from folder`);
110+
111+
return response;
112+
},
113+
};

components/box/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/box",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"description": "Pipedream Box Components",
55
"main": "box.app.mjs",
66
"keywords": [
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import confluence from "../../confluence.app.mjs";
2+
3+
export default {
4+
key: "confluence-get-current-user",
5+
name: "Get Current User",
6+
description: "Returns the authenticated Confluence user's account ID, display name, email, and cloud ID. Call this first when the user says 'my pages', 'my posts', or needs to scope queries to themselves. Use the returned `accountId` to filter results from **Search Content** or **Get Pages**. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-users/#api-wiki-rest-api-user-current-get).",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
confluence,
16+
},
17+
async run({ $ }) {
18+
const cloudId = await this.confluence.getCloudId({
19+
$,
20+
});
21+
22+
const user = await this.confluence._makeRequest({
23+
$,
24+
url: "https://api.atlassian.com/me",
25+
});
26+
27+
const summaryName = user.name || user.email || user.account_id;
28+
$.export("$summary", `Retrieved user ${summaryName}`);
29+
30+
return {
31+
cloudId,
32+
accountId: user.account_id,
33+
name: user.name,
34+
email: user.email,
35+
};
36+
},
37+
};

components/confluence/package.json

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

components/dataforb2b/dataforb2b.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/fleetbase/fleetbase.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import gmail from "../../gmail.app.mjs";
2+
3+
export default {
4+
key: "gmail-get-current-user",
5+
name: "Get Current User",
6+
description: "Returns the authenticated Gmail user's name, email address, and mailbox stats (total messages and threads). Call this first when the user says 'my emails', 'my inbox', or needs identity context. Use the returned `emailAddress` to identify the user's own messages in **Find Email** results. [See the documentation](https://developers.google.com/gmail/api/reference/rest/v1/users/getProfile).",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
gmail,
16+
},
17+
async run({ $ }) {
18+
const [
19+
userInfo,
20+
profile,
21+
] = await Promise.all([
22+
this.gmail.userInfo(),
23+
this.gmail.getProfile(),
24+
]);
25+
26+
const summaryName = userInfo.name || userInfo.email || profile.emailAddress;
27+
$.export("$summary", `Retrieved user ${summaryName}`);
28+
29+
return {
30+
name: userInfo.name,
31+
emailAddress: profile.emailAddress,
32+
messagesTotal: profile.messagesTotal,
33+
threadsTotal: profile.threadsTotal,
34+
};
35+
},
36+
};

components/gmail/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/gmail",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Pipedream Gmail Components",
55
"main": "gmail.app.mjs",
66
"keywords": [
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import jira from "../../jira.app.mjs";
2+
3+
export default {
4+
key: "jira-get-current-user",
5+
name: "Get Current User",
6+
description: "Returns the authenticated Jira user's account ID, display name, email, and active status. Call this first when the user says 'my issues', 'assigned to me', or needs their Jira identity. Use the returned `accountId` with **Search Issues with JQL** (e.g. `assignee = '{accountId}'`) or **Assign Issue**. Requires a Cloud ID to identify the Jira site. [See the documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/#api-rest-api-3-myself-get).",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
jira,
16+
cloudId: {
17+
propDefinition: [
18+
jira,
19+
"cloudId",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const user = await this.jira._makeRequest({
25+
$,
26+
cloudId: this.cloudId,
27+
path: "/myself",
28+
});
29+
30+
const summaryName = user.displayName || user.emailAddress || user.accountId;
31+
$.export("$summary", `Retrieved user ${summaryName}`);
32+
33+
return {
34+
accountId: user.accountId,
35+
displayName: user.displayName,
36+
emailAddress: user.emailAddress,
37+
active: user.active,
38+
timeZone: user.timeZone,
39+
};
40+
},
41+
};

components/jira/package.json

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

0 commit comments

Comments
 (0)