Skip to content

Conversation

Copy link

Copilot AI commented Oct 26, 2025

Implements client modules to consume the storage service from both NestJS microservices and frontend applications (React, Vue, Angular).

Implementation

NestJS Backend Client (src/client/nestjs/)

  • StorageClientModule with sync/async registration supporting ConfigService
  • StorageClientService providing typed methods for all API operations
  • Uses @nestjs/axios with RxJS observables

Axios Frontend Client (src/client/axios/)

  • StorageClient class for browser environments
  • Helper methods for file uploads and multipart uploads
  • Authentication support via setAuthToken() and setHeaders()

Shared Types (src/client/shared/)

  • Common TypeScript interfaces for requests/responses across both clients
  • 15+ typed interfaces covering all API operations

Usage

NestJS:

@Module({
  imports: [
    StorageClientModule.register({
      baseUrl: 'http://localhost:4000',
    }),
  ],
})
export class AppModule {}

Frontend:

const client = new StorageClient({ baseUrl: 'http://localhost:4000' });

const object = await client.createObject({
  namespace: 'documents',
  name: 'file.pdf',
  contentType: 'application/pdf',
  sizeBytes: 1024000,
});

await client.uploadFile(object.uploadUrl, file);

Package Exports

Added clean import paths via package.json exports:

  • @pnstack/nestjs-storage-service/client/nestjs
  • @pnstack/nestjs-storage-service/client/axios
  • @pnstack/nestjs-storage-service/client/shared

Security

Updated axios to v1.12.2 to patch DoS and SSRF vulnerabilities (CVE-2024-xxxxx).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • scarf.sh

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

implement client module for both backend microservice nestjs and frontend with axios in shared module


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: npsg02 <150496964+npsg02@users.noreply.github.com>
@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

Co-authored-by: npsg02 <150496964+npsg02@users.noreply.github.com>
@sonarqubecloud
Copy link

Copilot AI and others added 2 commits October 26, 2025 15:23
Co-authored-by: npsg02 <150496964+npsg02@users.noreply.github.com>
Co-authored-by: npsg02 <150496964+npsg02@users.noreply.github.com>
@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

Copilot AI changed the title [WIP] Implement client module for backend and frontend services Add client libraries for NestJS backend and Axios frontend Oct 26, 2025
Copilot AI requested a review from npsg02 October 26, 2025 15:28
Copilot finished work on behalf of npsg02 October 26, 2025 15:28
@npsg02 npsg02 marked this pull request as ready for review October 27, 2025 00:51
@npsg02 npsg02 merged commit b4f9681 into feat/storage-service Oct 27, 2025
2 of 3 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