@flashbacktech/flashbackclient 0.1.81 → 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.
@@ -7,6 +7,9 @@ import { QuotaResponse } from './types/quota';
7
7
  import { DeviceListResponse, DeviceDetailsResponse, SessionListResponse, TrustDeviceRequest, TrustDeviceResponse, UntrustDeviceResponse, RemoveDeviceResponse, RevokeSessionResponse, RevokeAllSessionsResponse, SessionHeartbeatResponse, DeviceInfo } from './types/device';
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
+ import { DeleteSettingsRequest, GetSettingsResponse, PartialUpdateSettingsRequest, UpdateSettingsRequest } from './types/settings';
11
+ import { UpdateUserRoleResponse, UserRoleResponse } from './types/roles';
12
+ import { UserProfileResponse } from './types/roles';
10
13
  interface ErrorResponse {
11
14
  message?: string;
12
15
  [key: string]: any;
@@ -135,5 +138,34 @@ export declare class ApiClient implements IApiClient {
135
138
  activateMagicLink: (data: MagicLinkActivationRequest) => Promise<MagicLinkActivationResponse>;
136
139
  getPasskeyAuthOptions: () => Promise<PasskeyAuthOptionsResult>;
137
140
  completePasskeyRegistration: (request: PasskeyCompleteRegistrationRequest) => Promise<PasskeyCompleteRegistrationResponse>;
141
+ getUserSettings: () => Promise<GetSettingsResponse>;
142
+ updateUserSettings: (request: UpdateSettingsRequest) => Promise<{
143
+ success: boolean;
144
+ message: string;
145
+ }>;
146
+ partialUpdateUserSettings: (request: PartialUpdateSettingsRequest) => Promise<{
147
+ success: boolean;
148
+ message: string;
149
+ }>;
150
+ deleteUserSettingsKeys: (request: DeleteSettingsRequest) => Promise<{
151
+ success: boolean;
152
+ message: string;
153
+ }>;
154
+ getOrganizationSettings: () => Promise<GetSettingsResponse>;
155
+ updateOrganizationSettings: (request: UpdateSettingsRequest) => Promise<{
156
+ success: boolean;
157
+ message: string;
158
+ }>;
159
+ partialUpdateOrganizationSettings: (request: PartialUpdateSettingsRequest) => Promise<{
160
+ success: boolean;
161
+ message: string;
162
+ }>;
163
+ deleteOrganizationSettingsKeys: (request: DeleteSettingsRequest) => Promise<{
164
+ success: boolean;
165
+ message: string;
166
+ }>;
167
+ getUserProfile: () => Promise<UserProfileResponse>;
168
+ getUserById: (userId: string) => Promise<UserRoleResponse>;
169
+ updateUserRole: (userId: string, orgRole: number) => Promise<UpdateUserRoleResponse>;
138
170
  }
139
171
  export {};
@@ -382,6 +382,41 @@ class ApiClient {
382
382
  this.completePasskeyRegistration = async (request) => {
383
383
  return this.makeRequest('mfa/passkey/complete-registration', 'POST', request);
384
384
  };
385
+ this.getUserSettings = async () => {
386
+ return this.makeRequest('settings/user', 'GET');
387
+ };
388
+ this.updateUserSettings = async (request) => {
389
+ return this.makeRequest('settings/user', 'POST', request);
390
+ };
391
+ this.partialUpdateUserSettings = async (request) => {
392
+ return this.makeRequest('settings/user', 'PUT', request);
393
+ };
394
+ this.deleteUserSettingsKeys = async (request) => {
395
+ return this.makeRequest('settings/user', 'DELETE', request);
396
+ };
397
+ // Organization Settings Methods
398
+ this.getOrganizationSettings = async () => {
399
+ return this.makeRequest('settings/organization', 'GET');
400
+ };
401
+ this.updateOrganizationSettings = async (request) => {
402
+ return this.makeRequest('settings/organization', 'POST', request);
403
+ };
404
+ this.partialUpdateOrganizationSettings = async (request) => {
405
+ return this.makeRequest('settings/organization', 'PUT', request);
406
+ };
407
+ this.deleteOrganizationSettingsKeys = async (request) => {
408
+ return this.makeRequest('settings/organization', 'DELETE', request);
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
+ };
385
420
  this.baseURL = baseURL;
386
421
  this.headers = {};
387
422
  this.debug = false;
@@ -9,4 +9,5 @@ import * as QuotaTypes from './types/quota';
9
9
  import * as SubscriptionTypes from './types/subscriptions';
10
10
  import * as DeviceTypes from './types/device';
11
11
  import * as MFATypes from './types/mfa';
12
- export { ApiClient, ApiTypes, AuthTypes, StatsTypes, ApiInterfaces, HttpError, BridgeTypes, EmailTypes, QuotaTypes, SubscriptionTypes, DeviceTypes, MFATypes };
12
+ import * as SettingsTypes from './types/settings';
13
+ export { ApiClient, ApiTypes, AuthTypes, StatsTypes, ApiInterfaces, HttpError, BridgeTypes, EmailTypes, QuotaTypes, SubscriptionTypes, DeviceTypes, MFATypes, SettingsTypes };
package/dist/api/index.js CHANGED
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.MFATypes = exports.DeviceTypes = exports.SubscriptionTypes = exports.QuotaTypes = exports.EmailTypes = exports.BridgeTypes = exports.HttpError = exports.ApiInterfaces = exports.StatsTypes = exports.AuthTypes = exports.ApiTypes = exports.ApiClient = void 0;
36
+ exports.SettingsTypes = exports.MFATypes = exports.DeviceTypes = exports.SubscriptionTypes = exports.QuotaTypes = exports.EmailTypes = exports.BridgeTypes = exports.HttpError = exports.ApiInterfaces = exports.StatsTypes = exports.AuthTypes = exports.ApiTypes = exports.ApiClient = void 0;
37
37
  const client_1 = require("./client");
38
38
  Object.defineProperty(exports, "ApiClient", { enumerable: true, get: function () { return client_1.ApiClient; } });
39
39
  Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return client_1.HttpError; } });
@@ -57,3 +57,5 @@ const DeviceTypes = __importStar(require("./types/device"));
57
57
  exports.DeviceTypes = DeviceTypes;
58
58
  const MFATypes = __importStar(require("./types/mfa"));
59
59
  exports.MFATypes = MFATypes;
60
+ const SettingsTypes = __importStar(require("./types/settings"));
61
+ exports.SettingsTypes = SettingsTypes;
@@ -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 = {}));
@@ -0,0 +1,18 @@
1
+ export interface GetSettingsResponse {
2
+ success: boolean;
3
+ settings: Record<string, any>;
4
+ }
5
+ export interface UpdateSettingsRequest {
6
+ settings: Record<string, any>;
7
+ }
8
+ export interface PartialUpdateSettingsRequest {
9
+ [key: string]: any;
10
+ }
11
+ export interface DeleteSettingsRequest {
12
+ keys: string[];
13
+ }
14
+ export interface SettingsErrorResponse {
15
+ success: false;
16
+ message: string;
17
+ error?: string;
18
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ ;
4
+ ;
5
+ ;
6
+ ;
7
+ ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.1.81",
3
+ "version": "0.1.83",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"