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

migrate shared package from node to nestjs #351

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

mit-27
Copy link
Contributor

@mit-27 mit-27 commented Apr 9, 2024

  • Now, the nesJS shared package is compatible with both API and web apps

Copy link

changeset-bot bot commented Apr 9, 2024

⚠️ No Changeset found

Latest commit: 1dc14d5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
panora-client-ts ❌ Failed (Inspect) Apr 9, 2024 6:11pm

Copy link
Contributor

coderabbitai bot commented Apr 9, 2024

Walkthrough

This update streamlines the structure and dependencies across various services and shared resources, focusing on module import path optimization and project configuration enhancements. Key changes include the standardization of import paths, removal of specific module system configurations, and updates to project metadata and tooling configurations. This refinement enhances maintainability and sets a clear path for future development, embodying a significant stride towards a more cohesive and efficient codebase.

Changes

File Pattern Change Summary
.npmrc, packages/shared/tsconfig.json, packages/shared/tslint.json, packages/shared/.prettierrc, packages/api/package.json Updated project and TypeScript configuration, including npm settings and linting preferences.
packages/api/src/.../services/*/*.ts, packages/api/src/@core/connections/ticketing/services/*/*.ts Standardized import paths for OAuth2AuthData and providerToType, removing specific path references.
packages/api/scripts/oauthConnector.js, packages/shared/src/authUrl.ts Updated import statements and modified API call implementations.
packages/api/swagger/swagger-spec.json Added and updated endpoints and schemas for user and ticketing management.
packages/shared/README.md, packages/shared/CONTRIBUTING.md, packages/shared/LICENSE, packages/shared/CHANGELOG.md Introduced and updated documentation regarding project contributions, licensing, and change log.
packages/shared/package.json, packages/shared/nest-cli.json, packages/shared/.gitignore Updated package metadata and configurations for NestJS and version control settings.
packages/api/src/@core/environment/environment.validation.ts, packages/shared/src/index.ts, packages/shared/src/test.ts Modified error handling and added new module exports.

"In the code's vast meadow, under the digital sun,
A rabbit hopped, its task not yet done.
Paths now straight, where once they did bend,
A tale of refactoring, with means to an end.
🌟 From shared to api, with every commit push,
Our project grows, in the quiet hush.
🚀 To the future we leap, with cleaner code in our grip,
A journey we share, on this development ship."


Recent Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d742286 and 1dc14d5.
Files ignored due to path filters (2)
  • packages/shared/package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !pnpm-lock.yaml
Files selected for processing (44)
  • .npmrc (1 hunks)
  • packages/api/package.json (1 hunks)
  • packages/api/scripts/oauthConnector.js (1 hunks)
  • packages/api/src/@core/connections/crm/services/accelo/accelo.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/affinity/affinity.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/attio/attio.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/capsule/capsule.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/close/close.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/copper/copper.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/hubspot/hubspot.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/insightly/insightly.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/keap/keap.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/pipedrive/pipedrive.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/sugarcrm/sugarcrm.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/teamleader/teamleader.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/teamwork/teamwork.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/zendesk/zendesk.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/zoho/zoho.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/aha/aha.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/clickup/clickup.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/front/front.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/github/github.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/gitlab/gitlab.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/gorgias/gorgias.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/jira/jira.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/jira_service_mgmt/jira.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/linear/linear.service.ts (1 hunks)
  • packages/api/src/@core/connections/ticketing/services/zendesk/zendesk.service.ts (1 hunks)
  • packages/api/src/@core/environment/environement.validation.ts (1 hunks)
  • packages/api/swagger/swagger-spec.json (16 hunks)
  • packages/shared/.gitignore (1 hunks)
  • packages/shared/.prettierrc (1 hunks)
  • packages/shared/CHANGELOG.md (1 hunks)
  • packages/shared/CONTRIBUTING.md (1 hunks)
  • packages/shared/LICENSE (1 hunks)
  • packages/shared/README.md (1 hunks)
  • packages/shared/nest-cli.json (1 hunks)
  • packages/shared/package.json (1 hunks)
  • packages/shared/src/authUrl.ts (3 hunks)
  • packages/shared/src/index.ts (1 hunks)
  • packages/shared/src/test.ts (1 hunks)
  • packages/shared/tsconfig.build.json (1 hunks)
  • packages/shared/tsconfig.json (1 hunks)
  • packages/shared/tslint.json (1 hunks)
