@inneropen/marvin-sdk 1.9.4 → 1.9.5

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/dist/index.cjs CHANGED
@@ -707,6 +707,13 @@ var init_assets = __esm({
707
707
  const response = await this.http.fetch(endpoint);
708
708
  return response.data || [];
709
709
  }
710
+ /**
711
+ * Get a single published asset by slug or ID
712
+ */
713
+ async get(slugOrId) {
714
+ const endpoint = `/api/publish/${this.workspaceSlug}/assets/${slugOrId}`;
715
+ return this.http.fetch(endpoint);
716
+ }
710
717
  /**
711
718
  * Convenience: Get all images
712
719
  */
package/dist/index.d.cts CHANGED
@@ -200,6 +200,10 @@ declare class AssetsModule {
200
200
  * Get all published assets
201
201
  */
202
202
  list(options?: GetAssetsOptions): Promise<MarvinAsset[]>;
203
+ /**
204
+ * Get a single published asset by slug or ID
205
+ */
206
+ get(slugOrId: string): Promise<MarvinAsset>;
203
207
  /**
204
208
  * Convenience: Get all images
205
209
  */
package/dist/index.d.ts CHANGED
@@ -200,6 +200,10 @@ declare class AssetsModule {
200
200
  * Get all published assets
201
201
  */
202
202
  list(options?: GetAssetsOptions): Promise<MarvinAsset[]>;
203
+ /**
204
+ * Get a single published asset by slug or ID
205
+ */
206
+ get(slugOrId: string): Promise<MarvinAsset>;
203
207
  /**
204
208
  * Convenience: Get all images
205
209
  */
package/dist/index.js CHANGED
@@ -358,6 +358,13 @@ var init_assets = __esm({
358
358
  const response = await this.http.fetch(endpoint);
359
359
  return response.data || [];
360
360
  }
361
+ /**
362
+ * Get a single published asset by slug or ID
363
+ */
364
+ async get(slugOrId) {
365
+ const endpoint = `/api/publish/${this.workspaceSlug}/assets/${slugOrId}`;
366
+ return this.http.fetch(endpoint);
367
+ }
361
368
  /**
362
369
  * Convenience: Get all images
363
370
  */
package/dist/platform.cjs CHANGED
@@ -388,19 +388,42 @@ var AssetsModule = class {
388
388
  return this.http.get(`/api/platform/assets/${id}`);
389
389
  }
390
390
  /**
391
- * Create a new asset
391
+ * Upload a new asset file
392
+ *
393
+ * @param file - The file to upload (File or Blob)
394
+ * @param metadata - Asset metadata (slug, name, altText, description, metadata)
395
+ * @returns The created asset with extracted metadata
396
+ */
397
+ async upload(file, metadata) {
398
+ const formData = new FormData();
399
+ formData.append("file", file);
400
+ formData.append("slug", metadata.slug);
401
+ formData.append("name", metadata.name);
402
+ if (metadata.altText) {
403
+ formData.append("alt_text", metadata.altText);
404
+ }
405
+ if (metadata.description) {
406
+ formData.append("description", metadata.description);
407
+ }
408
+ if (metadata.metadata) {
409
+ formData.append("metadata", JSON.stringify(metadata.metadata));
410
+ }
411
+ return this.http.post("/api/platform/assets/upload", formData);
412
+ }
413
+ /**
414
+ * Create a new asset (legacy metadata-only method)
392
415
  */
393
416
  async create(data) {
394
417
  return this.http.post("/api/platform/assets", data);
395
418
  }
396
419
  /**
397
- * Update an asset
420
+ * Update an asset (editable fields only: slug, name, altText, description, metadata)
398
421
  */
399
422
  async update(id, data) {
400
423
  return this.http.patch(`/api/platform/assets/${id}`, data);
401
424
  }
402
425
  /**
403
- * Delete an asset
426
+ * Delete an asset (removes file from storage and database)
404
427
  */
405
428
  async delete(id) {
406
429
  return this.http.delete(`/api/platform/assets/${id}`);
@@ -609,7 +632,7 @@ var WorkspacesModule = class {
609
632
  * Update workspace preferences
610
633
  */
611
634
  async updatePreferences(workspaceId, data) {
612
- return this.http.put(`/api/groups/${workspaceId}/preferences`, data);
635
+ return this.http.patch(`/api/groups/${workspaceId}/preferences`, data);
613
636
  }
614
637
  };
615
638
 
@@ -885,6 +908,12 @@ var UserModule = class {
885
908
  async getProfile() {
886
909
  return this.http.get("/api/self");
887
910
  }
911
+ /**
912
+ * Update current user profile
913
+ */
914
+ async updateProfile(data) {
915
+ await this.http.put("/api/self", data);
916
+ }
888
917
  /**
889
918
  * List personal API tokens
890
919
  */
@@ -183,84 +183,67 @@ interface components {
183
183
  };
184
184
  /**
185
185
  * AppTheme
186
- * @description Schema defining the color palette for the application's light and dark themes.
187
- * Provides default hex color values for various UI elements, intended for client-side use.
186
+ * @description Schema defining the complete color system for the application's light and dark themes.
187
+ * Includes background, surface, text, border, and accent colors.
188
+ * Actual color values are defined in core/settings/theme.py
188
189
  */
189
190
  AppTheme: {
190
- /**
191
- * Lightprimary
192
- * @default #E58325
193
- */
191
+ /** Lightbg */
192
+ lightBg: string;
193
+ /** Lightpanel */
194
+ lightPanel: string;
195
+ /** Lightpanelsecondary */
196
+ lightPanelSecondary: string;
197
+ /** Lighttext */
198
+ lightText: string;
199
+ /** Lighttextmuted */
200
+ lightTextMuted: string;
201
+ /** Lightborder */
202
+ lightBorder: string;
203
+ /** Lightprimary */
194
204
  lightPrimary: string;
195
- /**
196
- * Lightaccent
197
- * @default #007A99
198
- */
205
+ /** Lightaccent */
199
206
  lightAccent: string;
200
- /**
201
- * Lightsecondary
202
- * @default #973542
203
- */
207
+ /** Lightsecondary */
204
208
  lightSecondary: string;
205
- /**
206
- * Lightsuccess
207
- * @default #43A047
208
- */
209
+ /** Lightsuccess */
209
210
  lightSuccess: string;
210
- /**
211
- * Lightinfo
212
- * @default #1976D2
213
- */
211
+ /** Lightinfo */
214
212
  lightInfo: string;
215
- /**
216
- * Lightwarning
217
- * @default #FF6D00
218
- */
213
+ /** Lightwarning */
219
214
  lightWarning: string;
220
- /**
221
- * Lighterror
222
- * @default #EF5350
223
- */
215
+ /** Lighterror */
224
216
  lightError: string;
225
- /**
226
- * Darkprimary
227
- * @default #E58325
228
- */
217
+ /** Darkbg */
218
+ darkBg: string;
219
+ /** Darkpanel */
220
+ darkPanel: string;
221
+ /** Darkpanelsecondary */
222
+ darkPanelSecondary: string;
223
+ /** Darktext */
224
+ darkText: string;
225
+ /** Darktextmuted */
226
+ darkTextMuted: string;
227
+ /** Darkborder */
228
+ darkBorder: string;
229
+ /** Darkprimary */
229
230
  darkPrimary: string;
230
- /**
231
- * Darkaccent
232
- * @default #007A99
233
- */
231
+ /** Darkaccent */
234
232
  darkAccent: string;
235
- /**
236
- * Darksecondary
237
- * @default #973542
238
- */
233
+ /** Darksecondary */
239
234
  darkSecondary: string;
240
- /**
241
- * Darksuccess
242
- * @default #43A047
243
- */
235
+ /** Darksuccess */
244
236
  darkSuccess: string;
245
- /**
246
- * Darkinfo
247
- * @default #1976D2
248
- */
237
+ /** Darkinfo */
249
238
  darkInfo: string;
250
- /**
251
- * Darkwarning
252
- * @default #FF6D00
253
- */
239
+ /** Darkwarning */
254
240
  darkWarning: string;
255
- /**
256
- * Darkerror
257
- * @default #EF5350
258
- */
241
+ /** Darkerror */
259
242
  darkError: string;
260
243
  };
261
244
  /**
262
245
  * AssetCreate
263
- * @description Schema for creating a new asset.
246
+ * @description Legacy schema for backwards compatibility - prefer AssetCreateInternal.
264
247
  */
265
248
  AssetCreate: {
266
249
  /** Slug */
@@ -304,12 +287,33 @@ interface components {
304
287
  mimeType: string;
305
288
  /** Alttext */
306
289
  altText?: string | null;
290
+ /** Originalfilename */
291
+ originalFilename: string;
292
+ /** Filename */
293
+ filename: string;
294
+ /** Extension */
295
+ extension: string;
307
296
  /** Filesize */
308
297
  fileSize: number;
298
+ /**
299
+ * Assettype
300
+ * @enum {string}
301
+ */
302
+ assetType: "image" | "document" | "video" | "audio" | "archive" | "svg" | "other";
303
+ /** Checksum */
304
+ checksum: string;
309
305
  /** Width */
310
306
  width?: number | null;
311
307
  /** Height */
312
308
  height?: number | null;
309
+ /** Orientation */
310
+ orientation?: number | null;
311
+ /** Storageprovider */
312
+ storageProvider: string;
313
+ /** Storagekey */
314
+ storageKey: string;
315
+ /** Publicurl */
316
+ publicUrl?: string | null;
313
317
  /** Description */
314
318
  description?: string | null;
315
319
  /** Metadata */
@@ -322,6 +326,24 @@ interface components {
322
326
  */
323
327
  uploadedBy: string;
324
328
  };
329
+ /**
330
+ * AssetUpdate
331
+ * @description Schema for updating editable asset fields.
332
+ */
333
+ AssetUpdate: {
334
+ /** Slug */
335
+ slug?: string | null;
336
+ /** Name */
337
+ name?: string | null;
338
+ /** Alttext */
339
+ altText?: string | null;
340
+ /** Description */
341
+ description?: string | null;
342
+ /** Metadata */
343
+ metadata?: {
344
+ [key: string]: unknown;
345
+ } | null;
346
+ };
325
347
  /**
326
348
  * AuthMethod
327
349
  * @description Enumeration for the authentication methods a user can be associated with.
@@ -351,6 +373,24 @@ interface components {
351
373
  */
352
374
  remember_me: boolean;
353
375
  };
376
+ /** Body_upload_asset_api_platform_assets_upload_post */
377
+ Body_upload_asset_api_platform_assets_upload_post: {
378
+ /**
379
+ * File
380
+ * Format: binary
381
+ */
382
+ file: string;
383
+ /** Slug */
384
+ slug: string;
385
+ /** Name */
386
+ name: string;
387
+ /** Alt Text */
388
+ alt_text?: string | null;
389
+ /** Description */
390
+ description?: string | null;
391
+ /** Metadata */
392
+ metadata?: string | null;
393
+ };
354
394
  /**
355
395
  * ChangePassword
356
396
  * @description Schema for a password change request.
@@ -576,12 +616,33 @@ interface components {
576
616
  mimeType: string;
577
617
  /** Alttext */
578
618
  altText?: string | null;
619
+ /** Originalfilename */
620
+ originalFilename: string;
621
+ /** Filename */
622
+ filename: string;
623
+ /** Extension */
624
+ extension: string;
579
625
  /** Filesize */
580
626
  fileSize: number;
627
+ /**
628
+ * Assettype
629
+ * @enum {string}
630
+ */
631
+ assetType: "image" | "document" | "video" | "audio" | "archive" | "svg" | "other";
632
+ /** Checksum */
633
+ checksum: string;
581
634
  /** Width */
582
635
  width?: number | null;
583
636
  /** Height */
584
637
  height?: number | null;
638
+ /** Orientation */
639
+ orientation?: number | null;
640
+ /** Storageprovider */
641
+ storageProvider: string;
642
+ /** Storagekey */
643
+ storageKey: string;
644
+ /** Publicurl */
645
+ publicUrl?: string | null;
585
646
  /** Description */
586
647
  description?: string | null;
587
648
  /** Metadata */
@@ -1421,6 +1482,7 @@ interface components {
1421
1482
  * @description Schema for published assets in the publishing API.
1422
1483
  *
1423
1484
  * Provides asset metadata for external sites to build proper media tags.
1485
+ * Read-only, does not expose internal fields like storage_key or uploaded_by.
1424
1486
  */
1425
1487
  PublishedAssetRead: {
1426
1488
  /** Slug */
@@ -1429,14 +1491,20 @@ interface components {
1429
1491
  name: string;
1430
1492
  /** Mimetype */
1431
1493
  mimeType: string;
1494
+ /** Assettype */
1495
+ assetType: string;
1496
+ /** Filesize */
1497
+ fileSize: number;
1432
1498
  /** Width */
1433
1499
  width?: number | null;
1434
1500
  /** Height */
1435
1501
  height?: number | null;
1436
1502
  /** Alttext */
1437
1503
  altText?: string | null;
1438
- /** Fileurl */
1439
- fileUrl: string;
1504
+ /** Description */
1505
+ description?: string | null;
1506
+ /** Publicurl */
1507
+ publicUrl: string;
1440
1508
  };
1441
1509
  /**
1442
1510
  * PublishedAssetsResponse
@@ -2420,11 +2488,18 @@ type PlatformResource = components['schemas']['ResourceRead'];
2420
2488
  type PlatformResourceCreate = components['schemas']['ResourceCreate'];
2421
2489
  type PlatformResourceUpdate = components['schemas']['ResourceUpdate'];
2422
2490
  /**
2423
- * Asset (Platform API - full CRUD)
2491
+ * Asset (Platform API - full CRUD with file upload)
2424
2492
  */
2425
2493
  type PlatformAsset = components['schemas']['AssetRead'];
2426
2494
  type PlatformAssetCreate = components['schemas']['AssetCreate'];
2427
- type PlatformAssetUpdate = Partial<PlatformAssetCreate>;
2495
+ type PlatformAssetUpdate = components['schemas']['AssetUpdate'];
2496
+ type PlatformAssetUpload = {
2497
+ slug: string;
2498
+ name: string;
2499
+ altText?: string;
2500
+ description?: string;
2501
+ metadata?: Record<string, unknown>;
2502
+ };
2428
2503
  /**
2429
2504
  * API Client (Platform API - manage publishing tokens)
2430
2505
  */
@@ -2557,7 +2632,7 @@ declare class ResourcesModule {
2557
2632
  /**
2558
2633
  * Assets Module - Platform API
2559
2634
  *
2560
- * CRUD operations for assets
2635
+ * CRUD operations and file upload for assets
2561
2636
  */
2562
2637
 
2563
2638
  declare class AssetsModule {
@@ -2572,15 +2647,23 @@ declare class AssetsModule {
2572
2647
  */
2573
2648
  get(id: string): Promise<PlatformAsset>;
2574
2649
  /**
2575
- * Create a new asset
2650
+ * Upload a new asset file
2651
+ *
2652
+ * @param file - The file to upload (File or Blob)
2653
+ * @param metadata - Asset metadata (slug, name, altText, description, metadata)
2654
+ * @returns The created asset with extracted metadata
2655
+ */
2656
+ upload(file: File | Blob, metadata: PlatformAssetUpload): Promise<PlatformAsset>;
2657
+ /**
2658
+ * Create a new asset (legacy metadata-only method)
2576
2659
  */
2577
2660
  create(data: PlatformAssetCreate): Promise<PlatformAsset>;
2578
2661
  /**
2579
- * Update an asset
2662
+ * Update an asset (editable fields only: slug, name, altText, description, metadata)
2580
2663
  */
2581
2664
  update(id: string, data: PlatformAssetUpdate): Promise<PlatformAsset>;
2582
2665
  /**
2583
- * Delete an asset
2666
+ * Delete an asset (removes file from storage and database)
2584
2667
  */
2585
2668
  delete(id: string): Promise<void>;
2586
2669
  }
@@ -3114,6 +3197,11 @@ interface PasswordChange {
3114
3197
  currentPassword: string;
3115
3198
  newPassword: string;
3116
3199
  }
3200
+ interface UserProfileUpdate {
3201
+ username?: string;
3202
+ email?: string;
3203
+ fullName?: string | null;
3204
+ }
3117
3205
  declare class UserModule {
3118
3206
  private http;
3119
3207
  constructor(http: HttpClient);
@@ -3121,6 +3209,10 @@ declare class UserModule {
3121
3209
  * Get current user profile
3122
3210
  */
3123
3211
  getProfile(): Promise<UserProfile>;
3212
+ /**
3213
+ * Update current user profile
3214
+ */
3215
+ updateProfile(data: UserProfileUpdate): Promise<void>;
3124
3216
  /**
3125
3217
  * List personal API tokens
3126
3218
  */
@@ -3197,6 +3289,12 @@ declare class AuthModule {
3197
3289
  */
3198
3290
 
3199
3291
  interface AppTheme {
3292
+ lightBg: string;
3293
+ lightPanel: string;
3294
+ lightPanelSecondary: string;
3295
+ lightText: string;
3296
+ lightTextMuted: string;
3297
+ lightBorder: string;
3200
3298
  lightPrimary: string;
3201
3299
  lightAccent: string;
3202
3300
  lightSecondary: string;
@@ -3204,6 +3302,12 @@ interface AppTheme {
3204
3302
  lightInfo: string;
3205
3303
  lightWarning: string;
3206
3304
  lightError: string;
3305
+ darkBg: string;
3306
+ darkPanel: string;
3307
+ darkPanelSecondary: string;
3308
+ darkText: string;
3309
+ darkTextMuted: string;
3310
+ darkBorder: string;
3207
3311
  darkPrimary: string;
3208
3312
  darkAccent: string;
3209
3313
  darkSecondary: string;
@@ -3258,4 +3362,4 @@ declare class PlatformClient extends HttpClient {
3258
3362
  */
3259
3363
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
3260
3364
 
3261
- export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, type AuthToken, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type EventOption, EventsModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type MaintenanceStorageDetails, type MaintenanceSummary, type Notification, type NotificationCreate, type NotificationUpdate, NotificationsModule, type PasswordChange, type PasswordResetTokenRequest, type PasswordResetTokenResponse, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetCreate, type PlatformAssetUpdate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, type SystemStatistics, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserSummary, type UserUpdate, type Webhook, type WebhookCreate, type WebhookMethod, type WebhookPagination, type WebhookUpdate, WebhooksModule, type Workspace, type WorkspaceActivationRequest, type WorkspaceCreate, WorkspaceMembersModule, type WorkspacePreferences, type WorkspacePreferencesUpdate, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
3365
+ export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, type AuthToken, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type EventOption, EventsModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type MaintenanceStorageDetails, type MaintenanceSummary, type Notification, type NotificationCreate, type NotificationUpdate, NotificationsModule, type PasswordChange, type PasswordResetTokenRequest, type PasswordResetTokenResponse, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetCreate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, type SystemStatistics, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserProfileUpdate, type UserSummary, type UserUpdate, type Webhook, type WebhookCreate, type WebhookMethod, type WebhookPagination, type WebhookUpdate, WebhooksModule, type Workspace, type WorkspaceActivationRequest, type WorkspaceCreate, WorkspaceMembersModule, type WorkspacePreferences, type WorkspacePreferencesUpdate, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
@@ -183,84 +183,67 @@ interface components {
183
183
  };
184
184
  /**
185
185
  * AppTheme
186
- * @description Schema defining the color palette for the application's light and dark themes.
187
- * Provides default hex color values for various UI elements, intended for client-side use.
186
+ * @description Schema defining the complete color system for the application's light and dark themes.
187
+ * Includes background, surface, text, border, and accent colors.
188
+ * Actual color values are defined in core/settings/theme.py
188
189
  */
189
190
  AppTheme: {
190
- /**
191
- * Lightprimary
192
- * @default #E58325
193
- */
191
+ /** Lightbg */
192
+ lightBg: string;
193
+ /** Lightpanel */
194
+ lightPanel: string;
195
+ /** Lightpanelsecondary */
196
+ lightPanelSecondary: string;
197
+ /** Lighttext */
198
+ lightText: string;
199
+ /** Lighttextmuted */
200
+ lightTextMuted: string;
201
+ /** Lightborder */
202
+ lightBorder: string;
203
+ /** Lightprimary */
194
204
  lightPrimary: string;
195
- /**
196
- * Lightaccent
197
- * @default #007A99
198
- */
205
+ /** Lightaccent */
199
206
  lightAccent: string;
200
- /**
201
- * Lightsecondary
202
- * @default #973542
203
- */
207
+ /** Lightsecondary */
204
208
  lightSecondary: string;
205
- /**
206
- * Lightsuccess
207
- * @default #43A047
208
- */
209
+ /** Lightsuccess */
209
210
  lightSuccess: string;
210
- /**
211
- * Lightinfo
212
- * @default #1976D2
213
- */
211
+ /** Lightinfo */
214
212
  lightInfo: string;
215
- /**
216
- * Lightwarning
217
- * @default #FF6D00
218
- */
213
+ /** Lightwarning */
219
214
  lightWarning: string;
220
- /**
221
- * Lighterror
222
- * @default #EF5350
223
- */
215
+ /** Lighterror */
224
216
  lightError: string;
225
- /**
226
- * Darkprimary
227
- * @default #E58325
228
- */
217
+ /** Darkbg */
218
+ darkBg: string;
219
+ /** Darkpanel */
220
+ darkPanel: string;
221
+ /** Darkpanelsecondary */
222
+ darkPanelSecondary: string;
223
+ /** Darktext */
224
+ darkText: string;
225
+ /** Darktextmuted */
226
+ darkTextMuted: string;
227
+ /** Darkborder */
228
+ darkBorder: string;
229
+ /** Darkprimary */
229
230
  darkPrimary: string;
230
- /**
231
- * Darkaccent
232
- * @default #007A99
233
- */
231
+ /** Darkaccent */
234
232
  darkAccent: string;
235
- /**
236
- * Darksecondary
237
- * @default #973542
238
- */
233
+ /** Darksecondary */
239
234
  darkSecondary: string;
240
- /**
241
- * Darksuccess
242
- * @default #43A047
243
- */
235
+ /** Darksuccess */
244
236
  darkSuccess: string;
245
- /**
246
- * Darkinfo
247
- * @default #1976D2
248
- */
237
+ /** Darkinfo */
249
238
  darkInfo: string;
250
- /**
251
- * Darkwarning
252
- * @default #FF6D00
253
- */
239
+ /** Darkwarning */
254
240
  darkWarning: string;
255
- /**
256
- * Darkerror
257
- * @default #EF5350
258
- */
241
+ /** Darkerror */
259
242
  darkError: string;
260
243
  };
261
244
  /**
262
245
  * AssetCreate
263
- * @description Schema for creating a new asset.
246
+ * @description Legacy schema for backwards compatibility - prefer AssetCreateInternal.
264
247
  */
265
248
  AssetCreate: {
266
249
  /** Slug */
@@ -304,12 +287,33 @@ interface components {
304
287
  mimeType: string;
305
288
  /** Alttext */
306
289
  altText?: string | null;
290
+ /** Originalfilename */
291
+ originalFilename: string;
292
+ /** Filename */
293
+ filename: string;
294
+ /** Extension */
295
+ extension: string;
307
296
  /** Filesize */
308
297
  fileSize: number;
298
+ /**
299
+ * Assettype
300
+ * @enum {string}
301
+ */
302
+ assetType: "image" | "document" | "video" | "audio" | "archive" | "svg" | "other";
303
+ /** Checksum */
304
+ checksum: string;
309
305
  /** Width */
310
306
  width?: number | null;
311
307
  /** Height */
312
308
  height?: number | null;
309
+ /** Orientation */
310
+ orientation?: number | null;
311
+ /** Storageprovider */
312
+ storageProvider: string;
313
+ /** Storagekey */
314
+ storageKey: string;
315
+ /** Publicurl */
316
+ publicUrl?: string | null;
313
317
  /** Description */
314
318
  description?: string | null;
315
319
  /** Metadata */
@@ -322,6 +326,24 @@ interface components {
322
326
  */
323
327
  uploadedBy: string;
324
328
  };
329
+ /**
330
+ * AssetUpdate
331
+ * @description Schema for updating editable asset fields.
332
+ */
333
+ AssetUpdate: {
334
+ /** Slug */
335
+ slug?: string | null;
336
+ /** Name */
337
+ name?: string | null;
338
+ /** Alttext */
339
+ altText?: string | null;
340
+ /** Description */
341
+ description?: string | null;
342
+ /** Metadata */
343
+ metadata?: {
344
+ [key: string]: unknown;
345
+ } | null;
346
+ };
325
347
  /**
326
348
  * AuthMethod
327
349
  * @description Enumeration for the authentication methods a user can be associated with.
@@ -351,6 +373,24 @@ interface components {
351
373
  */
352
374
  remember_me: boolean;
353
375
  };
376
+ /** Body_upload_asset_api_platform_assets_upload_post */
377
+ Body_upload_asset_api_platform_assets_upload_post: {
378
+ /**
379
+ * File
380
+ * Format: binary
381
+ */
382
+ file: string;
383
+ /** Slug */
384
+ slug: string;
385
+ /** Name */
386
+ name: string;
387
+ /** Alt Text */
388
+ alt_text?: string | null;
389
+ /** Description */
390
+ description?: string | null;
391
+ /** Metadata */
392
+ metadata?: string | null;
393
+ };
354
394
  /**
355
395
  * ChangePassword
356
396
  * @description Schema for a password change request.
@@ -576,12 +616,33 @@ interface components {
576
616
  mimeType: string;
577
617
  /** Alttext */
578
618
  altText?: string | null;
619
+ /** Originalfilename */
620
+ originalFilename: string;
621
+ /** Filename */
622
+ filename: string;
623
+ /** Extension */
624
+ extension: string;
579
625
  /** Filesize */
580
626
  fileSize: number;
627
+ /**
628
+ * Assettype
629
+ * @enum {string}
630
+ */
631
+ assetType: "image" | "document" | "video" | "audio" | "archive" | "svg" | "other";
632
+ /** Checksum */
633
+ checksum: string;
581
634
  /** Width */
582
635
  width?: number | null;
583
636
  /** Height */
584
637
  height?: number | null;
638
+ /** Orientation */
639
+ orientation?: number | null;
640
+ /** Storageprovider */
641
+ storageProvider: string;
642
+ /** Storagekey */
643
+ storageKey: string;
644
+ /** Publicurl */
645
+ publicUrl?: string | null;
585
646
  /** Description */
586
647
  description?: string | null;
587
648
  /** Metadata */
@@ -1421,6 +1482,7 @@ interface components {
1421
1482
  * @description Schema for published assets in the publishing API.
1422
1483
  *
1423
1484
  * Provides asset metadata for external sites to build proper media tags.
1485
+ * Read-only, does not expose internal fields like storage_key or uploaded_by.
1424
1486
  */
1425
1487
  PublishedAssetRead: {
1426
1488
  /** Slug */
@@ -1429,14 +1491,20 @@ interface components {
1429
1491
  name: string;
1430
1492
  /** Mimetype */
1431
1493
  mimeType: string;
1494
+ /** Assettype */
1495
+ assetType: string;
1496
+ /** Filesize */
1497
+ fileSize: number;
1432
1498
  /** Width */
1433
1499
  width?: number | null;
1434
1500
  /** Height */
1435
1501
  height?: number | null;
1436
1502
  /** Alttext */
1437
1503
  altText?: string | null;
1438
- /** Fileurl */
1439
- fileUrl: string;
1504
+ /** Description */
1505
+ description?: string | null;
1506
+ /** Publicurl */
1507
+ publicUrl: string;
1440
1508
  };
1441
1509
  /**
1442
1510
  * PublishedAssetsResponse
@@ -2420,11 +2488,18 @@ type PlatformResource = components['schemas']['ResourceRead'];
2420
2488
  type PlatformResourceCreate = components['schemas']['ResourceCreate'];
2421
2489
  type PlatformResourceUpdate = components['schemas']['ResourceUpdate'];
2422
2490
  /**
2423
- * Asset (Platform API - full CRUD)
2491
+ * Asset (Platform API - full CRUD with file upload)
2424
2492
  */
2425
2493
  type PlatformAsset = components['schemas']['AssetRead'];
2426
2494
  type PlatformAssetCreate = components['schemas']['AssetCreate'];
2427
- type PlatformAssetUpdate = Partial<PlatformAssetCreate>;
2495
+ type PlatformAssetUpdate = components['schemas']['AssetUpdate'];
2496
+ type PlatformAssetUpload = {
2497
+ slug: string;
2498
+ name: string;
2499
+ altText?: string;
2500
+ description?: string;
2501
+ metadata?: Record<string, unknown>;
2502
+ };
2428
2503
  /**
2429
2504
  * API Client (Platform API - manage publishing tokens)
2430
2505
  */
@@ -2557,7 +2632,7 @@ declare class ResourcesModule {
2557
2632
  /**
2558
2633
  * Assets Module - Platform API
2559
2634
  *
2560
- * CRUD operations for assets
2635
+ * CRUD operations and file upload for assets
2561
2636
  */
2562
2637
 
2563
2638
  declare class AssetsModule {
@@ -2572,15 +2647,23 @@ declare class AssetsModule {
2572
2647
  */
2573
2648
  get(id: string): Promise<PlatformAsset>;
2574
2649
  /**
2575
- * Create a new asset
2650
+ * Upload a new asset file
2651
+ *
2652
+ * @param file - The file to upload (File or Blob)
2653
+ * @param metadata - Asset metadata (slug, name, altText, description, metadata)
2654
+ * @returns The created asset with extracted metadata
2655
+ */
2656
+ upload(file: File | Blob, metadata: PlatformAssetUpload): Promise<PlatformAsset>;
2657
+ /**
2658
+ * Create a new asset (legacy metadata-only method)
2576
2659
  */
2577
2660
  create(data: PlatformAssetCreate): Promise<PlatformAsset>;
2578
2661
  /**
2579
- * Update an asset
2662
+ * Update an asset (editable fields only: slug, name, altText, description, metadata)
2580
2663
  */
2581
2664
  update(id: string, data: PlatformAssetUpdate): Promise<PlatformAsset>;
2582
2665
  /**
2583
- * Delete an asset
2666
+ * Delete an asset (removes file from storage and database)
2584
2667
  */
2585
2668
  delete(id: string): Promise<void>;
2586
2669
  }
@@ -3114,6 +3197,11 @@ interface PasswordChange {
3114
3197
  currentPassword: string;
3115
3198
  newPassword: string;
3116
3199
  }
3200
+ interface UserProfileUpdate {
3201
+ username?: string;
3202
+ email?: string;
3203
+ fullName?: string | null;
3204
+ }
3117
3205
  declare class UserModule {
3118
3206
  private http;
3119
3207
  constructor(http: HttpClient);
@@ -3121,6 +3209,10 @@ declare class UserModule {
3121
3209
  * Get current user profile
3122
3210
  */
3123
3211
  getProfile(): Promise<UserProfile>;
3212
+ /**
3213
+ * Update current user profile
3214
+ */
3215
+ updateProfile(data: UserProfileUpdate): Promise<void>;
3124
3216
  /**
3125
3217
  * List personal API tokens
3126
3218
  */
@@ -3197,6 +3289,12 @@ declare class AuthModule {
3197
3289
  */
3198
3290
 
3199
3291
  interface AppTheme {
3292
+ lightBg: string;
3293
+ lightPanel: string;
3294
+ lightPanelSecondary: string;
3295
+ lightText: string;
3296
+ lightTextMuted: string;
3297
+ lightBorder: string;
3200
3298
  lightPrimary: string;
3201
3299
  lightAccent: string;
3202
3300
  lightSecondary: string;
@@ -3204,6 +3302,12 @@ interface AppTheme {
3204
3302
  lightInfo: string;
3205
3303
  lightWarning: string;
3206
3304
  lightError: string;
3305
+ darkBg: string;
3306
+ darkPanel: string;
3307
+ darkPanelSecondary: string;
3308
+ darkText: string;
3309
+ darkTextMuted: string;
3310
+ darkBorder: string;
3207
3311
  darkPrimary: string;
3208
3312
  darkAccent: string;
3209
3313
  darkSecondary: string;
@@ -3258,4 +3362,4 @@ declare class PlatformClient extends HttpClient {
3258
3362
  */
3259
3363
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
3260
3364
 
3261
- export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, type AuthToken, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type EventOption, EventsModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type MaintenanceStorageDetails, type MaintenanceSummary, type Notification, type NotificationCreate, type NotificationUpdate, NotificationsModule, type PasswordChange, type PasswordResetTokenRequest, type PasswordResetTokenResponse, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetCreate, type PlatformAssetUpdate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, type SystemStatistics, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserSummary, type UserUpdate, type Webhook, type WebhookCreate, type WebhookMethod, type WebhookPagination, type WebhookUpdate, WebhooksModule, type Workspace, type WorkspaceActivationRequest, type WorkspaceCreate, WorkspaceMembersModule, type WorkspacePreferences, type WorkspacePreferencesUpdate, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
3365
+ export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, type AuthToken, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type EventOption, EventsModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type MaintenanceStorageDetails, type MaintenanceSummary, type Notification, type NotificationCreate, type NotificationUpdate, NotificationsModule, type PasswordChange, type PasswordResetTokenRequest, type PasswordResetTokenResponse, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetCreate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, type SystemStatistics, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserProfileUpdate, type UserSummary, type UserUpdate, type Webhook, type WebhookCreate, type WebhookMethod, type WebhookPagination, type WebhookUpdate, WebhooksModule, type Workspace, type WorkspaceActivationRequest, type WorkspaceCreate, WorkspaceMembersModule, type WorkspacePreferences, type WorkspacePreferencesUpdate, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
package/dist/platform.js CHANGED
@@ -173,19 +173,42 @@ var AssetsModule = class {
173
173
  return this.http.get(`/api/platform/assets/${id}`);
174
174
  }
175
175
  /**
176
- * Create a new asset
176
+ * Upload a new asset file
177
+ *
178
+ * @param file - The file to upload (File or Blob)
179
+ * @param metadata - Asset metadata (slug, name, altText, description, metadata)
180
+ * @returns The created asset with extracted metadata
181
+ */
182
+ async upload(file, metadata) {
183
+ const formData = new FormData();
184
+ formData.append("file", file);
185
+ formData.append("slug", metadata.slug);
186
+ formData.append("name", metadata.name);
187
+ if (metadata.altText) {
188
+ formData.append("alt_text", metadata.altText);
189
+ }
190
+ if (metadata.description) {
191
+ formData.append("description", metadata.description);
192
+ }
193
+ if (metadata.metadata) {
194
+ formData.append("metadata", JSON.stringify(metadata.metadata));
195
+ }
196
+ return this.http.post("/api/platform/assets/upload", formData);
197
+ }
198
+ /**
199
+ * Create a new asset (legacy metadata-only method)
177
200
  */
178
201
  async create(data) {
179
202
  return this.http.post("/api/platform/assets", data);
180
203
  }
181
204
  /**
182
- * Update an asset
205
+ * Update an asset (editable fields only: slug, name, altText, description, metadata)
183
206
  */
184
207
  async update(id, data) {
185
208
  return this.http.patch(`/api/platform/assets/${id}`, data);
186
209
  }
187
210
  /**
188
- * Delete an asset
211
+ * Delete an asset (removes file from storage and database)
189
212
  */
190
213
  async delete(id) {
191
214
  return this.http.delete(`/api/platform/assets/${id}`);
@@ -394,7 +417,7 @@ var WorkspacesModule = class {
394
417
  * Update workspace preferences
395
418
  */
396
419
  async updatePreferences(workspaceId, data) {
397
- return this.http.put(`/api/groups/${workspaceId}/preferences`, data);
420
+ return this.http.patch(`/api/groups/${workspaceId}/preferences`, data);
398
421
  }
399
422
  };
400
423
 
@@ -670,6 +693,12 @@ var UserModule = class {
670
693
  async getProfile() {
671
694
  return this.http.get("/api/self");
672
695
  }
696
+ /**
697
+ * Update current user profile
698
+ */
699
+ async updateProfile(data) {
700
+ await this.http.put("/api/self", data);
701
+ }
673
702
  /**
674
703
  * List personal API tokens
675
704
  */
@@ -29,20 +29,47 @@ interface MarvinEntryType {
29
29
  }
30
30
  interface MarvinAsset {
31
31
  id: string;
32
- name: string;
33
32
  slug: string;
34
- url: string;
33
+ name: string;
34
+ originalFilename: string;
35
+ filename: string;
36
+ extension: string;
35
37
  mimeType: string;
36
- fileSize?: number;
38
+ assetType: 'image' | 'document' | 'video' | 'audio' | 'archive' | 'svg' | 'other';
39
+ fileSize: number;
40
+ checksum: string;
37
41
  width?: number;
38
42
  height?: number;
43
+ orientation?: number;
44
+ storageProvider: string;
45
+ storageKey: string;
46
+ publicUrl?: string;
39
47
  altText?: string;
40
48
  description?: string;
41
- focalPoint?: string;
42
49
  metadata?: Record<string, unknown>;
50
+ uploadedBy: string;
43
51
  createdAt: string;
44
52
  updatedAt: string;
45
53
  }
54
+ interface PublishedAsset {
55
+ slug: string;
56
+ name: string;
57
+ mimeType: string;
58
+ assetType: string;
59
+ fileSize: number;
60
+ width?: number;
61
+ height?: number;
62
+ altText?: string;
63
+ description?: string;
64
+ publicUrl: string;
65
+ }
66
+ interface AssetUploadRequest {
67
+ slug: string;
68
+ name: string;
69
+ altText?: string;
70
+ description?: string;
71
+ metadata?: Record<string, unknown>;
72
+ }
46
73
  interface MarvinCollection {
47
74
  id: string;
48
75
  name: string;
@@ -119,4 +146,4 @@ interface GetResourcesOptions {
119
146
  offset?: number;
120
147
  }
121
148
 
122
- export type { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite };
149
+ export type { AssetUploadRequest, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset };
@@ -29,20 +29,47 @@ interface MarvinEntryType {
29
29
  }
30
30
  interface MarvinAsset {
31
31
  id: string;
32
- name: string;
33
32
  slug: string;
34
- url: string;
33
+ name: string;
34
+ originalFilename: string;
35
+ filename: string;
36
+ extension: string;
35
37
  mimeType: string;
36
- fileSize?: number;
38
+ assetType: 'image' | 'document' | 'video' | 'audio' | 'archive' | 'svg' | 'other';
39
+ fileSize: number;
40
+ checksum: string;
37
41
  width?: number;
38
42
  height?: number;
43
+ orientation?: number;
44
+ storageProvider: string;
45
+ storageKey: string;
46
+ publicUrl?: string;
39
47
  altText?: string;
40
48
  description?: string;
41
- focalPoint?: string;
42
49
  metadata?: Record<string, unknown>;
50
+ uploadedBy: string;
43
51
  createdAt: string;
44
52
  updatedAt: string;
45
53
  }
54
+ interface PublishedAsset {
55
+ slug: string;
56
+ name: string;
57
+ mimeType: string;
58
+ assetType: string;
59
+ fileSize: number;
60
+ width?: number;
61
+ height?: number;
62
+ altText?: string;
63
+ description?: string;
64
+ publicUrl: string;
65
+ }
66
+ interface AssetUploadRequest {
67
+ slug: string;
68
+ name: string;
69
+ altText?: string;
70
+ description?: string;
71
+ metadata?: Record<string, unknown>;
72
+ }
46
73
  interface MarvinCollection {
47
74
  id: string;
48
75
  name: string;
@@ -119,4 +146,4 @@ interface GetResourcesOptions {
119
146
  offset?: number;
120
147
  }
121
148
 
122
- export type { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite };
149
+ export type { AssetUploadRequest, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -64,6 +64,7 @@
64
64
  "dev": "tsup src/index.ts src/platform.ts src/types/index.ts --format esm,cjs --dts --watch",
65
65
  "generate:types": "openapi-typescript http://localhost:8080/openapi.json -o src/generated/schema.ts",
66
66
  "typecheck": "tsc --noEmit",
67
+ "prepare": "npm run build",
67
68
  "prepublishOnly": "npm run build"
68
69
  },
69
70
  "peerDependencies": {