@flashbacktech/flashbackclient 0.1.82 → 0.1.83

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.
@@ -8,6 +8,8 @@ import { DeviceListResponse, DeviceDetailsResponse, SessionListResponse, TrustDe
8
8
  import { BuySubscriptionRequest, BuySubscriptionResponse, GetSubscriptionsResponse, MySubscriptionResponse, PaymentsListResponse, PaymentsQueryParams, CancelSubscriptionResponse } from './types/subscriptions';
9
9
  import { MFAMethodsResponse, MFASetupRequest, MFASetupResponse, MFAStatusResponse, MFAVerificationSetupRequest, MFAVerificationSetupResponse, MFAEnableRequest, MFAEnableResponse, MFADisableResponse, MFAPrimaryRequest, MFAPrimaryResponse, MFAResetResponse, MFAOrganizationEnforceRequest, MFAOrganizationEnforceResponse, MagicLinkActivationRequest, MagicLinkActivationResponse, MagicLinkSendResponse, PasskeyAuthOptionsResult, PasskeyCompleteRegistrationRequest, PasskeyCompleteRegistrationResponse, MFAVerificationRequest, MFAVerificationLoginResponse } from './types/mfa';
10
10
  import { DeleteSettingsRequest, GetSettingsResponse, PartialUpdateSettingsRequest, UpdateSettingsRequest } from './types/settings';
11
+ import { UpdateUserRoleResponse, UserRoleResponse } from './types/roles';
12
+ import { UserProfileResponse } from './types/roles';
11
13
  interface ErrorResponse {
12
14
  message?: string;
13
15
  [key: string]: any;
@@ -162,5 +164,8 @@ export declare class ApiClient implements IApiClient {
162
164
  success: boolean;
163
165
  message: string;
164
166
  }>;
167
+ getUserProfile: () => Promise<UserProfileResponse>;
168
+ getUserById: (userId: string) => Promise<UserRoleResponse>;
169
+ updateUserRole: (userId: string, orgRole: number) => Promise<UpdateUserRoleResponse>;
165
170
  }
166
171
  export {};
@@ -407,6 +407,16 @@ class ApiClient {
407
407
  this.deleteOrganizationSettingsKeys = async (request) => {
408
408
  return this.makeRequest('settings/organization', 'DELETE', request);
409
409
  };
410
+ // Role/profile management methods
411
+ this.getUserProfile = async () => {
412
+ return this.makeRequest('user/profile', 'GET', null);
413
+ };
414
+ this.getUserById = async (userId) => {
415
+ return this.makeRequest(`user/${userId}`, 'GET', null);
416
+ };
417
+ this.updateUserRole = async (userId, orgRole) => {
418
+ return this.makeRequest(`user/${userId}/role`, 'PUT', { orgRole });
419
+ };
410
420
  this.baseURL = baseURL;
411
421
  this.headers = {};
412
422
  this.debug = false;
@@ -0,0 +1,49 @@
1
+ export declare enum OrgRoles {
2
+ USER = 0,// Default role - basic user
3
+ BILLING = 1,// Can manage billing and subscriptions
4
+ WORKSPACES = 2,// Can manage workspaces and team members
5
+ ADMINISTRATORS = 254,// Administrative access (leaves room for future roles)
6
+ OWNER = 255
7
+ }
8
+ export interface UserRoleResponse {
9
+ success: boolean;
10
+ data?: {
11
+ userId: string;
12
+ orgRole: number;
13
+ orgRoleDescription: string;
14
+ orgRoles: OrgRoles[];
15
+ };
16
+ message?: string;
17
+ error?: string;
18
+ }
19
+ export interface UpdateUserRoleRequest {
20
+ orgRole: number;
21
+ }
22
+ export interface UpdateUserRoleResponse {
23
+ success: boolean;
24
+ data?: {
25
+ userId: string;
26
+ previousRole: number;
27
+ newRole: number;
28
+ message: string;
29
+ };
30
+ message?: string;
31
+ error?: string;
32
+ }
33
+ export interface UserProfileResponse {
34
+ success: boolean;
35
+ data?: {
36
+ id: string;
37
+ name: string;
38
+ lastName: string;
39
+ email: string;
40
+ orgId: string | null;
41
+ orgRole: number | null;
42
+ orgRoleDescription: string;
43
+ orgRoles: OrgRoles[];
44
+ validated: boolean;
45
+ mfaRequired: boolean;
46
+ };
47
+ message?: string;
48
+ error?: string;
49
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrgRoles = void 0;
4
+ var OrgRoles;
5
+ (function (OrgRoles) {
6
+ OrgRoles[OrgRoles["USER"] = 0] = "USER";
7
+ OrgRoles[OrgRoles["BILLING"] = 1] = "BILLING";
8
+ OrgRoles[OrgRoles["WORKSPACES"] = 2] = "WORKSPACES";
9
+ OrgRoles[OrgRoles["ADMINISTRATORS"] = 254] = "ADMINISTRATORS";
10
+ OrgRoles[OrgRoles["OWNER"] = 255] = "OWNER"; // Full organization access
11
+ })(OrgRoles || (exports.OrgRoles = OrgRoles = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.1.82",
3
+ "version": "0.1.83",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"