@trackunit/react-core-contexts-api 0.0.34

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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ This is the documentation for library
2
+
3
+ # core-contexts-api
4
+
5
+ The purpose of this library is to contain the api for the core contexts.
@@ -0,0 +1,29 @@
1
+ export interface ICurrentUserContext {
2
+ /**
3
+ * userName used when logging in. Undefined if not authenticated
4
+ */
5
+ userName: string | undefined;
6
+ /**
7
+ * Legacy user id. Undefined if not authenticated
8
+ */
9
+ userId: number | undefined;
10
+ /**
11
+ * Legacy customer id. Undefined if not authenticated
12
+ */
13
+ customerId: number | undefined;
14
+ /**
15
+ * Account ID. undefined if not authenticated
16
+ */
17
+ accountId: string | undefined;
18
+ /**
19
+ * If currently assuming a different user, this contains the information of that user. Null if not assuming
20
+ */
21
+ assumedUser: {
22
+ userId: number;
23
+ customerId: number;
24
+ accountId: string;
25
+ } | null;
26
+ email: string | undefined;
27
+ name: string | undefined;
28
+ jobTitle: string | undefined;
29
+ }
@@ -0,0 +1,30 @@
1
+ export interface ITracingHeaders {
2
+ "X-TrackunitAppVersion": string;
3
+ "session-id": string;
4
+ }
5
+ export interface IEnvironmentContext {
6
+ auth: {
7
+ url: string;
8
+ clientId: string;
9
+ issuer: string;
10
+ };
11
+ tracingHeaders: ITracingHeaders;
12
+ managerClassicUrl: string;
13
+ googleMapsApiKey: string;
14
+ amplitudeApiKey: string;
15
+ launchDarklyApiKey: string;
16
+ twilioUrl: string;
17
+ graphqlLegacyUrl: string;
18
+ graphqlManagerUrl: string;
19
+ graphqlReportUrl: string;
20
+ graphqlSimulatorUrl: string;
21
+ buildVersion: string;
22
+ commitNumber: number;
23
+ buildDate: string;
24
+ publicUrl: string;
25
+ irisAppSdkServerUrl: string;
26
+ isDev: boolean;
27
+ environment: string;
28
+ sentryDsn: string;
29
+ sessionId: string;
30
+ }
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./currentUserContext";
2
+ export * from "./environmentContext";
3
+ export * from "./tokenContext";
4
+ export * from "./userSubscriptionContext";
package/index.js ADDED
@@ -0,0 +1,10 @@
1
+ var UserSubscriptionPackageType;
2
+
3
+ (function (UserSubscriptionPackageType) {
4
+ UserSubscriptionPackageType["Collect"] = "COLLECT";
5
+ UserSubscriptionPackageType["Insight"] = "INSIGHT";
6
+ UserSubscriptionPackageType["None"] = "NONE";
7
+ UserSubscriptionPackageType["View"] = "VIEW";
8
+ })(UserSubscriptionPackageType || (UserSubscriptionPackageType = {}));
9
+
10
+ export { UserSubscriptionPackageType };
package/package.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@trackunit/react-core-contexts-api",
3
+ "version": "0.0.34",
4
+ "repository": "https://github.com/Trackunit/manager",
5
+ "license": "MIT",
6
+ "module": "./index.js",
7
+ "main": "./index.js",
8
+ "type": "module",
9
+ "types": "./index.d.ts"
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface ITokenContext {
2
+ /**
3
+ * The current valid token or null if no token is available.
4
+ */
5
+ token?: string;
6
+ }
@@ -0,0 +1,23 @@
1
+ export interface IUserSubscriptionContext {
2
+ /**
3
+ * The users subscription package
4
+ */
5
+ packageType: UserSubscriptionPackageType;
6
+ /**
7
+ * Extra features enabled for the current user. Will be null if still loading
8
+ */
9
+ features: IFeature[] | null;
10
+ hasCollectPackage: boolean;
11
+ hasViewPackage: boolean;
12
+ hasInsightPackage: boolean;
13
+ }
14
+ export declare enum UserSubscriptionPackageType {
15
+ Collect = "COLLECT",
16
+ Insight = "INSIGHT",
17
+ None = "NONE",
18
+ View = "VIEW"
19
+ }
20
+ export interface IFeature {
21
+ id: string;
22
+ name: string;
23
+ }