@stackshift-cloud/sdk 1.0.0 → 1.2.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.
Files changed (53) hide show
  1. package/README.md +117 -0
  2. package/dist/asset-media-v2.d.ts +65 -0
  3. package/dist/asset-media-v2.js +1 -0
  4. package/dist/asset-workflows.d.ts +269 -0
  5. package/dist/asset-workflows.js +69 -0
  6. package/dist/assets-dam-types.d.ts +225 -0
  7. package/dist/assets-dam-types.js +1 -0
  8. package/dist/assets-dam.d.ts +96 -0
  9. package/dist/assets-dam.js +47 -0
  10. package/dist/assets-platform-types.d.ts +218 -0
  11. package/dist/assets-platform-types.js +1 -0
  12. package/dist/assets-platform.d.ts +55 -0
  13. package/dist/assets-platform.js +90 -0
  14. package/dist/assets-video-types.d.ts +116 -0
  15. package/dist/assets-video-types.js +1 -0
  16. package/dist/assets-video.d.ts +25 -0
  17. package/dist/assets-video.js +19 -0
  18. package/dist/assets.d.ts +21 -1
  19. package/dist/assets.js +85 -132
  20. package/dist/client.d.ts +10 -0
  21. package/dist/client.js +26 -6
  22. package/dist/generated/assets-contract.d.ts +512 -2
  23. package/dist/generated/assets-contract.js +102 -0
  24. package/dist/index.d.ts +21 -0
  25. package/dist/index.js +11 -0
  26. package/dist/mail-advanced-types.d.ts +9 -0
  27. package/dist/mail-billing.d.ts +34 -0
  28. package/dist/mail-billing.js +7 -0
  29. package/dist/mail-brands.d.ts +35 -0
  30. package/dist/mail-brands.js +17 -0
  31. package/dist/mail-campaigns.d.ts +72 -10
  32. package/dist/mail-campaigns.js +25 -2
  33. package/dist/mail-marketing.d.ts +84 -0
  34. package/dist/mail-marketing.js +24 -0
  35. package/dist/mail-migration.d.ts +16 -0
  36. package/dist/mail-migration.js +10 -0
  37. package/dist/mail-otp-types.d.ts +4 -0
  38. package/dist/mail-simulation.d.ts +4 -0
  39. package/dist/mail-simulation.js +1 -0
  40. package/dist/mail-subscribers.d.ts +39 -0
  41. package/dist/mail-subscribers.js +1 -0
  42. package/dist/mail-template-types.d.ts +8 -0
  43. package/dist/mail-tracking.d.ts +59 -0
  44. package/dist/mail-tracking.js +14 -0
  45. package/dist/mail-webhook-types.d.ts +4 -1
  46. package/dist/mail.d.ts +12 -0
  47. package/dist/mail.js +19 -0
  48. package/dist/types.d.ts +19 -0
  49. package/dist/upload-controller.d.ts +70 -0
  50. package/dist/upload-controller.js +223 -0
  51. package/dist/workload-security.d.ts +172 -0
  52. package/dist/workload-security.js +50 -0
  53. package/package.json +2 -2
