@suronai/sdk 0.1.18 → 0.1.19
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/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/vault.js +7 -2
package/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export function vault(options?: VaultOptions): Promise<void>;
|
|
|
18
18
|
* console.error + process.exit(1). Unknown errors are re-thrown.
|
|
19
19
|
* Must be awaited before any code that reads process.env.
|
|
20
20
|
*/
|
|
21
|
-
export function
|
|
21
|
+
export function config(options?: VaultOptions): Promise<void>;
|
|
22
22
|
|
|
23
23
|
export class SuronError extends Error {}
|
|
24
24
|
export class SuronConfigError extends SuronError {}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
package/src/vault.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "fs";
|
|
2
2
|
import { join } from "path";
|
|
3
|
-
import { SuronConfigError, SuronAppNotFoundError, SuronRateLimitError } from "./errors.js";
|
|
3
|
+
import { SuronConfigError, SuronAppNotFoundError, SuronRateLimitError, SuronDeniedError, SuronTimeoutError } from "./errors.js";
|
|
4
4
|
import { pollUntilApproved } from "./poll.js";
|
|
5
5
|
import { decryptEnv } from "./decrypt.js";
|
|
6
6
|
|
|
@@ -126,10 +126,15 @@ export async function vault(options = {}) {
|
|
|
126
126
|
* Drop-in safe wrapper around vault().
|
|
127
127
|
* Handles all known Suron errors with a console.error + process.exit(1).
|
|
128
128
|
* Unknown errors are re-thrown so the caller still sees them.
|
|
129
|
+
*
|
|
130
|
+
* Usage:
|
|
131
|
+
* import { config } from "@suronai/sdk";
|
|
132
|
+
* await config();
|
|
133
|
+
*
|
|
129
134
|
* @param {VaultOptions} [options]
|
|
130
135
|
* @returns {Promise<void>}
|
|
131
136
|
*/
|
|
132
|
-
export async function
|
|
137
|
+
export async function config(options = {}) {
|
|
133
138
|
try {
|
|
134
139
|
await vault(options);
|
|
135
140
|
} catch (err) {
|