Skip to content

Conversation

jcortes
Copy link
Collaborator

@jcortes jcortes commented Sep 8, 2025

WHY

Resolves #18265

Summary by CodeRabbit

  • New Features

    • Added actions: Drive Search – Files and Folders, Get Article, and Get File Information.
    • Added a Content Type option for creating documents (Markdown, WYSIWYG, Advanced WYSIWYG).
  • Refactor

    • Improved dynamic dropdowns for users, folders, files, articles, and languages for more accurate selection and labels.
  • Chores

    • Bumped component package to 0.2.0 and updated platform dependency.
    • Incremented versions for Create Document action and New Article in Project Version source.

@jcortes jcortes self-assigned this Sep 8, 2025
Copy link

vercel bot commented Sep 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Sep 10, 2025 4:08pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 10, 2025 4:08pm

Copy link
Contributor

coderabbitai bot commented Sep 8, 2025

Walkthrough

Adds three new Document360 actions (drive search, get article, get file information), expands the Document360 app module with new API methods and dynamic propDefinitions, and bumps versions for an existing action and a source; also updates package version and a dependency.

Changes

Cohort / File(s) Summary
New actions: Drive, Article, File
components/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs, components/document360/actions/get-article/get-article.mjs, components/document360/actions/get-file-information/get-file-information.mjs
Adds three actions exposing: drive search (for files/folders), get article, and get file information. Each action declares props (some dynamic via propDefinition), calls corresponding app methods, returns API responses, and exports success summaries.
App module enhancements
components/document360/document360.app.mjs
Adds methods: getProjectLanguages, getFileInformation, driveSearchFilesAndFolders, getArticle, getFolders, getFolderInformation, _flattenFolders. Refactors/introduces dynamic propDefinitions for userId, folderId, fileId, articleId, langCode with pagination and data-driven option labels.
Create document version bump & prop addition
components/document360/actions/create-document/create-document.mjs
Bumps exported action version to 0.0.2 and adds a new optional public prop contentType with options for Markdown/WYSIWYG/Advanced WYSIWYG; forwards content_type in API payload.
Source version bump (metadata only)
components/document360/sources/new-article-in-project-version/new-article-in-project-version.mjs
Bumps exported source version from 0.0.1 to 0.0.2. No logic changes.
Package manifest update
components/document360/package.json
Bumps package version to 0.2.0 and updates dependency @pipedream/platform from ^1.5.1 to ^3.1.0.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant A as Action: Drive Search - Files and Folders
  participant App as Document360 App
  participant API as Document360 API

  U->>A: Provide search params
  A->>App: driveSearchFilesAndFolders(params, $)
  App->>API: GET /drive/search (query)
  API-->>App: Search results
  App-->>A: Results
  A-->>U: Summary + results
Loading
sequenceDiagram
  autonumber
  participant U as User
  participant A as Action: Get Article
  participant App as Document360 App
  participant API as Document360 API

  U->>A: articleId, langCode, flags
  A->>App: getArticle({ articleId, langCode, params }, $)
  App->>API: GET /articles/{articleId}?lang=...
  API-->>App: Article data
  App-->>A: Response
  A-->>U: Summary + article
Loading
sequenceDiagram
  autonumber
  participant U as User
  participant A as Action: Get File Information
  participant App as Document360 App
  participant API as Document360 API

  U->>A: folderId, fileId, appendSASToken?
  A->>App: getFileInformation({ folderId, fileId, params }, $)
  App->>API: GET /drive/folders/{folderId}/files/{fileId}
  API-->>App: File info
  App-->>A: Response
  A-->>U: Summary + file info
Loading
sequenceDiagram
  autonumber
  participant UI as UI (propDefinition)
  participant App as Document360 App
  participant API as Document360 API

  rect rgba(200,200,255,0.12)
  note over UI,App: userId options (paginated)
  UI->>App: options({ page })
  App->>API: GET /users?skip&take
  API-->>App: Users
  App-->>UI: Formatted user options
  end

  rect rgba(200,255,200,0.12)
  note over UI,App: folderId options (tree)
  UI->>App: options()
  App->>API: GET /drive/folders
  App->>App: _flattenFolders(tree)
  App-->>UI: Folder options
  end

  rect rgba(255,240,200,0.12)
  note over UI,App: fileId options (folder-aware)
  UI->>App: options({ folderId })
  App->>API: GET /drive/folders/{folderId}
  API-->>App: Folder files
  App-->>UI: File options
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • lcaresia