@@ -0,0 +1,225 @@
1
+ export type AssetAction = 'read' | 'upload' | 'edit_metadata' | 'process' | 'review' | 'publish' | 'download_original' | 'curate' | 'manage_policy' | 'manage_access';
2
+ export interface AssetSpaceAccess {
3
+ id: string;
4
+ owner_id: string;
5
+ name: string;
6
+ actions: AssetAction[];
7
+ collection_ids: string[];
8
+ }
9
+ export interface AssetCollaborator {
10
+ id: string;
11
+ asset_space_id: string;
12
+ email: string;
13
+ user_id?: string;
14
+ collection_id?: string;
15
+ actions: AssetAction[];
16
+ status: string;
17
+ revision: number;
18
+ expires_at: string;
19
+ }
20
+ export interface AssetMetadataField {
21
+ key: string;
22
+ label: string;
23
+ type: 'text' | 'integer' | 'decimal' | 'boolean' | 'date' | 'single_choice' | 'multiple_choice';
24
+ required?: boolean;
25
+ searchable?: boolean;
26
+ options?: string[];
27
+ minimum?: number;
28
+ maximum?: number;
29
+ max_length?: number;
30
+ }
31
+ export interface AssetMetadataSchema {
32
+ id: string;
33
+ name: string;
34
+ revision: number;
35
+ published_revision?: number;
36
+ fields: AssetMetadataField[];
37
+ }
38
+ export interface AssetBucketGovernance {
39
+ bucket_id: string;
40
+ revision: number;
41
+ enabled: boolean;
42
+ migrating: boolean;
43
+ schema_id?: string;
44
+ schema_revision?: number;
45
+ require_other_reviewer: boolean;
46
+ allow_ar: boolean;
47
+ channels: string[];
48
+ }
49
+ export interface AssetMediaReference {
50
+ render_set_id?: string;
51
+ render_role?: string;
52
+ spin_frame?: number;
53
+ language?: string;
54
+ label?: string;
55
+ caption_kind?: 'captions' | 'subtitles';
56
+ is_default?: boolean;
57
+ asset_id: string;
58
+ version_id: string;
59
+ rendition_id: string;
60
+ kind: 'image' | 'video' | 'model' | 'usdz' | 'caption';
61
+ role: 'media' | 'poster' | 'fallback' | 'caption' | 'usdz' | 'spin_frame';
62
+ output_checksum_sha256?: string;
63
+ policy_revision?: number;
64
+ }
65
+ export interface AssetPublicationRights {
66
+ owner: string;
67
+ attribution: string;
68
+ starts_at?: string;
69
+ expires_at?: string;
70
+ }
71
+ export type AssetPublicationStatus = 'draft' | 'in_review' | 'approved' | 'published' | 'withdrawn';
72
+ export interface AssetPublicationInput {
73
+ asset_id: string;
74
+ asset_revision: number;
75
+ channel: string;
76
+ renditions: AssetMediaReference[];
77
+ rights: AssetPublicationRights;
78
+ }
79
+ export interface AssetPublication {
80
+ id: string;
81
+ asset_id: string;
82
+ version_id: string;
83
+ channel: string;
84
+ status: AssetPublicationStatus;
85
+ revision: number;
86
+ metadata_revision: number;
87
+ metadata: Record<string, unknown>;
88
+ renditions: AssetMediaReference[];
89
+ rights: AssetPublicationRights;
90
+ reviewed_by?: string;
91
+ review_note?: string;
92
+ }
93
+ export interface AssetPublicationDelivery {
94
+ publication_id: string;
95
+ expires_at: string;
96
+ attribution: string;
97
+ ar_allowed: boolean;
98
+ renditions: Array<{
99
+ reference: AssetMediaReference;
100
+ url: string;
101
+ mp4_url?: string;
102
+ poster_url?: string;
103
+ }>;
104
+ }
105
+ export interface AssetPickerCapabilityInput {
106
+ buckets?: string[];
107
+ collections?: string[];
108
+ origins: string[];
109
+ channel: string;
110
+ result_limit?: number;
111
+ expires_in_seconds?: number;
112
+ actions?: ('search' | 'select')[];
113
+ }
114
+ export interface AssetPickerCapability {
115
+ id: string;
116
+ expires_at: string;
117
+ origins: string[];
118
+ channel: string;
119
+ result_limit: number;
120
+ }
121
+ export interface AssetModelPackage {
122
+ id: string;
123
+ asset_id: string;
124
+ version_id: string;
125
+ kind: 'glb' | 'usdz';
126
+ status: 'queued' | 'processing' | 'ready' | 'failed';
127
+ rendition_id?: string;
128
+ failure_reason?: string;
129
+ report: Record<string, unknown>;
130
+ updated_at: string;
131
+ }
132
+ export interface AssetGalleryEntryInput {
133
+ publication_id: string;
134
+ fallback_publication_id?: string;
135
+ role: 'hero' | 'detail' | 'media';
136
+ locale: string;
137
+ alt: string;
138
+ }
139
+ export interface AssetGalleryEntry extends AssetGalleryEntryInput {
140
+ asset_id: string;
141
+ version_id: string;
142
+ publication_revision: number;
143
+ fallback_revision?: number;
144
+ }
145
+ export interface AssetGallery {
146
+ id: string;
147
+ name: string;
148
+ revision: number;
149
+ published_revision?: number;
150
+ entries: AssetGalleryEntry[];
151
+ }
152
+ export interface AssetGalleryDelivery {
153
+ gallery_id: string;
154
+ name: string;
155
+ revision: number;
156
+ entries: Array<{
157
+ reference: AssetGalleryEntry;
158
+ delivery?: AssetPublicationDelivery;
159
+ fallback_delivery?: AssetPublicationDelivery;
160
+ unavailable?: boolean;
161
+ }>;
162
+ }
163
+ export interface AssetRenderRecipe {
164
+ environment: 'neutral' | 'pillars';
165
+ orbit: number;
166
+ elevation: number;
167
+ zoom: number;
168
+ exposure: number;
169
+ shadow: number;
170
+ background: string;
171
+ size: 512 | 1024;
172
+ }
173
+ export type AssetRenderOutput = 'proof' | 'poster' | 'spin' | 'turntable';
174
+ export interface AssetRenderInput {
175
+ version_id: string;
176
+ source_checksum: string;
177
+ recipe: AssetRenderRecipe;
178
+ outputs: AssetRenderOutput[];
179
+ }
180
+ export interface AssetRenderEstimate {
181
+ units: number;
182
+ remaining: number;
183
+ reused: boolean;
184
+ set_id?: string;
185
+ }
186
+ export interface AssetRenderSubmission {
187
+ set_id: string;
188
+ status: string;
189
+ job_id?: string;
190
+ units?: number;
191
+ reused?: boolean;
192
+ }
193
+ export interface AssetRenderSet {
194
+ id: string;
195
+ asset_id: string;
196
+ version_id: string;
197
+ source_checksum: string;
198
+ recipe: AssetRenderRecipe;
199
+ requested: AssetRenderOutput[];
200
+ status: 'queued' | 'processing' | 'ready' | 'failed';
201
+ can_retry: boolean;
202
+ units: number;
203
+ outputs: Array<{
204
+ role: AssetRenderOutput;
205
+ frame: number;
206
+ reference: AssetMediaReference;
207
+ }>;
208
+ created_at: string;
209
+ updated_at: string;
210
+ failure_reason?: string;
211
+ }
212
+ export interface AssetRenderingInfo {
213
+ enabled: boolean;
214
+ reason: string;
215
+ remaining: number;
216
+ qualified_outputs: AssetRenderOutput[];
217
+ source?: {
218
+ assetId: string;
219
+ versionId: string;
220
+ checksum: string;
221
+ };
222
+ delivery?: AssetPublicationDelivery;
223
+ sets: AssetRenderSet[];
224
+ deliveries: Record<string, AssetPublicationDelivery>;
225
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,96 @@
1
+ import type { StackShift } from './client.js';
2
+ import type { AssetJobSubmission } from './types.js';
3
+ import type { AssetRenderInput, AssetRenderEstimate, AssetRenderSubmission, AssetRenderingInfo } from './assets-dam-types.js';
4
+ import type { AssetAction, AssetSpaceAccess, AssetCollaborator, AssetMetadataSchema, AssetMetadataField, AssetBucketGovernance, AssetPublication, AssetPublicationInput, AssetPublicationStatus, AssetPublicationDelivery, AssetMediaReference, AssetPickerCapability, AssetPickerCapabilityInput, AssetModelPackage, AssetGallery, AssetGalleryEntryInput, AssetGalleryDelivery } from './assets-dam-types.js';
5
+ export declare class AssetDAMClient {
6
+ private readonly client;
7
+ constructor(client: StackShift);
8
+ spaces(): Promise<{
9
+ spaces: AssetSpaceAccess[];
10
+ }>;
11
+ collaborators(): Promise<{
12
+ collaborators: AssetCollaborator[];
13
+ }>;
14
+ invite(input: {
15
+ email: string;
16
+ actions: AssetAction[];
17
+ collection_id?: string;
18
+ expires_at: string;
19
+ }): Promise<AssetCollaborator>;
20
+ acceptInvitation(id: string): Promise<AssetCollaborator>;
21
+ updateCollaborator(id: string, revision: number, actions: AssetAction[]): Promise<{
22
+ saved: boolean;
23
+ }>;
24
+ revokeCollaborator(id: string, revision: number): Promise<{
25
+ saved: boolean;
26
+ }>;
27
+ metadataSchemas(): Promise<{
28
+ schemas: AssetMetadataSchema[];
29
+ }>;
30
+ metadataEditor(assetId: string): Promise<{
31
+ fields: AssetMetadataField[];
32
+ metadata: Record<string, unknown>;
33
+ revision: number;
34
+ metadata_revision: number;
35
+ can_edit: boolean;
36
+ }>;
37
+ createMetadataSchema(input: {
38
+ name: string;
39
+ fields: AssetMetadataField[];
40
+ }): Promise<AssetMetadataSchema>;
41
+ updateMetadataSchema(id: string, revision: number, input: {
42
+ name: string;
43
+ fields: AssetMetadataField[];
44
+ }): Promise<AssetMetadataSchema>;
45
+ publishMetadataSchema(id: string, revision: number): Promise<AssetMetadataSchema>;
46
+ bucketGovernance(id: string): Promise<AssetBucketGovernance>;
47
+ saveBucketGovernance(id: string, input: Omit<AssetBucketGovernance, 'bucket_id' | 'migrating'>): Promise<AssetBucketGovernance>;
48
+ migrateBucketGovernance(id: string, revision: number): Promise<AssetBucketGovernance>;
49
+ publications(options?: {
50
+ asset_id?: string;
51
+ status?: AssetPublicationStatus;
52
+ cursor?: string;
53
+ }): Promise<{
54
+ publications: AssetPublication[];
55
+ next_cursor: string;
56
+ }>;
57
+ publicationRenditions(assetId: string): Promise<{
58
+ renditions: AssetMediaReference[];
59
+ }>;
60
+ createPublication(input: AssetPublicationInput): Promise<AssetPublication>;
61
+ updatePublication(id: string, revision: number, input: AssetPublicationInput): Promise<AssetPublication>;
62
+ transitionPublication(id: string, revision: number, action: 'submit' | 'approve' | 'request-changes' | 'publish' | 'withdraw', note?: string): Promise<AssetPublication>;
63
+ resolvePublication(id: string, preview?: boolean): Promise<AssetPublicationDelivery>;
64
+ resolvePublicationAR(id: string): Promise<AssetPublicationDelivery>;
65
+ createPickerCapability(input: AssetPickerCapabilityInput): Promise<{
66
+ token: string;
67
+ capability: AssetPickerCapability;
68
+ }>;
69
+ revokePickerCapability(id: string): Promise<{
70
+ revoked: boolean;
71
+ }>;
72
+ models(assetId: string): Promise<{
73
+ packages: AssetModelPackage[];
74
+ pilot_enabled: boolean;
75
+ daily_jobs: number;
76
+ rendering: AssetRenderingInfo;
77
+ }>;
78
+ estimateRender(assetId: string, revision: number, input: AssetRenderInput): Promise<AssetRenderEstimate>;
79
+ renderProduct(assetId: string, revision: number, idempotencyKey: string, input: AssetRenderInput, maximumUnits: number): Promise<AssetRenderSubmission>;
80
+ processModel(assetId: string, revision: number, idempotencyKey: string): Promise<AssetJobSubmission>;
81
+ galleries(cursor?: string): Promise<{
82
+ galleries: AssetGallery[];
83
+ next_cursor: string;
84
+ }>;
85
+ createGallery(input: {
86
+ name: string;
87
+ entries: AssetGalleryEntryInput[];
88
+ }): Promise<AssetGallery>;
89
+ updateGallery(id: string, revision: number, input: {
90
+ name: string;
91
+ entries: AssetGalleryEntryInput[];
92
+ }): Promise<AssetGallery>;
93
+ transitionGallery(id: string, revision: number, action: 'publish' | 'withdraw'): Promise<AssetGallery>;
94
+ resolveGallery(id: string, preview?: boolean): Promise<AssetGalleryDelivery>;
95
+ resolveGalleryAR(id: string, publicationId: string): Promise<AssetPublicationDelivery>;
96
+ }
@@ -0,0 +1,47 @@
1
+ const path = (group, id) => `/assets/${group}/${encodeURIComponent(id)}`;
2
+ const revisionHeaders = (revision) => ({ 'If-Match': `"${revision}"` });
3
+ export class AssetDAMClient {
4
+ client;
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ spaces() { return this.client.request('/assets/spaces'); }
9
+ collaborators() { return this.client.request('/assets/collaborators'); }
10
+ invite(input) { return this.client.request('/assets/collaborators', { method: 'POST', body: input }); }
11
+ acceptInvitation(id) { return this.client.request(`${path('invitations', id)}/accept`, { method: 'POST' }); }
12
+ updateCollaborator(id, revision, actions) { return this.client.request(path('collaborators', id), { method: 'PUT', headers: revisionHeaders(revision), body: { actions } }); }
13
+ revokeCollaborator(id, revision) { return this.client.request(path('collaborators', id), { method: 'DELETE', headers: revisionHeaders(revision) }); }
14
+ metadataSchemas() { return this.client.request('/assets/metadata-schemas'); }
15
+ metadataEditor(assetId) { return this.client.request(`/assets/${encodeURIComponent(assetId)}/metadata-editor`); }
16
+ createMetadataSchema(input) { return this.client.request('/assets/metadata-schemas', { method: 'POST', body: input }); }
17
+ updateMetadataSchema(id, revision, input) { return this.client.request(path('metadata-schemas', id), { method: 'PUT', headers: revisionHeaders(revision), body: input }); }
18
+ publishMetadataSchema(id, revision) { return this.client.request(`${path('metadata-schemas', id)}/publish`, { method: 'POST', headers: revisionHeaders(revision) }); }
19
+ bucketGovernance(id) { return this.client.request(`${path('buckets', id)}/governance`); }
20
+ saveBucketGovernance(id, input) { return this.client.request(`${path('buckets', id)}/governance`, { method: 'PUT', body: input }); }
21
+ migrateBucketGovernance(id, revision) { return this.client.request(`${path('buckets', id)}/governance/migrate`, { method: 'POST', headers: revisionHeaders(revision) }); }
22
+ publications(options = {}) {
23
+ const query = new URLSearchParams();
24
+ for (const [key, value] of Object.entries(options))
25
+ if (value)
26
+ query.set(key, value);
27
+ return this.client.request(`/assets/publications?${query}`);
28
+ }
29
+ publicationRenditions(assetId) { return this.client.request(`/assets/${encodeURIComponent(assetId)}/publication-renditions`); }
30
+ createPublication(input) { return this.client.request('/assets/publications', { method: 'POST', body: input }); }
31
+ updatePublication(id, revision, input) { return this.client.request(path('publications', id), { method: 'PUT', headers: revisionHeaders(revision), body: input }); }
32
+ transitionPublication(id, revision, action, note = '') { return this.client.request(`${path('publications', id)}/${action}`, { method: 'POST', headers: revisionHeaders(revision), body: { note } }); }
33
+ resolvePublication(id, preview = false) { return this.client.request(`${path('publications', id)}/${preview ? 'preview' : 'resolve'}`); }
34
+ resolvePublicationAR(id) { return this.client.request(`${path('publications', id)}/ar`, { method: 'POST' }); }
35
+ createPickerCapability(input) { return this.client.request('/assets/picker-capabilities', { method: 'POST', body: input }); }
36
+ revokePickerCapability(id) { return this.client.request(path('picker-capabilities', id), { method: 'DELETE' }); }
37
+ models(assetId) { return this.client.request(`/assets/${encodeURIComponent(assetId)}/models`); }
38
+ estimateRender(assetId, revision, input) { return this.client.request(`/assets/${encodeURIComponent(assetId)}/models`, { method: 'POST', headers: revisionHeaders(revision), body: { ...input, operation: 'estimate' } }); }
39
+ renderProduct(assetId, revision, idempotencyKey, input, maximumUnits) { return this.client.request(`/assets/${encodeURIComponent(assetId)}/models`, { method: 'POST', headers: { ...revisionHeaders(revision), 'Idempotency-Key': idempotencyKey }, body: { ...input, operation: 'render', maximum_units: maximumUnits } }); }
40
+ processModel(assetId, revision, idempotencyKey) { return this.client.request(`/assets/${encodeURIComponent(assetId)}/models`, { method: 'POST', headers: { ...revisionHeaders(revision), 'Idempotency-Key': idempotencyKey } }); }
41
+ galleries(cursor) { return this.client.request(`/assets/galleries${cursor ? '?cursor=' + encodeURIComponent(cursor) : ''}`); }
42
+ createGallery(input) { return this.client.request('/assets/galleries', { method: 'POST', body: input }); }
43
+ updateGallery(id, revision, input) { return this.client.request(path('galleries', id), { method: 'PUT', headers: revisionHeaders(revision), body: input }); }
44
+ transitionGallery(id, revision, action) { return this.client.request(`${path('galleries', id)}/${action}`, { method: 'POST', headers: revisionHeaders(revision) }); }
45
+ resolveGallery(id, preview = false) { return this.client.request(`${path('galleries', id)}/resolve${preview ? '?preview=true' : ''}`); }
46
+ resolveGalleryAR(id, publicationId) { return this.client.request(`${path('galleries', id)}/ar`, { method: 'POST', body: { publication_id: publicationId } }); }
47
+ }
@@ -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 {};
@@ -0,0 +1,55 @@
1
+ import type { StackShift } from './client.js';
2
+ import type { AssetBucket } from './types.js';
3
+ import type { AssetConnection, AssetConnectionInput, AssetConnectionListResult, AssetMigration, AssetMigrationInput, AssetMigrationListResult, AssetMigrationReport, AssetRelocationInput, AssetS2Bucket, AssetS2BucketListResult, AssetStorageConfiguration, AssetTextExtraction, AssetTextExtractionInput, AssetUploadCapabilityInput, CreatedAssetUploadCapability } from './assets-platform-types.js';
4
+ export declare class AssetConnectionsClient {
5
+ private readonly client;
6
+ constructor(client: StackShift);
7
+ list(): Promise<AssetConnectionListResult>;
8
+ get(connectionId: string): Promise<AssetConnection>;
9
+ create(input: AssetConnectionInput): Promise<AssetConnection>;
10
+ update(connectionId: string, input: Partial<AssetConnectionInput>): Promise<AssetConnection>;
11
+ verify(connectionId: string): Promise<AssetConnection>;
12
+ delete(connectionId: string): Promise<{
13
+ deleted: boolean;
14
+ }>;
15
+ }
16
+ export declare class AssetStorageClient {
17
+ private readonly client;
18
+ constructor(client: StackShift);
19
+ configure(bucketId: string, revision: number, input: AssetStorageConfiguration): Promise<AssetBucket>;
20
+ listS2Buckets(): Promise<AssetS2BucketListResult>;
21
+ createS2Bucket(input: {
22
+ name: string;
23
+ region: string;
24
+ }): Promise<AssetS2Bucket>;
25
+ relocate(bucketId: string, input?: AssetRelocationInput): Promise<AssetMigration>;
26
+ }
27
+ export declare class AssetMigrationsClient {
28
+ private readonly client;
29
+ constructor(client: StackShift);
30
+ start(input: AssetMigrationInput): Promise<AssetMigration>;
31
+ list(options?: {
32
+ limit?: number;
33
+ }): Promise<AssetMigrationListResult>;
34
+ get(migrationId: string): Promise<AssetMigration>;
35
+ cancel(migrationId: string): Promise<{
36
+ canceled: boolean;
37
+ }>;
38
+ retryItem(migrationId: string, itemId: string): Promise<{
39
+ queued: boolean;
40
+ }>;
41
+ report(migrationId: string, format?: 'json'): Promise<AssetMigrationReport>;
42
+ downloadReport(migrationId: string, format?: 'json' | 'csv'): Promise<Blob>;
43
+ }
44
+ export declare class AssetTextClient {
45
+ private readonly client;
46
+ constructor(client: StackShift);
47
+ start(assetId: string, input?: AssetTextExtractionInput): Promise<AssetTextExtraction>;
48
+ get(assetId: string): Promise<AssetTextExtraction>;
49
+ retry(extractionId: string): Promise<AssetTextExtraction>;
50
+ }
51
+ export declare class AssetUploadCapabilitiesClient {
52
+ private readonly client;
53
+ constructor(client: StackShift);
54
+ create(input: AssetUploadCapabilityInput): Promise<CreatedAssetUploadCapability>;
55
+ }