-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[ACTION] Document360 - new components #18316
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 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
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
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
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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
Pre-merge checks (2 passed, 2 warnings, 1 inconclusive)❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 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. ✨ 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: 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 growthCap 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 paramsOnly 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 descriptionRemove 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 paramsOnly 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
⛔ 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 — LGTMNo logic changes. Safe to ship.
components/document360/sources/new-article-in-project-version/new-article-in-project-version.mjs (1)
9-9
: Version bump — LGTMcomponents/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
andfilterTags
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_casesub_folders
for nested folders, so this recursion will traverse children as intended.
125-127
: Auth header name confirmed
Document360’s API requires a lowercaseapi_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.
...onents/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs
Show resolved
Hide resolved
...onents/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.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.
LGTM!
d816abc
to
a1f47db
Compare
a1f47db
to
5924acc
Compare
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
🧹 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
📒 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 clearKey, 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
withpath: /Drive/Folders/${folderId}/${fileId}
(baseURL/v2
) and no explicit method, defaulting to GET;appendSASToken
inparams
will serialize as?appendSASToken=true
.
WHY
Resolves #18265
Summary by CodeRabbit
New Features
Refactor
Chores