@selfcommunity/react-core 0.4.50-alpha.0 → 0.4.50-event.30
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/lib/cjs/components/provider/SCUserProvider/index.js +4 -4
- package/lib/cjs/constants/Cache.d.ts +3 -0
- package/lib/cjs/constants/Cache.js +6 -2
- package/lib/cjs/constants/Integrations.d.ts +13 -0
- package/lib/cjs/constants/Integrations.js +17 -0
- package/lib/cjs/constants/Notifications.d.ts +2 -1
- package/lib/cjs/constants/Notifications.js +4 -3
- package/lib/cjs/constants/Preferences.d.ts +3 -0
- package/lib/cjs/constants/Preferences.js +8 -2
- package/lib/cjs/constants/Routes.d.ts +4 -0
- package/lib/cjs/constants/Routes.js +9 -1
- package/lib/cjs/hooks/useSCFetchEvent.d.ts +20 -0
- package/lib/cjs/hooks/useSCFetchEvent.js +74 -0
- package/lib/cjs/index.d.ts +2 -1
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/types/context.d.ts +37 -0
- package/lib/cjs/utils/errors.d.ts +6 -0
- package/lib/cjs/utils/errors.js +12 -0
- package/lib/cjs/utils/hooks/useIsomorphicLayoutEffect.js +2 -1
- package/lib/cjs/utils/notification.js +1 -1
- package/lib/cjs/utils/validator.d.ts +103 -28
- package/lib/cjs/utils/validator.js +178 -31
- package/lib/esm/components/provider/SCUserProvider/index.js +5 -5
- package/lib/esm/constants/Cache.d.ts +3 -0
- package/lib/esm/constants/Cache.js +3 -0
- package/lib/esm/constants/Integrations.d.ts +13 -0
- package/lib/esm/constants/Integrations.js +14 -0
- package/lib/esm/constants/Notifications.d.ts +2 -1
- package/lib/esm/constants/Notifications.js +3 -2
- package/lib/esm/constants/Preferences.d.ts +3 -0
- package/lib/esm/constants/Preferences.js +6 -0
- package/lib/esm/constants/Routes.d.ts +4 -0
- package/lib/esm/constants/Routes.js +8 -0
- package/lib/esm/hooks/useSCFetchEvent.d.ts +20 -0
- package/lib/esm/hooks/useSCFetchEvent.js +71 -0
- package/lib/esm/index.d.ts +2 -1
- package/lib/esm/index.js +2 -1
- package/lib/esm/types/context.d.ts +37 -0
- package/lib/esm/utils/errors.d.ts +6 -0
- package/lib/esm/utils/errors.js +12 -0
- package/lib/esm/utils/hooks/useIsomorphicLayoutEffect.js +2 -1
- package/lib/esm/utils/notification.js +2 -2
- package/lib/esm/utils/validator.d.ts +103 -28
- package/lib/esm/utils/validator.js +171 -30
- package/lib/umd/react-core.js +1 -1
- package/package.json +6 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SCNotificationsMobileNativePushMessagingType, SCNotificationsType, SCNotificationsWebPushMessagingType, SCNotificationsWebSocketType, SCSettingsType } from '../types/context';
|
|
1
|
+
import { SCGeocodingType, SCIntegrationsOpenAIType, SCIntegrationsType, SCNotificationsMobileNativePushMessagingType, SCNotificationsType, SCNotificationsWebPushMessagingType, SCNotificationsWebSocketType, SCSettingsType } from '../types/context';
|
|
2
2
|
import { ValidationResult } from './errors';
|
|
3
3
|
import { SCLocaleType } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Validate session option
|
|
6
|
-
* @param
|
|
6
|
+
* @param v
|
|
7
7
|
* @return {}
|
|
8
8
|
*/
|
|
9
9
|
export declare function validateSession(v: Record<string, any>): {
|
|
@@ -14,6 +14,7 @@ export declare function validateSession(v: Record<string, any>): {
|
|
|
14
14
|
/**
|
|
15
15
|
* Validate session type
|
|
16
16
|
* @param value
|
|
17
|
+
* @param session
|
|
17
18
|
* @return {}
|
|
18
19
|
*/
|
|
19
20
|
export declare const validateSessionType: (value: any, session: any) => {
|
|
@@ -24,6 +25,7 @@ export declare const validateSessionType: (value: any, session: any) => {
|
|
|
24
25
|
/**
|
|
25
26
|
* Validate session client id
|
|
26
27
|
* @param value
|
|
28
|
+
* @param session
|
|
27
29
|
* @return {}
|
|
28
30
|
*/
|
|
29
31
|
export declare const validateSessionClientId: (value: any, session: any) => {
|
|
@@ -34,6 +36,7 @@ export declare const validateSessionClientId: (value: any, session: any) => {
|
|
|
34
36
|
/**
|
|
35
37
|
* Validate session auth token
|
|
36
38
|
* @param value
|
|
39
|
+
* @param session
|
|
37
40
|
* @return {}
|
|
38
41
|
*/
|
|
39
42
|
export declare const validateSessionAuthTokenOption: (value: any, session: any) => {
|
|
@@ -55,6 +58,7 @@ export declare const validateHandleRefreshToken: (value: any, session: any) => {
|
|
|
55
58
|
/**
|
|
56
59
|
* Validate handleLogout option
|
|
57
60
|
* @param value
|
|
61
|
+
* @param session
|
|
58
62
|
* @return {}
|
|
59
63
|
*/
|
|
60
64
|
export declare const validateHandleLogout: (value: any, session: any) => {
|
|
@@ -64,7 +68,7 @@ export declare const validateHandleLogout: (value: any, session: any) => {
|
|
|
64
68
|
};
|
|
65
69
|
/**
|
|
66
70
|
* Validate notifications option
|
|
67
|
-
* @param
|
|
71
|
+
* @param v
|
|
68
72
|
* @return {}
|
|
69
73
|
*/
|
|
70
74
|
export declare function validateNotifications(v: SCNotificationsType): {
|
|
@@ -74,8 +78,7 @@ export declare function validateNotifications(v: SCNotificationsType): {
|
|
|
74
78
|
};
|
|
75
79
|
/**
|
|
76
80
|
* Validate webSocket
|
|
77
|
-
* @param
|
|
78
|
-
* @param {}
|
|
81
|
+
* @param v
|
|
79
82
|
*/
|
|
80
83
|
export declare const validateWebSocket: (v: any) => {
|
|
81
84
|
errors: any[];
|
|
@@ -91,9 +94,8 @@ export declare const validateWebSocket: (v: any) => {
|
|
|
91
94
|
/**
|
|
92
95
|
* Validate default disableToastMessage (webSocket)
|
|
93
96
|
* @param value
|
|
94
|
-
* @param {}
|
|
95
97
|
*/
|
|
96
|
-
export declare const validateWebSocketDisableToastMessage: (value: any
|
|
98
|
+
export declare const validateWebSocketDisableToastMessage: (value: any) => {
|
|
97
99
|
errors: any[];
|
|
98
100
|
warnings: any[];
|
|
99
101
|
value: any;
|
|
@@ -101,17 +103,24 @@ export declare const validateWebSocketDisableToastMessage: (value: any, notifica
|
|
|
101
103
|
/**
|
|
102
104
|
* Validate default secure (webSocket)
|
|
103
105
|
* @param value
|
|
104
|
-
* @param {}
|
|
105
106
|
*/
|
|
106
|
-
export declare const validateWebSocketSecure: (value: any
|
|
107
|
+
export declare const validateWebSocketSecure: (value: any) => {
|
|
107
108
|
errors: any[];
|
|
108
109
|
warnings: any[];
|
|
109
110
|
value: any;
|
|
110
111
|
};
|
|
111
112
|
/**
|
|
112
|
-
* Validate
|
|
113
|
+
* Validate prefixPath (webSocket)
|
|
113
114
|
* @param value
|
|
114
|
-
|
|
115
|
+
*/
|
|
116
|
+
export declare const validateWebSocketPrefixPath: (value: any) => {
|
|
117
|
+
errors: any[];
|
|
118
|
+
warnings: any[];
|
|
119
|
+
value: any;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Validate webPushMessaging
|
|
123
|
+
* @param v
|
|
115
124
|
*/
|
|
116
125
|
export declare const validateWebPushMessaging: (v: any) => {
|
|
117
126
|
errors: any[];
|
|
@@ -127,9 +136,8 @@ export declare const validateWebPushMessaging: (v: any) => {
|
|
|
127
136
|
/**
|
|
128
137
|
* Validate default disableToastMessage (webPushMessaging)
|
|
129
138
|
* @param value
|
|
130
|
-
* @param {}
|
|
131
139
|
*/
|
|
132
|
-
export declare const validateWebPushMessagingDisableToastMessage: (value: any
|
|
140
|
+
export declare const validateWebPushMessagingDisableToastMessage: (value: any) => {
|
|
133
141
|
errors: any[];
|
|
134
142
|
warnings: any[];
|
|
135
143
|
value: any;
|
|
@@ -137,17 +145,15 @@ export declare const validateWebPushMessagingDisableToastMessage: (value: any, n
|
|
|
137
145
|
/**
|
|
138
146
|
* Validate default applicationServerKey (webPushMessaging)
|
|
139
147
|
* @param value
|
|
140
|
-
* @param {}
|
|
141
148
|
*/
|
|
142
|
-
export declare const validateWebPushMessagingApplicationServerKey: (value: any
|
|
149
|
+
export declare const validateWebPushMessagingApplicationServerKey: (value: any) => {
|
|
143
150
|
errors: any[];
|
|
144
151
|
warnings: any[];
|
|
145
152
|
value: any;
|
|
146
153
|
};
|
|
147
154
|
/**
|
|
148
155
|
* Validate mobile native
|
|
149
|
-
* @param
|
|
150
|
-
* @param {}
|
|
156
|
+
* @param v
|
|
151
157
|
*/
|
|
152
158
|
export declare const validateMobileNativePushMessaging: (v: any) => {
|
|
153
159
|
errors: any[];
|
|
@@ -163,16 +169,15 @@ export declare const validateMobileNativePushMessaging: (v: any) => {
|
|
|
163
169
|
/**
|
|
164
170
|
* Validate default disable (mobileNativePushMessaging)
|
|
165
171
|
* @param value
|
|
166
|
-
* @param {}
|
|
167
172
|
*/
|
|
168
|
-
export declare const validateMobileNativePushMessagingDisable: (value: any
|
|
173
|
+
export declare const validateMobileNativePushMessagingDisable: (value: any) => {
|
|
169
174
|
errors: any[];
|
|
170
175
|
warnings: any[];
|
|
171
176
|
value: any;
|
|
172
177
|
};
|
|
173
178
|
/**
|
|
174
179
|
* Validate portal option
|
|
175
|
-
* @param
|
|
180
|
+
* @param value
|
|
176
181
|
* @return {}
|
|
177
182
|
*/
|
|
178
183
|
export declare const validatePortal: (value: any) => {
|
|
@@ -183,7 +188,7 @@ export declare const validatePortal: (value: any) => {
|
|
|
183
188
|
/**
|
|
184
189
|
* Validate default locale
|
|
185
190
|
* @param value
|
|
186
|
-
* @param
|
|
191
|
+
* @param locale
|
|
187
192
|
*/
|
|
188
193
|
export declare const validateLocaleDefault: (value: any, locale: any) => {
|
|
189
194
|
errors: any[];
|
|
@@ -193,7 +198,6 @@ export declare const validateLocaleDefault: (value: any, locale: any) => {
|
|
|
193
198
|
/**
|
|
194
199
|
* Validate default locale
|
|
195
200
|
* @param value
|
|
196
|
-
* @param {}
|
|
197
201
|
*/
|
|
198
202
|
export declare const validateLocaleMessages: (value: any) => {
|
|
199
203
|
errors: any[];
|
|
@@ -202,7 +206,7 @@ export declare const validateLocaleMessages: (value: any) => {
|
|
|
202
206
|
};
|
|
203
207
|
/**
|
|
204
208
|
* Validate locale option
|
|
205
|
-
* @param
|
|
209
|
+
* @param v
|
|
206
210
|
* @return {}
|
|
207
211
|
*/
|
|
208
212
|
export declare const validateLocale: (v: any) => {
|
|
@@ -218,7 +222,7 @@ export declare const validateLocale: (v: any) => {
|
|
|
218
222
|
};
|
|
219
223
|
/**
|
|
220
224
|
* Validate router option
|
|
221
|
-
* @param
|
|
225
|
+
* @param value
|
|
222
226
|
* @return {}
|
|
223
227
|
*/
|
|
224
228
|
export declare const validateRouter: (value: any) => {
|
|
@@ -228,7 +232,7 @@ export declare const validateRouter: (value: any) => {
|
|
|
228
232
|
};
|
|
229
233
|
/**
|
|
230
234
|
* Validate theme option
|
|
231
|
-
* @param
|
|
235
|
+
* @param value
|
|
232
236
|
* @return {}
|
|
233
237
|
*/
|
|
234
238
|
export declare const validateTheme: (value: any) => {
|
|
@@ -238,7 +242,7 @@ export declare const validateTheme: (value: any) => {
|
|
|
238
242
|
};
|
|
239
243
|
/**
|
|
240
244
|
* Validate handleAnonymousAction option
|
|
241
|
-
* @param
|
|
245
|
+
* @param v
|
|
242
246
|
* @return {}
|
|
243
247
|
*/
|
|
244
248
|
export declare const validateHandleAnonymousAction: (v: any) => {
|
|
@@ -248,7 +252,7 @@ export declare const validateHandleAnonymousAction: (v: any) => {
|
|
|
248
252
|
};
|
|
249
253
|
/**
|
|
250
254
|
* Validate contextProviders option
|
|
251
|
-
* @param
|
|
255
|
+
* @param value
|
|
252
256
|
* @return [...contextProviders]
|
|
253
257
|
*/
|
|
254
258
|
export declare const validateContextProviders: (value: any) => {
|
|
@@ -304,6 +308,73 @@ export declare function validateVote(v: Record<string, any>): {
|
|
|
304
308
|
warnings: any[];
|
|
305
309
|
value: Record<string, any>;
|
|
306
310
|
};
|
|
311
|
+
/**
|
|
312
|
+
* Validate integrations option
|
|
313
|
+
* @param v
|
|
314
|
+
* @return {}
|
|
315
|
+
*/
|
|
316
|
+
export declare function validateIntegrations(v: SCIntegrationsType): {
|
|
317
|
+
errors: any[];
|
|
318
|
+
warnings: any[];
|
|
319
|
+
value: {
|
|
320
|
+
openai: {
|
|
321
|
+
secretKey: any;
|
|
322
|
+
};
|
|
323
|
+
geocoding: {
|
|
324
|
+
apiKey: any;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* Validate OpenAI Option
|
|
330
|
+
* @param v
|
|
331
|
+
*/
|
|
332
|
+
export declare const validateOpenAI: (v: any) => {
|
|
333
|
+
errors: any[];
|
|
334
|
+
warnings: any[];
|
|
335
|
+
v: any;
|
|
336
|
+
value?: undefined;
|
|
337
|
+
} | {
|
|
338
|
+
errors: any[];
|
|
339
|
+
warnings: any[];
|
|
340
|
+
value: SCIntegrationsOpenAIType;
|
|
341
|
+
v?: undefined;
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* Validate Geocoding Option
|
|
345
|
+
* @param v
|
|
346
|
+
*/
|
|
347
|
+
export declare const validateGeocoding: (v: any) => {
|
|
348
|
+
errors: any[];
|
|
349
|
+
warnings: any[];
|
|
350
|
+
v: any;
|
|
351
|
+
value?: undefined;
|
|
352
|
+
} | {
|
|
353
|
+
errors: any[];
|
|
354
|
+
warnings: any[];
|
|
355
|
+
value: SCGeocodingType;
|
|
356
|
+
v?: undefined;
|
|
357
|
+
};
|
|
358
|
+
/**
|
|
359
|
+
* Validate OpenAI secret key option
|
|
360
|
+
* @param value
|
|
361
|
+
* @return {}
|
|
362
|
+
*/
|
|
363
|
+
export declare const validateOpenAISecretKey: (value: any) => {
|
|
364
|
+
errors: any[];
|
|
365
|
+
warnings: any[];
|
|
366
|
+
value: any;
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* Validate Geocoding api key option
|
|
370
|
+
* @param value
|
|
371
|
+
* @return {}
|
|
372
|
+
*/
|
|
373
|
+
export declare const validateGeocodingApiKey: (value: any) => {
|
|
374
|
+
errors: any[];
|
|
375
|
+
warnings: any[];
|
|
376
|
+
value: any;
|
|
377
|
+
};
|
|
307
378
|
/**
|
|
308
379
|
* Valid options
|
|
309
380
|
* @type {{}}
|
|
@@ -317,12 +388,16 @@ export declare const notificationsWebPushMessagingOptions: Record<string, any>;
|
|
|
317
388
|
export declare const notificationsMobileNativePushMessagingOptions: Record<string, any>;
|
|
318
389
|
export declare const preferencesOptions: Record<string, any>;
|
|
319
390
|
export declare const voteOptions: Record<string, any>;
|
|
391
|
+
export declare const integrationsOptions: Record<string, any>;
|
|
392
|
+
export declare const integrationsOpenAIOptions: Record<string, any>;
|
|
393
|
+
export declare const integrationsGeocodingOptions: Record<string, any>;
|
|
320
394
|
export declare const validOptions: {
|
|
321
395
|
[x: string]: any;
|
|
322
396
|
};
|
|
323
397
|
/**
|
|
324
398
|
* Validate all options by type
|
|
325
|
-
* @param
|
|
399
|
+
* @param values
|
|
400
|
+
* @param schemaOptions
|
|
326
401
|
* @return {options hydrated}
|
|
327
402
|
*/
|
|
328
403
|
export declare const validateOptions: (values: SCSettingsType, schemaOptions: Record<string, any>) => {
|