@qnsp/storage-sdk 0.0.1
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/.turbo/turbo-build.log +5 -0
- package/.turbo/turbo-lint.log +6 -0
- package/.turbo/turbo-test.log +41 -0
- package/.turbo/turbo-typecheck.log +5 -0
- package/README.md +93 -0
- package/dist/events.d.ts +47 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +124 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +202 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +398 -0
- package/dist/index.js.map +1 -0
- package/dist/observability.d.ts +28 -0
- package/dist/observability.d.ts.map +1 -0
- package/dist/observability.js +82 -0
- package/dist/observability.js.map +1 -0
- package/package.json +40 -0
- package/src/events.ts +192 -0
- package/src/index.test.ts +455 -0
- package/src/index.ts +664 -0
- package/src/observability.ts +135 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +10 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @qnsp/storage-sdk@0.0.1 test /Volumes/ProjectQNSP/QNSP/packages/storage-sdk
|
|
4
|
+
> vitest run
|
|
5
|
+
|
|
6
|
+
[?25l
|
|
7
|
+
RUN v4.0.13 /Volumes/ProjectQNSP/QNSP/packages/storage-sdk
|
|
8
|
+
|
|
9
|
+
[?2026h
|
|
10
|
+
❯ src/index.test.ts [queued]
|
|
11
|
+
|
|
12
|
+
Test Files 0 passed (1)
|
|
13
|
+
Tests 0 passed (0)
|
|
14
|
+
Start at 02:56:47
|
|
15
|
+
Duration 0ms
|
|
16
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
17
|
+
❯ src/index.test.ts 0/9
|
|
18
|
+
|
|
19
|
+
Test Files 0 passed (1)
|
|
20
|
+
Tests 0 passed (9)
|
|
21
|
+
Start at 02:56:47
|
|
22
|
+
Duration 201ms
|
|
23
|
+
[?2026l[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K ✓ src/index.test.ts (9 tests) 15ms
|
|
24
|
+
✓ StorageClient (8)
|
|
25
|
+
✓ initiates an upload with authorization and sensible defaults 9ms
|
|
26
|
+
✓ uploads binary parts using streaming semantics 1ms
|
|
27
|
+
✓ parses ranged download responses and surfaces stream metadata 1ms
|
|
28
|
+
✓ records telemetry for successful requests 0ms
|
|
29
|
+
✓ records telemetry failures 1ms
|
|
30
|
+
✓ records bytes for upload parts 0ms
|
|
31
|
+
✓ updates and fetches document policies with x-tenant-id header 0ms
|
|
32
|
+
✓ applies and releases legal holds 0ms
|
|
33
|
+
✓ StorageEventsClient (1)
|
|
34
|
+
✓ records telemetry when fetching events 1ms
|
|
35
|
+
|
|
36
|
+
Test Files 1 passed (1)
|
|
37
|
+
Tests 9 passed (9)
|
|
38
|
+
Start at 02:56:47
|
|
39
|
+
Duration 221ms (transform 59ms, setup 0ms, collect 130ms, tests 15ms, environment 0ms, prepare 2ms)
|
|
40
|
+
|
|
41
|
+
[?25h
|
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @qnsp/storage-sdk
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for the QNSP storage service. Supports multipart uploads, downloads, lifecycle
|
|
4
|
+
policies, legal holds, compliance metadata, and event subscriptions.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pnpm add @qnsp/storage-sdk
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Authentication
|
|
13
|
+
|
|
14
|
+
Authenticate with a **service token** (issued by `auth-service` or the cloud portal API key UI) and
|
|
15
|
+
pass it to `apiKey`. Set `tenantId` to scope quotas and telemetry labels.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { StorageClient, createStorageClientTelemetry } from "@qnsp/storage-sdk";
|
|
19
|
+
|
|
20
|
+
const storage = new StorageClient({
|
|
21
|
+
baseUrl: "https://storage.qnsp.cuilabs.io",
|
|
22
|
+
apiKey: process.env.QNSP_SERVICE_TOKEN!,
|
|
23
|
+
tenantId: "tenant_123",
|
|
24
|
+
telemetry: createStorageClientTelemetry({
|
|
25
|
+
serviceName: "storage-uploader",
|
|
26
|
+
serviceVersion: "1.0.0",
|
|
27
|
+
otlpEndpoint: process.env.OTLP_ENDPOINT!,
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Tier requirements
|
|
33
|
+
|
|
34
|
+
| Capability | Minimum tier | Notes |
|
|
35
|
+
|------------|--------------|-------|
|
|
36
|
+
| Upload/download, lifecycle, compliance | `free` | Included in Always Free tier (5GB, 2,000 API calls) |
|
|
37
|
+
| Extended storage quotas | Based on paid tier | Limits enforced by backend using `@qnsp/shared-kernel` |
|
|
38
|
+
|
|
39
|
+
All tenants can instantiate the SDK, but exceeding tier quotas triggers backend `TierError`
|
|
40
|
+
responses. Upgrade at <https://cloud.qnsp.cuilabs.io/billing>.
|
|
41
|
+
|
|
42
|
+
## Usage example
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import {
|
|
46
|
+
StorageClient,
|
|
47
|
+
StorageEventsClient,
|
|
48
|
+
createStorageClientTelemetry,
|
|
49
|
+
} from "@qnsp/storage-sdk";
|
|
50
|
+
|
|
51
|
+
const client = new StorageClient({
|
|
52
|
+
baseUrl: "https://storage.example.com",
|
|
53
|
+
apiKey: process.env.QNSP_SERVICE_TOKEN!,
|
|
54
|
+
tenantId: "tenant_123",
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const upload = await client.initiateUpload({
|
|
58
|
+
name: "document.pdf",
|
|
59
|
+
mimeType: "application/pdf",
|
|
60
|
+
sizeBytes: 1024 * 1024,
|
|
61
|
+
classification: "confidential",
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
await client.uploadPart(upload.uploadId, 1, part1Data);
|
|
65
|
+
await client.uploadPart(upload.uploadId, 2, part2Data);
|
|
66
|
+
|
|
67
|
+
const result = await client.completeUpload(upload.uploadId);
|
|
68
|
+
const stream = await client.downloadStream(result.documentId, result.version);
|
|
69
|
+
|
|
70
|
+
const events = new StorageEventsClient({ baseUrl: "https://storage.example.com" });
|
|
71
|
+
const replicationEvents = await events.fetchEvents("storage.document.replicated");
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Telemetry
|
|
75
|
+
|
|
76
|
+
Pass the optional `telemetry` property (either an instance or `createStorageClientTelemetry`
|
|
77
|
+
configuration) to emit OpenTelemetry metrics via OTLP HTTP exporter. Metrics include:
|
|
78
|
+
|
|
79
|
+
- `storage_sdk_requests_total`
|
|
80
|
+
- `storage_sdk_request_failures_total`
|
|
81
|
+
- `storage_sdk_request_duration_ms`
|
|
82
|
+
- `storage_sdk_bytes_total`
|
|
83
|
+
|
|
84
|
+
See `docs/observability/portal-dashboards.md` for dashboards powered by these metrics.
|
|
85
|
+
|
|
86
|
+
## Related documentation
|
|
87
|
+
|
|
88
|
+
- [Developer onboarding guide](../../docs/guides/developer-onboarding.md#sdk-quick-links)
|
|
89
|
+
- [Storage service plan](../../docs/service-plans/storage-service-plan.md)
|
|
90
|
+
- [Tier limits](../shared-kernel/src/tier-limits.ts)
|
|
91
|
+
|
|
92
|
+
© 2025 QNSP - CUI LABS, Singapore
|
|
93
|
+
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { EventEnvelope } from "@qnsp/events";
|
|
2
|
+
import type { StorageClientTelemetry, StorageClientTelemetryConfig } from "./observability.js";
|
|
3
|
+
type DocumentSearchEvent = EventEnvelope<{
|
|
4
|
+
documentId: string;
|
|
5
|
+
tenantId: string;
|
|
6
|
+
version: number;
|
|
7
|
+
checksumSha3: string;
|
|
8
|
+
occurredAt: string;
|
|
9
|
+
}>;
|
|
10
|
+
type UsageEvent = EventEnvelope<{
|
|
11
|
+
tenantId: string;
|
|
12
|
+
documentId?: string;
|
|
13
|
+
version?: number;
|
|
14
|
+
occurredAt: string;
|
|
15
|
+
operation: "upload" | "download";
|
|
16
|
+
sizeBytes: number;
|
|
17
|
+
tier: string;
|
|
18
|
+
durationMs?: number | null;
|
|
19
|
+
}>;
|
|
20
|
+
type BillingEvent = EventEnvelope<{
|
|
21
|
+
tenantId: string;
|
|
22
|
+
meterType: "storage" | "egress" | "api_call" | string;
|
|
23
|
+
quantity: number;
|
|
24
|
+
unit: string;
|
|
25
|
+
metadata?: Record<string, unknown>;
|
|
26
|
+
occurredAt: string;
|
|
27
|
+
}>;
|
|
28
|
+
export type StorageEvent = DocumentSearchEvent | UsageEvent | BillingEvent;
|
|
29
|
+
export interface StorageEventsConfig {
|
|
30
|
+
readonly baseUrl: string;
|
|
31
|
+
readonly apiKey?: string;
|
|
32
|
+
readonly timeoutMs?: number;
|
|
33
|
+
readonly telemetry?: StorageClientTelemetry | StorageClientTelemetryConfig;
|
|
34
|
+
}
|
|
35
|
+
export declare class StorageEventsClient {
|
|
36
|
+
private readonly config;
|
|
37
|
+
private readonly telemetry;
|
|
38
|
+
private readonly targetService;
|
|
39
|
+
constructor(config: StorageEventsConfig);
|
|
40
|
+
fetchEvents(topic: string, options?: {
|
|
41
|
+
since?: string;
|
|
42
|
+
limit?: number;
|
|
43
|
+
}): Promise<StorageEvent[]>;
|
|
44
|
+
private recordTelemetryEvent;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EACX,sBAAsB,EACtB,4BAA4B,EAE5B,MAAM,oBAAoB,CAAC;AAG5B,KAAK,mBAAmB,GAAG,aAAa,CAAC;IACxC,UAAU,EAA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C1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAE3B,MAAM,EAAE,mBAAmB;IAoBjC,WAAW,CAChB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1C,OAAO,CAAC,YAAY,EAAE,CAAC;IAuG1B,OAAO,CAAC,oBAAoB;CAM5B"}
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { performance } from "node:perf_hooks";
|
|
2
|
+
import { createEventEnvelope } from "@qnsp/events";
|
|
3
|
+
import { createStorageClientTelemetry, isStorageClientTelemetry } from "./observability.js";
|
|
4
|
+
export class StorageEventsClient {
|
|
5
|
+
config;
|
|
6
|
+
telemetry;
|
|
7
|
+
targetService;
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.config = {
|
|
10
|
+
baseUrl: config.baseUrl.replace(/\/$/, ""),
|
|
11
|
+
apiKey: config.apiKey ?? "",
|
|
12
|
+
timeoutMs: config.timeoutMs ?? 15_000,
|
|
13
|
+
};
|
|
14
|
+
this.telemetry = config.telemetry
|
|
15
|
+
? isStorageClientTelemetry(config.telemetry)
|
|
16
|
+
? config.telemetry
|
|
17
|
+
: createStorageClientTelemetry(config.telemetry)
|
|
18
|
+
: null;
|
|
19
|
+
try {
|
|
20
|
+
this.targetService = new URL(this.config.baseUrl).host;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
this.targetService = "storage-service";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async fetchEvents(topic, options) {
|
|
27
|
+
const params = new URLSearchParams();
|
|
28
|
+
if (options?.since)
|
|
29
|
+
params.set("since", options.since);
|
|
30
|
+
if (options?.limit)
|
|
31
|
+
params.set("limit", options.limit.toString());
|
|
32
|
+
const url = `${this.config.baseUrl}/storage/internal/events/${encodeURIComponent(topic)}${params.size > 0 ? `?${params}` : ""}`;
|
|
33
|
+
const headers = {
|
|
34
|
+
Accept: "application/json",
|
|
35
|
+
};
|
|
36
|
+
if (this.config.apiKey) {
|
|
37
|
+
headers["Authorization"] = `Bearer ${this.config.apiKey}`;
|
|
38
|
+
}
|
|
39
|
+
const controller = new AbortController();
|
|
40
|
+
const timeoutId = setTimeout(() => controller.abort(), this.config.timeoutMs);
|
|
41
|
+
const start = performance.now();
|
|
42
|
+
let status = "ok";
|
|
43
|
+
let httpStatus;
|
|
44
|
+
let errorMessage;
|
|
45
|
+
let bytesReceived;
|
|
46
|
+
const route = "/storage/internal/events/:topic";
|
|
47
|
+
try {
|
|
48
|
+
const response = await fetch(url, {
|
|
49
|
+
method: "GET",
|
|
50
|
+
headers,
|
|
51
|
+
signal: controller.signal,
|
|
52
|
+
});
|
|
53
|
+
clearTimeout(timeoutId);
|
|
54
|
+
httpStatus = response.status;
|
|
55
|
+
if (!response.ok) {
|
|
56
|
+
status = "error";
|
|
57
|
+
const errorText = await response.text().catch(() => "unknown error");
|
|
58
|
+
errorMessage = errorText;
|
|
59
|
+
throw new Error(`Event fetch failed: ${response.status} ${response.statusText} - ${errorText}`);
|
|
60
|
+
}
|
|
61
|
+
bytesReceived = Number.parseInt(response.headers.get("Content-Length") ?? "0", 10);
|
|
62
|
+
const payload = (await response.json());
|
|
63
|
+
return payload.map((entry) => {
|
|
64
|
+
const metadataSource = entry.metadata && typeof entry.metadata === "object" ? entry.metadata : undefined;
|
|
65
|
+
const normalizedMetadata = metadataSource !== undefined
|
|
66
|
+
? {
|
|
67
|
+
timestamp: typeof metadataSource["timestamp"] === "string"
|
|
68
|
+
? metadataSource["timestamp"]
|
|
69
|
+
: new Date().toISOString(),
|
|
70
|
+
...(typeof metadataSource["correlationId"] === "string"
|
|
71
|
+
? { correlationId: metadataSource["correlationId"] }
|
|
72
|
+
: {}),
|
|
73
|
+
...(typeof metadataSource["causationId"] === "string"
|
|
74
|
+
? { causationId: metadataSource["causationId"] }
|
|
75
|
+
: {}),
|
|
76
|
+
...(typeof metadataSource["tenantId"] === "string"
|
|
77
|
+
? { tenantId: metadataSource["tenantId"] }
|
|
78
|
+
: {}),
|
|
79
|
+
}
|
|
80
|
+
: { timestamp: new Date().toISOString() };
|
|
81
|
+
return createEventEnvelope({
|
|
82
|
+
topic: entry.topic,
|
|
83
|
+
version: entry.version,
|
|
84
|
+
payload: entry.payload,
|
|
85
|
+
metadata: normalizedMetadata,
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
clearTimeout(timeoutId);
|
|
91
|
+
status = "error";
|
|
92
|
+
if (!errorMessage && error instanceof Error) {
|
|
93
|
+
errorMessage = error.message;
|
|
94
|
+
}
|
|
95
|
+
if (error instanceof Error && error.name === "AbortError") {
|
|
96
|
+
errorMessage = `timeout after ${this.config.timeoutMs}ms`;
|
|
97
|
+
throw new Error(`Event request timeout after ${this.config.timeoutMs}ms`);
|
|
98
|
+
}
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
const durationMs = performance.now() - start;
|
|
103
|
+
const event = {
|
|
104
|
+
operation: `fetchEvents(${topic})`,
|
|
105
|
+
method: "GET",
|
|
106
|
+
route,
|
|
107
|
+
target: this.targetService,
|
|
108
|
+
status,
|
|
109
|
+
durationMs,
|
|
110
|
+
...(typeof httpStatus === "number" ? { httpStatus } : {}),
|
|
111
|
+
...(status === "error" && errorMessage ? { error: errorMessage } : {}),
|
|
112
|
+
...(typeof bytesReceived === "number" && bytesReceived > 0 ? { bytesReceived } : {}),
|
|
113
|
+
};
|
|
114
|
+
this.recordTelemetryEvent(event);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
recordTelemetryEvent(event) {
|
|
118
|
+
if (!this.telemetry) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.telemetry.record(event);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=events.js.map
|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,UAAU;gBACV,GAAG,CAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzD,GAAG,CAAC,MAAM,KAAK,OAAO,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACtE,GAAG,CAAC,OAAO,aAAa,KAAK,QAAQ,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACpF,CAAC;YACF,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;IAEO,oBAAoB,CAAC,KAAkC;QAC9D,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACrB,OAAO;QACR,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CACD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { StorageClientTelemetry, StorageClientTelemetryConfig } from "./observability.js";
|
|
2
|
+
/**
|
|
3
|
+
* @qnsp/storage-sdk
|
|
4
|
+
*
|
|
5
|
+
* TypeScript SDK client for the QNSP storage-service API.
|
|
6
|
+
* Provides a high-level interface for document upload, download, and management operations.
|
|
7
|
+
*/
|
|
8
|
+
export interface StorageClientConfig {
|
|
9
|
+
readonly baseUrl: string;
|
|
10
|
+
readonly apiKey?: string;
|
|
11
|
+
readonly tenantId: string;
|
|
12
|
+
readonly timeoutMs?: number;
|
|
13
|
+
readonly telemetry?: StorageClientTelemetry | StorageClientTelemetryConfig;
|
|
14
|
+
}
|
|
15
|
+
export interface InitiateUploadOptions {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly mimeType: string;
|
|
18
|
+
readonly sizeBytes: number;
|
|
19
|
+
readonly classification?: string;
|
|
20
|
+
readonly metadata?: Record<string, unknown>;
|
|
21
|
+
readonly tags?: readonly string[];
|
|
22
|
+
readonly retentionPolicy?: {
|
|
23
|
+
readonly mode?: "compliance" | "governance" | null;
|
|
24
|
+
readonly retainUntil?: string | null;
|
|
25
|
+
readonly legalHolds?: readonly string[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface UploadPartResult {
|
|
29
|
+
readonly uploadId: string;
|
|
30
|
+
readonly partId: number;
|
|
31
|
+
readonly status: string;
|
|
32
|
+
readonly sizeBytes: number;
|
|
33
|
+
readonly checksumSha3: string;
|
|
34
|
+
readonly retries: number;
|
|
35
|
+
readonly totalParts: number;
|
|
36
|
+
readonly completedParts: number;
|
|
37
|
+
readonly bytesReceived: number;
|
|
38
|
+
readonly lastPartNumber: number;
|
|
39
|
+
readonly resumeToken: string | null;
|
|
40
|
+
readonly scan?: {
|
|
41
|
+
readonly status: string;
|
|
42
|
+
readonly signature: string | null;
|
|
43
|
+
readonly engine: string | null;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface CompleteUploadResult {
|
|
47
|
+
readonly documentId: string;
|
|
48
|
+
readonly tenantId: string;
|
|
49
|
+
readonly version: number;
|
|
50
|
+
readonly sizeBytes: number;
|
|
51
|
+
readonly checksumSha3: string;
|
|
52
|
+
readonly parts: readonly {
|
|
53
|
+
readonly partId: number;
|
|
54
|
+
readonly checksumSha3: string;
|
|
55
|
+
readonly sizeBytes: number;
|
|
56
|
+
}[];
|
|
57
|
+
readonly downloadManifest: unknown;
|
|
58
|
+
readonly cdnDownload?: {
|
|
59
|
+
readonly url: string;
|
|
60
|
+
readonly expiresAt: string;
|
|
61
|
+
readonly token: string;
|
|
62
|
+
} | null;
|
|
63
|
+
}
|
|
64
|
+
export interface DownloadDescriptor {
|
|
65
|
+
readonly documentId: string;
|
|
66
|
+
readonly tenantId: string;
|
|
67
|
+
readonly version: number;
|
|
68
|
+
readonly sizeBytes: number;
|
|
69
|
+
readonly checksumSha3: string;
|
|
70
|
+
readonly manifest: unknown;
|
|
71
|
+
}
|
|
72
|
+
export interface UploadStatus {
|
|
73
|
+
readonly uploadId: string;
|
|
74
|
+
readonly documentId: string;
|
|
75
|
+
readonly tenantId: string;
|
|
76
|
+
readonly status: "pending" | "committed" | "aborted" | "quarantined";
|
|
77
|
+
readonly totalParts: number;
|
|
78
|
+
readonly completedParts: number;
|
|
79
|
+
readonly bytesReceived: number;
|
|
80
|
+
readonly lastPartNumber: number;
|
|
81
|
+
readonly chunkSizeBytes: number;
|
|
82
|
+
readonly totalSizeBytes: number;
|
|
83
|
+
readonly expiresAt: string;
|
|
84
|
+
readonly resumeToken: string | null;
|
|
85
|
+
readonly createdAt: string;
|
|
86
|
+
readonly updatedAt: string;
|
|
87
|
+
}
|
|
88
|
+
export interface DocumentPolicies {
|
|
89
|
+
readonly documentId: string;
|
|
90
|
+
readonly tenantId: string;
|
|
91
|
+
readonly compliance: {
|
|
92
|
+
readonly retentionMode: "compliance" | "governance" | null;
|
|
93
|
+
readonly retainUntil: string | null;
|
|
94
|
+
readonly legalHolds: readonly string[];
|
|
95
|
+
readonly wormLockExpiresAt: string | null;
|
|
96
|
+
};
|
|
97
|
+
readonly lifecycle?: {
|
|
98
|
+
readonly currentTier?: "hot" | "warm" | "cold" | "frozen";
|
|
99
|
+
readonly targetTier?: "hot" | "warm" | "cold" | "frozen" | null;
|
|
100
|
+
readonly transitionAfter?: string | null;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface UpdatePoliciesRequest {
|
|
104
|
+
readonly retentionMode?: "compliance" | "governance";
|
|
105
|
+
readonly retainUntil?: string;
|
|
106
|
+
readonly legalHolds?: readonly string[];
|
|
107
|
+
readonly wormLockExpiresAt?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ApplyLegalHoldRequest {
|
|
110
|
+
readonly holdId: string;
|
|
111
|
+
}
|
|
112
|
+
export interface ScheduleTransitionRequest {
|
|
113
|
+
readonly targetTier: "hot" | "warm" | "cold" | "frozen";
|
|
114
|
+
readonly transitionAfter: string;
|
|
115
|
+
}
|
|
116
|
+
export declare class StorageClient {
|
|
117
|
+
private readonly config;
|
|
118
|
+
private readonly telemetry;
|
|
119
|
+
private readonly targetService;
|
|
120
|
+
constructor(config: StorageClientConfig);
|
|
121
|
+
private request;
|
|
122
|
+
initiateUpload(options: InitiateUploadOptions): Promise<{
|
|
123
|
+
readonly uploadId: string;
|
|
124
|
+
readonly documentId: string;
|
|
125
|
+
readonly tenantId: string;
|
|
126
|
+
readonly chunkSizeBytes: number;
|
|
127
|
+
readonly totalSizeBytes: number;
|
|
128
|
+
readonly totalParts: number;
|
|
129
|
+
readonly expiresAt: string;
|
|
130
|
+
readonly resumeToken: string | null;
|
|
131
|
+
readonly pqc: {
|
|
132
|
+
readonly provider: string;
|
|
133
|
+
readonly algorithm: string;
|
|
134
|
+
readonly keyId: string;
|
|
135
|
+
};
|
|
136
|
+
}>;
|
|
137
|
+
uploadPart(uploadId: string, partId: number, data: ReadableStream<Uint8Array> | Buffer | Uint8Array): Promise<UploadPartResult>;
|
|
138
|
+
getUploadStatus(uploadId: string): Promise<UploadStatus>;
|
|
139
|
+
completeUpload(uploadId: string): Promise<CompleteUploadResult>;
|
|
140
|
+
getDownloadDescriptor(documentId: string, version: number, options?: {
|
|
141
|
+
readonly token?: string | null;
|
|
142
|
+
readonly expiresAt?: number | null;
|
|
143
|
+
readonly signature?: string | null;
|
|
144
|
+
}): Promise<DownloadDescriptor>;
|
|
145
|
+
downloadStream(documentId: string, version: number, options?: {
|
|
146
|
+
readonly token?: string | null;
|
|
147
|
+
readonly expiresAt?: number | null;
|
|
148
|
+
readonly signature?: string | null;
|
|
149
|
+
readonly range?: string | null;
|
|
150
|
+
}): Promise<{
|
|
151
|
+
readonly stream: ReadableStream<Uint8Array>;
|
|
152
|
+
readonly statusCode: 200 | 206;
|
|
153
|
+
readonly totalSize: number;
|
|
154
|
+
readonly contentLength: number;
|
|
155
|
+
readonly range?: {
|
|
156
|
+
readonly start: number;
|
|
157
|
+
readonly end: number;
|
|
158
|
+
};
|
|
159
|
+
readonly checksumSha3: string;
|
|
160
|
+
}>;
|
|
161
|
+
/**
|
|
162
|
+
* Retrieve document policies (compliance + lifecycle summary).
|
|
163
|
+
* Requires x-tenant-id header.
|
|
164
|
+
*/
|
|
165
|
+
getDocumentPolicies(documentId: string): Promise<DocumentPolicies>;
|
|
166
|
+
/**
|
|
167
|
+
* Update document retention/WORM/legal hold list atomically.
|
|
168
|
+
* Requires x-tenant-id header.
|
|
169
|
+
*/
|
|
170
|
+
updateDocumentPolicies(documentId: string, input: UpdatePoliciesRequest): Promise<DocumentPolicies>;
|
|
171
|
+
/**
|
|
172
|
+
* Apply a legal hold by id. Hold ids are caller-defined.
|
|
173
|
+
* Requires x-tenant-id header.
|
|
174
|
+
*/
|
|
175
|
+
applyLegalHold(documentId: string, request: ApplyLegalHoldRequest): Promise<{
|
|
176
|
+
readonly documentId: string;
|
|
177
|
+
readonly tenantId: string;
|
|
178
|
+
readonly legalHolds: readonly string[];
|
|
179
|
+
}>;
|
|
180
|
+
/**
|
|
181
|
+
* Release a legal hold by id.
|
|
182
|
+
* Requires x-tenant-id header.
|
|
183
|
+
*/
|
|
184
|
+
releaseLegalHold(documentId: string, holdId: string): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Schedule a lifecycle tier transition for a document.
|
|
187
|
+
* Requires x-tenant-id header.
|
|
188
|
+
*/
|
|
189
|
+
scheduleLifecycleTransition(documentId: string, request: ScheduleTransitionRequest): Promise<{
|
|
190
|
+
readonly documentId: string;
|
|
191
|
+
readonly tenantId: string;
|
|
192
|
+
readonly lifecycle: {
|
|
193
|
+
readonly currentTier?: "hot" | "warm" | "cold" | "frozen";
|
|
194
|
+
readonly targetTier?: "hot" | "warm" | "cold" | "frozen" | null;
|
|
195
|
+
readonly transitionAfter?: string | null;
|
|
196
|
+
};
|
|
197
|
+
}>;
|
|
198
|
+
private recordTelemetryEvent;
|
|
199
|
+
}
|
|
200
|
+
export * from "./events.js";
|
|
201
|
+
export * from "./observability.js";
|
|
202
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,sBAAsB,EACtB,4BAA4B,EAE5B,MAAM,oBAAoB,CAAC;AAG5B;;;;;GAKG;AAEH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,sBAAsB,GAAG,4BAA4B,CAAC;CAC3E;AASD,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,eAAe,CAAC,EAAE;QAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,YAAY,GAAG,IAAI,CAAC;QACnD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;KACxC,CAAC;CACF;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,QAAQ,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