Skip to content
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

feat: entity files #20

Merged
merged 3 commits into from
Jul 29, 2024
Merged

feat: entity files #20

merged 3 commits into from
Jul 29, 2024

Conversation

joscha
Copy link
Member

@joscha joscha commented Jul 29, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced README documentation with updated section indicators for "Entity Files" and "Whoami."
    • New commands added in testing configuration for running tests individually and expanded network permissions.
    • Created a robust interface for managing entity files, including retrieval, upload, and download functionalities.
  • Bug Fixes

    • Improved error handling and response structure for entity file management.
  • Tests

    • Introduced a comprehensive suite of tests for entity file functionalities in the API context, covering various operations such as listing, retrieving, uploading, and downloading files.
  • Documentation

    • Added clarifying comments to types and properties to enhance understanding of pagination and entity file behavior.
    • Updated TypeScript configuration to include DOM type support.

Copy link

coderabbitai bot commented Jul 29, 2024

Walkthrough

This update enhances the project's functionality by introducing a comprehensive interface for managing entity files, updating the README for clarity, and refining the testing framework. Key changes include new dependency additions, improved command structures in configuration files, and the introduction of structured responses for better handling. These enhancements streamline data management and extend the capabilities of the application.

Changes

Files Change Summary
README.md Updated status indicators for "Entity Files" and "Whoami" sections to reflect availability.
deno.jsonc Added @std/streams dependency, modified test commands to broaden network permissions, and introduced test:single for individual tests.
src/v1/entity_files.ts Introduced interface and methods for managing entity files, including retrieval, upload, and download functionalities.
scripts/build_npm.ts, tsconfig.json Modified build process settings, enabling npm installation and adding DOM library support in TypeScript configuration.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant API
    participant EntityFiles

    User->>API: Request entity files
    API->>EntityFiles: Fetch all entity files
    EntityFiles-->>API: Return entity files data
    API-->>User: Send entity files data
Loading

🐰 In a burrow deep, where changes bloom,
New paths are forged, dispelling gloom.
With entity files, we leap and bound,
In JSON dreams, our treasures found.
Oh, hop along, with joy we cheer,
For every change brings progress near! 🥕


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

@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: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 727df0c and ebd27bb.

Files ignored due to path filters (4)
  • deno.lock is excluded by !**/*.lock
  • flake.lock is excluded by !**/*.lock
  • src/v1/tests/__snapshots__/entity_files_test.ts.snap is excluded by !**/*.snap
  • src/v1/tests/fixtures/entity_files/test.pdf is excluded by !**/*.pdf
Files selected for processing (14)
  • README.md (1 hunks)
  • deno.jsonc (2 hunks)
  • src/v1/entity_files.ts (1 hunks)
  • src/v1/field_value_changes.ts (2 hunks)
  • src/v1/field_values.ts (1 hunks)
  • src/v1/index.ts (4 hunks)
  • src/v1/list_entries.ts (2 hunks)
  • src/v1/paged_response.ts (1 hunks)
  • src/v1/tests/entity_files_test.ts (1 hunks)
  • src/v1/tests/fixtures/entity_files/all.raw.response.json (1 hunks)
  • src/v1/tests/fixtures/entity_files/get.raw.response.json (1 hunks)
  • src/v1/tests/fixtures/entity_files/paginated.iterator.combined.response.json (1 hunks)
  • src/v1/tests/get_raw_fixture.ts (1 hunks)
  • src/v1/urls.ts (1 hunks)
Files skipped from review due to trivial changes (6)
  • README.md
  • src/v1/field_values.ts
  • src/v1/paged_response.ts
  • src/v1/tests/fixtures/entity_files/all.raw.response.json
  • src/v1/tests/fixtures/entity_files/get.raw.response.json
  • src/v1/tests/fixtures/entity_files/paginated.iterator.combined.response.json
Additional comments not posted (32)
src/v1/tests/get_raw_fixture.ts (2)

5-7: LGTM!

The getRawFixture function is correctly implemented and does not contain any issues.


9-11: LGTM!

The readFixtureFile function is correctly implemented and does not contain any issues.

deno.jsonc (3)

7-7: LGTM!

The addition of the @std/streams module appears to be correct and does not contain any issues.


16-16: LGTM!