Pre-merge checks (2 passed, 2 warnings, 1 inconclusive)

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning In addition to the requested actions, this PR modifies the create-document action by adding a new contentType prop and bumps versions on the new-article-in-project-version source, changes that are not related to the Drive Search, Get Article, or Get File Information endpoints specified in the linked issue. Please remove or isolate the create-document enhancements and the version bump for the new-article-in-project-version source into a separate pull request so that this change set only includes the scope needed to resolve issue #18265.
Description Check ⚠️ Warning The pull request description only includes the “## WHY” heading followed by “Resolves #18265,” but it does not explain the motivation or context for the changes as required by the template; readers cannot understand the reasons or benefits of the new actions and supporting updates. Expand the “## WHY” section to describe why these Document360 actions are being added, the problems they solve, and any relevant context or user scenarios; this will align the description with the repository template and improve clarity for maintainers.
Title Check ❓ Inconclusive The title “[ACTION] Document360 - new components” is overly generic and does not clearly convey the primary changes introduced by the pull request, such as the addition of specific actions for Drive Search, Get Article, and Get File Information; a concise title should highlight the main new functionality rather than use broad terms like “new components.” Please revise the title to succinctly reflect the main additions—for example, “[ACTION] Document360: Add Drive Search, Get Article & Get File Information Actions”—so that the key enhancements are immediately clear to reviewers.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues Check ✅ Passed The changes implement all three API operations called out in issue #18265—Drive Search (driveSearchFilesAndFolders), Get Article (getArticle), and Get File Information (getFileInformation)—and include the necessary props and app methods to support these actions, fulfilling the linked issue’s coding requirements.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I thump my paws on docs so bright,
New actions hop into the light—
Search the drive, fetch pages true,
Files and folders come to view.
I nibble code and skip with glee,
Hooray for routes that set us free! 🥕✨

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch document360-new-components

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (8)
components/document360/actions/create-document/create-document.mjs (1)

5-6: Align naming with Document360 (“Article” vs “Document”)

Action name/description and summary should say “Article” to match the API you call (/Articles).

-  name: "Create Document",
-  description: "Creates a new document in Document360 from text. [See the documentation](https://apidocs.document360.com/apidocs/how-to-create-and-publish-an-article)",
+  name: "Create Article",
+  description: "Creates a new article in Document360 from text. [See the documentation](https://apidocs.document360.com/apidocs/how-to-create-and-publish-an-article)",
@@
-    $.export("$summary", `Successfully created document "${this.title}"`);
+    $.export("$summary", `Successfully created article "${this.title}"`);

Also applies to: 67-67

components/document360/sources/new-article-in-project-version/new-article-in-project-version.mjs (2)

53-57: Prefer API-provided timestamps over Date.now()

Emitting the article’s own timestamp improves ordering and replay.

