@cloudparse/up-miniapps-sdk 0.5.7 → 0.6.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.d.cts CHANGED
@@ -1528,6 +1528,13 @@ declare class MiniAppSDK {
1528
1528
  * @param options The options to provide to the shell app
1529
1529
  */
1530
1530
  initialize(options: IInitializationOptions): Promise<IInitializationResponse>;
1531
+ /**
1532
+ * Returns the last known `env` (shell-provided config like `backendUrl`),
1533
+ * refreshed automatically by `initialize()` and every `UPDATE_CONTEXT`
1534
+ * push — read this instead of caching your own copy of `env` values.
1535
+ * Returns `null` before the first successful `initialize()`/context push.
1536
+ */
1537
+ getEnv<T extends Record<string, unknown> = Record<string, unknown>>(): T | null;
1531
1538
  /**
1532
1539
  * Registers a callback for a specific event from the native shell.
1533
1540
  * @param event The name of the event to listen for.
@@ -1548,4 +1555,57 @@ declare class MiniAppSDK {
1548
1555
  */
1549
1556
  declare const sdk: MiniAppSDK;
1550
1557
 
1551
- export { type BridgeMessageType, BridgeMocker, type BridgeMockerProps, type CenterCallbackParams, type CustomControl, DebugConsole, type DebugConsoleProps, type DeclarativeJourneyOptions, type DrawerState, type EtaData, type FidelityTransactionTypeType, type FlyToParams, GeolocationEvent, GlobalEvent, type HapticStyleType, type IBridgeEnvelope, type IContextState, type IEdgeInsets, type IFidelityBalance, type IFidelityHistoryParams, type IFidelityTransaction, type IGenerateQrCodeOptions, type IInitializationOptions, type IInitializationResponse, type ILocationData, type INetworkOptions, type INetworkResponse, type IPaymentRequest, type IPickImageResult, type ISaveImageResult, type IUserProfile, type LiveRoutingOptions, type LiveRoutingResult, type LocationStreamConfig, Map, MapControls, MapControlsContext, type MapControlsProps, type MapControlsState, type MapInsets, MapMenu, MapMenuDivider, type MapMenuDividerProps, MapMenuFooter, type MapMenuFooterProps, MapMenuItem, type MapMenuItemProps, type MapMenuProps, MapMenuTitle, type MapMenuTitleProps, type MapProps, type MenuItem, MiniAppSDK, MockLocationContext, type MockLocationContextType, type NetworkMethodType, type POI, QRScanner, type QRScannerProps, RouteLayer, type RouteLayerProps, RouteRequest, RouteResponse, RouteStep, type SDKEvent, SDKMapProvider, SDKProvider, type SDKProviderProps, type ScrollConfig, type StreamAccelerometerData, type StreamHeadingData, type StreamLocationData, type StreamUpdatePayload, type SwipeAxisPriority, SwipeCarousel, type SwipeCarouselItem, type SwipeCarouselProps, type SwipeCarouselVerticalDragConfig, UIEvent, type UseJourneyOptions, type UseJourneyResult, type UserLocationState, sdk as default, renderMap, sdk, useIsMocked, useJourney, useLiveRouting, useMapControls, useMockLocation, useRoute, useTrimmedRoute, useUserLocation };
1558
+ interface CreateApiServiceOptions {
1559
+ /**
1560
+ * Backend URL to use before the shell has ever supplied one via
1561
+ * `initialize()`/`UPDATE_CONTEXT`, or if a boot ever completes without
1562
+ * one (e.g. a degraded/standalone fallback). Should be the app's real
1563
+ * production backend, typically read from a build-time env var baked
1564
+ * via `.env.production` — never a local dev address, since that value
1565
+ * is what actually reaches the network if the live one is ever missing.
1566
+ */
1567
+ defaultBaseUrl: string;
1568
+ /** Same fallback role as `defaultBaseUrl`, for `wsUrl` instead of `baseUrl`. Optional — omit if this app derives its WS URL from `baseUrl` itself. */
1569
+ defaultWsBackendUrl?: string;
1570
+ }
1571
+ interface ApiServiceClient {
1572
+ /** Current backend URL — see `getBaseUrl`'s doc comment below for the full resolution order. */
1573
+ readonly baseUrl: string;
1574
+ /** Current WebSocket backend URL, same resolution order as `baseUrl` but reading the dedicated ws fields instead. `undefined` if neither the shell nor `defaultWsBackendUrl` ever supplied one. */
1575
+ readonly wsUrl: string | undefined;
1576
+ get<T = unknown>(path: string): Promise<INetworkResponse<T>>;
1577
+ post<T = unknown>(path: string, body?: unknown): Promise<INetworkResponse<T>>;
1578
+ patch<T = unknown>(path: string, body?: unknown): Promise<INetworkResponse<T>>;
1579
+ delete(path: string): Promise<INetworkResponse<void>>;
1580
+ graphqlQuery<T = unknown>(query: string, variables?: Record<string, unknown>): Promise<INetworkResponse<{
1581
+ data: T;
1582
+ errors?: {
1583
+ message: string;
1584
+ }[];
1585
+ }>>;
1586
+ }
1587
+ /**
1588
+ * Creates a small REST/GraphQL client that always proxies through
1589
+ * `sdk.network.request` and always resolves the backend URL LIVE — from
1590
+ * `window.__UP_BACKEND_URLS__` (earliest, synchronous, see
1591
+ * `getEarlyBackendUrl` above), then `sdk.getEnv()` (updated by
1592
+ * `initialize()`/`UPDATE_CONTEXT`) — never from a value cached at some
1593
+ * earlier point in the boot sequence. This is the fix for a real,
1594
+ * repeatedly reproduced bug: apps used to assign a mutable `baseUrl` field
1595
+ * imperatively from `initialize()`'s response / `UPDATE_CONTEXT`; if that
1596
+ * one assignment was ever skipped (e.g. the underlying bridge request
1597
+ * losing its response — see `Bridge.send`'s retry, which reduces but does
1598
+ * not entirely eliminate that risk) the field stayed wrong for the rest of
1599
+ * the session, silently sending requests to `defaultBaseUrl` instead.
1600
+ * Reading fresh here means the very next call after either source is
1601
+ * populated self-heals automatically, and there is no second, independent
1602
+ * copy of the URL that can go stale.
1603
+ *
1604
+ * Response shape is the raw `INetworkResponse<T>` (status/data/headers) —
1605
+ * this stays a thin transport client; app-specific response unwrapping,
1606
+ * error-message translation, etc. belong in each app's own thin wrapper
1607
+ * around this, not here.
1608
+ */
1609
+ declare function createApiService(options: CreateApiServiceOptions): ApiServiceClient;
1610
+
1611
+ export { type ApiServiceClient, type BridgeMessageType, BridgeMocker, type BridgeMockerProps, type CenterCallbackParams, type CreateApiServiceOptions, type CustomControl, DebugConsole, type DebugConsoleProps, type DeclarativeJourneyOptions, type DrawerState, type EtaData, type FidelityTransactionTypeType, type FlyToParams, GeolocationEvent, GlobalEvent, type HapticStyleType, type IBridgeEnvelope, type IContextState, type IEdgeInsets, type IFidelityBalance, type IFidelityHistoryParams, type IFidelityTransaction, type IGenerateQrCodeOptions, type IInitializationOptions, type IInitializationResponse, type ILocationData, type INetworkOptions, type INetworkResponse, type IPaymentRequest, type IPickImageResult, type ISaveImageResult, type IUserProfile, type LiveRoutingOptions, type LiveRoutingResult, type LocationStreamConfig, Map, MapControls, MapControlsContext, type MapControlsProps, type MapControlsState, type MapInsets, MapMenu, MapMenuDivider, type MapMenuDividerProps, MapMenuFooter, type MapMenuFooterProps, MapMenuItem, type MapMenuItemProps, type MapMenuProps, MapMenuTitle, type MapMenuTitleProps, type MapProps, type MenuItem, MiniAppSDK, MockLocationContext, type MockLocationContextType, type NetworkMethodType, type POI, QRScanner, type QRScannerProps, RouteLayer, type RouteLayerProps, RouteRequest, RouteResponse, RouteStep, type SDKEvent, SDKMapProvider, SDKProvider, type SDKProviderProps, type ScrollConfig, type StreamAccelerometerData, type StreamHeadingData, type StreamLocationData, type StreamUpdatePayload, type SwipeAxisPriority, SwipeCarousel, type SwipeCarouselItem, type SwipeCarouselProps, type SwipeCarouselVerticalDragConfig, UIEvent, type UseJourneyOptions, type UseJourneyResult, type UserLocationState, createApiService, sdk as default, renderMap, sdk, useIsMocked, useJourney, useLiveRouting, useMapControls, useMockLocation, useRoute, useTrimmedRoute, useUserLocation };
package/dist/index.d.ts CHANGED
@@ -1528,6 +1528,13 @@ declare class MiniAppSDK {
1528
1528
  * @param options The options to provide to the shell app
1529
1529
  */
1530
1530
  initialize(options: IInitializationOptions): Promise<IInitializationResponse>;
1531
+ /**
1532
+ * Returns the last known `env` (shell-provided config like `backendUrl`),
1533
+ * refreshed automatically by `initialize()` and every `UPDATE_CONTEXT`
1534
+ * push — read this instead of caching your own copy of `env` values.
1535
+ * Returns `null` before the first successful `initialize()`/context push.
1536
+ */
1537
+ getEnv<T extends Record<string, unknown> = Record<string, unknown>>(): T | null;
1531
1538
  /**
1532
1539
  * Registers a callback for a specific event from the native shell.
1533
1540
  * @param event The name of the event to listen for.
@@ -1548,4 +1555,57 @@ declare class MiniAppSDK {
1548
1555
  */
1549
1556
  declare const sdk: MiniAppSDK;
1550
1557
 
1551
- export { type BridgeMessageType, BridgeMocker, type BridgeMockerProps, type CenterCallbackParams, type CustomControl, DebugConsole, type DebugConsoleProps, type DeclarativeJourneyOptions, type DrawerState, type EtaData, type FidelityTransactionTypeType, type FlyToParams, GeolocationEvent, GlobalEvent, type HapticStyleType, type IBridgeEnvelope, type IContextState, type IEdgeInsets, type IFidelityBalance, type IFidelityHistoryParams, type IFidelityTransaction, type IGenerateQrCodeOptions, type IInitializationOptions, type IInitializationResponse, type ILocationData, type INetworkOptions, type INetworkResponse, type IPaymentRequest, type IPickImageResult, type ISaveImageResult, type IUserProfile, type LiveRoutingOptions, type LiveRoutingResult, type LocationStreamConfig, Map, MapControls, MapControlsContext, type MapControlsProps, type MapControlsState, type MapInsets, MapMenu, MapMenuDivider, type MapMenuDividerProps, MapMenuFooter, type MapMenuFooterProps, MapMenuItem, type MapMenuItemProps, type MapMenuProps, MapMenuTitle, type MapMenuTitleProps, type MapProps, type MenuItem, MiniAppSDK, MockLocationContext, type MockLocationContextType, type NetworkMethodType, type POI, QRScanner, type QRScannerProps, RouteLayer, type RouteLayerProps, RouteRequest, RouteResponse, RouteStep, type SDKEvent, SDKMapProvider, SDKProvider, type SDKProviderProps, type ScrollConfig, type StreamAccelerometerData, type StreamHeadingData, type StreamLocationData, type StreamUpdatePayload, type SwipeAxisPriority, SwipeCarousel, type SwipeCarouselItem, type SwipeCarouselProps, type SwipeCarouselVerticalDragConfig, UIEvent, type UseJourneyOptions, type UseJourneyResult, type UserLocationState, sdk as default, renderMap, sdk, useIsMocked, useJourney, useLiveRouting, useMapControls, useMockLocation, useRoute, useTrimmedRoute, useUserLocation };
1558
+ interface CreateApiServiceOptions {
1559
+ /**
1560
+ * Backend URL to use before the shell has ever supplied one via
1561
+ * `initialize()`/`UPDATE_CONTEXT`, or if a boot ever completes without
1562
+ * one (e.g. a degraded/standalone fallback). Should be the app's real
1563
+ * production backend, typically read from a build-time env var baked
1564
+ * via `.env.production` — never a local dev address, since that value
1565
+ * is what actually reaches the network if the live one is ever missing.
1566
+ */
1567
+ defaultBaseUrl: string;
1568
+ /** Same fallback role as `defaultBaseUrl`, for `wsUrl` instead of `baseUrl`. Optional — omit if this app derives its WS URL from `baseUrl` itself. */
1569
+ defaultWsBackendUrl?: string;
1570
+ }
1571
+ interface ApiServiceClient {
1572
+ /** Current backend URL — see `getBaseUrl`'s doc comment below for the full resolution order. */
1573
+ readonly baseUrl: string;
1574
+ /** Current WebSocket backend URL, same resolution order as `baseUrl` but reading the dedicated ws fields instead. `undefined` if neither the shell nor `defaultWsBackendUrl` ever supplied one. */
1575
+ readonly wsUrl: string | undefined;
1576
+ get<T = unknown>(path: string): Promise<INetworkResponse<T>>;
1577
+ post<T = unknown>(path: string, body?: unknown): Promise<INetworkResponse<T>>;
1578
+ patch<T = unknown>(path: string, body?: unknown): Promise<INetworkResponse<T>>;
1579
+ delete(path: string): Promise<INetworkResponse<void>>;
1580
+ graphqlQuery<T = unknown>(query: string, variables?: Record<string, unknown>): Promise<INetworkResponse<{
1581
+ data: T;
1582
+ errors?: {
1583
+ message: string;
1584
+ }[];
1585
+ }>>;
1586
+ }
1587
+ /**
1588
+ * Creates a small REST/GraphQL client that always proxies through
1589
+ * `sdk.network.request` and always resolves the backend URL LIVE — from
1590
+ * `window.__UP_BACKEND_URLS__` (earliest, synchronous, see
1591
+ * `getEarlyBackendUrl` above), then `sdk.getEnv()` (updated by
1592
+ * `initialize()`/`UPDATE_CONTEXT`) — never from a value cached at some
1593
+ * earlier point in the boot sequence. This is the fix for a real,
1594
+ * repeatedly reproduced bug: apps used to assign a mutable `baseUrl` field
1595
+ * imperatively from `initialize()`'s response / `UPDATE_CONTEXT`; if that
1596
+ * one assignment was ever skipped (e.g. the underlying bridge request
1597
+ * losing its response — see `Bridge.send`'s retry, which reduces but does
1598
+ * not entirely eliminate that risk) the field stayed wrong for the rest of
1599
+ * the session, silently sending requests to `defaultBaseUrl` instead.
1600
+ * Reading fresh here means the very next call after either source is
1601
+ * populated self-heals automatically, and there is no second, independent
1602
+ * copy of the URL that can go stale.
1603
+ *
1604
+ * Response shape is the raw `INetworkResponse<T>` (status/data/headers) —
1605
+ * this stays a thin transport client; app-specific response unwrapping,
1606
+ * error-message translation, etc. belong in each app's own thin wrapper
1607
+ * around this, not here.
1608
+ */
1609
+ declare function createApiService(options: CreateApiServiceOptions): ApiServiceClient;
1610
+
1611
+ export { type ApiServiceClient, type BridgeMessageType, BridgeMocker, type BridgeMockerProps, type CenterCallbackParams, type CreateApiServiceOptions, type CustomControl, DebugConsole, type DebugConsoleProps, type DeclarativeJourneyOptions, type DrawerState, type EtaData, type FidelityTransactionTypeType, type FlyToParams, GeolocationEvent, GlobalEvent, type HapticStyleType, type IBridgeEnvelope, type IContextState, type IEdgeInsets, type IFidelityBalance, type IFidelityHistoryParams, type IFidelityTransaction, type IGenerateQrCodeOptions, type IInitializationOptions, type IInitializationResponse, type ILocationData, type INetworkOptions, type INetworkResponse, type IPaymentRequest, type IPickImageResult, type ISaveImageResult, type IUserProfile, type LiveRoutingOptions, type LiveRoutingResult, type LocationStreamConfig, Map, MapControls, MapControlsContext, type MapControlsProps, type MapControlsState, type MapInsets, MapMenu, MapMenuDivider, type MapMenuDividerProps, MapMenuFooter, type MapMenuFooterProps, MapMenuItem, type MapMenuItemProps, type MapMenuProps, MapMenuTitle, type MapMenuTitleProps, type MapProps, type MenuItem, MiniAppSDK, MockLocationContext, type MockLocationContextType, type NetworkMethodType, type POI, QRScanner, type QRScannerProps, RouteLayer, type RouteLayerProps, RouteRequest, RouteResponse, RouteStep, type SDKEvent, SDKMapProvider, SDKProvider, type SDKProviderProps, type ScrollConfig, type StreamAccelerometerData, type StreamHeadingData, type StreamLocationData, type StreamUpdatePayload, type SwipeAxisPriority, SwipeCarousel, type SwipeCarouselItem, type SwipeCarouselProps, type SwipeCarouselVerticalDragConfig, UIEvent, type UseJourneyOptions, type UseJourneyResult, type UserLocationState, createApiService, sdk as default, renderMap, sdk, useIsMocked, useJourney, useLiveRouting, useMapControls, useMockLocation, useRoute, useTrimmedRoute, useUserLocation };
package/dist/index.js CHANGED
@@ -63,6 +63,8 @@ var Button = React.forwardRef(
63
63
  Button.displayName = "Button";
64
64
 
65
65
  // src/bridge.ts
66
+ var BridgeTimeoutError = class extends Error {
67
+ };
66
68
  var Bridge = class {
67
69
  callbacks = /* @__PURE__ */ new Map();
68
70
  eventListeners = /* @__PURE__ */ new Map();
@@ -133,18 +135,32 @@ var Bridge = class {
133
135
  * @param type The action type (e.g., "GET_LOCATION").
134
136
  * @param payload Data associated with the action.
135
137
  * @param timeoutMs Time in milliseconds to wait for a response before rejecting.
138
+ * @param retries Number of additional attempts if a request times out (default 1 — one retry).
139
+ * Exists because the response for a request can be lost in transit — e.g. the host's
140
+ * injected response script running before this WebView's own `message` listener has
141
+ * attached, worse under rapid mount/unmount cycles — with no application-visible symptom
142
+ * other than the full 30s timeout. A blind retry self-heals that class of loss without
143
+ * needing to diagnose which specific transport race dropped the original message; every
144
+ * call site benefits automatically instead of each consumer app hand-rolling its own
145
+ * retry-after-catch logic (which previously only covered `initialize()`, and imperfectly).
136
146
  * @returns A promise that resolves with the native response.
137
147
  */
138
- send(type, payload, timeoutMs = 3e4) {
148
+ send(type, payload, timeoutMs = 3e4, retries = 1) {
139
149
  if (!this.isNative()) {
140
150
  return this.handleMockMessage(type, payload);
141
151
  }
152
+ return this.sendOnce(type, payload, timeoutMs).catch((err) => {
153
+ if (retries <= 0 || !(err instanceof BridgeTimeoutError)) throw err;
154
+ return this.send(type, payload, timeoutMs, retries - 1);
155
+ });
156
+ }
157
+ sendOnce(type, payload, timeoutMs) {
142
158
  return new Promise((resolve, reject) => {
143
159
  const callbackId = `${type}_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
144
160
  const timeout = setTimeout(() => {
145
161
  if (this.callbacks.has(callbackId)) {
146
162
  this.callbacks.delete(callbackId);
147
- reject(new Error(`Bridge request timeout: ${type}`));
163
+ reject(new BridgeTimeoutError(`Bridge request timeout: ${type}`));
148
164
  }
149
165
  }, timeoutMs);
150
166
  this.callbacks.set(callbackId, {
@@ -3458,7 +3474,7 @@ var loadImage2 = (src) => new Promise((resolve, reject) => {
3458
3474
  });
3459
3475
 
3460
3476
  // package.json
3461
- var version = "0.5.7";
3477
+ var version = "0.6.0";
3462
3478
 
3463
3479
  // src/sdk.ts
3464
3480
  function deepFreeze(obj) {
@@ -3473,6 +3489,7 @@ function deepFreeze(obj) {
3473
3489
  return Object.freeze(obj);
3474
3490
  }
3475
3491
  var globalRoutingConfig = null;
3492
+ var lastKnownEnv = null;
3476
3493
  var MiniAppSDK = class {
3477
3494
  /**
3478
3495
  * Map services.
@@ -3795,7 +3812,14 @@ var MiniAppSDK = class {
3795
3812
  });
3796
3813
  constructor() {
3797
3814
  this.bridge = new Bridge();
3815
+ this.bridge.on(
3816
+ "UPDATE_CONTEXT" /* UPDATE_CONTEXT */,
3817
+ (data) => {
3818
+ if (data?.env) lastKnownEnv = data.env;
3819
+ }
3820
+ );
3798
3821
  this.initialize = this.initialize.bind(this);
3822
+ this.getEnv = this.getEnv.bind(this);
3799
3823
  this.on = this.on.bind(this);
3800
3824
  this.off = this.off.bind(this);
3801
3825
  }
@@ -3819,8 +3843,22 @@ var MiniAppSDK = class {
3819
3843
  * The starting point for the Mini-App. Must be called before any other SDK methods.
3820
3844
  * @param options The options to provide to the shell app
3821
3845
  */
3822
- initialize(options) {
3823
- return this.bridge.send("INITIALIZE", options);
3846
+ async initialize(options) {
3847
+ const res = await this.bridge.send(
3848
+ "INITIALIZE",
3849
+ options
3850
+ );
3851
+ if (res?.env) lastKnownEnv = res.env;
3852
+ return res;
3853
+ }
3854
+ /**
3855
+ * Returns the last known `env` (shell-provided config like `backendUrl`),
3856
+ * refreshed automatically by `initialize()` and every `UPDATE_CONTEXT`
3857
+ * push — read this instead of caching your own copy of `env` values.
3858
+ * Returns `null` before the first successful `initialize()`/context push.
3859
+ */
3860
+ getEnv() {
3861
+ return lastKnownEnv;
3824
3862
  }
3825
3863
  /**
3826
3864
  * Registers a callback for a specific event from the native shell.
@@ -4967,6 +5005,72 @@ var SwipeCarousel = ({
4967
5005
  );
4968
5006
  };
4969
5007
 
5008
+ // src/services/apiService.ts
5009
+ function buildUrl(baseUrl, path) {
5010
+ if (path.startsWith("http://") || path.startsWith("https://")) {
5011
+ return path;
5012
+ }
5013
+ let cleanBase = baseUrl.trim();
5014
+ while (cleanBase.endsWith("/")) {
5015
+ cleanBase = cleanBase.slice(0, -1);
5016
+ }
5017
+ let cleanPath = path.trim();
5018
+ if (!cleanPath.startsWith("/")) {
5019
+ cleanPath = `/${cleanPath}`;
5020
+ }
5021
+ const baseEndsWithV1 = cleanBase.endsWith("/api/v1");
5022
+ const pathStartsWithV1 = cleanPath.startsWith("/api/v1/") || cleanPath === "/api/v1";
5023
+ if (baseEndsWithV1 && pathStartsWithV1) {
5024
+ const strippedPath = cleanPath.slice(7);
5025
+ return `${cleanBase}${strippedPath}`;
5026
+ }
5027
+ return `${cleanBase}${cleanPath}`;
5028
+ }
5029
+ function getEarlyBackendUrl(kind) {
5030
+ if (typeof window === "undefined") return void 0;
5031
+ const early = window.__UP_BACKEND_URLS__;
5032
+ return early?.[kind] ?? void 0;
5033
+ }
5034
+ function createApiService(options) {
5035
+ const getBaseUrl = () => getEarlyBackendUrl("http") || sdk.getEnv()?.backendUrl || options.defaultBaseUrl;
5036
+ const getWsUrl = () => getEarlyBackendUrl("ws") || sdk.getEnv()?.wsBackendUrl || options.defaultWsBackendUrl;
5037
+ return {
5038
+ get baseUrl() {
5039
+ return getBaseUrl();
5040
+ },
5041
+ delete: (path) => sdk.network.request({
5042
+ method: "DELETE",
5043
+ url: buildUrl(getBaseUrl(), path)
5044
+ }),
5045
+ get: (path) => sdk.network.request({
5046
+ headers: { "Content-Type": "application/json" },
5047
+ method: "GET",
5048
+ url: buildUrl(getBaseUrl(), path)
5049
+ }),
5050
+ graphqlQuery: (query, variables = {}) => sdk.network.request({
5051
+ body: { query, variables },
5052
+ headers: { "Content-Type": "application/json" },
5053
+ method: "POST",
5054
+ url: buildUrl(getBaseUrl(), "/graphql")
5055
+ }),
5056
+ patch: (path, body) => sdk.network.request({
5057
+ body,
5058
+ headers: { "Content-Type": "application/json" },
5059
+ method: "PATCH",
5060
+ url: buildUrl(getBaseUrl(), path)
5061
+ }),
5062
+ post: (path, body) => sdk.network.request({
5063
+ body,
5064
+ headers: { "Content-Type": "application/json" },
5065
+ method: "POST",
5066
+ url: buildUrl(getBaseUrl(), path)
5067
+ }),
5068
+ get wsUrl() {
5069
+ return getWsUrl();
5070
+ }
5071
+ };
5072
+ }
5073
+
4970
5074
  // src/index.ts
4971
5075
  var src_default = sdk;
4972
5076
  export {
@@ -4990,6 +5094,7 @@ export {
4990
5094
  SDKProvider,
4991
5095
  SwipeCarousel,
4992
5096
  UIEvent,
5097
+ createApiService,
4993
5098
  src_default as default,
4994
5099
  handleClearRoute,
4995
5100
  handleDrawRoute,