Skip to content

Conversation

@bhabalan
Copy link
Contributor

@bhabalan bhabalan commented May 6, 2025

COMPLETES: ADHOC

This pull request addresses

  • fixes type in directory name for docs
  • Adds ability to import from @webex/plugin-encryption
  • misc readme updates

by making the following changes

  • misc readme updates

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

Tested locally and confirmed that the docs are generated

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly


Make sure to have followed the contributing guidelines before submitting.

@bhabalan bhabalan self-assigned this May 6, 2025
@bhabalan bhabalan requested a review from a team as a code owner May 6, 2025 13:06
@bhabalan bhabalan added the validated If the pull request is validated for automation. label May 6, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 6, 2025

📝 Walkthrough

Walkthrough

This change introduces the new @webex/plugin-encryption package into the Webex SDK ecosystem. It adds an "Encryption API Reference" link to the documentation index and updates the package README with CDN usage instructions, corrected sample code, and revised section headings. The package's package.json is updated with expanded contributors, corrected main entry points, added exports, and a fixed documentation build script path. A Babel configuration is enhanced with a plugin and source map support. The Jest config is modified to transform the uuid package. New source files provide default configuration and a Webex class extending the core SDK, exposing an initialization method. The encryption plugin is integrated into the webex-node package dependencies and imports. The main Webex package removes a direct export for encryption, and the webpack config is updated to use the new encryption source path. No changes affect runtime logic beyond these structural, configuration, and documentation updates.

Possibly related PRs

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

yarn install v1.22.22
[1/4] Resolving packages...
(node:9528) [DEP0169] DeprecationWarning: url.parse() behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for url.parse() vulnerabilities.
(Use node --trace-deprecation ... to show where the warning was created)
warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning eslint > @humanwhocodes/[email protected]: Use @eslint/config-array instead
warning eslint > @humanwhocodes/config-array > @humanwhocodes/[email protected]: Use @eslint/object-schema instead
warning eslint > file-entry-cache > flat-cache > [email protected]: Rimraf versions prior to v4 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > [email protected]: Glob versions prior to v9 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning eslint-import-resolver-typescript > [email protected]: Glob versions prior to v9 are no longer supported
warning [email protected]: Glob versions prior to v9 are no longer supported
warning intern > [email protected]: Glob versions prior to v9 are no longer supported
warning intern > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning jasmine > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-config > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-runtime > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/reporters > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/transform > babel-plugin-istanbul > test-exclude > [email protected]: Glob versions prior to v9 are no longer supported
warning mocha > [email protected]: Glob versions prior to v9 are no longer supported
warning mocha > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning [email protected]: 16.1.1
warning sinon > @sinonjs/samsam > [email protected]: This package is deprecated. Use the optional chaining (?.) operator instead.
warning wd > [email protected]: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.

