@descope/angular-sdk 0.5.11 → 0.5.12
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/package.json +17 -13
- package/.eslintrc.json +0 -41
- package/.prettierrc +0 -7
- package/CHANGELOG.md +0 -5
- package/angular.json +0 -154
- package/jest.config.js +0 -17
- package/project.json +0 -17
- package/projects/angular-sdk/.eslintrc.json +0 -32
- package/projects/angular-sdk/ng-package.json +0 -17
- package/projects/angular-sdk/package.json +0 -87
- package/projects/angular-sdk/src/environment.ts +0 -3
- package/projects/angular-sdk/src/lib/components/access-key-management/access-key-management.component.spec.ts +0 -84
- package/projects/angular-sdk/src/lib/components/access-key-management/access-key-management.component.ts +0 -63
- package/projects/angular-sdk/src/lib/components/audit-management/audit-management.component.spec.ts +0 -84
- package/projects/angular-sdk/src/lib/components/audit-management/audit-management.component.ts +0 -63
- package/projects/angular-sdk/src/lib/components/descope/descope.component.spec.ts +0 -142
- package/projects/angular-sdk/src/lib/components/descope/descope.component.ts +0 -171
- package/projects/angular-sdk/src/lib/components/role-management/role-management.component.spec.ts +0 -84
- package/projects/angular-sdk/src/lib/components/role-management/role-management.component.ts +0 -63
- package/projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.html +0 -17
- package/projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.spec.ts +0 -53
- package/projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.ts +0 -35
- package/projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.html +0 -17
- package/projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.spec.ts +0 -51
- package/projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.ts +0 -35
- package/projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.html +0 -17
- package/projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.spec.ts +0 -53
- package/projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.ts +0 -35
- package/projects/angular-sdk/src/lib/components/user-management/user-management.component.spec.ts +0 -84
- package/projects/angular-sdk/src/lib/components/user-management/user-management.component.ts +0 -64
- package/projects/angular-sdk/src/lib/components/user-profile/user-profile.component.spec.ts +0 -93
- package/projects/angular-sdk/src/lib/components/user-profile/user-profile.component.ts +0 -77
- package/projects/angular-sdk/src/lib/descope-auth.module.ts +0 -61
- package/projects/angular-sdk/src/lib/services/descope-auth.guard.spec.ts +0 -76
- package/projects/angular-sdk/src/lib/services/descope-auth.guard.ts +0 -16
- package/projects/angular-sdk/src/lib/services/descope-auth.service.spec.ts +0 -309
- package/projects/angular-sdk/src/lib/services/descope-auth.service.ts +0 -200
- package/projects/angular-sdk/src/lib/services/descope.interceptor.spec.ts +0 -102
- package/projects/angular-sdk/src/lib/services/descope.interceptor.ts +0 -76
- package/projects/angular-sdk/src/lib/types/types.ts +0 -15
- package/projects/angular-sdk/src/lib/utils/constants.ts +0 -8
- package/projects/angular-sdk/src/lib/utils/helpers.spec.ts +0 -103
- package/projects/angular-sdk/src/lib/utils/helpers.ts +0 -36
- package/projects/angular-sdk/src/public-api.ts +0 -18
- package/projects/angular-sdk/tsconfig.lib.json +0 -12
- package/projects/angular-sdk/tsconfig.lib.prod.json +0 -10
- package/projects/angular-sdk/tsconfig.spec.json +0 -11
- package/projects/demo-app/.eslintrc.json +0 -31
- package/projects/demo-app/src/app/app-routing.module.ts +0 -33
- package/projects/demo-app/src/app/app.component.html +0 -3
- package/projects/demo-app/src/app/app.component.scss +0 -18
- package/projects/demo-app/src/app/app.component.spec.ts +0 -37
- package/projects/demo-app/src/app/app.component.ts +0 -8
- package/projects/demo-app/src/app/app.module.ts +0 -63
- package/projects/demo-app/src/app/home/home.component.html +0 -32
- package/projects/demo-app/src/app/home/home.component.scss +0 -15
- package/projects/demo-app/src/app/home/home.component.spec.ts +0 -44
- package/projects/demo-app/src/app/home/home.component.ts +0 -85
- package/projects/demo-app/src/app/interceptor/auth.interceptor.ts +0 -20
- package/projects/demo-app/src/app/login/login.component.html +0 -20
- package/projects/demo-app/src/app/login/login.component.spec.ts +0 -42
- package/projects/demo-app/src/app/login/login.component.ts +0 -41
- package/projects/demo-app/src/app/manage-access-keys/manage-access-keys.component.html +0 -12
- package/projects/demo-app/src/app/manage-access-keys/manage-access-keys.component.spec.ts +0 -36
- package/projects/demo-app/src/app/manage-access-keys/manage-access-keys.component.ts +0 -15
- package/projects/demo-app/src/app/manage-audit/manage-audit.component.html +0 -6
- package/projects/demo-app/src/app/manage-audit/manage-audit.component.spec.ts +0 -36
- package/projects/demo-app/src/app/manage-audit/manage-audit.component.ts +0 -15
- package/projects/demo-app/src/app/manage-roles/manage-roles.component.html +0 -6
- package/projects/demo-app/src/app/manage-roles/manage-roles.component.spec.ts +0 -36
- package/projects/demo-app/src/app/manage-roles/manage-roles.component.ts +0 -15
- package/projects/demo-app/src/app/manage-users/manage-users.component.html +0 -6
- package/projects/demo-app/src/app/manage-users/manage-users.component.spec.ts +0 -36
- package/projects/demo-app/src/app/manage-users/manage-users.component.ts +0 -15
- package/projects/demo-app/src/app/my-user-profile/my-user-profile.component.html +0 -6
- package/projects/demo-app/src/app/my-user-profile/my-user-profile.component.spec.ts +0 -36
- package/projects/demo-app/src/app/my-user-profile/my-user-profile.component.ts +0 -20
- package/projects/demo-app/src/app/my-user-profile/my-user-profile.scss +0 -18
- package/projects/demo-app/src/app/protected/protected.component.html +0 -18
- package/projects/demo-app/src/app/protected/protected.component.scss +0 -8
- package/projects/demo-app/src/app/protected/protected.component.spec.ts +0 -42
- package/projects/demo-app/src/app/protected/protected.component.ts +0 -41
- package/projects/demo-app/src/assets/.gitkeep +0 -0
- package/projects/demo-app/src/environments/conifg.ts +0 -14
- package/projects/demo-app/src/environments/environment.ts +0 -20
- package/projects/demo-app/src/favicon.ico +0 -0
- package/projects/demo-app/src/index.html +0 -17
- package/projects/demo-app/src/main.ts +0 -7
- package/projects/demo-app/src/styles.scss +0 -21
- package/projects/demo-app/tsconfig.app.json +0 -11
- package/projects/demo-app/tsconfig.spec.json +0 -10
- package/scripts/setversion/setversion.js +0 -20
- package/setup-jest.ts +0 -1
- package/tsconfig.json +0 -36
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descope/angular-sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": ">=16.0.0",
|
|
6
6
|
"@angular/core": ">=16.0.0"
|
|
@@ -10,29 +10,32 @@
|
|
|
10
10
|
"node": "^16.14.0 || >=18.10.0",
|
|
11
11
|
"npm": ">= 8.1.0"
|
|
12
12
|
},
|
|
13
|
-
"module": "fesm2022/descope-angular-sdk.mjs",
|
|
14
|
-
"typings": "index.d.ts",
|
|
13
|
+
"module": "dist/fesm2022/descope-angular-sdk.mjs",
|
|
14
|
+
"typings": "dist/index.d.ts",
|
|
15
15
|
"exports": {
|
|
16
16
|
"./package.json": {
|
|
17
17
|
"default": "./package.json"
|
|
18
18
|
},
|
|
19
19
|
".": {
|
|
20
|
-
"types": "./index.d.ts",
|
|
21
|
-
"esm2022": "./esm2022/descope-angular-sdk.mjs",
|
|
22
|
-
"esm": "./esm2022/descope-angular-sdk.mjs",
|
|
23
|
-
"default": "./fesm2022/descope-angular-sdk.mjs"
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"esm2022": "./dist/esm2022/descope-angular-sdk.mjs",
|
|
22
|
+
"esm": "./dist/esm2022/descope-angular-sdk.mjs",
|
|
23
|
+
"default": "./dist/fesm2022/descope-angular-sdk.mjs"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
26
29
|
"sideEffects": false,
|
|
27
30
|
"dependencies": {
|
|
28
31
|
"tslib": "^2.3.0",
|
|
29
32
|
"@descope/access-key-management-widget": "0.1.115",
|
|
30
|
-
"@descope/audit-management-widget": "0.1.78",
|
|
31
|
-
"@descope/user-management-widget": "0.4.116",
|
|
32
|
-
"@descope/user-profile-widget": "0.0.94",
|
|
33
33
|
"@descope/role-management-widget": "0.1.113",
|
|
34
|
+
"@descope/user-management-widget": "0.4.116",
|
|
35
|
+
"@descope/user-profile-widget": "0.0.95",
|
|
36
|
+
"@descope/audit-management-widget": "0.1.78",
|
|
37
|
+
"@descope/web-component": "3.22.0",
|
|
34
38
|
"@descope/web-js-sdk": "1.16.0",
|
|
35
|
-
"@descope/web-component": "3.21.1",
|
|
36
39
|
"@descope/core-js-sdk": "2.24.0"
|
|
37
40
|
},
|
|
38
41
|
"devDependencies": {
|
|
@@ -75,11 +78,12 @@
|
|
|
75
78
|
"format-lint": "pretty-quick --staged --ignore-path .gitignore && lint-staged",
|
|
76
79
|
"prebuild": "node scripts/setversion/setversion.js",
|
|
77
80
|
"build": "npm run build:lib && rm -rf ./dist/package.json",
|
|
78
|
-
"build:lib": "cp package.json ./projects/angular-sdk && ng build angular-sdk",
|
|
81
|
+
"build:lib": "cp package.json ./projects/angular-sdk && ng build angular-sdk && rm -rf ./projects/angular-sdk/package.json",
|
|
79
82
|
"build:app": "ng build demo-app",
|
|
80
|
-
"pretest": "cp package.json ./projects/angular-sdk",
|
|
81
83
|
"watch": "ng build --watch --configuration development",
|
|
84
|
+
"pretest": "cp package.json ./projects/angular-sdk",
|
|
82
85
|
"test": "jest --config jest.config.js",
|
|
86
|
+
"posttest": "rm -rf ./projects/angular-sdk/package.json",
|
|
83
87
|
"lint": "ng lint",
|
|
84
88
|
"format": "prettier . -w --ignore-path .gitignore",
|
|
85
89
|
"format-check": "prettier . --check --ignore-path .gitignore"
|
package/.eslintrc.json
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"ignorePatterns": ["projects/**/*"],
|
|
4
|
-
"overrides": [
|
|
5
|
-
{
|
|
6
|
-
"files": ["*.ts"],
|
|
7
|
-
"extends": [
|
|
8
|
-
"eslint:recommended",
|
|
9
|
-
"plugin:@typescript-eslint/recommended",
|
|
10
|
-
"plugin:@angular-eslint/recommended",
|
|
11
|
-
"plugin:@angular-eslint/template/process-inline-templates"
|
|
12
|
-
],
|
|
13
|
-
"rules": {
|
|
14
|
-
"@angular-eslint/directive-selector": [
|
|
15
|
-
"error",
|
|
16
|
-
{
|
|
17
|
-
"type": "attribute",
|
|
18
|
-
"prefix": "lib",
|
|
19
|
-
"style": "camelCase"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"@angular-eslint/component-selector": [
|
|
23
|
-
"error",
|
|
24
|
-
{
|
|
25
|
-
"type": "element",
|
|
26
|
-
"style": "kebab-case"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"@typescript-eslint/no-explicit-any": "off"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"files": ["*.html"],
|
|
34
|
-
"extends": [
|
|
35
|
-
"plugin:@angular-eslint/template/recommended",
|
|
36
|
-
"plugin:@angular-eslint/template/accessibility"
|
|
37
|
-
],
|
|
38
|
-
"rules": {}
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
package/.prettierrc
DELETED
package/CHANGELOG.md
DELETED
package/angular.json
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"newProjectRoot": "projects",
|
|
5
|
-
"projects": {
|
|
6
|
-
"angular-sdk": {
|
|
7
|
-
"projectType": "library",
|
|
8
|
-
"root": "projects/angular-sdk",
|
|
9
|
-
"sourceRoot": "projects/angular-sdk/src",
|
|
10
|
-
"prefix": "lib",
|
|
11
|
-
"architect": {
|
|
12
|
-
"build": {
|
|
13
|
-
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
14
|
-
"options": {
|
|
15
|
-
"project": "projects/angular-sdk/ng-package.json"
|
|
16
|
-
},
|
|
17
|
-
"configurations": {
|
|
18
|
-
"production": {
|
|
19
|
-
"tsConfig": "projects/angular-sdk/tsconfig.lib.prod.json"
|
|
20
|
-
},
|
|
21
|
-
"development": {
|
|
22
|
-
"tsConfig": "projects/angular-sdk/tsconfig.lib.json"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"defaultConfiguration": "production"
|
|
26
|
-
},
|
|
27
|
-
"test": {
|
|
28
|
-
"builder": "@angular-devkit/build-angular:karma",
|
|
29
|
-
"options": {
|
|
30
|
-
"tsConfig": "projects/angular-sdk/tsconfig.spec.json",
|
|
31
|
-
"polyfills": ["zone.js", "zone.js/testing"]
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"lint": {
|
|
35
|
-
"builder": "@angular-eslint/builder:lint",
|
|
36
|
-
"options": {
|
|
37
|
-
"lintFilePatterns": [
|
|
38
|
-
"projects/angular-sdk/**/*.ts",
|
|
39
|
-
"projects/angular-sdk/**/*.html"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"demo-app": {
|
|
46
|
-
"projectType": "application",
|
|
47
|
-
"schematics": {
|
|
48
|
-
"@schematics/angular:component": {
|
|
49
|
-
"style": "scss"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"root": "projects/demo-app",
|
|
53
|
-
"sourceRoot": "projects/demo-app/src",
|
|
54
|
-
"prefix": "app",
|
|
55
|
-
"architect": {
|
|
56
|
-
"build": {
|
|
57
|
-
"builder": "@angular-devkit/build-angular:browser",
|
|
58
|
-
"options": {
|
|
59
|
-
"allowedCommonJsDependencies": ["lodash.get"],
|
|
60
|
-
"outputPath": "dist/demo-app",
|
|
61
|
-
"index": "projects/demo-app/src/index.html",
|
|
62
|
-
"main": "projects/demo-app/src/main.ts",
|
|
63
|
-
"polyfills": ["zone.js"],
|
|
64
|
-
"tsConfig": "projects/demo-app/tsconfig.app.json",
|
|
65
|
-
"inlineStyleLanguage": "scss",
|
|
66
|
-
"assets": [
|
|
67
|
-
"projects/demo-app/src/favicon.ico",
|
|
68
|
-
"projects/demo-app/src/assets"
|
|
69
|
-
],
|
|
70
|
-
"styles": ["projects/demo-app/src/styles.scss"],
|
|
71
|
-
"scripts": []
|
|
72
|
-
},
|
|
73
|
-
"configurations": {
|
|
74
|
-
"production": {
|
|
75
|
-
"budgets": [
|
|
76
|
-
{
|
|
77
|
-
"type": "initial",
|
|
78
|
-
"maximumWarning": "500kb",
|
|
79
|
-
"maximumError": "1mb"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"type": "anyComponentStyle",
|
|
83
|
-
"maximumWarning": "2kb",
|
|
84
|
-
"maximumError": "4kb"
|
|
85
|
-
}
|
|
86
|
-
],
|
|
87
|
-
"outputHashing": "all"
|
|
88
|
-
},
|
|
89
|
-
"development": {
|
|
90
|
-
"buildOptimizer": false,
|
|
91
|
-
"optimization": false,
|
|
92
|
-
"vendorChunk": true,
|
|
93
|
-
"extractLicenses": false,
|
|
94
|
-
"sourceMap": true,
|
|
95
|
-
"namedChunks": true,
|
|
96
|
-
"fileReplacements": [
|
|
97
|
-
{
|
|
98
|
-
"replace": "projects/demo-app/src/environments/environment.ts",
|
|
99
|
-
"with": "projects/demo-app/src/environments/environment.development.ts"
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
"defaultConfiguration": "production"
|
|
105
|
-
},
|
|
106
|
-
"serve": {
|
|
107
|
-
"builder": "@angular-devkit/build-angular:dev-server",
|
|
108
|
-
"configurations": {
|
|
109
|
-
"production": {
|
|
110
|
-
"browserTarget": "demo-app:build:production"
|
|
111
|
-
},
|
|
112
|
-
"development": {
|
|
113
|
-
"browserTarget": "demo-app:build:development"
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
"defaultConfiguration": "development"
|
|
117
|
-
},
|
|
118
|
-
"extract-i18n": {
|
|
119
|
-
"builder": "@angular-devkit/build-angular:extract-i18n",
|
|
120
|
-
"options": {
|
|
121
|
-
"browserTarget": "demo-app:build"
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
"test": {
|
|
125
|
-
"builder": "@angular-devkit/build-angular:karma",
|
|
126
|
-
"options": {
|
|
127
|
-
"polyfills": ["zone.js", "zone.js/testing"],
|
|
128
|
-
"tsConfig": "projects/demo-app/tsconfig.spec.json",
|
|
129
|
-
"inlineStyleLanguage": "scss",
|
|
130
|
-
"assets": [
|
|
131
|
-
"projects/demo-app/src/favicon.ico",
|
|
132
|
-
"projects/demo-app/src/assets"
|
|
133
|
-
],
|
|
134
|
-
"styles": ["projects/demo-app/src/styles.scss"],
|
|
135
|
-
"scripts": []
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
"lint": {
|
|
139
|
-
"builder": "@angular-eslint/builder:lint",
|
|
140
|
-
"options": {
|
|
141
|
-
"lintFilePatterns": [
|
|
142
|
-
"projects/demo-app/**/*.ts",
|
|
143
|
-
"projects/demo-app/**/*.html"
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
"cli": {
|
|
151
|
-
"schematicCollections": ["@angular-eslint/schematics"],
|
|
152
|
-
"analytics": false
|
|
153
|
-
}
|
|
154
|
-
}
|
package/jest.config.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
preset: 'jest-preset-angular',
|
|
3
|
-
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
|
|
4
|
-
roots: ['<rootDir>/projects/angular-sdk', '<rootDir>/projects/demo-app'],
|
|
5
|
-
collectCoverage: true,
|
|
6
|
-
coverageDirectory: 'coverage',
|
|
7
|
-
collectCoverageFrom: ['projects/**/*.{js,ts}'],
|
|
8
|
-
transform: {
|
|
9
|
-
'^.+\\.(ts|js|html)$': [
|
|
10
|
-
'jest-preset-angular',
|
|
11
|
-
{
|
|
12
|
-
tsconfig: './projects/angular-sdk/tsconfig.spec.json',
|
|
13
|
-
stringifyContentPathRegex: '\\.(html|svg)$'
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
};
|
package/project.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "angular-sdk",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "packages/sdks/angular-sdk/projects",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"targets": {
|
|
7
|
-
"version": {
|
|
8
|
-
"executor": "@jscutlery/semver:version",
|
|
9
|
-
"options": {
|
|
10
|
-
"trackDeps": true,
|
|
11
|
-
"push": false,
|
|
12
|
-
"preset": "conventional"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"tags": []
|
|
17
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../.eslintrc.json",
|
|
3
|
-
"ignorePatterns": ["node_modules", "dist"],
|
|
4
|
-
"overrides": [
|
|
5
|
-
{
|
|
6
|
-
"files": ["*.ts"],
|
|
7
|
-
"rules": {
|
|
8
|
-
"@angular-eslint/directive-selector": [
|
|
9
|
-
"error",
|
|
10
|
-
{
|
|
11
|
-
"type": "attribute",
|
|
12
|
-
"prefix": "lib",
|
|
13
|
-
"style": "camelCase"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"@angular-eslint/component-selector": [
|
|
17
|
-
"error",
|
|
18
|
-
{
|
|
19
|
-
"type": "element",
|
|
20
|
-
"prefix": "",
|
|
21
|
-
"style": "kebab-case"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"@angular-eslint/no-output-native": "off"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"files": ["*.html"],
|
|
29
|
-
"rules": {}
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
-
"dest": "../../dist",
|
|
4
|
-
"lib": {
|
|
5
|
-
"entryFile": "src/public-api.ts"
|
|
6
|
-
},
|
|
7
|
-
"allowedNonPeerDependencies": [
|
|
8
|
-
"@descope/core-js-sdk",
|
|
9
|
-
"@descope/web-js-sdk",
|
|
10
|
-
"@descope/web-component",
|
|
11
|
-
"@descope/user-management-widget",
|
|
12
|
-
"@descope/role-management-widget",
|
|
13
|
-
"@descope/access-key-management-widget",
|
|
14
|
-
"@descope/audit-management-widget",
|
|
15
|
-
"@descope/user-profile-widget"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@descope/angular-sdk",
|
|
3
|
-
"version": "0.5.11",
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular/common": ">=16.0.0",
|
|
6
|
-
"@angular/core": ">=16.0.0"
|
|
7
|
-
},
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"engines": {
|
|
10
|
-
"node": "^16.14.0 || >=18.10.0",
|
|
11
|
-
"npm": ">= 8.1.0"
|
|
12
|
-
},
|
|
13
|
-
"module": "fesm2022/descope-angular-sdk.mjs",
|
|
14
|
-
"typings": "index.d.ts",
|
|
15
|
-
"exports": {
|
|
16
|
-
"./package.json": {
|
|
17
|
-
"default": "./package.json"
|
|
18
|
-
},
|
|
19
|
-
".": {
|
|
20
|
-
"types": "./index.d.ts",
|
|
21
|
-
"esm2022": "./esm2022/descope-angular-sdk.mjs",
|
|
22
|
-
"esm": "./esm2022/descope-angular-sdk.mjs",
|
|
23
|
-
"default": "./fesm2022/descope-angular-sdk.mjs"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"sideEffects": false,
|
|
27
|
-
"scripts": {
|
|
28
|
-
"ng": "ng",
|
|
29
|
-
"start": "ng serve",
|
|
30
|
-
"format-lint": "pretty-quick --staged --ignore-path .gitignore && lint-staged",
|
|
31
|
-
"prebuild": "node scripts/setversion/setversion.js",
|
|
32
|
-
"build": "npm run build:lib && rm -rf ./dist/package.json",
|
|
33
|
-
"build:lib": "cp package.json ./projects/angular-sdk && ng build angular-sdk",
|
|
34
|
-
"build:app": "ng build demo-app",
|
|
35
|
-
"pretest": "cp package.json ./projects/angular-sdk",
|
|
36
|
-
"watch": "ng build --watch --configuration development",
|
|
37
|
-
"test": "jest --config jest.config.js",
|
|
38
|
-
"lint": "ng lint",
|
|
39
|
-
"format": "prettier . -w --ignore-path .gitignore",
|
|
40
|
-
"format-check": "prettier . --check --ignore-path .gitignore"
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"@descope/access-key-management-widget": "workspace:*",
|
|
44
|
-
"@descope/audit-management-widget": "workspace:*",
|
|
45
|
-
"@descope/role-management-widget": "workspace:*",
|
|
46
|
-
"@descope/user-management-widget": "workspace:*",
|
|
47
|
-
"@descope/user-profile-widget": "workspace:*",
|
|
48
|
-
"@descope/web-component": "workspace:*",
|
|
49
|
-
"@descope/web-js-sdk": "workspace:*",
|
|
50
|
-
"@descope/core-js-sdk": "workspace:*",
|
|
51
|
-
"tslib": "^2.3.0"
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@angular-devkit/build-angular": "^16.2.6",
|
|
55
|
-
"@angular-eslint/builder": "16.3.1",
|
|
56
|
-
"@angular-eslint/eslint-plugin": "16.3.1",
|
|
57
|
-
"@angular-eslint/eslint-plugin-template": "16.3.1",
|
|
58
|
-
"@angular-eslint/schematics": "16.3.1",
|
|
59
|
-
"@angular-eslint/template-parser": "16.3.1",
|
|
60
|
-
"@angular/animations": "^16.2.9",
|
|
61
|
-
"@angular/cli": "^16.2.6",
|
|
62
|
-
"@angular/common": "^16.2.9",
|
|
63
|
-
"@angular/compiler": "^16.2.9",
|
|
64
|
-
"@angular/compiler-cli": "^16.2.9",
|
|
65
|
-
"@angular/core": "^16.2.9",
|
|
66
|
-
"@angular/forms": "^16.2.9",
|
|
67
|
-
"@angular/platform-browser": "^16.2.9",
|
|
68
|
-
"@angular/platform-browser-dynamic": "^16.2.9",
|
|
69
|
-
"@angular/router": "^16.2.9",
|
|
70
|
-
"@types/jest": "^29.5.5",
|
|
71
|
-
"@typescript-eslint/eslint-plugin": "6.12.0",
|
|
72
|
-
"@typescript-eslint/parser": "6.12.0",
|
|
73
|
-
"eslint": "^8.51.0",
|
|
74
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
75
|
-
"jest": "^29.7.0",
|
|
76
|
-
"jest-preset-angular": "^13.1.2",
|
|
77
|
-
"lint-staged": "^15.2.0",
|
|
78
|
-
"ng-mocks": "^14.11.0",
|
|
79
|
-
"ng-packagr": "^16.2.3",
|
|
80
|
-
"prettier": "2.8.8",
|
|
81
|
-
"pretty-quick": "^3.1.3",
|
|
82
|
-
"rxjs": "~7.8.1",
|
|
83
|
-
"tslib": "^2.6.2",
|
|
84
|
-
"typescript": "4.9.3",
|
|
85
|
-
"zone.js": "~0.13.0"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { AccessKeyManagementComponent } from './access-key-management.component';
|
|
3
|
-
import createSdk from '@descope/web-js-sdk';
|
|
4
|
-
import { DescopeAuthConfig } from '../../types/types';
|
|
5
|
-
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
6
|
-
import mocked = jest.mocked;
|
|
7
|
-
|
|
8
|
-
jest.mock('@descope/web-js-sdk');
|
|
9
|
-
//Mock DescopeAccessKeyManagementWidget
|
|
10
|
-
jest.mock('@descope/access-key-management-widget', () => {
|
|
11
|
-
return jest.fn(() => {
|
|
12
|
-
// Create a mock DOM element
|
|
13
|
-
return document.createElement('descope-access-key-management-widget');
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe('DescopeAccessKeyManagementComponent', () => {
|
|
18
|
-
let component: AccessKeyManagementComponent;
|
|
19
|
-
let fixture: ComponentFixture<AccessKeyManagementComponent>;
|
|
20
|
-
let mockedCreateSdk: jest.Mock;
|
|
21
|
-
const onSessionTokenChangeSpy = jest.fn();
|
|
22
|
-
const onAccessKeyChangeSpy = jest.fn();
|
|
23
|
-
const afterRequestHooksSpy = jest.fn();
|
|
24
|
-
const mockConfig: DescopeAuthConfig = {
|
|
25
|
-
projectId: 'someProject'
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
mockedCreateSdk = mocked(createSdk);
|
|
30
|
-
|
|
31
|
-
mockedCreateSdk.mockReturnValue({
|
|
32
|
-
onSessionTokenChange: onSessionTokenChangeSpy,
|
|
33
|
-
onAccessKeyChange: onAccessKeyChangeSpy,
|
|
34
|
-
httpClient: {
|
|
35
|
-
hooks: {
|
|
36
|
-
afterRequest: afterRequestHooksSpy
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
TestBed.configureTestingModule({
|
|
42
|
-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
43
|
-
providers: [
|
|
44
|
-
DescopeAuthConfig,
|
|
45
|
-
{ provide: DescopeAuthConfig, useValue: mockConfig }
|
|
46
|
-
]
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
fixture = TestBed.createComponent(AccessKeyManagementComponent);
|
|
50
|
-
component = fixture.componentInstance;
|
|
51
|
-
component.projectId = '123';
|
|
52
|
-
component.tenant = 'tenant-1';
|
|
53
|
-
component.widgetId = 'widget-1';
|
|
54
|
-
component.logger = {
|
|
55
|
-
info: jest.fn(),
|
|
56
|
-
error: jest.fn(),
|
|
57
|
-
warn: jest.fn(),
|
|
58
|
-
debug: jest.fn()
|
|
59
|
-
};
|
|
60
|
-
fixture.detectChanges();
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('should create', () => {
|
|
64
|
-
expect(component).toBeTruthy();
|
|
65
|
-
const html: HTMLElement = fixture.nativeElement;
|
|
66
|
-
const webComponentHtml = html.querySelector(
|
|
67
|
-
'descope-access-key-management-widget'
|
|
68
|
-
);
|
|
69
|
-
expect(webComponentHtml).toBeDefined();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should correctly setup attributes based on inputs', () => {
|
|
73
|
-
const html: HTMLElement = fixture.nativeElement;
|
|
74
|
-
const webComponentHtml = html.querySelector(
|
|
75
|
-
'descope-access-key-management-widget'
|
|
76
|
-
)!;
|
|
77
|
-
expect(webComponentHtml.getAttribute('project-id')).toStrictEqual('123');
|
|
78
|
-
expect(webComponentHtml.getAttribute('tenant')).toStrictEqual('tenant-1');
|
|
79
|
-
expect(webComponentHtml.getAttribute('widget-id')).toStrictEqual(
|
|
80
|
-
'widget-1'
|
|
81
|
-
);
|
|
82
|
-
expect(webComponentHtml.getAttribute('logger')).toBeDefined();
|
|
83
|
-
});
|
|
84
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, Input, OnChanges, OnInit } from '@angular/core';
|
|
2
|
-
import DescopeAccessKeyManagementWidget from '@descope/access-key-management-widget';
|
|
3
|
-
import { ILogger } from '@descope/web-component';
|
|
4
|
-
import { DescopeAuthConfig } from '../../types/types';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'access-key-management[tenant]',
|
|
8
|
-
standalone: true,
|
|
9
|
-
template: ''
|
|
10
|
-
})
|
|
11
|
-
export class AccessKeyManagementComponent implements OnInit, OnChanges {
|
|
12
|
-
projectId: string;
|
|
13
|
-
baseUrl?: string;
|
|
14
|
-
baseStaticUrl?: string;
|
|
15
|
-
@Input() tenant: string;
|
|
16
|
-
@Input() widgetId: string;
|
|
17
|
-
|
|
18
|
-
@Input() theme: 'light' | 'dark' | 'os';
|
|
19
|
-
@Input() debug: boolean;
|
|
20
|
-
@Input() logger: ILogger;
|
|
21
|
-
|
|
22
|
-
private readonly webComponent = new DescopeAccessKeyManagementWidget();
|
|
23
|
-
|
|
24
|
-
constructor(
|
|
25
|
-
private elementRef: ElementRef,
|
|
26
|
-
descopeConfig: DescopeAuthConfig
|
|
27
|
-
) {
|
|
28
|
-
this.projectId = descopeConfig.projectId;
|
|
29
|
-
this.baseUrl = descopeConfig.baseUrl;
|
|
30
|
-
this.baseStaticUrl = descopeConfig.baseStaticUrl;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
ngOnInit() {
|
|
34
|
-
this.setupWebComponent();
|
|
35
|
-
this.elementRef.nativeElement.appendChild(this.webComponent);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
ngOnChanges(): void {
|
|
39
|
-
this.setupWebComponent();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
private setupWebComponent() {
|
|
43
|
-
this.webComponent.setAttribute('project-id', this.projectId);
|
|
44
|
-
this.webComponent.setAttribute('tenant', this.tenant);
|
|
45
|
-
this.webComponent.setAttribute('widget-id', this.widgetId);
|
|
46
|
-
if (this.baseUrl) {
|
|
47
|
-
this.webComponent.setAttribute('base-url', this.baseUrl);
|
|
48
|
-
}
|
|
49
|
-
if (this.baseStaticUrl) {
|
|
50
|
-
this.webComponent.setAttribute('base-static-url', this.baseStaticUrl);
|
|
51
|
-
}
|
|
52
|
-
if (this.theme) {
|
|
53
|
-
this.webComponent.setAttribute('theme', this.theme);
|
|
54
|
-
}
|
|
55
|
-
if (this.debug) {
|
|
56
|
-
this.webComponent.setAttribute('debug', this.debug.toString());
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (this.logger) {
|
|
60
|
-
(this.webComponent as any).logger = this.logger;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|