@accelbyte/sdk 4.0.4 → 4.1.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/index.d.ts CHANGED
@@ -35,6 +35,19 @@ interface AxiosConfig {
35
35
  interceptors?: Interceptor[];
36
36
  request?: AxiosRequestConfig;
37
37
  }
38
+ interface WebSocketConfig {
39
+ /**
40
+ * Allow reconnect when upstream is abruptly disconnected.
41
+ * @default true
42
+ */
43
+ allowReconnect?: boolean;
44
+ /**
45
+ * Maximum number of reconnect attempts. Positive value integer.
46
+ * Set 0 for unlimited attempts.
47
+ * @default 0
48
+ */
49
+ maxReconnectAttempts?: number;
50
+ }
38
51
  type Interceptor = {
39
52
  type: 'request';
40
53
  name: string;
@@ -49,10 +62,12 @@ type Interceptor = {
49
62
  interface SdkConstructorParam {
50
63
  coreConfig: MakeOptional<CoreConfig, 'useSchemaValidation'>;
51
64
  axiosConfig?: AxiosConfig;
65
+ webSocketConfig?: WebSocketConfig;
52
66
  }
53
67
  interface SdkSetConfigParam {
54
68
  coreConfig?: Partial<CoreConfig>;
55
69
  axiosConfig?: AxiosConfig;
70
+ webSocketConfig?: WebSocketConfig;
56
71
  }
57
72
  type ApiError = {
58
73
  errorCode: number | string;
@@ -70,8 +85,9 @@ declare class AccelByteSDK {
70
85
  private coreConfig;
71
86
  private axiosConfig;
72
87
  private axiosInstance;
88
+ private webSocketConfig;
73
89
  private token;
74
- constructor({ coreConfig, axiosConfig }: SdkConstructorParam);
90
+ constructor({ coreConfig, axiosConfig, webSocketConfig }: SdkConstructorParam);
75
91
  private createAxiosInstance;
76
92
  /**
77
93
  * Assembles and returns the current Axios instance along with core and Axios configurations.
@@ -80,6 +96,7 @@ declare class AccelByteSDK {
80
96
  axiosInstance: AxiosInstance;
81
97
  coreConfig: CoreConfig;
82
98
  axiosConfig: MakeRequired<AxiosConfig, "request">;
99
+ webSocketConfig: WebSocketConfig;
83
100
  };
84
101
  /**
85
102
  * Creates a new instance of AccelByteSDK with a shallow copy of the current configurations.
@@ -104,7 +121,7 @@ declare class AccelByteSDK {
104
121
  * Updates the SDK's core and Axios configurations.
105
122
  * Merges the provided configurations with the current ones.
106
123
  */
107
- setConfig({ coreConfig, axiosConfig }: SdkSetConfigParam): this;
124
+ setConfig({ coreConfig, axiosConfig, webSocketConfig }: SdkSetConfigParam): this;
108
125
  /**
109
126
  * Set accessToken and refreshToken and updates the Axios request headers to use Bearer authentication.
110
127
  */
@@ -465,4 +482,4 @@ declare class UrlHelper {
465
482
  static removeQueryParam(fullUrlString: string, param: string): string;
466
483
  }
467
484
 
468
- export { AccelByte, AccelByteSDK, type ApiError, ApiUtils, type AxiosConfig, BrowserHelper, CodeGenUtil, type CoreConfig, DecodeError, DesktopChecker, ERROR_CODE_LINK_DELETION_ACCOUNT, ERROR_CODE_TOKEN_EXPIRED, ERROR_LINK_ANOTHER_3RD_PARTY_ACCOUNT, ERROR_USER_BANNED, ErrorInterceptors, IamErrorCode, type Interceptor, type MakeOptional, type MakeRequired, Network, RefreshSession, RefreshToken, type Response, type ResponseError, type SdkConstructorParam, SdkDevice, type SdkSetConfigParam, type TokenConfig, UrlHelper, Validate, createAuthInterceptor, createCustomPathInterceptor, createGetSessionInterceptor, createRefreshSessionInterceptor, isType };
485
+ export { AccelByte, AccelByteSDK, type ApiError, ApiUtils, type AxiosConfig, BrowserHelper, CodeGenUtil, type CoreConfig, DecodeError, DesktopChecker, ERROR_CODE_LINK_DELETION_ACCOUNT, ERROR_CODE_TOKEN_EXPIRED, ERROR_LINK_ANOTHER_3RD_PARTY_ACCOUNT, ERROR_USER_BANNED, ErrorInterceptors, IamErrorCode, type Interceptor, type MakeOptional, type MakeRequired, Network, RefreshSession, RefreshToken, type Response, type ResponseError, type SdkConstructorParam, SdkDevice, type SdkSetConfigParam, type TokenConfig, UrlHelper, Validate, type WebSocketConfig, createAuthInterceptor, createCustomPathInterceptor, createGetSessionInterceptor, createRefreshSessionInterceptor, isType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accelbyte/sdk",
3
- "version": "4.0.4",
3
+ "version": "4.1.0",
4
4
  "author": "AccelByte Inc",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "main": "./dist/cjs/node/index.cjs",
@@ -48,7 +48,7 @@
48
48
  "vitest": "2.0.5"
49
49
  },
50
50
  "dependencies": {
51
- "@accelbyte/validator": "0.2.26",
51
+ "@accelbyte/validator": "0.2.27",
52
52
  "axios": "1.7.7",
53
53
  "buffer": "6.0.3",
54
54
  "crypto-js": "4.2.0",
@@ -57,6 +57,7 @@
57
57
  "query-string": "7.1.1",
58
58
  "uuid": "8.3.2",
59
59
  "validator": "13.7.0",
60
+ "ws": "8.18.0",
60
61
  "zod": "3.23.8"
61
62
  },
62
63
  "sideEffects": [