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