@magmamath/frontend-config 1.4.0 → 1.5.0-rc.0
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/{common.constants-4kbCK3_q.d.mts → common.constants-D7-P-TVv.d.mts} +10 -1
- package/dist/{common.constants-4kbCK3_q.d.ts → common.constants-D7-P-TVv.d.ts} +10 -1
- package/dist/index.d.mts +20 -3
- package/dist/index.d.ts +20 -3
- package/dist/index.js +138 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +133 -13
- package/dist/index.mjs.map +1 -1
- package/dist/translation/index.d.mts +1 -1
- package/dist/translation/index.d.ts +1 -1
- package/package.json +3 -2
|
@@ -88,10 +88,19 @@ declare enum ApiRegion {
|
|
|
88
88
|
MAIN = "MAIN",
|
|
89
89
|
CANADA = "CANADA"
|
|
90
90
|
}
|
|
91
|
+
declare enum HomeRegion {
|
|
92
|
+
EU_MAIN = "eu-main",
|
|
93
|
+
US_MAIN = "us-main",
|
|
94
|
+
CA_MAIN = "ca-main"
|
|
95
|
+
}
|
|
96
|
+
declare enum RegionURLVariant {
|
|
97
|
+
DEFAULT = "DEFAULT",
|
|
98
|
+
SV_SE = "sv-SE"
|
|
99
|
+
}
|
|
91
100
|
declare enum QRCodeSize {
|
|
92
101
|
DEFAULT = "default",
|
|
93
102
|
MEDIUM = "medium",
|
|
94
103
|
LARGE = "large"
|
|
95
104
|
}
|
|
96
105
|
|
|
97
|
-
export { ApiRegion as A, Environment as E, LoginSource as L, Platform as P, QRCodeSize as Q, SSO as S, Locale as a, PlatformBuildTarget as b, Source as c };
|
|
106
|
+
export { ApiRegion as A, Environment as E, HomeRegion as H, LoginSource as L, Platform as P, QRCodeSize as Q, RegionURLVariant as R, SSO as S, Locale as a, PlatformBuildTarget as b, Source as c };
|
|
@@ -88,10 +88,19 @@ declare enum ApiRegion {
|
|
|
88
88
|
MAIN = "MAIN",
|
|
89
89
|
CANADA = "CANADA"
|
|
90
90
|
}
|
|
91
|
+
declare enum HomeRegion {
|
|
92
|
+
EU_MAIN = "eu-main",
|
|
93
|
+
US_MAIN = "us-main",
|
|
94
|
+
CA_MAIN = "ca-main"
|
|
95
|
+
}
|
|
96
|
+
declare enum RegionURLVariant {
|
|
97
|
+
DEFAULT = "DEFAULT",
|
|
98
|
+
SV_SE = "sv-SE"
|
|
99
|
+
}
|
|
91
100
|
declare enum QRCodeSize {
|
|
92
101
|
DEFAULT = "default",
|
|
93
102
|
MEDIUM = "medium",
|
|
94
103
|
LARGE = "large"
|
|
95
104
|
}
|
|
96
105
|
|
|
97
|
-
export { ApiRegion as A, Environment as E, LoginSource as L, Platform as P, QRCodeSize as Q, SSO as S, Locale as a, PlatformBuildTarget as b, Source as c };
|
|
106
|
+
export { ApiRegion as A, Environment as E, HomeRegion as H, LoginSource as L, Platform as P, QRCodeSize as Q, RegionURLVariant as R, SSO as S, Locale as a, PlatformBuildTarget as b, Source as c };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SSO, L as LoginSource, a as Locale, E as Environment, P as Platform, b as PlatformBuildTarget, Q as QRCodeSize, A as ApiRegion } from './common.constants-
|
|
2
|
-
export { c as Source } from './common.constants-
|
|
1
|
+
import { S as SSO, L as LoginSource, a as Locale, E as Environment, P as Platform, b as PlatformBuildTarget, H as HomeRegion, R as RegionURLVariant, Q as QRCodeSize, A as ApiRegion } from './common.constants-D7-P-TVv.mjs';
|
|
2
|
+
export { c as Source } from './common.constants-D7-P-TVv.mjs';
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as effector from 'effector';
|
|
5
5
|
|
|
@@ -764,6 +764,20 @@ type EnvironmentVars<P extends Platform> = EnvPreset[P][Locale][Environment];
|
|
|
764
764
|
|
|
765
765
|
declare function buildTargetToEnvironment(buildTarget: PlatformBuildTarget): Environment;
|
|
766
766
|
|
|
767
|
+
type RegionURLOverrides = {
|
|
768
|
+
API_URL: string;
|
|
769
|
+
CDN_HOST: string;
|
|
770
|
+
CDN_HOST_TRANSLATIONS: string;
|
|
771
|
+
SOCKET_URL: string;
|
|
772
|
+
WEBSOCKETS_URL: string;
|
|
773
|
+
};
|
|
774
|
+
type RegionURLsMap = Record<Environment, Record<HomeRegion, Partial<Record<RegionURLVariant, RegionURLOverrides>>>>;
|
|
775
|
+
|
|
776
|
+
declare const REGION_URLS: RegionURLsMap;
|
|
777
|
+
declare const localeToRegionVariant: (locale: Locale) => RegionURLVariant;
|
|
778
|
+
declare const REGION_LOGGLY_SUFFIX: Record<HomeRegion, '' | 'US' | 'CA'>;
|
|
779
|
+
declare const rebuildLogglyTagForHomeRegion: (baseTag: string, homeRegion: HomeRegion) => string;
|
|
780
|
+
|
|
767
781
|
declare enum KeyboardPreset {
|
|
768
782
|
DOT_MIXED = "DotMixed",
|
|
769
783
|
DOT_MIXED_ALT = "DotMixedAlt",
|
|
@@ -1014,6 +1028,7 @@ type SetProps<L extends Locale> = {
|
|
|
1014
1028
|
locale?: L;
|
|
1015
1029
|
envsRegion?: L;
|
|
1016
1030
|
environment?: Environment;
|
|
1031
|
+
homeRegion?: HomeRegion;
|
|
1017
1032
|
};
|
|
1018
1033
|
declare class AppConfigManager<P extends Platform, L extends Locale> {
|
|
1019
1034
|
private readonly _DEV_OVERRIDES_?;
|
|
@@ -1021,6 +1036,7 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
|
|
|
1021
1036
|
environment: Environment;
|
|
1022
1037
|
locale: L;
|
|
1023
1038
|
envsRegion: L;
|
|
1039
|
+
homeRegion?: HomeRegion;
|
|
1024
1040
|
private readonly setEnvs;
|
|
1025
1041
|
private readonly setLocaleConfig;
|
|
1026
1042
|
readonly $envs: effector.StoreWritable<EnvironmentVars<P>>;
|
|
@@ -1035,6 +1051,7 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
|
|
|
1035
1051
|
isPolish: boolean;
|
|
1036
1052
|
}>;
|
|
1037
1053
|
constructor(opts: ConfigOptions<P>);
|
|
1054
|
+
private readonly applyHomeRegionOverride;
|
|
1038
1055
|
private readonly syncConfigsStores;
|
|
1039
1056
|
readonly set: (props: SetProps<L>) => void;
|
|
1040
1057
|
getEnvs: () => EnvironmentVars<P>;
|
|
@@ -1058,4 +1075,4 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
|
|
|
1058
1075
|
};
|
|
1059
1076
|
}
|
|
1060
1077
|
|
|
1061
|
-
export { AT_CALENDAR_CONFIG, ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, CH_CALENDAR_CONFIG, type CalendarConfig, CalendarLocale, type CommonGrades, DE_CALENDAR_CONFIG, DK_CALENDAR_CONFIG, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictLocaleConfig, type DistrictWebVarsPreset, DrawboardCoinVariant, EN_CALENDAR_CONFIG, ES_CALENDAR_CONFIG, type EnvPreset, Environment, type EnvironmentVars, FI_CALENDAR_CONFIG, FR_CALENDAR_CONFIG, Grade, type GradeData, type HighSchoolGrades, IS_CALENDAR_CONFIG, IT_CALENDAR_CONFIG, type KeyboardConfig, KeyboardCurrencyVariant, KeyboardPreset, KeyboardTimeVariant, LANGUAGES_CONFIG, LANGUAGES_LIST, Language, type LanguageConfig, Locale, type LocaleLanguageData, LoginSource, MOST_USED_LANGUAGES, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileLocaleConfig, type MobileVars, type MobileVarsPreset, MomentDateLocale, MultiplicationSymbol, NL_BE_CALENDAR_CONFIG, NL_CALENDAR_CONFIG, NO_CALENDAR_CONFIG, NumberDecimalSeparator, NumberGroupingSeparator, PL_CALENDAR_CONFIG, PRIORITY_LANGUAGES, PT_CALENDAR_CONFIG, type ParentWebLocaleConfig, type ParentWebVars, type ParentWebVarsPreset, Platform, PlatformBuildTarget, type PrimaryGrades, type ProblemCreatorConfig, ProblemCreatorDescriptionVariant, type ProblemCreatorKeyboardConfig, ProblemCreatorKeyboardPreset, ProblemCreatorMathEntryVariant, QRCodeSize, SE_CALENDAR_CONFIG, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_AT, type SSO_CH, type SSO_DE, type SSO_DK, type SSO_ES, type SSO_FI, type SSO_FR, type SSO_IE, type SSO_IS, type SSO_IT, type SSO_NL, type SSO_NL_BE, type SSO_NO, type SSO_PL, type SSO_PT, type SSO_SE, type SSO_SV_FI, type SSO_UK, type SSO_US, SV_FI_CALENDAR_CONFIG, type StudentsLocaleConfig, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, TTSOverrideSymbol, type TeachersLocaleConfig, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, TreeLevel, buildTargetToEnvironment };
|
|
1078
|
+
export { AT_CALENDAR_CONFIG, ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, CH_CALENDAR_CONFIG, type CalendarConfig, CalendarLocale, type CommonGrades, DE_CALENDAR_CONFIG, DK_CALENDAR_CONFIG, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictLocaleConfig, type DistrictWebVarsPreset, DrawboardCoinVariant, EN_CALENDAR_CONFIG, ES_CALENDAR_CONFIG, type EnvPreset, Environment, type EnvironmentVars, FI_CALENDAR_CONFIG, FR_CALENDAR_CONFIG, Grade, type GradeData, type HighSchoolGrades, HomeRegion, IS_CALENDAR_CONFIG, IT_CALENDAR_CONFIG, type KeyboardConfig, KeyboardCurrencyVariant, KeyboardPreset, KeyboardTimeVariant, LANGUAGES_CONFIG, LANGUAGES_LIST, Language, type LanguageConfig, Locale, type LocaleLanguageData, LoginSource, MOST_USED_LANGUAGES, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileLocaleConfig, type MobileVars, type MobileVarsPreset, MomentDateLocale, MultiplicationSymbol, NL_BE_CALENDAR_CONFIG, NL_CALENDAR_CONFIG, NO_CALENDAR_CONFIG, NumberDecimalSeparator, NumberGroupingSeparator, PL_CALENDAR_CONFIG, PRIORITY_LANGUAGES, PT_CALENDAR_CONFIG, type ParentWebLocaleConfig, type ParentWebVars, type ParentWebVarsPreset, Platform, PlatformBuildTarget, type PrimaryGrades, type ProblemCreatorConfig, ProblemCreatorDescriptionVariant, type ProblemCreatorKeyboardConfig, ProblemCreatorKeyboardPreset, ProblemCreatorMathEntryVariant, QRCodeSize, REGION_LOGGLY_SUFFIX, REGION_URLS, type RegionURLOverrides, RegionURLVariant, type RegionURLsMap, SE_CALENDAR_CONFIG, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_AT, type SSO_CH, type SSO_DE, type SSO_DK, type SSO_ES, type SSO_FI, type SSO_FR, type SSO_IE, type SSO_IS, type SSO_IT, type SSO_NL, type SSO_NL_BE, type SSO_NO, type SSO_PL, type SSO_PT, type SSO_SE, type SSO_SV_FI, type SSO_UK, type SSO_US, SV_FI_CALENDAR_CONFIG, type StudentsLocaleConfig, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, TTSOverrideSymbol, type TeachersLocaleConfig, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, TreeLevel, buildTargetToEnvironment, localeToRegionVariant, rebuildLogglyTagForHomeRegion };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SSO, L as LoginSource, a as Locale, E as Environment, P as Platform, b as PlatformBuildTarget, Q as QRCodeSize, A as ApiRegion } from './common.constants-
|
|
2
|
-
export { c as Source } from './common.constants-
|
|
1
|
+
import { S as SSO, L as LoginSource, a as Locale, E as Environment, P as Platform, b as PlatformBuildTarget, H as HomeRegion, R as RegionURLVariant, Q as QRCodeSize, A as ApiRegion } from './common.constants-D7-P-TVv.js';
|
|
2
|
+
export { c as Source } from './common.constants-D7-P-TVv.js';
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as effector from 'effector';
|
|
5
5
|
|
|
@@ -764,6 +764,20 @@ type EnvironmentVars<P extends Platform> = EnvPreset[P][Locale][Environment];
|
|
|
764
764
|
|
|
765
765
|
declare function buildTargetToEnvironment(buildTarget: PlatformBuildTarget): Environment;
|
|
766
766
|
|
|
767
|
+
type RegionURLOverrides = {
|
|
768
|
+
API_URL: string;
|
|
769
|
+
CDN_HOST: string;
|
|
770
|
+
CDN_HOST_TRANSLATIONS: string;
|
|
771
|
+
SOCKET_URL: string;
|
|
772
|
+
WEBSOCKETS_URL: string;
|
|
773
|
+
};
|
|
774
|
+
type RegionURLsMap = Record<Environment, Record<HomeRegion, Partial<Record<RegionURLVariant, RegionURLOverrides>>>>;
|
|
775
|
+
|
|
776
|
+
declare const REGION_URLS: RegionURLsMap;
|
|
777
|
+
declare const localeToRegionVariant: (locale: Locale) => RegionURLVariant;
|
|
778
|
+
declare const REGION_LOGGLY_SUFFIX: Record<HomeRegion, '' | 'US' | 'CA'>;
|
|
779
|
+
declare const rebuildLogglyTagForHomeRegion: (baseTag: string, homeRegion: HomeRegion) => string;
|
|
780
|
+
|
|
767
781
|
declare enum KeyboardPreset {
|
|
768
782
|
DOT_MIXED = "DotMixed",
|
|
769
783
|
DOT_MIXED_ALT = "DotMixedAlt",
|
|
@@ -1014,6 +1028,7 @@ type SetProps<L extends Locale> = {
|
|
|
1014
1028
|
locale?: L;
|
|
1015
1029
|
envsRegion?: L;
|
|
1016
1030
|
environment?: Environment;
|
|
1031
|
+
homeRegion?: HomeRegion;
|
|
1017
1032
|
};
|
|
1018
1033
|
declare class AppConfigManager<P extends Platform, L extends Locale> {
|
|
1019
1034
|
private readonly _DEV_OVERRIDES_?;
|
|
@@ -1021,6 +1036,7 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
|
|
|
1021
1036
|
environment: Environment;
|
|
1022
1037
|
locale: L;
|
|
1023
1038
|
envsRegion: L;
|
|
1039
|
+
homeRegion?: HomeRegion;
|
|
1024
1040
|
private readonly setEnvs;
|
|
1025
1041
|
private readonly setLocaleConfig;
|
|
1026
1042
|
readonly $envs: effector.StoreWritable<EnvironmentVars<P>>;
|
|
@@ -1035,6 +1051,7 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
|
|
|
1035
1051
|
isPolish: boolean;
|
|
1036
1052
|
}>;
|
|
1037
1053
|
constructor(opts: ConfigOptions<P>);
|
|
1054
|
+
private readonly applyHomeRegionOverride;
|
|
1038
1055
|
private readonly syncConfigsStores;
|
|
1039
1056
|
readonly set: (props: SetProps<L>) => void;
|
|
1040
1057
|
getEnvs: () => EnvironmentVars<P>;
|
|
@@ -1058,4 +1075,4 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
|
|
|
1058
1075
|
};
|
|
1059
1076
|
}
|
|
1060
1077
|
|
|
1061
|
-
export { AT_CALENDAR_CONFIG, ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, CH_CALENDAR_CONFIG, type CalendarConfig, CalendarLocale, type CommonGrades, DE_CALENDAR_CONFIG, DK_CALENDAR_CONFIG, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictLocaleConfig, type DistrictWebVarsPreset, DrawboardCoinVariant, EN_CALENDAR_CONFIG, ES_CALENDAR_CONFIG, type EnvPreset, Environment, type EnvironmentVars, FI_CALENDAR_CONFIG, FR_CALENDAR_CONFIG, Grade, type GradeData, type HighSchoolGrades, IS_CALENDAR_CONFIG, IT_CALENDAR_CONFIG, type KeyboardConfig, KeyboardCurrencyVariant, KeyboardPreset, KeyboardTimeVariant, LANGUAGES_CONFIG, LANGUAGES_LIST, Language, type LanguageConfig, Locale, type LocaleLanguageData, LoginSource, MOST_USED_LANGUAGES, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileLocaleConfig, type MobileVars, type MobileVarsPreset, MomentDateLocale, MultiplicationSymbol, NL_BE_CALENDAR_CONFIG, NL_CALENDAR_CONFIG, NO_CALENDAR_CONFIG, NumberDecimalSeparator, NumberGroupingSeparator, PL_CALENDAR_CONFIG, PRIORITY_LANGUAGES, PT_CALENDAR_CONFIG, type ParentWebLocaleConfig, type ParentWebVars, type ParentWebVarsPreset, Platform, PlatformBuildTarget, type PrimaryGrades, type ProblemCreatorConfig, ProblemCreatorDescriptionVariant, type ProblemCreatorKeyboardConfig, ProblemCreatorKeyboardPreset, ProblemCreatorMathEntryVariant, QRCodeSize, SE_CALENDAR_CONFIG, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_AT, type SSO_CH, type SSO_DE, type SSO_DK, type SSO_ES, type SSO_FI, type SSO_FR, type SSO_IE, type SSO_IS, type SSO_IT, type SSO_NL, type SSO_NL_BE, type SSO_NO, type SSO_PL, type SSO_PT, type SSO_SE, type SSO_SV_FI, type SSO_UK, type SSO_US, SV_FI_CALENDAR_CONFIG, type StudentsLocaleConfig, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, TTSOverrideSymbol, type TeachersLocaleConfig, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, TreeLevel, buildTargetToEnvironment };
|
|
1078
|
+
export { AT_CALENDAR_CONFIG, ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, CH_CALENDAR_CONFIG, type CalendarConfig, CalendarLocale, type CommonGrades, DE_CALENDAR_CONFIG, DK_CALENDAR_CONFIG, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictLocaleConfig, type DistrictWebVarsPreset, DrawboardCoinVariant, EN_CALENDAR_CONFIG, ES_CALENDAR_CONFIG, type EnvPreset, Environment, type EnvironmentVars, FI_CALENDAR_CONFIG, FR_CALENDAR_CONFIG, Grade, type GradeData, type HighSchoolGrades, HomeRegion, IS_CALENDAR_CONFIG, IT_CALENDAR_CONFIG, type KeyboardConfig, KeyboardCurrencyVariant, KeyboardPreset, KeyboardTimeVariant, LANGUAGES_CONFIG, LANGUAGES_LIST, Language, type LanguageConfig, Locale, type LocaleLanguageData, LoginSource, MOST_USED_LANGUAGES, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileLocaleConfig, type MobileVars, type MobileVarsPreset, MomentDateLocale, MultiplicationSymbol, NL_BE_CALENDAR_CONFIG, NL_CALENDAR_CONFIG, NO_CALENDAR_CONFIG, NumberDecimalSeparator, NumberGroupingSeparator, PL_CALENDAR_CONFIG, PRIORITY_LANGUAGES, PT_CALENDAR_CONFIG, type ParentWebLocaleConfig, type ParentWebVars, type ParentWebVarsPreset, Platform, PlatformBuildTarget, type PrimaryGrades, type ProblemCreatorConfig, ProblemCreatorDescriptionVariant, type ProblemCreatorKeyboardConfig, ProblemCreatorKeyboardPreset, ProblemCreatorMathEntryVariant, QRCodeSize, REGION_LOGGLY_SUFFIX, REGION_URLS, type RegionURLOverrides, RegionURLVariant, type RegionURLsMap, SE_CALENDAR_CONFIG, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_AT, type SSO_CH, type SSO_DE, type SSO_DK, type SSO_ES, type SSO_FI, type SSO_FR, type SSO_IE, type SSO_IS, type SSO_IT, type SSO_NL, type SSO_NL_BE, type SSO_NO, type SSO_PL, type SSO_PT, type SSO_SE, type SSO_SV_FI, type SSO_UK, type SSO_US, SV_FI_CALENDAR_CONFIG, type StudentsLocaleConfig, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, TTSOverrideSymbol, type TeachersLocaleConfig, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, TreeLevel, buildTargetToEnvironment, localeToRegionVariant, rebuildLogglyTagForHomeRegion };
|
package/dist/index.js
CHANGED
|
@@ -91,15 +91,15 @@ var MomentDateLocale = {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
// src/shared/constants/common.constants.ts
|
|
94
|
-
var Platform = /* @__PURE__ */ ((
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return
|
|
94
|
+
var Platform = /* @__PURE__ */ ((Platform2) => {
|
|
95
|
+
Platform2["STUDENTS_WEB"] = "STUDENTS";
|
|
96
|
+
Platform2["TEACHERS_WEB"] = "TEACHERS";
|
|
97
|
+
Platform2["DISTRICT_DASHBOARD"] = "DISTRICT";
|
|
98
|
+
Platform2["AUTH_WEB"] = "AUTH_WEB";
|
|
99
|
+
Platform2["WEB_ADMIN"] = "WEB_ADMIN";
|
|
100
|
+
Platform2["MOBILE"] = "MOBILE";
|
|
101
|
+
Platform2["PARENT_WEB"] = "PARENT_WEB";
|
|
102
|
+
return Platform2;
|
|
103
103
|
})(Platform || {});
|
|
104
104
|
var Environment = /* @__PURE__ */ ((Environment3) => {
|
|
105
105
|
Environment3["MARS"] = "MARS";
|
|
@@ -189,6 +189,17 @@ var ApiRegion = /* @__PURE__ */ ((ApiRegion2) => {
|
|
|
189
189
|
ApiRegion2["CANADA"] = "CANADA";
|
|
190
190
|
return ApiRegion2;
|
|
191
191
|
})(ApiRegion || {});
|
|
192
|
+
var HomeRegion = /* @__PURE__ */ ((HomeRegion3) => {
|
|
193
|
+
HomeRegion3["EU_MAIN"] = "eu-main";
|
|
194
|
+
HomeRegion3["US_MAIN"] = "us-main";
|
|
195
|
+
HomeRegion3["CA_MAIN"] = "ca-main";
|
|
196
|
+
return HomeRegion3;
|
|
197
|
+
})(HomeRegion || {});
|
|
198
|
+
var RegionURLVariant = /* @__PURE__ */ ((RegionURLVariant2) => {
|
|
199
|
+
RegionURLVariant2["DEFAULT"] = "DEFAULT";
|
|
200
|
+
RegionURLVariant2["SV_SE"] = "sv-SE";
|
|
201
|
+
return RegionURLVariant2;
|
|
202
|
+
})(RegionURLVariant || {});
|
|
192
203
|
var QRCodeSize = /* @__PURE__ */ ((QRCodeSize2) => {
|
|
193
204
|
QRCodeSize2["DEFAULT"] = "default";
|
|
194
205
|
QRCodeSize2["MEDIUM"] = "medium";
|
|
@@ -1299,6 +1310,100 @@ function buildTargetToEnvironment(buildTarget) {
|
|
|
1299
1310
|
return env;
|
|
1300
1311
|
}
|
|
1301
1312
|
|
|
1313
|
+
// src/configs/env/region.urls.ts
|
|
1314
|
+
var PROD = {
|
|
1315
|
+
["eu-main" /* EU_MAIN */]: {
|
|
1316
|
+
["DEFAULT" /* DEFAULT */]: {
|
|
1317
|
+
API_URL: "https://api.magmamath.com/v2",
|
|
1318
|
+
CDN_HOST: "https://cdn.magmamath.com",
|
|
1319
|
+
CDN_HOST_TRANSLATIONS: "https://cdn.magmamath.com/translations",
|
|
1320
|
+
SOCKET_URL: "https://sockets.magmamath.com",
|
|
1321
|
+
WEBSOCKETS_URL: "https://websockets.magmamath.com"
|
|
1322
|
+
},
|
|
1323
|
+
["sv-SE" /* SV_SE */]: {
|
|
1324
|
+
API_URL: "https://api.matteappen.se/v2",
|
|
1325
|
+
CDN_HOST: "https://cdn.matteappen.se",
|
|
1326
|
+
CDN_HOST_TRANSLATIONS: "https://cdn.matteappen.se/translations",
|
|
1327
|
+
SOCKET_URL: "https://sockets.matteappen.se",
|
|
1328
|
+
WEBSOCKETS_URL: "https://websockets.matteappen.se"
|
|
1329
|
+
}
|
|
1330
|
+
},
|
|
1331
|
+
["us-main" /* US_MAIN */]: {
|
|
1332
|
+
["DEFAULT" /* DEFAULT */]: {
|
|
1333
|
+
API_URL: "https://api.us.magmamath.com/v2",
|
|
1334
|
+
CDN_HOST: "https://cdn.us.magmamath.com",
|
|
1335
|
+
CDN_HOST_TRANSLATIONS: "https://cdn.us.magmamath.com/translations",
|
|
1336
|
+
SOCKET_URL: "https://sockets.us.magmamath.com",
|
|
1337
|
+
WEBSOCKETS_URL: "https://websockets.us.magmamath.com"
|
|
1338
|
+
}
|
|
1339
|
+
},
|
|
1340
|
+
["ca-main" /* CA_MAIN */]: {
|
|
1341
|
+
["DEFAULT" /* DEFAULT */]: {
|
|
1342
|
+
API_URL: "https://api.ca.magmamath.com/v2",
|
|
1343
|
+
CDN_HOST: "https://cdn.ca.magmamath.com",
|
|
1344
|
+
CDN_HOST_TRANSLATIONS: "https://cdn.ca.magmamath.com/translations",
|
|
1345
|
+
SOCKET_URL: "https://sockets.ca.magmamath.com",
|
|
1346
|
+
WEBSOCKETS_URL: "https://websockets.ca.magmamath.com"
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
};
|
|
1350
|
+
var MARS = {
|
|
1351
|
+
["eu-main" /* EU_MAIN */]: {
|
|
1352
|
+
["DEFAULT" /* DEFAULT */]: {
|
|
1353
|
+
API_URL: "https://api.mars.magmamath.com/v2",
|
|
1354
|
+
CDN_HOST: "https://cdn.mars.magmamath.com",
|
|
1355
|
+
CDN_HOST_TRANSLATIONS: "https://cdn.mars.magmamath.com/translations",
|
|
1356
|
+
SOCKET_URL: "https://sockets.mars.magmamath.com",
|
|
1357
|
+
WEBSOCKETS_URL: "https://websockets.mars.magmamath.com"
|
|
1358
|
+
},
|
|
1359
|
+
["sv-SE" /* SV_SE */]: {
|
|
1360
|
+
API_URL: "https://api.mars.matteappen.se/v2",
|
|
1361
|
+
CDN_HOST: "https://cdn.mars.matteappen.se",
|
|
1362
|
+
CDN_HOST_TRANSLATIONS: "https://cdn.mars.matteappen.se/translations",
|
|
1363
|
+
SOCKET_URL: "https://sockets.mars.matteappen.se",
|
|
1364
|
+
WEBSOCKETS_URL: "https://websockets.mars.matteappen.se"
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
["us-main" /* US_MAIN */]: {
|
|
1368
|
+
["DEFAULT" /* DEFAULT */]: {
|
|
1369
|
+
API_URL: "https://api.us.mars.magmamath.com/v2",
|
|
1370
|
+
CDN_HOST: "https://cdn.us.mars.magmamath.com",
|
|
1371
|
+
CDN_HOST_TRANSLATIONS: "https://cdn.us.mars.magmamath.com/translations",
|
|
1372
|
+
SOCKET_URL: "https://sockets.us.mars.magmamath.com",
|
|
1373
|
+
WEBSOCKETS_URL: "https://websockets.us.mars.magmamath.com"
|
|
1374
|
+
}
|
|
1375
|
+
},
|
|
1376
|
+
["ca-main" /* CA_MAIN */]: {
|
|
1377
|
+
["DEFAULT" /* DEFAULT */]: {
|
|
1378
|
+
API_URL: "https://api-ca.mars.magmamath.com/v2",
|
|
1379
|
+
CDN_HOST: "https://cdn.ca.magmamath.com",
|
|
1380
|
+
CDN_HOST_TRANSLATIONS: "https://cdn.ca.magmamath.com/translations",
|
|
1381
|
+
SOCKET_URL: "https://sockets.ca.magmamath.com",
|
|
1382
|
+
WEBSOCKETS_URL: "https://websockets.mars.matteappen.se"
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
var REGION_URLS = {
|
|
1387
|
+
["PROD" /* PROD */]: PROD,
|
|
1388
|
+
["MARS" /* MARS */]: MARS,
|
|
1389
|
+
["VENUS" /* VENUS */]: PROD
|
|
1390
|
+
};
|
|
1391
|
+
var localeToRegionVariant = (locale) => {
|
|
1392
|
+
if (locale === "sv-SE" /* SE */) return "sv-SE" /* SV_SE */;
|
|
1393
|
+
return "DEFAULT" /* DEFAULT */;
|
|
1394
|
+
};
|
|
1395
|
+
var REGION_LOGGLY_SUFFIX = {
|
|
1396
|
+
["eu-main" /* EU_MAIN */]: "",
|
|
1397
|
+
["us-main" /* US_MAIN */]: "US",
|
|
1398
|
+
["ca-main" /* CA_MAIN */]: "CA"
|
|
1399
|
+
};
|
|
1400
|
+
var rebuildLogglyTagForHomeRegion = (baseTag, homeRegion) => {
|
|
1401
|
+
const suffix = REGION_LOGGLY_SUFFIX[homeRegion];
|
|
1402
|
+
if (!suffix) return baseTag;
|
|
1403
|
+
const prefix = baseTag.split(",")[0];
|
|
1404
|
+
return `${prefix},${prefix}_${suffix}`;
|
|
1405
|
+
};
|
|
1406
|
+
|
|
1302
1407
|
// src/shared/constants/keyboard.constants.ts
|
|
1303
1408
|
var KeyboardPreset = /* @__PURE__ */ ((KeyboardPreset2) => {
|
|
1304
1409
|
KeyboardPreset2["DOT_MIXED"] = "DotMixed";
|
|
@@ -11628,6 +11733,7 @@ var AppConfigManager = class {
|
|
|
11628
11733
|
environment;
|
|
11629
11734
|
locale = "en-SE" /* US */;
|
|
11630
11735
|
envsRegion = "en-SE" /* US */;
|
|
11736
|
+
homeRegion;
|
|
11631
11737
|
setEnvs = effector.createEvent();
|
|
11632
11738
|
setLocaleConfig = effector.createEvent();
|
|
11633
11739
|
$envs = effector.restore(this.setEnvs, {});
|
|
@@ -11647,22 +11753,36 @@ var AppConfigManager = class {
|
|
|
11647
11753
|
this._DEV_OVERRIDES_ = opts._DEV_OVERRIDES_;
|
|
11648
11754
|
this.syncConfigsStores();
|
|
11649
11755
|
}
|
|
11756
|
+
applyHomeRegionOverride = (envs) => {
|
|
11757
|
+
if (!this.homeRegion) return envs;
|
|
11758
|
+
if (this.platform === "AUTH_WEB" /* AUTH_WEB */) return envs;
|
|
11759
|
+
const perRegion = REGION_URLS[this.environment]?.[this.homeRegion];
|
|
11760
|
+
if (!perRegion) return envs;
|
|
11761
|
+
const variant = localeToRegionVariant(this.locale);
|
|
11762
|
+
const override = perRegion[variant] ?? perRegion["DEFAULT" /* DEFAULT */];
|
|
11763
|
+
if (!override) return envs;
|
|
11764
|
+
const baseLogglyTag = envs.LOGGLY_TAG;
|
|
11765
|
+
const logglyOverride = baseLogglyTag ? { LOGGLY_TAG: rebuildLogglyTagForHomeRegion(baseLogglyTag, this.homeRegion) } : {};
|
|
11766
|
+
return { ...envs, ...override, ...logglyOverride };
|
|
11767
|
+
};
|
|
11650
11768
|
syncConfigsStores = () => {
|
|
11651
|
-
const
|
|
11769
|
+
const baseEnvs = ENV_PRESET[this.platform][this.envsRegion][this.environment];
|
|
11770
|
+
const withHomeRegion = this.applyHomeRegionOverride(baseEnvs);
|
|
11652
11771
|
const _DEV_OVERRIDES_ = this._DEV_OVERRIDES_?.[this.envsRegion];
|
|
11653
11772
|
if (_DEV_OVERRIDES_) {
|
|
11654
11773
|
consoleLogOverridesMessage();
|
|
11655
|
-
this.setEnvs({ ...
|
|
11774
|
+
this.setEnvs({ ...withHomeRegion, ..._DEV_OVERRIDES_ });
|
|
11656
11775
|
this.setLocaleConfig(LOCALE_PRESET[this.platform][this.locale]);
|
|
11657
11776
|
return;
|
|
11658
11777
|
}
|
|
11659
|
-
this.setEnvs(
|
|
11778
|
+
this.setEnvs(withHomeRegion);
|
|
11660
11779
|
this.setLocaleConfig(LOCALE_PRESET[this.platform][this.locale]);
|
|
11661
11780
|
};
|
|
11662
11781
|
set = (props) => {
|
|
11663
11782
|
this.locale = props.locale ?? this.locale;
|
|
11664
11783
|
this.environment = props.environment ?? this.environment;
|
|
11665
11784
|
this.envsRegion = props.envsRegion ?? this.envsRegion;
|
|
11785
|
+
this.homeRegion = props.homeRegion ?? this.homeRegion;
|
|
11666
11786
|
this.syncConfigsStores();
|
|
11667
11787
|
};
|
|
11668
11788
|
getEnvs = () => {
|
|
@@ -11713,6 +11833,7 @@ exports.Environment = Environment;
|
|
|
11713
11833
|
exports.FI_CALENDAR_CONFIG = FI_CALENDAR_CONFIG;
|
|
11714
11834
|
exports.FR_CALENDAR_CONFIG = FR_CALENDAR_CONFIG;
|
|
11715
11835
|
exports.Grade = Grade;
|
|
11836
|
+
exports.HomeRegion = HomeRegion;
|
|
11716
11837
|
exports.IS_CALENDAR_CONFIG = IS_CALENDAR_CONFIG;
|
|
11717
11838
|
exports.IT_CALENDAR_CONFIG = IT_CALENDAR_CONFIG;
|
|
11718
11839
|
exports.KeyboardCurrencyVariant = KeyboardCurrencyVariant;
|
|
@@ -11741,6 +11862,9 @@ exports.ProblemCreatorDescriptionVariant = ProblemCreatorDescriptionVariant;
|
|
|
11741
11862
|
exports.ProblemCreatorKeyboardPreset = ProblemCreatorKeyboardPreset;
|
|
11742
11863
|
exports.ProblemCreatorMathEntryVariant = ProblemCreatorMathEntryVariant;
|
|
11743
11864
|
exports.QRCodeSize = QRCodeSize;
|
|
11865
|
+
exports.REGION_LOGGLY_SUFFIX = REGION_LOGGLY_SUFFIX;
|
|
11866
|
+
exports.REGION_URLS = REGION_URLS;
|
|
11867
|
+
exports.RegionURLVariant = RegionURLVariant;
|
|
11744
11868
|
exports.SE_CALENDAR_CONFIG = SE_CALENDAR_CONFIG;
|
|
11745
11869
|
exports.SSO = SSO;
|
|
11746
11870
|
exports.SV_FI_CALENDAR_CONFIG = SV_FI_CALENDAR_CONFIG;
|
|
@@ -11748,5 +11872,7 @@ exports.Source = Source;
|
|
|
11748
11872
|
exports.TTSOverrideSymbol = TTSOverrideSymbol;
|
|
11749
11873
|
exports.TreeLevel = TreeLevel;
|
|
11750
11874
|
exports.buildTargetToEnvironment = buildTargetToEnvironment;
|
|
11875
|
+
exports.localeToRegionVariant = localeToRegionVariant;
|
|
11876
|
+
exports.rebuildLogglyTagForHomeRegion = rebuildLogglyTagForHomeRegion;
|
|
11751
11877
|
//# sourceMappingURL=index.js.map
|
|
11752
11878
|
//# sourceMappingURL=index.js.map
|