@stackshift-cloud/sdk 1.0.0 → 1.1.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/README.md CHANGED
@@ -218,6 +218,66 @@ export class AssetsService {
218
218
  }
219
219
  ```
220
220
 
221
+ ## Storage connections and migrations
222
+
223
+ Use AWS AssumeRole for S3 whenever possible. The returned `external_id` belongs in the role trust policy; credentials are write-only and are never returned by Stackshift.
224
+
225
+ ```ts
226
+ const connection = await stackshift.assets.connections.create({
227
+ provider: 'aws_s3',
228
+ name: 'Production media',
229
+ configuration: {
230
+ bucket: 'acme-media',
231
+ region: 'us-east-1',
232
+ role_arn: 'arn:aws:iam::123456789012:role/StackshiftAssets',
233
+ auth_type: 'assume_role',
234
+ },
235
+ })
236
+
237
+ await stackshift.assets.connections.verify(connection.id)
238
+
239
+ const dryRun = await stackshift.assets.migrations.start({
240
+ source_connection_id: connection.id,
241
+ destination_bucket_id: 'assets_bucket_id',
242
+ source_prefix: 'legacy',
243
+ conflict_policy: 'skip',
244
+ dry_run: true,
245
+ })
246
+
247
+ const report = await stackshift.assets.migrations.downloadReport(dryRun.id, 'csv')
248
+ ```
249
+
250
+ Native Stackshift S2 storage uses a bucket reference and internal authorization, never copied S2 access keys:
251
+
252
+ ```ts
253
+ const s2 = await stackshift.assets.storage.createS2Bucket({ name: 'asset-originals', region: 'us-east-1' })
254
+ await stackshift.assets.storage.configure('assets_bucket_id', 3, {
255
+ storage_mode: 'stackshift_s2',
256
+ s2_bucket_id: s2.id,
257
+ object_prefix: 'originals',
258
+ derivative_prefix: 'derived',
259
+ auto_extract_text: true,
260
+ })
261
+ ```
262
+
263
+ ## OCR and browser upload capabilities
264
+
265
+ ```ts
266
+ const extraction = await stackshift.assets.text.start('asset_id', { language: 'eng' })
267
+ const current = await stackshift.assets.text.get('asset_id')
268
+
269
+ const capability = await stackshift.assets.uploadCapabilities.create({
270
+ bucket: 'uploads',
271
+ key_prefix: 'customers/user_123',
272
+ allowed_mime_types: ['image/png', 'image/jpeg'],
273
+ allowed_origins: ['https://app.example.com'],
274
+ max_bytes: 25 * 1024 * 1024,
275
+ expires_in: '15m',
276
+ })
277
+ ```
278
+
279
+ Create capabilities only in trusted backend code. Send `capability.token` to `@stackshift/assets-widget`; never put the Stackshift API key in a browser bundle.
280
+
221
281
  For larger uploads, create a signed upload URL on your NestJS server and let the browser upload directly.
222
282
 
223
283
  ## Direct browser uploads
@@ -0,0 +1,65 @@
1
+ export type AssetMediaKind = 'image' | 'video';
2
+ export type AssetTransformOutputKind = 'image' | 'video' | 'audio' | 'thumbnail';
3
+ export type AssetAnimationPolicy = 'first' | 'preserve' | 'reject';
4
+ export interface AssetTransformOperation {
5
+ type: 'crop' | 'resize' | 'rotate' | 'blur' | 'radius' | 'dpr' | 'background' | 'overlay' | 'trim' | 'fps' | 'timestamp';
6
+ mode?: 'explicit' | 'fit' | 'fill' | 'pad';
7
+ gravity?: 'northwest' | 'north' | 'northeast' | 'west' | 'centre' | 'east' | 'southwest' | 'south' | 'southeast';
8
+ width?: number;
9
+ height?: number;
10
+ x?: number;
11
+ y?: number;
12
+ degrees?: number;
13
+ sigma?: number;
14
+ radius?: number;
15
+ dpr?: number;
16
+ color?: string;
17
+ asset_id?: string;
18
+ opacity?: number;
19
+ start_seconds?: number;
20
+ end_seconds?: number;
21
+ fps?: number;
22
+ timestamp_seconds?: number;
23
+ }
24
+ export interface AssetTransformDefinition {
25
+ version: 2;
26
+ media_kind: AssetMediaKind;
27
+ animation?: AssetAnimationPolicy;
28
+ operations: AssetTransformOperation[];
29
+ output: {
30
+ kind: AssetTransformOutputKind;
31
+ format: 'jpeg' | 'png' | 'webp' | 'avif' | 'mp4' | 'mp3' | 'aac' | 'wav';
32
+ quality?: number;
33
+ };
34
+ }
35
+ export type AssetTransformMaterializeInput = {
36
+ definition: AssetTransformDefinition;
37
+ preset?: never;
38
+ } | {
39
+ preset: string;
40
+ definition?: never;
41
+ };
42
+ export interface AssetDerivedAsset {
43
+ id: string;
44
+ asset_id: string;
45
+ source_checksum_sha256: string;
46
+ transform_hash: string;
47
+ normalized_spec: string;
48
+ definition_version: number;
49
+ output_kind: AssetTransformOutputKind;
50
+ dependency_checksum_sha256?: string;
51
+ processor_revision: string;
52
+ mime_type: string;
53
+ size: number;
54
+ status: string;
55
+ created_at: string;
56
+ updated_at: string;
57
+ last_accessed_at?: string;
58
+ }
59
+ export interface AssetImageGenerationInput {
60
+ prompt: string;
61
+ size: string;
62
+ format: 'png' | 'jpeg' | 'webp';
63
+ bucket: string;
64
+ key?: string;
65
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,269 @@
1
+ import type { StackShift } from './client.js';
2
+ export interface AssetWorkflowDefinition {
3
+ version: 1;
4
+ nodes: AssetWorkflowNode[];
5
+ edges: AssetWorkflowEdge[];
6
+ }
7
+ export interface AssetWorkflowNode {
8
+ id: string;
9
+ type: string;
10
+ action?: string;
11
+ action_version?: string;
12
+ config?: Record<string, unknown>;
13
+ retry?: {
14
+ max_attempts?: number;
15
+ backoff_seconds?: number;
16
+ };
17
+ timeout_seconds?: number;
18
+ failure_policy?: string;
19
+ }
20
+ export interface AssetWorkflowEdge {
21
+ id: string;
22
+ source: string;
23
+ source_port?: string;
24
+ target: string;
25
+ target_port?: string;
26
+ }
27
+ export interface AssetWorkflowLayout {
28
+ nodes: Array<{
29
+ id: string;
30
+ x: number;
31
+ y: number;
32
+ width?: number;
33
+ height?: number;
34
+ }>;
35
+ viewport: {
36
+ x: number;
37
+ y: number;
38
+ zoom: number;
39
+ };
40
+ groups?: Array<{
41
+ id: string;
42
+ label: string;
43
+ node_ids: string[];
44
+ }>;
45
+ }
46
+ export interface AssetWorkflow {
47
+ id: string;
48
+ name: string;
49
+ description?: string;
50
+ status: 'draft' | 'active' | 'disabled';
51
+ revision: number;
52
+ execution_principal_id: string;
53
+ draft_definition: AssetWorkflowDefinition;
54
+ draft_layout: AssetWorkflowLayout;
55
+ current_version_id?: string;
56
+ active_version_id?: string;
57
+ created_at: string;
58
+ updated_at: string;
59
+ }
60
+ export interface AssetWorkflowVersion {
61
+ id: string;
62
+ workflow_id: string;
63
+ version: number;
64
+ semantic_digest: string;
65
+ definition: AssetWorkflowDefinition;
66
+ layout: AssetWorkflowLayout;
67
+ created_by: string;
68
+ created_at: string;
69
+ }
70
+ export interface AssetWorkflowRun {
71
+ id: string;
72
+ workflow_id: string;
73
+ version_id: string;
74
+ durable_run_id?: string;
75
+ trigger_type: string;
76
+ trigger_key?: string;
77
+ status: 'queued' | 'running' | 'waiting' | 'completed' | 'completed_with_warning' | 'failed' | 'canceled';
78
+ input: unknown;
79
+ output?: unknown;
80
+ error?: unknown;
81
+ started_at?: string;
82
+ completed_at?: string;
83
+ created_at: string;
84
+ updated_at: string;
85
+ }
86
+ export interface AssetWorkflowNodeExecution {
87
+ id: string;
88
+ run_id: string;
89
+ node_id: string;
90
+ node_type: string;
91
+ status: string;
92
+ attempt: number;
93
+ input?: unknown;
94
+ output?: unknown;
95
+ error?: unknown;
96
+ selected_ports: string[];
97
+ wait_event?: string;
98
+ wait_correlation?: string;
99
+ wait_until?: string;
100
+ started_at?: string;
101
+ completed_at?: string;
102
+ stackie_activity?: Array<Record<string, unknown>>;
103
+ }
104
+ export interface AssetWorkflowValidation {
105
+ valid: boolean;
106
+ semantic_digest?: string;
107
+ definition: AssetWorkflowDefinition;
108
+ issues: Array<{
109
+ code: string;
110
+ message: string;
111
+ node_id?: string;
112
+ edge_id?: string;
113
+ }>;
114
+ }
115
+ export interface AssetWorkflowNodeDefinition {
116
+ type: string;
117
+ version: string;
118
+ name: string;
119
+ category: string;
120
+ description: string;
121
+ input_ports: Array<{
122
+ name: string;
123
+ data_type: string;
124
+ required?: boolean;
125
+ }>;
126
+ output_ports: Array<{
127
+ name: string;
128
+ data_type: string;
129
+ required?: boolean;
130
+ }>;
131
+ config_schema: Record<string, unknown>;
132
+ risk: 'read' | 'reversible' | 'costly' | 'production' | 'external';
133
+ requires_approval: boolean;
134
+ approval_mode: 'none' | 'version' | 'per_run';
135
+ }
136
+ export interface AssetWorkflowTemplate {
137
+ key: string;
138
+ name: string;
139
+ description: string;
140
+ definition: AssetWorkflowDefinition;
141
+ layout: AssetWorkflowLayout;
142
+ valid: boolean;
143
+ issues: AssetWorkflowValidation['issues'];
144
+ }
145
+ export interface AssetWorkflowApproval {
146
+ id: string;
147
+ workflow_id: string;
148
+ version_id: string;
149
+ run_id?: string;
150
+ node_id?: string;
151
+ approval_mode: 'version' | 'per_run';
152
+ semantic_digest: string;
153
+ status: 'pending' | 'approved' | 'rejected';
154
+ risk_summary: unknown;
155
+ constraints: unknown;
156
+ requested_by: string;
157
+ decided_by?: string;
158
+ decision_reason?: string;
159
+ expires_at?: string;
160
+ created_at: string;
161
+ updated_at: string;
162
+ }
163
+ export interface AssetWorkflowHTTPConnection {
164
+ id?: string;
165
+ name: string;
166
+ host: string;
167
+ allowed_path_prefixes: string[];
168
+ credential_reference?: string;
169
+ credential?: AssetWorkflowHTTPCredentialInput;
170
+ default_headers: Record<string, string>;
171
+ revision?: number;
172
+ created_at?: string;
173
+ updated_at?: string;
174
+ }
175
+ export interface AssetWorkflowHTTPCredentialInput {
176
+ name: string;
177
+ header: string;
178
+ prefix?: string;
179
+ value: string;
180
+ }
181
+ export interface AssetAutomationOverview {
182
+ mcp_endpoint: '/api/v1/assets/mcp';
183
+ auth_method: 'pat';
184
+ tools: Array<{
185
+ name: string;
186
+ description: string;
187
+ required_scope: string;
188
+ required_scopes?: string[];
189
+ risk: string;
190
+ }>;
191
+ recent_executions: Array<{
192
+ id: string;
193
+ tool: string;
194
+ transport: string;
195
+ status: string;
196
+ created_at: string;
197
+ }>;
198
+ }
199
+ export declare class AssetWorkflowsClient {
200
+ private readonly client;
201
+ constructor(client: StackShift);
202
+ catalog(): Promise<{
203
+ nodes: AssetWorkflowNodeDefinition[];
204
+ templates: AssetWorkflowTemplate[];
205
+ }>;
206
+ create(input: {
207
+ name: string;
208
+ description?: string;
209
+ template_key?: string;
210
+ definition?: AssetWorkflowDefinition;
211
+ layout?: AssetWorkflowLayout;
212
+ }): Promise<AssetWorkflow>;
213
+ list(page?: number, perPage?: number): Promise<AssetWorkflow[]>;
214
+ get(workflowId: string): Promise<AssetWorkflow>;
215
+ updateDraft(workflowId: string, input: {
216
+ name: string;
217
+ description?: string;
218
+ definition: AssetWorkflowDefinition;
219
+ layout: AssetWorkflowLayout;
220
+ expected_revision: number;
221
+ }): Promise<AssetWorkflow>;
222
+ validate(workflowId: string): Promise<AssetWorkflowValidation>;
223
+ publish(workflowId: string, expectedRevision: number): Promise<AssetWorkflowVersion>;
224
+ activate(workflowId: string, versionId: string, expectedRevision: number): Promise<void>;
225
+ versions(workflowId: string): Promise<AssetWorkflowVersion[]>;
226
+ run(workflowId: string, input?: {
227
+ version_id?: string;
228
+ input?: unknown;
229
+ idempotency_key?: string;
230
+ }): Promise<AssetWorkflowRun>;
231
+ runs(workflowId: string, page?: number, perPage?: number): Promise<AssetWorkflowRun[]>;
232
+ runDetail(runId: string): Promise<{
233
+ run: AssetWorkflowRun;
234
+ nodes: AssetWorkflowNodeExecution[];
235
+ }>;
236
+ cancelRun(runId: string): Promise<AssetWorkflowRun>;
237
+ retryRun(runId: string): Promise<AssetWorkflowRun>;
238
+ approvals(status?: AssetWorkflowApproval['status']): Promise<AssetWorkflowApproval[]>;
239
+ decideApproval(approvalId: string, approved: boolean, input?: {
240
+ reason?: string;
241
+ expires_at?: string;
242
+ }): Promise<AssetWorkflowApproval>;
243
+ approve(approvalId: string, input?: {
244
+ reason?: string;
245
+ expires_at?: string;
246
+ }): Promise<AssetWorkflowApproval>;
247
+ reject(approvalId: string, input?: {
248
+ reason?: string;
249
+ }): Promise<AssetWorkflowApproval>;
250
+ connections(): Promise<AssetWorkflowHTTPConnection[]>;
251
+ createConnection(input: AssetWorkflowHTTPConnection): Promise<AssetWorkflowHTTPConnection>;
252
+ rotateConnectionCredential(connectionId: string, input: AssetWorkflowHTTPCredentialInput): Promise<{
253
+ id: string;
254
+ name: string;
255
+ header: string;
256
+ prefix?: string;
257
+ revision: number;
258
+ }>;
259
+ rotateInboundHook(workflowId: string): Promise<{
260
+ hook: {
261
+ id: string;
262
+ workflow_id: string;
263
+ secret_version: number;
264
+ enabled: boolean;
265
+ };
266
+ token: string;
267
+ secret: string;
268
+ }>;
269
+ }
@@ -0,0 +1,69 @@
1
+ export class AssetWorkflowsClient {
2
+ client;
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ catalog() {
7
+ return this.client.request('/assets/workflows/catalog');
8
+ }
9
+ create(input) {
10
+ return this.client.request('/assets/workflows', { method: 'POST', body: input });
11
+ }
12
+ list(page = 1, perPage = 20) {
13
+ return this.client.request(`/assets/workflows?page=${page}&per_page=${perPage}`);
14
+ }
15
+ get(workflowId) { return this.client.request(`/assets/workflows/${encodeURIComponent(workflowId)}`); }
16
+ updateDraft(workflowId, input) {
17
+ return this.client.request(`/assets/workflows/${encodeURIComponent(workflowId)}/draft`, { method: 'PUT', body: input });
18
+ }
19
+ validate(workflowId) {
20
+ return this.client.request(`/assets/workflows/${encodeURIComponent(workflowId)}/validate`, { method: 'POST' });
21
+ }
22
+ publish(workflowId, expectedRevision) {
23
+ return this.client.request(`/assets/workflows/${encodeURIComponent(workflowId)}/publish`, { method: 'POST', body: { expected_revision: expectedRevision } });
24
+ }
25
+ activate(workflowId, versionId, expectedRevision) {
26
+ return this.client.request(`/assets/workflows/${encodeURIComponent(workflowId)}/activate`, { method: 'POST', body: { version_id: versionId, expected_revision: expectedRevision } });
27
+ }
28
+ versions(workflowId) { return this.client.request(`/assets/workflows/${encodeURIComponent(workflowId)}/versions`); }
29
+ run(workflowId, input = {}) {
30
+ return this.client.request(`/assets/workflows/${encodeURIComponent(workflowId)}/run`, {
31
+ method: 'POST', body: input,
32
+ headers: input.idempotency_key ? { 'Idempotency-Key': input.idempotency_key } : undefined,
33
+ });
34
+ }
35
+ runs(workflowId, page = 1, perPage = 20) {
36
+ return this.client.request(`/assets/workflows/${encodeURIComponent(workflowId)}/runs?page=${page}&per_page=${perPage}`);
37
+ }
38
+ runDetail(runId) {
39
+ return this.client.request(`/assets/workflows/runs/${encodeURIComponent(runId)}`);
40
+ }
41
+ cancelRun(runId) {
42
+ return this.client.request(`/assets/workflows/runs/${encodeURIComponent(runId)}/cancel`, { method: 'POST' });
43
+ }
44
+ retryRun(runId) {
45
+ return this.client.request(`/assets/workflows/runs/${encodeURIComponent(runId)}/retry`, { method: 'POST' });
46
+ }
47
+ approvals(status) {
48
+ if (status)
49
+ return this.client.request(`/assets/workflows/approvals?status=${encodeURIComponent(status)}`);
50
+ return this.client.request('/assets/workflows/approvals');
51
+ }
52
+ decideApproval(approvalId, approved, input = {}) {
53
+ return approved ? this.approve(approvalId, input) : this.reject(approvalId, input);
54
+ }
55
+ approve(approvalId, input = {}) {
56
+ return this.client.request(`/assets/workflows/approvals/${encodeURIComponent(approvalId)}/approve`, { method: 'POST', body: input });
57
+ }
58
+ reject(approvalId, input = {}) {
59
+ return this.client.request(`/assets/workflows/approvals/${encodeURIComponent(approvalId)}/reject`, { method: 'POST', body: input });
60
+ }
61
+ connections() { return this.client.request('/assets/workflows/connections'); }
62
+ createConnection(input) { return this.client.request('/assets/workflows/connections', { method: 'POST', body: input }); }
63
+ rotateConnectionCredential(connectionId, input) {
64
+ return this.client.request(`/assets/workflows/connections/${encodeURIComponent(connectionId)}/credential/rotate`, { method: 'POST', body: input });
65
+ }
66
+ rotateInboundHook(workflowId) {
67
+ return this.client.request(`/assets/workflows/${encodeURIComponent(workflowId)}/inbound-hook/rotate`, { method: 'POST' });
68
+ }
69
+ }
@@ -0,0 +1,218 @@
1
+ import type { Asset, AssetBucket, JsonValue } from './types.js';
2
+ export type AssetConnectionProvider = 'aws_s3' | 'r2' | 'wasabi' | 'minio' | 's3' | 'stackshift_s2' | 'cloudinary';
3
+ export type AssetConnectionStatus = 'unverified' | 'verified' | 'failed' | 'revoked';
4
+ export type AssetStorageMode = 'managed' | 'byob' | 'stackshift_s2';
5
+ export type AssetMigrationStatus = 'queued' | 'running' | 'completed' | 'failed' | 'canceled';
6
+ export type AssetMigrationItemStatus = 'queued' | 'running' | 'imported' | 'skipped' | 'failed' | 'canceled';
7
+ export interface AssetConnection {
8
+ id: string;
9
+ provider: AssetConnectionProvider;
10
+ name: string;
11
+ configuration: Record<string, JsonValue>;
12
+ external_id: string;
13
+ s2_bucket_id?: string;
14
+ status: AssetConnectionStatus;
15
+ last_verified_at?: string;
16
+ verification_error?: string;
17
+ created_at: string;
18
+ updated_at: string;
19
+ }
20
+ export interface AssetS3ConnectionConfiguration {
21
+ bucket: string;
22
+ region?: string;
23
+ endpoint?: string;
24
+ prefix?: string;
25
+ role_arn?: string;
26
+ auth_type: 'assume_role' | 'static';
27
+ path_style?: boolean;
28
+ }
29
+ export interface AssetS3StaticCredentials {
30
+ access_key_id: string;
31
+ secret_access_key: string;
32
+ session_token?: string;
33
+ }
34
+ export interface AssetCloudinaryConfiguration {
35
+ cloud_name: string;
36
+ api_key: string;
37
+ }
38
+ export interface AssetCloudinaryCredentials {
39
+ api_secret: string;
40
+ }
41
+ interface AssetConnectionInputBase {
42
+ name: string;
43
+ }
44
+ export type AssetConnectionInput = AssetConnectionInputBase & ({
45
+ provider: 'aws_s3';
46
+ configuration: AssetS3ConnectionConfiguration;
47
+ credentials?: AssetS3StaticCredentials;
48
+ } | {
49
+ provider: 'r2' | 'wasabi' | 'minio' | 's3';
50
+ configuration: AssetS3ConnectionConfiguration;
51
+ credentials: AssetS3StaticCredentials;
52
+ } | {
53
+ provider: 'cloudinary';
54
+ configuration: AssetCloudinaryConfiguration;
55
+ credentials: AssetCloudinaryCredentials;
56
+ } | {
57
+ provider: 'stackshift_s2';
58
+ s2_bucket_id: string;
59
+ configuration?: never;
60
+ credentials?: never;
61
+ });
62
+ export interface AssetStorageConfiguration {
63
+ storage_mode: AssetStorageMode;
64
+ connection_id?: string;
65
+ s2_bucket_id?: string;
66
+ object_prefix?: string;
67
+ derivative_prefix?: string;
68
+ auto_extract_text?: boolean;
69
+ expected_revision?: number;
70
+ }
71
+ export interface AssetS2Bucket {
72
+ id: string;
73
+ name: string;
74
+ workspace_id?: string;
75
+ project_id?: string;
76
+ region: string;
77
+ visibility: string;
78
+ versioning_enabled: boolean;
79
+ quota_bytes?: number;
80
+ object_count: number;
81
+ size_bytes: number;
82
+ created_at: string;
83
+ updated_at: string;
84
+ }
85
+ export interface AssetMigrationInput {
86
+ kind?: 'import' | 'relocate';
87
+ source_connection_id?: string;
88
+ destination_bucket_id: string;
89
+ source_prefix?: string;
90
+ conflict_policy?: 'skip' | 'new_version' | 'rename';
91
+ dry_run?: boolean;
92
+ }
93
+ export interface AssetMigration {
94
+ id: string;
95
+ kind: 'import' | 'relocate';
96
+ source_connection_id?: string;
97
+ destination_bucket_id: string;
98
+ source_prefix: string;
99
+ conflict_policy: 'skip' | 'new_version' | 'rename';
100
+ dry_run: boolean;
101
+ status: AssetMigrationStatus;
102
+ phase: 'inventory' | 'transfer' | 'complete' | string;
103
+ total_items: number;
104
+ processed_items: number;
105
+ imported_items: number;
106
+ skipped_items: number;
107
+ failed_items: number;
108
+ total_bytes: number;
109
+ processed_bytes: number;
110
+ report: Record<string, JsonValue>;
111
+ cancel_requested_at?: string;
112
+ started_at?: string;
113
+ completed_at?: string;
114
+ created_at: string;
115
+ updated_at: string;
116
+ }
117
+ export interface AssetMigrationItem {
118
+ id: string;
119
+ migration_id: string;
120
+ source_identity: string;
121
+ source_key: string;
122
+ destination_key: string;
123
+ content_type?: string;
124
+ size?: number;
125
+ checksum_sha256?: string;
126
+ checksum_state: 'known' | 'pending_execution' | 'verified';
127
+ source_metadata: Record<string, JsonValue>;
128
+ source_tags: string[];
129
+ status: AssetMigrationItemStatus;
130
+ attempt_count: number;
131
+ max_attempts: number;
132
+ mapped_asset_id?: string;
133
+ warning_code?: string;
134
+ error_code?: string;
135
+ error_message?: string;
136
+ created_at: string;
137
+ updated_at: string;
138
+ finished_at?: string;
139
+ }
140
+ export interface AssetTextBlock {
141
+ text: string;
142
+ type: string;
143
+ confidence: number;
144
+ box: [number, number, number, number];
145
+ }
146
+ export interface AssetTextPage {
147
+ number: number;
148
+ width: number;
149
+ height: number;
150
+ blocks: AssetTextBlock[];
151
+ }
152
+ export interface AssetTextExtraction {
153
+ id: string;
154
+ checksum_sha256: string;
155
+ provider: string;
156
+ engine_version: string;
157
+ language: string;
158
+ options_hash: string;
159
+ status: 'pending' | 'processing' | 'ready' | 'failed';
160
+ plain_text?: string;
161
+ pages: AssetTextPage[];
162
+ page_count: number;
163
+ error_code?: string;
164
+ error_message?: string;
165
+ created_at: string;
166
+ updated_at: string;
167
+ completed_at?: string;
168
+ }
169
+ export interface AssetUploadCapabilityInput {
170
+ bucket: string;
171
+ key_prefix?: string;
172
+ fixed_key?: string;
173
+ allowed_mime_types?: string[];
174
+ allowed_origins: string[];
175
+ max_bytes: number;
176
+ allow_remote_url?: boolean;
177
+ expires_in: string;
178
+ }
179
+ export interface AssetUploadCapability {
180
+ id: string;
181
+ bucket: string;
182
+ key_prefix: string;
183
+ fixed_key?: string;
184
+ allowed_mime_types: string[];
185
+ allowed_origins: string[];
186
+ max_bytes: number;
187
+ allow_remote_url: boolean;
188
+ session_id?: string;
189
+ expires_at: string;
190
+ created_at: string;
191
+ }
192
+ export interface CreatedAssetUploadCapability {
193
+ capability: AssetUploadCapability;
194
+ token: string;
195
+ }
196
+ export interface AssetMigrationListResult {
197
+ migrations: AssetMigration[];
198
+ }
199
+ export interface AssetConnectionListResult {
200
+ connections: AssetConnection[];
201
+ }
202
+ export interface AssetS2BucketListResult {
203
+ buckets: AssetS2Bucket[];
204
+ }
205
+ export interface AssetRelocationInput {
206
+ dry_run?: boolean;
207
+ }
208
+ export interface AssetTextExtractionInput {
209
+ language?: string;
210
+ options?: Record<string, JsonValue>;
211
+ }
212
+ export type AssetMigrationReport = {
213
+ migration: AssetMigration;
214
+ items: AssetMigrationItem[];
215
+ } | Record<string, JsonValue>;
216
+ export type AssetCapabilityUploadResult = Asset;
217
+ export type AssetStorageBucket = AssetBucket;
218
+ export {};
@@ -0,0 +1 @@
1
+ export {};