@dofe/infra-shared-services 0.1.13 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/file-cdn/dto/file-cdn.dto.d.ts +78 -0
- package/dist/file-cdn/dto/file-cdn.dto.d.ts.map +1 -0
- package/dist/file-cdn/dto/file-cdn.dto.js +70 -0
- package/dist/file-cdn/dto/file-cdn.dto.js.map +1 -0
- package/dist/file-cdn/file-cdn.client.d.ts +283 -0
- package/dist/file-cdn/file-cdn.client.d.ts.map +1 -0
- package/dist/file-cdn/file-cdn.client.js +526 -0
- package/dist/file-cdn/file-cdn.client.js.map +1 -0
- package/dist/file-cdn/file-cdn.module.d.ts +3 -0
- package/dist/file-cdn/file-cdn.module.d.ts.map +1 -0
- package/dist/file-cdn/file-cdn.module.js +26 -0
- package/dist/file-cdn/file-cdn.module.js.map +1 -0
- package/dist/file-cdn/index.d.ts +4 -0
- package/dist/file-cdn/index.d.ts.map +1 -0
- package/dist/file-cdn/index.js +20 -0
- package/dist/file-cdn/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview File CDN 类型定义
|
|
3
|
+
*
|
|
4
|
+
* @module file-cdn/dto
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
export declare const QueryDataSchema: z.ZodObject<{
|
|
8
|
+
auth: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const CdnConfigSchema: z.ZodObject<{
|
|
11
|
+
url: z.ZodString;
|
|
12
|
+
downloaderUrl: z.ZodString;
|
|
13
|
+
vodUrl: z.ZodString;
|
|
14
|
+
thumbTemplate: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const CdnConfigsSchema: z.ZodObject<{
|
|
17
|
+
cn: z.ZodObject<{
|
|
18
|
+
url: z.ZodString;
|
|
19
|
+
downloaderUrl: z.ZodString;
|
|
20
|
+
vodUrl: z.ZodString;
|
|
21
|
+
thumbTemplate: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
us: z.ZodObject<{
|
|
24
|
+
url: z.ZodString;
|
|
25
|
+
downloaderUrl: z.ZodString;
|
|
26
|
+
vodUrl: z.ZodString;
|
|
27
|
+
thumbTemplate: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const CdnUrlResponseSchema: z.ZodObject<{
|
|
31
|
+
code: z.ZodNumber;
|
|
32
|
+
message: z.ZodString;
|
|
33
|
+
url: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export declare const ImageTemplateIdSchema: z.ZodUnion<readonly [z.ZodLiteral<"origin">, z.ZodLiteral<"preview">, z.ZodLiteral<"mini">, z.ZodString]>;
|
|
36
|
+
export declare const CloudFlareTemplateSchema: z.ZodUnion<readonly [z.ZodLiteral<"360:360:360:360">, z.ZodLiteral<"183:103:360:360">, z.ZodLiteral<"origin">, z.ZodLiteral<"mini">, z.ZodString]>;
|
|
37
|
+
export declare const CdnRegionSchema: z.ZodEnum<{
|
|
38
|
+
cn: "cn";
|
|
39
|
+
us: "us";
|
|
40
|
+
}>;
|
|
41
|
+
export declare const CdnUrlTypeSchema: z.ZodEnum<{
|
|
42
|
+
image: "image";
|
|
43
|
+
video: "video";
|
|
44
|
+
download: "download";
|
|
45
|
+
}>;
|
|
46
|
+
export declare const SignedUrlParamsSchema: z.ZodObject<{
|
|
47
|
+
auth: z.ZodOptional<z.ZodString>;
|
|
48
|
+
expireIn: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
49
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
50
|
+
signedHeaders: z.ZodOptional<z.ZodString>;
|
|
51
|
+
signedId: z.ZodOptional<z.ZodString>;
|
|
52
|
+
templateId: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export declare const AwsSignatureV4ParamsSchema: z.ZodObject<{
|
|
55
|
+
algorithm: z.ZodString;
|
|
56
|
+
contentSha256: z.ZodString;
|
|
57
|
+
credential: z.ZodString;
|
|
58
|
+
expires: z.ZodNumber;
|
|
59
|
+
signature: z.ZodString;
|
|
60
|
+
signedHeaders: z.ZodString;
|
|
61
|
+
requestId: z.ZodString;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type QueryData = z.infer<typeof QueryDataSchema>;
|
|
64
|
+
export type CdnConfig = z.infer<typeof CdnConfigSchema>;
|
|
65
|
+
export type CdnConfigs = z.infer<typeof CdnConfigsSchema>;
|
|
66
|
+
export type CdnUrlResponse = z.infer<typeof CdnUrlResponseSchema>;
|
|
67
|
+
export type ImageTemplateId = z.infer<typeof ImageTemplateIdSchema>;
|
|
68
|
+
export type CloudFlareTemplate = z.infer<typeof CloudFlareTemplateSchema>;
|
|
69
|
+
export type CdnRegion = z.infer<typeof CdnRegionSchema>;
|
|
70
|
+
export type CdnUrlType = z.infer<typeof CdnUrlTypeSchema>;
|
|
71
|
+
export type SignedUrlParams = z.infer<typeof SignedUrlParamsSchema>;
|
|
72
|
+
export type AwsSignatureV4Params = z.infer<typeof AwsSignatureV4ParamsSchema>;
|
|
73
|
+
export declare namespace DoFeFileCdn {
|
|
74
|
+
type QueryData = z.infer<typeof QueryDataSchema>;
|
|
75
|
+
type Config = z.infer<typeof CdnConfigSchema>;
|
|
76
|
+
type Configs = z.infer<typeof CdnConfigsSchema>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=file-cdn.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-cdn.dto.d.ts","sourceRoot":"","sources":["../../../../../packages/shared-services/src/file-cdn/dto/file-cdn.dto.ts"],"names":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B,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAG9E,yBAAiB,WAAW,CAAC;IAC3B,KAAY,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;IACxD,KAAY,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;IACrD,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;CACxD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview File CDN 类型定义
|
|
4
|
+
*
|
|
5
|
+
* @module file-cdn/dto
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AwsSignatureV4ParamsSchema = exports.SignedUrlParamsSchema = exports.CdnUrlTypeSchema = exports.CdnRegionSchema = exports.CloudFlareTemplateSchema = exports.ImageTemplateIdSchema = exports.CdnUrlResponseSchema = exports.CdnConfigsSchema = exports.CdnConfigSchema = exports.QueryDataSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
// CDN Query Data Schema
|
|
11
|
+
exports.QueryDataSchema = zod_1.z.object({
|
|
12
|
+
auth: zod_1.z.string(),
|
|
13
|
+
});
|
|
14
|
+
// CDN Config Schema
|
|
15
|
+
exports.CdnConfigSchema = zod_1.z.object({
|
|
16
|
+
url: zod_1.z.string(),
|
|
17
|
+
downloaderUrl: zod_1.z.string(),
|
|
18
|
+
vodUrl: zod_1.z.string(),
|
|
19
|
+
thumbTemplate: zod_1.z.string(),
|
|
20
|
+
});
|
|
21
|
+
// CDN Configs Schema
|
|
22
|
+
exports.CdnConfigsSchema = zod_1.z.object({
|
|
23
|
+
cn: exports.CdnConfigSchema,
|
|
24
|
+
us: exports.CdnConfigSchema,
|
|
25
|
+
});
|
|
26
|
+
// CDN URL Response Schema
|
|
27
|
+
exports.CdnUrlResponseSchema = zod_1.z.object({
|
|
28
|
+
code: zod_1.z.number(),
|
|
29
|
+
message: zod_1.z.string(),
|
|
30
|
+
url: zod_1.z.string(),
|
|
31
|
+
});
|
|
32
|
+
// Image Template ID Schema
|
|
33
|
+
exports.ImageTemplateIdSchema = zod_1.z.union([
|
|
34
|
+
zod_1.z.literal('origin'),
|
|
35
|
+
zod_1.z.literal('preview'),
|
|
36
|
+
zod_1.z.literal('mini'),
|
|
37
|
+
zod_1.z.string(),
|
|
38
|
+
]);
|
|
39
|
+
// CloudFlare Template Schema
|
|
40
|
+
exports.CloudFlareTemplateSchema = zod_1.z.union([
|
|
41
|
+
zod_1.z.literal('360:360:360:360'),
|
|
42
|
+
zod_1.z.literal('183:103:360:360'),
|
|
43
|
+
zod_1.z.literal('origin'),
|
|
44
|
+
zod_1.z.literal('mini'),
|
|
45
|
+
zod_1.z.string(),
|
|
46
|
+
]);
|
|
47
|
+
// CDN Region Schema
|
|
48
|
+
exports.CdnRegionSchema = zod_1.z.enum(['cn', 'us']);
|
|
49
|
+
// CDN URL Type Schema
|
|
50
|
+
exports.CdnUrlTypeSchema = zod_1.z.enum(['image', 'video', 'download']);
|
|
51
|
+
// Signed URL Params Schema
|
|
52
|
+
exports.SignedUrlParamsSchema = zod_1.z.object({
|
|
53
|
+
auth: zod_1.z.string().optional(),
|
|
54
|
+
expireIn: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(),
|
|
55
|
+
signature: zod_1.z.string().optional(),
|
|
56
|
+
signedHeaders: zod_1.z.string().optional(),
|
|
57
|
+
signedId: zod_1.z.string().optional(),
|
|
58
|
+
templateId: zod_1.z.string().optional(),
|
|
59
|
+
});
|
|
60
|
+
// AWS Signature V4 Params Schema
|
|
61
|
+
exports.AwsSignatureV4ParamsSchema = zod_1.z.object({
|
|
62
|
+
algorithm: zod_1.z.string(),
|
|
63
|
+
contentSha256: zod_1.z.string(),
|
|
64
|
+
credential: zod_1.z.string(),
|
|
65
|
+
expires: zod_1.z.number(),
|
|
66
|
+
signature: zod_1.z.string(),
|
|
67
|
+
signedHeaders: zod_1.z.string(),
|
|
68
|
+
requestId: zod_1.z.string(),
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=file-cdn.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-cdn.dto.js","sourceRoot":"","sources":["../../../../../packages/shared-services/src/file-cdn/dto/file-cdn.dto.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6BAAwB;AAExB,wBAAwB;AACX,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH,oBAAoB;AACP,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC;AAEH,qBAAqB;AACR,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,uBAAe;IACnB,EAAE,EAAE,uBAAe;CACpB,CAAC,CAAC;AAEH,0BAA0B;AACb,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAC;AAEH,2BAA2B;AACd,QAAA,qBAAqB,GAAG,OAAC,CAAC,KAAK,CAAC;IAC3C,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACnB,OAAC,CAAC,OAAO,CAAC,SAAS,C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AAM,EAAE;IACrB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview File CDN 客户端
|
|
3
|
+
*
|
|
4
|
+
* 本文件实现了 CDN URL 生成服务,负责:
|
|
5
|
+
* - 生成图片 CDN URL(火山引擎、CloudFlare)
|
|
6
|
+
* - 生成视频点播 URL
|
|
7
|
+
* - 生成文件下载 URL
|
|
8
|
+
* - 处理 CDN 签名和认证
|
|
9
|
+
*
|
|
10
|
+
* @module file-cdn/client
|
|
11
|
+
*/
|
|
12
|
+
import { Logger } from 'winston';
|
|
13
|
+
import { ConfigService } from '@nestjs/config';
|
|
14
|
+
import { FileBucketVendor } from '@prisma/client';
|
|
15
|
+
import { FileStorageService } from '../file-storage/file-storage.service';
|
|
16
|
+
import { CryptClient } from '@dofe/infra-clients';
|
|
17
|
+
import { CdnUrlResponse, ImageTemplateId, CloudFlareTemplate } from './dto/file-cdn.dto';
|
|
18
|
+
/**
|
|
19
|
+
* File CDN 客户端
|
|
20
|
+
*
|
|
21
|
+
* @description 提供 CDN URL 生成服务,支持多种 CDN 供应商和 URL 类型。
|
|
22
|
+
*
|
|
23
|
+
* 主要功能:
|
|
24
|
+
* - **图片 CDN**: 火山引擎图片处理、CloudFlare 图片优化
|
|
25
|
+
* - **视频 CDN**: 视频点播 URL 生成
|
|
26
|
+
* - **下载 CDN**: 文件下载 URL 生成
|
|
27
|
+
*
|
|
28
|
+
* 安全特性:
|
|
29
|
+
* - 支持 AWS 签名 V4 认证
|
|
30
|
+
* - 支持 URL 签名验证
|
|
31
|
+
* - 私有文件访问控制
|
|
32
|
+
*
|
|
33
|
+
* @class FileCdnClient
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* @Injectable()
|
|
38
|
+
* class ImageService {
|
|
39
|
+
* constructor(private readonly cdnClient: FileCdnClient) {}
|
|
40
|
+
*
|
|
41
|
+
* // 获取图片 CDN URL
|
|
42
|
+
* async getImageUrl(vendor: FileBucketVendor, bucket: string, key: string) {
|
|
43
|
+
* return await this.cdnClient.getImageVolcengineCdn(
|
|
44
|
+
* vendor,
|
|
45
|
+
* bucket,
|
|
46
|
+
* key,
|
|
47
|
+
* 'mini',
|
|
48
|
+
* );
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* // 获取视频 URL
|
|
52
|
+
* async getVideoUrl(vendor: FileBucketVendor, bucket: string, key: string) {
|
|
53
|
+
* return await this.cdnClient.getVodUrl(vendor, bucket, key);
|
|
54
|
+
* }
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare class FileCdnClient {
|
|
59
|
+
private readonly fileApi;
|
|
60
|
+
private readonly crypt;
|
|
61
|
+
private readonly logger;
|
|
62
|
+
/**
|
|
63
|
+
* CDN 配置
|
|
64
|
+
* @private
|
|
65
|
+
*/
|
|
66
|
+
private readonly cdnConfig;
|
|
67
|
+
/**
|
|
68
|
+
* 构造函数
|
|
69
|
+
*
|
|
70
|
+
* @param {ConfigService} config - NestJS 配置服务
|
|
71
|
+
* @param {FileStorageService} fileApi - 文件存储服务
|
|
72
|
+
* @param {CryptClient} crypt - 加密服务
|
|
73
|
+
* @param {Logger} logger - Winston 日志记录器
|
|
74
|
+
*/
|
|
75
|
+
constructor(config: ConfigService, fileApi: FileStorageService, crypt: CryptClient, logger: Logger);
|
|
76
|
+
/**
|
|
77
|
+
* 获取文件下载 URL
|
|
78
|
+
*
|
|
79
|
+
* @description 生成文件下载器的 CDN URL,支持公开和私有文件。
|
|
80
|
+
*
|
|
81
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
82
|
+
* @param {string} bucket - 存储桶名称
|
|
83
|
+
* @param {string} key - 文件键
|
|
84
|
+
* @returns {Promise<string>} CDN 下载 URL
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const url = await cdnClient.getDownloaderUrl('oss', 'my-bucket', 'files/doc.pdf');
|
|
89
|
+
* // 返回: "https://cdn.example.com/signed-url..."
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
getDownloaderUrl(vendor: FileBucketVendor, bucket: string, key: string): Promise<string>;
|
|
93
|
+
/**
|
|
94
|
+
* 获取视频点播 URL
|
|
95
|
+
*
|
|
96
|
+
* @description 生成视频点播的 CDN URL,支持公开和私有视频。
|
|
97
|
+
*
|
|
98
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
99
|
+
* @param {string} bucket - 存储桶名称
|
|
100
|
+
* @param {string} key - 视频文件键
|
|
101
|
+
* @returns {Promise<string>} CDN 视频 URL
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const url = await cdnClient.getVodUrl('tos', 'video-bucket', 'videos/movie.mp4');
|
|
106
|
+
* // 返回: "https://vod.example.com/signed-url..."
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
getVodUrl(vendor: FileBucketVendor, bucket: string, key: string): Promise<string>;
|
|
110
|
+
/**
|
|
111
|
+
* 获取火山引擎图片 CDN URL
|
|
112
|
+
*
|
|
113
|
+
* @description 生成火山引擎图片处理的 CDN URL,支持多种图片模板。
|
|
114
|
+
*
|
|
115
|
+
* 支持的模板:
|
|
116
|
+
* - `origin`: 原图预览
|
|
117
|
+
* - `preview`: 预览图
|
|
118
|
+
* - `mini`: 缩略图
|
|
119
|
+
* - 自定义尺寸: `183:103:360:360` 格式
|
|
120
|
+
*
|
|
121
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
122
|
+
* @param {string} bucket - 存储桶名称
|
|
123
|
+
* @param {string} key - 图片文件键
|
|
124
|
+
* @param {ImageTemplateId} [templateId='183:103:360:360'] - 图片模板 ID
|
|
125
|
+
* @returns {Promise<string>} CDN 图片 URL
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* // 获取缩略图
|
|
130
|
+
* const miniUrl = await cdnClient.getImageVolcengineCdn(
|
|
131
|
+
* 'tos',
|
|
132
|
+
* 'image-bucket',
|
|
133
|
+
* 'images/photo.jpg',
|
|
134
|
+
* 'mini',
|
|
135
|
+
* );
|
|
136
|
+
*
|
|
137
|
+
* // 获取自定义尺寸
|
|
138
|
+
* const customUrl = await cdnClient.getImageVolcengineCdn(
|
|
139
|
+
* 'tos',
|
|
140
|
+
* 'image-bucket',
|
|
141
|
+
* 'images/photo.jpg',
|
|
142
|
+
* '640:480:640:480',
|
|
143
|
+
* );
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
getImageVolcengineCdn(vendor: FileBucketVendor, bucket: string, key: string, templateId?: ImageTemplateId): Promise<string>;
|
|
147
|
+
/**
|
|
148
|
+
* 获取 CloudFlare 图片 CDN URL
|
|
149
|
+
*
|
|
150
|
+
* @description 生成 CloudFlare 图片优化的 CDN URL。
|
|
151
|
+
*
|
|
152
|
+
* 支持的模板:
|
|
153
|
+
* - `360:360:360:360`: 360x360 裁剪
|
|
154
|
+
* - `183:103:360:360`: 320x180 裁剪
|
|
155
|
+
* - `origin`: 原图
|
|
156
|
+
* - `mini`: 360x360 包含
|
|
157
|
+
*
|
|
158
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
159
|
+
* @param {string} bucket - 存储桶名称
|
|
160
|
+
* @param {string} key - 图片文件键
|
|
161
|
+
* @param {CloudFlareTemplate} [templateId='183:103:360:360'] - CloudFlare 模板
|
|
162
|
+
* @returns {Promise<string>} CDN 图片 URL
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* const url = await cdnClient.getImageCloudFlareCdnUrl(
|
|
167
|
+
* 'oss',
|
|
168
|
+
* 'image-bucket',
|
|
169
|
+
* 'images/photo.jpg',
|
|
170
|
+
* 'mini',
|
|
171
|
+
* );
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
getImageCloudFlareCdnUrl(vendor: FileBucketVendor, bucket: string, key: string, templateId?: CloudFlareTemplate): Promise<string>;
|
|
175
|
+
/**
|
|
176
|
+
* 获取原始 CDN 图片(带验证)
|
|
177
|
+
*
|
|
178
|
+
* @description 验证签名后返回原始图片 URL,用于 CDN 回源。
|
|
179
|
+
*
|
|
180
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
181
|
+
* @param {string} bucket - 存储桶名称
|
|
182
|
+
* @param {string} key - 图片文件键
|
|
183
|
+
* @param {string} [auth] - 认证信息
|
|
184
|
+
* @param {string} [expireIn] - 过期时间
|
|
185
|
+
* @param {string} [signature] - 签名
|
|
186
|
+
* @param {string} [signedHeaders] - 签名头
|
|
187
|
+
* @param {string} [signedId] - 签名 ID
|
|
188
|
+
* @param {string} [templateId='183:103:360:360'] - 模板 ID
|
|
189
|
+
* @returns {Promise<CdnUrlResponse>} CDN URL 响应
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```typescript
|
|
193
|
+
* const response = await cdnClient.getCdnOriginImages(
|
|
194
|
+
* 'tos',
|
|
195
|
+
* 'bucket',
|
|
196
|
+
* 'key',
|
|
197
|
+
* auth,
|
|
198
|
+
* expireIn,
|
|
199
|
+
* signature,
|
|
200
|
+
* signedHeaders,
|
|
201
|
+
* signedId,
|
|
202
|
+
* );
|
|
203
|
+
*
|
|
204
|
+
* if (response.code === 200) {
|
|
205
|
+
* console.log('Origin URL:', response.url);
|
|
206
|
+
* }
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
getCdnOriginImages(vendor: FileBucketVendor, bucket: string, key: string, auth?: string, expireIn?: string, signature?: string, signedHeaders?: string, signedId?: string, templateId?: string): Promise<CdnUrlResponse>;
|
|
210
|
+
/**
|
|
211
|
+
* 构建 URI 路径
|
|
212
|
+
*
|
|
213
|
+
* @private
|
|
214
|
+
*/
|
|
215
|
+
private buildUri;
|
|
216
|
+
/**
|
|
217
|
+
* 构建公开 URL
|
|
218
|
+
*
|
|
219
|
+
* @private
|
|
220
|
+
*/
|
|
221
|
+
private buildPublicUrl;
|
|
222
|
+
/**
|
|
223
|
+
* 构建私有 URL(带 AWS 签名 V4)
|
|
224
|
+
*
|
|
225
|
+
* @private
|
|
226
|
+
*/
|
|
227
|
+
private buildPrivateUrl;
|
|
228
|
+
/**
|
|
229
|
+
* 构建私有图片 URL
|
|
230
|
+
*
|
|
231
|
+
* @private
|
|
232
|
+
*/
|
|
233
|
+
private buildPrivateImageUrl;
|
|
234
|
+
/**
|
|
235
|
+
* 构建 CloudFlare 私有 URL
|
|
236
|
+
*
|
|
237
|
+
* @private
|
|
238
|
+
*/
|
|
239
|
+
private buildCloudFlarePrivateUrl;
|
|
240
|
+
/**
|
|
241
|
+
* 构建 AWS 签名 URL
|
|
242
|
+
*
|
|
243
|
+
* @private
|
|
244
|
+
*/
|
|
245
|
+
private buildAwsSignedUrl;
|
|
246
|
+
/**
|
|
247
|
+
* 生成签名
|
|
248
|
+
*
|
|
249
|
+
* @private
|
|
250
|
+
*/
|
|
251
|
+
private generateSignature;
|
|
252
|
+
/**
|
|
253
|
+
* 获取火山引擎图片模板
|
|
254
|
+
*
|
|
255
|
+
* @private
|
|
256
|
+
*/
|
|
257
|
+
private getVolcengineTemplate;
|
|
258
|
+
/**
|
|
259
|
+
* 获取 CloudFlare 图片模板
|
|
260
|
+
*
|
|
261
|
+
* @private
|
|
262
|
+
*/
|
|
263
|
+
private getCloudFlareTemplate;
|
|
264
|
+
/**
|
|
265
|
+
* 验证签名
|
|
266
|
+
*
|
|
267
|
+
* @private
|
|
268
|
+
*/
|
|
269
|
+
private validateSignature;
|
|
270
|
+
/**
|
|
271
|
+
* 创建禁止访问响应
|
|
272
|
+
*
|
|
273
|
+
* @private
|
|
274
|
+
*/
|
|
275
|
+
private createForbiddenResponse;
|
|
276
|
+
/**
|
|
277
|
+
* 创建成功响应
|
|
278
|
+
*
|
|
279
|
+
* @private
|
|
280
|
+
*/
|
|
281
|
+
private createSuccessResponse;
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=file-cdn.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-cdn.client.d.ts","sourceRoot":"","sources":["../../../../packages/shared-services/src/file-cdn/file-cdn.client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAEL,cAAc,EACd,eAAe,EACf,kBAAkB,EAEnB,MAAM,oBAAoB,CAAC;AAuD5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,qBACa,aAAa;IAiBtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACW,OAAO,CAAC,QAAQ,CAAC,MAAM;IAlB1D;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsB;IAEhD;;;;;;;OAOG;gBAED,MAAM,EAAE,aAAa,EACJ,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,WAAW,EACe,MAAM,EAAE,MAAM;IASlE;;;;;;;;;;;;;;;OAeG;IACG,gBAAgB,CACpB,MAAM,EAAE,gBAAgB,EACxB,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IAMzB;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAO7B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAI7B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA6BzB;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAQ/B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;CAO9B"}
|
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview File CDN 客户端
|
|
4
|
+
*
|
|
5
|
+
* 本文件实现了 CDN URL 生成服务,负责:
|
|
6
|
+
* - 生成图片 CDN URL(火山引擎、CloudFlare)
|
|
7
|
+
* - 生成视频点播 URL
|
|
8
|
+
* - 生成文件下载 URL
|
|
9
|
+
* - 处理 CDN 签名和认证
|
|
10
|
+
*
|
|
11
|
+
* @module file-cdn/client
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
30
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
31
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
32
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
33
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
34
|
+
};
|
|
35
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
36
|
+
var ownKeys = function(o) {
|
|
37
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
38
|
+
var ar = [];
|
|
39
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
return ownKeys(o);
|
|
43
|
+
};
|
|
44
|
+
return function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
53
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
54
|
+
};
|
|
55
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
56
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
57
|
+
};
|
|
58
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
+
exports.FileCdnClient = void 0;
|
|
60
|
+
const common_1 = require("@nestjs/common");
|
|
61
|
+
const nest_winston_1 = require("nest-winston");
|
|
62
|
+
const winston_1 = require("winston");
|
|
63
|
+
const config_1 = require("@nestjs/config");
|
|
64
|
+
const file_storage_service_1 = require("../file-storage/file-storage.service");
|
|
65
|
+
const infra_clients_1 = require("@dofe/infra-clients");
|
|
66
|
+
const cryptoUtil = __importStar(require("@dofe/infra-utils"));
|
|
67
|
+
// ============================================================================
|
|
68
|
+
// 常量定义
|
|
69
|
+
// ============================================================================
|
|
70
|
+
/**
|
|
71
|
+
* 默认过期时间(30天,单位:秒)
|
|
72
|
+
*/
|
|
73
|
+
const DEFAULT_EXPIRE_IN = 24 * 3600 * 30;
|
|
74
|
+
/**
|
|
75
|
+
* AWS 签名 V4 算法
|
|
76
|
+
*/
|
|
77
|
+
const AWS_ALGORITHM = 'AWS4-HMAC-SHA256';
|
|
78
|
+
/**
|
|
79
|
+
* 未签名内容 SHA256
|
|
80
|
+
*/
|
|
81
|
+
const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD';
|
|
82
|
+
/**
|
|
83
|
+
* 默认签名头
|
|
84
|
+
*/
|
|
85
|
+
const DEFAULT_SIGNED_HEADERS = 'host';
|
|
86
|
+
/**
|
|
87
|
+
* 默认签名 ID
|
|
88
|
+
*/
|
|
89
|
+
const DEFAULT_SIGNED_ID = 'GetObject';
|
|
90
|
+
/**
|
|
91
|
+
* 火山引擎图片模板映射
|
|
92
|
+
*/
|
|
93
|
+
const VOLCENGINE_TEMPLATES = {
|
|
94
|
+
origin: '~tplv-fv5ms769k2-preview-v3.image',
|
|
95
|
+
preview: '~tplv-fv5ms769k2-preview-v3.image',
|
|
96
|
+
mini: '~tplv-i29hxueo9g-mini.image',
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* CloudFlare 图片尺寸模板映射
|
|
100
|
+
*/
|
|
101
|
+
const CLOUDFLARE_TEMPLATES = {
|
|
102
|
+
'360:360:360:360': 'width=360,height=360,fit=crop,gravity=center',
|
|
103
|
+
'183:103:360:360': 'width=320,height=180,fit=crop,gravity=center',
|
|
104
|
+
origin: 'fit=contain',
|
|
105
|
+
mini: 'width=360,height=360,fit=contain',
|
|
106
|
+
default: 'width=720,height=720,fit=contain',
|
|
107
|
+
};
|
|
108
|
+
// ============================================================================
|
|
109
|
+
// 客户端实现
|
|
110
|
+
// ============================================================================
|
|
111
|
+
/**
|
|
112
|
+
* File CDN 客户端
|
|
113
|
+
*
|
|
114
|
+
* @description 提供 CDN URL 生成服务,支持多种 CDN 供应商和 URL 类型。
|
|
115
|
+
*
|
|
116
|
+
* 主要功能:
|
|
117
|
+
* - **图片 CDN**: 火山引擎图片处理、CloudFlare 图片优化
|
|
118
|
+
* - **视频 CDN**: 视频点播 URL 生成
|
|
119
|
+
* - **下载 CDN**: 文件下载 URL 生成
|
|
120
|
+
*
|
|
121
|
+
* 安全特性:
|
|
122
|
+
* - 支持 AWS 签名 V4 认证
|
|
123
|
+
* - 支持 URL 签名验证
|
|
124
|
+
* - 私有文件访问控制
|
|
125
|
+
*
|
|
126
|
+
* @class FileCdnClient
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* @Injectable()
|
|
131
|
+
* class ImageService {
|
|
132
|
+
* constructor(private readonly cdnClient: FileCdnClient) {}
|
|
133
|
+
*
|
|
134
|
+
* // 获取图片 CDN URL
|
|
135
|
+
* async getImageUrl(vendor: FileBucketVendor, bucket: string, key: string) {
|
|
136
|
+
* return await this.cdnClient.getImageVolcengineCdn(
|
|
137
|
+
* vendor,
|
|
138
|
+
* bucket,
|
|
139
|
+
* key,
|
|
140
|
+
* 'mini',
|
|
141
|
+
* );
|
|
142
|
+
* }
|
|
143
|
+
*
|
|
144
|
+
* // 获取视频 URL
|
|
145
|
+
* async getVideoUrl(vendor: FileBucketVendor, bucket: string, key: string) {
|
|
146
|
+
* return await this.cdnClient.getVodUrl(vendor, bucket, key);
|
|
147
|
+
* }
|
|
148
|
+
* }
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
let FileCdnClient = class FileCdnClient {
|
|
152
|
+
fileApi;
|
|
153
|
+
crypt;
|
|
154
|
+
logger;
|
|
155
|
+
/**
|
|
156
|
+
* CDN 配置
|
|
157
|
+
* @private
|
|
158
|
+
*/
|
|
159
|
+
cdnConfig;
|
|
160
|
+
/**
|
|
161
|
+
* 构造函数
|
|
162
|
+
*
|
|
163
|
+
* @param {ConfigService} config - NestJS 配置服务
|
|
164
|
+
* @param {FileStorageService} fileApi - 文件存储服务
|
|
165
|
+
* @param {CryptClient} crypt - 加密服务
|
|
166
|
+
* @param {Logger} logger - Winston 日志记录器
|
|
167
|
+
*/
|
|
168
|
+
constructor(config, fileApi, crypt, logger) {
|
|
169
|
+
this.fileApi = fileApi;
|
|
170
|
+
this.crypt = crypt;
|
|
171
|
+
this.logger = logger;
|
|
172
|
+
this.cdnConfig = config.getOrThrow('cdn');
|
|
173
|
+
}
|
|
174
|
+
// =========================================================================
|
|
175
|
+
// 公共方法
|
|
176
|
+
// =========================================================================
|
|
177
|
+
/**
|
|
178
|
+
* 获取文件下载 URL
|
|
179
|
+
*
|
|
180
|
+
* @description 生成文件下载器的 CDN URL,支持公开和私有文件。
|
|
181
|
+
*
|
|
182
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
183
|
+
* @param {string} bucket - 存储桶名称
|
|
184
|
+
* @param {string} key - 文件键
|
|
185
|
+
* @returns {Promise<string>} CDN 下载 URL
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* const url = await cdnClient.getDownloaderUrl('oss', 'my-bucket', 'files/doc.pdf');
|
|
190
|
+
* // 返回: "https://cdn.example.com/signed-url..."
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
async getDownloaderUrl(vendor, bucket, key) {
|
|
194
|
+
const bucketConfig = await this.fileApi.getFileServiceConfig(vendor, bucket);
|
|
195
|
+
const domain = this.cdnConfig.cn.downloaderUrl;
|
|
196
|
+
const uri = this.buildUri(vendor, bucket, key);
|
|
197
|
+
if (bucketConfig.isPublic) {
|
|
198
|
+
return this.buildPublicUrl(domain, uri);
|
|
199
|
+
}
|
|
200
|
+
return this.buildPrivateUrl(domain, uri, key);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* 获取视频点播 URL
|
|
204
|
+
*
|
|
205
|
+
* @description 生成视频点播的 CDN URL,支持公开和私有视频。
|
|
206
|
+
*
|
|
207
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
208
|
+
* @param {string} bucket - 存储桶名称
|
|
209
|
+
* @param {string} key - 视频文件键
|
|
210
|
+
* @returns {Promise<string>} CDN 视频 URL
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* const url = await cdnClient.getVodUrl('tos', 'video-bucket', 'videos/movie.mp4');
|
|
215
|
+
* // 返回: "https://vod.example.com/signed-url..."
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
async getVodUrl(vendor, bucket, key) {
|
|
219
|
+
const bucketConfig = await this.fileApi.getFileServiceConfig(vendor, bucket);
|
|
220
|
+
const domain = this.cdnConfig.cn.vodUrl;
|
|
221
|
+
const uri = this.buildUri(vendor, bucket, key);
|
|
222
|
+
if (bucketConfig.isPublic) {
|
|
223
|
+
return this.buildPublicUrl(domain, uri);
|
|
224
|
+
}
|
|
225
|
+
return this.buildPrivateUrl(domain, uri, key);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* 获取火山引擎图片 CDN URL
|
|
229
|
+
*
|
|
230
|
+
* @description 生成火山引擎图片处理的 CDN URL,支持多种图片模板。
|
|
231
|
+
*
|
|
232
|
+
* 支持的模板:
|
|
233
|
+
* - `origin`: 原图预览
|
|
234
|
+
* - `preview`: 预览图
|
|
235
|
+
* - `mini`: 缩略图
|
|
236
|
+
* - 自定义尺寸: `183:103:360:360` 格式
|
|
237
|
+
*
|
|
238
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
239
|
+
* @param {string} bucket - 存储桶名称
|
|
240
|
+
* @param {string} key - 图片文件键
|
|
241
|
+
* @param {ImageTemplateId} [templateId='183:103:360:360'] - 图片模板 ID
|
|
242
|
+
* @returns {Promise<string>} CDN 图片 URL
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* ```typescript
|
|
246
|
+
* // 获取缩略图
|
|
247
|
+
* const miniUrl = await cdnClient.getImageVolcengineCdn(
|
|
248
|
+
* 'tos',
|
|
249
|
+
* 'image-bucket',
|
|
250
|
+
* 'images/photo.jpg',
|
|
251
|
+
* 'mini',
|
|
252
|
+
* );
|
|
253
|
+
*
|
|
254
|
+
* // 获取自定义尺寸
|
|
255
|
+
* const customUrl = await cdnClient.getImageVolcengineCdn(
|
|
256
|
+
* 'tos',
|
|
257
|
+
* 'image-bucket',
|
|
258
|
+
* 'images/photo.jpg',
|
|
259
|
+
* '640:480:640:480',
|
|
260
|
+
* );
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
async getImageVolcengineCdn(vendor, bucket, key, templateId = '183:103:360:360') {
|
|
264
|
+
const thumbTemplate = this.getVolcengineTemplate(templateId);
|
|
265
|
+
const domain = this.cdnConfig.cn.url;
|
|
266
|
+
const bucketConfig = await this.fileApi.getFileServiceConfig(vendor, bucket);
|
|
267
|
+
const uri = `${vendor}/${bucket}/${key}${thumbTemplate}?`;
|
|
268
|
+
if (bucketConfig.isPublic) {
|
|
269
|
+
return this.buildPublicUrl(domain, uri);
|
|
270
|
+
}
|
|
271
|
+
return this.buildPrivateImageUrl(domain, uri, key + thumbTemplate, templateId);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* 获取 CloudFlare 图片 CDN URL
|
|
275
|
+
*
|
|
276
|
+
* @description 生成 CloudFlare 图片优化的 CDN URL。
|
|
277
|
+
*
|
|
278
|
+
* 支持的模板:
|
|
279
|
+
* - `360:360:360:360`: 360x360 裁剪
|
|
280
|
+
* - `183:103:360:360`: 320x180 裁剪
|
|
281
|
+
* - `origin`: 原图
|
|
282
|
+
* - `mini`: 360x360 包含
|
|
283
|
+
*
|
|
284
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
285
|
+
* @param {string} bucket - 存储桶名称
|
|
286
|
+
* @param {string} key - 图片文件键
|
|
287
|
+
* @param {CloudFlareTemplate} [templateId='183:103:360:360'] - CloudFlare 模板
|
|
288
|
+
* @returns {Promise<string>} CDN 图片 URL
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* ```typescript
|
|
292
|
+
* const url = await cdnClient.getImageCloudFlareCdnUrl(
|
|
293
|
+
* 'oss',
|
|
294
|
+
* 'image-bucket',
|
|
295
|
+
* 'images/photo.jpg',
|
|
296
|
+
* 'mini',
|
|
297
|
+
* );
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
async getImageCloudFlareCdnUrl(vendor, bucket, key, templateId = '183:103:360:360') {
|
|
301
|
+
const cfTemplate = this.getCloudFlareTemplate(templateId);
|
|
302
|
+
const bucketConfig = await this.fileApi.getFileServiceConfig(vendor, bucket);
|
|
303
|
+
const domain = `${this.cdnConfig.us.url}/${cfTemplate}/https://api.dndshare.com/filecdn/`;
|
|
304
|
+
const uri = `${vendor}/${bucket}/${key}?`;
|
|
305
|
+
if (bucketConfig.isPublic) {
|
|
306
|
+
return this.crypt.getSignUrl(uri);
|
|
307
|
+
}
|
|
308
|
+
return this.buildCloudFlarePrivateUrl(domain, uri, key, templateId);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* 获取原始 CDN 图片(带验证)
|
|
312
|
+
*
|
|
313
|
+
* @description 验证签名后返回原始图片 URL,用于 CDN 回源。
|
|
314
|
+
*
|
|
315
|
+
* @param {FileBucketVendor} vendor - 存储供应商
|
|
316
|
+
* @param {string} bucket - 存储桶名称
|
|
317
|
+
* @param {string} key - 图片文件键
|
|
318
|
+
* @param {string} [auth] - 认证信息
|
|
319
|
+
* @param {string} [expireIn] - 过期时间
|
|
320
|
+
* @param {string} [signature] - 签名
|
|
321
|
+
* @param {string} [signedHeaders] - 签名头
|
|
322
|
+
* @param {string} [signedId] - 签名 ID
|
|
323
|
+
* @param {string} [templateId='183:103:360:360'] - 模板 ID
|
|
324
|
+
* @returns {Promise<CdnUrlResponse>} CDN URL 响应
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```typescript
|
|
328
|
+
* const response = await cdnClient.getCdnOriginImages(
|
|
329
|
+
* 'tos',
|
|
330
|
+
* 'bucket',
|
|
331
|
+
* 'key',
|
|
332
|
+
* auth,
|
|
333
|
+
* expireIn,
|
|
334
|
+
* signature,
|
|
335
|
+
* signedHeaders,
|
|
336
|
+
* signedId,
|
|
337
|
+
* );
|
|
338
|
+
*
|
|
339
|
+
* if (response.code === 200) {
|
|
340
|
+
* console.log('Origin URL:', response.url);
|
|
341
|
+
* }
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
async getCdnOriginImages(vendor, bucket, key, auth, expireIn, signature, signedHeaders, signedId, templateId = '183:103:360:360') {
|
|
345
|
+
// 验证存储桶
|
|
346
|
+
if (!this.fileApi.checkBucketValidate(vendor, bucket)) {
|
|
347
|
+
return this.createForbiddenResponse();
|
|
348
|
+
}
|
|
349
|
+
// 获取存储桶配置
|
|
350
|
+
const bucketConfig = await this.fileApi.getFileServiceConfig(vendor, bucket);
|
|
351
|
+
// 验证私有文件的签名
|
|
352
|
+
if (!bucketConfig.isPublic &&
|
|
353
|
+
!this.validateSignature({
|
|
354
|
+
auth,
|
|
355
|
+
expireIn,
|
|
356
|
+
signature,
|
|
357
|
+
signedHeaders,
|
|
358
|
+
signedId,
|
|
359
|
+
templateId,
|
|
360
|
+
}, key)) {
|
|
361
|
+
return this.createForbiddenResponse();
|
|
362
|
+
}
|
|
363
|
+
this.logger.info('Fetching CDN origin image', {
|
|
364
|
+
vendor,
|
|
365
|
+
bucket,
|
|
366
|
+
key,
|
|
367
|
+
});
|
|
368
|
+
// 获取私有下载 URL
|
|
369
|
+
const url = await this.fileApi.getPrivateDownloadUrl(vendor, bucket, key, {
|
|
370
|
+
expire: DEFAULT_EXPIRE_IN,
|
|
371
|
+
internal: false,
|
|
372
|
+
});
|
|
373
|
+
return this.createSuccessResponse(url);
|
|
374
|
+
}
|
|
375
|
+
// =========================================================================
|
|
376
|
+
// 私有辅助方法
|
|
377
|
+
// =========================================================================
|
|
378
|
+
/**
|
|
379
|
+
* 构建 URI 路径
|
|
380
|
+
*
|
|
381
|
+
* @private
|
|
382
|
+
*/
|
|
383
|
+
buildUri(vendor, bucket, key) {
|
|
384
|
+
return `${vendor}/${bucket}/${key}?`;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* 构建公开 URL
|
|
388
|
+
*
|
|
389
|
+
* @private
|
|
390
|
+
*/
|
|
391
|
+
buildPublicUrl(domain, uri) {
|
|
392
|
+
return `${domain}/${this.crypt.getSignUrl(encodeURI(uri))}`;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* 构建私有 URL(带 AWS 签名 V4)
|
|
396
|
+
*
|
|
397
|
+
* @private
|
|
398
|
+
*/
|
|
399
|
+
buildPrivateUrl(domain, uri, key) {
|
|
400
|
+
const auth = this.crypt.encrypt(key);
|
|
401
|
+
const signature = this.generateSignature(auth);
|
|
402
|
+
return this.buildAwsSignedUrl(domain, uri, {
|
|
403
|
+
auth,
|
|
404
|
+
signature,
|
|
405
|
+
expireIn: DEFAULT_EXPIRE_IN,
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* 构建私有图片 URL
|
|
410
|
+
*
|
|
411
|
+
* @private
|
|
412
|
+
*/
|
|
413
|
+
buildPrivateImageUrl(domain, uri, keyWithTemplate, templateId) {
|
|
414
|
+
const auth = this.crypt.encrypt(keyWithTemplate);
|
|
415
|
+
const signature = this.generateSignature(auth);
|
|
416
|
+
return `${this.buildAwsSignedUrl(domain, uri, {
|
|
417
|
+
auth,
|
|
418
|
+
signature,
|
|
419
|
+
expireIn: DEFAULT_EXPIRE_IN,
|
|
420
|
+
})}&templateId=${templateId}`;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* 构建 CloudFlare 私有 URL
|
|
424
|
+
*
|
|
425
|
+
* @private
|
|
426
|
+
*/
|
|
427
|
+
buildCloudFlarePrivateUrl(domain, uri, key, templateId) {
|
|
428
|
+
const auth = this.crypt.encrypt(key);
|
|
429
|
+
const signature = this.generateSignature(auth);
|
|
430
|
+
return `${domain}/${this.crypt.getSignUrl(uri)}&X-Amz-Algorithm=${AWS_ALGORITHM}&X-Amz-Content-Sha256=${UNSIGNED_PAYLOAD}&X-Amz-Credential=${auth}&X-Amz-Expires=${DEFAULT_EXPIRE_IN}&X-Amz-Signature=${signature}&X-Amz-SignedHeaders=${DEFAULT_SIGNED_HEADERS}&x-id=${DEFAULT_SIGNED_ID}&templateId=${templateId}`;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* 构建 AWS 签名 URL
|
|
434
|
+
*
|
|
435
|
+
* @private
|
|
436
|
+
*/
|
|
437
|
+
buildAwsSignedUrl(domain, uri, params) {
|
|
438
|
+
const { auth, signature, expireIn } = params;
|
|
439
|
+
const signedUri = this.crypt.getSignUrl(encodeURI(uri));
|
|
440
|
+
return `${domain}/${signedUri}&X-Amz-Algorithm=${AWS_ALGORITHM}&X-Amz-Content-Sha256=${UNSIGNED_PAYLOAD}&X-Amz-Credential=${auth}&X-Amz-Expires=${expireIn}&X-Amz-Signature=${signature}&X-Amz-SignedHeaders=${DEFAULT_SIGNED_HEADERS}&x-id=${DEFAULT_SIGNED_ID}`;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* 生成签名
|
|
444
|
+
*
|
|
445
|
+
* @private
|
|
446
|
+
*/
|
|
447
|
+
generateSignature(auth) {
|
|
448
|
+
return cryptoUtil.sha1(`${auth}-time-${DEFAULT_EXPIRE_IN}-header-${DEFAULT_SIGNED_HEADERS}-id-${DEFAULT_SIGNED_ID}`);
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* 获取火山引擎图片模板
|
|
452
|
+
*
|
|
453
|
+
* @private
|
|
454
|
+
*/
|
|
455
|
+
getVolcengineTemplate(templateId) {
|
|
456
|
+
if (VOLCENGINE_TEMPLATES[templateId]) {
|
|
457
|
+
return VOLCENGINE_TEMPLATES[templateId];
|
|
458
|
+
}
|
|
459
|
+
return `~tplv-fv5ms769k2-preview-v2:${templateId}.webp`;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* 获取 CloudFlare 图片模板
|
|
463
|
+
*
|
|
464
|
+
* @private
|
|
465
|
+
*/
|
|
466
|
+
getCloudFlareTemplate(templateId) {
|
|
467
|
+
return CLOUDFLARE_TEMPLATES[templateId] || CLOUDFLARE_TEMPLATES.default;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* 验证签名
|
|
471
|
+
*
|
|
472
|
+
* @private
|
|
473
|
+
*/
|
|
474
|
+
validateSignature(params, key) {
|
|
475
|
+
const { auth, expireIn, signature, signedHeaders, signedId, templateId } = params;
|
|
476
|
+
if (!auth || !expireIn || !signature) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
// 验证签名
|
|
480
|
+
const expectedSignature = cryptoUtil.sha1(`${auth}-time-${expireIn}-header-${signedHeaders}-id-${signedId}`);
|
|
481
|
+
if (expectedSignature !== signature) {
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
// 验证认证信息
|
|
485
|
+
const decodedAuth = decodeURIComponent(auth);
|
|
486
|
+
const authKey = decodeURIComponent(this.crypt.decrypt(decodedAuth));
|
|
487
|
+
const template = templateId !== 'origin'
|
|
488
|
+
? `~tplv-i29hxueo9g-thumb-v1:${templateId}.awebp`
|
|
489
|
+
: '~tplv-i29hxueo9g-orgin.awebp';
|
|
490
|
+
return authKey === `${key}${template}`;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* 创建禁止访问响应
|
|
494
|
+
*
|
|
495
|
+
* @private
|
|
496
|
+
*/
|
|
497
|
+
createForbiddenResponse() {
|
|
498
|
+
return {
|
|
499
|
+
code: 403,
|
|
500
|
+
message: 'Forbidden',
|
|
501
|
+
url: '',
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* 创建成功响应
|
|
506
|
+
*
|
|
507
|
+
* @private
|
|
508
|
+
*/
|
|
509
|
+
createSuccessResponse(url) {
|
|
510
|
+
return {
|
|
511
|
+
code: 200,
|
|
512
|
+
message: 'success',
|
|
513
|
+
url,
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
exports.FileCdnClient = FileCdnClient;
|
|
518
|
+
exports.FileCdnClient = FileCdnClient = __decorate([
|
|
519
|
+
(0, common_1.Injectable)(),
|
|
520
|
+
__param(3, (0, common_1.Inject)(nest_winston_1.WINSTON_MODULE_PROVIDER)),
|
|
521
|
+
__metadata("design:paramtypes", [config_1.ConfigService,
|
|
522
|
+
file_storage_service_1.FileStorageService,
|
|
523
|
+
infra_clients_1.CryptClient,
|
|
524
|
+
winston_1.Logger])
|
|
525
|
+
], FileCdnClient);
|
|
526
|
+
//# sourceMappingURL=file-cdn.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-cdn.client.js","sourceRoot":"","sources":["../../../../packages/shared-services/src/file-cdn/file-cdn.client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAAoD;AACpD,+CAAuD;AACvD,qCAAiC;AACjC,2CAA+C;AAG/C,+EAA0E;AAC1E,uDAAkD;AAClD,8DAAgD;AAShD,+EAA+E;AAC/E,OAAO;AACP,+EAA+E;AAE/E;;GAEG;AACH,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,CAAC;AAEzC;;GAEG;AACH,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEzC;;GAEG;AACH,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C;;GAEG;AACH,MAAM,sBAAs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SAAS;QACT,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;QAEpE,MAAM,QAAQ,GACZ,UAAU,KAAK,QAAQ;YACrB,CAAC,CAAC,6BAA6B,UAAU,QAAQ;YACjD,CAAC,CAAC,8BAA8B,CAAC;QAErC,OAAO,OAAO,KAAK,GAAG,GAAG,GAAG,QAAQ,EAAE,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACK,uBAAuB;QAC7B,OAAO;YACL,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,WAAW;YACpB,GAAG,EAAE,EAAE;SACR,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACK,qBAAqB,CAAC,GAAW;QACvC,OAAO;YACL,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,SAAS;YAClB,GAAG;SACJ,CAAC;IACJ,CAAC;CACF,CAAA;AAreY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAoBR,WAAA,IAAA,eAAM,EAAC,sCAAuB,CAAC,CAAA;qCAHxB,sBAAa;QACK,yCAAkB;QACpB,2BAAW;QACuB,gBAAM;GAnBvD,aAAa,CAqezB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-cdn.module.d.ts","sourceRoot":"","sources":["../../../../packages/shared-services/src/file-cdn/file-cdn.module.ts"],"names":[],"mappings":"AAOA,qBAKa,aAAa;CAAG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.FileCdnModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const file_cdn_client_1 = require("./file-cdn.client");
|
|
12
|
+
const file_storage_module_1 = require("../file-storage/file-storage.module");
|
|
13
|
+
const infra_redis_1 = require("@dofe/infra-redis");
|
|
14
|
+
const config_1 = require("@nestjs/config");
|
|
15
|
+
const infra_clients_1 = require("@dofe/infra-clients");
|
|
16
|
+
let FileCdnModule = class FileCdnModule {
|
|
17
|
+
};
|
|
18
|
+
exports.FileCdnModule = FileCdnModule;
|
|
19
|
+
exports.FileCdnModule = FileCdnModule = __decorate([
|
|
20
|
+
(0, common_1.Module)({
|
|
21
|
+
imports: [config_1.ConfigModule, infra_redis_1.RedisModule, file_storage_module_1.FileStorageServiceModule, infra_clients_1.CryptModule],
|
|
22
|
+
providers: [file_cdn_client_1.FileCdnClient],
|
|
23
|
+
exports: [file_cdn_client_1.FileCdnClient],
|
|
24
|
+
})
|
|
25
|
+
], FileCdnModule);
|
|
26
|
+
//# sourceMappingURL=file-cdn.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-cdn.module.js","sourceRoot":"","sources":["../../../../packages/shared-services/src/file-cdn/file-cdn.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uDAAkD;AAClD,6EAA+E;AAC/E,mDAAgD;AAChD,2CAA8C;AAC9C,uDAAkD;AAO3C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IALzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,qBAAY,EAAE,yBAAW,EAAE,8CAAwB,EAAE,2BAAW,CAAC;QAC3E,SAAS,EAAE,CAAC,+BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,+BAAa,CAAC;KACzB,CAAC;GACW,aAAa,CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/shared-services/src/file-cdn/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./file-cdn.module"), exports);
|
|
18
|
+
__exportStar(require("./file-cdn.client"), exports);
|
|
19
|
+
__exportStar(require("./dto/file-cdn.dto"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/shared-services/src/file-cdn/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,qDAAmC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './notification';
|
|
|
6
6
|
export * from './file-storage/file-storage.module';
|
|
7
7
|
export * from './file-storage/file-storage.service';
|
|
8
8
|
export { PardxUploader } from './file-storage/index';
|
|
9
|
+
export * from './file-cdn';
|
|
9
10
|
export * from './ip-geo/ip-geo.module';
|
|
10
11
|
export * from './ip-geo/ip-geo.service';
|
|
11
12
|
export * from './ip-info/ip-info.module';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/shared-services/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/shared-services/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ __exportStar(require("./email/email.service"), exports);
|
|
|
21
21
|
__exportStar(require("./notification"), exports);
|
|
22
22
|
__exportStar(require("./file-storage/file-storage.module"), exports);
|
|
23
23
|
__exportStar(require("./file-storage/file-storage.service"), exports);
|
|
24
|
+
__exportStar(require("./file-cdn"), exports);
|
|
24
25
|
__exportStar(require("./ip-geo/ip-geo.module"), exports);
|
|
25
26
|
__exportStar(require("./ip-geo/ip-geo.service"), exports);
|
|
26
27
|
__exportStar(require("./ip-info/ip-info.module"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/shared-services/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,uDAAqC;AACrC,wDAAsC;AACtC,iDAA+B;AAC/B,qEAAmD;AACnD,sEAAoD;AAEpD,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,4DAA0C;AAC1C,mDAAiC;AACjC,mDAAiC;AACjC,oDAAkC;AAClC,mDAAiC;AACjC,oDAAkC;AAClC,uEAAqD;AACrD,wEAAsD;AACtD,uEAAqD;AACrD,wEAAsD;AACtD,6DAA2C;AAC3C,8DAA4C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/shared-services/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,uDAAqC;AACrC,wDAAsC;AACtC,iDAA+B;AAC/B,qEAAmD;AACnD,sEAAoD;AAEpD,6CAA2B;AAC3B,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,4DAA0C;AAC1C,mDAAiC;AACjC,mDAAiC;AACjC,oDAAkC;AAClC,mDAAiC;AACjC,oDAAkC;AAClC,uEAAqD;AACrD,wEAAsD;AACtD,uEAAqD;AACrD,wEAAsD;AACtD,6DAA2C;AAC3C,8DAA4C"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dofe/infra-shared-services",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"peerDependencies": {
|
|
7
|
-
"@dofe/infra-clients": "^0.1.
|
|
8
|
-
"@dofe/infra-contracts": "^0.1.
|
|
7
|
+
"@dofe/infra-clients": "^0.1.14",
|
|
8
|
+
"@dofe/infra-contracts": "^0.1.14",
|
|
9
9
|
"@nestjs/axios": "^4.0.0",
|
|
10
10
|
"@nestjs/common": "^11.0.0",
|
|
11
11
|
"@nestjs/config": "^4.0.0",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"zod": "^4.3.6"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@dofe/infra-common": "^0.1.
|
|
29
|
-
"@dofe/infra-jwt": "^0.1.
|
|
30
|
-
"@dofe/infra-prisma": "^0.1.
|
|
31
|
-
"@dofe/infra-rabbitmq": "^0.1.
|
|
32
|
-
"@dofe/infra-redis": "^0.1.
|
|
33
|
-
"@dofe/infra-utils": "^0.1.
|
|
28
|
+
"@dofe/infra-common": "^0.1.14",
|
|
29
|
+
"@dofe/infra-jwt": "^0.1.14",
|
|
30
|
+
"@dofe/infra-prisma": "^0.1.14",
|
|
31
|
+
"@dofe/infra-rabbitmq": "^0.1.14",
|
|
32
|
+
"@dofe/infra-redis": "^0.1.14",
|
|
33
|
+
"@dofe/infra-utils": "^0.1.14"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"rimraf": "^6.1.3",
|