Skip to content

Commit 1d173bf

Browse files
committed
feat(js-types-auth): Setup authentication types package
1 parent 47ccaad commit 1d173bf

File tree

22 files changed

+6862
-1924
lines changed

22 files changed

+6862
-1924
lines changed

.verdaccio/config.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# path to a directory with all packages
2+
storage: ../tmp/local-registry/storage
3+
4+
# a list of other known repositories we can talk to
5+
uplinks:
6+
npmjs:
7+
url: https://registry.npmjs.org/
8+
maxage: 60m
9+
10+
packages:
11+
'**':
12+
# give all users (including non-authenticated users) full access
13+
# because it is a local registry
14+
access: $all
15+
publish: $all
16+
unpublish: $all
17+
18+
# if package is not available locally, proxy requests to npm registry
19+
proxy: npmjs
20+
21+
# log settings
22+
log:
23+
type: stdout
24+
format: pretty
25+
level: warn
26+
27+
publish:
28+
allow_offline: true # set offline to true to allow publish offline

apps/docs/src/app/categories/javascript/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import StringCategory from './utils/sub-categories/string/ng-doc.category';
1111
import FileCategory from './utils/sub-categories/file/ng-doc.category';
1212
import NumberCategory from './utils/sub-categories/number/ng-doc.category';
1313
import JavascriptCategory from './ng-doc.category';
14+
import TypesCategory from './types/ng-doc.category';
1415

1516
export {
1617
PaginationCategory,
@@ -26,4 +27,5 @@ export {
2627
StringCategory,
2728
FileCategory,
2829
NumberCategory,
30+
TypesCategory,
2931
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { NgDocCategory } from '@ng-doc/core';
2+
import JavascriptCategory from '../ng-doc.category';
3+
4+
const TypesCategory: NgDocCategory = {
5+
title: 'Types',
6+
category: JavascriptCategory,
7+
};
8+
9+
export default TypesCategory;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
keyword: AuthenticationPage
3+
---
4+
5+
`@studiohyperdrive/types` is a collection of individual packages that aim to form a bridge between front-end and back-end related packages.
6+
7+
## Installation
8+
9+
```shell
10+
npm install @studiohyperdrive/types-auth
11+
```
12+
13+
### Versioning and build information
14+
15+
This package will follow a semver-like format, `major.minor.patch`, in which:
16+
17+
- `major`: Follows the Angular major version
18+
- `minor`: Introduces new features and (potential) breaking changes
19+
- `patch`: Introduces bugfixes and minor non-breaking changes
20+
21+
For more information about the build process, authors, contributions and issues, we refer to the [ngx-tools](https://github.com/studiohyperdrive/hyperdrive-opensource) repository.
22+
23+
## Types
24+
25+
In order to plug into the corresponding frontend packages, the package provides an `AuthenticatedUserSession` and an `AuthenticationResponse` type.
26+
27+
`AuthenticatedUserSession` provides the basics for both permissions and feature flags provided to a user during their session.
28+
29+
`AuthenticationResponse` provides the authenticated user, an optional session and optional metadata.
30+
31+
## Corresponding packages
32+
33+
For Angular, the corresponding package is [@studiohyperdrive/ngx-auth](https://open-source.studiohyperdrive.be/docs/angular/authentication/introduction).
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { NgDocPage } from '@ng-doc/core';
2+
import { TypesCategory } from '../../../../../categories/javascript';
3+
4+
const AuthenticationPage: NgDocPage = {
5+
title: `Authentication`,
6+
mdFile: './index.md',
7+
category: TypesCategory,
8+
order: 1,
9+
};
10+
11+
export default AuthenticationPage;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
keyword: IntroductionPage
3+
---
4+
5+
`@studiohyperdrive/types` is a collection of individual packages that aim to form a bridge between frontend and backend related packages.
6+
7+
## For developers
8+
9+
Our `@studiohyperdrive/types` packages form the bridge between backend and frontend applications, ensuring that both sides of the story can easily connect with each other. These packages are divided based on their context with the intent of keeping them as lightweight as possible.
10+
11+
Looking for more information on how these packages can help you out in your application? Check out the individual packages to find out more!
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { NgDocPage } from '@ng-doc/core';
2+
import { TypesCategory } from '../../../../../categories/javascript';
3+
4+
const IntroductionPage: NgDocPage = {
5+
title: `Introduction`,
6+
mdFile: './index.md',
7+
category: TypesCategory,
8+
order: 0,
9+
};
10+
11+
export default IntroductionPage;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": ["../../../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["*.json"],
19+
"parser": "jsonc-eslint-parser",
20+
"rules": {
21+
"@nx/dependency-checks": "error"
22+
}
23+
}
24+
]
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Javascript Tools: Authentication Types (`@studiohyperdrive/types-auth`)
2+
3+
`@studiohyperdrive/types-auth` is a set of base types used for the frontend-equivalent packages such as `@studiohyperdrive/ngx-auth`.
4+
5+
## Installation
6+
7+
Install the package first:
8+
9+
```shell
10+
npm install @studiohyperdrive/types-auth
11+
```
12+
13+
## Versioning and build information
14+
15+
This package will follow a semver-like format, `major.minor.patch`, in which:
16+
17+
- `major`: Introduces new features or breaking changes
18+
- `minor`: Introduces minor non-breaking changes
19+
- `patch`: Introduces bugfixes
20+
21+
For more information about the build process, authors, contributions and issues, we refer to the [hyperdrive-opensource](https://github.com/studiohyperdrive/hyperdrive-opensource) repository.
22+
23+
## Documentation
24+
25+
To find more information regarding this package, we refer to [our documentation platform](https://open-source.studiohyperdrive.be/docs/javascript/types/introduction).
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@studiohyperdrive/types-auth",
3+
"version": "0.0.1",
4+
"dependencies": {},
5+
"type": "commonjs",
6+
"main": "./index.cjs",
7+
"typings": "./index.d.ts",
8+
"description": "A package containing common authentication related types",
9+
"keywords": [
10+
"authentication",
11+
"user",
12+
"session",
13+
"features",
14+
"permissions"
15+
],
16+
"homepage": "https://open-source.studiohyperdrive.be/docs/javascript/types/introduction",
17+
"author": {
18+
"name": "Studio Hyperdrive",
19+
"url": "https://studiohyperdrive.be/"
20+
},
21+
"repository": {
22+
"type": "git",
23+
"url": "https://github.com/studiohyperdrive/hyperdrive-opensource",
24+
"directory": "libs/javascript/types/auth/src"
25+
},
26+
"license": "MIT"
27+
}

0 commit comments

Comments
 (0)