@sparkvault/sdk 1.1.6 → 1.8.3

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.
@@ -1,26 +0,0 @@
1
- /**
2
- * RNG Module Types
3
- */
4
- export type RNGFormat = 'hex' | 'base64' | 'base64url' | 'alphanumeric' | 'alphanumeric-mixed' | 'password' | 'numeric' | 'uuid' | 'bytes';
5
- export interface GenerateOptions {
6
- /** Number of bytes to generate (1-1024) */
7
- bytes: number;
8
- /** Output format (default: 'base64url') */
9
- format?: RNGFormat;
10
- }
11
- export interface RandomResult {
12
- /** Generated random value */
13
- value: string | number[];
14
- /** Number of bytes generated */
15
- bytes: number;
16
- /** Format used */
17
- format: RNGFormat;
18
- /** Reference ID for billing/audit */
19
- referenceId: string;
20
- }
21
- export interface GenerateResponse {
22
- random_bytes_b64: string;
23
- num_bytes: number;
24
- format: string;
25
- reference_id: string;
26
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * Sparks Module
3
- *
4
- * Create and read ephemeral encrypted secrets.
5
- * Sparks are destroyed after being read (burn-on-read).
6
- */
7
- import { HttpClient } from '../http';
8
- import type { CreateSparkOptions, Spark, SparkPayload } from './types';
9
- export declare class SparksModule {
10
- private readonly http;
11
- constructor(http: HttpClient);
12
- /**
13
- * Create an ephemeral encrypted secret.
14
- *
15
- * @example
16
- * const spark = await sv.sparks.create({
17
- * payload: 'my secret data',
18
- * ttl: 3600,
19
- * maxReads: 1
20
- * });
21
- * console.log(spark.url);
22
- */
23
- create(options: CreateSparkOptions): Promise<Spark>;
24
- /**
25
- * Read and burn a spark.
26
- * The spark is destroyed after the configured number of reads.
27
- *
28
- * @example
29
- * const payload = await sv.sparks.read('spk_abc123');
30
- * console.log(payload.data);
31
- */
32
- read(id: string, password?: string): Promise<SparkPayload>;
33
- private validateCreateOptions;
34
- private encodePayload;
35
- private decodePayload;
36
- }
37
- export type { CreateSparkOptions, Spark, SparkPayload, } from './types';
@@ -1,56 +0,0 @@
1
- /**
2
- * Sparks Module Types
3
- */
4
- export interface CreateSparkOptions {
5
- /** Secret payload to encrypt */
6
- payload: string | Uint8Array;
7
- /** Time-to-live in seconds (default: 3600) */
8
- ttl?: number;
9
- /** Maximum number of reads before destruction (default: 1) */
10
- maxReads?: number;
11
- /** Optional password protection */
12
- password?: string;
13
- /** Optional name/label for the spark */
14
- name?: string;
15
- }
16
- export interface Spark {
17
- /** Spark ID */
18
- id: string;
19
- /** Direct URL to read the spark */
20
- url: string;
21
- /** Expiry timestamp (Unix seconds) */
22
- expiresAt: number;
23
- /** Maximum reads remaining */
24
- maxReads: number;
25
- /** Name/label if provided */
26
- name?: string;
27
- }
28
- export interface ReadSparkOptions {
29
- /** Spark ID */
30
- id: string;
31
- /** Password if the spark is password-protected */
32
- password?: string;
33
- }
34
- export interface SparkPayload {
35
- /** Decrypted data */
36
- data: string | Uint8Array;
37
- /** When the spark was read (Unix seconds) */
38
- readAt: number;
39
- /** Whether the spark was destroyed after reading */
40
- burned: boolean;
41
- /** Reads remaining (0 if burned) */
42
- readsRemaining: number;
43
- }
44
- export interface CreateSparkResponse {
45
- spark_id: string;
46
- url: string;
47
- expires_at: number;
48
- max_reads: number;
49
- name?: string;
50
- }
51
- export interface ReadSparkResponse {
52
- payload: string;
53
- read_at: number;
54
- burned: boolean;
55
- reads_remaining: number;
56
- }