@ait-kit/sdk 0.4.0 → 0.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 +95 -21
- package/dist/ads/adapter.d.ts +36 -0
- package/dist/ads/adapter.d.ts.map +1 -0
- package/dist/ads/adapter.js +219 -0
- package/dist/ads/platform-contract.d.ts +45 -0
- package/dist/ads/platform-contract.d.ts.map +1 -0
- package/dist/ads/platform-contract.js +7 -0
- package/dist/iap/adapter.d.ts +11 -1
- package/dist/iap/adapter.d.ts.map +1 -1
- package/dist/iap/adapter.js +13 -0
- package/dist/iap/order-history.d.ts +6 -0
- package/dist/iap/order-history.d.ts.map +1 -0
- package/dist/iap/order-history.js +54 -0
- package/dist/iap/platform-contract.d.ts +9 -1
- package/dist/iap/platform-contract.d.ts.map +1 -1
- package/dist/iap/platform-contract.js +1 -1
- package/dist/iap/purchase-flow.d.ts +1 -1
- package/dist/iap/purchase-flow.js +1 -1
- package/dist/iap/subscription-info.d.ts +6 -0
- package/dist/iap/subscription-info.d.ts.map +1 -0
- package/dist/iap/subscription-info.js +38 -0
- package/dist/identity/platform-contract.d.ts +1 -1
- package/dist/index.d.ts +28 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/notification/platform-contract.d.ts +1 -1
- package/dist/rn/ads.d.ts +7 -36
- package/dist/rn/ads.d.ts.map +1 -1
- package/dist/rn/ads.js +2 -223
- package/dist/rn/framework-contract.d.ts +1 -44
- package/dist/rn/framework-contract.d.ts.map +1 -1
- package/dist/rn/framework-contract.js +0 -6
- package/dist/rn/iap.d.ts +1 -1
- package/dist/rn/iap.d.ts.map +1 -1
- package/dist/rn/iap.js +1 -1
- package/dist/share/platform-contract.d.ts +1 -1
- package/dist/storage/platform-contract.d.ts +1 -1
- package/dist/webview/ads.d.ts +10 -0
- package/dist/webview/ads.d.ts.map +1 -0
- package/dist/webview/ads.js +14 -0
- package/dist/webview/banner-contract.d.ts +59 -0
- package/dist/webview/banner-contract.d.ts.map +1 -0
- package/dist/webview/banner.d.ts +15 -0
- package/dist/webview/banner.d.ts.map +1 -0
- package/dist/webview/banner.js +188 -0
- package/dist/{web → webview}/framework-loader.d.ts +1 -1
- package/dist/webview/framework-loader.d.ts.map +1 -0
- package/dist/{web → webview}/framework-loader.js +3 -3
- package/dist/{web → webview}/iap-contract.d.ts +4 -4
- package/dist/webview/iap-contract.d.ts.map +1 -0
- package/dist/webview/iap-contract.js +1 -0
- package/dist/webview/identity.d.ts +40 -0
- package/dist/webview/identity.d.ts.map +1 -0
- package/dist/{web → webview}/identity.js +17 -13
- package/dist/webview/index.d.ts +62 -0
- package/dist/webview/index.d.ts.map +1 -0
- package/dist/{web → webview}/index.js +20 -11
- package/dist/webview/notify-share.d.ts +50 -0
- package/dist/webview/notify-share.d.ts.map +1 -0
- package/dist/{web → webview}/notify-share.js +18 -14
- package/dist/webview/platform-loader.d.ts +4 -0
- package/dist/webview/platform-loader.d.ts.map +1 -0
- package/dist/{web → webview}/platform-loader.js +1 -1
- package/dist/webview/promotion.d.ts +13 -0
- package/dist/webview/promotion.d.ts.map +1 -0
- package/dist/{web → webview}/promotion.js +5 -3
- package/dist/webview/review.d.ts +11 -0
- package/dist/webview/review.d.ts.map +1 -0
- package/dist/webview/review.js +11 -0
- package/package.json +7 -3
- package/dist/web/framework-loader.d.ts.map +0 -1
- package/dist/web/iap-contract.d.ts.map +0 -1
- package/dist/web/identity.d.ts +0 -30
- package/dist/web/identity.d.ts.map +0 -1
- package/dist/web/index.d.ts +0 -49
- package/dist/web/index.d.ts.map +0 -1
- package/dist/web/notify-share.d.ts +0 -38
- package/dist/web/notify-share.d.ts.map +0 -1
- package/dist/web/platform-loader.d.ts +0 -4
- package/dist/web/platform-loader.d.ts.map +0 -1
- package/dist/web/promotion.d.ts +0 -9
- package/dist/web/promotion.d.ts.map +0 -1
- package/dist/web/review.d.ts +0 -7
- package/dist/web/review.d.ts.map +0 -1
- package/dist/web/review.js +0 -9
- /package/dist/{web/iap-contract.js → webview/banner-contract.js} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type SdkNotificationAgreementResult, type SdkShareUiResult } from "../index.js";
|
|
2
|
+
import { type NotificationPlatformLoader, type NotificationPlatformSdk } from "../notification/platform-contract.js";
|
|
3
|
+
import { type SharePlatformLoader, type SharePlatformSdk } from "../share/platform-contract.js";
|
|
4
|
+
export interface WebViewNotificationOptions {
|
|
5
|
+
/**
|
|
6
|
+
* WebView framework injection: pass a module exposing Notification or a
|
|
7
|
+
* custom loader. Defaults to the lazy `import("@apps-in-toss/web-framework")`
|
|
8
|
+
* loader.
|
|
9
|
+
*/
|
|
10
|
+
framework?: NotificationPlatformSdk | NotificationPlatformLoader;
|
|
11
|
+
/** Overall deadline per agreement request (default 60000ms; 0 disables). */
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface WebViewNotification {
|
|
15
|
+
/** See ReactNativeNotification.requestAgreement for the contract. */
|
|
16
|
+
requestAgreement(templateCode: string): Promise<SdkNotificationAgreementResult>;
|
|
17
|
+
}
|
|
18
|
+
export declare function createWebViewNotification(options?: WebViewNotificationOptions): WebViewNotification;
|
|
19
|
+
export interface WebViewShareOptions {
|
|
20
|
+
/**
|
|
21
|
+
* WebView framework injection: pass a module exposing Share or a custom
|
|
22
|
+
* loader. Defaults to the lazy `import("@apps-in-toss/web-framework")`
|
|
23
|
+
* loader.
|
|
24
|
+
*/
|
|
25
|
+
framework?: SharePlatformSdk | SharePlatformLoader;
|
|
26
|
+
}
|
|
27
|
+
export interface WebViewShare {
|
|
28
|
+
/** Creates a share link for an `intoss://` deeplink path. */
|
|
29
|
+
createLink(path: string, ogImageUrl?: string): Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Opens the native share sheet; `completed` means only that the SDK share
|
|
32
|
+
* call finished — it never proves the user shared and never grants reward
|
|
33
|
+
* eligibility.
|
|
34
|
+
*/
|
|
35
|
+
sendMessage(message: string): Promise<SdkShareUiResult>;
|
|
36
|
+
}
|
|
37
|
+
export declare function createWebViewShare(options?: WebViewShareOptions): WebViewShare;
|
|
38
|
+
/** @deprecated Use createWebViewNotification from @ait-kit/sdk/webview. */
|
|
39
|
+
export declare const createWebNotification: typeof createWebViewNotification;
|
|
40
|
+
/** @deprecated Use createWebViewShare from @ait-kit/sdk/webview. */
|
|
41
|
+
export declare const createWebShare: typeof createWebViewShare;
|
|
42
|
+
/** @deprecated Use WebViewNotification from @ait-kit/sdk/webview. */
|
|
43
|
+
export type WebNotification = WebViewNotification;
|
|
44
|
+
/** @deprecated Use WebViewNotificationOptions from @ait-kit/sdk/webview. */
|
|
45
|
+
export type WebNotificationOptions = WebViewNotificationOptions;
|
|
46
|
+
/** @deprecated Use WebViewShare from @ait-kit/sdk/webview. */
|
|
47
|
+
export type WebShare = WebViewShare;
|
|
48
|
+
/** @deprecated Use WebViewShareOptions from @ait-kit/sdk/webview. */
|
|
49
|
+
export type WebShareOptions = WebViewShareOptions;
|
|
50
|
+
//# sourceMappingURL=notify-share.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-share.d.ts","sourceRoot":"","sources":["../../src/webview/notify-share.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAE7B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAGtB,MAAM,+BAA+B,CAAC;AAIvC,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,SAAS,CAAC,EAAE,uBAAuB,GAAG,0BAA0B,CAAC;IACjE,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,qEAAqE;IACrE,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;CACjF;AAED,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,0BAA+B,GAAG,mBAAmB,CAavG;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,gBAAgB,GAAG,mBAAmB,CAAC;CACpD;AAED,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/D;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACzD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,YAAY,CAwClF;AAoGD,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,kCAA4B,CAAC;AAC/D,oEAAoE;AACpE,eAAO,MAAM,cAAc,2BAAqB,CAAC;AACjD,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAClD,4EAA4E;AAC5E,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;AAChE,8DAA8D;AAC9D,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;AACpC,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { resolvePlatformLoader } from "../platform-loader.js";
|
|
2
|
-
import {
|
|
2
|
+
import { createWebViewPlatformLoader } from "./platform-loader.js";
|
|
3
3
|
import { SdkError } from "../index.js";
|
|
4
4
|
import { runRequestAgreement } from "../notification/platform-contract.js";
|
|
5
5
|
import { runShareUi, validateSharePath } from "../share/platform-contract.js";
|
|
6
6
|
const DEFAULT_AGREEMENT_TIMEOUT_MS = 60_000;
|
|
7
|
-
export function
|
|
8
|
-
const loader =
|
|
7
|
+
export function createWebViewNotification(options = {}) {
|
|
8
|
+
const loader = normalizeWebViewNotificationLoader(options.framework);
|
|
9
9
|
const timeoutMs = options.timeoutMs ?? DEFAULT_AGREEMENT_TIMEOUT_MS;
|
|
10
10
|
return {
|
|
11
11
|
requestAgreement(templateCode) {
|
|
@@ -16,8 +16,8 @@ export function createWebNotification(options = {}) {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export function
|
|
20
|
-
const loader =
|
|
19
|
+
export function createWebViewShare(options = {}) {
|
|
20
|
+
const loader = normalizeWebViewShareLoader(options.framework);
|
|
21
21
|
const load = async () => {
|
|
22
22
|
const result = await loader();
|
|
23
23
|
if (!result.available) {
|
|
@@ -54,19 +54,19 @@ export function createWebShare(options = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return resolvePlatformLoader(framework,
|
|
57
|
+
function normalizeWebViewNotificationLoader(framework) {
|
|
58
|
+
return resolvePlatformLoader(framework, createDefaultWebViewNotificationLoader);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return resolvePlatformLoader(framework,
|
|
60
|
+
function normalizeWebViewShareLoader(framework) {
|
|
61
|
+
return resolvePlatformLoader(framework, createDefaultWebViewShareLoader);
|
|
62
62
|
}
|
|
63
|
-
// See
|
|
63
|
+
// See createDefaultWebViewIdentityLoader in ./identity.ts: the web SDK already
|
|
64
64
|
// matches the shared contract shapes, so no conversion or assertion is used.
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function createDefaultWebViewNotificationLoader() {
|
|
66
|
+
return createWebViewPlatformLoader(module => ({ available: true, module: module }));
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
68
|
+
function createDefaultWebViewShareLoader() {
|
|
69
|
+
return createWebViewPlatformLoader(module => ({ available: true, module: module }));
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Same loader-covering deadline as the React Native adapter; see
|
|
@@ -130,3 +130,7 @@ async function loadNotificationPlatform(loader) {
|
|
|
130
130
|
}
|
|
131
131
|
return result.module;
|
|
132
132
|
}
|
|
133
|
+
/** @deprecated Use createWebViewNotification from @ait-kit/sdk/webview. */
|
|
134
|
+
export const createWebNotification = createWebViewNotification;
|
|
135
|
+
/** @deprecated Use createWebViewShare from @ait-kit/sdk/webview. */
|
|
136
|
+
export const createWebShare = createWebViewShare;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type PlatformLoader, type PlatformLoadResult } from "../platform-loader.js";
|
|
2
|
+
/** Lazy platform-local import followed by capability-specific selection. */
|
|
3
|
+
export declare function createWebViewPlatformLoader<T>(select: (module: typeof import("@apps-in-toss/web-framework")) => PlatformLoadResult<T>, includeErrorDetails?: boolean): PlatformLoader<T>;
|
|
4
|
+
//# sourceMappingURL=platform-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-loader.d.ts","sourceRoot":"","sources":["../../src/webview/platform-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACvI,4EAA4E;AAC5E,wBAAgB,2BAA2B,CAAC,CAAC,EAC3C,MAAM,EAAE,CAAC,MAAM,EAAE,cAAc,6BAA6B,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,EACvF,mBAAmB,UAAO,GACzB,cAAc,CAAC,CAAC,CAAC,CAKnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCachedPlatformLoader, frameworkImportError } from "../platform-loader.js";
|
|
2
2
|
/** Lazy platform-local import followed by capability-specific selection. */
|
|
3
|
-
export function
|
|
3
|
+
export function createWebViewPlatformLoader(select, includeErrorDetails = true) {
|
|
4
4
|
return createCachedPlatformLoader(async () => select(await import("@apps-in-toss/web-framework")), error => frameworkImportError("@apps-in-toss/web-framework", error, includeErrorDetails));
|
|
5
5
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PromotionAdapter, PromotionPlatformLoader, PromotionPlatformSdk } from "../promotion/platform-contract.js";
|
|
2
|
+
export interface WebViewPromotionOptions {
|
|
3
|
+
/** Shared Promotion contract or async loader; defaults to the official SDK. */
|
|
4
|
+
framework?: PromotionPlatformSdk | PromotionPlatformLoader;
|
|
5
|
+
/** Overall wait deadline; 0 (default) disables it. Timeout does not cancel payment. */
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function createWebViewPromotion(options?: WebViewPromotionOptions): PromotionAdapter;
|
|
9
|
+
/** @deprecated Use createWebViewPromotion from @ait-kit/sdk/webview. */
|
|
10
|
+
export declare const createWebPromotion: typeof createWebViewPromotion;
|
|
11
|
+
/** @deprecated Use WebViewPromotionOptions from @ait-kit/sdk/webview. */
|
|
12
|
+
export type WebPromotionOptions = WebViewPromotionOptions;
|
|
13
|
+
//# sourceMappingURL=promotion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promotion.d.ts","sourceRoot":"","sources":["../../src/webview/promotion.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzH,MAAM,WAAW,uBAAuB;IACtC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,oBAAoB,GAAG,uBAAuB,CAAC;IAC3D,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAE9F;AAOD,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,+BAAyB,CAAC;AACzD,yEAAyE;AACzE,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { resolvePlatformLoader } from "../platform-loader.js";
|
|
2
|
-
import {
|
|
2
|
+
import { createWebViewPlatformLoader } from "./platform-loader.js";
|
|
3
3
|
import { createPromotionAdapter } from "../promotion/adapter.js";
|
|
4
|
-
export function
|
|
4
|
+
export function createWebViewPromotion(options = {}) {
|
|
5
5
|
return createPromotionAdapter(resolvePlatformLoader(options.framework, createDefaultPromotionLoader), options.timeoutMs);
|
|
6
6
|
}
|
|
7
7
|
/** Keep import diagnostics redacted for direct-promotion operations. */
|
|
8
8
|
function createDefaultPromotionLoader() {
|
|
9
|
-
return
|
|
9
|
+
return createWebViewPlatformLoader(module => ({ available: true, module: module }), false);
|
|
10
10
|
}
|
|
11
|
+
/** @deprecated Use createWebViewPromotion from @ait-kit/sdk/webview. */
|
|
12
|
+
export const createWebPromotion = createWebViewPromotion;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReviewAdapter, ReviewPlatformLoader, ReviewPlatformSdk } from "../review/platform-contract.js";
|
|
2
|
+
export interface WebViewReviewOptions {
|
|
3
|
+
/** Shared contract injection, or a loader; defaults to the lazy official SDK. */
|
|
4
|
+
framework?: ReviewPlatformSdk | ReviewPlatformLoader;
|
|
5
|
+
}
|
|
6
|
+
export declare function createWebViewReview(options?: WebViewReviewOptions): ReviewAdapter;
|
|
7
|
+
/** @deprecated Use createWebViewReview from @ait-kit/sdk/webview. */
|
|
8
|
+
export declare const createWebReview: typeof createWebViewReview;
|
|
9
|
+
/** @deprecated Use WebViewReviewOptions from @ait-kit/sdk/webview. */
|
|
10
|
+
export type WebReviewOptions = WebViewReviewOptions;
|
|
11
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/webview/review.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAE7G,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,SAAS,CAAC,EAAE,iBAAiB,GAAG,oBAAoB,CAAC;CACtD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,aAAa,CAErF;AAMD,qEAAqE;AACrE,eAAO,MAAM,eAAe,4BAAsB,CAAC;AACnD,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { resolvePlatformLoader } from "../platform-loader.js";
|
|
2
|
+
import { createWebViewPlatformLoader } from "./platform-loader.js";
|
|
3
|
+
import { createReviewAdapter } from "../review/adapter.js";
|
|
4
|
+
export function createWebViewReview(options = {}) {
|
|
5
|
+
return createReviewAdapter(resolvePlatformLoader(options.framework, createDefaultReviewLoader));
|
|
6
|
+
}
|
|
7
|
+
function createDefaultReviewLoader() {
|
|
8
|
+
return createWebViewPlatformLoader(module => ({ available: true, module: module }), false);
|
|
9
|
+
}
|
|
10
|
+
/** @deprecated Use createWebViewReview from @ait-kit/sdk/webview. */
|
|
11
|
+
export const createWebReview = createWebViewReview;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ait-kit/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Frontend SDK adapters for Apps in Toss mini apps: shared contracts plus per-runtime entry points.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,8 +35,12 @@
|
|
|
35
35
|
"import": "./dist/rn/index.js"
|
|
36
36
|
},
|
|
37
37
|
"./web": {
|
|
38
|
-
"types": "./dist/
|
|
39
|
-
"import": "./dist/
|
|
38
|
+
"types": "./dist/webview/index.d.ts",
|
|
39
|
+
"import": "./dist/webview/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./webview": {
|
|
42
|
+
"types": "./dist/webview/index.d.ts",
|
|
43
|
+
"import": "./dist/webview/index.js"
|
|
40
44
|
}
|
|
41
45
|
},
|
|
42
46
|
"files": [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"framework-loader.d.ts","sourceRoot":"","sources":["../../src/web/framework-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;;GAKG;AACH,wBAAgB,+BAA+B,IAAI,iBAAiB,CAQnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iap-contract.d.ts","sourceRoot":"","sources":["../../src/web/iap-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,YAAY,CAAC;CACnB,CAAC"}
|
package/dist/web/identity.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type SdkAnonymousKey, type SdkLoginResult, type SdkStorage } from "../index.js";
|
|
2
|
-
import { type IdentityPlatformLoader, type IdentityPlatformSdk } from "../identity/platform-contract.js";
|
|
3
|
-
import { type StoragePlatformLoader, type StoragePlatformSdk } from "../storage/platform-contract.js";
|
|
4
|
-
export interface WebIdentityOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Web framework injection: pass a module exposing TossAuth/User or a
|
|
7
|
-
* custom loader (tests, dev replacements). Defaults to the lazy
|
|
8
|
-
* `import("@apps-in-toss/web-framework")` loader. The default never
|
|
9
|
-
* guesses the environment or substitutes a fake login.
|
|
10
|
-
*/
|
|
11
|
-
framework?: IdentityPlatformSdk | IdentityPlatformLoader;
|
|
12
|
-
}
|
|
13
|
-
export interface WebIdentity {
|
|
14
|
-
/** Starts the platform login and validates/preserves the result. */
|
|
15
|
-
login(): Promise<SdkLoginResult>;
|
|
16
|
-
/** Looks up the SDK-issued anonymous key; never fabricates one. */
|
|
17
|
-
getAnonymousKey(): Promise<SdkAnonymousKey>;
|
|
18
|
-
}
|
|
19
|
-
export declare function createWebIdentity(options?: WebIdentityOptions): WebIdentity;
|
|
20
|
-
export interface WebStorageOptions {
|
|
21
|
-
/**
|
|
22
|
-
* Web framework injection: pass a module exposing Storage or a custom
|
|
23
|
-
* loader. Defaults to the lazy `import("@apps-in-toss/web-framework")`
|
|
24
|
-
* loader.
|
|
25
|
-
*/
|
|
26
|
-
framework?: StoragePlatformSdk | StoragePlatformLoader;
|
|
27
|
-
}
|
|
28
|
-
/** SDK-backed storage for web with the same verbatim-key contract as /rn. */
|
|
29
|
-
export declare function createWebStorage(options?: WebStorageOptions): SdkStorage;
|
|
30
|
-
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/web/identity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EAGzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,mBAAmB,GAAG,sBAAsB,CAAC;CAC1D;AAED,MAAM,WAAW,WAAW;IAC1B,oEAAoE;IACpE,KAAK,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IACjC,mEAAmE;IACnE,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;CAC7C;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,WAAW,CAa/E;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,SAAS,CAAC,EAAE,kBAAkB,GAAG,qBAAqB,CAAC;CACxD;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,UAAU,CA8B5E"}
|
package/dist/web/index.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Web adapters for `@ait-kit/sdk`.
|
|
3
|
-
*
|
|
4
|
-
* Requires the official `@apps-in-toss/web-framework` package (declared as
|
|
5
|
-
* an optional peer): it is imported lazily at first use, so this entry
|
|
6
|
-
* never requires the React Native SDK, and the React Native entry never
|
|
7
|
-
* requires this one.
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* import { createWebIap } from "@ait-kit/sdk/web";
|
|
11
|
-
*
|
|
12
|
-
* const iap = createWebIap({
|
|
13
|
-
* // Resolve only after YOUR server verified the order and persisted the
|
|
14
|
-
* // grant (see the ait-kit server packages for verification flows).
|
|
15
|
-
* grant: async ({ orderId, sku }) => {
|
|
16
|
-
* const response = await fetch("/api/iap/grant", {
|
|
17
|
-
* method: "POST",
|
|
18
|
-
* body: JSON.stringify({ orderId, sku })
|
|
19
|
-
* });
|
|
20
|
-
* if (!response.ok) {
|
|
21
|
-
* // Resolve-only-on-success is part of the contract: never report a
|
|
22
|
-
* // grant your server did not verify and persist.
|
|
23
|
-
* throw new Error(`grant request failed: HTTP ${response.status}`);
|
|
24
|
-
* }
|
|
25
|
-
* }
|
|
26
|
-
* });
|
|
27
|
-
* const result = await iap.purchaseOneTime("SKU_100_COINS");
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
import { type IapAdapterOptions, type IapRecoveryResult } from "../iap/adapter.js";
|
|
31
|
-
import type { IapPlatformLoader, PartialIapPlatformSdk } from "../iap/platform-contract.js";
|
|
32
|
-
import type { WebIapFramework } from "./iap-contract.js";
|
|
33
|
-
export interface WebIapOptions extends Omit<IapAdapterOptions, "loader"> {
|
|
34
|
-
/**
|
|
35
|
-
* Web framework injection: pass an `IAP` module instance or a custom
|
|
36
|
-
* loader (tests/consumers). Defaults to the lazy
|
|
37
|
-
* `import("@apps-in-toss/web-framework")` loader.
|
|
38
|
-
*/
|
|
39
|
-
framework?: WebIapFramework["IAP"] | PartialIapPlatformSdk | IapPlatformLoader;
|
|
40
|
-
}
|
|
41
|
-
export type WebIap = ReturnType<typeof createWebIap>;
|
|
42
|
-
export type { IapRecoveryResult };
|
|
43
|
-
export { createWebIdentity, type WebIdentity, type WebIdentityOptions } from "./identity.js";
|
|
44
|
-
export { createWebStorage, type WebStorageOptions } from "./identity.js";
|
|
45
|
-
export { createWebNotification, createWebShare, type WebNotification, type WebNotificationOptions, type WebShare, type WebShareOptions } from "./notify-share.js";
|
|
46
|
-
export declare function createWebIap(options: WebIapOptions): import("../iap/adapter.js").IapAdapter;
|
|
47
|
-
export { createWebReview, type WebReviewOptions } from "./review.js";
|
|
48
|
-
export { createWebPromotion, type WebPromotionOptions } from "./promotion.js";
|
|
49
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/web/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAoB,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACrG,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAE5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IACtE;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG,qBAAqB,GAAG,iBAAiB,CAAC;CAChF;AAED,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACrD,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EACb,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAE3B,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,0CAGlD;AAED,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type SdkNotificationAgreementResult, type SdkShareUiResult } from "../index.js";
|
|
2
|
-
import { type NotificationPlatformLoader, type NotificationPlatformSdk } from "../notification/platform-contract.js";
|
|
3
|
-
import { type SharePlatformLoader, type SharePlatformSdk } from "../share/platform-contract.js";
|
|
4
|
-
export interface WebNotificationOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Web framework injection: pass a module exposing Notification or a
|
|
7
|
-
* custom loader. Defaults to the lazy `import("@apps-in-toss/web-framework")`
|
|
8
|
-
* loader.
|
|
9
|
-
*/
|
|
10
|
-
framework?: NotificationPlatformSdk | NotificationPlatformLoader;
|
|
11
|
-
/** Overall deadline per agreement request (default 60000ms; 0 disables). */
|
|
12
|
-
timeoutMs?: number;
|
|
13
|
-
}
|
|
14
|
-
export interface WebNotification {
|
|
15
|
-
/** See ReactNativeNotification.requestAgreement for the contract. */
|
|
16
|
-
requestAgreement(templateCode: string): Promise<SdkNotificationAgreementResult>;
|
|
17
|
-
}
|
|
18
|
-
export declare function createWebNotification(options?: WebNotificationOptions): WebNotification;
|
|
19
|
-
export interface WebShareOptions {
|
|
20
|
-
/**
|
|
21
|
-
* Web framework injection: pass a module exposing Share or a custom
|
|
22
|
-
* loader. Defaults to the lazy `import("@apps-in-toss/web-framework")`
|
|
23
|
-
* loader.
|
|
24
|
-
*/
|
|
25
|
-
framework?: SharePlatformSdk | SharePlatformLoader;
|
|
26
|
-
}
|
|
27
|
-
export interface WebShare {
|
|
28
|
-
/** Creates a share link for an `intoss://` deeplink path. */
|
|
29
|
-
createLink(path: string, ogImageUrl?: string): Promise<string>;
|
|
30
|
-
/**
|
|
31
|
-
* Opens the native share sheet; `completed` means only that the SDK share
|
|
32
|
-
* call finished — it never proves the user shared and never grants reward
|
|
33
|
-
* eligibility.
|
|
34
|
-
*/
|
|
35
|
-
sendMessage(message: string): Promise<SdkShareUiResult>;
|
|
36
|
-
}
|
|
37
|
-
export declare function createWebShare(options?: WebShareOptions): WebShare;
|
|
38
|
-
//# sourceMappingURL=notify-share.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notify-share.d.ts","sourceRoot":"","sources":["../../src/web/notify-share.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAE7B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAGtB,MAAM,+BAA+B,CAAC;AAIvC,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,SAAS,CAAC,EAAE,uBAAuB,GAAG,0BAA0B,CAAC;IACjE,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;CACjF;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CAa3F;AAED,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,SAAS,CAAC,EAAE,gBAAgB,GAAG,mBAAmB,CAAC;CACpD;AAED,MAAM,WAAW,QAAQ;IACvB,6DAA6D;IAC7D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/D;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACzD;AAED,wBAAgB,cAAc,CAAC,OAAO,GAAE,eAAoB,GAAG,QAAQ,CAwCtE"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type PlatformLoader, type PlatformLoadResult } from "../platform-loader.js";
|
|
2
|
-
/** Lazy platform-local import followed by capability-specific selection. */
|
|
3
|
-
export declare function createWebPlatformLoader<T>(select: (module: typeof import("@apps-in-toss/web-framework")) => PlatformLoadResult<T>, includeErrorDetails?: boolean): PlatformLoader<T>;
|
|
4
|
-
//# sourceMappingURL=platform-loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform-loader.d.ts","sourceRoot":"","sources":["../../src/web/platform-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACvI,4EAA4E;AAC5E,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,MAAM,EAAE,CAAC,MAAM,EAAE,cAAc,6BAA6B,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,EACvF,mBAAmB,UAAO,GACzB,cAAc,CAAC,CAAC,CAAC,CAKnB"}
|
package/dist/web/promotion.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { PromotionAdapter, PromotionPlatformLoader, PromotionPlatformSdk } from "../promotion/platform-contract.js";
|
|
2
|
-
export interface WebPromotionOptions {
|
|
3
|
-
/** Shared Promotion contract or async loader; defaults to the official SDK. */
|
|
4
|
-
framework?: PromotionPlatformSdk | PromotionPlatformLoader;
|
|
5
|
-
/** Overall wait deadline; 0 (default) disables it. Timeout does not cancel payment. */
|
|
6
|
-
timeoutMs?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare function createWebPromotion(options?: WebPromotionOptions): PromotionAdapter;
|
|
9
|
-
//# sourceMappingURL=promotion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promotion.d.ts","sourceRoot":"","sources":["../../src/web/promotion.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzH,MAAM,WAAW,mBAAmB;IAClC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,oBAAoB,GAAG,uBAAuB,CAAC;IAC3D,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,gBAAgB,CAEtF"}
|
package/dist/web/review.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ReviewAdapter, ReviewPlatformLoader, ReviewPlatformSdk } from "../review/platform-contract.js";
|
|
2
|
-
export interface WebReviewOptions {
|
|
3
|
-
/** Shared contract injection, or a loader; defaults to the lazy official SDK. */
|
|
4
|
-
framework?: ReviewPlatformSdk | ReviewPlatformLoader;
|
|
5
|
-
}
|
|
6
|
-
export declare function createWebReview(options?: WebReviewOptions): ReviewAdapter;
|
|
7
|
-
//# sourceMappingURL=review.d.ts.map
|
package/dist/web/review.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/web/review.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAE7G,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,SAAS,CAAC,EAAE,iBAAiB,GAAG,oBAAoB,CAAC;CACtD;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,gBAAqB,GAAG,aAAa,CAE7E"}
|
package/dist/web/review.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { resolvePlatformLoader } from "../platform-loader.js";
|
|
2
|
-
import { createWebPlatformLoader } from "./platform-loader.js";
|
|
3
|
-
import { createReviewAdapter } from "../review/adapter.js";
|
|
4
|
-
export function createWebReview(options = {}) {
|
|
5
|
-
return createReviewAdapter(resolvePlatformLoader(options.framework, createDefaultReviewLoader));
|
|
6
|
-
}
|
|
7
|
-
function createDefaultReviewLoader() {
|
|
8
|
-
return createWebPlatformLoader(module => ({ available: true, module: module }), false);
|
|
9
|
-
}
|
|
File without changes
|