@sgrsoft/vpe-core-sdk 0.2.0 → 0.3.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/locales/en/index.d.ts +104 -0
- package/dist/locales/i18n.d.ts +1137 -0
- package/dist/locales/ja/index.d.ts +104 -0
- package/dist/locales/ko/index.d.ts +104 -0
- package/dist/locales/nationCode.d.ts +251 -0
- package/dist/locales/zh/index.d.ts +70 -0
- package/dist/ma.d.ts +46 -0
- package/dist/maManager.d.ts +100 -0
- package/dist/main.d.ts +77 -8
- package/dist/options.d.ts +96 -0
- package/dist/vpe-core-sdk.cjs.js +1 -0
- package/dist/vpe-core-sdk.es.js +885 -0
- package/package.json +11 -4
- package/dist/main.js +0 -73
package/package.json
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sgrsoft/vpe-core-sdk",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/
|
|
7
|
-
"module": "dist/
|
|
6
|
+
"main": "dist/vpe-core-sdk.cjs.js",
|
|
7
|
+
"module": "dist/vpe-core-sdk.es.js",
|
|
8
8
|
"types": "dist/main.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"dev": "vite",
|
|
14
|
-
"build": "tsc",
|
|
14
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
15
|
+
"build": "vite build && npm run build:types",
|
|
15
16
|
"release Private": "release-it --only-version --access=restricted",
|
|
16
17
|
"release:beta Private": "release-it --preRelease=beta --access=restricted",
|
|
17
18
|
"release": "release-it --only-version",
|
|
18
19
|
"release:beta": "release-it --preRelease=beta"
|
|
19
20
|
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/vpe-core-sdk.es.js",
|
|
24
|
+
"require": "./dist/vpe-core-sdk.cjs.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
20
27
|
"devDependencies": {
|
|
21
28
|
"@release-it/conventional-changelog": "^8.0.2",
|
|
22
29
|
"release-it": "^17.6.0",
|
package/dist/main.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// prettier-ignore
|
|
2
|
-
const ENCODED_API_PATH = {
|
|
3
|
-
gov: {
|
|
4
|
-
prod: {
|
|
5
|
-
config: 'aHR0cHM6Ly9wYXBpLnZwZS5nb3YtbnRydXNzLmNvbS9wbGF5ZXIvY29uZmln',
|
|
6
|
-
report: 'aHR0cHM6Ly9sb2cudnBlLmdvdi1udHJ1c3MuY29tL3N0YXRz',
|
|
7
|
-
},
|
|
8
|
-
beta: {
|
|
9
|
-
config: 'aHR0cHM6Ly9wYXBpLmJldGEtdnBlLmdvdi1udHJ1c3MuY29tL3BsYXllci9jb25maWc=',
|
|
10
|
-
report: 'aHR0cHM6Ly9sb2cuYmV0YS12cGUuZ292LW50cnVzcy5jb20vc3RhdHM=',
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
pub: {
|
|
14
|
-
prod: {
|
|
15
|
-
config: 'aHR0cHM6Ly9wYXBpLnZwZS5uYXZlcm5jcC5jb20vcGxheWVyL2NvbmZpZw==',
|
|
16
|
-
report: 'aHR0cHM6Ly9sb2cudnBlLm5hdmVybmNwLmNvbS9zdGF0cw==',
|
|
17
|
-
},
|
|
18
|
-
beta: {
|
|
19
|
-
config: 'aHR0cHM6Ly9wYXBpLmJldGEtdnBlLm5hdmVybmNwLmNvbS9wbGF5ZXIvY29uZmln',
|
|
20
|
-
report: 'aHR0cHM6Ly9sb2cuYmV0YS12cGUubmF2ZXJuY3AuY29tL3N0YXRz',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Base64로 인코딩된 문자열을 디코딩합니다.
|
|
26
|
-
* React Native (Expo) 환경에서는 atob가 전역으로 사용 가능합니다.
|
|
27
|
-
* @param str - 디코딩할 Base64 문자열
|
|
28
|
-
* @returns 디코딩된 문자열
|
|
29
|
-
*/
|
|
30
|
-
const detcosde = (str) => {
|
|
31
|
-
// prettier-ignore
|
|
32
|
-
try {
|
|
33
|
-
return atob(str);
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
console.error('Base64 decoding failed:', e);
|
|
37
|
-
return '';
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* accessKey와 앱 ID를 사용하여 플레이어 설정을 서버에서 가져옵니다.
|
|
42
|
-
* @param accessKey - 인증을 위한 Access Key
|
|
43
|
-
* @returns 서버로부터 받은 설정 응답 (Promise)
|
|
44
|
-
* @throws API 호출 실패 또는 응답이 정상이 아닐 경우 에러를 던집니다.
|
|
45
|
-
*/
|
|
46
|
-
export async function keyCheck(accessKey, appId, platform, stage, isDev) {
|
|
47
|
-
// prettier-ignore
|
|
48
|
-
try {
|
|
49
|
-
const APopein = isDev ? '?preview=true' : '';
|
|
50
|
-
const API_URL = detcosde(ENCODED_API_PATH[platform][stage].config) + APopein;
|
|
51
|
-
// 2. accessKey와 appId를 API 서버로 POST 요청을 보냅니다.
|
|
52
|
-
const response = await fetch(API_URL, {
|
|
53
|
-
method: 'POST',
|
|
54
|
-
headers: {
|
|
55
|
-
'Content-Type': 'application/json',
|
|
56
|
-
},
|
|
57
|
-
body: JSON.stringify({
|
|
58
|
-
access_key: accessKey,
|
|
59
|
-
domain: appId,
|
|
60
|
-
}),
|
|
61
|
-
});
|
|
62
|
-
// 3. 응답 상태를 확인하고, 문제가 있으면 에러를 던집니다.
|
|
63
|
-
if (!response.ok) {
|
|
64
|
-
throw new Error(`API Error: ${response.status} ${response.statusText}`);
|
|
65
|
-
}
|
|
66
|
-
// 4. JSON 형태의 바디 응답을 파싱하여 반환합니다.
|
|
67
|
-
return await response.json();
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
//console.error('Failed to execute keyCheck:', error);
|
|
71
|
-
throw error; // 에러를 다시 던져서 호출한 쪽에서 처리할 수 있도록 합니다.
|
|
72
|
-
}
|
|
73
|
-
}
|