Files skipped from review due to trivial changes (9)
  • packages/api/package.json
  • packages/shared/.gitignore
  • packages/shared/CHANGELOG.md
  • packages/shared/CONTRIBUTING.md
  • packages/shared/LICENSE
  • packages/shared/nest-cli.json
  • packages/shared/src/index.ts
  • packages/shared/src/test.ts
  • packages/shared/tsconfig.build.json
Additional comments not posted (44)
.npmrc (1)

1-2: The configuration changes in .npmrc are approved. Ensure they align with your project's dependency management strategy.

packages/shared/tsconfig.json (2)

3-13: The TypeScript compiler options are correctly configured for a NestJS project.


15-15: Ensure the include pattern covers all necessary TypeScript files in your project.

packages/shared/README.md (1)

1-41: Ensure all links and references in the README.md are accurate and up-to-date following the migration to NestJS.

packages/shared/package.json (1)

2-78: Ensure the main entry point in package.json ("main": "dist/test.js") is correctly specified for your package. Also, verify that all dependencies are necessary and up-to-date.

packages/shared/src/authUrl.ts (1)

80-83: Clarify the reason for commenting out the axios call and using mock data directly. Ensure this change aligns with your project's development strategy and is not intended for production use.

packages/api/src/@core/connections/crm/services/teamwork/teamwork.service.ts (1)

15-15: Ensure the new import path for providerToType and AuthStrategy aligns with the restructured module paths in @panora/shared.

packages/api/src/@core/connections/crm/services/copper/copper.service.ts (1)

15-15: Confirm the updated import path for providerToType and AuthStrategy is correct according to the new structure of @panora/shared.

packages/api/src/@core/connections/ticketing/services/clickup/clickup.service.ts (1)

15-15: Verify the corrected import path for providerToType and AuthStrategy matches the updated structure of @panora/shared.

packages/api/src/@core/connections/ticketing/services/aha/aha.service.ts (1)

16-16: Check that the new import path for providerToType correctly reflects the reorganized @panora/shared module structure.

packages/api/src/@core/connections/crm/services/attio/attio.service.ts (1)

15-15: Ensure the updated import path for providerToType and AuthStrategy is accurate as per the new @panora/shared module organization.

packages/api/src/@core/connections/ticketing/services/linear/linear.service.ts (1)

16-16: Confirm the import path for providerToType and AuthStrategy is correctly updated to match the new structure of @panora/shared.

packages/api/src/@core/connections/ticketing/services/zendesk/zendesk.service.ts (1)

16-16: Check the updated import path for providerToType and AuthStrategy for correctness in accordance with the restructured @panora/shared.

packages/api/src/@core/connections/crm/services/capsule/capsule.service.ts (1)

15-15: Verify the corrected import path for providerToType and AuthStrategy aligns with the updated module structure of @panora/shared.

packages/api/src/@core/connections/crm/services/keap/keap.service.ts (1)

15-15: Ensure the updated import paths from @panora/shared are correctly resolving the necessary modules.

Verification successful

The updated import paths from @panora/shared for OAuth2AuthData and providerToType are correctly resolving in the keap.service.ts file, as confirmed by the script output.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify if the updated import paths are correctly resolving.
ast-grep --lang typescript --pattern $'import { OAuth2AuthData, providerToType } from "@panora/shared"'

Length of output: 104



Script:

#!/bin/bash
# Verify the existence of keap.service.ts and check for the specific import statement.
fd keap.service.ts --exec rg 'import { OAuth2AuthData, providerToType } from "@panora/shared"'

Length of output: 251



Script:

#!/bin/bash
# Correcting the regex error by simplifying the search pattern.
fd keap.service.ts --exec rg 'OAuth2AuthData, providerToType'

Length of output: 128

packages/api/src/@core/connections/crm/services/affinity/affinity.service.ts (1)

15-15: Confirm that the new import paths from @panora/shared are correctly set up and accessible.

packages/api/src/@core/connections/crm/services/insightly/insightly.service.ts (1)