(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
warning wd > archiver > [email protected]: Glob versions prior to v9 are no longer supported
warning wd > archiver > archiver-utils > [email protected]: Glob versions prior to v9 are no longer supported
warning wd > [email protected]: request has been deprecated, see request/request#3142
warning wd > request > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning wd > request > [email protected]: this library is no longer supported
warning @babel/cli > [email protected]: Glob versions prior to v9 are no longer supported
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
warning @babel/polyfill > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @babel/runtime-corejs2 > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning babel-plugin-lodash > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > [email protected]: 16.1.1
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning workspace-aggregator-7af31586-d2e7-47c6-84a2-24b4ccc83f94 > @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
[2/4] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version "^14 || ^16 || ^17 || ^18 || ^19". Got "24.0.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 42f5121 and 7aaf3a4.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • packages/@webex/plugin-encryption/README.md (5 hunks)
  • packages/@webex/plugin-encryption/developer-quickstart.md (1 hunks)
  • packages/webex/package.json (0 hunks)
  • webpack.config.js (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/webex/package.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • webpack.config.js
  • packages/@webex/plugin-encryption/developer-quickstart.md
  • packages/@webex/plugin-encryption/README.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build Packages
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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 (3)
packages/@webex/plugin-encryption/README.md (3)

1-5: Avoid duplicate top-level headings
The README begins with two H1 headings (# @webex/plugin-encryption and then # Encryption plugin for the Cisco Webex JS SDK). This can confuse parsers and readers. Consider demoting the second heading to H2 or removing it to comply with the standard-readme spec.


22-30: Enhance CDN examples with SRI
To follow best practices and improve security, add integrity and crossorigin attributes to your <script> tags for both unpkg and jsDelivr.


57-64: Optional: Simplify promise handling
Instead of .then(async () => { … }), you could make the enclosing callback async and use:

await webex.cypher.register();
try {  } catch (error) {  }

for clearer flow and error handling.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa3675d and 4555de8.

📒 Files selected for processing (3)
  • docs/index.html (1 hunks)
  • packages/@webex/plugin-encryption/README.md (4 hunks)
  • packages/@webex/plugin-encryption/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Initialize Project
  • GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (4)
packages/@webex/plugin-encryption/package.json (1)

17-17:

✅ Verification successful

Confirm corrected docs output path
The build:docs script now writes to ../../../docs/plugin-encryption, matching the renamed directory. Please verify there are no remaining references to the old plugin-encrption path in CI/CD workflows or other scripts.

Run this to catch any typos:


🏁 Script executed:

#!/bin/bash
# Ensure no residual typo references to the old docs path
rg -l "plugin-encrption"

Length of output: 24


Docs output path confirmed
Ran rg -l plugin-encrption with no matches; there are no residual references to the old typo.

docs/index.html (1)

100-100: Approve: Added Encryption API Reference link
The new <a href="./plugin-encryption">Encryption API Reference</a> aligns with the corrected docs directory and completes the API Reference section.

packages/@webex/plugin-encryption/README.md (2)

17-19: Verify installation instructions
The Install section now directs users to npm install --save webex instead of the plugin package. Confirm that the encryption plugin ships with the core webex bundle to prevent user confusion.


38-38: Approve: Updated usage links
The links to the developer portal and the specific Encryption API Reference (https://webex.github.io/webex-js-sdk/plugin-encryption/) are accurate and reflect the new docs structure.

@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4238.d3m3l2kee0btzx.amplifyapp.com

Copy link
Contributor

@sreenara sreenara left a comment

Choose a reason for hiding this comment

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

I'm confused with the sample code snippet.

import Webex from 'webex/plugin-encryption';

Ideally, we should have 2 ways of a developer consuming this package.
import Webex from '@webex/plugin-encryption';

This would allow a developer to limit their package consumption to one package.

If a developer is already using webex or doesn't mind the entire package, then
import Webex from 'webex/encryption';

The statement in the README doesn't match the current folder structure.

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: 2

🧹 Nitpick comments (2)
packages/@webex/plugin-encryption/developer-quickstart.md (2)

87-87: Fix code block language tag
Remove the space before typescript so syntax highlighting works correctly.


98-99: Improve example error handling and async flow
Relying on .then(async ...) without a .catch may hide errors. Consider an immediately invoked async function with try/catch for clarity and proper error logging:

(async () => {
  try {
    const webex = await initializeWebex(accessToken);
    await decryptFile(webex, attachmentURL, options, decryptedFileName, mimeType);
  } catch (error) {
    console.error('Error initializing or decrypting file:', error);
  }
})();
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 4555de8 and 42f5121.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (11)
  • packages/@webex/plugin-encryption/README.md (5 hunks)
  • packages/@webex/plugin-encryption/babel.config.js (1 hunks)
  • packages/@webex/plugin-encryption/developer-quickstart.md (1 hunks)
  • packages/@webex/plugin-encryption/jest.config.js (1 hunks)
  • packages/@webex/plugin-encryption/package.json (2 hunks)
  • packages/@webex/plugin-encryption/src/webex-config.ts (1 hunks)
  • packages/@webex/plugin-encryption/src/webex.js (1 hunks)
  • packages/webex-node/package.json (1 hunks)
  • packages/webex-node/src/webex-node.js (1 hunks)
  • packages/webex/package.json (0 hunks)
  • webpack.config.js (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/webex/package.json
✅ Files skipped from review due to trivial changes (6)
  • packages/webex-node/package.json
  • packages/webex-node/src/webex-node.js
  • webpack.config.js
  • packages/@webex/plugin-encryption/src/webex-config.ts
  • packages/@webex/plugin-encryption/package.json
  • packages/@webex/plugin-encryption/src/webex.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/@webex/plugin-encryption/README.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Initialize Project
🔇 Additional comments (4)
packages/@webex/plugin-encryption/babel.config.js (3)

2-2: Good addition of package version injection

Adding the @webex/babel-config-legacy/inject-package-version plugin is a good practice that ensures the package version is automatically embedded in the built files. This is important for tracking and debugging purposes.


3-13: Improved preset configuration formatting

The reorganized preset configuration maintains the same functionality while improving readability with consistent formatting. The explicit node target specification in the @babel/preset-env configuration is a good practice.


14-14: Good addition of source maps

Enabling source maps is beneficial for debugging transformed code, making it easier to trace issues back to the original source. This will improve the developer experience when working with this package.

packages/@webex/plugin-encryption/jest.config.js (1)

5-7: Correctly handling the uuid package transformation

The addition of this transformIgnorePatterns configuration ensures that the uuid package is processed by Babel during testing, while other node modules are still ignored. This is important because:

  1. It allows the test environment to properly process ES modules from the uuid package
  2. It maintains test performance by still ignoring other node_modules

This change aligns with modern Jest testing practices for handling ES module dependencies.

Copy link
Contributor

@sreenara sreenara left a comment

Choose a reason for hiding this comment

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

Nitpicks in the comments. But everything else looks OK.


webex.once('ready', () => {
webex.cypher.register().then(() => {
webex.cypher.register().then( async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
webex.cypher.register().then( async () => {
webex.cypher.register().then(async () => {

### Example Usage

```typescript
``` typescript
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
``` typescript
```typescript

@bhabalan bhabalan merged commit ff180f6 into webex:next May 19, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants