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
41 changes: 41 additions & 0 deletions components/github/actions/get-current-user/get-current-user.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import github from "../../github.app.mjs";

const DEFAULT_ORGS_LIMIT = 20;
const DEFAULT_TEAMS_LIMIT = 20;

export default {
key: "github-get-current-user",
name: "Get Current User",
description: "Gather a full snapshot of the authenticated GitHub actor, combining `/user`, `/user/orgs`, and `/user/teams`. Returns profile metadata (login, name, email, company, plan, creation timestamps) and trimmed lists of organizations and teams for quick role awareness. Helpful when you need to validate which user is calling the API, adapt behavior based on their org/team memberships, or provide LLMs with grounding before repository operations. [See the documentation](https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user).",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
github,
},
async run({ $ }) {
const [
user,
organizations,
teams,
] = await Promise.all([
this.github.getAuthenticatedUser(),
this.github.getOrganizations()
.then((orgs) => orgs.slice(0, DEFAULT_ORGS_LIMIT)),
this.github.getTeams()
.then((teamsResponse) => teamsResponse.slice(0, DEFAULT_TEAMS_LIMIT)),
]);

$.export("$summary", `Retrieved GitHub user ${user.login}`);

return {
user,
organizations,
teams,
};
},
};
2 changes: 1 addition & 1 deletion components/github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/github",
"version": "1.8.0",
"version": "1.8.1",
"description": "Pipedream Github Components",
"main": "github.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import googleCalendar from "../../google_calendar.app.mjs";
import constants from "../../common/constants.mjs";

const DEFAULT_CALENDAR_SAMPLE_LIMIT = 25;

export default {
key: "google_calendar-get-current-user",
name: "Get Current User",
description: "Retrieve information about the authenticated Google Calendar account, including the primary calendar (summary, timezone, ACL flags), a list of accessible calendars, user-level settings (timezone, locale, week start), and the color palette that controls events and calendars. Ideal for confirming which calendar account is in use, customizing downstream scheduling, or equipping LLMs with the user’s context (timezones, available calendars) prior to creating or updating events. [See the documentation](https://developers.google.com/calendar/api/v3/reference/calendars/get).",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
googleCalendar,
},
async run({ $ }) {
const [
primaryCalendar,
calendarList,
settings,
colors,
] = await Promise.all([
this.googleCalendar.getCalendar({
calendarId: "primary",
}),
this.googleCalendar.listCalendars({
maxResults: DEFAULT_CALENDAR_SAMPLE_LIMIT,
}),
this.googleCalendar.requestHandler({
api: constants.API.SETTINGS.NAME,
method: constants.API.SETTINGS.METHOD.LIST,
}),
this.googleCalendar.requestHandler({
api: constants.API.COLORS.NAME,
method: constants.API.COLORS.METHOD.GET,
}),
]);

const timezoneSetting = settings?.items?.find?.((setting) => setting.id === "timezone")?.value;
const localeSetting = settings?.items?.find?.((setting) => setting.id === "locale")?.value;

const summaryName = primaryCalendar?.summary || primaryCalendar?.id;
$.export("$summary", `Retrieved Google Calendar user ${summaryName}`);

return {
primaryCalendar,
calendars: calendarList?.items ?? [],
settings: settings?.items ?? [],
timezone: timezoneSetting || primaryCalendar?.timeZone,
locale: localeSetting,
colors,
};
},
};
2 changes: 1 addition & 1 deletion components/google_calendar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/google_calendar",
"version": "0.5.12",
"version": "0.5.13",
"description": "Pipedream Google_calendar Components",
"main": "google_calendar.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import googleDrive from "../../google_drive.app.mjs";

const ABOUT_FIELDS = "user,storageQuota";

export default {
key: "google_drive-get-current-user",
name: "Get Current User",
description: "Retrieve Google Drive account metadata for the authenticated user via `about.get`, including display name, email, permission ID, and storage quota. Useful when flows or agents need to confirm the active Google identity or understand available storage. [See the documentation](https://developers.google.com/drive/api/v3/reference/about/get).",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
googleDrive,
},
async run({ $ }) {
const about = await this.googleDrive.getAbout(ABOUT_FIELDS);

const summaryName =
about?.user?.displayName
|| about?.user?.emailAddress
|| about?.user?.permissionId;
$.export("$summary", `Retrieved Google Drive user ${summaryName}`);

return {
about,
};
},
};
2 changes: 1 addition & 1 deletion components/google_drive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/google_drive",
"version": "1.1.1",
"version": "1.1.2",
"description": "Pipedream Google_drive Components",
"main": "google_drive.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import googleSheets from "../../google_sheets.app.mjs";

const ABOUT_FIELDS = "user,storageQuota";

