andoncloud-sdk 1.7.33 → 1.7.35

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +346 -346
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -5,10 +5,6 @@ import { SxProps, Theme } from '@mui/material/styles';
5
5
  import * as Sentry from '@sentry/react';
6
6
  import { InitOptions } from 'i18next';
7
7
 
8
- import { CheckboxProps } from './core/ui/Checkbox';
9
- import { RadioProps } from './core/ui/Radio';
10
- import { RadioGroupProps } from './core/ui/RadioGroup';
11
-
12
8
  declare module '@mui/material/styles' {
13
9
  interface Palette {
14
10
  gray: Palette['primary'];
@@ -29,424 +25,428 @@ declare module '@mui/material/styles' {
29
25
  }
30
26
  }
31
27
 
32
- declare module 'andoncloud-sdk' {
33
- interface NavItem {
34
- label: string;
35
- url?: string;
36
- redirect?: boolean;
37
- action?: () => void;
38
- icon?: React.ReactNode;
39
- defaultOpened?: boolean;
40
- }
28
+ interface NavItem {
29
+ label: string;
30
+ url?: string;
31
+ redirect?: boolean;
32
+ action?: () => void;
33
+ icon?: React.ReactNode;
34
+ defaultOpened?: boolean;
35
+ }
41
36
 
42
- interface MenuItem {
43
- label: string;
44
- url?: string;
45
- action?: () => void;
46
- }
37
+ interface MenuItem {
38
+ label: string;
39
+ url?: string;
40
+ action?: () => void;
41
+ }
47
42
 
48
- interface AuthProps {
49
- enabled?: boolean;
50
- loginUrl?: string;
51
- redirectUri?: string;
52
- redirectPath?: string;
53
- clientId: string;
54
- grantType?: 'authorization_code' | 'password';
55
- }
43
+ interface AuthProps {
44
+ enabled?: boolean;
45
+ loginUrl?: string;
46
+ redirectUri?: string;
47
+ redirectPath?: string;
48
+ clientId: string;
49
+ grantType?: 'authorization_code' | 'password';
50
+ }
56
51
 
57
- interface I18nProps {
58
- locales: InitOptions['resources'];
59
- }
52
+ interface I18nProps {
53
+ locales: InitOptions['resources'];
54
+ }
60
55
 
61
- interface MetaProps {
62
- appVersion?: string;
63
- apiVersion?: string;
64
- releaseVersion?: string;
65
- releasePageLink?: string;
66
- }
56
+ interface MetaProps {
57
+ appVersion?: string;
58
+ apiVersion?: string;
59
+ releaseVersion?: string;
60
+ releasePageLink?: string;
61
+ }
67
62
 
68
- interface Display {
69
- mode: 'standalone' | 'iframe';
70
- isEmbeddedMode: boolean;
71
- iframeMounted: boolean;
72
- setIframeMounted: (mounted: boolean) => void;
73
- iframeNavigationItems: SidebarMenuItem[];
74
- setIframeNavigationItems: (items: SidebarMenuItem[]) => void;
75
- }
76
- export const useDisplay: () => Display;
63
+ interface Display {
64
+ mode: 'standalone' | 'iframe';
65
+ isEmbeddedMode: boolean;
66
+ iframeMounted: boolean;
67
+ setIframeMounted: (mounted: boolean) => void;
68
+ iframeNavigationItems: SidebarMenuItem[];
69
+ setIframeNavigationItems: (items: SidebarMenuItem[]) => void;
70
+ }
71
+ export const useDisplay: () => Display;
77
72
 
78
- export const getDisplayMode: () => Display['mode'];
73
+ export const getDisplayMode: () => Display['mode'];
79
74
 
80
- export const updateParentHeaderLeadingText: (text: string) => void;
81
- export const resetParentHeaderLeadingText: () => void;
75
+ export const updateParentHeaderLeadingText: (text: string) => void;
76
+ export const resetParentHeaderLeadingText: () => void;
82
77
 
83
- export const updateParentHeaderTitle: (title: string) => void;
84
- export const resetParentHeaderTitle: () => void;
78
+ export const updateParentHeaderTitle: (title: string) => void;
79
+ export const resetParentHeaderTitle: () => void;
85
80
 
86
- type UpdateParentHeaderStylesArgs = {
87
- target?: string;
88
- styles: SxProps<Theme>;
89
- };
90
- export const updateParentHeaderStyles: ({ target, styles }: UpdateParentHeaderStylesArgs) => void;
91
- export const resetParentHeaderStyles: (target?: string) => void;
81
+ type UpdateParentHeaderStylesArgs = {
82
+ target?: string;
83
+ styles: SxProps<Theme>;
84
+ };
85
+ export const updateParentHeaderStyles: ({ target, styles }: UpdateParentHeaderStylesArgs) => void;
86
+ export const resetParentHeaderStyles: (target?: string) => void;
92
87
 
93
- interface ContentDescriptor {
94
- component: string;
95
- props?: Record<string, any>;
96
- }
97
- export const updateParentHeaderContent: (descriptor: ContentDescriptor) => void;
98
- export const resetParentHeaderContent: () => void;
99
-
100
- interface AppProps {
101
- children: React.ReactNode;
102
- baseUrl: string;
103
- authProps: AuthProps;
104
- gtmProps?: TagManagerArgs;
105
- i18nProps?: I18nProps;
106
- sentryProps?: Sentry.BrowserOptions;
107
- metaProps?: MetaProps;
108
- muiTheme?: Record<string, unknown>;
109
- }
110
- export const App: React.FC<AppProps>;
88
+ interface ContentDescriptor {
89
+ component: string;
90
+ props?: Record<string, any>;
91
+ }
92
+ export const updateParentHeaderContent: (descriptor: ContentDescriptor) => void;
93
+ export const resetParentHeaderContent: () => void;
94
+
95
+ interface AppProps {
96
+ children: React.ReactNode;
97
+ baseUrl: string;
98
+ authProps: AuthProps;
99
+ gtmProps?: TagManagerArgs;
100
+ i18nProps?: I18nProps;
101
+ sentryProps?: Sentry.BrowserOptions;
102
+ metaProps?: MetaProps;
103
+ muiTheme?: Record<string, unknown>;
104
+ }
105
+ export const App: React.FC<AppProps>;
111
106
 
112
- interface NavProps {
113
- items?: NavItem[];
114
- }
107
+ interface NavProps {
108
+ items?: NavItem[];
109
+ }
115
110
 
116
- interface UserProps {
117
- show?: boolean;
118
- showCompanyLogo?: boolean;
119
- }
111
+ interface UserProps {
112
+ show?: boolean;
113
+ showCompanyLogo?: boolean;
114
+ }
120
115
 
121
- interface MenuProps {
122
- items?: MenuItem[];
123
- buttonColor?: string;
124
- dropdownStyles?: SxProps<Theme>;
125
- styles?: SxProps<Theme>;
126
- }
116
+ interface MenuProps {
117
+ items?: MenuItem[];
118
+ buttonColor?: string;
119
+ dropdownStyles?: SxProps<Theme>;
120
+ styles?: SxProps<Theme>;
121
+ }
127
122
 
128
- interface HeaderProps {
129
- position?: 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky';
130
- showAcLogo?: boolean;
131
- leadingText?: string;
132
- title?: string;
133
- titleStyles?: SxProps<Theme>;
134
- content?: React.ReactNode;
135
- contentComponents?: Record<string, React.ComponentType<any>>;
136
- contentStyles?: SxProps<Theme>;
137
- navProps?: NavProps;
138
- userProps?: UserProps;
139
- menuProps?: MenuProps;
140
- styles?: SxProps<Theme>;
141
- }
123
+ interface HeaderProps {
124
+ position?: 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky';
125
+ showAcLogo?: boolean;
126
+ leadingText?: string;
127
+ title?: string;
128
+ titleStyles?: SxProps<Theme>;
129
+ content?: React.ReactNode;
130
+ contentComponents?: Record<string, React.ComponentType<any>>;
131
+ contentStyles?: SxProps<Theme>;
132
+ navProps?: NavProps;
133
+ userProps?: UserProps;
134
+ menuProps?: MenuProps;
135
+ styles?: SxProps<Theme>;
136
+ }
142
137
 
143
- interface SidebarMenuItem extends NavItem {
144
- items?: NavItem[];
145
- }
138
+ interface SidebarMenuItem extends NavItem {
139
+ items?: NavItem[];
140
+ }
146
141
 
147
- interface SidebarMenuProps {
148
- enabled: boolean;
149
- items: SidebarMenuItem[];
150
- open?: boolean;
151
- width?: number;
152
- styles?: SxProps<Theme>;
153
- listStyles?: SxProps<Theme>;
154
- itemStyles?: SxProps<Theme>;
155
- subitemStyles?: SxProps<Theme>;
156
- }
142
+ interface SidebarMenuProps {
143
+ enabled: boolean;
144
+ items: SidebarMenuItem[];
145
+ open?: boolean;
146
+ width?: number;
147
+ styles?: SxProps<Theme>;
148
+ listStyles?: SxProps<Theme>;
149
+ itemStyles?: SxProps<Theme>;
150
+ subitemStyles?: SxProps<Theme>;
151
+ }
157
152
 
158
- export interface SidePanelProps {
159
- enabled: boolean;
160
- open?: boolean;
161
- onClose?: () => void;
162
- title?: string;
163
- mainContent: React.ReactNode;
164
- asideContent?: React.ReactNode;
165
- width?: string;
166
- mainContentWidth?: string;
167
- asideContentWidth?: string;
168
- styles?: SxProps<Theme>;
169
- headerStyles?: SxProps<Theme>;
170
- contentWrapperStyles?: SxProps<Theme>;
171
- mainContentStyles?: SxProps<Theme>;
172
- asideContentStyles?: SxProps<Theme>;
173
- }
153
+ export interface SidePanelProps {
154
+ enabled: boolean;
155
+ open?: boolean;
156
+ onClose?: () => void;
157
+ title?: string;
158
+ mainContent: React.ReactNode;
159
+ asideContent?: React.ReactNode;
160
+ width?: string;
161
+ mainContentWidth?: string;
162
+ asideContentWidth?: string;
163
+ styles?: SxProps<Theme>;
164
+ headerStyles?: SxProps<Theme>;
165
+ contentWrapperStyles?: SxProps<Theme>;
166
+ mainContentStyles?: SxProps<Theme>;
167
+ asideContentStyles?: SxProps<Theme>;
168
+ }
174
169
 
175
- interface ContainerProps {
176
- children: React.ReactNode;
177
- headerProps: HeaderProps;
178
- sidebarMenuProps?: SidebarMenuProps;
179
- sidePanelProps?: SidePanelProps;
180
- styles?: SxProps<Theme>;
181
- }
182
- export const Container: React.FC<ContainerProps>;
170
+ interface ContainerProps {
171
+ children: React.ReactNode;
172
+ headerProps: HeaderProps;
173
+ sidebarMenuProps?: SidebarMenuProps;
174
+ sidePanelProps?: SidePanelProps;
175
+ styles?: SxProps<Theme>;
176
+ }
177
+ export const Container: React.FC<ContainerProps>;
183
178
 
184
- type FeatureStatus =
185
- | 'accessible'
186
- | 'no_permission'
187
- | 'not_purchased'
188
- | 'trial_expired_recent'
189
- | 'trial_expired_old'
190
- | 'no_access';
179
+ type FeatureStatus =
180
+ | 'accessible'
181
+ | 'no_permission'
182
+ | 'not_purchased'
183
+ | 'trial_expired_recent'
184
+ | 'trial_expired_old'
185
+ | 'no_access';
191
186
 
192
- type EntitlementType = 'trial' | 'purchased' | null;
187
+ type EntitlementType = 'trial' | 'purchased' | null;
193
188
 
194
- type AccessState = 'no_permission' | 'accessible' | 'expired' | 'not_purchased';
189
+ type AccessState = 'no_permission' | 'accessible' | 'expired' | 'not_purchased';
195
190
 
196
- type DenyReason = 'MISSING_ROLE_PERMISSION' | 'EXPIRED_PLAN' | string;
191
+ type DenyReason = 'MISSING_ROLE_PERMISSION' | 'EXPIRED_PLAN' | string;
197
192
 
198
- type PermissionValue = 'ALLOW' | `DENY:${DenyReason}`;
193
+ type PermissionValue = 'ALLOW' | `DENY:${DenyReason}`;
199
194
 
200
- interface PermissionsMap {
201
- [permissionKey: string]: PermissionValue;
202
- }
195
+ interface PermissionsMap {
196
+ [permissionKey: string]: PermissionValue;
197
+ }
203
198
 
204
- interface FeatureInfo {
205
- status: FeatureStatus;
206
- entitlementType: EntitlementType;
207
- expiresAt: string | null;
208
- daysSinceExpiry: number | null;
209
- permissions: string[];
210
- }
199
+ interface FeatureInfo {
200
+ status: FeatureStatus;
201
+ entitlementType: EntitlementType;
202
+ expiresAt: string | null;
203
+ daysSinceExpiry: number | null;
204
+ permissions: string[];
205
+ }
211
206
 
212
- interface FeaturesMap {
213
- [featureKey: string]: FeatureInfo;
214
- }
207
+ interface FeaturesMap {
208
+ [featureKey: string]: FeatureInfo;
209
+ }
215
210
 
216
- interface RequestInfo {
217
- lastRequestedAt: string;
218
- daysRemaining: number;
219
- }
211
+ interface RequestInfo {
212
+ lastRequestedAt: string;
213
+ daysRemaining: number;
214
+ }
220
215
 
221
- interface FeaturesRequestsMap {
222
- [workplaceIdOrCompany: string]: {
223
- [featureKey: string]: {
224
- [requestType: string]: RequestInfo;
225
- };
216
+ interface FeaturesRequestsMap {
217
+ [workplaceIdOrCompany: string]: {
218
+ [featureKey: string]: {
219
+ [requestType: string]: RequestInfo;
226
220
  };
227
- }
221
+ };
222
+ }
228
223
 
229
- interface CooldownStatus {
230
- isInCooldown: boolean;
231
- daysRemaining: number;
232
- }
224
+ interface CooldownStatus {
225
+ isInCooldown: boolean;
226
+ daysRemaining: number;
227
+ }
233
228
 
234
- interface CooldownInfo {
235
- [requestType: string]: CooldownStatus;
236
- }
229
+ interface CooldownInfo {
230
+ [requestType: string]: CooldownStatus;
231
+ }
237
232
 
238
- interface UserData {
239
- id: number;
240
- companyId: number;
241
- roleId: number;
242
- username: string;
243
- email: string;
244
- name: string;
245
- permissionsMap: PermissionsMap | null;
246
- featuresMap: FeaturesMap | null;
247
- featuresRequestsMap: FeaturesRequestsMap | null;
248
- }
233
+ interface UserData {
234
+ id: number;
235
+ companyId: number;
236
+ roleId: number;
237
+ username: string;
238
+ email: string;
239
+ name: string;
240
+ permissionsMap: PermissionsMap | null;
241
+ featuresMap: FeaturesMap | null;
242
+ featuresRequestsMap: FeaturesRequestsMap | null;
243
+ }
249
244
 
250
- interface PermissionCheckResult {
251
- isAllowed: boolean;
252
- denyReason: DenyReason | null;
253
- }
245
+ interface PermissionCheckResult {
246
+ isAllowed: boolean;
247
+ denyReason: DenyReason | null;
248
+ }
254
249
 
255
- interface UsePermissionsResult {
256
- checkPermission: (permissionKey: string) => PermissionCheckResult;
257
- checkPermissions: (permissionKeys: string[]) => {
258
- allAllowed: boolean;
259
- results: Record<string, PermissionCheckResult>;
260
- deniedKeys: string[];
261
- };
262
- permissionsMap: PermissionsMap | null;
263
- }
250
+ interface UsePermissionsResult {
251
+ checkPermission: (permissionKey: string) => PermissionCheckResult;
252
+ checkPermissions: (permissionKeys: string[]) => {
253
+ allAllowed: boolean;
254
+ results: Record<string, PermissionCheckResult>;
255
+ deniedKeys: string[];
256
+ };
257
+ permissionsMap: PermissionsMap | null;
258
+ }
264
259
 
265
- export const usePermissions: () => UsePermissionsResult;
260
+ export const usePermissions: () => UsePermissionsResult;
266
261
 
267
- interface UseFeaturesResult {
268
- getFeature: (featureKey: string) => FeatureInfo | null;
269
- getFeatures: (featureKeys: string[]) => Record<string, FeatureInfo | null>;
270
- featuresMap: FeaturesMap | null;
271
- }
262
+ interface UseFeaturesResult {
263
+ getFeature: (featureKey: string) => FeatureInfo | null;
264
+ getFeatures: (featureKeys: string[]) => Record<string, FeatureInfo | null>;
265
+ featuresMap: FeaturesMap | null;
266
+ }
272
267
 
273
- export const useFeatures: () => UseFeaturesResult;
268
+ export const useFeatures: () => UseFeaturesResult;
274
269
 
275
- interface UseAccessOptions {
276
- extraPermissions?: string[];
277
- workplaceId?: string;
278
- }
270
+ interface UseAccessOptions {
271
+ extraPermissions?: string[];
272
+ workplaceId?: string;
273
+ }
279
274
 
280
- export type AccessAction = 'start_trial' | 'request_access' | 'renew' | 'buy' | 'wishlist';
275
+ export type AccessAction = 'start_trial' | 'request_access' | 'renew' | 'buy' | 'wishlist';
281
276
 
282
- export type AccessRequestType = 'feature_access' | 'trial_expired' | 'purchase' | 'wishlist';
277
+ export type AccessRequestType = 'feature_access' | 'trial_expired' | 'purchase' | 'wishlist';
283
278
 
284
- export type ButtonVariant = 'primary' | 'secondary' | 'link';
279
+ export type ButtonVariant = 'primary' | 'secondary' | 'link';
285
280
 
286
- export interface AccessButton {
287
- action: AccessAction;
288
- requestType: AccessRequestType | null;
289
- variant: ButtonVariant;
290
- }
281
+ export interface AccessButton {
282
+ action: AccessAction;
283
+ requestType: AccessRequestType | null;
284
+ variant: ButtonVariant;
285
+ }
291
286
 
292
- interface FeatureAccessDetail {
293
- featureKey: string;
294
- hasAccess: boolean;
295
- accessState: AccessState;
296
- daysSinceExpiry: number | null;
297
- buttons: AccessButton[];
298
- }
287
+ interface FeatureAccessDetail {
288
+ featureKey: string;
289
+ hasAccess: boolean;
290
+ accessState: AccessState;
291
+ daysSinceExpiry: number | null;
292
+ buttons: AccessButton[];
293
+ }
299
294
 
300
- interface UseAccessResult {
301
- hasAccess: boolean;
302
- accessState: AccessState;
303
- features: FeatureAccessDetail[];
304
- buttons: AccessButton[];
305
- cooldownInfo: CooldownInfo;
306
- missingPermissions: string[];
307
- }
295
+ interface UseAccessResult {
296
+ hasAccess: boolean;
297
+ accessState: AccessState;
298
+ features: FeatureAccessDetail[];
299
+ buttons: AccessButton[];
300
+ cooldownInfo: CooldownInfo;
301
+ missingPermissions: string[];
302
+ }
308
303
 
309
- export const useAccess: (features?: string[], options?: UseAccessOptions) => UseAccessResult;
304
+ export const useAccess: (features?: string[], options?: UseAccessOptions) => UseAccessResult;
310
305
 
311
- type ContentEventHandler = (event: string, payload?: unknown) => void;
312
- export const useHeaderContentEvent: (handler: ContentEventHandler) => void;
306
+ type ContentEventHandler = (event: string, payload?: unknown) => void;
307
+ export const useHeaderContentEvent: (handler: ContentEventHandler) => void;
313
308
 
314
- export interface FeatureRequestPayload {
315
- featureKey: string;
316
- requestType: AccessRequestType;
317
- workplaceId?: string;
318
- }
309
+ export interface FeatureRequestPayload {
310
+ featureKey: string;
311
+ requestType: AccessRequestType;
312
+ workplaceId?: string;
313
+ }
319
314
 
320
- interface AccessGuardProps {
321
- features?: string[];
322
- extraPermissions?: string[];
323
- workplaceId?: string;
324
- backgroundImage?: string;
325
- onTrialRequest: (featureKey: string) => Promise<boolean>;
326
- onFeatureRequest: (payload: FeatureRequestPayload) => Promise<boolean>;
327
- children: React.ReactNode;
328
- }
315
+ interface AccessGuardProps {
316
+ features?: string[];
317
+ extraPermissions?: string[];
318
+ workplaceId?: string;
319
+ backgroundImage?: string;
320
+ onTrialRequest: (featureKey: string) => Promise<boolean>;
321
+ onFeatureRequest: (payload: FeatureRequestPayload) => Promise<boolean>;
322
+ children: React.ReactNode;
323
+ }
324
+
325
+ export const AccessGuard: React.FC<AccessGuardProps>;
326
+
327
+ /**
328
+ * @note AccessBlocker is exported for demo/preview purposes only.
329
+ * For production use, prefer AccessGuard or withAccessGuard.
330
+ */
331
+ interface AccessBlockerProps {
332
+ accessState: AccessState;
333
+ buttons: AccessButton[];
334
+ featureKey: string;
335
+ daysSinceExpiry?: number;
336
+ workplaceId?: string;
337
+ backgroundImage?: string;
338
+ cooldownInfo?: CooldownInfo;
339
+ onTrialRequest: (featureKey: string) => Promise<boolean>;
340
+ onFeatureRequest: (payload: FeatureRequestPayload) => Promise<boolean>;
341
+ }
329
342
 
330
- export const AccessGuard: React.FC<AccessGuardProps>;
331
-
332
- /**
333
- * @note AccessBlocker is exported for demo/preview purposes only.
334
- * For production use, prefer AccessGuard or withAccessGuard.
335
- */
336
- interface AccessBlockerProps {
337
- accessState: AccessState;
338
- buttons: AccessButton[];
339
- featureKey: string;
340
- daysSinceExpiry?: number;
341
- workplaceId?: string;
342
- backgroundImage?: string;
343
- cooldownInfo?: CooldownInfo;
343
+ export const AccessBlocker: React.FC<AccessBlockerProps>;
344
+
345
+ interface AccessGuardInjectedProps {
346
+ accessState: AccessState;
347
+ hasAccess: boolean;
348
+ missingPermissions: string[];
349
+ }
350
+
351
+ export function withAccessGuard<P extends object>(
352
+ features?: string[],
353
+ options?: UseAccessOptions,
354
+ ): (Component: React.ComponentType<P & AccessGuardInjectedProps>) => React.FC<
355
+ P & {
344
356
  onTrialRequest: (featureKey: string) => Promise<boolean>;
345
357
  onFeatureRequest: (payload: FeatureRequestPayload) => Promise<boolean>;
346
358
  }
359
+ >;
347
360
 
348
- export const AccessBlocker: React.FC<AccessBlockerProps>;
361
+ export interface Session {
362
+ user: UserData;
363
+ accessToken: string;
364
+ refreshToken: string;
365
+ }
349
366
 
350
- interface AccessGuardInjectedProps {
351
- accessState: AccessState;
352
- hasAccess: boolean;
353
- missingPermissions: string[];
354
- }
367
+ interface LoginProps {
368
+ title?: string;
369
+ subtitle?: string;
370
+ redirectPath?: string;
371
+ storeSession?: boolean;
372
+ onSuccess?: (session: Session) => void;
373
+ onFailure?: () => void;
374
+ onCancel?: () => void;
375
+ }
376
+
377
+ export const useLogin: (scope: string, loginProps?: LoginProps) => () => void;
355
378
 
356
- export function withAccessGuard<P extends object>(
357
- features?: string[],
358
- options?: UseAccessOptions,
359
- ): (Component: React.ComponentType<P & AccessGuardInjectedProps>) => React.FC<
360
- P & {
361
- onTrialRequest: (featureKey: string) => Promise<boolean>;
362
- onFeatureRequest: (payload: FeatureRequestPayload) => Promise<boolean>;
363
- }
364
- >;
365
-
366
- export interface Session {
379
+ interface LoginStatus {
380
+ status: 'connected' | 'not_authorized' | 'unknown';
381
+ authResponse?: {
367
382
  user: UserData;
368
383
  accessToken: string;
369
384
  refreshToken: string;
370
- }
371
-
372
- interface LoginProps {
373
- title?: string;
374
- subtitle?: string;
375
- redirectPath?: string;
376
- storeSession?: boolean;
377
- onSuccess?: (session: Session) => void;
378
- onFailure?: () => void;
379
- onCancel?: () => void;
380
- }
381
-
382
- export const useLogin: (scope: string, loginProps?: LoginProps) => () => void;
383
-
384
- interface LoginStatus {
385
- status: 'connected' | 'not_authorized' | 'unknown';
386
- authResponse?: {
387
- user: UserData;
388
- accessToken: string;
389
- refreshToken: string;
390
- tokenType: string;
391
- createdAt: number;
392
- expiresIn: number;
393
- };
394
- }
385
+ tokenType: string;
386
+ createdAt: number;
387
+ expiresIn: number;
388
+ };
389
+ }
395
390
 
396
- interface SessionStore {
397
- loginStatus: LoginStatus;
398
- }
391
+ interface SessionStore {
392
+ loginStatus: LoginStatus;
393
+ }
399
394
 
400
- interface RootStore {
401
- sessionStore: SessionStore;
402
- }
395
+ interface RootStore {
396
+ sessionStore: SessionStore;
397
+ }
403
398
 
404
- export const useStore: () => RootStore;
399
+ export const useStore: () => RootStore;
405
400
 
406
- type ServiceWorkerRegistrationConfig = {
407
- onSuccess?: (registration: ServiceWorkerRegistration) => void;
408
- onUpdate?: (registration: ServiceWorkerRegistration, version?: string) => void;
409
- };
401
+ type ServiceWorkerRegistrationConfig = {
402
+ onSuccess?: (registration: ServiceWorkerRegistration) => void;
403
+ onUpdate?: (registration: ServiceWorkerRegistration, version?: string) => void;
404
+ };
410
405
 
411
- interface ServiceWorkerConfig {
412
- publicUrl: string;
413
- mode: 'development' | 'production' | 'test';
414
- version?: string;
415
- autoUpdate?: boolean;
416
- registrationConfig?: ServiceWorkerRegistrationConfig;
417
- }
406
+ interface ServiceWorkerConfig {
407
+ publicUrl: string;
408
+ mode: 'development' | 'production' | 'test';
409
+ version?: string;
410
+ autoUpdate?: boolean;
411
+ registrationConfig?: ServiceWorkerRegistrationConfig;
412
+ }
418
413
 
419
- export const useLoginStatus: () => LoginStatus;
414
+ export const useLoginStatus: () => LoginStatus;
420
415
 
421
- export const logout: () => void;
416
+ export const logout: () => void;
422
417
 
423
- export const refreshUserData: () => Promise<UserData | null>;
418
+ export const refreshUserData: () => Promise<UserData | null>;
424
419
 
425
- export const setLocale: (lang: string) => void;
420
+ export const setLocale: (lang: string) => void;
426
421
 
427
- export const getLocale: () => string;
422
+ export const getLocale: () => string;
428
423
 
429
- export const notify: typeof toast;
424
+ export const notify: typeof toast;
430
425
 
431
- export type AuthEventType = 'TOKEN_REFRESHED' | 'LOGOUT';
426
+ export type AuthEventType = 'TOKEN_REFRESHED' | 'LOGOUT';
432
427
 
433
- export interface AuthEvent {
434
- type: AuthEventType;
435
- }
428
+ export interface AuthEvent {
429
+ type: AuthEventType;
430
+ }
436
431
 
437
- export const fetch: typeof global.fetch;
432
+ export const fetch: typeof global.fetch;
438
433
 
439
- export const registerServiceWorker: (config: ServiceWorkerConfig) => void;
434
+ export const registerServiceWorker: (config: ServiceWorkerConfig) => void;
440
435
 
441
- export const registerTranslations: (locales: InitOptions['resources']) => void;
436
+ export const registerTranslations: (locales: InitOptions['resources']) => void;
442
437
 
443
- export const captureException: typeof Sentry.captureException;
438
+ export const captureException: typeof Sentry.captureException;
444
439
 
445
- export const Checkbox: React.FC<CheckboxProps>;
440
+ // NOTE: Checkbox/Radio/RadioGroup types loosened to `any` because their
441
+ // source declarations live in src/core/ui/* which is not bundled into
442
+ // published dist (only dist/index.js + dist/index.d.ts ship). Restoring
443
+ // proper types requires either bundling .d.ts (via tsdown --dts or
444
+ // rollup-plugin-dts) or migrating SDK to TypeScript (tech-debt #4).
445
+ // Downstream consumers will see these as React.FC<any> until then.
446
+ export const Checkbox: React.FC<any>;
446
447
 
447
- export const Radio: React.FC<RadioProps>;
448
+ export const Radio: React.FC<any>;
448
449
 
449
- export const RadioGroup: React.FC<RadioGroupProps>;
450
+ export const RadioGroup: React.FC<any>;
450
451
 
451
- export const sidePanelDefaultProps: SidePanelProps;
452
- }
452
+ export const sidePanelDefaultProps: SidePanelProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "andoncloud-sdk",
3
- "version": "1.7.33",
3
+ "version": "1.7.35",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "type": "module",
@@ -52,7 +52,7 @@
52
52
  "ajv": "^8.18.0",
53
53
  "andoncloud-library-scripts": "^2.0.0",
54
54
  "copyfiles": "^2.4.1",
55
- "cypress": "^15.13.1",
55
+ "cypress": "^15.16.0",
56
56
  "cypress-rspack-dev-server": "^1.1.2",
57
57
  "eslint": "8.57.1",
58
58
  "eslint-config-andoncloud": "^1.1.0",