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: expose native OSS from package #3132

Merged
merged 1 commit into from Aug 5, 2023

Conversation

ghostoy
Copy link
Contributor

@ghostoy ghostoy commented Aug 2, 2023

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

oss

Description of change

在某些情况下,不引用OSS的返回值类型的时候会报TS2742错误

这个补丁导出了@midwayjs/oss内的原生OSS对象和类型,可以避免上述问题,同时也避免引入额外的ali-oss依赖。

import { OSS, OSSService } from '@midwayjs/oss';
import { Inject } from '@midayjs/core';

@Provide()
export class MyService {
  @Inject()
  ossService: OSSService;

  async deleteMulti(keys: string[]): Promise<OSS.DeleteMultiResult> {
    // 如果不声明返回值类型会报TS2742错误
    return await this.ossService.deleteMulti(keys, { quiet: true });
  }
}

@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.15% ⚠️

Comparison is base (c6d8317) 81.83% compared to head (166f679) 81.69%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3132      +/-   ##
==========================================
- Coverage   81.83%   81.69%   -0.15%     
==========================================
  Files         438      439       +1     
  Lines       15936    15938       +2     
  Branches     3773     3773              
==========================================
- Hits        13042    13020      -22     
- Misses       2626     2645      +19     
- Partials      268      273       +5     
Files Changed Coverage Δ
packages/oss/src/interface.ts 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@czy88840616 czy88840616 added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Aug 5, 2023
@czy88840616 czy88840616 merged commit b30b188 into midwayjs:main Aug 5, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Development

Successfully merging this pull request may close these issues.

None yet

3 participants