@ariacompute/engine-rn 1.20.0 → 1.21.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/setup.js +2 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariacompute/engine-rn",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "React Native binding for Aria Engine",
5
5
  "main": "src/index.js",
6
6
  "license": "MIT",
package/src/setup.js CHANGED
@@ -7,13 +7,8 @@ const CN_UPGRADE = 'https://gitee.com/ariacompute';
7
7
 
8
8
  function defaultSetupConfig() {
9
9
  return {
10
- // Local (router registration)
11
10
  router: '',
12
11
  router_api_key: '',
13
- // OAuth (Aria Compute)
14
- serve_site: '',
15
- serve_api_key: '',
16
- // Hub / compute
17
12
  site_url: '',
18
13
  upgrade_url: '',
19
14
  compute: 'auto',
@@ -46,22 +41,8 @@ function fillSetupUrls(cfg) {
46
41
  function validateRouterApiKey(key) {
47
42
  const t = (key || '').trim();
48
43
  if (!t) return;
49
- if (t.startsWith('bfvk-')) {
50
- throw new Error(
51
- 'OAuth key detected (bfvk-); use serve_api_key / [2/2] OAuth (Aria Compute)',
52
- );
53
- }
54
- }
55
-
56
- function validateServeApiKey(key) {
57
- const t = (key || '').trim();
58
- if (!t) return;
59
- if (t.startsWith('sk-aria_')) {
60
- throw new Error('Local router key detected (sk-aria_); use router_api_key / [1/2] Local');
61
- }
62
- if (!t.startsWith('bfvk-')) {
63
- throw new Error('serve_api_key must start with bfvk-');
64
- }
44
+ if (t.startsWith('sk-aria_') || t.startsWith('bfvk-')) return;
45
+ throw new Error('router_api_key must start with sk-aria_ or bfvk-');
65
46
  }
66
47
 
67
48
  function applySetup(existing, updates) {
@@ -74,7 +55,6 @@ function applySetup(existing, updates) {
74
55
  throw new Error(`invalid compute: ${out.compute}`);
75
56
  }
76
57
  validateRouterApiKey(out.router_api_key);
77
- validateServeApiKey(out.serve_api_key);
78
58
  return fillSetupUrls(out);
79
59
  }
80
60