-            this.$emit(article, {
+            this.$emit(article, {
               id: article.id,
               summary: `New Article: "${article.title}"`,
-              ts: Date.now(),
+              ts: new Date(
+                article.last_updated_on
+                ?? article.published_on
+                ?? article.created_on
+                ?? article.created_date
+                ?? Date.now()
+              ).getTime(),
             });

62-63: Bound savedItems to avoid unbounded growth

Cap the array to a reasonable size.

-      this._setSavedItems(savedItems);
+      if (savedItems.length > 10000) {
+        savedItems.splice(0, savedItems.length - 10000);
+      }
+      this._setSavedItems(savedItems);
components/document360/actions/get-file-information/get-file-information.mjs (2)

45-47: Avoid sending undefined query params

Only include appendSASToken when set; some APIs treat undefined differently than omitted.

-      params: {
-        appendSASToken,
-      },
+      params,

Add above the request:

+    const params = {};
+    if (appendSASToken !== undefined) params.appendSASToken = appendSASToken;

26-31: Clarify default behavior of “Append SAS Token”

If the API defaults to appending SAS tokens when omitted, note that here to reduce ambiguity.

components/document360/actions/get-article/get-article.mjs (3)

36-41: Tighten isForDisplay description

Remove the update-endpoint note (irrelevant here) to reduce confusion.

-      description: "Set this to `true`, if you are displaying the article to the end-user. If `true`, the content of snippets or variables appears in the article. Note: If the value is true, ensure that the article content is not passed for update article endpoints.",
+      description: "Set this to `true` if you are displaying the article to the end-user. If `true`, the content of snippets or variables appears in the article.",

45-46: Fix minor grammar in description

-      description: "`true` : You will get the latest published version of the article. (If there are no published versions, then it will return the latest version) `false` : To get the the latest version of the article",
+      description: "`true`: Return the latest published version (or latest version if none published). `false`: Return the latest version of the article.",

69-73: Avoid sending undefined query params

Only include params that are explicitly set.

-      params: {
-        isForDisplay,
-        isPublished,
-        appendSASToken,
-      },
+      params,

Add above the request:

+    const params = {};
+    if (isForDisplay !== undefined) params.isForDisplay = isForDisplay;
+    if (isPublished !== undefined) params.isPublished = isPublished;
+    if (appendSASToken !== undefined) params.appendSASToken = appendSASToken;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 212cd8b and d816abc.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • components/document360/actions/create-document/create-document.mjs (1 hunks)
  • components/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs (1 hunks)
  • components/document360/actions/get-article/get-article.mjs (1 hunks)
  • components/document360/actions/get-file-information/get-file-information.mjs (1 hunks)
  • components/document360/document360.app.mjs (2 hunks)
  • components/document360/package.json (2 hunks)
  • components/document360/sources/new-article-in-project-version/new-article-in-project-version.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 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/document360/package.json
🧬 Code graph analysis (3)
components/document360/actions/get-article/get-article.mjs (1)
components/document360/actions/get-file-information/get-file-information.mjs (1)
  • response (41-48)
components/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs (2)
components/document360/actions/get-article/get-article.mjs (1)
  • response (65-74)
components/document360/actions/get-file-information/get-file-information.mjs (1)
  • response (41-48)
components/document360/actions/get-file-information/get-file-information.mjs (2)
components/document360/actions/get-article/get-article.mjs (1)
  • response (65-74)
components/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs (1)
  • response (76-88)
⏰ 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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (8)
components/document360/actions/create-document/create-document.mjs (1)

7-7: Version bump — LGTM

No logic changes. Safe to ship.

components/document360/sources/new-article-in-project-version/new-article-in-project-version.mjs (1)

9-9: Version bump — LGTM

components/document360/package.json (2)

3-3: Version bump & dependency upgrade — LGTM


16-16: Verify @pipedream/platform v3 compatibility
components/document360/package.json (line 16):

"@pipedream/platform": "^3.1.0"

Ensure CI workflows and any shared integration code support breaking changes introduced in v3.1.0.

components/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs (1)

17-21: Align parameters with Document360 Drive Search API docs

  • Use pageNo (integer, zero-based, default 0) for pagination.
  • Use filterTags (array of string) to filter by tag IDs.
  • Ensure userIds and filterTags arrays are serialized correctly (e.g. repeated query params or bracket notation) by testing with the API’s “Try it” tool.
components/document360/document360.app.mjs (3)

214-217: No action required: sub_folders is the correct key. Verified that the Document360 Drive Folders API uses snake_case sub_folders for nested folders, so this recursion will traverse children as intended.


125-127: Auth header name confirmed
Document360’s API requires a lowercase api_token header; existing code is correct.


150-154: No change needed: keep singular /Language/{projectVersionId} — Document360 API’s “Gets all version languages in the project” endpoint is GET /v2/Language/{projectVersionId}, so the current implementation is correct.

michelle0927
michelle0927 previously approved these changes Sep 9, 2025
Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jcortes jcortes force-pushed the document360-new-components branch from a1f47db to 5924acc Compare September 10, 2025 16:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
components/document360/actions/get-file-information/get-file-information.mjs (1)

26-31: Clarify appendSASToken help text to reflect API behavior (default is false)

Docs state appendSASToken is a boolean with default false. Suggest rewording to reduce ambiguity and align with the API. (apidocs.document360.com)

     appendSASToken: {
       type: "boolean",
       label: "Append SAS Token",
-      description: "Set this to false to exclude appending SAS token for images/files",
+      description: "If true, appends a SAS token to image/file URLs in the response. Leave unset to use the API default (false).",
       optional: true,
     },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d816abc and 5924acc.

📒 Files selected for processing (7)
  • components/document360/actions/create-document/create-document.mjs (3 hunks)
  • components/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs (1 hunks)
  • components/document360/actions/get-article/get-article.mjs (1 hunks)
  • components/document360/actions/get-file-information/get-file-information.mjs (1 hunks)
  • components/document360/document360.app.mjs (2 hunks)
  • components/document360/package.json (2 hunks)
  • components/document360/sources/new-article-in-project-version/new-article-in-project-version.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/document360/sources/new-article-in-project-version/new-article-in-project-version.mjs
🚧 Files skipped from review as they are similar to previous changes (5)
  • components/document360/document360.app.mjs
  • components/document360/package.json
  • components/document360/actions/get-article/get-article.mjs
  • components/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs
  • components/document360/actions/create-document/create-document.mjs
🧰 Additional context used
🧬 Code graph analysis (1)
components/document360/actions/get-file-information/get-file-information.mjs (2)
components/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs (1)
  • response (76-88)
components/document360/actions/get-article/get-article.mjs (1)
  • response (65-74)
⏰ 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 (2)
components/document360/actions/get-file-information/get-file-information.mjs (2)

3-9: Solid addition: action metadata looks consistent and clear

Key, name, description link, version, and type align with existing Document360 actions. Link matches the official endpoint docs. (apidocs.document360.com)


41-48: Confirmed path and HTTP verb are correct getFileInformation invokes _makeRequest with path: /Drive/Folders/${folderId}/${fileId} (baseURL /v2) and no explicit method, defaulting to GET; appendSASToken in params will serialize as ?appendSASToken=true.

@jcortes jcortes merged commit c4e584e into master Sep 11, 2025
10 checks passed
@jcortes jcortes deleted the document360-new-components branch September 11, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ACTION] Document360

2 participants