@arbidocs/sdk 0.4.93 → 0.4.95

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.
@@ -3984,6 +3984,12 @@ declare namespace agents {
3984
3984
  */
3985
3985
 
3986
3986
  type UpdateProfileRequest = components['schemas']['UpdateProfileRequest'];
3987
+ type CurrentUserResponse = components['schemas']['CurrentUserResponse'];
3988
+ /**
3989
+ * The signed-in user as the server sees them now, including what they may do on this deployment
3990
+ * (`can_create_projects`). Unlike the login profile it is re-read, so it follows role changes.
3991
+ */
3992
+ declare function getCurrentUser(arbi: ArbiClient): Promise<CurrentUserResponse>;
3987
3993
  /**
3988
3994
  * Update the signed-in user's profile. Fields are optional — pass only what
3989
3995
  * changes (e.g. `given_name`, `family_name`, `picture`).
@@ -3996,10 +4002,12 @@ declare function updateProfile(arbi: ArbiClient, body: UpdateProfileRequest): Pr
3996
4002
  is_identity_verified: boolean;
3997
4003
  }>;
3998
4004
 
4005
+ type profile_CurrentUserResponse = CurrentUserResponse;
3999
4006
  type profile_UpdateProfileRequest = UpdateProfileRequest;
4007
+ declare const profile_getCurrentUser: typeof getCurrentUser;
4000
4008
  declare const profile_updateProfile: typeof updateProfile;
4001
4009
  declare namespace profile {
4002
- export { type profile_UpdateProfileRequest as UpdateProfileRequest, profile_updateProfile as updateProfile };
4010
+ export { type profile_CurrentUserResponse as CurrentUserResponse, type profile_UpdateProfileRequest as UpdateProfileRequest, profile_getCurrentUser as getCurrentUser, profile_updateProfile as updateProfile };
4003
4011
  }
4004
4012
 
4005
4013
  /**
@@ -5870,6 +5878,22 @@ declare class Arbi {
5870
5878
  usageToday: () => Promise<{
5871
5879
  credits_used: number;
5872
5880
  }>;
5881
+ /**
5882
+ * The signed-in user from the server, with `can_create_projects`: false on deployments where
5883
+ * only firm members may create projects and workspaces and this user is not one (yet).
5884
+ */
5885
+ me: () => Promise<{
5886
+ external_id: string;
5887
+ parent_ext_id?: string | null;
5888
+ email: string;
5889
+ given_name: string;
5890
+ family_name?: string | null;
5891
+ picture?: string | null;
5892
+ encryption_public_key: string;
5893
+ is_sso: boolean;
5894
+ is_identity_verified: boolean;
5895
+ can_create_projects: boolean;
5896
+ }>;
5873
5897
  };
5874
5898
  readonly profile: {
5875
5899
  /** Update the display profile; pass only what changes (`''` clears family name or picture). */
@@ -3984,6 +3984,12 @@ declare namespace agents {
3984
3984
  */
3985
3985
 
3986
3986
  type UpdateProfileRequest = components['schemas']['UpdateProfileRequest'];
3987
+ type CurrentUserResponse = components['schemas']['CurrentUserResponse'];
3988
+ /**
3989
+ * The signed-in user as the server sees them now, including what they may do on this deployment
3990
+ * (`can_create_projects`). Unlike the login profile it is re-read, so it follows role changes.
3991
+ */
3992
+ declare function getCurrentUser(arbi: ArbiClient): Promise<CurrentUserResponse>;
3987
3993
  /**
3988
3994
  * Update the signed-in user's profile. Fields are optional — pass only what
3989
3995
  * changes (e.g. `given_name`, `family_name`, `picture`).
@@ -3996,10 +4002,12 @@ declare function updateProfile(arbi: ArbiClient, body: UpdateProfileRequest): Pr
3996
4002
  is_identity_verified: boolean;
3997
4003
  }>;
3998
4004
 
4005
+ type profile_CurrentUserResponse = CurrentUserResponse;
3999
4006
  type profile_UpdateProfileRequest = UpdateProfileRequest;
4007
+ declare const profile_getCurrentUser: typeof getCurrentUser;
4000
4008
  declare const profile_updateProfile: typeof updateProfile;
4001
4009
  declare namespace profile {
4002
- export { type profile_UpdateProfileRequest as UpdateProfileRequest, profile_updateProfile as updateProfile };
4010
+ export { type profile_CurrentUserResponse as CurrentUserResponse, type profile_UpdateProfileRequest as UpdateProfileRequest, profile_getCurrentUser as getCurrentUser, profile_updateProfile as updateProfile };
4003
4011
  }
4004
4012
 
4005
4013
  /**
@@ -5870,6 +5878,22 @@ declare class Arbi {
5870
5878
  usageToday: () => Promise<{
5871
5879
  credits_used: number;
5872
5880
  }>;
5881
+ /**
5882
+ * The signed-in user from the server, with `can_create_projects`: false on deployments where
5883
+ * only firm members may create projects and workspaces and this user is not one (yet).
5884
+ */
5885
+ me: () => Promise<{
5886
+ external_id: string;
5887
+ parent_ext_id?: string | null;
5888
+ email: string;
5889
+ given_name: string;
5890
+ family_name?: string | null;
5891
+ picture?: string | null;
5892
+ encryption_public_key: string;
5893
+ is_sso: boolean;
5894
+ is_identity_verified: boolean;
5895
+ can_create_projects: boolean;
5896
+ }>;
5873
5897
  };
5874
5898
  readonly profile: {
5875
5899
  /** Update the display profile; pass only what changes (`''` clears family name or picture). */
package/dist/browser.cjs CHANGED
@@ -6025,8 +6025,12 @@ function currentSessionId(accessToken) {
6025
6025
  // src/operations/profile.ts
6026
6026
  var profile_exports = {};
6027
6027
  __export(profile_exports, {
6028
+ getCurrentUser: () => getCurrentUser,
6028
6029
  updateProfile: () => updateProfile
6029
6030
  });
6031
+ async function getCurrentUser(arbi) {
6032
+ return requireData(await arbi.fetch.GET("/v1/user/me"), "Failed to fetch the current user");
6033
+ }
6030
6034
  async function updateProfile(arbi, body) {
6031
6035
  return requireData(
6032
6036
  await arbi.fetch.PATCH("/v1/user/profile", { body }),
@@ -7607,7 +7611,12 @@ var Arbi = class {
7607
7611
  return () => this.profileListeners.delete(listener);
7608
7612
  },
7609
7613
  /** Today's deployment-wide credit spend for the current user. */
7610
- usageToday: () => getUserUsageToday(this.requireClient())
7614
+ usageToday: () => getUserUsageToday(this.requireClient()),
7615
+ /**
7616
+ * The signed-in user from the server, with `can_create_projects`: false on deployments where
7617
+ * only firm members may create projects and workspaces and this user is not one (yet).
7618
+ */
7619
+ me: () => getCurrentUser(this.requireClient())
7611
7620
  };
7612
7621
  // ── Profile ───────────────────────────────────────────────────────────
7613
7622
  profile = {