@chrryai/chrry 1.6.89 → 1.6.91

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.mts CHANGED
@@ -1606,7 +1606,7 @@ declare function reorderApps({ token, apps, autoInstall, storeId, API_URL, }: {
1606
1606
  storeId?: string;
1607
1607
  API_URL?: string;
1608
1608
  }): Promise<any>;
1609
- declare const getSession: ({ deviceId, fingerprint, gift, isStandalone, appId, token, API_URL, VERSION, app, appSlug, agentName, chrryUrl, routeType, userAgent, pathname, screenWidth, screenHeight, translate, locale, source, }: {
1609
+ declare const getSession: ({ deviceId, fingerprint, gift, isStandalone, appId, token, API_URL, VERSION, app, appSlug, agentName, chrryUrl, routeType, userAgent, pathname, screenWidth, screenHeight, translate, locale, source, ip, }: {
1610
1610
  appId?: string;
1611
1611
  pathname?: string;
1612
1612
  deviceId: string | undefined;
@@ -1627,6 +1627,7 @@ declare const getSession: ({ deviceId, fingerprint, gift, isStandalone, appId, t
1627
1627
  translate?: boolean;
1628
1628
  locale?: string;
1629
1629
  source?: string;
1630
+ ip?: string;
1630
1631
  }) => Promise<session | undefined>;
1631
1632
  type ApiActions = ReturnType<typeof getActions>;
1632
1633
  declare const getApps: ({ API_URL, token, chrryUrl, appId, }: {
package/dist/index.d.ts CHANGED
@@ -1606,7 +1606,7 @@ declare function reorderApps({ token, apps, autoInstall, storeId, API_URL, }: {
1606
1606
  storeId?: string;
1607
1607
  API_URL?: string;
1608
1608
  }): Promise<any>;
1609
- declare const getSession: ({ deviceId, fingerprint, gift, isStandalone, appId, token, API_URL, VERSION, app, appSlug, agentName, chrryUrl, routeType, userAgent, pathname, screenWidth, screenHeight, translate, locale, source, }: {
1609
+ declare const getSession: ({ deviceId, fingerprint, gift, isStandalone, appId, token, API_URL, VERSION, app, appSlug, agentName, chrryUrl, routeType, userAgent, pathname, screenWidth, screenHeight, translate, locale, source, ip, }: {
1610
1610
  appId?: string;
1611
1611
  pathname?: string;
1612
1612
  deviceId: string | undefined;
@@ -1627,6 +1627,7 @@ declare const getSession: ({ deviceId, fingerprint, gift, isStandalone, appId, t
1627
1627
  translate?: boolean;
1628
1628
  locale?: string;
1629
1629
  source?: string;
1630
+ ip?: string;
1630
1631
  }) => Promise<session | undefined>;
1631
1632
  type ApiActions = ReturnType<typeof getActions>;
1632
1633
  declare const getApps: ({ API_URL, token, chrryUrl, appId, }: {
package/dist/index.js CHANGED
@@ -2211,7 +2211,9 @@ var init_lib = __esm({
2211
2211
  screenHeight,
2212
2212
  translate,
2213
2213
  locale: locale5,
2214
- source = "client"
2214
+ source = "client",
2215
+ ip
2216
+ // Client IP address for Arcjet
2215
2217
  }) => {
2216
2218
  if (!deviceId) {
2217
2219
  return;
@@ -2247,7 +2249,9 @@ var init_lib = __esm({
2247
2249
  ...pathname ? { "x-pathname": pathname } : {},
2248
2250
  ...locale5 ? { "x-locale": locale5 } : {},
2249
2251
  ...fingerprint ? { "x-fp": fingerprint } : {},
2250
- ...chrryUrl ? { "x-chrry-url": chrryUrl } : {}
2252
+ ...chrryUrl ? { "x-chrry-url": chrryUrl } : {},
2253
+ ...ip ? { "x-forwarded-for": ip } : {}
2254
+ // Pass client IP for Arcjet
2251
2255
  }
2252
2256
  });
2253
2257
  if (!response.ok) {
@@ -3152,7 +3156,7 @@ var init_utils = __esm({
3152
3156
  };
3153
3157
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
3154
3158
  config = getSiteConfig(getClientHostname());
3155
- VERSION = config.version || "1.6.89";
3159
+ VERSION = config.version || "1.6.91";
3156
3160
  getSlugFromPathname = (path) => {
3157
3161
  return getAppAndStoreSlugs(path, {
3158
3162
  defaultAppSlug: config.slug,
@@ -6158,47 +6162,32 @@ var init_useWindowHistory = __esm({
6158
6162
 
6159
6163
  // platform/navigation.web.ts
6160
6164
  function useNavigation() {
6161
- const nextRouter = useNextRouter?.();
6162
- const pathname = useNextPathname?.() || usePathname();
6163
- const searchParams = useNextSearchParams?.() || useSearchParams();
6165
+ const pathname = usePathname();
6166
+ const searchParams = useSearchParams();
6164
6167
  const clientRouter2 = useRouter();
6165
6168
  const push = (0, import_react17.useCallback)(
6166
6169
  (path, options) => {
6167
- const useClientOnly = options?.clientOnly !== false;
6168
- if (useClientOnly) {
6169
- clientRouter2.push(path, { scroll: options?.scroll });
6170
- } else {
6171
- nextRouter?.push(path, { scroll: options?.scroll });
6172
- }
6170
+ clientRouter2.push(path, { scroll: options?.scroll });
6173
6171
  },
6174
- [nextRouter, clientRouter2]
6172
+ [clientRouter2]
6175
6173
  );
6176
6174
  const replace = (0, import_react17.useCallback)(
6177
6175
  (path, options) => {
6178
- const useClientOnly = options?.clientOnly !== false;
6179
- if (useClientOnly) {
6180
- clientRouter2.replace(path, { scroll: options?.scroll });
6181
- } else {
6182
- nextRouter?.replace(path, { scroll: options?.scroll });
6183
- }
6176
+ clientRouter2.replace(path, { scroll: options?.scroll });
6184
6177
  },
6185
- [nextRouter, clientRouter2]
6178
+ [clientRouter2]
6186
6179
  );
6187
6180
  const back = (0, import_react17.useCallback)(() => {
6188
- nextRouter?.back();
6189
- }, [nextRouter]);
6181
+ clientRouter2.back();
6182
+ }, [clientRouter2]);
6190
6183
  const forward = (0, import_react17.useCallback)(() => {
6191
- nextRouter?.forward();
6192
- }, [nextRouter]);
6184
+ clientRouter2.forward();
6185
+ }, [clientRouter2]);
6193
6186
  const refresh = (0, import_react17.useCallback)(() => {
6194
- nextRouter?.refresh();
6195
- }, [nextRouter]);
6196
- const prefetch = (0, import_react17.useCallback)(
6197
- (path) => {
6198
- nextRouter?.prefetch(path);
6199
- },
6200
- [nextRouter]
6201
- );
6187
+ window.location.reload();
6188
+ }, []);
6189
+ const prefetch = (0, import_react17.useCallback)((path) => {
6190
+ }, []);
6202
6191
  const addParams = (0, import_react17.useCallback)(
6203
6192
  (params) => {
6204
6193
  const newSearchParams = new URLSearchParams(searchParams?.toString());
@@ -6207,13 +6196,9 @@ function useNavigation() {
6207
6196
  });
6208
6197
  const queryString = newSearchParams.toString();
6209
6198
  const newUrl = queryString ? `${pathname}?${queryString}` : pathname;
6210
- if (nextRouter) {
6211
- nextRouter.push(newUrl);
6212
- } else {
6213
- clientRouter2.push(newUrl);
6214
- }
6199
+ clientRouter2.push(newUrl);
6215
6200
  },
6216
- [nextRouter, clientRouter2, pathname, searchParams]
6201
+ [clientRouter2, pathname, searchParams]
6217
6202
  );
6218
6203
  const removeParams = (0, import_react17.useCallback)(
6219
6204
  (keys) => {
@@ -6222,13 +6207,9 @@ function useNavigation() {
6222
6207
  keysArray.forEach((key) => newSearchParams.delete(key));
6223
6208
  const queryString = newSearchParams.toString();
6224
6209
  const newUrl = queryString ? `${pathname}?${queryString}` : pathname;
6225
- if (nextRouter) {
6226
- nextRouter.push(newUrl);
6227
- } else {
6228
- clientRouter2.push(newUrl);
6229
- }
6210
+ clientRouter2.push(newUrl);
6230
6211
  },
6231
- [nextRouter, clientRouter2, pathname, searchParams]
6212
+ [clientRouter2, pathname, searchParams]
6232
6213
  );
6233
6214
  const setParams = (0, import_react17.useCallback)(
6234
6215
  (params) => {
@@ -6238,13 +6219,9 @@ function useNavigation() {
6238
6219
  });
6239
6220
  const queryString = newSearchParams.toString();
6240
6221
  const newUrl = queryString ? `${pathname}?${queryString}` : pathname;
6241
- if (nextRouter) {
6242
- nextRouter.push(newUrl);
6243
- } else {
6244
- clientRouter2.push(newUrl);
6245
- }
6222
+ clientRouter2.push(newUrl);
6246
6223
  },
6247
- [nextRouter, clientRouter2, pathname]
6224
+ [clientRouter2, pathname]
6248
6225
  );
6249
6226
  return (0, import_react17.useMemo)(
6250
6227
  () => ({
@@ -6278,19 +6255,12 @@ function useNavigation() {
6278
6255
  function usePreviousPathname() {
6279
6256
  return null;
6280
6257
  }
6281
- var import_react17, useNextRouter, useNextPathname, useNextSearchParams;
6258
+ var import_react17;
6282
6259
  var init_navigation_web = __esm({
6283
6260
  "platform/navigation.web.ts"() {
6284
6261
  "use strict";
6285
6262
  import_react17 = __toESM(require("react"));
6286
6263
  init_useWindowHistory();
6287
- try {
6288
- const nextNavigation = require("next/navigation");
6289
- useNextRouter = nextNavigation.useRouter;
6290
- useNextPathname = nextNavigation.usePathname;
6291
- useNextSearchParams = nextNavigation.useSearchParams;
6292
- } catch {
6293
- }
6294
6264
  }
6295
6265
  });
6296
6266
 
@@ -24736,7 +24706,7 @@ function DataProvider({ children, ...rest }) {
24736
24706
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24737
24707
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24738
24708
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24739
- const VERSION4 = "1.6.89";
24709
+ const VERSION4 = "1.6.91";
24740
24710
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24741
24711
  const {
24742
24712
  API_URL: API_URL2,