15-15: Verify the correct resolution of the updated import paths from @panora/shared.

packages/api/src/@core/connections/ticketing/services/gitlab/gitlab.service.ts (1)

16-16: Check that the modified import paths from @panora/shared are properly configured and functional.

packages/api/src/@core/connections/crm/services/close/close.service.ts (1)

15-15: Ensure the new import paths from @panora/shared are correctly implemented and accessible.

packages/api/src/@core/connections/ticketing/services/front/front.service.ts (1)

16-16: Confirm the correct setup of the updated import paths from @panora/shared.

packages/api/src/@core/connections/ticketing/services/github/github.service.ts (1)

15-15: Verify the correct resolution of the updated import paths from @panora/shared.

packages/api/src/@core/connections/crm/services/teamleader/teamleader.service.ts (1)

15-15: Check that the modified import paths from @panora/shared are properly set up and functional.

packages/api/src/@core/connections/ticketing/services/gorgias/gorgias.service.ts (1)

15-15: Updated import paths for providerToType and OAuth2AuthData look correct, aligning with the migration to NestJS.

Verification successful

The verification process has confirmed that providerToType and OAuth2AuthData are correctly exported from the @panora/shared package, specifically within packages/shared/src/envConfig.ts. This supports the updated import paths in the gorgias.service.ts file, aligning with the migration to NestJS and ensuring that the functionality remains intact.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the correct export of providerToType and OAuth2AuthData from @panora/shared
rg --type ts "export.*providerToType" packages/shared/src/index.ts
rg --type ts "export.*OAuth2AuthData" packages/shared/src/index.ts

Length of output: 137



Script:

#!/bin/bash
# Broaden the search for the export of providerToType and OAuth2AuthData within the @panora/shared package
fd --type f --extension ts ".*" packages/shared/src/ | xargs rg "export.*providerToType"
fd --type f --extension ts ".*" packages/shared/src/ | xargs rg "export.*OAuth2AuthData"

Length of output: 476

packages/api/src/@core/connections/crm/services/pipedrive/pipedrive.service.ts (1)

15-15: Updated import paths for providerToType and OAuth2AuthData are consistent with the NestJS migration.

packages/api/src/@core/connections/crm/services/sugarcrm/sugarcrm.service.ts (1)

15-15: The changes to import paths for providerToType and OAuth2AuthData align with the migration goals.

Verification successful

The search results confirm that both providerToType and OAuth2AuthData are indeed exported from packages/shared/src/envConfig.ts, not directly from packages/shared/src/index.ts as initially sought. This indicates that the import paths in the SugarCRM service file are correctly aligned with the actual locations of these exports within the @panora/shared package. Therefore, the review comment regarding the update of import paths aligns with the migration goals and the codebase's current state.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Ensure `providerToType` and `OAuth2AuthData` are correctly exported from @panora/shared
rg --type ts "export.*providerToType" packages/shared/src/index.ts
rg --type ts "export.*OAuth2AuthData" packages/shared/src/index.ts

Length of output: 137



Script:

#!/bin/bash
# Broaden the search to capture any form of export for `providerToType` and `OAuth2AuthData`
rg --type ts "providerToType" packages/shared/src/
rg --type ts "OAuth2AuthData" packages/shared/src/

Length of output: 761

packages/api/src/@core/connections/crm/services/hubspot/hubspot.service.ts (1)

15-15: Changes to import paths for providerToType and OAuth2AuthData are appropriate for the NestJS migration.

packages/api/src/@core/connections/crm/services/zendesk/zendesk.service.ts (1)

15-15: The update to import paths for providerToType and OAuth2AuthData supports the migration to NestJS effectively.

Verification successful

The verification process has confirmed that both providerToType and OAuth2AuthData are correctly exported from the @panora/shared package, specifically from the envConfig.ts file within the packages/shared/src/ directory. This aligns with the import changes made in the zendesk.service.ts file, supporting the migration to NestJS effectively.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the correct export of `providerToType` and `OAuth2AuthData` from @panora/shared
rg --type ts "export.*providerToType" packages/shared/src/index.ts
rg --type ts "export.*OAuth2AuthData" packages/shared/src/index.ts

