@layers/amba-core 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layers/amba-core",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "amba SDK runtime — shared client core used by @layers/amba-web, @layers/amba-node, @layers/amba-react-native. Internal dependency; install one of those packages instead.",
5
5
  "type": "module",
6
6
  "main": "./pkg/amba_core.js",
@@ -8,7 +8,10 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./pkg/amba_core.d.ts",
11
- "import": "./pkg/amba_core.js"
11
+ "react-native": "./pkg-rn/amba_core.js",
12
+ "browser": "./pkg/amba_core.js",
13
+ "import": "./pkg/amba_core.js",
14
+ "default": "./pkg/amba_core.js"
12
15
  },
13
16
  "./wasm": "./pkg/amba_core_bg.wasm"
14
17
  },
@@ -17,10 +20,16 @@
17
20
  "pkg/amba_core_bg.wasm",
18
21
  "pkg/amba_core.d.ts",
19
22
  "pkg/amba_core_bg.wasm.d.ts",
23
+ "pkg-rn/amba_core.js",
24
+ "pkg-rn/amba_core_bg.js",
25
+ "pkg-rn/amba_core_bg.wasm.js",
26
+ "pkg-rn/amba_core.d.ts",
27
+ "pkg-rn/amba_core_bg.wasm.d.ts",
20
28
  "README.md"
21
29
  ],
22
30
  "sideEffects": [
23
- "./pkg/snippets/*"
31
+ "./pkg/snippets/*",
32
+ "./pkg-rn/amba_core_bg.wasm.js"
24
33
  ],
25
34
  "license": "MIT",
