@hush-hush/sdk 3.0.0
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/LICENSE +21 -0
- package/README.md +64 -0
- package/package.json +79 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 alrayyes
|
|
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
|
|
7
|
+
deal in the Software without restriction, including without limitation the
|
|
8
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
9
|
+
sell 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
|
|
13
|
+
all 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
|
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
|
+
DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# hush-hush-node
|
|
2
|
+
|
|
3
|
+
[](https://github.com/alrayyes/hush-hush-node/actions/workflows/ci.yml)
|
|
4
|
+
[](https://codecov.io/gh/alrayyes/hush-hush-node)
|
|
5
|
+
[](https://www.npmjs.com/package/hush-hush)
|
|
6
|
+
[](https://github.com/alrayyes/hush-hush-node/releases)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
The official Node.js/TypeScript SDK for
|
|
10
|
+
[hush-hush](https://github.com/alrayyes/hush-hush), generated from its
|
|
11
|
+
OpenAPI spec and kept in sync with it automatically.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install hush-hush
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Requires Node.js 22 or newer.
|
|
20
|
+
|
|
21
|
+
## Quickstart
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { Client } from "hush-hush";
|
|
25
|
+
|
|
26
|
+
const client = new Client("https://hush-hush.example.com", {
|
|
27
|
+
apiKey: "your-api-key", // or set HUSH_HUSH_API_KEY
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Create is a write operation — it needs the credential above.
|
|
31
|
+
await client.createObject(
|
|
32
|
+
"my-first-secret",
|
|
33
|
+
new TextEncoder().encode("already-sealed-ciphertext"),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// Get needs no credential — hush-hush's confidentiality boundary is
|
|
37
|
+
// "who holds a matching private key," not who's calling this endpoint.
|
|
38
|
+
const value = await client.getObject("my-first-secret");
|
|
39
|
+
console.log(`got ${value.byteLength} bytes of sealed ciphertext`);
|
|
40
|
+
|
|
41
|
+
// The audit log records every read and write; querying it needs no
|
|
42
|
+
// credential either, and resolves with the full matching result set
|
|
43
|
+
// (there's no pagination on this endpoint).
|
|
44
|
+
for (const entry of await client.queryAuditLog()) {
|
|
45
|
+
console.log(entry.action, entry.object_id, entry.timestamp);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The API key is only required for write operations (create/update/delete);
|
|
50
|
+
reads (get, used-by, audit-log query) work without one. A per-call `caller`
|
|
51
|
+
option, accepted by create/get/update/delete, is optional. The package
|
|
52
|
+
ships both ESM and CommonJS builds. See the
|
|
53
|
+
[full API reference](https://alrayyes.github.io/hush-hush-node/) for
|
|
54
|
+
everything else.
|
|
55
|
+
|
|
56
|
+
## Versioning
|
|
57
|
+
|
|
58
|
+
This SDK's version tracks hush-hush's OpenAPI spec, not this repo's own
|
|
59
|
+
commit history — see [CONTRIBUTING.md](CONTRIBUTING.md) for how a spec
|
|
60
|
+
change becomes a release.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
[MIT](LICENSE)
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hush-hush/sdk",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Official Node.js/TypeScript SDK for hush-hush, generated from its OpenAPI spec",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"hush-hush",
|
|
7
|
+
"secrets",
|
|
8
|
+
"sdk"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/alrayyes/hush-hush-node",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/alrayyes/hush-hush-node.git"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "alrayyes",
|
|
17
|
+
"type": "module",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"require": {
|
|
25
|
+
"types": "./dist/index.d.cts",
|
|
26
|
+
"default": "./dist/index.cjs"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"main": "./dist/index.cjs",
|
|
31
|
+
"module": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsup",
|
|
38
|
+
"codegen": "./scripts/generate.sh",
|
|
39
|
+
"docs": "typedoc",
|
|
40
|
+
"format:check": "prettier --check \"**/*.{md,yml,yaml}\"",
|
|
41
|
+
"format:write": "prettier --write \"**/*.{md,yml,yaml}\"",
|
|
42
|
+
"lint": "biome check .",
|
|
43
|
+
"lint:fix": "biome check --write .",
|
|
44
|
+
"lint:md": "markdownlint-cli2 \"**/*.md\"",
|
|
45
|
+
"prepare": "lefthook install",
|
|
46
|
+
"test": "vitest run test/unit --coverage",
|
|
47
|
+
"test:contract": "vitest run test/contract",
|
|
48
|
+
"test:e2e": "vitest run test/e2e",
|
|
49
|
+
"test:pact": "vitest run test/pact",
|
|
50
|
+
"typecheck": "tsc --noEmit"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@biomejs/biome": "2.5.11",
|
|
54
|
+
"@commitlint/cli": "21.2.2",
|
|
55
|
+
"@commitlint/config-conventional": "21.2.2",
|
|
56
|
+
"@pact-foundation/pact": "17.1.3",
|
|
57
|
+
"@types/node": "26.4.0",
|
|
58
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
59
|
+
"lefthook": "2.1.12",
|
|
60
|
+
"markdownlint-cli2": "0.23.2",
|
|
61
|
+
"openapi-typescript": "7.13.0",
|
|
62
|
+
"prettier": "3.9.6",
|
|
63
|
+
"sort-package-json": "4.0.0",
|
|
64
|
+
"tsup": "8.5.1",
|
|
65
|
+
"typedoc": "0.28.20",
|
|
66
|
+
"typescript": "5.9.3",
|
|
67
|
+
"vitest": "4.1.11"
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": ">=22"
|
|
71
|
+
},
|
|
72
|
+
"publishConfig": {
|
|
73
|
+
"access": "public"
|
|
74
|
+
},
|
|
75
|
+
"allowScripts": {
|
|
76
|
+
"lefthook@2.1.12": true,
|
|
77
|
+
"esbuild@0.27.7": true
|
|
78
|
+
}
|
|
79
|
+
}
|