@churchapps/helpers 1.2.32 → 1.3.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.
|
@@ -14,6 +14,8 @@ export declare class CommonEnvironmentHelper {
|
|
|
14
14
|
static B1AdminRoot: string;
|
|
15
15
|
static LessonsRoot: string;
|
|
16
16
|
static init: (stage: string) => void;
|
|
17
|
+
private static readApiBase;
|
|
18
|
+
private static applyApiBase;
|
|
17
19
|
static initDev: () => void;
|
|
18
20
|
static initDemo: () => void;
|
|
19
21
|
static initStaging: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonEnvironmentHelper.d.ts","sourceRoot":"","sources":["../src/CommonEnvironmentHelper.ts"],"names":[],"mappings":"AACA,qBAAa,uBAAuB;IAClC,OAAc,aAAa,SAAM;IACjC,OAAc,QAAQ,SAAM;IAC5B,OAAc,SAAS,SAAM;IAC7B,OAAc,aAAa,SAAM;IACjC,OAAc,YAAY,SAAM;IAChC,OAAc,YAAY,SAAM;IAChC,OAAc,kBAAkB,SAAM;IACtC,OAAc,UAAU,SAAM;IAC9B,OAAc,MAAM,SAAM;IAC1B,OAAc,kBAAkB,SAAM;IAEtC,MAAM,CAAC,WAAW,SAAM;IACxB,MAAM,CAAC,MAAM,SAAM;IACnB,MAAM,CAAC,WAAW,SAAM;IACxB,MAAM,CAAC,WAAW,SAAM;IAExB,MAAM,CAAC,IAAI,GAAI,OAAO,MAAM,UAO1B;IAEF,MAAM,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"CommonEnvironmentHelper.d.ts","sourceRoot":"","sources":["../src/CommonEnvironmentHelper.ts"],"names":[],"mappings":"AACA,qBAAa,uBAAuB;IAClC,OAAc,aAAa,SAAM;IACjC,OAAc,QAAQ,SAAM;IAC5B,OAAc,SAAS,SAAM;IAC7B,OAAc,aAAa,SAAM;IACjC,OAAc,YAAY,SAAM;IAChC,OAAc,YAAY,SAAM;IAChC,OAAc,kBAAkB,SAAM;IACtC,OAAc,UAAU,SAAM;IAC9B,OAAc,MAAM,SAAM;IAC1B,OAAc,kBAAkB,SAAM;IAEtC,MAAM,CAAC,WAAW,SAAM;IACxB,MAAM,CAAC,MAAM,SAAM;IACnB,MAAM,CAAC,WAAW,SAAM;IACxB,MAAM,CAAC,WAAW,SAAM;IAExB,MAAM,CAAC,IAAI,GAAI,OAAO,MAAM,UAO1B;IAEF,OAAO,CAAC,MAAM,CAAC,WAAW,CAIlB;IAER,OAAO,CAAC,MAAM,CAAC,YAAY,CASzB;IAEF,MAAM,CAAC,OAAO,aAaZ;IAGF,MAAM,CAAC,QAAQ,aAUb;IAGF,MAAM,CAAC,WAAW,aAUhB;IAGF,MAAM,CAAC,QAAQ,aASb;CAEH"}
|
|
@@ -29,16 +29,26 @@ export class CommonEnvironmentHelper {
|
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
+
static readApiBase = () => process.env.REACT_APP_API_BASE
|
|
33
|
+
|| process.env.NEXT_PUBLIC_API_BASE
|
|
34
|
+
|| process.env.EXPO_PUBLIC_API_BASE
|
|
35
|
+
|| "";
|
|
36
|
+
static applyApiBase = (base) => {
|
|
37
|
+
const trimmed = base.replace(/\/$/, "");
|
|
38
|
+
CommonEnvironmentHelper.MembershipApi = trimmed + "/membership";
|
|
39
|
+
CommonEnvironmentHelper.AttendanceApi = trimmed + "/attendance";
|
|
40
|
+
CommonEnvironmentHelper.ContentApi = trimmed + "/content";
|
|
41
|
+
CommonEnvironmentHelper.GivingApi = trimmed + "/giving";
|
|
42
|
+
CommonEnvironmentHelper.MessagingApi = trimmed + "/messaging";
|
|
43
|
+
CommonEnvironmentHelper.DoingApi = trimmed + "/doing";
|
|
44
|
+
CommonEnvironmentHelper.ReportingApi = trimmed + "/reporting";
|
|
45
|
+
};
|
|
32
46
|
static initDev = () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
CommonEnvironmentHelper.MembershipApi = process.env.REACT_APP_MEMBERSHIP_API || process.env.NEXT_PUBLIC_MEMBERSHIP_API || CommonEnvironmentHelper.MembershipApi;
|
|
38
|
-
CommonEnvironmentHelper.ReportingApi = process.env.REACT_APP_REPORTING_API || process.env.NEXT_PUBLIC_REPORTING_API || CommonEnvironmentHelper.ReportingApi;
|
|
39
|
-
CommonEnvironmentHelper.MessagingApi = process.env.REACT_APP_MESSAGING_API || process.env.NEXT_PUBLIC_MESSAGING_API || CommonEnvironmentHelper.MessagingApi;
|
|
47
|
+
CommonEnvironmentHelper.initStaging(); //Use staging values for anything not provided
|
|
48
|
+
const base = CommonEnvironmentHelper.readApiBase();
|
|
49
|
+
if (base)
|
|
50
|
+
CommonEnvironmentHelper.applyApiBase(base);
|
|
40
51
|
CommonEnvironmentHelper.MessagingApiSocket = process.env.REACT_APP_MESSAGING_API_SOCKET || process.env.NEXT_PUBLIC_MESSAGING_API_SOCKET || CommonEnvironmentHelper.MessagingApiSocket;
|
|
41
|
-
CommonEnvironmentHelper.ContentApi = process.env.REACT_APP_CONTENT_API || process.env.NEXT_PUBLIC_CONTENT_API || CommonEnvironmentHelper.ContentApi;
|
|
42
52
|
CommonEnvironmentHelper.AskApi = process.env.REACT_APP_ASK_API || process.env.NEXT_PUBLIC_ASK_API || CommonEnvironmentHelper.AskApi;
|
|
43
53
|
CommonEnvironmentHelper.GoogleAnalyticsTag = process.env.REACT_APP_GOOGLE_ANALYTICS || process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS || CommonEnvironmentHelper.GoogleAnalyticsTag;
|
|
44
54
|
CommonEnvironmentHelper.ContentRoot = process.env.REACT_APP_CONTENT_ROOT || process.env.NEXT_PUBLIC_CONTENT_ROOT || CommonEnvironmentHelper.ContentRoot;
|
|
@@ -48,14 +58,8 @@ export class CommonEnvironmentHelper {
|
|
|
48
58
|
};
|
|
49
59
|
//NOTE: None of these values are secret.
|
|
50
60
|
static initDemo = () => {
|
|
51
|
-
CommonEnvironmentHelper.
|
|
52
|
-
CommonEnvironmentHelper.DoingApi = "https://api.demo.churchapps.org/doing";
|
|
53
|
-
CommonEnvironmentHelper.GivingApi = "https://api.demo.churchapps.org/giving";
|
|
54
|
-
CommonEnvironmentHelper.MembershipApi = "https://api.demo.churchapps.org/membership";
|
|
55
|
-
CommonEnvironmentHelper.ReportingApi = "https://api.demo.churchapps.org/reporting";
|
|
56
|
-
CommonEnvironmentHelper.MessagingApi = "https://api.demo.churchapps.org/messaging";
|
|
61
|
+
CommonEnvironmentHelper.applyApiBase("https://api.demo.churchapps.org");
|
|
57
62
|
CommonEnvironmentHelper.MessagingApiSocket = "wss://socket.demo.churchapps.org";
|
|
58
|
-
CommonEnvironmentHelper.ContentApi = "https://api.demo.churchapps.org/content";
|
|
59
63
|
CommonEnvironmentHelper.AskApi = "https://askapi.demo.churchapps.org";
|
|
60
64
|
CommonEnvironmentHelper.GoogleAnalyticsTag = "";
|
|
61
65
|
CommonEnvironmentHelper.ContentRoot = "https://democontent.churchapps.org";
|
|
@@ -65,14 +69,8 @@ export class CommonEnvironmentHelper {
|
|
|
65
69
|
};
|
|
66
70
|
//NOTE: None of these values are secret.
|
|
67
71
|
static initStaging = () => {
|
|
68
|
-
CommonEnvironmentHelper.
|
|
69
|
-
CommonEnvironmentHelper.DoingApi = "https://api.staging.churchapps.org/doing";
|
|
70
|
-
CommonEnvironmentHelper.GivingApi = "https://api.staging.churchapps.org/giving";
|
|
71
|
-
CommonEnvironmentHelper.MembershipApi = "https://api.staging.churchapps.org/membership";
|
|
72
|
-
CommonEnvironmentHelper.ReportingApi = "https://api.staging.churchapps.org/reporting";
|
|
73
|
-
CommonEnvironmentHelper.MessagingApi = "https://api.staging.churchapps.org/messaging";
|
|
72
|
+
CommonEnvironmentHelper.applyApiBase("https://api.staging.churchapps.org");
|
|
74
73
|
CommonEnvironmentHelper.MessagingApiSocket = "wss://socket.staging.churchapps.org";
|
|
75
|
-
CommonEnvironmentHelper.ContentApi = "https://api.staging.churchapps.org/content";
|
|
76
74
|
CommonEnvironmentHelper.AskApi = "https://askapi.staging.churchapps.org";
|
|
77
75
|
CommonEnvironmentHelper.GoogleAnalyticsTag = "";
|
|
78
76
|
CommonEnvironmentHelper.ContentRoot = "https://content.staging.churchapps.org";
|
|
@@ -82,14 +80,8 @@ export class CommonEnvironmentHelper {
|
|
|
82
80
|
};
|
|
83
81
|
//NOTE: None of these values are secret.
|
|
84
82
|
static initProd = () => {
|
|
85
|
-
CommonEnvironmentHelper.
|
|
86
|
-
CommonEnvironmentHelper.DoingApi = "https://api.churchapps.org/doing";
|
|
87
|
-
CommonEnvironmentHelper.GivingApi = "https://api.churchapps.org/giving";
|
|
88
|
-
CommonEnvironmentHelper.MembershipApi = "https://api.churchapps.org/membership";
|
|
89
|
-
CommonEnvironmentHelper.ReportingApi = "https://api.churchapps.org/reporting";
|
|
90
|
-
CommonEnvironmentHelper.MessagingApi = "https://api.churchapps.org/messaging";
|
|
83
|
+
CommonEnvironmentHelper.applyApiBase("https://api.churchapps.org");
|
|
91
84
|
CommonEnvironmentHelper.MessagingApiSocket = "wss://socket.churchapps.org";
|
|
92
|
-
CommonEnvironmentHelper.ContentApi = "https://api.churchapps.org/content";
|
|
93
85
|
CommonEnvironmentHelper.AskApi = "https://askapi.churchapps.org";
|
|
94
86
|
CommonEnvironmentHelper.ContentRoot = "https://content.churchapps.org";
|
|
95
87
|
CommonEnvironmentHelper.B1Root = "https://{key}.b1.church";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonEnvironmentHelper.js","sourceRoot":"","sources":["../src/CommonEnvironmentHelper.ts"],"names":[],"mappings":"AACA,MAAM,OAAO,uBAAuB;IAC3B,MAAM,CAAC,aAAa,GAAG,EAAE,CAAC;IAC1B,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,MAAM,CAAC,aAAa,GAAG,EAAE,CAAC;IAC1B,MAAM,CAAC,YAAY,GA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