@mpgd/game-services 0.12.1 → 0.13.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.
@@ -75,8 +75,9 @@ export interface AppsInTossPurchaseAuthorityInput {
75
75
  export interface AppsInTossPurchaseOrderRecord {
76
76
  readonly orderId: string;
77
77
  /**
78
- * Server-authenticated game player identity associated with the Toss login
79
- * user used for the order-status lookup.
78
+ * Server-authenticated game player identity associated with this order.
79
+ * It may be bound through a Toss Login user key or through a verified
80
+ * platform-anonymous game identity plus a consume-once order authority.
80
81
  */
81
82
  readonly playerId: string;
82
83
  readonly sku: string;
@@ -76,10 +76,11 @@ export interface AppsInTossPartnerApiClient {
76
76
  getIapOrderStatus(input: {
77
77
  readonly orderId: string;
78
78
  /**
79
- * A user key resolved through Apps in Toss login. Supplying it binds the
80
- * lookup to the same authenticated user that initiated the purchase.
79
+ * Optional user key resolved through Apps in Toss login. Supplying it
80
+ * narrows the lookup to the same authenticated user; the official API also
81
+ * supports an order-id-only lookup when a game does not require login.
81
82
  */
82
- readonly tossUserKey: string;
83
+ readonly tossUserKey?: string;
83
84
  readonly signal?: AbortSignal;
84
85
  }): Promise<AppsInTossIapOrderStatusResult>;
85
86
  }
@@ -91,12 +91,14 @@ export function createAppsInTossPartnerApiClient(input) {
91
91
  },
92
92
  async getIapOrderStatus(request) {
93
93
  const orderId = normalizeIdentifier(request.orderId, 'orderId');
94
- const tossUserKey = normalizeTossUserKey(request.tossUserKey, 'tossUserKey');
94
+ const tossUserKey = request.tossUserKey === undefined
95
+ ? undefined
96
+ : normalizeTossUserKey(request.tossUserKey, 'tossUserKey');
95
97
  const response = await requestJson({
96
98
  mtls: input.mtls,
97
99
  method: 'POST',
98
100
  url: new URL(getIapOrderStatusPath, baseUrl).href,
99
- headers: { 'x-toss-user-key': tossUserKey },
101
+ headers: tossUserKey === undefined ? {} : { 'x-toss-user-key': tossUserKey },
100
102
  body: { orderId },
101
103
  timeoutMs,
102
104
  ...(request.signal === undefined ? {} : { signal: request.signal }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/game-services",
3
- "version": "0.12.1",
3
+ "version": "0.13.0",
4
4
  "description": "Client, contract, server, store, and test helpers for authoritative mpgd game services.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -130,9 +130,9 @@
130
130
  "@orpc/client": "2.0.0-beta.14",
131
131
  "@orpc/contract": "2.0.0-beta.14",
132
132
  "@orpc/server": "2.0.0-beta.14",
133
+ "@mpgd/catalog": "0.7.0",
133
134
  "@mpgd/platform": "0.10.0",
134
- "@mpgd/analytics": "0.3.10",
135
- "@mpgd/catalog": "0.7.0"
135
+ "@mpgd/analytics": "0.3.10"
136
136
  },
137
137
  "devDependencies": {
138
138
  "ttsc": "0.18.4",