@magmamath/frontend-config 1.0.23 → 1.0.24-rc.10
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.mts +145 -114
- package/dist/index.d.ts +145 -114
- package/dist/index.js +775 -674
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +775 -670
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -4
package/dist/index.d.mts
CHANGED
|
@@ -88,7 +88,6 @@ declare enum LoginSource {
|
|
|
88
88
|
MY_LOGIN = 9
|
|
89
89
|
}
|
|
90
90
|
declare enum SSO {
|
|
91
|
-
APPLE = "APPLE",
|
|
92
91
|
GOOGLE = "GOOGLE",
|
|
93
92
|
MICROSOFT = "MICROSOFT",
|
|
94
93
|
CLEVER = "CLEVER",
|
|
@@ -104,86 +103,57 @@ declare enum ApiRegion {
|
|
|
104
103
|
MAIN = "MAIN",
|
|
105
104
|
CANADA = "CANADA"
|
|
106
105
|
}
|
|
107
|
-
declare enum QRCodeSize {
|
|
108
|
-
DEFAULT = "default",
|
|
109
|
-
MEDIUM = "medium",
|
|
110
|
-
LARGE = "large"
|
|
111
|
-
}
|
|
112
106
|
|
|
113
107
|
declare enum MatrixMode {
|
|
114
108
|
SKILL = "SKILL",
|
|
115
109
|
STANDARD = "STANDARD"
|
|
116
110
|
}
|
|
117
111
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
declare enum Grade {
|
|
113
|
+
OTHER = "-1",
|
|
114
|
+
ZERO = "0",
|
|
115
|
+
ONE = "1",
|
|
116
|
+
TWO = "2",
|
|
117
|
+
THREE = "3",
|
|
118
|
+
FOUR = "4",
|
|
119
|
+
FIVE = "5",
|
|
120
|
+
SIX = "6",
|
|
121
|
+
SEVEN = "7",
|
|
122
|
+
EIGHT = "8",
|
|
123
|
+
NINE = "9",
|
|
124
|
+
TEN = "10",
|
|
125
|
+
ELEVEN = "11",
|
|
126
|
+
TWELVE = "12",
|
|
127
|
+
THIRTEEN = "13",
|
|
128
|
+
ALGEBRA_1 = "21",
|
|
129
|
+
GEOMETRY = "22",
|
|
130
|
+
ALGEBRA_2 = "23",
|
|
131
|
+
INTEGRATED_MATH_I = "24",
|
|
132
|
+
INTEGRATED_MATH_II = "25",
|
|
133
|
+
INTEGRATED_MATH_III = "26",
|
|
134
|
+
PRECALCULUS = "27",
|
|
135
|
+
HS = "HS",
|
|
136
|
+
HSG = "HSG",
|
|
137
|
+
HSA = "HSA",
|
|
138
|
+
HSS = "HSS",
|
|
139
|
+
HSF = "HSF",
|
|
140
|
+
HSN = "HSN",
|
|
141
|
+
ALL = "all",
|
|
142
|
+
K = "K"
|
|
143
|
+
}
|
|
121
144
|
|
|
122
|
-
type
|
|
145
|
+
type GradeData = {
|
|
123
146
|
name: string;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
loginSource: LoginSource;
|
|
127
|
-
ownUrl?: boolean;
|
|
128
|
-
getUrl: (envs: E) => string;
|
|
129
|
-
}>;
|
|
130
|
-
|
|
131
|
-
type RegionSpecificVars = {
|
|
132
|
-
API_URL: string;
|
|
133
|
-
AUTH_WEB_URL: string;
|
|
134
|
-
CDN_HOST: string;
|
|
135
|
-
DISTRICT_WEB_URL: string;
|
|
136
|
-
LOGGLY_TAG: string;
|
|
137
|
-
MAGMAMATH_URL: string;
|
|
138
|
-
SOCKET_URL: string;
|
|
139
|
-
STUDENTS_WEB_URL: string;
|
|
140
|
-
TEACHERS_WEB_URL: string;
|
|
147
|
+
displayOnly?: boolean;
|
|
148
|
+
noPrefix?: boolean;
|
|
141
149
|
};
|
|
150
|
+
type CommonGrades = Grade.ALL | Grade.OTHER | Grade.ZERO | Grade.K;
|
|
151
|
+
type PrimaryGrades = CommonGrades | Grade.ONE | Grade.TWO | Grade.THREE | Grade.FOUR | Grade.FIVE | Grade.SIX | Grade.SEVEN | Grade.EIGHT | Grade.NINE | Grade.TEN | Grade.ELEVEN | Grade.TWELVE | Grade.THIRTEEN;
|
|
152
|
+
type HighSchoolGrades = Grade.ALGEBRA_1 | Grade.GEOMETRY | Grade.ALGEBRA_2 | Grade.INTEGRATED_MATH_I | Grade.INTEGRATED_MATH_II | Grade.INTEGRATED_MATH_III | Grade.PRECALCULUS;
|
|
153
|
+
type TreeNodeGrades = Grade.HS | Grade.HSG | Grade.HSA | Grade.HSS | Grade.HSF | Grade.HSN;
|
|
142
154
|
|
|
143
|
-
type
|
|
144
|
-
|
|
145
|
-
DESMOS_API_KEY: string;
|
|
146
|
-
LOGGLY_CUSTOMER_TOKEN: string;
|
|
147
|
-
MYSCRIPT_APPLICATION_KEY: string;
|
|
148
|
-
MYSCRIPT_HMAC_KEY: string;
|
|
149
|
-
MYSCRIPT_HOST: string;
|
|
150
|
-
MYSCRIPT_SOCKET_KEY: string;
|
|
151
|
-
MYSCRIPT_REST_APP_KEY: string;
|
|
152
|
-
MYSCRIPT_REST_HMAC_KEY: string;
|
|
153
|
-
};
|
|
154
|
-
type StudentsWebVars = RegionSpecificVars & StudentsWebCommon;
|
|
155
|
-
type StudentsWebVarsPreset = {
|
|
156
|
-
[key in Locale]: {
|
|
157
|
-
[key in Environment]: StudentsWebVars;
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
type TeachersWebCommon = {
|
|
162
|
-
MYSCRIPT_HOST: string;
|
|
163
|
-
MYSCRIPT_REST_APP_KEY: string;
|
|
164
|
-
MYSCRIPT_REST_HMAC_KEY: string;
|
|
165
|
-
PROBLEM_IMAGE_SIZE_LIMIT: number;
|
|
166
|
-
INTERCOM_APP_ID: string;
|
|
167
|
-
CLARITY_PROJECT_ID: string;
|
|
168
|
-
LOGGLY_CUSTOMER_TOKEN: string;
|
|
169
|
-
};
|
|
170
|
-
type TeachersWebVars = RegionSpecificVars & TeachersWebCommon;
|
|
171
|
-
type TeachersWebVarsPreset = {
|
|
172
|
-
[key in Locale]: {
|
|
173
|
-
[key in Environment]: TeachersWebVars;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
type DistrictCommon = {
|
|
178
|
-
INTERCOM_APP_ID: string;
|
|
179
|
-
CLARITY_PROJECT_ID: string;
|
|
180
|
-
PROBLEM_IMAGE_SIZE_LIMIT: number;
|
|
181
|
-
};
|
|
182
|
-
type DistrictDashboardVars = Omit<RegionSpecificVars, 'SOCKET_URL'> & DistrictCommon;
|
|
183
|
-
type DistrictWebVarsPreset = {
|
|
184
|
-
[key in Locale]: {
|
|
185
|
-
[key in Environment]: DistrictDashboardVars;
|
|
186
|
-
};
|
|
155
|
+
type IconProps = {
|
|
156
|
+
size?: number;
|
|
187
157
|
};
|
|
188
158
|
|
|
189
159
|
type SSO_UK = {
|
|
@@ -223,6 +193,18 @@ type Prettify<T> = T extends Function ? T : {
|
|
|
223
193
|
[K in keyof T]: T[K];
|
|
224
194
|
};
|
|
225
195
|
|
|
196
|
+
type RegionSpecificVars = {
|
|
197
|
+
API_URL: string;
|
|
198
|
+
AUTH_WEB_URL: string;
|
|
199
|
+
CDN_HOST: string;
|
|
200
|
+
DISTRICT_WEB_URL: string;
|
|
201
|
+
LOGGLY_TAG: string;
|
|
202
|
+
MAGMAMATH_URL: string;
|
|
203
|
+
SOCKET_URL: string;
|
|
204
|
+
STUDENTS_WEB_URL: string;
|
|
205
|
+
TEACHERS_WEB_URL: string;
|
|
206
|
+
};
|
|
207
|
+
|
|
226
208
|
type AuthWebVars<T extends SSOVariant> = Prettify<AuthWebBaseVars & T>;
|
|
227
209
|
type AuthWebBaseVars = Omit<RegionSpecificVars, 'CDN_HOST' | 'LOGGLY_TAG' | 'SOCKET_URL'> & {
|
|
228
210
|
TOS_URL: string;
|
|
@@ -250,6 +232,61 @@ type AuthWebVarsPreset = {
|
|
|
250
232
|
};
|
|
251
233
|
};
|
|
252
234
|
|
|
235
|
+
type SSOConfig<T extends SSOVariant> = Readonly<{
|
|
236
|
+
name: string;
|
|
237
|
+
icon: ComponentType<IconProps>;
|
|
238
|
+
type: SSO;
|
|
239
|
+
loginSource: LoginSource;
|
|
240
|
+
getUrl: (envs: AuthWebVars<T>) => string;
|
|
241
|
+
ownUrl?: boolean;
|
|
242
|
+
}>;
|
|
243
|
+
|
|
244
|
+
type StudentsWebCommon = {
|
|
245
|
+
GOOGLE_API_KEY: string;
|
|
246
|
+
DESMOS_API_KEY: string;
|
|
247
|
+
LOGGLY_CUSTOMER_TOKEN: string;
|
|
248
|
+
MYSCRIPT_APPLICATION_KEY: string;
|
|
249
|
+
MYSCRIPT_HMAC_KEY: string;
|
|
250
|
+
MYSCRIPT_HOST: string;
|
|
251
|
+
MYSCRIPT_SOCKET_KEY: string;
|
|
252
|
+
MYSCRIPT_REST_APP_KEY: string;
|
|
253
|
+
MYSCRIPT_REST_HMAC_KEY: string;
|
|
254
|
+
};
|
|
255
|
+
type StudentsWebVars = RegionSpecificVars & StudentsWebCommon;
|
|
256
|
+
type StudentsWebVarsPreset = {
|
|
257
|
+
[key in Locale]: {
|
|
258
|
+
[key in Environment]: StudentsWebVars;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
type TeachersWebCommon = {
|
|
263
|
+
MYSCRIPT_HOST: string;
|
|
264
|
+
MYSCRIPT_REST_APP_KEY: string;
|
|
265
|
+
MYSCRIPT_REST_HMAC_KEY: string;
|
|
266
|
+
PROBLEM_IMAGE_SIZE_LIMIT: number;
|
|
267
|
+
INTERCOM_APP_ID: string;
|
|
268
|
+
CLARITY_PROJECT_ID: string;
|
|
269
|
+
LOGGLY_CUSTOMER_TOKEN: string;
|
|
270
|
+
};
|
|
271
|
+
type TeachersWebVars = RegionSpecificVars & TeachersWebCommon;
|
|
272
|
+
type TeachersWebVarsPreset = {
|
|
273
|
+
[key in Locale]: {
|
|
274
|
+
[key in Environment]: TeachersWebVars;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
type DistrictCommon = {
|
|
279
|
+
INTERCOM_APP_ID: string;
|
|
280
|
+
CLARITY_PROJECT_ID: string;
|
|
281
|
+
PROBLEM_IMAGE_SIZE_LIMIT: number;
|
|
282
|
+
};
|
|
283
|
+
type DistrictDashboardVars = Omit<RegionSpecificVars, 'SOCKET_URL'> & DistrictCommon;
|
|
284
|
+
type DistrictWebVarsPreset = {
|
|
285
|
+
[key in Locale]: {
|
|
286
|
+
[key in Environment]: DistrictDashboardVars;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
|
|
253
290
|
type MobileCommon = {
|
|
254
291
|
DESMOS_API_KEY: string;
|
|
255
292
|
USER_AGENT: string;
|
|
@@ -260,13 +297,9 @@ type MobileCommon = {
|
|
|
260
297
|
MYSCRIPT_SOCKET_KEY: string;
|
|
261
298
|
MYSCRIPT_REST_APP_KEY: string;
|
|
262
299
|
MYSCRIPT_REST_HMAC_KEY: string;
|
|
263
|
-
GOOGLE_API_KEY: string;
|
|
264
|
-
GOOGLE_TEXT_TO_SPEECH_URL: string;
|
|
265
|
-
GOOGLE_TRANSLATE_URL: string;
|
|
266
300
|
};
|
|
267
301
|
type MobileBaseVars = {
|
|
268
302
|
TEACHERS_WEB_URL: string;
|
|
269
|
-
AUTH_WEB_URL: string;
|
|
270
303
|
API_URL: string;
|
|
271
304
|
CDN_HOST: string;
|
|
272
305
|
SOCKET_URL: string;
|
|
@@ -371,22 +404,11 @@ type StudentsLocaleConfig = CommonLocaleConfig & {
|
|
|
371
404
|
};
|
|
372
405
|
|
|
373
406
|
type TeachersLocaleConfig = CommonLocaleConfig & {
|
|
374
|
-
country: string;
|
|
375
|
-
emails: {
|
|
376
|
-
studentsList: string;
|
|
377
|
-
};
|
|
378
407
|
symbols: {
|
|
379
408
|
decimalSeparator: string;
|
|
380
409
|
};
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
locale: DateLocale;
|
|
384
|
-
formats: {
|
|
385
|
-
full: DateFormat;
|
|
386
|
-
dayMonth: DateFormat;
|
|
387
|
-
hoursMinutes: DateFormat;
|
|
388
|
-
fullWithSeconds: DateFormat;
|
|
389
|
-
};
|
|
410
|
+
emails: {
|
|
411
|
+
studentsList: string;
|
|
390
412
|
};
|
|
391
413
|
urls: {
|
|
392
414
|
specialBook: string;
|
|
@@ -417,39 +439,22 @@ type TeachersLocaleConfig = CommonLocaleConfig & {
|
|
|
417
439
|
};
|
|
418
440
|
firstLoginBooks: {
|
|
419
441
|
isLargeGrade: ((grade: number) => boolean) | null;
|
|
420
|
-
|
|
421
|
-
grades: {
|
|
422
|
-
showPrefix: boolean;
|
|
423
|
-
showOtherGrade: boolean;
|
|
424
|
-
};
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
type DistrictLocaleConfig = CommonLocaleConfig & {
|
|
428
|
-
date: {
|
|
429
|
-
use24HourFormat: boolean;
|
|
430
|
-
locale: DateLocale;
|
|
431
|
-
formats: {
|
|
432
|
-
full: DateFormat;
|
|
433
|
-
dayMonthYear: DateFormat;
|
|
434
|
-
dayMonth: DateFormat;
|
|
435
|
-
hoursMinutes: DateFormat;
|
|
436
|
-
fullWithSeconds: DateFormat;
|
|
437
|
-
};
|
|
442
|
+
useHighSchoolGrades: boolean;
|
|
438
443
|
};
|
|
439
444
|
};
|
|
440
445
|
|
|
441
|
-
type
|
|
446
|
+
type AuthWebLocaleConfig<T extends SSOVariant> = {
|
|
442
447
|
path: string;
|
|
443
448
|
shortCode: string;
|
|
444
449
|
icon: ComponentType<IconProps>;
|
|
445
450
|
sources: {
|
|
446
451
|
signUp: {
|
|
447
|
-
list: SSOConfig<
|
|
452
|
+
list: SSOConfig<T>[];
|
|
448
453
|
};
|
|
449
454
|
signIn: {
|
|
450
455
|
withOnboarding: boolean;
|
|
451
|
-
|
|
452
|
-
list: SSOConfig<
|
|
456
|
+
largeQRCode: boolean;
|
|
457
|
+
list: SSOConfig<T>[];
|
|
453
458
|
};
|
|
454
459
|
};
|
|
455
460
|
isPrimaryRegion: boolean;
|
|
@@ -470,9 +475,26 @@ type WebAdminLocaleConfig = {
|
|
|
470
475
|
type CommonLocaleConfig = Readonly<{
|
|
471
476
|
name: string;
|
|
472
477
|
languageName: string;
|
|
478
|
+
country: string;
|
|
473
479
|
languageHeader: string;
|
|
474
480
|
contentLocale: Locale;
|
|
475
481
|
shortCode: string;
|
|
482
|
+
date: {
|
|
483
|
+
use24HourFormat: boolean;
|
|
484
|
+
locale: string;
|
|
485
|
+
formats: {
|
|
486
|
+
dayMonth: string;
|
|
487
|
+
dayMonthYear: string;
|
|
488
|
+
hoursMinutes: string;
|
|
489
|
+
full: string;
|
|
490
|
+
fullWithSeconds: string;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
grades: {
|
|
494
|
+
primary: Partial<Record<PrimaryGrades, GradeData>>;
|
|
495
|
+
highSchool: Partial<Record<HighSchoolGrades, GradeData>>;
|
|
496
|
+
treeNode: Partial<Record<TreeNodeGrades, GradeData>>;
|
|
497
|
+
};
|
|
476
498
|
}>;
|
|
477
499
|
type LocalePreset = {
|
|
478
500
|
[Platform.STUDENTS_WEB]: {
|
|
@@ -485,17 +507,19 @@ type LocalePreset = {
|
|
|
485
507
|
[key in Locale]: DistrictLocaleConfig;
|
|
486
508
|
};
|
|
487
509
|
[Platform.AUTH_WEB]: {
|
|
488
|
-
[key in Locale]:
|
|
510
|
+
[key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
|
|
489
511
|
};
|
|
490
512
|
[Platform.WEB_ADMIN]: {
|
|
491
513
|
[key in Locale]: WebAdminLocaleConfig;
|
|
492
514
|
};
|
|
493
515
|
[Platform.MOBILE]: {
|
|
494
|
-
[key in Locale]:
|
|
516
|
+
[key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
|
|
495
517
|
};
|
|
496
518
|
};
|
|
497
519
|
type LocaleConfig<P extends Platform, L extends Locale> = LocalePreset[P][L];
|
|
498
520
|
|
|
521
|
+
type DistrictLocaleConfig = CommonLocaleConfig;
|
|
522
|
+
|
|
499
523
|
type DevOverrides<P extends Platform> = {
|
|
500
524
|
[K in Locale]?: Partial<EnvironmentVars<P>>;
|
|
501
525
|
};
|
|
@@ -529,9 +553,16 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
|
|
|
529
553
|
readonly onEnvsChange: (cb: (cfg: EnvironmentVars<P>) => void) => effector.Subscription;
|
|
530
554
|
readonly onLocaleChange: (cb: (cfg: LocaleConfig<P, L>) => void) => effector.Subscription;
|
|
531
555
|
readonly getPresets: () => {
|
|
532
|
-
envPreset:
|
|
556
|
+
envPreset: Readonly<{
|
|
557
|
+
STUDENTS: StudentsWebVarsPreset;
|
|
558
|
+
TEACHERS: TeachersWebVarsPreset;
|
|
559
|
+
DISTRICT: DistrictWebVarsPreset;
|
|
560
|
+
AUTH_WEB: AuthWebVarsPreset;
|
|
561
|
+
WEB_ADMIN: WebAdminVarsPreset;
|
|
562
|
+
MOBILE: MobileVarsPreset;
|
|
563
|
+
}>;
|
|
533
564
|
localePreset: LocalePreset;
|
|
534
565
|
};
|
|
535
566
|
}
|
|
536
567
|
|
|
537
|
-
export { ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictWebVarsPreset, type EnvPreset, Environment, type EnvironmentVars, Locale, LoginSource, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileVars, type MobileVarsPreset, Platform, PlatformBuildTarget,
|
|
568
|
+
export { ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, type CommonGrades, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictLocaleConfig, type DistrictWebVarsPreset, type EnvPreset, Environment, type EnvironmentVars, Grade, type GradeData, type HighSchoolGrades, Locale, LoginSource, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileVars, type MobileVarsPreset, Platform, PlatformBuildTarget, type PrimaryGrades, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_DE, type SSO_SE, type SSO_UK, type SSO_US, Source, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, type TeachersLocaleConfig, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, type TreeNodeGrades, buildTargetToEnvironment };
|