@seayoo-io/combo-sdk-node 1.4.5 → 1.5.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/README.md CHANGED
@@ -108,10 +108,6 @@ interface OrderMetaData {
108
108
  role_name?: string
109
109
  /** 游戏角色的等级 */
110
110
  role_level?: number
111
- /** 微信小游戏的 App ID, 微信小游戏的 iOS 支付场景必须传入 */
112
- weixin_appid?: string
113
- /** 微信小游戏的玩家 OpenID, 微信小游戏的 iOS 支付场景必须传入 */
114
- weixin_openid?: string
115
111
  }
116
112
 
117
113
  interface CreateOrderResponse {
@@ -298,9 +294,8 @@ const identityPayload = verifier.verifyIdentityToken(token)
298
294
  if(identityPayload instanceof Error) {
299
295
  console.error(result.message)
300
296
  } else {
301
- // 微信登录判断
302
- if(identityPayload.idp === IdP.Weixin) {
303
- // 微信登录会提供 weixin_unionid
297
+ // WebGL 平台,包括微信、抖音等小游戏,以及 HTML5 网页游戏
298
+ if(identityPayload.idp === IdP.WebGL) {
304
299
  // do something
305
300
  }
306
301
  // 游客登录判断
@@ -331,11 +326,11 @@ interface IdentityPayload {
331
326
  /** external_name 是用户在外部 IdP 中的名称,通常是用户的昵称 */
332
327
  external_name: string
333
328
  /**
334
- * weixin_unionid 是用户在微信中的 UnionId
335
- * 游戏侧可以使用 weixin_unionid 实现多端互通
336
- * 注意:weixin_unionid 只在 IdP 为 weixin 时才会有值。
329
+ * weixin_session_key 是用户在微信小游戏登录时,从微信服务端获得的会话密钥 session_key。
330
+ * 该字段在 Identity Token 中以 AES-256-GCM 加密存储,SDK 会自动解密。
331
+ * weixin_session_key 只在 IdP 为 MinigameWeixin 时才会有值。
337
332
  */
338
- weixin_unionid: string
333
+ weixin_session_key: string
339
334
  /**
340
335
  * device_id 是用户在登录时使用的设备的唯一 ID。
341
336
  */
package/dist/const.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /** SDK 名称 */
2
2
  export declare const SDKName = "combo-sdk-node";
3
3
  /** SDK 版本,在编译前会被动态替换 */
4
- export declare const SDKVersion = "1.4.5";
4
+ export declare const SDKVersion = "1.5.0";
5
5
  /**
6
6
  * 世游支持的服务端点列表
7
7
  */
@@ -21,12 +21,6 @@ export declare enum Platform {
21
21
  Windows = "windows",
22
22
  /** macOS 桌面平台 */
23
23
  macOS = "macos",
24
- /**
25
- * 微信小游戏
26
- *
27
- * @deprecated 已被 Platform.WebGL 取代
28
- */
29
- Weixin = "weixin",
30
24
  /** WebGL 平台,包括微信、抖音等小游戏,以及 HTML5 网页游戏 */
31
25
  WebGL = "webgl",
32
26
  /** 华为的 HarmonyOS NEXT 鸿蒙应用开发平台 */
package/dist/index.cjs CHANGED
@@ -12,7 +12,7 @@ var https__default = /*#__PURE__*/_interopDefaultLegacy(https);
12
12
  /** SDK 名称 */
13
13
  const SDKName = "combo-sdk-node";
14
14
  /** SDK 版本,在编译前会被动态替换 */
15
- const SDKVersion = "1.4.5";
15
+ const SDKVersion = "1.5.0";
16
16
  /**
17
17
  * 世游支持的服务端点列表
18
18
  */
@@ -34,12 +34,6 @@ exports.Platform = void 0;
34
34
  Platform["Windows"] = "windows";
35
35
  /** macOS 桌面平台 */
36
36
  Platform["macOS"] = "macos";
37
- /**
38
- * 微信小游戏
39
- *
40
- * @deprecated 已被 Platform.WebGL 取代
41
- */
42
- Platform["Weixin"] = "weixin";
43
37
  /** WebGL 平台,包括微信、抖音等小游戏,以及 HTML5 网页游戏 */
44
38
  Platform["WebGL"] = "webgl";
45
39
  /** 华为的 HarmonyOS NEXT 鸿蒙应用开发平台 */
@@ -1215,7 +1209,7 @@ class TokenVerifier {
1215
1209
  idp: payload.idp,
1216
1210
  external_id: payload.external_id,
1217
1211
  external_name: payload.external_name,
1218
- weixin_unionid: payload.weixin_unionid || "",
1212
+ weixin_session_key: payload.weixin_session_key || "",
1219
1213
  distro: payload.distro || "",
1220
1214
  variant: payload.variant || "",
1221
1215
  device_id: payload.device_id || "",
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { verify } from 'jsonwebtoken';
7
7
  /** SDK 名称 */
8
8
  const SDKName = "combo-sdk-node";
9
9
  /** SDK 版本,在编译前会被动态替换 */
10
- const SDKVersion = "1.4.5";
10
+ const SDKVersion = "1.5.0";
11
11
  /**
12
12
  * 世游支持的服务端点列表
13
13
  */
@@ -29,12 +29,6 @@ var Platform;
29
29
  Platform["Windows"] = "windows";
30
30
  /** macOS 桌面平台 */
31
31
  Platform["macOS"] = "macos";
32
- /**
33
- * 微信小游戏
34
- *
35
- * @deprecated 已被 Platform.WebGL 取代
36
- */
37
- Platform["Weixin"] = "weixin";
38
32
  /** WebGL 平台,包括微信、抖音等小游戏,以及 HTML5 网页游戏 */
39
33
  Platform["WebGL"] = "webgl";
40
34
  /** 华为的 HarmonyOS NEXT 鸿蒙应用开发平台 */
@@ -1210,7 +1204,7 @@ class TokenVerifier {
1210
1204
  idp: payload.idp,
1211
1205
  external_id: payload.external_id,
1212
1206
  external_name: payload.external_name,
1213
- weixin_unionid: payload.weixin_unionid || "",
1207
+ weixin_session_key: payload.weixin_session_key || "",
1214
1208
  distro: payload.distro || "",
1215
1209
  variant: payload.variant || "",
1216
1210
  device_id: payload.device_id || "",
@@ -30,12 +30,12 @@ export interface IdentityPayload {
30
30
  */
31
31
  external_name: string;
32
32
  /**
33
- * weixin_unionid 是用户在微信中的 UnionId
34
- * 游戏侧可以使用 weixin_unionid 实现多端互通
33
+ * weixin_session_key 是用户在微信小游戏登录时,从微信服务端获得的会话密钥 session_key。
34
+ * 该字段在 Identity Token 中以 AES-256-GCM 加密存储,SDK 会自动解密。
35
35
  *
36
- * 注意:weixin_unionid 只在 IdP 为 weixin 时才会有值。
36
+ * weixin_session_key 只在 IdP 为 MinigameWeixin 时才会有值。
37
37
  */
38
- weixin_unionid: string;
38
+ weixin_session_key: string;
39
39
  /**
40
40
  * DeviceId 是用户在登录时使用的设备的唯一 ID。
41
41
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-io/combo-sdk-node",
3
- "version": "1.4.5",
3
+ "version": "1.5.0",
4
4
  "description": "Combo SDK for Node.js",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",