@descope/angular-sdk 0.0.0-next-32627c0f-20231228 → 0.0.0-next-cc7eda17-20231228
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/.editorconfig +16 -0
- package/.eslintrc.json +40 -0
- package/.github/workflows/ci.yml +98 -0
- package/.github/workflows/publish-next.yml +43 -0
- package/.github/workflows/publish.yml +31 -0
- package/.github/workflows/release.yml +41 -0
- package/.husky/pre-commit +4 -0
- package/.prettierrc +8 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/settings.json +3 -0
- package/.vscode/tasks.json +42 -0
- package/LICENSE +21 -0
- package/README.md +448 -13
- package/angular.json +154 -0
- package/jest.config.js +17 -0
- package/package.json +77 -41
- package/projects/angular-sdk/.eslintrc.json +32 -0
- package/projects/angular-sdk/README.md +21 -0
- package/projects/angular-sdk/ng-package.json +8 -0
- package/projects/angular-sdk/src/environment.ts +3 -0
- package/projects/angular-sdk/src/lib/components/descope/descope.component.spec.ts +104 -0
- package/projects/angular-sdk/src/lib/components/descope/descope.component.ts +114 -0
- package/projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.html +15 -0
- package/projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.spec.ts +53 -0
- package/projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.ts +32 -0
- package/projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.html +15 -0
- package/projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.spec.ts +51 -0
- package/projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.ts +32 -0
- package/projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.html +15 -0
- package/projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.spec.ts +53 -0
- package/projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.ts +32 -0
- package/projects/angular-sdk/src/lib/descope-auth.module.ts +46 -0
- package/projects/angular-sdk/src/lib/services/descope-auth.guard.spec.ts +76 -0
- package/projects/angular-sdk/src/lib/services/descope-auth.guard.ts +16 -0
- package/projects/angular-sdk/src/lib/services/descope-auth.service.spec.ts +264 -0
- package/projects/angular-sdk/src/lib/services/descope-auth.service.ts +176 -0
- package/projects/angular-sdk/src/lib/services/descope.interceptor.spec.ts +102 -0
- package/projects/angular-sdk/src/lib/services/descope.interceptor.ts +76 -0
- package/projects/angular-sdk/src/lib/types/types.ts +10 -0
- package/projects/angular-sdk/src/lib/utils/constants.ts +8 -0
- package/projects/angular-sdk/src/lib/utils/helpers.spec.ts +103 -0
- package/projects/angular-sdk/src/lib/utils/helpers.ts +36 -0
- package/projects/angular-sdk/src/public-api.ts +13 -0
- package/projects/angular-sdk/tsconfig.lib.json +12 -0
- package/projects/angular-sdk/tsconfig.lib.prod.json +10 -0
- package/projects/angular-sdk/tsconfig.spec.json +11 -0
- package/projects/demo-app/.eslintrc.json +31 -0
- package/projects/demo-app/src/app/app-routing.module.ts +23 -0
- package/projects/demo-app/src/app/app.component.html +3 -0
- package/projects/demo-app/src/app/app.component.scss +16 -0
- package/projects/demo-app/src/app/app.component.spec.ts +37 -0
- package/projects/demo-app/src/app/app.component.ts +8 -0
- package/projects/demo-app/src/app/app.module.ts +52 -0
- package/projects/demo-app/src/app/home/home.component.html +23 -0
- package/projects/demo-app/src/app/home/home.component.scss +15 -0
- package/projects/demo-app/src/app/home/home.component.spec.ts +44 -0
- package/projects/demo-app/src/app/home/home.component.ts +61 -0
- package/projects/demo-app/src/app/interceptor/auth.interceptor.ts +20 -0
- package/projects/demo-app/src/app/login/login.component.html +12 -0
- package/projects/demo-app/src/app/login/login.component.spec.ts +42 -0
- package/projects/demo-app/src/app/login/login.component.ts +35 -0
- package/projects/demo-app/src/app/protected/protected.component.html +18 -0
- package/projects/demo-app/src/app/protected/protected.component.scss +8 -0
- package/projects/demo-app/src/app/protected/protected.component.spec.ts +42 -0
- package/projects/demo-app/src/app/protected/protected.component.ts +40 -0
- package/projects/demo-app/src/assets/.gitkeep +0 -0
- package/projects/demo-app/src/environments/conifg.ts +13 -0
- package/projects/demo-app/src/environments/environment.ts +19 -0
- package/projects/demo-app/src/favicon.ico +0 -0
- package/projects/demo-app/src/index.html +17 -0
- package/projects/demo-app/src/main.ts +7 -0
- package/projects/demo-app/src/styles.scss +21 -0
- package/projects/demo-app/tsconfig.app.json +10 -0
- package/projects/demo-app/tsconfig.spec.json +10 -0
- package/renovate.json +4 -0
- package/scripts/gitleaks/.gitleaks.toml +653 -0
- package/scripts/gitleaks/gitleaks.sh +34 -0
- package/scripts/setversion/setversion.js +20 -0
- package/setup-jest.ts +1 -0
- package/thirdPartyLicenseCollector_linux_amd64 +0 -0
- package/tsconfig.json +35 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Editor configuration, see https://editorconfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 2
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.ts]
|
|
12
|
+
quote_type = single
|
|
13
|
+
|
|
14
|
+
[*.md]
|
|
15
|
+
max_line_length = off
|
|
16
|
+
trim_trailing_whitespace = false
|
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"files": ["*.html"],
|
|
33
|
+
"extends": [
|
|
34
|
+
"plugin:@angular-eslint/template/recommended",
|
|
35
|
+
"plugin:@angular-eslint/template/accessibility"
|
|
36
|
+
],
|
|
37
|
+
"rules": {}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
name: 🎛️ CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
NODE_VERSION: 20
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
name: 👷 Build
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
22
|
+
registry-url: https://npm.pkg.github.com/
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: npm ci
|
|
25
|
+
- name: Building Lib
|
|
26
|
+
run: npm run build:lib
|
|
27
|
+
- name: Building Demo App
|
|
28
|
+
run: npm run build:app
|
|
29
|
+
|
|
30
|
+
lint:
|
|
31
|
+
name: 🪥 Lint
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checkout code
|
|
35
|
+
uses: actions/checkout@v4
|
|
36
|
+
- uses: actions/setup-node@v4
|
|
37
|
+
with:
|
|
38
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
39
|
+
registry-url: https://npm.pkg.github.com/
|
|
40
|
+
- name: Install dependencies
|
|
41
|
+
run: npm ci
|
|
42
|
+
- name: Linting
|
|
43
|
+
run: npm run lint
|
|
44
|
+
- name: Format check
|
|
45
|
+
run: npm run format-check
|
|
46
|
+
|
|
47
|
+
gitleaks:
|
|
48
|
+
name: 🔒 Run Git leaks
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
steps:
|
|
51
|
+
- name: Checkout code
|
|
52
|
+
uses: actions/checkout@v4
|
|
53
|
+
- uses: actions/setup-node@v4
|
|
54
|
+
with:
|
|
55
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
56
|
+
- name: Install dependencies
|
|
57
|
+
run: npm ci
|
|
58
|
+
- name: Gitleaks
|
|
59
|
+
run: npm run leaks
|
|
60
|
+
shell: bash
|
|
61
|
+
|
|
62
|
+
testing:
|
|
63
|
+
name: 👔 Test
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
steps:
|
|
66
|
+
- name: Checkout code
|
|
67
|
+
uses: actions/checkout@v4
|
|
68
|
+
- uses: actions/setup-node@v4
|
|
69
|
+
with:
|
|
70
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
71
|
+
registry-url: https://npm.pkg.github.com/
|
|
72
|
+
- name: Install dependencies
|
|
73
|
+
run: npm ci
|
|
74
|
+
- name: Testing
|
|
75
|
+
run: npm run test
|
|
76
|
+
- name: Coverage check
|
|
77
|
+
uses: devmasx/coverage-check-action@v1.2.0
|
|
78
|
+
with:
|
|
79
|
+
type: lcov
|
|
80
|
+
min_coverage: 72.19
|
|
81
|
+
result_path: coverage/lcov.info
|
|
82
|
+
token: ${{ github.token }}
|
|
83
|
+
|
|
84
|
+
license-validation:
|
|
85
|
+
name: 🪪 License Validation
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
steps:
|
|
88
|
+
- name: Checkout code
|
|
89
|
+
uses: actions/checkout@v4
|
|
90
|
+
- uses: actions/setup-node@v4
|
|
91
|
+
with:
|
|
92
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
93
|
+
registry-url: https://npm.pkg.github.com/
|
|
94
|
+
- name: Install dependencies
|
|
95
|
+
run: npm ci
|
|
96
|
+
- name: License validation
|
|
97
|
+
shell: bash
|
|
98
|
+
run: ./thirdPartyLicenseCollector_linux_amd64 -npm-project .
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: 📢 Publish Next
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- init # TODO remove this
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
NODE_VERSION: 20
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
name: 📢 Publish Next
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
22
|
+
registry-url: https://registry.npmjs.org/
|
|
23
|
+
- name: Get Short SHA
|
|
24
|
+
run: echo "SHORT_SHA=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV
|
|
25
|
+
- name: Get Next Version
|
|
26
|
+
run: |
|
|
27
|
+
current_date=$(date +'%Y%m%d')
|
|
28
|
+
echo "NEW_VERSION=0.0.0-next-${SHORT_SHA}-${current_date}" >> $GITHUB_ENV
|
|
29
|
+
- name: Use Next Version
|
|
30
|
+
run: |
|
|
31
|
+
git config --global user.email "info@descope.com"
|
|
32
|
+
git config --global user.name "Descope"
|
|
33
|
+
yarn version --new-version ${NEW_VERSION}
|
|
34
|
+
cat package.json
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: npm ci
|
|
37
|
+
- name: Build Library
|
|
38
|
+
run: npm run build:ci
|
|
39
|
+
- name: Publish to NPM Package Registry
|
|
40
|
+
run: |
|
|
41
|
+
npm publish --access=public --tag next
|
|
42
|
+
env:
|
|
43
|
+
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_REGISTRY }}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: 📢 publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'release/**'
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
NODE_VERSION: 20
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish:
|
|
13
|
+
name: 📢 Publish
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-node@v4
|
|
19
|
+
with:
|
|
20
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
21
|
+
registry-url: https://registry.npmjs.org/
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: npm ci
|
|
24
|
+
- name: Build Library
|
|
25
|
+
run: npm run build:ci
|
|
26
|
+
- name: Publish to NPM Package Registry
|
|
27
|
+
run: |
|
|
28
|
+
npm publish --access=public
|
|
29
|
+
env:
|
|
30
|
+
CI: true
|
|
31
|
+
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_REGISTRY }}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: 👊 Bump Version & Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
bump-version:
|
|
10
|
+
name: 👊 Bump Version & Release
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
# this workflow will run only if commit message ends with "RELEASE"
|
|
13
|
+
if: "contains(github.event.head_commit.message, 'RELEASE')"
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout source code
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
persist-credentials: false
|
|
19
|
+
ref: ${{ github.ref }}
|
|
20
|
+
- name: Get token
|
|
21
|
+
id: get_token
|
|
22
|
+
uses: tibdex/github-app-token@v1
|
|
23
|
+
with:
|
|
24
|
+
private_key: ${{ secrets.RELEASE_APP_PEM }}
|
|
25
|
+
app_id: ${{ secrets.RELEASE_APP_ID }}
|
|
26
|
+
|
|
27
|
+
- name: Automated Version Bump
|
|
28
|
+
id: version-bump
|
|
29
|
+
uses: phips28/gh-action-bump-version@master
|
|
30
|
+
with:
|
|
31
|
+
tag-prefix: release/v
|
|
32
|
+
major-wording: 'MAJOR'
|
|
33
|
+
minor-wording: 'MINOR'
|
|
34
|
+
env:
|
|
35
|
+
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
|
|
36
|
+
- name: cat angular-sdk package.json
|
|
37
|
+
run: cat ./package.json
|
|
38
|
+
- name: Output Step
|
|
39
|
+
env:
|
|
40
|
+
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
|
|
41
|
+
run: echo "new tag $NEW_TAG"
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"configurations": [
|
|
5
|
+
{
|
|
6
|
+
"name": "ng serve",
|
|
7
|
+
"type": "chrome",
|
|
8
|
+
"request": "launch",
|
|
9
|
+
"preLaunchTask": "npm: start",
|
|
10
|
+
"url": "http://localhost:4200/"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "ng test",
|
|
14
|
+
"type": "chrome",
|
|
15
|
+
"request": "launch",
|
|
16
|
+
"preLaunchTask": "npm: test",
|
|
17
|
+
"url": "http://localhost:9876/debug.html"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"tasks": [
|
|
5
|
+
{
|
|
6
|
+
"type": "npm",
|
|
7
|
+
"script": "start",
|
|
8
|
+
"isBackground": true,
|
|
9
|
+
"problemMatcher": {
|
|
10
|
+
"owner": "typescript",
|
|
11
|
+
"pattern": "$tsc",
|
|
12
|
+
"background": {
|
|
13
|
+
"activeOnStart": true,
|
|
14
|
+
"beginsPattern": {
|
|
15
|
+
"regexp": "(.*?)"
|
|
16
|
+
},
|
|
17
|
+
"endsPattern": {
|
|
18
|
+
"regexp": "bundle generation complete"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "npm",
|
|
25
|
+
"script": "test",
|
|
26
|
+
"isBackground": true,
|
|
27
|
+
"problemMatcher": {
|
|
28
|
+
"owner": "typescript",
|
|
29
|
+
"pattern": "$tsc",
|
|
30
|
+
"background": {
|
|
31
|
+
"activeOnStart": true,
|
|
32
|
+
"beginsPattern": {
|
|
33
|
+
"regexp": "(.*?)"
|
|
34
|
+
},
|
|
35
|
+
"endsPattern": {
|
|
36
|
+
"regexp": "bundle generation complete"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Descope <help@descope.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|