The modification to the test command appears to be correct and does not contain any issues.


17-17: LGTM!

The addition of the test:single command appears to be correct and does not contain any issues.

src/v1/urls.ts (1)

88-96: LGTM!

The entityFilesUrl function is correctly implemented and does not contain any issues.

src/v1/index.ts (4)

10-10: Import statement for EntityFiles looks good.

The import statement is correctly added and aligns with the new functionality.


20-20: Export statement for EntityFiles looks good.

The export statement is correctly added and aligns with the new functionality.


77-77: Property declaration for entityFiles looks good.

The property declaration is correctly added and aligns with the new functionality.


58-58: Constructor modification for entityFiles looks good.

The initialization of entityFiles in the constructor is correctly added and aligns with the new functionality.

src/v1/field_value_changes.ts (2)

Line range hint 88-101:
Interface EntityRequestFilter looks good.

The interface is correctly added and provides a base for other request filters.


106-106: Modification to GetFieldValueChangesRequestFilter looks good.

The modification to extend EntityRequestFilter is correctly added and enhances the type hierarchy.

src/v1/tests/entity_files_test.ts (7)

50-59: Test case for listing all files looks good.

The test case is correctly added and verifies the listing functionality.


61-68: Test case for getting a single file looks good.

The test case is correctly added and verifies the retrieval functionality.


70-93: Test case for uploading a file looks good.

The test case is correctly added and verifies the upload functionality.


95-120: Test case for uploading multiple files looks good.

The test case is correctly added and verifies the multiple upload functionality.


122-136: Test case for downloading a file looks good.

The test case is correctly added and verifies the download functionality.


138-182: Test case for iterating over all entity files looks good.

The test case is correctly added and verifies the iteration functionality.


185-192: Helper function readableFromArray looks good.

The helper function is correctly added and converts an array to a readable stream.

src/v1/entity_files.ts (12)

34-36: LGTM!

The type definition for EntityFile is correct.


41-56: LGTM!

The type definition for AllEntityFileRequest is correct.


58-62: LGTM!

The type definition for PagedEntityFileResponseRaw is correct.


64-66: LGTM!

The type definition for PagedEntityFileResponse is correct.


68-72: LGTM!

The type definition for UploadEntityFileRequest is correct.


78-81: LGTM!

The constructor is correct.


83-88: LGTM!

The function transformEntityFile is correct.


90-112: LGTM!

The function all is correct. Ensure that error handling is managed upstream.


132-135: LGTM!

The function pagedIterator is correct.


140-151: LGTM!

The function get is correct. Ensure that error handling is managed upstream.


163-173: LGTM!

The function download is correct. Ensure that error handling is managed upstream.


189-230: LGTM!

The function upload is correct. Ensure that error handling is managed upstream.

src/v1/list_entries.ts (1)

69-73: LGTM!

The modification to PagedListEntryResponseRaw to extend PagedResponse is correct and promotes consistency.

src/v1/entity_files.ts Outdated Show resolved Hide resolved
Copy link

@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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ebd27bb and 72b1e58.

Files ignored due to path filters (1)
  • deno.lock is excluded by !**/*.lock
Files selected for processing (3)
  • scripts/build_npm.ts (1 hunks)
  • src/v1/entity_files.ts (1 hunks)
  • tsconfig.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/v1/entity_files.ts
Additional comments not posted (3)
scripts/build_npm.ts (2)

20-20: Approved: Enable npm installation during build.

Setting skipNpmInstall to false ensures that npm dependencies are installed during the build process. This can help keep dependencies up-to-date but may increase the build time.


27-28: Approved: Update shims configuration.

Disabling Deno-specific shims and enabling Undici can improve performance and compatibility with Node.js environments. Ensure that any existing Deno-specific code is reviewed for compatibility.

tsconfig.json (1)

15-17: Approved: Add support for DOM types.

Including "DOM" in the lib property enhances the TypeScript environment by adding support for DOM types, which is beneficial for projects interacting with web APIs.

@joscha joscha marked this pull request as ready for review July 29, 2024 20:50
@joscha joscha merged commit 750133f into main Jul 29, 2024
8 checks passed
@joscha joscha deleted the joscha/entity-files branch July 29, 2024 20:53
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.

1 participant