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.
- package/dist/index.d.ts +346 -346
- 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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
interface MenuItem {
|
|
38
|
+
label: string;
|
|
39
|
+
url?: string;
|
|
40
|
+
action?: () => void;
|
|
41
|
+
}
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
interface I18nProps {
|
|
53
|
+
locales: InitOptions['resources'];
|
|
54
|
+
}
|
|
60
55
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
interface MetaProps {
|
|
57
|
+
appVersion?: string;
|
|
58
|
+
apiVersion?: string;
|
|
59
|
+
releaseVersion?: string;
|
|
60
|
+
releasePageLink?: string;
|
|
61
|
+
}
|
|
67
62
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
73
|
+
export const getDisplayMode: () => Display['mode'];
|
|
79
74
|
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
export const updateParentHeaderLeadingText: (text: string) => void;
|
|
76
|
+
export const resetParentHeaderLeadingText: () => void;
|
|
82
77
|
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
export const updateParentHeaderTitle: (title: string) => void;
|
|
79
|
+
export const resetParentHeaderTitle: () => void;
|
|
85
80
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
interface NavProps {
|
|
108
|
+
items?: NavItem[];
|
|
109
|
+
}
|
|
115
110
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
interface UserProps {
|
|
112
|
+
show?: boolean;
|
|
113
|
+
showCompanyLogo?: boolean;
|
|
114
|
+
}
|
|
120
115
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
116
|
+
interface MenuProps {
|
|
117
|
+
items?: MenuItem[];
|
|
118
|
+
buttonColor?: string;
|
|
119
|
+
dropdownStyles?: SxProps<Theme>;
|
|
120
|
+
styles?: SxProps<Theme>;
|
|
121
|
+
}
|
|
127
122
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
interface SidebarMenuItem extends NavItem {
|
|
139
|
+
items?: NavItem[];
|
|
140
|
+
}
|
|
146
141
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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
|
-
|
|
187
|
+
type EntitlementType = 'trial' | 'purchased' | null;
|
|
193
188
|
|
|
194
|
-
|
|
189
|
+
type AccessState = 'no_permission' | 'accessible' | 'expired' | 'not_purchased';
|
|
195
190
|
|
|
196
|
-
|
|
191
|
+
type DenyReason = 'MISSING_ROLE_PERMISSION' | 'EXPIRED_PLAN' | string;
|
|
197
192
|
|
|
198
|
-
|
|
193
|
+
type PermissionValue = 'ALLOW' | `DENY:${DenyReason}`;
|
|
199
194
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
195
|
+
interface PermissionsMap {
|
|
196
|
+
[permissionKey: string]: PermissionValue;
|
|
197
|
+
}
|
|
203
198
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
207
|
+
interface FeaturesMap {
|
|
208
|
+
[featureKey: string]: FeatureInfo;
|
|
209
|
+
}
|
|
215
210
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
211
|
+
interface RequestInfo {
|
|
212
|
+
lastRequestedAt: string;
|
|
213
|
+
daysRemaining: number;
|
|
214
|
+
}
|
|
220
215
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
};
|
|
216
|
+
interface FeaturesRequestsMap {
|
|
217
|
+
[workplaceIdOrCompany: string]: {
|
|
218
|
+
[featureKey: string]: {
|
|
219
|
+
[requestType: string]: RequestInfo;
|
|
226
220
|
};
|
|
227
|
-
}
|
|
221
|
+
};
|
|
222
|
+
}
|
|
228
223
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
interface CooldownStatus {
|
|
225
|
+
isInCooldown: boolean;
|
|
226
|
+
daysRemaining: number;
|
|
227
|
+
}
|
|
233
228
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
229
|
+
interface CooldownInfo {
|
|
230
|
+
[requestType: string]: CooldownStatus;
|
|
231
|
+
}
|
|
237
232
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
245
|
+
interface PermissionCheckResult {
|
|
246
|
+
isAllowed: boolean;
|
|
247
|
+
denyReason: DenyReason | null;
|
|
248
|
+
}
|
|
254
249
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
-
|
|
260
|
+
export const usePermissions: () => UsePermissionsResult;
|
|
266
261
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
268
|
+
export const useFeatures: () => UseFeaturesResult;
|
|
274
269
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
270
|
+
interface UseAccessOptions {
|
|
271
|
+
extraPermissions?: string[];
|
|
272
|
+
workplaceId?: string;
|
|
273
|
+
}
|
|
279
274
|
|
|
280
|
-
|
|
275
|
+
export type AccessAction = 'start_trial' | 'request_access' | 'renew' | 'buy' | 'wishlist';
|
|
281
276
|
|
|
282
|
-
|
|
277
|
+
export type AccessRequestType = 'feature_access' | 'trial_expired' | 'purchase' | 'wishlist';
|
|
283
278
|
|
|
284
|
-
|
|
279
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'link';
|
|
285
280
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
281
|
+
export interface AccessButton {
|
|
282
|
+
action: AccessAction;
|
|
283
|
+
requestType: AccessRequestType | null;
|
|
284
|
+
variant: ButtonVariant;
|
|
285
|
+
}
|
|
291
286
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
287
|
+
interface FeatureAccessDetail {
|
|
288
|
+
featureKey: string;
|
|
289
|
+
hasAccess: boolean;
|
|
290
|
+
accessState: AccessState;
|
|
291
|
+
daysSinceExpiry: number | null;
|
|
292
|
+
buttons: AccessButton[];
|
|
293
|
+
}
|
|
299
294
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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
|
-
|
|
304
|
+
export const useAccess: (features?: string[], options?: UseAccessOptions) => UseAccessResult;
|
|
310
305
|
|
|
311
|
-
|
|
312
|
-
|
|
306
|
+
type ContentEventHandler = (event: string, payload?: unknown) => void;
|
|
307
|
+
export const useHeaderContentEvent: (handler: ContentEventHandler) => void;
|
|
313
308
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
309
|
+
export interface FeatureRequestPayload {
|
|
310
|
+
featureKey: string;
|
|
311
|
+
requestType: AccessRequestType;
|
|
312
|
+
workplaceId?: string;
|
|
313
|
+
}
|
|
319
314
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
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
|
-
|
|
361
|
+
export interface Session {
|
|
362
|
+
user: UserData;
|
|
363
|
+
accessToken: string;
|
|
364
|
+
refreshToken: string;
|
|
365
|
+
}
|
|
349
366
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
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
|
-
|
|
357
|
-
|
|
358
|
-
|
|
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
|
-
|
|
373
|
-
|
|
374
|
-
|
|
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
|
-
|
|
397
|
-
|
|
398
|
-
|
|
391
|
+
interface SessionStore {
|
|
392
|
+
loginStatus: LoginStatus;
|
|
393
|
+
}
|
|
399
394
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
395
|
+
interface RootStore {
|
|
396
|
+
sessionStore: SessionStore;
|
|
397
|
+
}
|
|
403
398
|
|
|
404
|
-
|
|
399
|
+
export const useStore: () => RootStore;
|
|
405
400
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
401
|
+
type ServiceWorkerRegistrationConfig = {
|
|
402
|
+
onSuccess?: (registration: ServiceWorkerRegistration) => void;
|
|
403
|
+
onUpdate?: (registration: ServiceWorkerRegistration, version?: string) => void;
|
|
404
|
+
};
|
|
410
405
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
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
|
-
|
|
414
|
+
export const useLoginStatus: () => LoginStatus;
|
|
420
415
|
|
|
421
|
-
|
|
416
|
+
export const logout: () => void;
|
|
422
417
|
|
|
423
|
-
|
|
418
|
+
export const refreshUserData: () => Promise<UserData | null>;
|
|
424
419
|
|
|
425
|
-
|
|
420
|
+
export const setLocale: (lang: string) => void;
|
|
426
421
|
|
|
427
|
-
|
|
422
|
+
export const getLocale: () => string;
|
|
428
423
|
|
|
429
|
-
|
|
424
|
+
export const notify: typeof toast;
|
|
430
425
|
|
|
431
|
-
|
|
426
|
+
export type AuthEventType = 'TOKEN_REFRESHED' | 'LOGOUT';
|
|
432
427
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
428
|
+
export interface AuthEvent {
|
|
429
|
+
type: AuthEventType;
|
|
430
|
+
}
|
|
436
431
|
|
|
437
|
-
|
|
432
|
+
export const fetch: typeof global.fetch;
|
|
438
433
|
|
|
439
|
-
|
|
434
|
+
export const registerServiceWorker: (config: ServiceWorkerConfig) => void;
|
|
440
435
|
|
|
441
|
-
|
|
436
|
+
export const registerTranslations: (locales: InitOptions['resources']) => void;
|
|
442
437
|
|
|
443
|
-
|
|
438
|
+
export const captureException: typeof Sentry.captureException;
|
|
444
439
|
|
|
445
|
-
|
|
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
|
-
|
|
448
|
+
export const Radio: React.FC<any>;
|
|
448
449
|
|
|
449
|
-
|
|
450
|
+
export const RadioGroup: React.FC<any>;
|
|
450
451
|
|
|
451
|
-
|
|
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.
|
|
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.
|
|
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",
|