Length of output: 137



Script:

#!/bin/bash
# Expanding the search for `providerToType` and `OAuth2AuthData` exports within the entire @panora/shared package
rg --type ts "export.*providerToType" packages/shared/src/
rg --type ts "export.*OAuth2AuthData" packages/shared/src/

Length of output: 416

packages/api/src/@core/connections/crm/services/zoho/zoho.service.ts (1)

15-15: The modifications to import paths for providerToType and OAuth2AuthData are correctly aligned with the NestJS migration.

Verification successful

The broader search within the @panora/shared package has successfully located the exports for both providerToType and OAuth2AuthData in the packages/shared/src/envConfig.ts file. This confirms that the modifications to import paths for these entities in the Zoho service class are correctly aligned with the project's migration strategy and the entities are indeed available for import from the @panora/shared module.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for correct export of `providerToType` and `OAuth2AuthData` from @panora/shared
rg --type ts "export.*providerToType" packages/shared/src/index.ts
rg --type ts "export.*OAuth2AuthData" packages/shared/src/index.ts

Length of output: 137



Script:

#!/bin/bash
# Broaden the search for `providerToType` and `OAuth2AuthData` within the entire @panora/shared package
rg --type ts "export.*providerToType" packages/shared/src
rg --type ts "export.*OAuth2AuthData" packages/shared/src

Length of output: 414

packages/api/src/@core/connections/crm/services/accelo/accelo.service.ts (1)

15-15: The changes to import paths for providerToType and OAuth2AuthData are well-aligned with the migration objectives.

Verification successful

The verification process has confirmed that both providerToType and OAuth2AuthData are indeed exported from the @panora/shared package, specifically from the packages/shared/src/envConfig.ts file. This aligns with the changes made in the Accelo service class to import these entities from @panora/shared, supporting the migration objectives.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Ensure `providerToType` and `OAuth2AuthData` are exported correctly from @panora/shared
rg --type ts "export.*providerToType" packages/shared/src/index.ts
rg --type ts "export.*OAuth2AuthData" packages/shared/src/index.ts

Length of output: 137



Script:

#!/bin/bash
# Broaden the search to ensure `providerToType` and `OAuth2AuthData` are present and exported in any file within the @panora/shared package
rg --type ts "export.*providerToType" packages/shared/src/
rg --type ts "export.*OAuth2AuthData" packages/shared/src/

Length of output: 416

packages/api/src/@core/connections/ticketing/services/jira/jira.service.ts (1)

15-15: The update to import paths for providerToType and OAuth2AuthData is consistent with the migration to NestJS.

Verification successful

The search results confirm that both providerToType and OAuth2AuthData are indeed exported from within the @panora/shared package, specifically from the envConfig.ts file. This verifies that the updated import paths in the Jira service class are correct and align with the migration to NestJS, as intended in the PR.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm `providerToType` and `OAuth2AuthData` are correctly exported from @panora/shared
rg --type ts "export.*providerToType" packages/shared/src/index.ts
rg --type ts "export.*OAuth2AuthData" packages/shared/src/index.ts

Length of output: 137



Script:

#!/bin/bash
# Broaden the search for `providerToType` and `OAuth2AuthData` exports within the @panora/shared package
rg --type ts "export.*providerToType" packages/shared/src
rg --type ts "export.*OAuth2AuthData" packages/shared/src

Length of output: 414

packages/api/src/@core/connections/ticketing/services/jira_service_mgmt/jira.service.ts (3)

Line range hint 31-31: Ensure providerToType usage aligns with the new import path.

Please verify that the updated import path for providerToType correctly reflects its usage throughout the service, especially in the constructor where it's used to set the type property.


Line range hint 76-76: Validate the hardcoded URL against environment-specific configurations.

Consider making the URL configurable to support different environments or Jira instances.

Verification successful

The verification process confirms that the URL 'https://panora.atlassian.net' is hardcoded in two separate files within the packages/api/src directory. This supports the initial review comment suggesting that the URL should be made configurable to support different environments or Jira instances. Therefore, the review comment is upheld.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify if the hardcoded URL 'https://panora.atlassian.net' should be configurable per environment.
grep -r 'https://panora.atlassian.net' ./packages/api/src

