@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 +5 -0
- package/currentUserContext.d.ts +29 -0
- package/environmentContext.d.ts +30 -0
- package/index.d.ts +4 -0
- package/index.js +10 -0
- package/package.json +10 -0
- package/test/config/jest.setup.d.ts +1 -0
- package/tokenContext.d.ts +6 -0
- package/userSubscriptionContext.d.ts +23 -0
package/README.md
ADDED
@@ -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
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 @@
|
|
1
|
+
export {};
|
@@ -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
|
+
}
|