zcw-shared 1.34.1 → 1.35.0
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/functions/android/integrateWechatShare.d.ts +13 -0
- package/dist/functions/android/integrateWechatShare.js +154 -0
- package/dist/functions/android/integrateWechatShare.js.map +1 -0
- package/dist/functions/async/cancellableFetch.d.ts +12 -0
- package/dist/functions/async/cancellableFetch.js +27 -0
- package/dist/functions/async/cancellableFetch.js.map +1 -0
- package/dist/functions/async/cancellableXHR.d.ts +21 -0
- package/dist/functions/async/cancellableXHR.js +96 -0
- package/dist/functions/async/cancellableXHR.js.map +1 -0
- package/dist/functions/functional/constant.d.ts +1 -0
- package/dist/functions/functional/constant.js +4 -0
- package/dist/functions/functional/constant.js.map +1 -0
- package/dist/functions/functional/identity.d.ts +1 -0
- package/dist/functions/functional/identity.js +4 -0
- package/dist/functions/functional/identity.js.map +1 -0
- package/dist/functions/functional/noop.d.ts +1 -0
- package/dist/functions/functional/noop.js +3 -0
- package/dist/functions/functional/noop.js.map +1 -0
- package/dist/functions/image/renderBankCard.d.ts +52 -0
- package/dist/functions/image/renderBankCard.js +177 -0
- package/dist/functions/image/renderBankCard.js.map +1 -0
- package/dist/functions/software/publishToPgyer.d.ts +16 -0
- package/dist/functions/software/publishToPgyer.js +96 -0
- package/dist/functions/software/publishToPgyer.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +32 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
- package/dist/functions/validation/generateFakeBankCard.d.ts +87 -0
- package/dist/functions/validation/generateFakeBankCard.js +152 -0
- package/dist/functions/validation/generateFakeBankCard.js.map +1 -0
- package/package.json +9 -2
- package/references/blob.d.ts +4 -0
- package/references/fetch.d.ts +22 -0
- package/references/xhr.d.ts +47 -0
- package/types/pgyer.d.ts +64 -0
- package/types/uniapp-android-build.d.ts +16 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type IntegrateThirdPartyModuleDeps } from './integrateThirdPartyModule';
|
|
2
|
+
export interface WechatShareConfig {
|
|
3
|
+
appId: string;
|
|
4
|
+
secret: string;
|
|
5
|
+
shareAarPath: string;
|
|
6
|
+
wxEntryActivityPath: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function integrateWechatShare(projectPath: string, moduleDir: string, packageName: string, config: WechatShareConfig, deps: IntegrateThirdPartyModuleDeps): Promise<{
|
|
9
|
+
success: boolean;
|
|
10
|
+
message?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
logs: string[];
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { integrateThirdPartyModule } from './integrateThirdPartyModule';
|
|
2
|
+
export async function integrateWechatShare(projectPath, moduleDir, packageName, config, deps) {
|
|
3
|
+
const logs = [];
|
|
4
|
+
try {
|
|
5
|
+
logs.push('开始集成微信分享模块');
|
|
6
|
+
const moduleConfig = {
|
|
7
|
+
name: '微信分享',
|
|
8
|
+
libFiles: [
|
|
9
|
+
{
|
|
10
|
+
source: config.shareAarPath,
|
|
11
|
+
targetName: 'share-weixin-release.aar'
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
gradleDependencies: [
|
|
15
|
+
'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.8.0'
|
|
16
|
+
],
|
|
17
|
+
sourceFiles: [
|
|
18
|
+
{
|
|
19
|
+
source: config.wxEntryActivityPath,
|
|
20
|
+
targetDir: 'wxapi',
|
|
21
|
+
targetName: 'WXEntryActivity.java',
|
|
22
|
+
packageReplacements: [
|
|
23
|
+
{
|
|
24
|
+
oldPackage: 'io.dcloud.HBuilder.wxapi',
|
|
25
|
+
newPackage: `${packageName}.wxapi`
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
manifestModifications: [
|
|
31
|
+
{
|
|
32
|
+
xpath: "//uses-permission[@android:name='android.permission.MODIFY_AUDIO_SETTINGS']",
|
|
33
|
+
action: 'removeElement'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
xpath: "//manifest",
|
|
37
|
+
action: 'addElement',
|
|
38
|
+
elementName: 'uses-permission',
|
|
39
|
+
attributes: {
|
|
40
|
+
'android:name': 'android.permission.MODIFY_AUDIO_SETTINGS'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
xpath: "//meta-data[@android:name='WX_APPID']",
|
|
45
|
+
action: 'removeElement'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
xpath: "//meta-data[@android:name='WX_SECRET']",
|
|
49
|
+
action: 'removeElement'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
xpath: "//application",
|
|
53
|
+
action: 'addElement',
|
|
54
|
+
elementName: 'meta-data',
|
|
55
|
+
attributes: {
|
|
56
|
+
'android:name': 'WX_APPID',
|
|
57
|
+
'android:value': config.appId
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
xpath: "//application",
|
|
62
|
+
action: 'addElement',
|
|
63
|
+
elementName: 'meta-data',
|
|
64
|
+
attributes: {
|
|
65
|
+
'android:name': 'WX_SECRET',
|
|
66
|
+
'android:value': config.secret
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
xpath: `//activity[@android:name='${packageName}.wxapi.WXEntryActivity']`,
|
|
71
|
+
action: 'removeElement'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
xpath: "//intent-filter[not(action) and not(category) and not(data)]",
|
|
75
|
+
action: 'removeElement'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
xpath: "//manifest/intent-filter",
|
|
79
|
+
action: 'removeElement'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
xpath: "//activity/action",
|
|
83
|
+
action: 'removeElement'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
xpath: "//activity/category",
|
|
87
|
+
action: 'removeElement'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
xpath: "//activity/data",
|
|
91
|
+
action: 'removeElement'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
xpath: "//application",
|
|
95
|
+
action: 'addElement',
|
|
96
|
+
elementName: 'activity',
|
|
97
|
+
attributes: {
|
|
98
|
+
'android:name': `${packageName}.wxapi.WXEntryActivity`,
|
|
99
|
+
'android:label': '@string/app_name',
|
|
100
|
+
'android:exported': 'true',
|
|
101
|
+
'android:launchMode': 'singleTop'
|
|
102
|
+
},
|
|
103
|
+
children: [
|
|
104
|
+
{
|
|
105
|
+
elementName: 'intent-filter',
|
|
106
|
+
attributes: {},
|
|
107
|
+
children: [
|
|
108
|
+
{
|
|
109
|
+
elementName: 'action',
|
|
110
|
+
attributes: {
|
|
111
|
+
'android:name': 'android.intent.action.VIEW'
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
elementName: 'category',
|
|
116
|
+
attributes: {
|
|
117
|
+
'android:name': 'android.intent.category.DEFAULT'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
elementName: 'data',
|
|
122
|
+
attributes: {
|
|
123
|
+
'android:scheme': config.appId
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
dcloudPropertiesConfig: {
|
|
132
|
+
featureName: 'Share',
|
|
133
|
+
featureImpl: 'io.dcloud.share.ShareFeatureImpl',
|
|
134
|
+
moduleName: 'Weixin',
|
|
135
|
+
moduleImpl: 'io.dcloud.share.mm.WeiXinApiManager'
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const result = await integrateThirdPartyModule(projectPath, moduleDir, packageName, moduleConfig, deps);
|
|
139
|
+
return {
|
|
140
|
+
success: result.success,
|
|
141
|
+
message: result.message,
|
|
142
|
+
error: result.error,
|
|
143
|
+
logs: [...logs, ...result.logs]
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
return {
|
|
148
|
+
success: false,
|
|
149
|
+
error: `集成微信分享失败: ${error instanceof Error ? error.message : String(error)}`,
|
|
150
|
+
logs
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=integrateWechatShare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrateWechatShare.js","sourceRoot":"","sources":["../../../src/functions/android/integrateWechatShare.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAmE,MAAM,6BAA6B,CAAA;AA0BxI,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,WAAmB,EACnB,SAAiB,EACjB,WAAmB,EACnB,MAAyB,EACzB,IAAmC;IAEnC,MAAM,IAAI,GAAa,EAAE,CAAA;IAEzB,IAAI,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAGvB,MAAM,YAAY,GAA2B;YAC3C,IAAI,EAAE,MAAM;YAEZ,QAAQ,EAAE;gBACR;oBACE,MAAM,EAAE,MAAM,CAAC,YAAY;oBAC3B,UAAU,EAAE,0BAA0B;iBACvC;aACF;YAED,kBAAkB,EAAE;gBAClB,6DAA6D;aAC9D;YAED,WAAW,EAAE;gBACX;oBACE,MAAM,EAAE,MAAM,CAAC,mBAAmB;oBAClC,SAAS,EAAE,OAAO;oBAClB,UAAU,EAAE,sBAAsB;oBAClC,mBAAmB,EAAE;wBACnB;4BACE,UAAU,EAAE,0BAA0B;4BACtC,UAAU,EAAE,GAAG,WAAW,QAAQ;yBACnC;qBACF;iBACF;aACF;YAED,qBAAqB,EAAE;gBAErB;oBACE,KAAK,EAAE,6EAA6E;oBACpF,MAAM,EAAE,eAAe;iBACxB;gBAED;oBACE,KAAK,EAAE,YAAY;oBACnB,MAAM,EAAE,YAAY;oBACpB,WAAW,EAA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,EAAE,eAAe;4BAC5B,UAAU,EAAE,EAAE;4BACd,QAAQ,EAAE;gCACR;oCACE,WAAW,EAAE,QAAQ;oCACrB,UAAU,EAAE;wCACV,cAAc,EAAE,4BAA4B;qCAC7C;iCACF;gCACD;oCACE,WAAW,EAAE,UAAU;oCACvB,UAAU,EAAE;wCACV,cAAc,EAAE,iCAAiC;qCAClD;iCACF;gCACD;oCACE,WAAW,EAAE,MAAM;oCACnB,UAAU,EAAE;wCACV,gBAAgB,EAAE,MAAM,CAAC,KAAK;qCAC/B;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;YAED,sBAAsB,EAAE;gBACtB,WAAW,EAAE,OAAO;gBACpB,WAAW,EAAE,kCAAkC;gBAC/C,UAAU,EAAE,QAAQ;gBACpB,UAAU,EAAE,qCAAqC;aAClD;SACF,CAAA;QAGD,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAC5C,WAAW,EACX,SAAS,EACT,WAAW,EACX,YAAY,EACZ,IAAI,CACL,CAAA;QAED,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;SAChC,CAAA;IAEH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,aAAa,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YAC5E,IAAI;SACL,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FetchFunction, RequestInfo, RequestInit, Response, AbortController, AbortSignal } from '../../../references/fetch.d';
|
|
2
|
+
import type { URL } from '../../../references/url.d';
|
|
3
|
+
export interface CancellableFetchDeps {
|
|
4
|
+
fetch: FetchFunction;
|
|
5
|
+
AbortController: typeof AbortController;
|
|
6
|
+
}
|
|
7
|
+
export interface CancellableFetchResult {
|
|
8
|
+
promise: Promise<Response>;
|
|
9
|
+
cancel: (reason?: any) => void;
|
|
10
|
+
signal: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
export declare function cancellableFetch(input: RequestInfo | URL, init: RequestInit | undefined, deps: CancellableFetchDeps): CancellableFetchResult;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function cancellableFetch(input, init = {}, deps) {
|
|
2
|
+
let controller = null;
|
|
3
|
+
let signal;
|
|
4
|
+
if (init.signal) {
|
|
5
|
+
signal = init.signal;
|
|
6
|
+
}
|
|
7
|
+
else {
|
|
8
|
+
controller = new deps.AbortController();
|
|
9
|
+
signal = controller.signal;
|
|
10
|
+
}
|
|
11
|
+
const requestInit = {
|
|
12
|
+
...init,
|
|
13
|
+
signal
|
|
14
|
+
};
|
|
15
|
+
const promise = deps.fetch(input, requestInit);
|
|
16
|
+
const cancel = (reason) => {
|
|
17
|
+
if (controller) {
|
|
18
|
+
controller.abort(reason);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
promise,
|
|
23
|
+
cancel,
|
|
24
|
+
signal
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=cancellableFetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancellableFetch.js","sourceRoot":"","sources":["../../../src/functions/async/cancellableFetch.ts"],"names":[],"mappings":"AA0EA,MAAM,UAAU,gBAAgB,CAC9B,KAAwB,EACxB,OAAoB,EAAE,EACtB,IAA0B;IAG1B,IAAI,UAAU,GAA2B,IAAI,CAAA;IAC7C,IAAI,MAAmB,CAAA;IAEvB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAEhB,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IACtB,CAAC;SAAM,CAAC;QAEN,UAAU,GAAG,IAAI,IAAI,CAAC,eAAe,EAAE,CAAA;QACvC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;IAC5B,CAAC;IAGD,MAAM,WAAW,GAAgB;QAC/B,GAAG,IAAI;QACP,MAAM;KACP,CAAA;IAGD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;IAG9C,MAAM,MAAM,GAAG,CAAC,MAAY,EAAE,EAAE;QAG9B,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAC1B,CAAC;IACH,CAAC,CAAA;IAED,OAAO;QACL,OAAO;QACP,MAAM;QACN,MAAM;KACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BodyInit } from '../../../references/fetch.d';
|
|
2
|
+
import type { Document } from '../../../references/dom.d';
|
|
3
|
+
import type { XMLHttpRequestConstructor, XMLHttpRequestResponseType, XMLHttpRequest } from '../../../references/xhr.d';
|
|
4
|
+
export interface CancellableXHRDeps {
|
|
5
|
+
XMLHttpRequest: XMLHttpRequestConstructor;
|
|
6
|
+
}
|
|
7
|
+
export interface CancellableXHROptions {
|
|
8
|
+
method?: string;
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
body?: BodyInit | Document | null;
|
|
11
|
+
responseType?: XMLHttpRequestResponseType;
|
|
12
|
+
withCredentials?: boolean;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
onProgress?: (event: any) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface CancellableXHRResult {
|
|
17
|
+
promise: Promise<XMLHttpRequest>;
|
|
18
|
+
cancel: (reason?: any) => void;
|
|
19
|
+
xhr: XMLHttpRequest;
|
|
20
|
+
}
|
|
21
|
+
export declare function cancellableXHR(url: string, options: CancellableXHROptions | undefined, deps: CancellableXHRDeps): CancellableXHRResult;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export function cancellableXHR(url, options = {}, deps) {
|
|
2
|
+
const { method = 'GET', headers = {}, body = null, responseType, withCredentials, timeout, onProgress } = options;
|
|
3
|
+
const xhr = new deps.XMLHttpRequest();
|
|
4
|
+
let isSettled = false;
|
|
5
|
+
let abortReason = null;
|
|
6
|
+
const promise = new Promise((resolve, reject) => {
|
|
7
|
+
xhr.open(method, url, true);
|
|
8
|
+
if (responseType) {
|
|
9
|
+
xhr.responseType = responseType;
|
|
10
|
+
}
|
|
11
|
+
if (typeof withCredentials === 'boolean') {
|
|
12
|
+
xhr.withCredentials = withCredentials;
|
|
13
|
+
}
|
|
14
|
+
if (typeof timeout === 'number') {
|
|
15
|
+
xhr.timeout = timeout;
|
|
16
|
+
}
|
|
17
|
+
if (onProgress) {
|
|
18
|
+
xhr.onprogress = (event) => {
|
|
19
|
+
onProgress(event);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
Object.entries(headers).forEach(([key, value]) => {
|
|
23
|
+
xhr.setRequestHeader(key, value);
|
|
24
|
+
});
|
|
25
|
+
xhr.onload = () => {
|
|
26
|
+
if (isSettled)
|
|
27
|
+
return;
|
|
28
|
+
isSettled = true;
|
|
29
|
+
const isSuccess = xhr.status >= 200 && xhr.status < 300;
|
|
30
|
+
if (isSuccess) {
|
|
31
|
+
resolve(xhr);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
reject(createHttpError(xhr));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
xhr.onerror = () => {
|
|
38
|
+
if (isSettled)
|
|
39
|
+
return;
|
|
40
|
+
isSettled = true;
|
|
41
|
+
reject(createNetworkError());
|
|
42
|
+
};
|
|
43
|
+
xhr.onabort = () => {
|
|
44
|
+
if (isSettled)
|
|
45
|
+
return;
|
|
46
|
+
isSettled = true;
|
|
47
|
+
reject(createAbortError(abortReason));
|
|
48
|
+
};
|
|
49
|
+
xhr.ontimeout = () => {
|
|
50
|
+
if (isSettled)
|
|
51
|
+
return;
|
|
52
|
+
isSettled = true;
|
|
53
|
+
reject(createTimeoutError(timeout));
|
|
54
|
+
};
|
|
55
|
+
xhr.send(body);
|
|
56
|
+
});
|
|
57
|
+
const cancel = (reason) => {
|
|
58
|
+
if (isSettled)
|
|
59
|
+
return;
|
|
60
|
+
abortReason = reason ?? 'Request aborted';
|
|
61
|
+
xhr.abort();
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
promise,
|
|
65
|
+
cancel,
|
|
66
|
+
xhr
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function createHttpError(xhr) {
|
|
70
|
+
const error = new Error(`Request failed with status ${xhr.status}: ${xhr.statusText}`);
|
|
71
|
+
error.name = 'HTTPError';
|
|
72
|
+
return error;
|
|
73
|
+
}
|
|
74
|
+
function createNetworkError() {
|
|
75
|
+
const error = new Error('Network error');
|
|
76
|
+
error.name = 'NetworkError';
|
|
77
|
+
return error;
|
|
78
|
+
}
|
|
79
|
+
function createTimeoutError(timeout) {
|
|
80
|
+
const error = new Error(typeof timeout === 'number'
|
|
81
|
+
? `Request timed out after ${timeout}ms`
|
|
82
|
+
: 'Request timed out');
|
|
83
|
+
error.name = 'TimeoutError';
|
|
84
|
+
return error;
|
|
85
|
+
}
|
|
86
|
+
function createAbortError(reason) {
|
|
87
|
+
const message = typeof reason === 'string'
|
|
88
|
+
? reason
|
|
89
|
+
: reason instanceof Error
|
|
90
|
+
? reason.message
|
|
91
|
+
: 'Request aborted';
|
|
92
|
+
const error = new Error(message);
|
|
93
|
+
error.name = 'AbortError';
|
|
94
|
+
return error;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=cancellableXHR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancellableXHR.js","sourceRoot":"","sources":["../../../src/functions/async/cancellableXHR.ts"],"names":[],"mappings":"AA8CA,MAAM,UAAU,cAAc,CAC5B,GAAW,EACX,UAAiC,EAAE,EACnC,IAAwB;IAExB,MAAM,E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AK,CAAA;AACd,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;IACxC,KAAK,CAAC,IAAI,GAAG,cAAc,CAAA;IAC3B,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAgB;IAC1C,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,OAAO,OAAO,KAAK,QAAQ;QACzB,CAAC,CAAC,2BAA2B,OAAO,IAAI;QACxC,CAAC,CAAC,mBAAmB,CACxB,CAAA;IACD,KAAK,CAAC,IAAI,GAAG,cAAc,CAAA;IAC3B,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAY;IACpC,MAAM,OAAO,GACX,OAAO,MAAM,KAAK,QAAQ;QACxB,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,MAAM,YAAY,KAAK;YACvB,CAAC,CAAC,MAAM,CAAC,OAAO;YAChB,CAAC,CAAC,iBAAiB,CAAA;IACzB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAChC,KAAK,CAAC,IAAI,GAAG,YAAY,CAAA;IACzB,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function constant<T>(value: T): (...args: any[]) => T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../src/functions/functional/constant.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,QAAQ,CAAI,KAAQ;IAClC,OAAO,GAAG,EAAE,CAAC,KAAK,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function identity<T>(value: T): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/functions/functional/identity.ts"],"names":[],"mappings":"AAkBA,MAAM,UAAU,QAAQ,CAAI,KAAQ;IAClC,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function noop(...args: any[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.js","sourceRoot":"","sources":["../../../src/functions/functional/noop.ts"],"names":[],"mappings":"AAwBA,MAAM,UAAU,IAAI,CAAC,GAAG,IAAW;AAEnC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { GeneratedBankCardProfile } from '../validation/generateFakeBankCard';
|
|
2
|
+
type CanvasTextBaseline = 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom';
|
|
3
|
+
type CanvasTextAlign = 'left' | 'right' | 'center' | 'start' | 'end';
|
|
4
|
+
export interface RenderBankCardOptions {
|
|
5
|
+
resolution?: 'standard' | 'retina';
|
|
6
|
+
cornerRadius?: number;
|
|
7
|
+
showSignaturePanel?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface CanvasGradientLike {
|
|
10
|
+
addColorStop: (offset: number, color: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface Canvas2DContextLike {
|
|
13
|
+
fillStyle: string | CanvasGradientLike;
|
|
14
|
+
strokeStyle: string;
|
|
15
|
+
globalAlpha: number;
|
|
16
|
+
lineWidth: number;
|
|
17
|
+
font: string;
|
|
18
|
+
textBaseline: CanvasTextBaseline;
|
|
19
|
+
textAlign: CanvasTextAlign;
|
|
20
|
+
beginPath: () => void;
|
|
21
|
+
moveTo?: (x: number, y: number) => void;
|
|
22
|
+
lineTo?: (x: number, y: number) => void;
|
|
23
|
+
arc: (x: number, y: number, radius: number, startAngle: number, endAngle: number) => void;
|
|
24
|
+
closePath: () => void;
|
|
25
|
+
fill?: () => void;
|
|
26
|
+
stroke?: () => void;
|
|
27
|
+
fillRect: (x: number, y: number, w: number, h: number) => void;
|
|
28
|
+
strokeRect: (x: number, y: number, w: number, h: number) => void;
|
|
29
|
+
drawImage?: (...args: any[]) => void;
|
|
30
|
+
fillText: (text: string, x: number, y: number) => void;
|
|
31
|
+
measureText: (text: string) => {
|
|
32
|
+
width: number;
|
|
33
|
+
};
|
|
34
|
+
createLinearGradient: (x0: number, y0: number, x1: number, y1: number) => CanvasGradientLike;
|
|
35
|
+
save: () => void;
|
|
36
|
+
restore: () => void;
|
|
37
|
+
setLineDash?: (segments: number[]) => void;
|
|
38
|
+
clip?: () => void;
|
|
39
|
+
}
|
|
40
|
+
export interface CanvasLike {
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
getContext: (type: '2d') => Canvas2DContextLike;
|
|
44
|
+
}
|
|
45
|
+
export interface RenderBankCardDeps {
|
|
46
|
+
createCanvas: (width: number, height: number) => CanvasLike;
|
|
47
|
+
}
|
|
48
|
+
export interface RenderBankCardResult {
|
|
49
|
+
canvas: CanvasLike;
|
|
50
|
+
}
|
|
51
|
+
export declare function renderBankCard(profile: GeneratedBankCardProfile, deps: RenderBankCardDeps, options?: RenderBankCardOptions): RenderBankCardResult;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
function drawRoundedRect(ctx, x, y, w, h, r) {
|
|
2
|
+
const radius = Math.min(r, Math.min(w, h) / 2);
|
|
3
|
+
ctx.beginPath();
|
|
4
|
+
ctx.moveTo?.(x + radius, y);
|
|
5
|
+
ctx.arc(x + w - radius, y + radius, radius, Math.PI * 1.5, 0);
|
|
6
|
+
ctx.lineTo?.(x + w, y + h - radius);
|
|
7
|
+
ctx.arc(x + w - radius, y + h - radius, radius, 0, Math.PI * 0.5);
|
|
8
|
+
ctx.lineTo?.(x + radius, y + h);
|
|
9
|
+
ctx.arc(x + radius, y + h - radius, radius, Math.PI * 0.5, Math.PI);
|
|
10
|
+
ctx.lineTo?.(x, y + radius);
|
|
11
|
+
ctx.arc(x + radius, y + radius, radius, Math.PI, Math.PI * 1.5);
|
|
12
|
+
ctx.closePath();
|
|
13
|
+
}
|
|
14
|
+
function drawBackground(ctx, width, height, theme, radius) {
|
|
15
|
+
ctx.save();
|
|
16
|
+
drawRoundedRect(ctx, 0, 0, width, height, radius);
|
|
17
|
+
const gradient = ctx.createLinearGradient(0, 0, width, height);
|
|
18
|
+
gradient.addColorStop(0, theme.gradient[0]);
|
|
19
|
+
gradient.addColorStop(1, theme.gradient[1]);
|
|
20
|
+
ctx.fillStyle = gradient;
|
|
21
|
+
ctx.fill?.();
|
|
22
|
+
ctx.restore();
|
|
23
|
+
}
|
|
24
|
+
function drawPattern(ctx, width, height, theme, radius) {
|
|
25
|
+
ctx.save();
|
|
26
|
+
ctx.globalAlpha = 1;
|
|
27
|
+
drawRoundedRect(ctx, 0, 0, width, height, radius);
|
|
28
|
+
ctx.clip?.();
|
|
29
|
+
ctx.strokeStyle = theme.patternColor;
|
|
30
|
+
ctx.lineWidth = 2;
|
|
31
|
+
const spacing = 42;
|
|
32
|
+
for (let i = -width; i < width * 2; i += spacing) {
|
|
33
|
+
ctx.beginPath();
|
|
34
|
+
ctx.moveTo?.(i, -20);
|
|
35
|
+
ctx.lineTo?.(i + height, height + 20);
|
|
36
|
+
ctx.stroke?.();
|
|
37
|
+
}
|
|
38
|
+
ctx.restore();
|
|
39
|
+
}
|
|
40
|
+
function drawChip(ctx, x, y, width, height, style, accentColor) {
|
|
41
|
+
ctx.save();
|
|
42
|
+
ctx.lineWidth = 2;
|
|
43
|
+
const gradient = ctx.createLinearGradient(x, y, x + width, y + height);
|
|
44
|
+
gradient.addColorStop(0, '#eceff4');
|
|
45
|
+
gradient.addColorStop(1, '#cbd5f5');
|
|
46
|
+
ctx.fillStyle = gradient;
|
|
47
|
+
drawRoundedRect(ctx, x, y, width, height, 16);
|
|
48
|
+
ctx.fill?.();
|
|
49
|
+
ctx.strokeStyle = 'rgba(0,0,0,0.2)';
|
|
50
|
+
ctx.stroke?.();
|
|
51
|
+
ctx.strokeStyle = 'rgba(0,0,0,0.35)';
|
|
52
|
+
ctx.lineWidth = 1.2;
|
|
53
|
+
const segments = style === 'minimal' ? 2 : 3;
|
|
54
|
+
for (let i = 1; i <= segments; i++) {
|
|
55
|
+
const offset = (height / (segments + 1)) * i;
|
|
56
|
+
ctx.beginPath();
|
|
57
|
+
ctx.moveTo?.(x + 10, y + offset);
|
|
58
|
+
ctx.lineTo?.(x + width - 10, y + offset);
|
|
59
|
+
ctx.stroke?.();
|
|
60
|
+
}
|
|
61
|
+
ctx.fillStyle = accentColor;
|
|
62
|
+
ctx.fillRect(x + width / 2 - 8, y + height / 2 - 22, 16, 44);
|
|
63
|
+
ctx.restore();
|
|
64
|
+
}
|
|
65
|
+
function drawContactless(ctx, x, y, color) {
|
|
66
|
+
ctx.save();
|
|
67
|
+
ctx.strokeStyle = color;
|
|
68
|
+
ctx.lineWidth = 2;
|
|
69
|
+
for (let i = 0; i < 3; i++) {
|
|
70
|
+
ctx.beginPath();
|
|
71
|
+
ctx.arc(x, y, 10 + i * 6, -Math.PI / 3, Math.PI / 3);
|
|
72
|
+
ctx.stroke?.();
|
|
73
|
+
}
|
|
74
|
+
ctx.restore();
|
|
75
|
+
}
|
|
76
|
+
function drawCardNumber(ctx, value, x, y, theme, width) {
|
|
77
|
+
const segments = value.split(' ');
|
|
78
|
+
ctx.save();
|
|
79
|
+
ctx.font = '600 48px "SF Mono", "JetBrains Mono", "Menlo", monospace';
|
|
80
|
+
ctx.fillStyle = theme.textColor;
|
|
81
|
+
const spacing = (width - x * 2) / segments.length;
|
|
82
|
+
segments.forEach((segment, index) => {
|
|
83
|
+
const text = ctx.measureText(segment);
|
|
84
|
+
const baseX = x + spacing * index + (spacing - text.width) / 2;
|
|
85
|
+
ctx.fillText(segment, baseX, y);
|
|
86
|
+
});
|
|
87
|
+
ctx.restore();
|
|
88
|
+
}
|
|
89
|
+
function drawLabelValue(ctx, label, value, x, y, theme) {
|
|
90
|
+
ctx.save();
|
|
91
|
+
ctx.font = '600 18px "Inter", "PingFang SC", sans-serif';
|
|
92
|
+
ctx.fillStyle = theme.secondaryTextColor;
|
|
93
|
+
ctx.fillText(label.toUpperCase(), x, y);
|
|
94
|
+
ctx.font = '600 30px "Inter", "PingFang SC", sans-serif';
|
|
95
|
+
ctx.fillStyle = theme.textColor;
|
|
96
|
+
ctx.fillText(value, x, y + 42);
|
|
97
|
+
ctx.restore();
|
|
98
|
+
}
|
|
99
|
+
function drawBrandBadge(ctx, brand, x, y, theme) {
|
|
100
|
+
const radius = 42;
|
|
101
|
+
ctx.save();
|
|
102
|
+
ctx.beginPath();
|
|
103
|
+
ctx.arc(x, y, radius, 0, Math.PI * 2);
|
|
104
|
+
ctx.closePath();
|
|
105
|
+
ctx.fillStyle = '#ffffff';
|
|
106
|
+
ctx.globalAlpha = 0.92;
|
|
107
|
+
ctx.fill?.();
|
|
108
|
+
ctx.globalAlpha = 1;
|
|
109
|
+
ctx.strokeStyle = theme.accentColor;
|
|
110
|
+
ctx.lineWidth = 3;
|
|
111
|
+
ctx.stroke?.();
|
|
112
|
+
ctx.fillStyle = theme.baseColor;
|
|
113
|
+
ctx.font = '700 20px "Inter", "PingFang SC", sans-serif';
|
|
114
|
+
ctx.textAlign = 'center';
|
|
115
|
+
ctx.textBaseline = 'middle';
|
|
116
|
+
ctx.fillText(brand, x, y);
|
|
117
|
+
ctx.restore();
|
|
118
|
+
}
|
|
119
|
+
function ensureFormattedNumber(cardNumber, formatted) {
|
|
120
|
+
if (formatted && formatted.trim().length > 0)
|
|
121
|
+
return formatted;
|
|
122
|
+
return cardNumber.replace(/\D/g, '').replace(/(.{4})/g, '$1 ').trim();
|
|
123
|
+
}
|
|
124
|
+
export function renderBankCard(profile, deps, options = {}) {
|
|
125
|
+
const width = options.resolution === 'retina' ? 1280 : 1012;
|
|
126
|
+
const height = Math.round(width * 0.63);
|
|
127
|
+
const cornerRadius = options.cornerRadius ?? 52;
|
|
128
|
+
const canvas = deps.createCanvas(width, height);
|
|
129
|
+
const ctx = canvas.getContext('2d');
|
|
130
|
+
ctx.textBaseline = 'alphabetic';
|
|
131
|
+
ctx.textAlign = 'left';
|
|
132
|
+
drawBackground(ctx, width, height, profile.background, cornerRadius);
|
|
133
|
+
drawPattern(ctx, width, height, profile.background, cornerRadius);
|
|
134
|
+
const padding = Math.round(width * 0.07);
|
|
135
|
+
const chipWidth = 160;
|
|
136
|
+
const chipHeight = 110;
|
|
137
|
+
drawChip(ctx, padding, padding + 40, chipWidth, chipHeight, profile.chipStyle, profile.background.accentColor);
|
|
138
|
+
if (profile.contactless) {
|
|
139
|
+
drawContactless(ctx, padding + chipWidth + 50, padding + chipHeight / 2 + 20, profile.background.secondaryTextColor);
|
|
140
|
+
}
|
|
141
|
+
ctx.save();
|
|
142
|
+
ctx.fillStyle = profile.background.textColor;
|
|
143
|
+
ctx.font = '700 48px "Inter", "PingFang SC", sans-serif';
|
|
144
|
+
ctx.fillText(profile.bankName, padding, padding + 32);
|
|
145
|
+
ctx.font = '400 20px "Inter", "PingFang SC", sans-serif';
|
|
146
|
+
ctx.fillStyle = profile.background.secondaryTextColor;
|
|
147
|
+
ctx.fillText(`${profile.cardType} · ${profile.tagline}`, padding, padding + 72);
|
|
148
|
+
ctx.restore();
|
|
149
|
+
const formattedNumber = ensureFormattedNumber(profile.cardNumber, profile.formattedNumber);
|
|
150
|
+
drawCardNumber(ctx, formattedNumber, padding, height / 2 + 40, profile.background, width - padding * 2);
|
|
151
|
+
drawLabelValue(ctx, 'CARD HOLDER', profile.holderName.toUpperCase(), padding, height - 180, profile.background);
|
|
152
|
+
drawLabelValue(ctx, 'VALID FROM', profile.validFrom, padding + 360, height - 180, profile.background);
|
|
153
|
+
drawLabelValue(ctx, 'VALID THRU', profile.validThru, padding + 620, height - 180, profile.background);
|
|
154
|
+
if (options.showSignaturePanel !== false) {
|
|
155
|
+
ctx.save();
|
|
156
|
+
const panelWidth = width * 0.32;
|
|
157
|
+
const panelHeight = 70;
|
|
158
|
+
const panelX = width - panelWidth - padding;
|
|
159
|
+
const panelY = padding + 30;
|
|
160
|
+
ctx.globalAlpha = 0.25;
|
|
161
|
+
drawRoundedRect(ctx, panelX, panelY, panelWidth, panelHeight, 10);
|
|
162
|
+
ctx.fillStyle = '#ffffff';
|
|
163
|
+
ctx.fill?.();
|
|
164
|
+
ctx.globalAlpha = 1;
|
|
165
|
+
ctx.strokeStyle = 'rgba(255,255,255,0.5)';
|
|
166
|
+
ctx.lineWidth = 1;
|
|
167
|
+
ctx.stroke?.();
|
|
168
|
+
ctx.font = '500 18px "Inter", "PingFang SC", sans-serif';
|
|
169
|
+
ctx.fillStyle = profile.background.baseColor;
|
|
170
|
+
ctx.textAlign = 'right';
|
|
171
|
+
ctx.fillText(profile.bankShortName, panelX + panelWidth - 16, panelY + panelHeight / 2 + 6);
|
|
172
|
+
ctx.restore();
|
|
173
|
+
}
|
|
174
|
+
drawBrandBadge(ctx, profile.cardBrand, width - padding - 64, height - padding - 60, profile.background);
|
|
175
|
+
return { canvas };
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=renderBankCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderBankCard.js","sourceRoot":"","sources":["../../../src/functions/image/renderBankCard.ts"],"names":[],"mappings":"AAoEA,SAAS,eAAe,CAAC,GAAwB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACtG,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAC9C,GAAG,CAAC,SAAS,EAAE,CAAA;IACf,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,CAAA;IAC3B,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,CAAA;IAC7D,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AW,GAAG,IAAI,CAAA;QACtB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,CAAC,CAAA;QACjE,GAAG,CAAC,SAAS,GAAG,SAAS,CAAA;QACzB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAA;QACZ,GAAG,CAAC,WAAW,GAAG,CAAC,CAAA;QACnB,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAA;QACzC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAA;QACjB,GAAG,CAAC,MAAM,EAAE,EAAE,CAAA;QACd,GAAG,CAAC,IAAI,GAAG,6CAA6C,CAAA;QACxD,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,CAAA;QAC5C,GAAG,CAAC,SAAS,GAAG,OAAO,CAAA;QACvB,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,GAAG,UAAU,GAAG,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QAC3F,GAAG,CAAC,OAAO,EAAE,CAAA;IACf,CAAC;IAED,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IAEvG,OAAO,EAAE,MAAM,EAAE,CAAA;AACnB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PublishToPgyerOptions, PublishToPgyerResult } from '../../../types/pgyer.d';
|
|
2
|
+
import type { FileSystem } from '../../../references/node.d';
|
|
3
|
+
import type { Console } from '../../../references/console.d';
|
|
4
|
+
import type { fetch, FormData, Headers } from '../../../references/fetch.d';
|
|
5
|
+
import type { Blob } from '../../../references/blob.d';
|
|
6
|
+
export interface PublishToPgyerDeps {
|
|
7
|
+
existsSync: FileSystem['existsSync'];
|
|
8
|
+
readFileSync: FileSystem['readFileSync'];
|
|
9
|
+
fetch: typeof fetch;
|
|
10
|
+
FormData: typeof FormData;
|
|
11
|
+
Headers: typeof Headers;
|
|
12
|
+
Blob: typeof Blob;
|
|
13
|
+
log: Console['log'];
|
|
14
|
+
error: Console['error'];
|
|
15
|
+
}
|
|
16
|
+
export declare function publishToPgyer(options: PublishToPgyerOptions, deps: PublishToPgyerDeps): Promise<PublishToPgyerResult>;
|