@magmamath/frontend-config 1.0.22-rc.2 → 1.0.22-rc.4

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 CHANGED
@@ -104,6 +104,11 @@ declare enum ApiRegion {
104
104
  MAIN = "MAIN",
105
105
  CANADA = "CANADA"
106
106
  }
107
+ declare enum QRCodeSize {
108
+ DEFAULT = "default",
109
+ MEDIUM = "medium",
110
+ LARGE = "large"
111
+ }
107
112
 
108
113
  declare enum MatrixMode {
109
114
  SKILL = "SKILL",
@@ -114,6 +119,73 @@ type IconProps = {
114
119
  size?: number;
115
120
  };
116
121
 
122
+ type SSOConfig<E> = Readonly<{
123
+ name: string;
124
+ icon: ComponentType<IconProps>;
125
+ type: SSO;
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;
141
+ };
142
+
143
+ type StudentsWebCommon = {
144
+ GOOGLE_API_KEY: string;
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
+ };
187
+ };
188
+
117
189
  type SSO_UK = {
118
190
  GOOGLE_AUTH: string;
119
191
  MICROSOFT_AUTH: string;
@@ -151,18 +223,6 @@ type Prettify<T> = T extends Function ? T : {
151
223
  [K in keyof T]: T[K];
152
224
  };
153
225
 
154
- type RegionSpecificVars = {
155
- API_URL: string;
156
- AUTH_WEB_URL: string;
157
- CDN_HOST: string;
158
- DISTRICT_WEB_URL: string;
159
- LOGGLY_TAG: string;
160
- MAGMAMATH_URL: string;
161
- SOCKET_URL: string;
162
- STUDENTS_WEB_URL: string;
163
- TEACHERS_WEB_URL: string;
164
- };
165
-
166
226
  type AuthWebVars<T extends SSOVariant> = Prettify<AuthWebBaseVars & T>;
167
227
  type AuthWebBaseVars = Omit<RegionSpecificVars, 'CDN_HOST' | 'LOGGLY_TAG' | 'SOCKET_URL'> & {
168
228
  TOS_URL: string;
@@ -190,63 +250,6 @@ type AuthWebVarsPreset = {
190
250
  };
191
251
  };
192
252
 
193
- type SSOConfigStatic = Readonly<{
194
- name: string;
195
- icon: ComponentType<IconProps>;
196
- type: SSO;
197
- loginSource: LoginSource;
198
- ownUrl?: boolean;
199
- }>;
200
- type SSOConfig<T extends SSOVariant> = SSOConfigStatic & {
201
- getUrl: (envs: AuthWebVars<T>) => string;
202
- };
203
-
204
- type StudentsWebCommon = {
205
- GOOGLE_API_KEY: string;
206
- DESMOS_API_KEY: string;
207
- LOGGLY_CUSTOMER_TOKEN: string;
208
- MYSCRIPT_APPLICATION_KEY: string;
209
- MYSCRIPT_HMAC_KEY: string;
210
- MYSCRIPT_HOST: string;
211
- MYSCRIPT_SOCKET_KEY: string;
212
- MYSCRIPT_REST_APP_KEY: string;
213
- MYSCRIPT_REST_HMAC_KEY: string;
214
- };
215
- type StudentsWebVars = RegionSpecificVars & StudentsWebCommon;
216
- type StudentsWebVarsPreset = {
217
- [key in Locale]: {
218
- [key in Environment]: StudentsWebVars;
219
- };
220
- };
221
-
222
- type TeachersWebCommon = {
223
- MYSCRIPT_HOST: string;
224
- MYSCRIPT_REST_APP_KEY: string;
225
- MYSCRIPT_REST_HMAC_KEY: string;
226
- PROBLEM_IMAGE_SIZE_LIMIT: number;
227
- INTERCOM_APP_ID: string;
228
- CLARITY_PROJECT_ID: string;
229
- LOGGLY_CUSTOMER_TOKEN: string;
230
- };
231
- type TeachersWebVars = RegionSpecificVars & TeachersWebCommon;
232
- type TeachersWebVarsPreset = {
233
- [key in Locale]: {
234
- [key in Environment]: TeachersWebVars;
235
- };
236
- };
237
-
238
- type DistrictCommon = {
239
- INTERCOM_APP_ID: string;
240
- CLARITY_PROJECT_ID: string;
241
- PROBLEM_IMAGE_SIZE_LIMIT: number;
242
- };
243
- type DistrictDashboardVars = Omit<RegionSpecificVars, 'SOCKET_URL'> & DistrictCommon;
244
- type DistrictWebVarsPreset = {
245
- [key in Locale]: {
246
- [key in Environment]: DistrictDashboardVars;
247
- };
248
- };
249
-
250
253
  type MobileCommon = {
251
254
  DESMOS_API_KEY: string;
252
255
  USER_AGENT: string;
@@ -431,18 +434,18 @@ type DistrictLocaleConfig = CommonLocaleConfig & {
431
434
  };
432
435
  };
433
436
 
434
- type AuthWebLocaleConfig<T extends SSOVariant> = {
437
+ type AuthLocaleConfig<E> = {
435
438
  path: string;
436
439
  shortCode: string;
437
440
  icon: ComponentType<IconProps>;
438
441
  sources: {
439
442
  signUp: {
440
- list: SSOConfig<T>[];
443
+ list: SSOConfig<E>[];
441
444
  };
442
445
  signIn: {
443
446
  withOnboarding: boolean;
444
- largeQRCode: boolean;
445
- list: SSOConfig<T>[];
447
+ qrCodeSize: QRCodeSize;
448
+ list: SSOConfig<E>[];
446
449
  };
447
450
  };
448
451
  isPrimaryRegion: boolean;
@@ -460,27 +463,6 @@ type WebAdminLocaleConfig = {
460
463
  apiRegion: ApiRegion;
461
464
  };
462
465
 
463
- type MobileLocaleConfig = {
464
- path: string;
465
- shortCode: string;
466
- icon: ComponentType<IconProps>;
467
- sources: {
468
- signUp: {
469
- list: SSOConfigStatic[];
470
- };
471
- signIn: {
472
- withOnboarding: boolean;
473
- largeQRCode: boolean;
474
- mediumQRCode: boolean;
475
- list: SSOConfigStatic[];
476
- };
477
- };
478
- isPrimaryRegion: boolean;
479
- regionGroup: string;
480
- navigatorLanguages: string[];
481
- locale: Locale;
482
- };
483
-
484
466
  type CommonLocaleConfig = Readonly<{
485
467
  name: string;
486
468
  languageName: string;
@@ -499,13 +481,13 @@ type LocalePreset = {
499
481
  [key in Locale]: DistrictLocaleConfig;
500
482
  };
501
483
  [Platform.AUTH_WEB]: {
502
- [key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
484
+ [key in Locale]: AuthLocaleConfig<AuthWebVars<SSOByLocale[key]>>;
503
485
  };
504
486
  [Platform.WEB_ADMIN]: {
505
487
  [key in Locale]: WebAdminLocaleConfig;
506
488
  };
507
489
  [Platform.MOBILE]: {
508
- [key in Locale]: MobileLocaleConfig;
490
+ [key in Locale]: AuthLocaleConfig<MobileVars<SSOByLocale[key]>>;
509
491
  };
510
492
  };
511
493
  type LocaleConfig<P extends Platform, L extends Locale> = LocalePreset[P][L];
@@ -548,4 +530,4 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
548
530
  };
549
531
  }
550
532
 
551
- 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, SSO, type SSOByLocale, type SSOConfig, type SSOConfigStatic, type SSOVariant, type SSO_DE, type SSO_SE, type SSO_UK, type SSO_US, Source, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, buildTargetToEnvironment };
533
+ 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, QRCodeSize, 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 TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, buildTargetToEnvironment };
package/dist/index.d.ts CHANGED
@@ -104,6 +104,11 @@ declare enum ApiRegion {
104
104
  MAIN = "MAIN",
105
105
  CANADA = "CANADA"
106
106
  }