export default {
key: "google_sheets-get-current-user",
name: "Get Current User",
description: "Retrieve Google Sheets account metadata for the authenticated user by calling Drive's `about.get`, returning the user profile (display name, email, permission ID) and storage quota information. Helpful when you need to verify which Google account is active, tailor sheet operations to available storage, or give an LLM clear context about the user identity before composing read/write actions. [See the Drive API documentation](https://developers.google.com/drive/api/v3/reference/about/get).",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
googleSheets,
},
async run({ $ }) {
const about = await this.googleSheets.getAbout(ABOUT_FIELDS);

const summaryName =
about?.user?.displayName
|| about?.user?.emailAddress
|| about?.user?.permissionId;
$.export("$summary", `Retrieved Google Sheets user ${summaryName}`);

return {
about,
};
},
};
2 changes: 1 addition & 1 deletion components/google_sheets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/google_sheets",
"version": "0.9.1",
"version": "0.9.2",
"description": "Pipedream Google_sheets Components",
"main": "google_sheets.app.mjs",
"keywords": [
Expand Down
47 changes: 47 additions & 0 deletions components/linear/actions/get-current-user/get-current-user.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import linearApp from "../../linear.app.mjs";

const DEFAULT_CONNECTION_LIMIT = 50;

export default {
key: "linear-get-current-user",
name: "Get Current User",
description: "Retrieve rich context about the authenticated Linear user, including core profile fields, recent timestamps, direct team memberships, and high-level organization settings. Returns the user object, a paginated team list (with names, keys, cycle configs, etc.), associated team memberships, and organization metadata such as auth defaults and SCIM/SAML flags. Use this when your workflow or agent needs to understand who is currently authenticated, which teams they belong to, or what workspace policies might influence subsequent Linear actions. See Linear's GraphQL viewer docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api).",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
linearApp,
},
async run({ $ }) {
const client = this.linearApp.client();
const viewer = await client.viewer;

const [
organization,
teamsConnection,
teamMembershipsConnection,
] = await Promise.all([
viewer.organization,
viewer.teams({
first: DEFAULT_CONNECTION_LIMIT,
}),
viewer.teamMemberships({
first: DEFAULT_CONNECTION_LIMIT,
}),
]);

const summaryIdentifier = viewer.name || viewer.displayName || viewer.email || viewer.id;
$.export("$summary", `Retrieved Linear user ${summaryIdentifier}`);

return {
user: viewer,
organization,
teams: teamsConnection,
teamMemberships: teamMembershipsConnection,
};
},
};
2 changes: 1 addition & 1 deletion components/linear/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/linear",
"version": "0.8.0",
"version": "0.8.1",
"description": "Pipedream Linear Components",
"main": "linear.app.mjs",
"keywords": [
Expand Down
42 changes: 42 additions & 0 deletions components/notion/actions/get-current-user/get-current-user.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import notion from "../../notion.app.mjs";

export default {
key: "notion-get-current-user",
name: "Get Current User",
description: "Retrieve the Notion identity tied to the current OAuth token, returning the full `users.retrieve` payload for `me` (person or bot). Includes the user ID, name, avatar URL, type (`person` vs `bot`), and workspace ownership metadata—useful for confirming which workspace is connected, adapting downstream queries, or giving an LLM the context it needs about who is operating inside Notion. [See the documentation](https://developers.notion.com/reference/get-user).",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
notion,
},
async run({ $ }) {
const response = await this.notion.getUser("me");

const displayName = response?.name || response?.bot?.workspace_name || response?.id;
const ownerUser = response?.bot?.owner?.user;
const ownerName = ownerUser?.name || ownerUser?.id;
const ownerEmail = ownerUser?.person?.email;
const summaryParts = [
response?.bot?.workspace_name && `workspace **${response.bot.workspace_name}**`,
(() => {
if (!ownerName && !ownerEmail) return null;
if (ownerName && ownerEmail) return `owner ${ownerName} (<${ownerEmail}>)`;
if (ownerName) return `owner ${ownerName}`;
return `owner <${ownerEmail}>`;
})(),
].filter(Boolean);

const summaryContext = summaryParts.length
? ` — ${summaryParts.join(", ")}`
: "";

$.export("$summary", `Retrieved Notion ${response?.type || "user"} **${displayName}**${summaryContext}`);

return response;
},
};
2 changes: 1 addition & 1 deletion components/notion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/notion",
"version": "1.0.3",
"version": "1.0.4",
"description": "Pipedream Notion Components",
"main": "notion.app.mjs",
"keywords": [
Expand Down
68 changes: 68 additions & 0 deletions components/slack/actions/get-current-user/get-current-user.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import slack from "../../slack.app.mjs";

export default {
key: "slack-get-current-user",
name: "Get Current User",
description: "Retrieve comprehensive context about the authenticated Slack member, combining `auth.test`, `users.info`, `users.profile.get`, and `team.info` payloads. Returns the user’s profile (name variants, email, locale, timezone, status, admin flags), raw auth test data, and workspace metadata (domain, enterprise info, icons). Ideal when you need to confirm which user token is active, tailor messages to their locale/timezone, or ground an LLM in the member’s role and workspace before executing other Slack actions. [See Slack API docs](https://api.slack.com/methods/auth.test).",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
slack,
},
async run({ $ }) {
const authContext = await this.slack.authTest();

const userId = authContext.user_id || authContext.user;
if (!userId) {
throw new Error(`Unable to determine user ID from auth context. Received: ${JSON.stringify(authContext)}`);
}

let userInfo;
try {
userInfo = await this.slack.usersInfo({
user: userId,
include_locale: true,
});
} catch (error) {
// Gracefully degrade if scope not available
}

let userProfile;
try {
userProfile = await this.slack.getUserProfile({
user: userId,
});
} catch (error) {
// Gracefully degrade if scope not available
}

let teamInfo;
try {
teamInfo = await this.slack.getTeamInfo();
} catch (error) {
// Gracefully degrade if scope not available
}

const user = userInfo?.user;
const profile = userProfile?.profile ?? user?.profile;
const summaryName =
profile?.real_name_normalized
|| profile?.display_name_normalized
|| authContext.user
|| userId;

$.export("$summary", `Retrieved Slack user ${summaryName}`);

return {
authContext,
user,
profile,
team: teamInfo?.team,
};
},
};
2 changes: 1 addition & 1 deletion components/slack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/slack",
"version": "0.10.2",
"version": "0.10.3",
"description": "Pipedream Slack Components",
"main": "slack.app.mjs",
"keywords": [
Expand Down
Loading