@aippy/runtime 0.4.1-dev.1 → 0.4.2-beta.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.
Files changed (45) hide show
  1. package/README.md +35 -6
  2. package/dist/ai/errors.d.ts +1 -0
  3. package/dist/ai/index.d.ts +2 -0
  4. package/dist/ai/index.js +22 -17
  5. package/dist/ai/viggle/generate.d.ts +67 -0
  6. package/dist/ai/viggle/models.d.ts +46 -0
  7. package/dist/ai/viggle/recovery.d.ts +12 -0
  8. package/dist/{app-version-checker-Bz7FrEZz.js → app-version-checker-YVIFbytA.js} +18 -17
  9. package/dist/bridge-K3HqQwdj.js +311 -0
  10. package/dist/container-message-gRiGPin4.js +56 -0
  11. package/dist/core/env.d.ts +2 -0
  12. package/dist/core/index.js +2 -2
  13. package/dist/core/parent-message.d.ts +5 -0
  14. package/dist/core/wallet-recharge.d.ts +16 -0
  15. package/dist/helper-CJ3YV3nf.js +748 -0
  16. package/dist/{hooks-D5lkty5r.js → hooks-CMKwSLcQ.js} +1 -1
  17. package/dist/index/index.js +66 -56
  18. package/dist/index.d.ts +1 -0
  19. package/dist/ministore/app-authorization.d.ts +9 -0
  20. package/dist/ministore/authorization.d.ts +6 -0
  21. package/dist/ministore/consume.d.ts +3 -0
  22. package/dist/ministore/errors.d.ts +18 -0
  23. package/dist/ministore/index.d.ts +19 -0
  24. package/dist/ministore/index.js +99 -0
  25. package/dist/ministore/order.d.ts +1 -0
  26. package/dist/ministore/purchase.d.ts +5 -0
  27. package/dist/ministore/queries.d.ts +14 -0
  28. package/dist/ministore/recharge.d.ts +12 -0
  29. package/dist/ministore/transport.d.ts +14 -0
  30. package/dist/ministore/types.d.ts +177 -0
  31. package/dist/ministore/update-item.d.ts +3 -0
  32. package/dist/ministore/validation.d.ts +19 -0
  33. package/dist/ministore.d.ts +2 -0
  34. package/dist/recharge-o5P-y8eV.js +1036 -0
  35. package/dist/tweaks/index.js +1 -1
  36. package/dist/{useTweaks-v5wEZGGm.js → useTweaks-C7BEMpV3.js} +21 -27
  37. package/dist/user/bridge.d.ts +3 -8
  38. package/dist/user/config.d.ts +2 -0
  39. package/dist/user/index.js +3 -3
  40. package/dist/utils/app-version-requirements.json.d.ts +4 -0
  41. package/dist/utils/index.js +1 -1
  42. package/package.json +15 -3
  43. package/dist/bridge-CtB9L5kL.js +0 -259
  44. package/dist/container-message-KgL1paGV.js +0 -56
  45. package/dist/helper-CZqFi-QF.js +0 -241
