-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add optional file download URL to file-related source emits #18269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds optional Include Link/File Stash support to many file-related sources (new props, stash helpers, and stashFile/stashAttachment methods), app-level download helpers, dependency bumps, multiple version updates, and several emission loops converted to awaited/sequential emits. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Src as Source
participant API as Service API
participant FS as File Stash (dir)
participant E as Emitter
Note over Src: includeLink = false
Src->>API: fetch event / file metadata
Src-->>E: emit event (no file link)
rect rgba(200,235,255,0.18)
Note over Src: includeLink = true
Src->>API: retrieve file content (stream/bytes)
Src->>FS: dir.open(path).fromReadableStream(...) / write
FS-->>Src: File.withoutPutUrl().withGetUrl()
Src-->>E: emit event with file.get_url
end
sequenceDiagram
autonumber
participant Poll as Polling Source
participant E as Emitter
Poll->>Poll: fetch batch
loop per item
Poll->>E: await emitEvent(item)
E-->>Poll: resolve / reject
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks (3 passed, 2 warnings)❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (36)
✅ Files skipped from review due to trivial changes (8)
🚧 Files skipped from review as they are similar to previous changes (28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 29
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs (1)
15-16
: User-facing text links to Delete action but labels it “Move File to Trash”.
The alert should say “Delete File” to avoid confusion.Apply:
- content: "If you want to **permanently** delete a file instead, use the **[Move File to Trash](https://pipedream.com/apps/google-drive/actions/delete-file)** action.", + content: "If you want to **permanently** delete a file instead, use the **[Delete File](https://pipedream.com/apps/google-drive/actions/delete-file)** action.",components/google_drive/actions/download-file/download-file.mjs (1)
1-159
: Remove the npm “stream” dependency from all components’ package.json
Node.js provides the built-instream
module; the npm “stream” package shadows it and must be removed from everycomponents/**/package.json
.components/google_drive/actions/delete-file/delete-file.mjs (1)
38-38
: Fix typo in $summary (missing closing parenthesis)User-facing message currently renders like “(ID: 123” without “)”.
Apply:
- $.export("$summary", `Successfully deleted file (ID: ${fileId}`); + $.export("$summary", `Successfully deleted file (ID: ${fileId})`);components/egnyte/actions/upload-file/upload-file.mjs (1)
21-21
: Close the inline code fence in descriptionBacktick around the example path isn’t closed; minor docs polish.
- description: "The full path to the folder where the file should be uploaded. Example: `/Shared/Documents", + description: "The full path to the folder where the file should be uploaded. Example: `/Shared/Documents`",components/google_drive/actions/search-shared-drives/search-shared-drives.mjs (1)
15-16
: Fix typo in user-facing description“shard drive-specific” → “shared drive-specific”.
Apply this diff:
- "The [shared drives](https://support.google.com/a/users/answer/9310351) search query. See [query terms](https://developers.google.com/drive/api/v3/ref-search-terms#drive_properties) for a list of shard drive-specific query terms.", + "The [shared drives](https://support.google.com/a/users/answer/9310351) search query. See [query terms](https://developers.google.com/drive/api/v3/ref-search-terms#drive_properties) for a list of shared drive-specific query terms.",components/microsoft_outlook/sources/new-attachment-received/new-attachment-received.mjs (1)
100-105
: Fix meta id: contentId can be null for standard attachments.Use item.id (stable) to avoid missing/duplicated events under dedupe: "unique".
- generateMeta(item) { + generateMeta(item) { return { - id: item.contentId, + id: item.id, summary: `New attachment ${item.name}`, ts: Date.parse(item.messageReceivedDateTime), }; },
🧹 Nitpick comments (33)
components/zoho_desk/sources/common/common-polling.mjs (2)
56-58
: Isolate per-resource failures so one bad item doesn’t abort the batch.A single throw in
processEvent
will currently stop all remaining emissions. Consider continuing on error with logging.- for (const resource of filteredResources) { - await this.processEvent(resource); - } + for (const resource of filteredResources) { + try { + await this.processEvent(resource); + } catch (err) { + this.$logger?.error?.("Zoho Desk: processEvent failed", { err, resourceId: resource?.id }); + } + }
51-55
: Nit: “lastResource” reads as tail; it’s actually the first (newest).Minor naming mismatch can confuse future maintainers. Consider
newestResource
orfirstResource
.- const [ - lastResource, - ] = resources; + const [newestResource] = resources; ... - if (lastResource) { + if (newestResource) { ... - } = lastResource; + } = newestResource;components/gmail/sources/new-sent-email/new-sent-email.mjs (1)
8-8
: Fix typo in user-facing description (“emited” → “emitted”).This shows up in the UI/marketplace.
- description: "Emit new event for each new email sent. (Maximum of 100 events emited per execution)", + description: "Emit new event for each new email sent. (Maximum of 100 events emitted per execution)",components/google_drive/actions/download-file/download-file.mjs (1)
2-3
: Prefer native promises API for streams.Use node:stream/promises.pipeline instead of promisifying callback API. Clearer and avoids extra util import.
-import stream from "stream"; -import { promisify } from "util"; +import { pipeline as pipelinePromise } from "node:stream/promises"; @@ - const pipeline = promisify(stream.pipeline); + const pipeline = pipelinePromise;Also applies to: 150-154
components/egnyte/actions/create-folder/create-folder.mjs (1)
18-20
: Guard against empty folderPath to avoid TypeErrorAccessing
this.folderPath[0]
will throw if an empty string or undefined slips through. Add a minimal validation.async run({ $ }) { - const folderPath = this.folderPath[0] === "/" + if (!this.folderPath || typeof this.folderPath !== "string" || this.folderPath.length === 0) { + throw new Error("Folder Path is required and must be a non-empty string."); + } + const folderPath = this.folderPath[0] === "/" ? this.folderPath.slice(1) : this.folderPath;components/google_drive/sources/new-or-modified-files/test-event.mjs (1)
1-1
: Nit: remove double space afterexport default
.
Minor style cleanup for consistency.Apply:
-export default JSON.parse("{ +export default JSON.parse("{components/egnyte/actions/upload-file/upload-file.mjs (1)
23-29
: Remove or use the unused syncDir propIt’s defined but unused; consider removing to reduce confusion, or document intended future use.
- syncDir: - { - type: "dir", - accessMode: "read", - sync: true, - optional: true, - },components/google_drive/actions/create-file-from-text/create-file-from-text.mjs (1)
8-8
: Version bump only — OK.Import from Node’s core "stream" is correct; no need for an npm "stream" dependency.
For consistency with the guidance above, ensure no package.json adds "stream" as a dependency for this import pattern.
components/google_drive/actions/update-file/update-file.mjs (1)
143-145
: Fix swapped name/id in success summaryWhen a new name is provided, the summary prints the file ID instead of the name. Prefer name-first, fall back to ID.
Apply this diff:
- $.export("$summary", `Successfully updated the file, "${name ? resp.id : resp.name}"`); + $.export("$summary", `Successfully updated the file "${resp?.name ?? resp?.id}"`);components/aws/.upm/store.json (1)
1-1
: Avoid formatting-only churn in generated metadata.This appears to be whitespace-only. Consider reverting to minimize noisy diffs unless required by tooling.
components/gmail/sources/new-labeled-email/new-labeled-email.mjs (2)
27-27
: Grammar nit: fix description phrasing.
“...makes it easier for LLMs work with.” → “...makes it easier for LLMs to work with.”- description: "Convert the payload response into a single text field. **This reduces the size of the payload and makes it easier for LLMs work with.**", + description: "Convert the payload response into a single text field. **This reduces the size of the payload and makes it easier for LLMs to work with.**",
40-44
: Fix stray quote in user-facing summary.
Remove the trailing double quote.- summary: `A new message with ID: ${message.id} was labeled"`, + summary: `A new message with ID: ${message.id} was labeled.`,components/microsoft_outlook/sources/common/common-new-email.mjs (2)
28-28
: Awaiting emitEvent changes failure semantics—confirm intent.
Deploy will now fail fast on the first emission error. If that’s desired, LGTM. If not, wrap with try/catch or collect results.- await this.emitEvent(item); + try { + await this.emitEvent(item); + } catch (err) { + console.warn(`emitEvent failed during deploy: ${err.message}`); + }
21-23
: Align deploy sample size with PR guidance (~10).
Current pageSize is 25; consider 10 to reduce noise and cost on first deploy.- pageSize: 25, + pageSize: 10,components/gmail/sources/common/polling-history.mjs (1)
190-191
: Optional: isolate per-message emission failures.
Prevents one bad message from aborting the run; logs and continues.- await this.emitEvent(message); + try { + await this.emitEvent(message); + } catch (err) { + console.warn(`emitEvent failed for message ${id}: ${err.message}`); + }components/egnyte/egnyte.app.mjs (1)
58-66
: Encode path segments to support spaces/special characters; optionally set Accept header.Unencoded
folderPath
/filename
can break URLs. At minimum, encodefilename
.Apply this diff:
return this._makeRequest({ - path: `/fs-content/${folderPath}/${filename}`, + path: `/fs-content/${folderPath}/${encodeURIComponent(filename)}`, responseType: "arraybuffer", + headers: { Accept: "application/octet-stream" }, ...opts, });If
folderPath
may contain spaces, consider encoding its segments upstream.components/zoho_workdrive/zoho_workdrive.app.mjs (1)
164-172
: Minor: prefer first-class absolute URL support and encode fileId.Current
_makeRequest
always builds a base URL first, then you override it viaurl
. Make_makeRequest
accepturl
explicitly and encodefileId
to avoid errors.Apply this localized improvement to encode
fileId
:- return this._makeRequest({ - url: `https://download.${this.$auth.base_api_uri}/v1/workdrive/download/${fileId}`, + return this._makeRequest({ + url: `https://download.${this.$auth.base_api_uri}/v1/workdrive/download/${encodeURIComponent(fileId)}`, responseType: "arraybuffer", ...args, });Optionally, update
_makeRequest
(outside this hunk) to accepturl
:async _makeRequest({ url, path, params, headers, ...opts }) { const config = { url: url ?? this._apiUrl(path, params), headers: this._getHeaders(headers), ...opts, }; const { data } = await axios(config); return data; }components/zoho_workdrive/actions/download-file/download-file.mjs (1)
8-9
: Fix typo in action name.“Direcory” → “Directory”.
- name: "Download File to Tmp Direcory", + name: "Download File to Tmp Directory",components/microsoft_outlook/sources/new-attachment-received/new-attachment-received.mjs (2)
72-91
: Avoid unnecessary base64 round-trip; use Buffer directly.getAttachment with responseType: "arraybuffer" returns binary. Converting to base64 and back wastes CPU and memory.
- const messageAttachment = await this.microsoftOutlook.getAttachment({ + const messageAttachment = await this.microsoftOutlook.getAttachment({ messageId: item.messageId, attachmentId: item.id, responseType: "arraybuffer", }); - const rawcontent = messageAttachment.toString("base64"); - const buffer = Buffer.from(rawcontent, "base64"); + const buffer = Buffer.isBuffer(messageAttachment) + ? messageAttachment + : Buffer.from(messageAttachment);
126-128
: Sequential emit is fine; consider batching only if needed.Current approach prioritizes simplicity and correctness.
components/gmail/sources/new-attachment-received/new-attachment-received.mjs (1)
80-101
: Stash implementation is solid; minor path hardening optional.Current path uses filename directly; consider normalizing to avoid unexpected path separators in rare cases.
- const filepath = `${messageId}-${attachment.partId}/${attachment.filename}`; + const safeName = attachment.filename?.replace?.(/[\\/]/g, "_") || "attachment"; + const filepath = `${messageId}-${attachment.partId}/${safeName}`;components/egnyte/sources/new-file-in-folder/new-file-in-folder.mjs (3)
2-3
: Prefer node:stream import (minor)Use node: protocol for core modules for clarity.
-import { Readable } from "stream"; +import { Readable } from "node:stream";
15-21
: Copy nit: “attachment” → “file”Matches the source semantics and other components.
- description: "Upload attachment to your File Stash and emit temporary download link to the file. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.", + description: "Upload file to your File Stash and emit a temporary download link to the file. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.",
41-53
: Optional: avoid buffering entire file in memoryIf the Egnyte SDK supports streaming responses, pipe the HTTP stream directly into dir.open(...).fromReadableStream to reduce memory footprint for large files.
Would you like me to propose a streaming variant once we confirm the SDK returns a readable stream?
components/openai/sources/new-file-created/new-file-created.mjs (1)
2-3
: Minor: prefer node:stream importConsistency with Node ESM core module imports.
-import { Readable } from "stream"; +import { Readable } from "node:stream";components/aws/sources/common/include-link.mjs (2)
20-26
: Remove unused helper after switching to streamingIf you adopt the streaming refactor, streamToBuffer becomes dead code.
- async streamToBuffer(stream) { - const chunks = []; - for await (const chunk of stream) { - chunks.push(chunk); - } - return Buffer.concat(chunks); - },
53-56
: Use consistent logging utility (optional)Console logging may be filtered differently by the platform. Prefer the component’s logging mechanism if available.
- console.log("Received initial test event. Skipping..."); + console.log("Received initial test event. Skipping..."); // consider this.$log?.info(...)components/box/sources/new-file/new-file.mjs (1)
36-37
: Minor: tidy summary formattingRemove extra space and avoid template literal when not needed.
- return `New file uploaded event with ID(${event.id})`; + return `New file uploaded event with ID(${event.id})`;components/google_drive/common/utils.mjs (2)
6-6
: Guard against undefined mimeType checksUse a stricter prefix check and handle undefined to avoid runtime errors when
mimeType
is missing.
8-8
: Prefer core module importImport from the Node core module to avoid accidental polyfill resolution.
Apply this diff:
-import { Readable } from "stream"; +import { Readable } from "node:stream";components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs (1)
33-44
: Validatedir
whenincludeLink
is true
Add a runtime check innew-files-shared-drive.mjs
(around the props or at the start ofrun
/processEvent
) to throw a clear error ifthis.includeLink
is enabled butthis.dir
is missing:if (this.includeLink && !this.dir) { throw new Error("The `dir` prop is required when `includeLink` is true"); }Also update the action’s description to note that supplying
dir
is necessary for link generation.components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs (1)
241-241
: Pass the filtered file to processChange for clarity.
Use the result of checkMinimumInterval to avoid any confusion about which object is emitted.- await this.processChange(file, headers); + await this.processChange(checkedFile, headers);components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs (1)
137-149
: Reduce noisy debug logs or gate them behind a debug flag.
The multiple console.log lines can flood user logs in busy drives. Consider removing or switching to console.debug, or wrap with a condition.- console.log(`Processing ${changedFiles.length} changed files`); - console.log(`Changed files: ${JSON.stringify(changedFiles, null, 2)}!!!`); - console.log(`Files: ${this.files}!!!`); + if (process.env.PPD_DEBUG) { + console.debug(`Processing ${changedFiles.length} changed files`); + console.debug(`Changed files: ${JSON.stringify(changedFiles, null, 2)}`); + console.debug(`Files: ${this.files}`); + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (85)
components/aws/.upm/store.json
(1 hunks)components/aws/package.json
(2 hunks)components/aws/sources/common/include-link.mjs
(1 hunks)components/aws/sources/s3-new-file/s3-new-file.mjs
(1 hunks)components/aws/sources/s3-restored-file/s3-restored-file.mjs
(2 hunks)components/box/package.json
(2 hunks)components/box/sources/new-file/new-file.mjs
(2 hunks)components/egnyte/actions/create-folder/create-folder.mjs
(1 hunks)components/egnyte/actions/upload-file/upload-file.mjs
(1 hunks)components/egnyte/egnyte.app.mjs
(1 hunks)components/egnyte/package.json
(1 hunks)components/egnyte/sources/common/base.mjs
(2 hunks)components/egnyte/sources/new-file-in-folder/new-file-in-folder.mjs
(2 hunks)components/egnyte/sources/new-folder-added/new-folder-added.mjs
(1 hunks)components/gmail/package.json
(2 hunks)components/gmail/sources/common/polling-history.mjs
(1 hunks)components/gmail/sources/common/polling-messages.mjs
(2 hunks)components/gmail/sources/new-attachment-received/new-attachment-received.mjs
(3 hunks)components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs
(1 hunks)components/gmail/sources/new-email-received/new-email-received.mjs
(1 hunks)components/gmail/sources/new-labeled-email/new-labeled-email.mjs
(1 hunks)components/gmail/sources/new-sent-email/new-sent-email.mjs
(1 hunks)components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs
(1 hunks)components/google_drive/actions/copy-file/copy-file.mjs
(1 hunks)components/google_drive/actions/create-file-from-template/create-file-from-template.mjs
(1 hunks)components/google_drive/actions/create-file-from-text/create-file-from-text.mjs
(1 hunks)components/google_drive/actions/create-folder/create-folder.mjs
(1 hunks)components/google_drive/actions/create-shared-drive/create-shared-drive.mjs
(1 hunks)components/google_drive/actions/delete-file/delete-file.mjs
(1 hunks)components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs
(1 hunks)components/google_drive/actions/download-file/download-file.mjs
(1 hunks)components/google_drive/actions/find-file/find-file.mjs
(1 hunks)components/google_drive/actions/find-folder/find-folder.mjs
(1 hunks)components/google_drive/actions/find-forms/find-forms.mjs
(1 hunks)components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs
(1 hunks)components/google_drive/actions/get-file-by-id/get-file-by-id.mjs
(1 hunks)components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs
(1 hunks)components/google_drive/actions/get-shared-drive/get-shared-drive.mjs
(1 hunks)components/google_drive/actions/list-access-proposals/list-access-proposals.mjs
(1 hunks)components/google_drive/actions/list-files/list-files.mjs
(1 hunks)components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs
(1 hunks)components/google_drive/actions/move-file/move-file.mjs
(1 hunks)components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs
(1 hunks)components/google_drive/actions/search-shared-drives/search-shared-drives.mjs
(1 hunks)components/google_drive/actions/update-file/update-file.mjs
(1 hunks)components/google_drive/actions/update-shared-drive/update-shared-drive.mjs
(1 hunks)components/google_drive/actions/upload-file/upload-file.mjs
(1 hunks)components/google_drive/common/utils.mjs
(3 hunks)components/google_drive/package.json
(2 hunks)components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs
(6 hunks)components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs
(3 hunks)components/google_drive/sources/new-access-proposal/new-access-proposal.mjs
(1 hunks)components/google_drive/sources/new-files-instant/new-files-instant.mjs
(5 hunks)components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs
(2 hunks)components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs
(1 hunks)components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs
(4 hunks)components/google_drive/sources/new-or-modified-files/test-event.mjs
(1 hunks)components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs
(1 hunks)components/google_drive/sources/new-shared-drive/new-shared-drive.mjs
(1 hunks)components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs
(1 hunks)components/microsoft_onedrive/package.json
(2 hunks)components/microsoft_onedrive/sources/new-file-created/new-file-created.mjs
(4 hunks)components/microsoft_outlook/package.json
(2 hunks)components/microsoft_outlook/sources/common/common-new-email.mjs
(1 hunks)components/microsoft_outlook/sources/new-attachment-received/new-attachment-received.mjs
(3 hunks)components/microsoft_outlook/sources/new-email/new-email.mjs
(1 hunks)components/openai/package.json
(2 hunks)components/openai/sources/new-file-created/new-file-created.mjs
(3 hunks)components/zoho_desk/package.json
(2 hunks)components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs
(1 hunks)components/zoho_desk/sources/common/common-polling.mjs
(1 hunks)components/zoho_desk/sources/new-account/new-account.mjs
(1 hunks)components/zoho_desk/sources/new-agent/new-agent.mjs
(1 hunks)components/zoho_desk/sources/new-contact/new-contact.mjs
(1 hunks)components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs
(3 hunks)components/zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs
(1 hunks)components/zoho_desk/sources/new-ticket-message/new-ticket-message.mjs
(1 hunks)components/zoho_desk/sources/new-ticket/new-ticket.mjs
(1 hunks)components/zoho_desk/sources/updated-ticket/updated-ticket.mjs
(1 hunks)components/zoho_workdrive/actions/download-file/download-file.mjs
(2 hunks)components/zoho_workdrive/actions/upload-file/upload-file.mjs
(1 hunks)components/zoho_workdrive/package.json
(2 hunks)components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs
(5 hunks)components/zoho_workdrive/sources/new-folder/new-folder.mjs
(1 hunks)components/zoho_workdrive/zoho_workdrive.app.mjs
(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
Applied to files:
components/box/package.json
components/zoho_desk/package.json
components/aws/package.json
components/microsoft_onedrive/package.json
components/openai/package.json
components/zoho_workdrive/package.json
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Applied to files:
components/microsoft_outlook/sources/common/common-new-email.mjs
components/egnyte/sources/common/base.mjs
components/openai/sources/new-file-created/new-file-created.mjs
components/gmail/sources/common/polling-messages.mjs
📚 Learning: 2025-07-01T17:07:48.193Z
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: For "dir" props in Pipedream components, whether to mark them as optional depends on the action's file I/O behavior - if an action always writes files as output, the "dir" prop should not be marked as optional.
Applied to files:
components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs
components/egnyte/sources/new-file-in-folder/new-file-in-folder.mjs
components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs
components/openai/sources/new-file-created/new-file-created.mjs
components/gmail/sources/new-attachment-received/new-attachment-received.mjs
components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs
components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs
components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs
components/microsoft_onedrive/sources/new-file-created/new-file-created.mjs
📚 Learning: 2025-07-01T17:07:48.193Z
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: "dir" props in Pipedream components are hidden in the component form and not user-facing, so they don't require labels or descriptions for user clarity.
Applied to files:
components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs
components/gmail/sources/new-attachment-received/new-attachment-received.mjs
components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs
📚 Learning: 2025-07-01T16:56:20.177Z
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/tinypng/actions/convert-image/convert-image.mjs:33-37
Timestamp: 2025-07-01T16:56:20.177Z
Learning: 'dir' props with sync functionality do not expose a path to the sync directory directly. For files to be synced, they must be either: (1) written to `process.env.STASH_DIR` (`/tmp/__stash`), or (2) written to `/tmp` and have their file path returned from the `run` method as a string, `[filepath]`, `[_, filepath]`, `{ filePath }`, `{ filepath }`, or `{ path }`.
Applied to files:
components/google_drive/common/utils.mjs
🧬 Code graph analysis (18)
components/egnyte/sources/new-file-in-folder/new-file-in-folder.mjs (6)
components/aws/sources/common/include-link.mjs (7)
item
(28-31)item
(60-60)buffer
(33-33)filepath
(32-32)type
(34-34)file
(37-41)meta
(59-59)components/box/sources/new-file/new-file.mjs (5)
response
(39-42)buffer
(43-43)filepath
(44-44)type
(45-45)file
(46-50)components/google_drive/common/utils.mjs (4)
response
(278-284)buffer
(290-290)filepath
(293-293)file
(296-300)components/openai/sources/new-file-created/new-file-created.mjs (6)
response
(52-55)buffer
(56-56)filepath
(57-57)type
(58-58)file
(59-63)items
(73-73)components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (5)
buffer
(75-75)filepath
(76-76)type
(77-77)file
(78-82)items
(95-101)components/egnyte/sources/common/base.mjs (2)
items
(55-55)meta
(35-35)
components/aws/sources/common/include-link.mjs (2)
components/google_drive/common/utils.mjs (5)
chunks
(64-64)chunks
(286-286)filepath
(293-293)buffer
(290-290)file
(296-300)components/box/sources/new-file/new-file.mjs (4)
filepath
(44-44)buffer
(43-43)type
(45-45)file
(46-50)
components/egnyte/sources/common/base.mjs (1)
components/egnyte/sources/new-file-in-folder/new-file-in-folder.mjs (1)
meta
(60-60)
components/microsoft_outlook/sources/new-attachment-received/new-attachment-received.mjs (3)
components/aws/sources/common/include-link.mjs (5)
item
(28-31)item
(60-60)buffer
(33-33)filepath
(32-32)file
(37-41)components/gmail/sources/new-attachment-received/new-attachment-received.mjs (5)
messageAttachment
(83-86)buffer
(87-87)filepath
(90-90)file
(93-97)attachments
(104-104)components/microsoft_outlook/microsoft_outlook.app.mjs (3)
buffer
(260-260)attachments
(179-185)attachments
(296-296)
components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs (1)
components/google_drive/common/utils.mjs (1)
file
(296-300)
components/openai/sources/new-file-created/new-file-created.mjs (4)
components/aws/sources/common/include-link.mjs (6)
item
(28-31)item
(60-60)buffer
(33-33)filepath
(32-32)type
(34-34)file
(37-41)components/box/sources/new-file/new-file.mjs (5)
response
(39-42)buffer
(43-43)filepath
(44-44)type
(45-45)file
(46-50)components/gmail/sources/new-attachment-received/new-attachment-received.mjs (3)
buffer
(87-87)filepath
(90-90)file
(93-97)components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (4)
buffer
(75-75)filepath
(76-76)type
(77-77)file
(78-82)
components/zoho_workdrive/zoho_workdrive.app.mjs (1)
components/zoho_workdrive/actions/download-file/download-file.mjs (1)
fileId
(75-75)
components/gmail/sources/new-attachment-received/new-attachment-received.mjs (2)
components/gmail/gmail.app.mjs (8)
messageId
(105-107)messageId
(153-155)attachmentId
(548-552)message
(66-68)message
(407-409)message
(415-417)message
(458-458)message
(501-501)components/microsoft_outlook/sources/new-attachment-received/new-attachment-received.mjs (8)
messageAttachment
(73-77)buffer
(79-79)filepath
(80-80)file
(83-87)message
(120-123)attachments
(48-48)attachments
(56-58)attachments
(125-125)
components/zoho_desk/sources/common/common-polling.mjs (1)
components/zoho_desk/zoho_desk.app.mjs (1)
resources
(321-331)
components/google_drive/sources/new-files-instant/new-files-instant.mjs (1)
components/google_drive/common/utils.mjs (1)
file
(296-300)
components/google_drive/common/utils.mjs (3)
components/aws/sources/common/include-link.mjs (6)
item
(28-31)item
(60-60)chunks
(21-21)buffer
(33-33)filepath
(32-32)file
(37-41)components/google_drive/actions/download-file/download-file.mjs (7)
fileMetadata
(111-113)mimeType
(114-114)isWorkspaceDocument
(116-116)chunks
(137-137)buffer
(141-141)file
(65-65)file
(125-131)components/box/sources/new-file/new-file.mjs (4)
response
(39-42)buffer
(43-43)filepath
(44-44)file
(46-50)
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (2)
components/aws/sources/common/include-link.mjs (6)
item
(28-31)item
(60-60)buffer
(33-33)filepath
(32-32)type
(34-34)file
(37-41)components/zoho_workdrive/actions/download-file/download-file.mjs (1)
fileContent
(79-81)
components/box/sources/new-file/new-file.mjs (4)
components/gmail/sources/new-attachment-received/new-attachment-received.mjs (3)
buffer
(87-87)filepath
(90-90)file
(93-97)components/egnyte/sources/new-file-in-folder/new-file-in-folder.mjs (5)
response
(41-44)buffer
(45-45)filepath
(46-46)type
(47-47)file
(48-52)components/openai/sources/new-file-created/new-file-created.mjs (5)
response
(52-55)buffer
(56-56)filepath
(57-57)type
(58-58)file
(59-63)components/aws/sources/common/include-link.mjs (4)
buffer
(33-33)filepath
(32-32)type
(34-34)file
(37-41)
components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs (4)
components/google_drive/actions/create-file-from-text/create-file-from-text.mjs (1)
file
(85-87)components/google_drive/actions/download-file/download-file.mjs (2)
file
(65-65)file
(125-131)components/aws/sources/common/include-link.mjs (1)
file
(37-41)components/google_drive/common/utils.mjs (1)
file
(296-300)
components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs (6)
components/box/sources/new-file/new-file.mjs (5)
response
(39-42)buffer
(43-43)filepath
(44-44)type
(45-45)file
(46-50)components/openai/sources/new-file-created/new-file-created.mjs (5)
response
(52-55)buffer
(56-56)filepath
(57-57)type
(58-58)file
(59-63)components/aws/sources/common/include-link.mjs (5)
buffer
(33-33)filepath
(32-32)type
(34-34)file
(37-41)meta
(59-59)components/gmail/sources/new-attachment-received/new-attachment-received.mjs (3)
buffer
(87-87)filepath
(90-90)file
(93-97)components/microsoft_outlook/sources/new-attachment-received/new-attachment-received.mjs (3)
buffer
(79-79)filepath
(80-80)file
(83-87)components/zoho_desk/sources/common/common-polling.mjs (1)
meta
(45-45)
components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs (2)
components/google_drive/common/utils.mjs (1)
file
(296-300)components/google_drive/google_drive.app.mjs (2)
file
(121-121)changedFiles
(360-362)
components/microsoft_onedrive/sources/new-file-created/new-file-created.mjs (4)
components/microsoft_onedrive/sources/common/base.mjs (2)
driveItem
(234-238)meta
(258-258)components/box/sources/new-file/new-file.mjs (4)
response
(39-42)buffer
(43-43)filepath
(44-44)file
(46-50)components/microsoft_onedrive/actions/list-files-in-folder/list-files-in-folder.mjs (1)
response
(31-33)components/microsoft_onedrive/microsoft_onedrive.app.mjs (5)
response
(31-39)response
(110-114)response
(133-135)response
(151-153)response
(377-379)
components/zoho_workdrive/actions/download-file/download-file.mjs (1)
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (1)
fileContent
(72-74)
🔇 Additional comments (95)
components/zoho_desk/sources/common/common-polling.mjs (2)
56-58
: Good move to an awaited loop.Switching to a
for...of
withawait this.processEvent(resource)
ensures async file-stash/link generation completes before advancing. This aligns with the PR goal and prevents silent races.
55-55
: Ignore bindingthis
in the filter callback
None of theresourceFilter
overrides reference any instance state (no uses ofthis.
), so passingthis.resourceFilter
directly poses no risk. Discard the suggested wrapper.Likely an incorrect or invalid review comment.
components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs (1)
8-8
: Version bump only — LGTM.
No functional changes; safe to publish.components/zoho_workdrive/sources/new-folder/new-folder.mjs (1)
8-8
: Version bump only — LGTM.
No behavior changes; consistent with the PR scope.components/aws/package.json (1)
37-38
: file-type@21 requires Node.js ≥ 20, but Pipedream components run on Node v18 (components/aws/package.json:37–38). Downgrade “file-type” to a version compatible with Node 18 or coordinate upgrading the runtime to Node ≥ 20 to prevent runtime failures.⛔ Skipped due to learnings
Learnt from: jcortes PR: PipedreamHQ/pipedream#14935 File: components/sailpoint/package.json:15-18 Timestamp: 2024-12-12T19:23:09.039Z Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
components/google_drive/actions/get-shared-drive/get-shared-drive.mjs (1)
7-7
: Version bump only — LGTM.
No logic changes; aligns with release housekeeping.components/zoho_desk/sources/new-contact/new-contact.mjs (1)
9-9
: Version bump looks good.No behavioral changes; safe to publish.
components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs (1)
9-9
: Minor version bump approved.No logic changes; CI/CD should pass as-is.
components/gmail/sources/new-sent-email/new-sent-email.mjs (1)
9-9
: Version bump LGTM.components/google_drive/actions/download-file/download-file.mjs (2)
21-21
: Version bump acknowledged.
92-101
: Confirm whether syncDir is still needed.The prop is defined but unused in run(). If not required, remove to reduce UI noise; if required for future parity with File Stash, add a brief comment.
components/zoho_desk/package.json (2)
3-3
: Version bump fine.
15-16
: Verify runtime compatibility for file-type v21.file-type@21 targets modern Node versions. Confirm the Pipedream Node runtime used by these components meets its engine requirements.
components/google_drive/actions/create-file-from-template/create-file-from-template.mjs (1)
11-11
: LGTM: version bump onlyNo functional changes detected. Safe to merge as-is.
components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs (1)
9-9
: LGTM: version bump onlyNo behavior changes observed.
components/google_drive/actions/update-shared-drive/update-shared-drive.mjs (1)
7-7
: LGTM: version bump onlyAction logic unchanged.
components/egnyte/package.json (1)
3-3
: LGTM: package version bumpMinor publish metadata update looks good.
components/egnyte/actions/create-folder/create-folder.mjs (1)
7-7
: LGTM: version bumpNo functional diffs in this action.
components/google_drive/actions/find-forms/find-forms.mjs (1)
9-9
: Version bump only — LGTM.
No functional changes detected; patch bump is appropriate.components/google_drive/actions/move-file/move-file.mjs (1)
7-7
: Patch version bump acknowledged.
No behavior change; safe to merge.components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs (1)
9-9
: Metadata-only change — looks good.
Patch increment with no logic changes.components/google_drive/actions/create-folder/create-folder.mjs (1)
16-16
: Patch version bump — OK.
No runtime changes; fine to ship.components/zoho_desk/sources/new-ticket-message/new-ticket-message.mjs (1)
9-9
: Version bump only — LGTMNo functional changes; safe metadata update.
components/google_drive/actions/delete-file/delete-file.mjs (1)
8-8
: Version bump only — LGTMMatches repo-wide housekeeping for this PR.
components/zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs (1)
9-9
: Version bump only — LGTMNo behavior change; consistent with other Zoho Desk sources.
components/google_drive/actions/find-file/find-file.mjs (1)
9-9
: Version bump only — LGTMNo logic changes; safe to merge.
components/egnyte/actions/upload-file/upload-file.mjs (1)
9-9
: Version bump only — LGTMNo functional changes in the action.
components/zoho_workdrive/actions/upload-file/upload-file.mjs (1)
8-8
: Version bump looks fine; ensure metadata stays in sync.Please update the component/package CHANGELOG and verify the package.json version for Zoho WorkDrive matches this action’s bump.
components/google_drive/actions/list-access-proposals/list-access-proposals.mjs (1)
7-7
: LGTM on version bump.No functional changes detected; version increment aligns with broader provider updates.
components/google_drive/actions/get-file-by-id/get-file-by-id.mjs (1)
8-8
: LGTM on version bump.No behavior changes in this action; safe to publish.
components/egnyte/sources/new-folder-added/new-folder-added.mjs (1)
8-8
: LGTM on version bump.Consistent with related Egnyte updates in this PR.
components/google_drive/actions/list-files/list-files.mjs (1)
8-8
: Version bump only — LGTMPatch increment to 0.1.16 with no functional changes detected.
components/google_drive/actions/find-folder/find-folder.mjs (1)
10-10
: Version bump only — LGTMPatch increment to 0.1.12 with no functional changes detected.
components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs (1)
23-23
: Version bump only — LGTMPatch increment to 0.2.5 with no functional changes detected.
components/google_drive/sources/new-access-proposal/new-access-proposal.mjs (1)
9-9
: Version bump only — LGTMPatch increment to 0.0.5 with no functional changes detected.
components/google_drive/actions/upload-file/upload-file.mjs (1)
16-16
: Version bump only — LGTMPatch increment to 2.0.5 with no functional changes detected.
components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs (1)
9-9
: Patch version bump only — OKNo behavior changes detected. Please confirm any relevant package.json/CHANGELOG entries reflect 0.0.5 for release traceability.
components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs (1)
20-20
: Minor version bump acknowledgedLooks good. Verify downstream docs and examples reference 1.0.8 where applicable; no code paths changed here.
components/zoho_desk/sources/new-agent/new-agent.mjs (1)
9-9
: Version metadata update — approvedPatch bump reads consistent with no functional changes. Ensure Zoho Desk package versioning stays aligned across sources.
components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs (1)
8-8
: Action version bump — approvedNo runtime changes. Confirm action catalog/version map is updated so users see 0.0.5 in UI.
components/zoho_desk/sources/new-account/new-account.mjs (1)
9-9
: Patch bump only — approvedNo behavior change. Please ensure release notes group this with other Zoho Desk source bumps for consistency.
components/gmail/package.json (2)
3-3
: Version bump looks fine.No API surface change here; aligns with the broader streaming updates in the PR.
24-24
: Remove the built-in "stream" dependency from components/gmail/package.json.Node provides the core "stream" module — don't add the npm "stream" shim as a dependency.
File: components/gmail/package.json (line 24)"dependencies": { "@google-cloud/local-auth": "^2.1.0", "@google-cloud/pubsub": "^4.7.0", "@googleapis/gmail": "^13.0.1", "@pipedream/platform": "^3.1.0", "google-auth-library": "^8.7.0", "html-to-text": "^9.0.5", "mime": "^3.0.0", "nodemailer": "^6.7.8", - "stream": "^0.0.3", "uuid": "^10.0.0" }
components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs (1)
7-7
: Version bump only — OK.No logic changes; safe to publish.
components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs (1)
15-15
: Version bump only — OK.No behavioral changes detected.
components/box/package.json (2)
3-3
: Version bump looks good.
12-19
: Ensure Node ≥20 support; remove core deps (path, stream, util)
file-type v21 requires Node >= 20; confirm the Pipedream runtime meets this. “path”, “stream” and “util” are built-in Node modules and must be removed from dependencies.Apply:
"dependencies": { "@pipedream/platform": "^3.1.0", "file-type": "^21.0.0", "form-data": "^4.0.0", - "path": "^0.12.7", - "stream": "^0.0.2", - "util": "^0.12.5" }components/zoho_desk/sources/new-ticket/new-ticket.mjs (1)
9-9
: Version bump looks finePatch bump only; no functional changes in this file.
components/google_drive/actions/update-file/update-file.mjs (1)
9-9
: Semver patch bump is appropriateNo logic changes; 2.0.3 → 2.0.4 is correct.
components/zoho_desk/sources/updated-ticket/updated-ticket.mjs (1)
9-9
: Version bump acknowledgedPatch version increment only; behavior unchanged.
components/google_drive/actions/search-shared-drives/search-shared-drives.mjs (1)
7-7
: Patch version bump is fineNo behavior change; 0.1.12 → 0.1.13 aligns with metadata-only edits.
components/google_drive/actions/create-shared-drive/create-shared-drive.mjs (1)
7-7
: LGTM on version bumpMetadata-only; patch increment is appropriate.
components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs (1)
23-23
: Version bump only — LGTM.No logic changes; safe to merge.
components/gmail/sources/new-email-received/new-email-received.mjs (1)
18-18
: Version bump only — LGTM.Aligned with related Gmail package bump; no functional impact.
components/google_drive/sources/new-shared-drive/new-shared-drive.mjs (1)
8-8
: Version bump only — LGTM.No behavior changes detected.
components/openai/package.json (1)
3-3
: Package version bump — LGTM.Consistent with added functionality elsewhere.
components/gmail/sources/new-labeled-email/new-labeled-email.mjs (1)
11-11
: Version bump only — LGTM.
No functional changes observed.components/google_drive/package.json (1)
3-3
: Version bump — LGTM.components/gmail/sources/common/polling-history.mjs (1)
190-191
: Awaiting emission for consistency and error propagation — LGTM.
Matches the async emission pattern elsewhere.components/zoho_workdrive/package.json (2)
3-3
: Version bump — LGTM.
18-18
: Verify runtime compatibility for file-type v21.
file-type@21 is ESM-only and requires Node ≥ 18. Confirm the runtime for these components meets that.components/microsoft_onedrive/package.json (1)
3-3
: Version bump looks fine.No issues with 1.7.3.
components/gmail/sources/common/polling-messages.mjs (1)
52-52
: Good: await per-message emission.Awaiting
emitEvent
ensures ordering and error propagation during polling.components/zoho_workdrive/actions/download-file/download-file.mjs (1)
79-85
: Remove unnecessary encoding guard
axios withresponseType: "arraybuffer"
returns a Node Buffer, andfs.writeFileSync
acceptsBuffer
directly, so no explicit conversion is needed. (github.com, nodejs.org)Likely an incorrect or invalid review comment.
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (3)
3-4
: Imports look good and consistent with stash flow.
117-119
: LGTM: conditional enrichment before emit.Awaiting stash ensures get_url is present on the emitted item when requested.
133-133
: Good deploy behavior.Limiting historical events to 10 aligns with the recommendations in the issue.
components/microsoft_outlook/sources/new-attachment-received/new-attachment-received.mjs (1)
94-97
: LGTM: conditional stashing before emit with await.components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs (2)
70-84
: Stash flow looks correct (arraybuffer → Buffer → File Stash).Using file-type for MIME inference is consistent with other sources.
85-91
: LGTM: includeLink gating and meta generation before emit.components/gmail/sources/new-attachment-received/new-attachment-received.mjs (1)
107-116
: LGTM: per-attachment async emit with optional link enrichment.Good dedupe id: message.id + partId.
components/egnyte/sources/new-file-in-folder/new-file-in-folder.mjs (1)
10-10
: Version bump LGTMSemver minor for new optional behavior is appropriate.
components/microsoft_onedrive/sources/new-file-created/new-file-created.mjs (1)
4-4
: Import path is correct
common/httpRequest.mjs exists at components/microsoft_onedrive/common/httpRequest.mjs and resolves via../../common/httpRequest.mjs
; no changes needed.components/openai/sources/new-file-created/new-file-created.mjs (1)
51-65
: Stashing flow LGTM; mirrors pattern across sourcesBuffer conversion, MIME detection, and withGetUrl usage look consistent.
components/aws/sources/s3-restored-file/s3-restored-file.mjs (1)
20-25
: LGTM: includeLink integration is correctly composedProps and methods are merged cleanly; version bump aligns with new behavior.
components/aws/sources/s3-new-file/s3-new-file.mjs (1)
12-19
: LGTM: includeLink props/methods merged; version bump OKComposition mirrors s3-restored-file; no functional regressions evident.
components/google_drive/actions/copy-file/copy-file.mjs (1)
7-7
: Version bump only — OKNo functional change; safe to publish.
components/google_drive/common/utils.mjs (1)
318-319
: Export looks goodPublic export of
stashFile
is consistent with usage across sources.components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs (1)
10-10
: Version bump aligns with new propsMinor version bump for additive props is appropriate.
components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs (2)
18-18
: Version bump looks correct and aligned with new optional behavior.
38-49
: Props addition (includeLink, dir) is consistent with the pattern used across sources.
No label/description for dir is fine since it's hidden; marking it optional is appropriate given includeLink is opt-in.components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs (4)
18-18
: Import of stashFile is appropriate for the new feature.
28-28
: Version bump to 0.4.0 matches public API change.
65-76
: Props (includeLink, dir) added correctly and match the cross-file contract.
168-170
: Unify Google Drive sources’ payload
- In components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs (lines 168–170), replace
witheventToEmit.fileURL = await stashFile(file, this.googleDrive, this.dir);file.file = await stashFile(file, this.googleDrive, this.dir);- Verify all Google Drive triggers in this PR consistently attach the stashed file to
file.file
rather than emittingfileURL
.components/google_drive/sources/new-files-instant/new-files-instant.mjs (6)
6-6
: Import of stashFile is correct for the new link feature.
14-14
: Version bump to 0.2.0 is appropriate given the new props and async behavior.
50-61
: Props (includeLink, dir) added correctly; matches other sources.
78-79
: Awaiting emitFiles during deploy avoids races with stashing.
107-115
: Attach stashed file to file.file — consistent and clear.
This matches the pattern used elsewhere in the PR.
138-139
: Awaiting emitFiles in processChanges is the right call post-async conversion.components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs (4)
19-19
: stashFile import is correct.
31-31
: Version bump to 0.3.0 aligns with behavior change.
47-58
: Props (includeLink, dir) added correctly; optional dir is appropriate since linking is opt-in.
75-76
: deploy now awaits processing — good to ensure staged sample emits finish.
components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs
Show resolved
Hide resolved
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs
Show resolved
Hide resolved
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @michelle0927 lgtm! Ready for QA!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
components/box/sources/new-file/new-file.mjs (2)
47-61
: Fallback MIME + defensive stashing
fileTypeFromBuffer
can return undefined; default the MIME. Also wrap stashing to avoid dropping the whole event on transient errors and add context to logs.async stashFile(event) { - const response = await this.app.downloadFile({ + const response = await this.app.downloadFile({ fileId: event.source.id, responseType: "arraybuffer", }); - const buffer = Buffer.from(response); - const filepath = `${event.source.id}/${event.source.name}`; - const type = await fileTypeFromBuffer(buffer); - const file = await this.dir.open(filepath).fromReadableStream( - Readable.from(buffer), - type?.mime, - buffer.length, - ); - return await file.withoutPutUrl().withGetUrl(); + try { + const buffer = Buffer.from(response); + const filepath = `${event.source.id}/${event.source.name}`; + const type = await fileTypeFromBuffer(buffer); + const file = await this.dir.open(filepath).fromReadableStream( + Readable.from(buffer), + type?.mime || "application/octet-stream", + buffer.length, + ); + return await file.withoutPutUrl().withGetUrl(); + } catch (err) { + console.warn( + `Failed to stash file (id=${event?.source?.id}, name=${event?.source?.name}):`, + err?.message || err, + ); + return null; + } },Optional: consider streaming to reduce memory for large files (e.g., use
responseType: "stream"
andfileTypeStream
), but that would require obtaining size from headers or metadata.
63-66
: Guard: includeLink requires dir; handle stash failures gracefullyPrevent runtime errors when
dir
is unset and avoid overwritingevent.body.file
with null on failures.- if (this.includeLink) { - event.body.file = await this.stashFile(event.body); - } + if (this.includeLink) { + if (!this.dir) { + throw new Error("Include Link is enabled, but no File Stash directory (dir) is configured. Please connect a directory."); + } + const stashed = await this.stashFile(event.body); + if (stashed) { + event.body.file = stashed; + } + }
🧹 Nitpick comments (3)
components/box/box.app.mjs (2)
132-135
: Breaking change: option value shape now JSON-encoded; ensure downstream parsing
webhookTarget.options
now returnsvalue: JSON.stringify({ id, type })
. Verify all consumers parse this before use (e.g.,const { id, type } = JSON.parse(webhookTarget)
), especially where webhook creation expects separateid
andtype
.
168-171
: Avoid mutating prevContext.queue with reverse()
queue.reverse()
mutates shared state and can cause pagination order issues. Copy before reversing.- const reverseQueue = queue.reverse(); + const reverseQueue = [...queue].reverse();components/box/sources/new-file/new-file.mjs (1)
13-36
: Include Link UX is good; note required guard with dirProps look right. See run() comment for enforcing
dir
whenincludeLink
is true.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
components/aws/sources/common/include-link.mjs
(1 hunks)components/aws/sources/s3-restored-file/s3-restored-file.mjs
(1 hunks)components/box/actions/create-sign-request/create-sign-request.mjs
(1 hunks)components/box/actions/download-file/download-file.mjs
(1 hunks)components/box/actions/get-comments/get-comments.mjs
(1 hunks)components/box/actions/search-content/search-content.mjs
(1 hunks)components/box/actions/upload-file-version/upload-file-version.mjs
(1 hunks)components/box/actions/upload-file/upload-file.mjs
(1 hunks)components/box/box.app.mjs
(3 hunks)components/box/sources/new-event/new-event.mjs
(1 hunks)components/box/sources/new-file/new-file.mjs
(2 hunks)components/box/sources/new-folder/new-folder.mjs
(1 hunks)components/buddee/buddee.app.mjs
(1 hunks)
✅ Files skipped from review due to trivial changes (9)
- components/box/actions/search-content/search-content.mjs
- components/box/actions/download-file/download-file.mjs
- components/box/actions/upload-file-version/upload-file-version.mjs
- components/box/sources/new-folder/new-folder.mjs
- components/box/actions/upload-file/upload-file.mjs
- components/buddee/buddee.app.mjs
- components/box/sources/new-event/new-event.mjs
- components/box/actions/create-sign-request/create-sign-request.mjs
- components/box/actions/get-comments/get-comments.mjs
🚧 Files skipped from review as they are similar to previous changes (2)
- components/aws/sources/common/include-link.mjs
- components/aws/sources/s3-restored-file/s3-restored-file.mjs
🧰 Additional context used
🧬 Code graph analysis (2)
components/box/box.app.mjs (1)
components/box/sources/new-file/new-file.mjs (1)
type
(54-54)
components/box/sources/new-file/new-file.mjs (3)
components/gmail/sources/new-attachment-received/new-attachment-received.mjs (3)
buffer
(87-87)filepath
(90-90)file
(93-97)components/microsoft_onedrive/sources/new-file-created/new-file-created.mjs (4)
response
(81-84)buffer
(85-85)filepath
(86-86)file
(87-91)components/openai/sources/new-file-created/new-file-created.mjs (5)
response
(52-55)buffer
(56-56)filepath
(57-57)type
(58-58)file
(59-63)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (4)
components/box/box.app.mjs (2)
159-166
: Type-aware filtering + value payload LGTMFiltering by
type
and including{ id, type }
in the option value is consistent and improves correctness.
190-197
: Inner page type filter + JSON payload LGTMThe inner-page filtering and value encoding look correct.
components/box/sources/new-file/new-file.mjs (2)
2-3
: Confirm dependency + runtime compatibilityEnsure
file-type
is added to the component package and compatible with the runtime (ESM import). The repo showsfile-type
usage elsewhere; just confirm version alignment.
8-10
: Metadata updates LGTMDescription fix and version bump are fine.
/approve |
Resolves #18218
Updates sources identified by Cursor (claud-4-sonnet) as file-related to include a temporary, pre‑signed URL in the emitted event. I think this should cover the most widely used file-related sources, but I suspect there are more that we could add this feature to. I created this issue for updating the remaining sources.
Gmail
Zoho Workdrive
Microsoft Outlook
Google Drive
Microsoft Onedrive
AWS
OpenAI
Zoho Desk
Box
Egnyte
Summary by CodeRabbit
New Features
Bug Fixes
Chores