@cloudparse/up-miniapps-sdk 0.2.3 → 0.2.5

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.cjs CHANGED
@@ -2704,7 +2704,10 @@ var MapInternal = ({
2704
2704
  return Math.ceil(routeDurationSeconds * ratio / 60);
2705
2705
  })();
2706
2706
  const kmRemaining = remainingMeters / 1e3;
2707
- const progressValue = totalDist && totalDist > 0 ? Math.min(100, Math.max(0, (totalDist - remainingMeters) / totalDist * 100)) : 0;
2707
+ const progressValue = totalDist && totalDist > 0 ? Math.min(
2708
+ 100,
2709
+ Math.max(0, (totalDist - remainingMeters) / totalDist * 100)
2710
+ ) : 0;
2708
2711
  const showEtaData = navigationData && route ? {
2709
2712
  distanceRemainingKm: kmRemaining,
2710
2713
  etaMins,
@@ -3144,7 +3147,7 @@ var RoutingService = {
3144
3147
  };
3145
3148
 
3146
3149
  // package.json
3147
- var version = "0.2.3";
3150
+ var version = "0.2.5";
3148
3151
 
3149
3152
  // src/sdk.ts
3150
3153
  function deepFreeze(obj) {
@@ -3230,7 +3233,14 @@ var MiniAppSDK = class {
3230
3233
  * Fetch user profile data.
3231
3234
  * @param fields Optional list of specific fields to retrieve (e.g., ['fullName', 'username']).
3232
3235
  */
3233
- getProfile: (fields) => this.bridge.send("GET_USER_PROFILE", { fields })
3236
+ getProfile: (fields) => this.bridge.send("GET_USER_PROFILE", { fields }),
3237
+ /**
3238
+ * Fetch profile picture as a string of the current user, or a map of profile pictures from a list of user UUIDs.
3239
+ * @param uuids Optional list of user UUIDs.
3240
+ */
3241
+ getProfilePicture: ((uuids) => {
3242
+ return this.bridge.send("GET_PROFILE_PICTURE", { uuids: uuids || [] });
3243
+ })
3234
3244
  });
3235
3245
  /**
3236
3246
  * Explicit Permission Management.
@@ -3748,6 +3758,19 @@ var BridgeMocker = ({
3748
3758
  uuid: "mock-user-42"
3749
3759
  });
3750
3760
  }
3761
+ if (type === "GET_PROFILE_PICTURE") {
3762
+ const uuids = payload?.uuids || [];
3763
+ if (uuids.length === 0) {
3764
+ return Promise.resolve(
3765
+ `https://api.dicebear.com/9.x/rings/png?seed=dummy`
3766
+ );
3767
+ }
3768
+ const map = {};
3769
+ for (const uuid of uuids) {
3770
+ map[uuid] = `https://api.dicebear.com/9.x/rings/png?seed=${uuid}`;
3771
+ }
3772
+ return Promise.resolve(map);
3773
+ }
3751
3774
  if (type === "GET_FIDELITY_BALANCE") {
3752
3775
  return Promise.resolve({ balance: 1337, currency: "FPoints" });
3753
3776
  }