@antasphere/chassis-sdk 0.0.0-stage → 1.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/LICENSE ADDED
@@ -0,0 +1,82 @@
1
+ # License
2
+
3
+ The Antasphere chassis
4
+ Copyright (c) 2026 Antasphere
5
+
6
+ The Antasphere chassis is made available by Antasphere, the licensor, under the "Sustainable Use License" as
7
+ defined below. All third party components incorporated into the Antasphere chassis are licensed under the
8
+ original license provided by the owner of the applicable component.
9
+
10
+ ## Sustainable Use License
11
+
12
+ Version 1.0
13
+
14
+ ### Acceptance
15
+
16
+ By using the software, you agree to all of the terms and conditions below.
17
+
18
+ ### Copyright License
19
+
20
+ The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license
21
+ to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject
22
+ to the limitations below.
23
+
24
+ ### Limitations
25
+
26
+ You may use or modify the software only for your own internal business purposes or for non-commercial or
27
+ personal use. You may distribute the software or provide it to others only if you do so free of charge for
28
+ non-commercial purposes. You may not alter, remove, or obscure any licensing, copyright, or other notices of
29
+ the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
30
+
31
+ ### Patents
32
+
33
+ The licensor grants you a license, under any patent claims the licensor can license, or becomes able to
34
+ license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case
35
+ subject to the limitations and conditions in this license. This license does not cover any patent claims that
36
+ you cause to be infringed by modifications or additions to the software. If you or your company make any
37
+ written claim that the software infringes or contributes to infringement of any patent, your patent license
38
+ for the software granted under these terms ends immediately. If your company makes such a claim, your patent
39
+ license ends immediately for work on behalf of your company.
40
+
41
+ ### Notices
42
+
43
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these
44
+ terms. If you modify the software, you must include in any modified copies of the software a prominent notice
45
+ stating that you have modified the software.
46
+
47
+ ### No Other Rights
48
+
49
+ These terms do not imply any licenses other than those expressly granted in these terms.
50
+
51
+ ### Termination
52
+
53
+ If you use the software in violation of these terms, such use is not licensed, and your license will
54
+ automatically terminate. If the licensor provides you with a notice of your violation, and you cease all
55
+ violation of this license no later than 30 days after you receive that notice, your license will be reinstated
56
+ retroactively. However, if you violate these terms after such reinstatement, any additional violation of these
57
+ terms will cause your license to terminate automatically and permanently.
58
+
59
+ ### No Liability
60
+
61
+ As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will
62
+ not be liable to you for any damages arising out of these terms or the use or nature of the software, under
63
+ any kind of legal claim.
64
+
65
+ ### Definitions
66
+
67
+ The “licensor” is the entity offering these terms.
68
+
69
+ The “software” is the software the licensor makes available under these terms, including any portion of it.
70
+
71
+ “You” refers to the individual or entity agreeing to these terms.
72
+
73
+ “Your company” is any legal entity, sole proprietorship, or other kind of organization that you work for, plus
74
+ all organizations that have control over, are under the control of, or are under common control with that
75
+ organization. Control means ownership of substantially all the assets of an entity, or the power to direct its
76
+ management and policies by vote, contract, or otherwise. Control can be direct or indirect.
77
+
78
+ “Your license” is the license granted to you for the software under these terms.
79
+
80
+ “Use” means anything you do with the software requiring your license.
81
+
82
+ “Trademark” means trademarks, service marks, and similar rights.
@@ -0,0 +1,363 @@
1
+ import type { ApiKeyCreateOf, ApiKeyCreatedOf, ApiKeyInfoOf, AuditEntry, AuditVia, BreakGlassClaimOwnership, BreakGlassClaimOwnershipRequest, BreakGlassResetTwoFactor, BreakGlassResetTwoFactorRequest, ChassisContract, CliAuthComplete, CliAuthCompletedOf, CliAuthRequest, CliAuthRequested, CliAuthRevoked, DefaultWorkspace, DemoPass, DemoPassesList, DemoPassMint, DemoPassMinted, DemoPassRedeemed, FileInfo, InstanceInfo, InvitationAccept, InvitationCreate, InvitationCreated, InvitationInfo, InvitationLookup, MeResponseOf, Member, MemberChangeEmailLink, MemberChangeEmailLinkRequest, MemberResetLink, MemberUpdate, OnboardingDismissed, Project, ProjectCreate, ProjectMember, ProjectMemberAdd, ProjectMembersList, ProjectPersonMember, ProjectRole, ProjectsArchivedFilter, ProjectsList, ProjectTeamMember, ProjectUpdate, SetupRequest, SetupResponse, SsoCliConnect, SsoLogoutResponse, Team, TeamCreate, TeamMemberAdd, TeamMemberInfo, TeamMembersList, TeamsList, TeamUpdate, WorkspaceCreated, WorkspaceLook, WorkspaceRole, WorkspaceUpdate, WorkspaceUpdated } from '@antasphere/chassis-contract';
2
+ /**
3
+ * The scope-carrying wire types, read off the chassis contract a tool instantiates
4
+ * with its own scopes: `ChassisClient<Scope>` types them exactly as the tool's own
5
+ * `ApiKeyInfo`, `MeResponse`… (same `z.infer` over the same `ChassisContract<Scope>`).
6
+ */
7
+ type ApiKeyInfo<TScope extends string> = ApiKeyInfoOf<ChassisContract<TScope>>;
8
+ type ApiKeyCreate<TScope extends string> = ApiKeyCreateOf<ChassisContract<TScope>>;
9
+ type ApiKeyCreated<TScope extends string> = ApiKeyCreatedOf<ChassisContract<TScope>>;
10
+ type CliAuthCompleted<TScope extends string> = CliAuthCompletedOf<ChassisContract<TScope>>;
11
+ type MeResponse<TScope extends string> = MeResponseOf<ChassisContract<TScope>>;
12
+ /**
13
+ * Thin typed client over /api/v1. Isomorphic: in the dashboard it rides the
14
+ * same-origin session cookie; in Node/CLI contexts pass an API key.
15
+ */
16
+ export declare class PlatformApiError extends Error {
17
+ readonly status: number;
18
+ readonly code: string;
19
+ readonly details?: unknown | undefined;
20
+ constructor(status: number, code: string, message: string, details?: unknown | undefined);
21
+ }
22
+ export interface ClientOptions {
23
+ /** Origin of the instance; '' (default) = same-origin (dashboard). */
24
+ baseUrl?: string;
25
+ /** API key (`<prefix>_<keyid>_<secret>`) for machine callers. */
26
+ apiKey?: string;
27
+ /**
28
+ * Active workspace for EVERY credential kind (sent as X-Workspace-Id —
29
+ * the user-scoped credential model): a caller in several workspaces names
30
+ * which one their requests target; absent, the user's default membership
31
+ * applies. Meaningful with the session cookie AND with user-scoped API
32
+ * keys/OAuth tokens; a PINNED key rejects a mismatching value server-side
33
+ * (403 workspace_mismatch). Mutable later via setWorkspace().
34
+ */
35
+ workspaceId?: string;
36
+ fetch?: typeof globalThis.fetch;
37
+ /**
38
+ * Deadline for the JSON API calls, in milliseconds (default 30 000; 0
39
+ * disables). Without one, a hung or throttling instance parks a CLI
40
+ * invocation — or a dashboard request — forever: `fetch` has no default
41
+ * timeout in Node or the browser.
42
+ */
43
+ timeoutMs?: number;
44
+ /**
45
+ * Deadline for the byte-streaming calls — a tool's assets, file content, the
46
+ * workspace export (default 600 000; 0 disables). Separate because it
47
+ * covers the whole body transfer, and an export is legitimately slow.
48
+ */
49
+ downloadTimeoutMs?: number;
50
+ /**
51
+ * Headers sent on EVERY call, merged in before the credential and the
52
+ * workspace are set (so they can never replace either). For a Node caller
53
+ * that holds a browser-style session: the CLI's owner-only commands send
54
+ * the session `cookie` and the `origin` the server checks, and no key.
55
+ */
56
+ headers?: Record<string, string>;
57
+ }
58
+ /** Cursor-pagination params shared by every list endpoint. */
59
+ export interface ListParams {
60
+ /** `nextCursor` from the previous page; omit for page 1. */
61
+ cursor?: string;
62
+ /** Page size (server default 50, max 100). */
63
+ limit?: number;
64
+ }
65
+ export interface AuditListResponse {
66
+ entries: AuditEntry[];
67
+ nextCursor: string | null;
68
+ /** How many entries match in all; counted on the first page only, null after it. */
69
+ total: number | null;
70
+ }
71
+ /** Cursor pagination + the audit log's filters (every one optional, combined with AND). */
72
+ export interface AuditListParams extends ListParams {
73
+ /** Free text, matched case-insensitively against the actor's email and the action. */
74
+ q?: string;
75
+ /** Actions or families: an item ending in `.` matches the family (`apikey.`). */
76
+ action?: string[];
77
+ /** How the actor authenticated. */
78
+ actorVia?: AuditVia[];
79
+ /** One user id, or `system` for the rows nobody signed. */
80
+ actor?: string;
81
+ resourceType?: string;
82
+ resourceId?: string;
83
+ /** ISO datetime: entries created at or after this instant. */
84
+ from?: string;
85
+ /** ISO datetime: entries created at or before this instant. */
86
+ to?: string;
87
+ }
88
+ export interface InvitationAccepted {
89
+ workspaceId: string;
90
+ userId: string;
91
+ role: WorkspaceRole;
92
+ }
93
+ export interface FileUploaded {
94
+ file: FileInfo;
95
+ deduplicated: boolean;
96
+ }
97
+ /**
98
+ * Options for the non-idempotent create calls. Setting `idempotencyKey`
99
+ * (any client-chosen string ≤200 chars, e.g. a UUID) makes a retried create
100
+ * replay the original response instead of double-creating (docs/security/security.md).
101
+ */
102
+ export interface IdempotentRequestOptions {
103
+ idempotencyKey?: string;
104
+ }
105
+ export declare function idempotencyHeader(opts: IdempotentRequestOptions): Record<string, string> | undefined;
106
+ /** Default deadline for the JSON API calls (ms). */
107
+ export declare const DEFAULT_TIMEOUT_MS = 30000;
108
+ /** Default deadline for the streaming download calls (ms). */
109
+ export declare const DEFAULT_DOWNLOAD_TIMEOUT_MS = 600000;
110
+ export declare class ChassisClient<TScope extends string> {
111
+ protected readonly baseUrl: string;
112
+ private readonly apiKey;
113
+ private workspaceId;
114
+ protected readonly fetchImpl: typeof globalThis.fetch;
115
+ private readonly timeoutMs;
116
+ private readonly downloadTimeoutMs;
117
+ private readonly extraHeaders;
118
+ constructor(options?: ClientOptions);
119
+ /**
120
+ * The abort signal every call carries. `fetch` never times out on its
121
+ * own, so a silent peer (or a hostile one holding the socket open) would
122
+ * otherwise hang the caller indefinitely.
123
+ */
124
+ protected signal(kind: 'api' | 'download'): AbortSignal | undefined;
125
+ /** Set (or clear) the active workspace all subsequent requests target. */
126
+ setWorkspace(workspaceId: string | null): void;
127
+ /** Base headers shared by every call: the caller's own, then credential + active workspace. */
128
+ protected baseHeaders(): Record<string, string>;
129
+ protected parse<T>(res: Response): Promise<T>;
130
+ /** Append cursor-pagination params to a list path. */
131
+ protected pathWithQuery(base: string, params: ListParams, extra?: Record<string, string | undefined>): string;
132
+ protected request<T>(method: string, path: string, body?: unknown, extraHeaders?: Record<string, string>): Promise<T>;
133
+ instance(): Promise<InstanceInfo>;
134
+ setup(req: SetupRequest): Promise<SetupResponse>;
135
+ me(): Promise<MeResponse<TScope>>;
136
+ /**
137
+ * CLOUD EDITION only (404 on oss); sessions only (machines 403): record
138
+ * the explicit first-run-welcome dismissal — flips /me's
139
+ * `firstRunPending` to false, permanently. Idempotent.
140
+ */
141
+ dismissOnboarding(): Promise<OnboardingDismissed>;
142
+ /**
143
+ * Choose the workspace a request naming none resolves to, or clear the
144
+ * choice with `null` (the oldest active membership answers again). The
145
+ * person's own setting, open to their keys under the write scope; a key
146
+ * pinned to one workspace answers 403 `key_pinned`. On the cloud edition
147
+ * the default is set on the account site: 403 `hub_managed` with
148
+ * `details.manageUrl`. 404 for a workspace the caller is no active member of.
149
+ */
150
+ setDefaultWorkspace(workspaceId: string | null): Promise<DefaultWorkspace>;
151
+ /**
152
+ * Create ANOTHER workspace with the caller as its owner. Sessions only
153
+ * (API keys and OAuth bearers answer 403); offer it only while `/me`'s
154
+ * `canCreateWorkspace` is true. Self-hosted creates it locally under the
155
+ * operator's per-person cap; cloud creates the organization at Antasphere
156
+ * as the caller. Either way `workspace.id` is the id to pass as
157
+ * `X-Workspace-Id` (`setWorkspace`). Refusals (403 unless noted):
158
+ * `session_required`, `guest_forbidden`, `workspace_creation_disabled`,
159
+ * `workspace_limit_reached`, `hub_link_required`, `hub_unavailable`,
160
+ * `hub_refused`, 401 `hub_grant_expired`, 401 `hub_reauth_required` (both
161
+ * healed by signing in again), 400 `validation_error`, 429 `rate_limited`.
162
+ */
163
+ createWorkspace(name: string, opts?: IdempotentRequestOptions & {
164
+ look?: Partial<WorkspaceLook>;
165
+ }): Promise<WorkspaceCreated>;
166
+ /**
167
+ * PATCH /workspace — the ACTIVE workspace's name and look (owner/admin,
168
+ * sessions only). A rename of a hub-origin workspace answers 403
169
+ * `hub_managed` with `details.manageUrl`; its look is accepted.
170
+ */
171
+ updateWorkspace(body: WorkspaceUpdate): Promise<WorkspaceUpdated>;
172
+ /** Better Auth session probe — null when signed out. */
173
+ session(): Promise<{
174
+ user: {
175
+ id: string;
176
+ email: string;
177
+ name: string;
178
+ };
179
+ } | null>;
180
+ signInEmail(email: string, password: string): Promise<{
181
+ user: {
182
+ id: string;
183
+ };
184
+ }>;
185
+ signOut(): Promise<void>;
186
+ /** Public: email a sign-in code. Generic success — silent about account existence. */
187
+ cliAuthRequest(req: CliAuthRequest): Promise<CliAuthRequested>;
188
+ /**
189
+ * Public: verify the code and mint an API key (the tool's read + write
190
+ * scopes). The returned `key` appears only here.
191
+ */
192
+ cliAuthComplete(req: CliAuthComplete): Promise<CliAuthCompleted<TScope>>;
193
+ /**
194
+ * Revoke the PRESENTING API key (CLI logout). Self-revocation only: the
195
+ * route names no key, so the credential can kill exactly itself. Requires
196
+ * an API-key credential with the tool's write scope (sessions and OAuth
197
+ * bearers are refused — the dashboard is their key-management surface).
198
+ */
199
+ cliAuthRevoke(): Promise<CliAuthRevoked>;
200
+ /**
201
+ * Public, CLOUD EDITION only (404 on oss): exchange a hub-minted 120 s
202
+ * connect JWT (the hub's /sso/tool-token response) for an API key
203
+ * bound to the projected workspace — same grant and one-shot response
204
+ * shape as cliAuthComplete. Each token works exactly once (jti).
205
+ */
206
+ ssoCliConnect(req: SsoCliConnect): Promise<CliAuthCompleted<TScope>>;
207
+ /**
208
+ * CLOUD EDITION only (404 on oss); sessions only (machines 403 — the
209
+ * path is unlisted in the scope allowlist): single logout. The server
210
+ * revokes the local session and clears the SSO hint cookie in this very
211
+ * response; `url` is the hub end-session URL the browser must then VISIT
212
+ * to end the hub anchor session (null = local signout only — go straight
213
+ * to /login?signed_out=1).
214
+ */
215
+ ssoLogout(): Promise<SsoLogoutResponse>;
216
+ members(params?: ListParams): Promise<{
217
+ members: Member[];
218
+ nextCursor: string | null;
219
+ }>;
220
+ updateMember(id: string, patch: MemberUpdate): Promise<Member>;
221
+ /**
222
+ * Admin: delete a member's account (GDPR erasure). Sessions only — the
223
+ * endpoint is unlisted in the machine scope allowlist, so API keys 403.
224
+ * Files the member uploaded stay with the workspace.
225
+ */
226
+ deleteMember(id: string): Promise<Member>;
227
+ /**
228
+ * Remove a member from the workspace (admin+, sessions only): the
229
+ * membership is switched off and their project grants and team seats are
230
+ * deleted; the account stays. Invited back, the person starts with none.
231
+ * Refused `hub_managed` on a hub-origin workspace (removal is the hub's).
232
+ */
233
+ removeMember(id: string): Promise<Member>;
234
+ /**
235
+ * Owner: mint a one-time password reset link for a member (SMTP-free
236
+ * recovery). Refused for a per-resource guest and for anyone who also belongs
237
+ * to another workspace — the minted credential is global (PRDCT-1354).
238
+ */
239
+ createMemberResetLink(id: string, opts?: IdempotentRequestOptions): Promise<MemberResetLink>;
240
+ /**
241
+ * Owner: mint a one-time email change link for a member (SMTP-free email
242
+ * change). ⚠️ The link updates the email AND signs the member in — share
243
+ * it with the target member only. Same refusals as the reset link (guest
244
+ * targets, cross-workspace targets), plus the cloud edition closure.
245
+ */
246
+ createMemberChangeEmailLink(id: string, req: MemberChangeEmailLinkRequest, opts?: IdempotentRequestOptions): Promise<MemberChangeEmailLink>;
247
+ /** The caller's projects (every project for a workspace owner or admin). `archived`: `false` by default. */
248
+ projects(params?: ListParams & {
249
+ archived?: ProjectsArchivedFilter;
250
+ }): Promise<ProjectsList>;
251
+ /** The caller becomes the project's first manager. */
252
+ createProject(req: ProjectCreate, opts?: IdempotentRequestOptions): Promise<Project>;
253
+ project(id: string): Promise<Project>;
254
+ updateProject(id: string, patch: ProjectUpdate): Promise<Project>;
255
+ archiveProject(id: string): Promise<Project>;
256
+ unarchiveProject(id: string): Promise<Project>;
257
+ projectMembers(id: string, params?: ListParams): Promise<ProjectMembersList>;
258
+ /**
259
+ * Adds one of the workspace's own active members, by user id or by email,
260
+ * or one of its teams by `teamId`: exactly one of the three. A team entry
261
+ * gives every member of the team the role.
262
+ */
263
+ addProjectMember(id: string, req: ProjectMemberAdd, opts?: IdempotentRequestOptions): Promise<ProjectMember>;
264
+ setProjectMemberRole(id: string, userId: string, role: ProjectRole): Promise<ProjectPersonMember>;
265
+ /** A manager removes anyone; any member removes themselves. */
266
+ removeProjectMember(id: string, userId: string): Promise<ProjectPersonMember>;
267
+ /** Changes the role a team holds on a project (manager). */
268
+ setProjectTeamRole(projectId: string, teamId: string, role: ProjectRole): Promise<ProjectTeamMember>;
269
+ /** Removes a team from a project (manager); its people keep their own entries. */
270
+ removeProjectTeam(projectId: string, teamId: string): Promise<ProjectTeamMember>;
271
+ /** The workspace's teams, newest first. */
272
+ teams(params?: ListParams): Promise<TeamsList>;
273
+ team(id: string): Promise<Team>;
274
+ /** Owner or admin. The slug is derived from the name when absent. */
275
+ createTeam(req: TeamCreate, opts?: IdempotentRequestOptions): Promise<Team>;
276
+ updateTeam(id: string, patch: TeamUpdate): Promise<Team>;
277
+ /** The memberships stay; answers the team's final snapshot. */
278
+ deleteTeam(id: string): Promise<Team>;
279
+ teamMembers(id: string, params?: ListParams): Promise<TeamMembersList>;
280
+ /** Seats one of the workspace's own active members, by user id or by email. */
281
+ addTeamMember(id: string, req: TeamMemberAdd, opts?: IdempotentRequestOptions): Promise<TeamMemberInfo>;
282
+ /** Unseats a member; the workspace membership stays. */
283
+ removeTeamMember(id: string, userId: string): Promise<TeamMemberInfo>;
284
+ /** Owner: the workspace's passes, newest first. Never carries a secret. */
285
+ demoPasses(): Promise<DemoPassesList>;
286
+ /**
287
+ * Owner: mint a pass for a member by address. The `secret` and the `url`
288
+ * (`<instance>/demo#pass=…&to=…`) appear in this answer only. Refusals, in
289
+ * this order: 404 `no_such_member`, 403 `owner_target`,
290
+ * `demo_address_required`, `two_factor_enrolled`, `guest_target`,
291
+ * `cross_workspace_target`, then 400 `invalid_demo_path` or
292
+ * `validation_error` (a lifetime outside 1 to 10080 minutes).
293
+ */
294
+ mintDemoPass(req: DemoPassMint): Promise<DemoPassMinted>;
295
+ /** Owner: revoke a pass; revoking a revoked pass answers it again. */
296
+ revokeDemoPass(id: string): Promise<DemoPass>;
297
+ /**
298
+ * Anyone holding a pass's secret: sign in as its person. Served by the
299
+ * sign-in library (like `signInEmail`, no route contract), which sets the
300
+ * session cookie on this very answer; in a browser, call it same-origin.
301
+ * Every refusal of a pass is one 401 `invalid_demo_pass`, whatever the
302
+ * reason; 429 `rate_limited` past 20 REFUSED tries in 15 minutes from one address.
303
+ */
304
+ redeemDemoPass(secret: string): Promise<DemoPassRedeemed>;
305
+ /**
306
+ * Superadmin: make the caller (or a named existing user) an ACTIVE OWNER
307
+ * of the workspace — creating, reactivating, or promoting the membership.
308
+ * Adds an owner, never removes one. Sessions only: the endpoint is
309
+ * unlisted in the machine scope allowlist (API keys/tokens 403), and the
310
+ * calling session's VERIFIED email must be on SUPERADMIN_EMAILS.
311
+ */
312
+ breakGlassClaimOwnership(req?: BreakGlassClaimOwnershipRequest): Promise<BreakGlassClaimOwnership>;
313
+ /** Superadmin: clear a locked-out user's 2FA (sessions only, audited). */
314
+ breakGlassResetTwoFactor(req: BreakGlassResetTwoFactorRequest): Promise<BreakGlassResetTwoFactor>;
315
+ apiKeys(params?: ListParams): Promise<{
316
+ apiKeys: ApiKeyInfo<TScope>[];
317
+ nextCursor: string | null;
318
+ }>;
319
+ /** The returned `key` is the full secret — shown once, never retrievable. */
320
+ createApiKey(req: ApiKeyCreate<TScope>, opts?: IdempotentRequestOptions): Promise<ApiKeyCreated<TScope>>;
321
+ revokeApiKey(id: string): Promise<ApiKeyInfo<TScope>>;
322
+ invitations(params?: ListParams): Promise<{
323
+ invitations: InvitationInfo[];
324
+ nextCursor: string | null;
325
+ }>;
326
+ /** `acceptUrl` is always returned — email delivery is best-effort on top. */
327
+ createInvitation(req: InvitationCreate, opts?: IdempotentRequestOptions): Promise<InvitationCreated>;
328
+ revokeInvitation(id: string): Promise<InvitationInfo>;
329
+ /** Public: resolves an invitation token for the acceptance page. */
330
+ lookupInvitation(token: string): Promise<InvitationLookup>;
331
+ /** Public: accepts an invitation (creates the account when needed). */
332
+ acceptInvitation(req: InvitationAccept): Promise<InvitationAccepted>;
333
+ audit(params?: AuditListParams): Promise<AuditListResponse>;
334
+ files(params?: ListParams): Promise<{
335
+ files: FileInfo[];
336
+ nextCursor: string | null;
337
+ }>;
338
+ /** Uploads raw bytes; the filename travels as a query param. */
339
+ uploadFile(name: string, body: Blob | ArrayBuffer | Uint8Array, contentType?: string): Promise<FileUploaded>;
340
+ deleteFile(id: string): Promise<FileInfo>;
341
+ file(id: string): Promise<FileInfo>;
342
+ /** URL of the streamed (Range-capable) content endpoint for a file. */
343
+ fileContentUrl(id: string): string;
344
+ /**
345
+ * Downloads a file's bytes with the client's own headers (credential and
346
+ * active workspace). Raw Response so callers can stream it; a non-2xx
347
+ * answer throws PlatformApiError like every other method. A browser anchor
348
+ * on `fileContentUrl` cannot carry `X-Workspace-Id` (PRDCT-2426).
349
+ */
350
+ downloadFileContent(id: string): Promise<Response>;
351
+ /** The shared body of the streamed-download methods (the asset download's shape). */
352
+ protected rawDownload(url: string): Promise<Response>;
353
+ /** URL of the workspace export endpoint (admin+; keys need the tool's export scope). */
354
+ workspaceExportUrl(): string;
355
+ /**
356
+ * Downloads the full workspace export. Returns the raw Response so callers
357
+ * can stream the zip (exports can be large — never buffer by default);
358
+ * a non-2xx answer throws PlatformApiError like every other method.
359
+ */
360
+ downloadExport(): Promise<Response>;
361
+ }
362
+ export {};
363
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,wBAAwB,EACxB,+BAA+B,EAC/B,wBAAwB,EACxB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,qBAAqB,EACrB,4BAA4B,EAC5B,eAAe,EACf,YAAY,EACZ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