jmapcloud-ng-core-types 0.0.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.
@@ -0,0 +1,96 @@
1
+ declare interface JUserEventSessionChangedParams {
2
+ session: JSessionData
3
+ }
4
+
5
+ declare interface JTokenInfo {
6
+ /**
7
+ * The JMap user session token (legacy) or access token (Saas JMap Cloud).
8
+ */
9
+ accessToken: string
10
+ /**
11
+ * The refresh token.
12
+ */
13
+ refreshToken: string
14
+ /**
15
+ * The access token expiration time in seconds.
16
+ */
17
+ accessTokenExpiration: number
18
+ }
19
+
20
+ declare interface JSessionData extends JTokenInfo {
21
+ /**
22
+ * The user permission to change his password
23
+ */
24
+ changePasswordAllowed: boolean
25
+ /**
26
+ * The user information.
27
+ *
28
+ * @example ```ts
29
+ *
30
+ * user: {
31
+ * username: "jdo@company.com",
32
+ * fullName: "John Do",
33
+ * admin: true
34
+ * }
35
+ * ```
36
+ */
37
+ user: JUserIdentity
38
+ /**
39
+ * Infos about the user's organizations, only for JMap Cloud servers.
40
+ */
41
+ organizationInfos: JOrganizationInfo[]
42
+ /**
43
+ * THe JMap Cloud organization in which the user is currently logged in, only for JMap Cloud servers.
44
+ */
45
+ currentOrganization: JOrganization
46
+ }
47
+
48
+ declare interface JUserIdentity {
49
+ username: string
50
+ fullName: string
51
+ email: string
52
+ }
53
+
54
+ declare interface JUserInfo {
55
+ id: string
56
+ label: string
57
+ value: undefined | null | string | number | Date
58
+ }
59
+
60
+ declare interface JOrganizationInfo {
61
+ id: string
62
+ auth0Id: string
63
+ name: string
64
+ logoUrl: string
65
+ primaryColor: string
66
+ backgroundColor: string
67
+ active: boolean
68
+ }
69
+
70
+ declare interface JOrganization extends JOrganizationInfo {
71
+ externalApiKeys: JOrganizationExternalApiKey[]
72
+ enabledExtensions: JProjectServerExtension[]
73
+ }
74
+
75
+ declare interface JOrganizationExternalApiKey {
76
+ id: string
77
+ title: string
78
+ apiKey: string
79
+ type: JORGANIZATION_EXTERNAL_API_KEY_TYPES
80
+ }
81
+
82
+ declare interface JJMapServerPasswordPolicyCompliance {
83
+ hasMinimumLength: boolean
84
+ }
85
+
86
+ declare interface JJMapCloudPasswordPolicyCompliance extends JJMapServerPasswordPolicyCompliance {
87
+ hasLowercaseLetters: boolean
88
+ hasUppercaseLetters: boolean
89
+ hasNumbers: boolean
90
+ hasSpecialCharacters: boolean
91
+ }
92
+
93
+ // ALL_JORGANIZATION_EXTERNAL_API_KEY_TYPES in all-enum.ts
94
+ declare const enum JORGANIZATION_EXTERNAL_API_KEY_TYPES {
95
+ MAPBOX_ACCESS_TOKEN = "MAPBOX_ACCESS_TOKEN"
96
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./out",
4
+ "baseUrl": "./",
5
+ "strict": true,
6
+ "sourceMap": true,
7
+ "noImplicitAny": true,
8
+ "moduleResolution": "node",
9
+ "module": "esnext",
10
+ "target": "es5",
11
+ "jsx": "react",
12
+ "lib": [
13
+ "es2017",
14
+ "dom",
15
+ "es5",
16
+ "es2015.promise"
17
+ ]
18
+ },
19
+ "include": [
20
+ "../public/**/*",
21
+ "../private/**/*",
22
+ "./index.ts",
23
+ "./all-enums.ts"
24
+ ]
25
+ }
package/tslint.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "defaultSeverity": "error",
3
+ "extends": [
4
+ "tslint:recommended"
5
+ ],
6
+ "jsRules": {},
7
+ "rules": {
8
+ "no-eval": false,
9
+ "semicolon": [
10
+ true,
11
+ "never"
12
+ ],
13
+ "object-literal-sort-keys": false,
14
+ "no-shadowed-variable": [
15
+ true,
16
+ {
17
+ "class": true,
18
+ "enum": true,
19
+ "function": true,
20
+ "interface": false,
21
+ "namespace": true,
22
+ "typeAlias": false,
23
+ "typeParameter": false,
24
+ "temporalDeadZone": false
25
+ }
26
+ ],
27
+ "arrow-parens": [
28
+ true,
29
+ "ban-single-arg-parens"
30
+ ],
31
+ "no-trailing-whitespace": [
32
+ true,
33
+ "ignore-comments"
34
+ ],
35
+ "ordered-imports": [
36
+ false,
37
+ {
38
+ "import-sources-order": "any",
39
+ "named-imports-order": "any",
40
+ "grouped-imports": true
41
+ }
42
+ ],
43
+ "max-line-length": [
44
+ true,
45
+ 130
46
+ ],
47
+ "curly": [
48
+ true
49
+ ],
50
+ "no-console": [
51
+ true,
52
+ "log"
53
+ ],
54
+ "max-classes-per-file": [
55
+ true,
56
+ 10,
57
+ "exclude-class-expressions"
58
+ ],
59
+ "trailing-comma": [ false ],
60
+ "variable-name": [
61
+ false,
62
+ "ban-keywords", "check-format", "allow-leading-underscore", "allow-trailing-underscore"
63
+ ],
64
+ "interface-name": [ false ],
65
+ "member-ordering": [
66
+ true,
67
+ {
68
+ "order": [
69
+ "public-static-field",
70
+ "public-instance-field",
71
+ "private-static-field",
72
+ "private-instance-field",
73
+ "public-constructor",
74
+ "private-constructor",
75
+ "public-static-method",
76
+ "public-instance-method",
77
+ "protected-instance-method",
78
+ "private-instance-method",
79
+ "private-static-method"
80
+ ]
81
+ }
82
+ ],
83
+ "no-namespace": [true, "allow-declarations"]
84
+ },
85
+ "rulesDirectory": []
86
+ }