@lovrabet/sdk 1.4.3 → 1.5.1-beta.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.
@@ -28,6 +28,15 @@ export declare const ENVIRONMENTS: {
28
28
  /** 开发环境 */
29
29
  readonly DEVELOPMENT: "development";
30
30
  };
31
+ /**
32
+ * Lovrabet official deployment regions.
33
+ */
34
+ export declare const REGIONS: {
35
+ /** Mainland China node (default). */
36
+ readonly CN: "cn";
37
+ /** Indonesia node. */
38
+ readonly ID: "id";
39
+ };
31
40
  /**
32
41
  * HTTP 状态码常量
33
42
  */
@@ -1,3 +1,5 @@
1
+ import type { Region } from '../types';
2
+ /** Mainland China endpoints retained as the backward-compatible public export. */
1
3
  export declare const API_ENDPOINTS: {
2
4
  readonly production: "https://runtime.lovrabet.com";
3
5
  readonly online: "https://runtime.lovrabet.com";
@@ -5,12 +7,30 @@ export declare const API_ENDPOINTS: {
5
7
  readonly development: "https://dev.lovrabet.com";
6
8
  };
7
9
  export type Environment = keyof typeof API_ENDPOINTS;
10
+ /** Runtime endpoints selected by official region and environment. */
11
+ export declare const REGION_API_ENDPOINTS: {
12
+ readonly cn: {
13
+ readonly production: "https://runtime.lovrabet.com";
14
+ readonly online: "https://runtime.lovrabet.com";
15
+ readonly daily: "https://daily-runtime.lovrabet.com";
16
+ readonly development: "https://dev.lovrabet.com";
17
+ };
18
+ readonly id: {
19
+ readonly production: "https://runtime.lovrabet.id";
20
+ readonly online: "https://runtime.lovrabet.id";
21
+ readonly daily: "https://daily-runtime.lovrabet.id";
22
+ readonly development: "https://dev.lovrabet.id";
23
+ };
24
+ };
8
25
  /**
9
26
  * 获取指定环境的 API 端点(支持向下兼容)
10
27
  * @param env - 环境名称(支持 "production", "online", "daily", "dev", "development")
28
+ * @param region - 官方节点("cn" 或 "id"),默认 "cn"
11
29
  * @returns API 端点 URL
12
30
  */
13
- export declare function getApiEndpoint(env: Environment | string): string;
31
+ export declare function getApiEndpoint(env: Environment | string, region?: Region | string): string;
32
+ /** Returns official regions supported by the SDK's built-in Runtime mapping. */
33
+ export declare function getAvailableRegions(): Region[];
14
34
  /**
15
35
  * 获取所有可用的环境
16
36
  * @returns 环境列表(返回标准化的环境名)
@@ -6,7 +6,8 @@ export declare class HttpClient {
6
6
  constructor(config: ClientConfig, authManager: AuthManager);
7
7
  /**
8
8
  * 获取 API 基础地址
9
- * 优先级:runtimeDomain > window.__GLOBAL__.deploymentConfig.RUNTIME_API_DOMAIN > getApiEndpoint(env)
9
+ * 优先级:runtimeDomain > serverUrl >
10
+ * window.__GLOBAL__.deploymentConfig.RUNTIME_API_DOMAIN > getApiEndpoint(env, region)
10
11
  *
11
12
  * 注:serverUrl 为 runtimeDomain 的旧名称,向下兼容保留;两者均设置时以 runtimeDomain 优先。
12
13
  */
@@ -17,6 +17,8 @@
17
17
  * - development: 本地开发环境
18
18
  */
19
19
  export type Environment = "production" | "online" | "daily" | "development";
20
+ /** Official Lovrabet Runtime region. Mainland China is the default. */
21
+ export type Region = "cn" | "id";
20
22
  /**
21
23
  * 排序方向枚举
22
24
  * @description 定义数据排序的方向
@@ -419,6 +421,8 @@ export interface ClientConfig {
419
421
  serverUrl?: string;
420
422
  /** 运行环境,默认为 'production'(向下兼容 'online') */
421
423
  env?: Environment;
424
+ /** 官方运行节点,默认为 'cn';显式 runtimeDomain 的优先级更高。 */
425
+ region?: Region;
422
426
  /** 用户 Token,用于 Bearer 认证 */
423
427
  token?: string;
424
428
  /** 与 token 配对的时间戳(OpenAPI 模式必需) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/sdk",
3
- "version": "1.4.3",
3
+ "version": "1.5.1-beta.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",