@@ -0,0 +1,56 @@
1
+ import { g as o, a as i } from "./bridge-K3HqQwdj.js";
2
+ const r = "0.4.2-beta.0", c = {
3
+ version: r
4
+ }, a = c.version, p = "@aippy/runtime";
5
+ function u() {
6
+ return {
7
+ name: p,
8
+ version: a,
9
+ buildTime: (/* @__PURE__ */ new Date()).toISOString()
10
+ };
11
+ }
12
+ function g(n) {
13
+ const { token: t, existingHeaders: s } = n, e = new Headers(s);
14
+ return e.set("Aippy-Runtime-Authorization", `Bearer ${t}`), e.set("Aippy-Runtime-SDK-Version", a), typeof navigator < "u" && navigator.userAgent && e.set("Aippy-Runtime-UA", navigator.userAgent), e;
15
+ }
16
+ async function m(n) {
17
+ const t = await o();
18
+ return g({ token: t, existingHeaders: n });
19
+ }
20
+ function y(n) {
21
+ if (!(typeof window > "u"))
22
+ try {
23
+ const t = window.webkit?.messageHandlers?.aippyListener;
24
+ if (t)
25
+ try {
26
+ const e = {
27
+ command: "container.message",
28
+ parameters: n
29
+ };
30
+ t.postMessage(e);
31
+ } catch {
32
+ console.warn("Failed to send container message to the native host");
33
+ }
34
+ const s = i();
35
+ if (s)
36
+ try {
37
+ const e = {
38
+ type: "container.message",
39
+ data: n
40
+ };
41
+ window.parent.postMessage(e, s);
42
+ } catch {
43
+ console.warn("Failed to send container message to the parent host");
44
+ }
45
+ } catch {
46
+ console.warn("Failed to send container message");
47
+ }
48
+ }
49
+ export {
50
+ p as S,
51
+ a as V,
52
+ m as a,
53
+ g as c,
54
+ u as g,
55
+ y as s
56
+ };
@@ -4,6 +4,8 @@
4
4
  * All environment-specific URLs live here — no other file should
5
5
  * hardcode aippy domain strings.
6
6
  */
7
+ /** @internal Runtime credentials may only be sent to these official API origins. */
8
+ export declare function isTrustedApiOrigin(origin: string): boolean;
7
9
  /**
8
10
  * Resolves the API base URL at runtime by inspecting the page hostname.
9
11
  *
@@ -1,7 +1,7 @@
1
1
  import { D as r, g as s, m as o } from "../config-B0A7gHQM.js";
2
- import { _ as t, r as i } from "../bridge-CtB9L5kL.js";
2
+ import { _ as t, r as i } from "../bridge-K3HqQwdj.js";
3
3
  import { A as R, a as E, E as c, b as m, c as A } from "../errors-B3bDbQbD.js";
4
- import { S as f, V as g, c as l, a as y, g as _, s as d } from "../container-message-KgL1paGV.js";
4
+ import { S as f, V as g, c as l, a as y, g as _, s as d } from "../container-message-gRiGPin4.js";
5
5
  import { A as D, C as O, R as F, a as I, p as S } from "../runtime-CmoG3v2m.js";
6
6
  export {
7
7
  D as AippyRuntime,
@@ -0,0 +1,5 @@
1
+ /** Browser-observed parent origin; never trust an origin supplied in a message. */
2
+ export declare function getParentOrigin(): string | undefined;
3
+ export declare function isParentMessage(event: MessageEvent, origin?: string | undefined): boolean;
4
+ /** Preserve native self-postMessage callbacks, but reject sibling/foreign frames. */
5
+ export declare function isHostMessage(event: MessageEvent): boolean;
@@ -0,0 +1,16 @@
1
+ /** Shared native recharge sheet tracking. No payment or balance is inferred here. */
2
+ export declare const WALLET_SHOW_RECHARGE = "wallet.showRecharge";
3
+ type Failure = 'unavailable' | 'busy' | 'cancelled' | 'timeout' | 'protocol' | 'bridge';
4
+ export declare class WalletRechargeError extends Error {
5
+ readonly type: Failure;
6
+ constructor(type: Failure, message: string);
7
+ }
8
+ /** Request GEM recharge guidance without waiting for funds or retrying an action. */
9
+ export declare function showNativeRecharge(): void;
10
+ /**
11
+ * At most one continuation owns a sheet. An existing unclaimed sheet may be joined.
12
+ * After timeout/abort, retain a drain-only listener until closed: no requestId
13
+ * exists, so opening another sheet earlier could mistake an old result for it.
14
+ */
15
+ export declare function waitForNativeRecharge(signal?: AbortSignal): Promise<boolean>;
16
+ export {};