Length of output: 340


Line range hint 108-108: Encrypt sensitive data before storing in the database.

It's good to see encryption being applied to sensitive data like access_token and refresh_token before storing them in the database. This is a crucial security practice.

packages/api/scripts/oauthConnector.js (2)

53-53: Ensure the updated import path for providerToType is correct.

Given the change in the import path for providerToType, please verify that it is correctly imported and used within the script, especially considering the dynamic nature of service file creation.


Line range hint 1-1: Document the script's purpose and usage.

Adding a detailed comment at the beginning of the script explaining its purpose, usage, and examples would enhance its maintainability and ease of use for new team members or external contributors.

packages/api/swagger/swagger-spec.json (9)

86-109: Consider adding a more detailed description for the /auth/users/create endpoint to improve API documentation clarity.


151-176: Ensure the getUser endpoint's stytchId parameter description clearly defines its purpose and usage to enhance API documentation.


803-826: For the createConnectionStrategy endpoint, verify that all required attributes and values are correctly documented and match the expected functionality.


828-851: Ensure the toggleConnectionStrategy endpoint accurately reflects the operation's intent, especially regarding how the strategy is activated or deactivated.


853-883: The getCredentials endpoint should have a detailed description of the credentials being fetched, including their scope and usage.


4305-4310: The CreateUserDto schema includes a strategy field. Ensure this field is clearly defined in the API documentation to explain its purpose and possible values.


4556-4584: The CreateConnectionStrategyDto schema should include descriptions for each property to clarify their purpose and usage within the context of connection strategies.


5502-5533: The UnifiedCollectionOutput schema is a new addition. Verify that this schema accurately represents the data structure for collections and includes all necessary fields.


4173-4283: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-5533]

Ensure the Swagger specification is validated using a tool like Swagger Editor to catch any syntax errors or missing fields.

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration 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

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/[email protected]

View full report↗︎

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

@@ -12,7 +12,7 @@ import {
ITicketingConnectionService,
} from '../../types';
import { ServiceRegistry } from '../registry.service';
import { OAuth2AuthData, providerToType } from '@panora/shared/src/envConfig';
import { OAuth2AuthData, providerToType } from '@panora/shared';
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider grouping imports from the same module.

- import { OAuth2AuthData, providerToType } from '@panora/shared';
- import { AuthStrategy } from '@panora/shared';
+ import { OAuth2AuthData, providerToType, AuthStrategy } from '@panora/shared';

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
import { OAuth2AuthData, providerToType } from '@panora/shared';
import { OAuth2AuthData, providerToType, AuthStrategy } from '@panora/shared';

@@ -50,7 +50,7 @@ import {
} from '../../types';
import { ServiceRegistry } from '../registry.service';
import { AuthStrategy } from '@panora/shared';
import { OAuth2AuthData, providerToType } from '@panora/shared/src/envConfig';
import { OAuth2AuthData, providerToType } from '@panora/shared';
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider abstracting repetitive code into functions.

The script contains repetitive patterns, especially in the createServiceFile function. Consider abstracting repetitive code blocks, such as the OAuth response type definition and the axios request setup, into reusable functions or templates.

Comment on lines +1 to +18
{
"defaultSeverity": "error",
"extends": ["tslint:recommended"],
"jsRules": {
"no-unused-expression": true
},
"rules": {
"quotemark": [true, "single"],
"member-access": [false],
"ordered-imports": [false],
"max-line-length": [true, 150],
"member-ordering": [false],
"interface-name": [false],
"arrow-parens": false,
"object-literal-sort-keys": false
},
"rulesDirectory": []
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider migrating from TSLint to ESLint, as TSLint is deprecated and ESLint offers better support for TypeScript and NestJS projects.

Comment on lines +85 to +90

//TODO - Resolve this
// if (errors.length) throw new Error(errors.toString());
if (errors.length) {

}
Copy link
Contributor

Choose a reason for hiding this comment

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

Implement proper error handling for environment variable validation errors. Leaving a TODO without error handling could lead to silent failures.

@naelob naelob merged commit 7026426 into panoratech:main Apr 9, 2024
8 of 14 checks passed
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.

2 participants