@denodeio/seshat 0.0.20
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 +36 -0
- package/build/dist/src/index.d.ts +30 -0
- package/build/dist/src/signer.d.ts +14 -0
- package/build/index.d.ts +6596 -0
- package/build/index.js +6604 -0
- package/build/index.js.map +1 -0
- package/package.json +43 -0
- package/readme.md +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<h1 align="center">@denode/seshat</h1>
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
<b>seshat</b> is a library that offers a collection of functions commonly used in Denode backend services.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
To use functions in other services, download seshat as a package:
|
|
8
|
+
```bash
|
|
9
|
+
npm i denode-seshat
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Local Build And Deploy
|
|
13
|
+
To build the project locally and deploy, follow these steps:
|
|
14
|
+
### 1. Build The Project
|
|
15
|
+
Run the following command to build the project using Rollup.js, which compiles and generates a bundled version of the project:
|
|
16
|
+
```bash
|
|
17
|
+
pnpm build
|
|
18
|
+
```
|
|
19
|
+
This command outputs the compiled code to the "dist" folder, which is used for deployment.
|
|
20
|
+
### 2. Update Package Version:
|
|
21
|
+
Open the [package.json]( package.json) file and update the version field. For example:
|
|
22
|
+
```
|
|
23
|
+
"version": "0.0.12"
|
|
24
|
+
```
|
|
25
|
+
Ensure that you increment the version number appropriately.
|
|
26
|
+
### 3. Login to NPM Registry:
|
|
27
|
+
Use the following command to log in to the [npm registry](https://www.npmjs.com):
|
|
28
|
+
```bash
|
|
29
|
+
npm login
|
|
30
|
+
```
|
|
31
|
+
This command will redirect you to the [npm registry](https://www.npmjs.com). Follow the login process on the browser (contact package owner for login credentials)
|
|
32
|
+
### 4. Publish the New Version:
|
|
33
|
+
After successful login, you can publish the new version to NPM with the following command:
|
|
34
|
+
```bash
|
|
35
|
+
npm publish
|
|
36
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
type JwsSignature = {
|
|
3
|
+
protected: string;
|
|
4
|
+
header: {
|
|
5
|
+
kid: string;
|
|
6
|
+
};
|
|
7
|
+
signature: string;
|
|
8
|
+
};
|
|
9
|
+
type JwsPayload = {
|
|
10
|
+
payload: string;
|
|
11
|
+
signatures: JwsSignature[];
|
|
12
|
+
};
|
|
13
|
+
type Keychain = {
|
|
14
|
+
algorithm: string;
|
|
15
|
+
value: Buffer;
|
|
16
|
+
};
|
|
17
|
+
type JwtPayload<T> = {
|
|
18
|
+
iss: string;
|
|
19
|
+
exp: number;
|
|
20
|
+
jti: string;
|
|
21
|
+
event: {
|
|
22
|
+
name: string;
|
|
23
|
+
record: T;
|
|
24
|
+
};
|
|
25
|
+
iat: number;
|
|
26
|
+
};
|
|
27
|
+
export * from "./signer";
|
|
28
|
+
export declare const sessionVerifier: (options: any) => (req: any, res: any, next: any) => void;
|
|
29
|
+
export declare const managementSigner: (options: any) => (req: any, res: any, next: any) => void;
|
|
30
|
+
export declare const validateJws: <T>(key: Keychain, input: JwsPayload) => JwtPayload<T> | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type SignJwsResponse = {
|
|
2
|
+
payload: string;
|
|
3
|
+
signatures: {
|
|
4
|
+
protected: string;
|
|
5
|
+
header: {
|
|
6
|
+
kid: string;
|
|
7
|
+
};
|
|
8
|
+
signature: string;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
export declare function signJws(payload: string, options: any): SignJwsResponse;
|
|
12
|
+
export declare function signPayload(payload: any, options: any): string;
|
|
13
|
+
export declare function signData(payload: object, options: any): SignJwsResponse;
|
|
14
|
+
export {};
|