@seayoo-io/combo-sdk-node 1.11.0 → 1.12.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.cjs CHANGED
@@ -33,7 +33,7 @@ jsonwebtoken = __toESM(jsonwebtoken);
33
33
  /** SDK 名称 */
34
34
  const SDKName = "combo-sdk-node";
35
35
  /** SDK 版本,在编译前会被动态替换 */
36
- const SDKVersion = "1.11.0";
36
+ const SDKVersion = "1.12.0";
37
37
  /**
38
38
  * 世游支持的服务端点列表
39
39
  */
@@ -1271,7 +1271,7 @@ var TokenVerifier = class {
1271
1271
  //#endregion
1272
1272
  //#region src/notify/msgShipOrder.ts
1273
1273
  function isShipOrderPayload(data) {
1274
- return isObject(data) && "order_id" in data && "reference_id" in data && "combo_id" in data && "product_id" in data && "quantity" in data && "currency" in data && "amount" in data && typeof data.order_id === "string" && typeof data.combo_id === "string" && typeof data.quantity === "number" && typeof data.amount === "number" && ("is_sandbox" in data ? typeof data.is_sandbox === "boolean" : true) && Number.isSafeInteger(data.quantity) && Number.isSafeInteger(data.amount) && !!data.order_id && !!data.combo_id;
1274
+ return isObject(data) && "order_id" in data && "reference_id" in data && "combo_id" in data && "product_id" in data && "quantity" in data && "currency" in data && "amount" in data && typeof data.order_id === "string" && typeof data.combo_id === "string" && typeof data.quantity === "number" && typeof data.amount === "number" && ("is_sandbox" in data ? typeof data.is_sandbox === "boolean" : true) && ("paid_currency" in data ? typeof data.paid_currency === "string" : true) && ("paid_amount" in data ? typeof data.paid_amount === "number" && Number.isSafeInteger(data.paid_amount) : true) && ("app_store_offer_identifier" in data ? typeof data.app_store_offer_identifier === "string" : true) && Number.isSafeInteger(data.quantity) && Number.isSafeInteger(data.amount) && !!data.order_id && !!data.combo_id;
1275
1275
  }
1276
1276
  //#endregion
1277
1277
  //#region src/notify/msgRefund.ts
package/dist/index.d.cts CHANGED
@@ -384,6 +384,12 @@ interface OrderMetaData {
384
384
  role_name?: string;
385
385
  /** 游戏角色的等级 */
386
386
  role_level?: number;
387
+ /**
388
+ * 是否为 App Store Offer Code 兑换订单。
389
+ *
390
+ * 为 true 时,本单只能通过 App Store Offer Code 兑换;为 false 或未赋值时,只能通过内购购买。
391
+ */
392
+ redeem_app_store_offer_code?: boolean;
387
393
  }
388
394
  interface CreateOrderResponse {
389
395
  /** 世游服务端创建的,标识订单的唯一 ID。 */
@@ -404,7 +410,12 @@ interface SendOtpOption {
404
410
  /** 发送方元数据,主要用于数据分析,游戏服务端应当尽量提供。*/
405
411
  meta?: SendOtpMetaData;
406
412
  }
407
- type SendOtpMetaData = OrderMetaData;
413
+ /**
414
+ * 发送验证码时附带的元数据。
415
+ *
416
+ * 字段定义同 OrderMetaData,但不包含仅对创建订单有意义的 redeem_app_store_offer_code。
417
+ */
418
+ type SendOtpMetaData = Omit<OrderMetaData, "redeem_app_store_offer_code">;
408
419
  interface SendOtpResponse {
409
420
  /** 掩码后的手机号,仅当 channel=sms 时有值。*/
410
421
  mobile: string;
@@ -673,6 +684,16 @@ interface ShipOrderNotification {
673
684
  * 预期此字段仅用于记录日志和数据埋点。无论是否是沙盒订单,游戏侧都应当发货。
674
685
  */
675
686
  is_sandbox?: boolean;
687
+ /** 实付币种代码。例如 USD、CNY。可能与订单币种 currency 不同 */
688
+ paid_currency?: string;
689
+ /**
690
+ * 玩家实付金额,单位为分。可能与订单 amount 不同,例如免费兑换的 App Store Offer Code 订单为 0。
691
+ *
692
+ * 预期此字段仅用于对账和数据埋点。无论 paid_amount 是否为 0,游戏侧都应当按订单发货。
693
+ */
694
+ paid_amount?: number;
695
+ /** 交易实际使用的 App Store Offer 标识(offerIdentifier),只在 App Store Offer Code 兑换订单中出现 */
696
+ app_store_offer_identifier?: string;
676
697
  }
677
698
  //#endregion
678
699
  //#region src/notify/msgRefund.d.ts
package/dist/index.d.ts CHANGED
@@ -384,6 +384,12 @@ interface OrderMetaData {
384
384
  role_name?: string;
385
385
  /** 游戏角色的等级 */
386
386
  role_level?: number;
387
+ /**
388
+ * 是否为 App Store Offer Code 兑换订单。
389
+ *
390
+ * 为 true 时,本单只能通过 App Store Offer Code 兑换;为 false 或未赋值时,只能通过内购购买。
391
+ */
392
+ redeem_app_store_offer_code?: boolean;
387
393
  }
388
394
  interface CreateOrderResponse {
389
395
  /** 世游服务端创建的,标识订单的唯一 ID。 */
@@ -404,7 +410,12 @@ interface SendOtpOption {
404
410
  /** 发送方元数据,主要用于数据分析,游戏服务端应当尽量提供。*/
405
411
  meta?: SendOtpMetaData;
406
412
  }
407
- type SendOtpMetaData = OrderMetaData;
413
+ /**
414
+ * 发送验证码时附带的元数据。
415
+ *
416
+ * 字段定义同 OrderMetaData,但不包含仅对创建订单有意义的 redeem_app_store_offer_code。
417
+ */
418
+ type SendOtpMetaData = Omit<OrderMetaData, "redeem_app_store_offer_code">;
408
419
  interface SendOtpResponse {
409
420
  /** 掩码后的手机号,仅当 channel=sms 时有值。*/
410
421
  mobile: string;
@@ -673,6 +684,16 @@ interface ShipOrderNotification {
673
684
  * 预期此字段仅用于记录日志和数据埋点。无论是否是沙盒订单,游戏侧都应当发货。
674
685
  */
675
686
  is_sandbox?: boolean;
687
+ /** 实付币种代码。例如 USD、CNY。可能与订单币种 currency 不同 */
688
+ paid_currency?: string;
689
+ /**
690
+ * 玩家实付金额,单位为分。可能与订单 amount 不同,例如免费兑换的 App Store Offer Code 订单为 0。
691
+ *
692
+ * 预期此字段仅用于对账和数据埋点。无论 paid_amount 是否为 0,游戏侧都应当按订单发货。
693
+ */
694
+ paid_amount?: number;
695
+ /** 交易实际使用的 App Store Offer 标识(offerIdentifier),只在 App Store Offer Code 兑换订单中出现 */
696
+ app_store_offer_identifier?: string;
676
697
  }
677
698
  //#endregion
678
699
  //#region src/notify/msgRefund.d.ts
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import jwt from "jsonwebtoken";
7
7
  /** SDK 名称 */
8
8
  const SDKName = "combo-sdk-node";
9
9
  /** SDK 版本,在编译前会被动态替换 */
10
- const SDKVersion = "1.11.0";
10
+ const SDKVersion = "1.12.0";
11
11
  /**
12
12
  * 世游支持的服务端点列表
13
13
  */
@@ -1245,7 +1245,7 @@ var TokenVerifier = class {
1245
1245
  //#endregion
1246
1246
  //#region src/notify/msgShipOrder.ts
1247
1247
  function isShipOrderPayload(data) {
1248
- return isObject(data) && "order_id" in data && "reference_id" in data && "combo_id" in data && "product_id" in data && "quantity" in data && "currency" in data && "amount" in data && typeof data.order_id === "string" && typeof data.combo_id === "string" && typeof data.quantity === "number" && typeof data.amount === "number" && ("is_sandbox" in data ? typeof data.is_sandbox === "boolean" : true) && Number.isSafeInteger(data.quantity) && Number.isSafeInteger(data.amount) && !!data.order_id && !!data.combo_id;
1248
+ return isObject(data) && "order_id" in data && "reference_id" in data && "combo_id" in data && "product_id" in data && "quantity" in data && "currency" in data && "amount" in data && typeof data.order_id === "string" && typeof data.combo_id === "string" && typeof data.quantity === "number" && typeof data.amount === "number" && ("is_sandbox" in data ? typeof data.is_sandbox === "boolean" : true) && ("paid_currency" in data ? typeof data.paid_currency === "string" : true) && ("paid_amount" in data ? typeof data.paid_amount === "number" && Number.isSafeInteger(data.paid_amount) : true) && ("app_store_offer_identifier" in data ? typeof data.app_store_offer_identifier === "string" : true) && Number.isSafeInteger(data.quantity) && Number.isSafeInteger(data.amount) && !!data.order_id && !!data.combo_id;
1249
1249
  }
1250
1250
  //#endregion
1251
1251
  //#region src/notify/msgRefund.ts
@@ -69,6 +69,12 @@ interface OrderMetaData {
69
69
  role_name?: string
70
70
  /** 游戏角色的等级 */
71
71
  role_level?: number
72
+ /**
73
+ * 是否为 App Store Offer Code 兑换订单。
74
+ *
75
+ * 为 true 时,本单只能通过 App Store Offer Code 兑换;为 false 或未赋值时,只能通过内购购买。
76
+ */
77
+ redeem_app_store_offer_code?: boolean
72
78
  }
73
79
 
74
80
  interface CreateOrderResponse {
@@ -119,7 +125,7 @@ const sendResult = await client.sendOtp({
119
125
  action: "<Action>",
120
126
  /**
121
127
  * [可选] 发送方元数据,主要用于数据分析,游戏服务端应当尽量提供
122
- * 字段定义同 OrderMetaData
128
+ * 字段定义同 OrderMetaData,但不包含仅对创建订单有意义的 redeem_app_store_offer_code
123
129
  */
124
130
  meta: { ... },
125
131
  })
package/docs/notify.md CHANGED
@@ -55,6 +55,15 @@ interface ShipOrderNotification {
55
55
  * 预期此字段仅用于记录日志和数据埋点。无论是否是沙盒订单,游戏侧都应当发货。
56
56
  */
57
57
  is_sandbox?: boolean
58
+ /** 实付币种代码。例如 USD、CNY。可能与订单币种 currency 不同 */
59
+ paid_currency?: string
60
+ /**
61
+ * 玩家实付金额,单位为分。可能与订单 amount 不同,例如免费兑换的 App Store Offer Code 订单为 0。
62
+ * 预期此字段仅用于对账和数据埋点。无论 paid_amount 是否为 0,游戏侧都应当按订单发货。
63
+ */
64
+ paid_amount?: number
65
+ /** 交易实际使用的 App Store Offer 标识(offerIdentifier),只在 App Store Offer Code 兑换订单中出现 */
66
+ app_store_offer_identifier?: string
58
67
  }
59
68
 
60
69
  interface RefundNotification {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-io/combo-sdk-node",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Combo SDK for Node.js",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -50,15 +50,15 @@
50
50
  "ioredis": "^5.4.1",
51
51
  "lint-staged": "^17.3.0",
52
52
  "msw": "^2.15.0",
53
- "oxfmt": "^0.62.0",
53
+ "oxfmt": "^0.80.0",
54
54
  "oxlint": "^1.77.0",
55
55
  "publint": "^0.3.23",
56
- "rimraf": "^6.1.3",
56
+ "rimraf": "^6.1.4",
57
57
  "simple-git-hooks": "^2.13.1",
58
58
  "tsdown": "0.21.0",
59
59
  "typescript": "6.0.3",
60
- "vite": "^8.2.0",
61
- "vitest": "^4.1.10"
60
+ "vite": "^8.3.8",
61
+ "vitest": "^4.1.12"
62
62
  },
63
63
  "dependencies": {
64
64
  "jsonwebtoken": "^9.0.2"