@lifeaz/gate-helper 1.0.4 → 1.0.6

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  # 🔐 GATE Helper
2
- **1.0.4** Global Authentication and Trust Endpoint Helper
2
+ **1.0.6** Global Authentication and Trust Endpoint Helper
3
3
 
4
4
  ---
5
5
 
@@ -10,6 +10,6 @@ Easier implementation of Lifeaz GATE authentication for everyone.
10
10
  ---
11
11
 
12
12
  ### 🪴EOD
13
- > ***OFFICIAL REPOSITORY**
13
+ > ***1.0.6**
14
14
  This repository is PROPRIETARY. No part of this repository
15
15
  may be disclosed in any manner without the prior written consent of Lifeaz. https://lifeaz.co*
package/dist/main.d.ts CHANGED
@@ -1,6 +1,10 @@
1
- import { Moment } from "moment";
1
+ import type { Dayjs } from "dayjs";
2
2
  import { UUID } from "uuidv7";
3
3
  export type Permission = string;
4
+ export interface PermissionsBySource {
5
+ direct: Permission[];
6
+ role: Permission[];
7
+ }
4
8
  export interface User {
5
9
  blocked: boolean;
6
10
  id: UUID;
@@ -9,7 +13,8 @@ export interface User {
9
13
  lastname: string;
10
14
  gender: Gender;
11
15
  role: Role;
12
- birthdate: Moment | null;
16
+ permissions?: PermissionsBySource;
17
+ birthdate: Dayjs | null;
13
18
  phone: Phone | null;
14
19
  address: Address | null;
15
20
  a2f: A2F | null;
@@ -65,3 +70,4 @@ export interface State {
65
70
  name: string;
66
71
  iso: string;
67
72
  }
73
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,MAAM,WAAW,mBAAmB;IACn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MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,IAAI,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,KAAK;IACrB,EAAE,EAAE,IAAI,CAAC;IACT,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ"}
package/dist/main.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ import { UUID } from "uuidv7";
package/package.json CHANGED
@@ -1,9 +1,20 @@
1
1
  {
2
2
  "name": "@lifeaz/gate-helper",
3
3
  "description": "Lifeaz Global Authentication and Trust Endpoint Helper",
4
- "version": "1.0.4",
4
+ "version": "1.0.6",
5
+ "versionCode": "100060030",
5
6
  "main": "dist/main.js",
6
- "types": "dist/main.d.ts",
7
+ "files": ["dist", "src/main.ts"],
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/main.d.ts",
11
+ "bun": "./src/main.ts",
12
+ "import": "./dist/main.js",
13
+ "require": "./dist/main.js"
14
+ }
15
+ },
16
+ "type": "module",
17
+ "types": "dist/main.d.ts",
7
18
  "engines": {
8
19
  "node": ">=20"
9
20
  },
@@ -20,12 +31,12 @@
20
31
  ],
21
32
  "scripts": {
22
33
  "build": "npm run clean && tsc",
23
- "clean": "rimraf dist"
34
+ "build:version": "bash bump.sh",
35
+ "clean": "rimraf dist",
36
+ "debug": "npm run build && node dist/test.js"
24
37
  },