26
35
  "repository": {
@@ -31,11 +40,16 @@
31
40
  "publishConfig": {
32
41
  "access": "public"
33
42
  },
43
+ "devDependencies": {
44
+ "binaryen": "129.0.0"
45
+ },
34
46
  "engines": {
35
47
  "node": ">=20.0.0"
36
48
  },
37
49
  "scripts": {
38
- "build": "wasm-pack build ../../core --target web --out-name amba_core --out-dir ../packages/core/pkg && node ./scripts/verify-pkg.mjs",
50
+ "build": "pnpm run build:web && pnpm run build:rn && node ./scripts/verify-pkg.mjs",
51
+ "build:web": "wasm-pack build ../../core --target web --out-name amba_core --out-dir ../packages/core/pkg",
52
+ "build:rn": "node ./scripts/build-rn.mjs",
39
53
  "build:bundler": "wasm-pack build ../../core --target bundler --out-name amba_core --out-dir ../packages/core/pkg-bundler",
40
54
  "build:nodejs": "wasm-pack build ../../core --target nodejs --out-name amba_core --out-dir ../packages/core/pkg-node",
41
55
  "verify:pkg": "node ./scripts/verify-pkg.mjs"
@@ -0,0 +1,130 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * JS-callable opaque handle to [`AmbaCore`].
6
+ *
7
+ * The JS side instantiates it via `AmbaCoreWasm.init(configJson, fetchFn)`
8
+ * and stashes it for the lifetime of the page.
9
+ */
10
+ export class AmbaCoreWasm {
11
+ private constructor();
12
+ free(): void;
13
+ [Symbol.dispose](): void;
14
+ achievementsGetAll(): Promise<any>;
15
+ achievementsGetProgress(): Promise<any>;
16
+ aiAnthropicMessages(request_json: string): Promise<any>;
17
+ anonymousId(): string;
18
+ appUserId(): string | undefined;
19
+ catalogList(): Promise<any>;
20
+ challengesClaim(id: string): Promise<any>;
21
+ challengesGet(id: string): Promise<any>;
22
+ challengesGetActive(): Promise<any>;
23
+ challengesGetProgress(id: string): Promise<any>;
24
+ collectionsDelete(collection: string, id: string): Promise<any>;
25
+ collectionsFind(collection: string, options_json: string): Promise<any>;
26
+ collectionsFindOne(collection: string, id: string): Promise<any>;
27
+ collectionsInsert(collection: string, row_json: string): Promise<any>;
28
+ collectionsUpdate(collection: string, id: string, set_json: string): Promise<any>;
29
+ configFetch(): Promise<any>;
30
+ contentCreateItem(channel: string, item_json: string): Promise<any>;
31
+ contentGetItem(id: string): Promise<any>;
32
+ /**
33
+ * `channel` is optional; `limit` caps results per page; `cursor` is
34
+ * the server-issued opaque pagination token. Mirror the TS wrapper
35
+ * signature: getLibrary(channel?, { limit?, cursor? }).
36
+ */
37
+ contentGetLibrary(channel?: string | null, limit?: number | null, cursor?: string | null): Promise<any>;
38
+ /**
39
+ * `channel` is optional; when omitted, FFI defaults to `"default"` so
40
+ * single-channel apps can call `Amba.content.getToday()` without args.
41
+ */
42
+ contentGetToday(channel?: string | null): Promise<any>;
43
+ contentUpdateItem(id: string, state_json: string): Promise<any>;
44
+ currenciesGetBalance(): Promise<any>;
45
+ currenciesGetTransactions(currency_key: string): Promise<any>;
46
+ deepLinksCreate(params_json: string): Promise<any>;
47
+ deepLinksGet(short_code: string): Promise<any>;
48
+ entitlementsHas(name: string): Promise<any>;
49
+ entitlementsList(): Promise<any>;
50
+ feedsGetActivity(feed?: string | null, cursor?: string | null): Promise<any>;
51
+ flagsFetch(): Promise<any>;
52
+ friendsBlockUser(user_id: string): Promise<any>;
53
+ friendsGetFriends(): Promise<any>;
54
+ friendsGetList(): Promise<any>;
55
+ friendsRemoveBlock(friendship_id: string): Promise<any>;
56
+ friendsUnblockUser(user_id: string): Promise<any>;
57
+ groupsCreate(params_json: string): Promise<any>;
58
+ groupsDelete(id: string): Promise<any>;
59
+ groupsGet(id: string): Promise<any>;
60
+ groupsGetMembers(id: string): Promise<any>;
61
+ groupsInvite(id: string, user_id: string): Promise<any>;
62
+ groupsJoin(id: string): Promise<any>;
63
+ groupsLeave(id: string): Promise<any>;
64
+ groupsUpdate(id: string, patch_json: string): Promise<any>;
65
+ /**
66
+ * Initialize the SDK.
67
+ *
68
+ * `config_json`: JSON-stringified `AmbaConfig` (api_key, base_url,
69
+ * sdk_platform, sdk_wrapper_version, consent_required, debug).
70
+ *
71
+ * `fetch_fn`: a JS function `(url, init) => Promise<Response>`
72
+ * matching the global `fetch` signature. The wrapper passes
73
+ * `window.fetch.bind(window)` or a server-side polyfill.
74
+ */
75
+ static init(config_json: string, fetch_fn: Function): AmbaCoreWasm;
76
+ inventoryConsume(request_json: string): Promise<any>;
77
+ inventoryGetItem(id: string): Promise<any>;
78
+ inventoryGetItems(): Promise<any>;
79
+ inventoryPurchase(request_json: string): Promise<any>;
80
+ isAuthenticated(): boolean;
81
+ leaderboardsGet(key: string): Promise<any>;
82
+ leaderboardsGetEntries(key: string, limit?: number | null): Promise<any>;
83
+ leaderboardsGetMyRank(key: string): Promise<any>;
84
+ me(): Promise<any>;
85
+ messagingGetConversations(): Promise<any>;
86
+ messagingGetMessage(id: string): Promise<any>;
87
+ messagingSendMessage(request_json: string): Promise<any>;
88
+ moderationGetReportStatus(id: string): Promise<any>;
89
+ moderationReportContent(request_json: string): Promise<any>;
90
+ moderationReportUser(request_json: string): Promise<any>;
91
+ onboardingComplete(): Promise<any>;
92
+ onboardingGetStatus(): Promise<any>;
93
+ onboardingNextStep(payload_json: string): Promise<any>;
94
+ onboardingSkipStep(): Promise<any>;
95
+ pushGetTokens(): Promise<any>;
96
+ pushRegister(token: string, platform: string, bundle_id?: string | null): Promise<any>;
97
+ pushSubscribe(topic: string): Promise<any>;
98
+ pushUnregister(token: string): Promise<any>;
99
+ pushUnsubscribe(topic: string): Promise<any>;
100
+ referralsClaimReferral(code: string): Promise<any>;
101
+ referralsCreate(code?: string | null, max_uses?: number | null): Promise<any>;
102
+ referralsGetReferralCode(): Promise<any>;
103
+ refreshSession(): Promise<any>;
104
+ reviewsCreate(params_json: string): Promise<any>;
105
+ reviewsDelete(id: string): Promise<any>;
106
+ reviewsList(target_type: string, target_id: string): Promise<any>;
107
+ reviewsUpdate(id: string, patch_json: string): Promise<any>;
108
+ rolesGetMyRoles(): Promise<any>;
109
+ rolesHasPermission(permission: string): Promise<any>;
110
+ setDebug(enabled: boolean): void;
111
+ signInAnonymously(): Promise<any>;
112
+ signInWithEmail(email: string, password: string): Promise<any>;
113
+ signInWithSocial(provider: string, id_token: string): Promise<any>;
114
+ signOut(rotate_anonymous_id: boolean): Promise<any>;
115
+ signUpWithEmail(email: string, password: string): Promise<any>;
116
+ storageCommit(upload_id: string, asset_id: string): Promise<any>;
117
+ storagePresign(bucket: string, filename: string, mime_type: string, size_bytes: number, retention_days?: number | null): Promise<any>;
118
+ storesGetPurchaseOptions(store_key: string): Promise<any>;
119
+ storesList(): Promise<any>;
120
+ storesPurchase(store_key: string, purchase_option_id: string, receipt_json: string): Promise<any>;
121
+ streaksGetAll(): Promise<any>;
122
+ streaksQualify(streak_key: string): Promise<any>;
123
+ /**
124
+ * Track an event. Returns a Promise that resolves to undefined on success.
125
+ */
126
+ track(event: string, properties_json?: string | null): Promise<any>;
127
+ xpClaim(grant_key: string): Promise<any>;
128
+ xpGetBalance(): Promise<any>;
129
+ xpGetHistory(limit?: number | null): Promise<any>;
130
+ }
@@ -0,0 +1,9 @@
1
+ /* @ts-self-types="./amba_core.d.ts" */
2
+ import * as wasm from "./amba_core_bg.wasm.js";
3
+ import { __wbg_set_wasm } from "./amba_core_bg.js";
4
+
5
+ __wbg_set_wasm(wasm);
6
+
7
+ export {
8
+ AmbaCoreWasm
9
+ } from "./amba_core_bg.js";