@hugoalh/github-sodium 5.0.1 → 5.0.2

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,52 +1,71 @@
1
- # GitHub Sodium (NodeJS)
1
+ # GitHub Sodium (JavaScript)
2
2
 
3
- [⚖️ MIT](./LICENSE.md)
4
- [![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/hugoalh-studio/github-sodium-nodejs?label=Grade&logo=codefactor&logoColor=ffffff&style=flat-square "CodeFactor Grade")](https://www.codefactor.io/repository/github/hugoalh-studio/github-sodium-nodejs)
3
+ [**⚖️** MIT](./LICENSE.md)
5
4
 
6
- | | **Release - Latest** | **Release - Pre** |
7
- |:-:|:-:|:-:|
8
- | [![GitHub](https://img.shields.io/badge/GitHub-181717?logo=github&logoColor=ffffff&style=flat-square "GitHub")](https://github.com/hugoalh-studio/github-sodium-nodejs) | ![GitHub Latest Release Version](https://img.shields.io/github/release/hugoalh-studio/github-sodium-nodejs?sort=semver&label=&style=flat-square "GitHub Latest Release Version") (![GitHub Latest Release Date](https://img.shields.io/github/release-date/hugoalh-studio/github-sodium-nodejs?label=&style=flat-square "GitHub Latest Release Date")) | ![GitHub Latest Pre-Release Version](https://img.shields.io/github/release/hugoalh-studio/github-sodium-nodejs?include_prereleases&sort=semver&label=&style=flat-square "GitHub Latest Pre-Release Version") (![GitHub Latest Pre-Release Date](https://img.shields.io/github/release-date-pre/hugoalh-studio/github-sodium-nodejs?label=&style=flat-square "GitHub Latest Pre-Release Date")) |
9
- | [![NPM](https://img.shields.io/badge/NPM-CB3837?logo=npm&logoColor=ffffff&style=flat-square "NPM")](https://www.npmjs.com/package/@hugoalh/github-sodium) | ![NPM Latest Release Version](https://img.shields.io/npm/v/@hugoalh/github-sodium/latest?label=&style=flat-square "NPM Latest Release Version") | ![NPM Latest Pre-Release Version](https://img.shields.io/npm/v/@hugoalh/github-sodium/pre?label=&style=flat-square "NPM Latest Pre-Release Version") |
5
+ **🗂️**
6
+ [![GitHub: hugoalh-studio/github-sodium-js](https://img.shields.io/badge/hugoalh--studio/github--sodium--js-181717?logo=github&logoColor=ffffff&style=flat "GitHub: hugoalh-studio/github-sodium-js")](https://github.com/hugoalh-studio/github-sodium-js)
7
+ [![NPM: @hugoalh/github-sodium](https://img.shields.io/badge/@hugoalh/github--sodium-CB3837?logo=npm&logoColor=ffffff&style=flat "NPM: @hugoalh/github-sodium")](https://www.npmjs.com/package/@hugoalh/github-sodium)
10
8
 
11
- A NodeJS module to provide an easier sodium for GitHub secrets.
9
+ **🆙** ![Latest Release Version](https://img.shields.io/github/release/hugoalh-studio/github-sodium-js?sort=semver&color=2187C0&label=&style=flat "Latest Release Version") (![Latest Release Date](https://img.shields.io/github/release-date/hugoalh-studio/github-sodium-js?color=2187C0&label=&style=flat "Latest Release Date"))
12
10
 
13
- This project is based on libsodium.js ([GitHub](https://github.com/jedisct1/libsodium.js))([NPM](https://www.npmjs.com/package/libsodium)) with optimization for GitHub secrets.
11
+ A JavaScript module to provide an easier sodium for GitHub secrets.
14
12
 
15
- ## 🔰 Begin
13
+ This project is based on [libsodium.js](https://github.com/jedisct1/libsodium.js) with optimization for GitHub secrets.
16
14
 
17
- ### Bun
15
+ ## 🎯 Target
18
16
 
19
- > **🧪 Experimental:** Bun is still under development.
17
+ - Bun ^ v1.0.0
18
+ - Cloudflare Workers
19
+ - Deno >= v1.34.0
20
+ > **🛡️ Require Permission**
21
+ >
22
+ > *N/A*
23
+ - NodeJS >= v16.13.0
20
24
 
21
- - **Target Version:** ^ v1.0.0, &:
22
- - TypeScript >= v5.1.0 *\[Development\]*
23
- - **Require Permission:** *N/A*
24
- - **Domain/Registry:**
25
- - [NPM](https://www.npmjs.com/package/@hugoalh/github-sodium)
26
- ```sh
27
- bun add @hugoalh/github-sodium[@<Tag>]
28
- ```
29
- ```js
30
- import ... from "@hugoalh/github-sodium[@<Tag>]";
31
- ```
25
+ ## 🔰 Usage
32
26
 
33
- > **ℹ️ Notice:** It is also able to import part of the module with sub path if available, see [file `package.json`](./package.json) property `exports` for available sub paths.
27
+ ### Via Installation
34
28
 
35
- ### NodeJS
29
+ > **🎯 Supported Target**
30
+ >
31
+ > - Cloudflare Workers
32
+ > - NodeJS
36
33
 
37
- - **Target Version:** >= v16.13.0, &:
38
- - TypeScript >= v5.1.0 *\[Development\]*
39
- - **Require Permission:** *N/A*
40
- - **Domain/Registry:**
41
- - [NPM](https://www.npmjs.com/package/@hugoalh/github-sodium)
42
- ```sh
43
- npm install @hugoalh/github-sodium[@<Tag>]
44
- ```
34
+ 1. Install via console/shell/terminal:
35
+ - Via NPM
36
+ ```sh
37
+ npm install @hugoalh/github-sodium[@<Tag>]
38
+ ```
39
+ - Via PNPM
40
+ ```sh
41
+ pnpm add @hugoalh/github-sodium[@<Tag>]
42
+ ```
43
+ - Via Yarn
44
+ ```sh
45
+ yarn add @hugoalh/github-sodium[@<Tag>]
46
+ ```
47
+ 2. Import at the script (`<ScriptName>.js`):
45
48
  ```js
46
49
  import ... from "@hugoalh/github-sodium";
47
50
  ```
51
+ > **ℹ️ Note**
52
+ >
53
+ > Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `package.json`](./package.json) property `exports` for available sub paths.
54
+
55
+ ### Via NPM Specifier
48
56
 
49
- > **ℹ️ Notice:** It is also able to import part of the module with sub path if available, see [file `package.json`](./package.json) property `exports` for available sub paths.
57
+ > **🎯 Supported Target**
58
+ >
59
+ > - Bun
60
+ > - Deno
61
+
62
+ 1. Import at the script (`<ScriptName>.js`):
63
+ ```js
64
+ import ... from "npm:@hugoalh/github-sodium[@<Tag>]";
65
+ ```
66
+ > **ℹ️ Note**
67
+ >
68
+ > Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `package.json`](./package.json) property `exports` for available sub paths.
50
69
 
51
70
  ## 🧩 API
52
71
 
@@ -61,13 +80,9 @@ This project is based on libsodium.js ([GitHub](https://github.com/jedisct1/libs
61
80
  function seal(publicKey: string, value: string): string;
62
81
  ```
63
82
 
64
- > **ℹ️ Notice:** Documentation is included inside the script file.
65
-
66
83
  ## ✍️ Example
67
84
 
68
85
  - ```js
69
- import { GitHubSodiumSealer } from "@hugoalh/github-sodium";
70
-
71
86
  new GitHubSodiumSealer("base64-encoded-public-key").encrypt("plain-text-secret");
72
87
  //=> "+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0="
73
88
  ```
package/dist/main.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  export declare class GitHubSodiumSealer {
5
5
  #private;
6
6
  /**
7
+ * Initialize GitHub sodium sealer.
7
8
  * @param {string} publicKey Organization's or repository's public key, which need for encrypt value to secret value before create or update a secret.
8
9
  */
9
10
  constructor(publicKey: string);
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,kBAAkB;;IAE9B;;OAEG;gBACS,SAAS,EAAE,MAAM;IAM7B;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAM9B;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CAGrD;AACD,eAAe,kBAAkB,CAAC;AAClC;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7D"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,kBAAkB;;IAE9B;;;OAGG;gBACS,SAAS,EAAE,MAAM;IAM7B;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAM9B;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CAGrD;AACD,eAAe,kBAAkB,CAAC;AAClC;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7D"}
package/dist/main.js CHANGED
@@ -6,6 +6,7 @@ await libsodium.ready;
6
6
  export class GitHubSodiumSealer {
7
7
  #publicKeyBuffer;
8
8
  /**
9
+ * Initialize GitHub sodium sealer.
9
10
  * @param {string} publicKey Organization's or repository's public key, which need for encrypt value to secret value before create or update a secret.
10
11
  */
11
12
  constructor(publicKey) {
package/package.json CHANGED
@@ -1,17 +1,26 @@
1
1
  {
2
2
  "name": "@hugoalh/github-sodium",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "A module to provide an easier sodium for GitHub secrets.",
5
5
  "keywords": [
6
6
  "github",
7
7
  "sodium"
8
8
  ],
9
- "homepage": "https://github.com/hugoalh-studio/github-sodium-nodejs#readme",
9
+ "homepage": "https://github.com/hugoalh-studio/github-sodium-js#readme",
10
10
  "bugs": {
11
- "url": "https://github.com/hugoalh-studio/github-sodium-nodejs/issues"
11
+ "url": "https://github.com/hugoalh-studio/github-sodium-js/issues"
12
12
  },
13
13
  "license": "MIT",
14
14
  "author": "hugoalh",
15
+ "files": [
16
+ "asset/**",
17
+ "bin/**",
18
+ "dist/**",
19
+ "lib/**",
20
+ "LICENSE*.md",
21
+ "package.json",
22
+ "README*.md"
23
+ ],
15
24
  "type": "module",
16
25
  "main": "./dist/main.js",
17
26
  "exports": {
@@ -21,20 +30,23 @@
21
30
  "types": "./dist/main.d.ts",
22
31
  "repository": {
23
32
  "type": "git",
24
- "url": "git+https://github.com/hugoalh-studio/github-sodium-nodejs.git"
33
+ "url": "git+https://github.com/hugoalh-studio/github-sodium-js.git"
34
+ },
35
+ "scripts": {
36
+ "build": "tsc"
25
37
  },
26
38
  "dependencies": {
27
- "libsodium-wrappers": "^0.7.13"
39
+ "libsodium-wrappers": "0.7.13"
28
40
  },
29
41
  "devDependencies": {
30
- "@stylistic/eslint-plugin": "^1.5.3",
42
+ "@stylistic/eslint-plugin": "^1.7.0",
31
43
  "@types/libsodium-wrappers": "^0.7.13",
32
- "@types/node": "^20.11.0",
33
- "@typescript-eslint/eslint-plugin": "^6.18.1",
34
- "@typescript-eslint/parser": "^6.18.1",
35
- "eslint": "^8.56.0",
44
+ "@types/node": "^20.12.2",
45
+ "@typescript-eslint/eslint-plugin": "^7.4.0",
46
+ "@typescript-eslint/parser": "^7.4.0",
47
+ "eslint": "^8.57.0",
36
48
  "eslint-plugin-only-warn": "^1.1.0",
37
- "typescript": "^5.3.3"
49
+ "typescript": "^5.4.3"
38
50
  },
39
51
  "engines": {
40
52
  "node": ">=16.13.0"