@cloudparse/up-miniapps-sdk 0.9.0 → 0.11.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/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.cjs +31 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -2
- package/dist/index.d.ts +72 -2
- package/dist/index.js +31 -5
- package/dist/index.js.map +1 -1
- package/dist/style.css +3 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3665,7 +3665,7 @@ var RoutingService = {
|
|
|
3665
3665
|
};
|
|
3666
3666
|
|
|
3667
3667
|
// package.json
|
|
3668
|
-
var version = "0.
|
|
3668
|
+
var version = "0.11.0";
|
|
3669
3669
|
|
|
3670
3670
|
// src/sdk.ts
|
|
3671
3671
|
function deepFreeze(obj) {
|
|
@@ -3859,9 +3859,22 @@ var MiniAppSDK = class {
|
|
|
3859
3859
|
/**
|
|
3860
3860
|
* Performs a network request via the host shell.
|
|
3861
3861
|
* @param options Request method, URL, headers, and body.
|
|
3862
|
+
*
|
|
3863
|
+
* Real bug, caught by reviewer-strict: `options.timeoutMs` only ever
|
|
3864
|
+
* reached the shell's own `fetchWithTimeout` call — this `bridge.send`
|
|
3865
|
+
* has an entirely separate client-side promise timeout (its own
|
|
3866
|
+
* `timeoutMs` param, default 30000ms) waiting for the native reply,
|
|
3867
|
+
* previously left at that default regardless of what `options.timeoutMs`
|
|
3868
|
+
* said. A slow-but-legitimate call given a longer `options.timeoutMs`
|
|
3869
|
+
* (e.g. 50000ms for an LLM-backed endpoint) would still get this
|
|
3870
|
+
* bridge-level promise rejected ("Bridge request timeout") at 30s,
|
|
3871
|
+
* reintroducing the exact same "aborted before it could finish" bug
|
|
3872
|
+
* this field exists to fix, one layer up. Forwarding it here means both
|
|
3873
|
+
* ceilings move together; omitted (`undefined`, every other caller)
|
|
3874
|
+
* falls through to `send`'s own unchanged 30000ms default.
|
|
3862
3875
|
*/
|
|
3863
3876
|
request: async (options) => {
|
|
3864
|
-
return this.bridge.send("NETWORK_REQUEST", options);
|
|
3877
|
+
return this.bridge.send("NETWORK_REQUEST", options, options.timeoutMs);
|
|
3865
3878
|
}
|
|
3866
3879
|
});
|
|
3867
3880
|
/**
|
|
@@ -3933,7 +3946,19 @@ var MiniAppSDK = class {
|
|
|
3933
3946
|
* Configures native scroll behaviors like Pull-to-Refresh and Infinite Scroll.
|
|
3934
3947
|
* @param config Scroll configuration for top/bottom detection.
|
|
3935
3948
|
*/
|
|
3936
|
-
setScrollConfig: (config) => this.bridge.send("SET_SCROLL_CONFIG", config)
|
|
3949
|
+
setScrollConfig: (config) => this.bridge.send("SET_SCROLL_CONFIG", config),
|
|
3950
|
+
/**
|
|
3951
|
+
* Shows or hides the host's status bar / navigation bar while this
|
|
3952
|
+
* Mini-App is active — e.g. an immersive full-bleed map or video view.
|
|
3953
|
+
* Merges into any existing override: a key you omit keeps its current
|
|
3954
|
+
* value, pass `false` explicitly to un-hide a bar you'd previously
|
|
3955
|
+
* hidden. The host resets any override back to its own default the
|
|
3956
|
+
* moment this Mini-App stops being the active screen (exit, or the
|
|
3957
|
+
* app backgrounding/locking) — it never outlives this session and can
|
|
3958
|
+
* never keep a bar visible during an actual lock/security screen.
|
|
3959
|
+
* @param config Which bars to hide (`true`) or explicitly show (`false`).
|
|
3960
|
+
*/
|
|
3961
|
+
setSystemBarsHidden: (config) => this.bridge.send("SET_SYSTEM_BARS_HIDDEN", config)
|
|
3937
3962
|
});
|
|
3938
3963
|
/**
|
|
3939
3964
|
* Debug controls
|
|
@@ -4503,7 +4528,7 @@ var BridgeMocker = ({
|
|
|
4503
4528
|
transactionId: `tx_${Math.random().toString(36).slice(2)}`
|
|
4504
4529
|
});
|
|
4505
4530
|
}
|
|
4506
|
-
if (type === "TRIGGER_HAPTIC" || type === "EXIT" || type === "UPDATE_CONTEXT") {
|
|
4531
|
+
if (type === "TRIGGER_HAPTIC" || type === "EXIT" || type === "UPDATE_CONTEXT" || type === "SET_SYSTEM_BARS_HIDDEN") {
|
|
4507
4532
|
return Promise.resolve({ success: true });
|
|
4508
4533
|
}
|
|
4509
4534
|
return originalSend(type, payload);
|
|
@@ -5690,10 +5715,11 @@ function createApiService(options) {
|
|
|
5690
5715
|
method: "PATCH",
|
|
5691
5716
|
url: buildUrl(getBaseUrl(), path)
|
|
5692
5717
|
}),
|
|
5693
|
-
post: (path, body) => sdk.network.request({
|
|
5718
|
+
post: (path, body, timeoutMs) => sdk.network.request({
|
|
5694
5719
|
body,
|
|
5695
5720
|
headers: { "Content-Type": "application/json" },
|
|
5696
5721
|
method: "POST",
|
|
5722
|
+
timeoutMs,
|
|
5697
5723
|
url: buildUrl(getBaseUrl(), path)
|
|
5698
5724
|
}),
|
|
5699
5725
|
get wsUrl() {
|