@stackframe/stack 2.6.15 → 2.6.16

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.
@@ -25,7 +25,7 @@ import { constructRedirectUrl } from "../utils/url";
25
25
  import { addNewOAuthProviderOrScope, callOAuthCallback, signInWithOAuth } from "./auth";
26
26
  import { deleteCookie, getCookie, setOrDeleteCookie } from "./cookie";
27
27
  var NextNavigation = scrambleDuringCompileTime(NextNavigationUnscrambled);
28
- var clientVersion = "js @stackframe/stack@2.6.15";
28
+ var clientVersion = "js @stackframe/stack@2.6.16";
29
29
  function getUrls(partial) {
30
30
  const handler = partial.handler ?? "/handler";
31
31
  const home = partial.home ?? "/";
@@ -567,7 +567,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
567
567
  isPrimary: crud.is_primary,
568
568
  usedForAuth: crud.used_for_auth,
569
569
  async sendVerificationEmail() {
570
- return await app._interface.sendCurrentUserContactChannelVerificationEmail(crud.id, constructRedirectUrl(app.urls.emailVerification), app._getSession());
570
+ await app._interface.sendCurrentUserContactChannelVerificationEmail(crud.id, constructRedirectUrl(app.urls.emailVerification), app._getSession());
571
571
  },
572
572
  async update(data) {
573
573
  await app._interface.updateClientContactChannel(crud.id, contactChannelUpdateOptionsToCrud(data), app._getSession());
@@ -1323,8 +1323,8 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
1323
1323
  this._currentServerUserCache = createCacheBySession(async (session) => {
1324
1324
  return await this._interface.getServerUserByToken(session);
1325
1325
  });
1326
- this._serverUsersCache = createCache(async () => {
1327
- return await this._interface.listServerUsers();
1326
+ this._serverUsersCache = createCache(async ([cursor, limit, orderBy, desc, query]) => {
1327
+ return await this._interface.listServerUsers({ cursor, limit, orderBy, desc, query });
1328
1328
  });
1329
1329
  this._serverUserCache = createCache(async ([userId]) => {
1330
1330
  const user = await this._interface.getServerUserById(userId);
@@ -1399,7 +1399,7 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
1399
1399
  return {
1400
1400
  ...this._clientContactChannelFromCrud(crud),
1401
1401
  async sendVerificationEmail() {
1402
- return await app._interface.sendServerContactChannelVerificationEmail(userId, crud.id, constructRedirectUrl(app.urls.emailVerification));
1402
+ await app._interface.sendServerContactChannelVerificationEmail(userId, crud.id, constructRedirectUrl(app.urls.emailVerification));
1403
1403
  },
1404
1404
  async update(data) {
1405
1405
  await app._interface.updateServerContactChannel(userId, crud.id, serverContactChannelUpdateOptionsToCrud(data));
@@ -1699,15 +1699,17 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
1699
1699
  return crud && this._serverUserFromCrud(crud);
1700
1700
  }, [crud]);
1701
1701
  }
1702
- async listUsers() {
1703
- const crud = await this._serverUsersCache.getOrWait([], "write-only");
1704
- return crud.map((j) => this._serverUserFromCrud(j));
1702
+ async listUsers(options) {
1703
+ const crud = await this._serverUsersCache.getOrWait([options?.cursor, options?.limit, options?.orderBy, options?.desc, options?.query], "write-only");
1704
+ const result = crud.items.map((j) => this._serverUserFromCrud(j));
1705
+ result.nextCursor = crud.pagination?.next_cursor ?? null;
1706
+ return result;
1705
1707
  }
1706
- useUsers() {
1707
- const crud = useAsyncCache(this._serverUsersCache, [], "useServerUsers()");
1708
- return useMemo(() => {
1709
- return crud.map((j) => this._serverUserFromCrud(j));
1710
- }, [crud]);
1708
+ useUsers(options) {
1709
+ const crud = useAsyncCache(this._serverUsersCache, [options?.cursor, options?.limit, options?.orderBy, options?.desc, options?.query], "useServerUsers()");
1710
+ const result = crud.items.map((j) => this._serverUserFromCrud(j));
1711
+ result.nextCursor = crud.pagination?.next_cursor ?? null;
1712
+ return result;
1711
1713
  }
1712
1714
  _serverPermissionFromCrud(crud) {
1713
1715
  return {