25
- "dependencies": {
26
- "@lifeaz/gate-helper": "file:",
27
- "moment": "^2.30.1",
28
- "tslib": "^2.8.0",
38
+ "peerDependencies": {
39
+ "dayjs": "^1.11.20",
29
40
  "uuidv7": "^1.0.2"
30
41
  },
31
42
  "devDependencies": {
package/src/main.ts CHANGED
@@ -1,8 +1,13 @@
1
- import { Moment } from "moment";
1
+ import type { Dayjs } from "dayjs";
2
2
  import { UUID } from "uuidv7";
3
3
 
4
4
  export type Permission = string;
5
5
 
6
+ export interface PermissionsBySource {
7
+ direct: Permission[];
8
+ role: Permission[];
9
+ }
10
+
6
11
  export interface User {
7
12
  blocked: boolean;
8
13
  id: UUID;
@@ -11,10 +16,11 @@ export interface User {
11
16
  lastname: string;
12
17
  gender: Gender;
13
18
  role: Role;
14
- birthdate: Moment|null;
15
- phone: Phone|null;
16
- address: Address|null;
17
- a2f: A2F|null;
19
+ permissions?: PermissionsBySource;
20
+ birthdate: Dayjs | null;
21
+ phone: Phone | null;
22
+ address: Address | null;
23
+ a2f: A2F | null;
18
24
  }
19
25
 
20
26
  export interface Gender {
@@ -48,8 +54,8 @@ export interface Phone {
48
54
  export interface Address {
49
55
  id: UUID;
50
56
  country: Country;
51
- state: State|null;
52
- alias: string|null;
57
+ state: State | null;
58
+ alias: string | null;
53
59
  line: string;
54
60
  details: string;
55
61
  postcode: string;
@@ -72,7 +78,7 @@ export interface Geozone {
72
78
 
73
79
  export interface State {
74
80
  id: UUID;
75
- country?: Country|null;
81
+ country?: Country | null;
76
82
  name: string;
77
83
  iso: string;
78
84
  }
package/.editorconfig DELETED
@@ -1,14 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- end_of_line = lf
5
- charset = utf-8
6
- indent_style = tab
7
- indent_size = 4
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
-
11
- [*.md]
12
- max_line_length = off
13
- insert_final_newline = false
14
- trim_trailing_whitespace = false
package/.gitlab-ci.yml DELETED
@@ -1,42 +0,0 @@
1
- include:
2
- - project: 'everydayheroes-team/cloud/internal/templates/ci'
3
- file: '.gitlab-ci.yml'
4
-
5
- stages:
6
- - pre
7
- - build
8
- - quality
9
- - documentation
10
- - release
11
- - deploy
12
-
13
- build:
14
- stage: build
15
- image: node:lts-alpine
16
- script:
17
- - npm ci
18
- - npm run build
19
- artifacts:
20
- paths:
21
- - dist/
22
-
23
- publish:
24
- stage: release
25
- image: node:lts-alpine
26
- only:
27
- - tags
28
- before_script:
29
- - npm install
30
- script:
31
- - echo "//registry.npmjs.org/:_authToken=\${NPM_LIFEAZ_PUBLISH_TOKEN}" >> ~/.npmrc
32
- - npm publish --access=public
33
-
34
- unpublish:
35
- stage: release
36
- image: node:lts-alpine
37
- only:
38
- - tags
39
- script:
40
- - echo "//registry.npmjs.org/:_authToken=\${NPM_LIFEAZ_PUBLISH_TOKEN}" >> ~/.npmrc
41
- - npm unpublish
42
- when: manual
package/CODEOWNERS DELETED
@@ -1,5 +0,0 @@
1
- # Global Owners
2
- * @lifeaz
3
-
4
- ## Maintainers
5
- ./ @raphaelhb
package/STYLE.md DELETED
@@ -1,72 +0,0 @@
1
- # Introduction
2
-
3
- This file describes the various style and design conventions that are used in the Kent dashboard repository.
4
-
5
- # TypeScript Coding Conventions
6
-
7
- Our TypeScript style is inspired by the [style guidelines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines) of the TypeScript implementation itself.
8
-
9
- ## Naming
10
-
11
- 1. Use PascalCase for type names.
12
- 1. Do not use `I` as a prefix for interface names.
13
- 1. Use PascalCase for `enum` values.
14
- 1. Use `camelCase` for function names.
15
- 1. Use `camelCase` for property names and local variables.
16
- 1. Use `_` as a prefix for private properties.
17
- 1. Use whole words in names when possible.
18
- 1. Give type parameters names prefixed with `T`, for example `Request<TBody>`.
19
-
20
- ## Syntax and Types
21
-
22
- 1. Use `undefined`. Do not use `null`.
23
- 1. Prefer `for..of` over `.forEach`.
24
- 1. Do not introduce new types/values to the global namespace.
25
-
26
- ## File and Export Structure
27
-
28
- 1. Keep `main.ts` free from implementation, it should only contain re-exports.
29
- 1. If a file has a single or a main export, name the file after the export.
30
-
31
- # Documentation Guidelines
32
-
33
- We use [API Extractor](https://api-extractor.com/pages/overview/demo_docs/) to generate our documentation, which in turn uses [TSDoc](https://github.com/microsoft/tsdoc) to parse our doc comments.
34
-
35
- The doc comments are of the good old `/** ... */` format, with tags of the format `@<tag>` used to mark various things. The [TSDoc website](https://tsdoc.org/) has a good index of all available tags.
36
-
37
- There are a few things to pay attention to, in order to make the documentation show up in a nice way on the website...
38
-
39
- ## Use `@remarks` to split long descriptions
40
-
41
- The API reference has an index of exported symbols for each package, which uses a short description, while clicking through to the page for a symbol shows the full description. By default all descriptions are considered "short", and you have to manually add a divider where the description should be cut off using the `@remarks` tag.
42
-
43
- ```ts
44
- /**
45
- * This function helps you create a thing.
46
- *
47
- * @remarks
48
- *
49
- * Here is a much longer and more elaborate description of how the
50
- * creation of a thing works, which is way too long to fit on the index page.
51
- */
52
- function createTheThing() {}
53
- ```
54
-
55
- ## Use `@param` to document parameters
56
-
57
- When using the `@param` tag to document a parameter it will show up in the **Parameters** section:
58
-
59
- ![image](https://user-images.githubusercontent.com/4984472/133120977-64004074-0afb-4e8a-9a2a-c846f04eb3d9.png)
60
-
61
- Be sure to include a `-` after the parameter name as well as [required by TSDoc](https://tsdoc.org/pages/tags/param/), or you'll get a warning in the API report.
62
-
63
- ```ts
64
- /**
65
- * Generates a PluginCacheManager for consumption by plugins.
66
- *
67
- * @param pluginId - The plugin that the cache manager should be created for. Plugin names should be unique.
68
- */
69
- forPlugin(pluginId: string): PluginCacheManager {
70
- ...
71
- }
72
- ```
package/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.4
package/tsconfig.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "rootDir": "src/",
6
- "outDir": "dist/",
7
- "strict": true,
8
- "moduleResolution": "NodeNext",
9
- "importHelpers": true,
10
- "experimentalDecorators": true,
11
- "esModuleInterop": true,
12
- "skipLibCheck": true,
13
- "allowSyntheticDefaultImports": true,
14
- "resolveJsonModule": true,
15
- "forceConsistentCasingInFileNames": true,
16
- "removeComments": true,
17
- "typeRoots": [
18
- "node_modules/@types"
19
- ],
20
- "sourceMap": false,
21
- "baseUrl": "./",
22
- "declaration": true
23
- },
24
- "include": [
25
- "src/**/*.ts"
26
- ],
27
- "exclude": [
28
- "node_modules",
29
- "dist",
30
- ".vscode",
31
- ".git",
32
- ".env",
33
- "__tests__",
34
- "jest.config.js",
35
- "coverage"
36
- ],
37
- }