refactor: prefix Mi for all entities (#11719)
* wip
* wip
* wip
* wip
* Update RepositoryModule.ts
* wip
* wip
* wip
* Revert "wip"
This reverts commit c1c13b37d2
.
This commit is contained in:
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
import { DeleteObjectCommand, S3Client } from '@aws-sdk/client-s3';
|
||||
import { Upload } from '@aws-sdk/lib-storage';
|
||||
import { NodeHttpHandler, NodeHttpHandlerOptions } from '@aws-sdk/node-http-handler';
|
||||
import type { Meta } from '@/models/entities/Meta.js';
|
||||
import type { MiMeta } from '@/models/entities/Meta.js';
|
||||
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import type { DeleteObjectCommandInput, PutObjectCommandInput } from '@aws-sdk/client-s3';
|
||||
@@ -23,7 +23,7 @@ export class S3Service {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public getS3Client(meta: Meta): S3Client {
|
||||
public getS3Client(meta: MiMeta): S3Client {
|
||||
const u = meta.objectStorageEndpoint
|
||||
? `${meta.objectStorageUseSSL ? 'https' : 'http'}://${meta.objectStorageEndpoint}`
|
||||
: `${meta.objectStorageUseSSL ? 'https' : 'http'}://example.net`; // dummy url to select http(s) agent
|
||||
@@ -50,7 +50,7 @@ export class S3Service {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async upload(meta: Meta, input: PutObjectCommandInput) {
|
||||
public async upload(meta: MiMeta, input: PutObjectCommandInput) {
|
||||
const client = this.getS3Client(meta);
|
||||
return new Upload({
|
||||
client,
|
||||
@@ -62,7 +62,7 @@ export class S3Service {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public delete(meta: Meta, input: DeleteObjectCommandInput) {
|
||||
public delete(meta: MiMeta, input: DeleteObjectCommandInput) {
|
||||
const client = this.getS3Client(meta);
|
||||
return client.send(new DeleteObjectCommand(input));
|
||||
}
|
||||
|
Reference in New Issue
Block a user