@mpgd/adapter-ait 0.12.2 → 0.12.4

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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Invokes the AIT WebView's fetch as a standalone function. Calling an injected
3
+ * native fetch through a dependency object's `.fetch()` method gives it that
4
+ * object as `this`, which can reject otherwise valid purchase-grant requests on
5
+ * iOS before they reach the game authority.
6
+ *
7
+ * Keep the game's authentication, idempotency headers, timeout policy, and
8
+ * response validation in its authority client. This helper only owns the
9
+ * WebView transport invocation, so all game-owned authority endpoints can use
10
+ * the same safe call shape.
11
+ */
12
+ export declare function fetchAitAuthority(input: {
13
+ readonly resource: RequestInfo | URL;
14
+ readonly init?: RequestInit;
15
+ readonly fetch?: typeof fetch;
16
+ }): Promise<Response>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Invokes the AIT WebView's fetch as a standalone function. Calling an injected
3
+ * native fetch through a dependency object's `.fetch()` method gives it that
4
+ * object as `this`, which can reject otherwise valid purchase-grant requests on
5
+ * iOS before they reach the game authority.
6
+ *
7
+ * Keep the game's authentication, idempotency headers, timeout policy, and
8
+ * response validation in its authority client. This helper only owns the
9
+ * WebView transport invocation, so all game-owned authority endpoints can use
10
+ * the same safe call shape.
11
+ */
12
+ export function fetchAitAuthority(input) {
13
+ const fetchImplementation = input.fetch ?? globalThis.fetch;
14
+ if (typeof fetchImplementation !== 'function') {
15
+ return Promise.reject(new TypeError('AIT authority fetch is unavailable.'));
16
+ }
17
+ return fetchImplementation(input.resource, input.init);
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/adapter-ait",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "description": "Apps in Toss WebView platform adapter for mpgd games.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,6 +49,10 @@
49
49
  "types": "./dist/safe-area.d.ts",
50
50
  "default": "./dist/safe-area.js"
51
51
  },
52
+ "./authority-fetch": {
53
+ "types": "./dist/authority-fetch.d.ts",
54
+ "default": "./dist/authority-fetch.js"
55
+ },
52
56
  "./package.json": "./package.json"
53
57
  },
54
58
  "files": [
@@ -56,7 +60,7 @@
56
60
  ],
57
61
  "dependencies": {
58
62
  "@mpgd/bridge": "0.9.1",
59
- "@mpgd/platform": "0.12.1"
63
+ "@mpgd/platform": "0.12.2"
60
64
  },
61
65
  "peerDependencies": {
62
66
  "@apps-in-toss/web-framework": ">=3.0.0 <4"