107
+ declare enum QRCodeSize {
108
+ DEFAULT = "default",
109
+ MEDIUM = "medium",
110
+ LARGE = "large"
111
+ }
107
112
 
108
113
  declare enum MatrixMode {
109
114
  SKILL = "SKILL",
@@ -114,6 +119,73 @@ type IconProps = {
114
119
  size?: number;
115
120
  };
116
121
 
122
+ type SSOConfig<E> = Readonly<{
123
+ name: string;
124
+ icon: ComponentType<IconProps>;
125
+ type: SSO;
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;
141
+ };
142
+
143
+ type StudentsWebCommon = {
144
+ GOOGLE_API_KEY: string;
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
+ };
187
+ };
188
+
117
189
  type SSO_UK = {
118
190
  GOOGLE_AUTH: string;
119
191
  MICROSOFT_AUTH: string;
@@ -151,18 +223,6 @@ type Prettify<T> = T extends Function ? T : {
151
223
  [K in keyof T]: T[K];
152
224
  };
153
225
 
154
- type RegionSpecificVars = {
155
- API_URL: string;
156
- AUTH_WEB_URL: string;
157
- CDN_HOST: string;
158
- DISTRICT_WEB_URL: string;
159
- LOGGLY_TAG: string;
160
- MAGMAMATH_URL: string;
161
- SOCKET_URL: string;
162
- STUDENTS_WEB_URL: string;
163
- TEACHERS_WEB_URL: string;
164
- };
165
-
166
226
  type AuthWebVars<T extends SSOVariant> = Prettify<AuthWebBaseVars & T>;
167
227
  type AuthWebBaseVars = Omit<RegionSpecificVars, 'CDN_HOST' | 'LOGGLY_TAG' | 'SOCKET_URL'> & {
168
228
  TOS_URL: string;
@@ -190,63 +250,6 @@ type AuthWebVarsPreset = {
190
250
  };
191
251
  };
192
252
 
193
- type SSOConfigStatic = Readonly<{
194
- name: string;
195
- icon: ComponentType<IconProps>;
196
- type: SSO;
197
- loginSource: LoginSource;
198
- ownUrl?: boolean;
199
- }>;
200
- type SSOConfig<T extends SSOVariant> = SSOConfigStatic & {
201
- getUrl: (envs: AuthWebVars<T>) => string;
202
- };
203
-
204
- type StudentsWebCommon = {
205
- GOOGLE_API_KEY: string;
206
- DESMOS_API_KEY: string;
207
- LOGGLY_CUSTOMER_TOKEN: string;
208
- MYSCRIPT_APPLICATION_KEY: string;
209
- MYSCRIPT_HMAC_KEY: string;
210
- MYSCRIPT_HOST: string;
211
- MYSCRIPT_SOCKET_KEY: string;
212
- MYSCRIPT_REST_APP_KEY: string;
213
- MYSCRIPT_REST_HMAC_KEY: string;
214
- };
215
- type StudentsWebVars = RegionSpecificVars & StudentsWebCommon;
216
- type StudentsWebVarsPreset = {
217
- [key in Locale]: {
218
- [key in Environment]: StudentsWebVars;
219
- };
220
- };
221
-
222
- type TeachersWebCommon = {
223
- MYSCRIPT_HOST: string;
224
- MYSCRIPT_REST_APP_KEY: string;
225
- MYSCRIPT_REST_HMAC_KEY: string;
226
- PROBLEM_IMAGE_SIZE_LIMIT: number;
227
- INTERCOM_APP_ID: string;
228
- CLARITY_PROJECT_ID: string;
229
- LOGGLY_CUSTOMER_TOKEN: string;
230
- };
231
- type TeachersWebVars = RegionSpecificVars & TeachersWebCommon;
232
- type TeachersWebVarsPreset = {
233
- [key in Locale]: {
234
- [key in Environment]: TeachersWebVars;
235
- };
236
- };
237
-
238
- type DistrictCommon = {
239
- INTERCOM_APP_ID: string;
240
- CLARITY_PROJECT_ID: string;
241
- PROBLEM_IMAGE_SIZE_LIMIT: number;
242
- };
243
- type DistrictDashboardVars = Omit<RegionSpecificVars, 'SOCKET_URL'> & DistrictCommon;
244
- type DistrictWebVarsPreset = {
245
- [key in Locale]: {
246
- [key in Environment]: DistrictDashboardVars;
247
- };
248
- };
249
-
250
253
  type MobileCommon = {
251
254
  DESMOS_API_KEY: string;
252
255
  USER_AGENT: string;
@@ -431,18 +434,18 @@ type DistrictLocaleConfig = CommonLocaleConfig & {
431
434
  };
432
435
  };
433
436
 
434
- type AuthWebLocaleConfig<T extends SSOVariant> = {
437
+ type AuthLocaleConfig<E> = {
435
438
  path: string;
436
439
  shortCode: string;
437
440
  icon: ComponentType<IconProps>;
438
441
  sources: {
439
442
  signUp: {
440
- list: SSOConfig<T>[];
443
+ list: SSOConfig<E>[];
441
444
  };
442
445
  signIn: {
443
446
  withOnboarding: boolean;
444
- largeQRCode: boolean;
445
- list: SSOConfig<T>[];
447
+ qrCodeSize: QRCodeSize;
448
+ list: SSOConfig<E>[];
446
449
  };
447
450
  };
448
451
  isPrimaryRegion: boolean;
@@ -460,27 +463,6 @@ type WebAdminLocaleConfig = {
460
463
  apiRegion: ApiRegion;
461
464
  };
462
465
 
463
- type MobileLocaleConfig = {
464
- path: string;
465
- shortCode: string;
466
- icon: ComponentType<IconProps>;
467
- sources: {
468
- signUp: {
469
- list: SSOConfigStatic[];
470
- };
471
- signIn: {
472
- withOnboarding: boolean;
473
- largeQRCode: boolean;
474
- mediumQRCode: boolean;
475
- list: SSOConfigStatic[];
476
- };
477
- };
478
- isPrimaryRegion: boolean;
479
- regionGroup: string;
480
- navigatorLanguages: string[];
481
- locale: Locale;
482
- };
483
-
484
466
  type CommonLocaleConfig = Readonly<{
485
467
  name: string;
486
468
  languageName: string;
@@ -499,13 +481,13 @@ type LocalePreset = {
499
481
  [key in Locale]: DistrictLocaleConfig;
500
482
  };
501
483
  [Platform.AUTH_WEB]: {
502
- [key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
484
+ [key in Locale]: AuthLocaleConfig<AuthWebVars<SSOByLocale[key]>>;
503
485
  };
504
486
  [Platform.WEB_ADMIN]: {
505
487
  [key in Locale]: WebAdminLocaleConfig;
506
488
  };
507
489
  [Platform.MOBILE]: {
508
- [key in Locale]: MobileLocaleConfig;
490
+ [key in Locale]: AuthLocaleConfig<MobileVars<SSOByLocale[key]>>;
509
491
  };
510
492
  };
511
493
  type LocaleConfig<P extends Platform, L extends Locale> = LocalePreset[P][L];
@@ -548,4 +530,4 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
548
530
  };
549
531
  }
550
532
 
551
- 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, SSO, type SSOByLocale, type SSOConfig, type SSOConfigStatic, type SSOVariant, type SSO_DE, type SSO_SE, type SSO_UK, type SSO_US, Source, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, buildTargetToEnvironment };
533
+ 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, QRCodeSize, 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 TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, buildTargetToEnvironment };