@inneropen/marvin-sdk 2.0.0-next.13 → 2.0.0-next.15
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 +59 -10
- package/dist/{HttpClient-BX5Gqd0w.d.cts → HttpClient-CdF3IHM1.d.cts} +41 -2
- package/dist/{HttpClient-BX5Gqd0w.d.ts → HttpClient-CdF3IHM1.d.ts} +41 -2
- package/dist/chunk-GJNOYXUQ.js +980 -0
- package/dist/{chunk-DYC2BEA4.js → chunk-WJC4X7TB.js} +274 -9
- package/dist/index.cjs +356 -12
- package/dist/index.d.cts +20 -610
- package/dist/index.d.ts +20 -610
- package/dist/index.js +21 -880
- package/dist/marvin-Bx5k6tsF.d.cts +654 -0
- package/dist/marvin-g7dayc83.d.ts +654 -0
- package/dist/platform.cjs +396 -43
- package/dist/platform.d.cts +124 -15
- package/dist/platform.d.ts +124 -15
- package/dist/platform.js +251 -37
- package/dist/publish.cjs +1487 -0
- package/dist/publish.d.cts +49 -0
- package/dist/publish.d.ts +49 -0
- package/dist/publish.js +75 -0
- package/dist/types/index.d.cts +9 -1
- package/dist/types/index.d.ts +9 -1
- package/package.json +11 -6
package/dist/platform.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { H as HttpClient } from './HttpClient-
|
|
1
|
+
import { H as HttpClient } from './HttpClient-CdF3IHM1.cjs';
|
|
2
|
+
import { AuthToken } from './types/index.cjs';
|
|
2
3
|
|
|
3
4
|
interface components {
|
|
4
5
|
schemas: {
|
|
@@ -3396,9 +3397,19 @@ declare class ResourcesModule {
|
|
|
3396
3397
|
* CRUD operations and file upload for assets
|
|
3397
3398
|
*/
|
|
3398
3399
|
|
|
3400
|
+
interface FileUploadOptions {
|
|
3401
|
+
/** Maximum file size in bytes (default: 100MB) */
|
|
3402
|
+
maxFileSize?: number;
|
|
3403
|
+
/** Allowed MIME types (if not provided, all types allowed) */
|
|
3404
|
+
allowedMimeTypes?: string[];
|
|
3405
|
+
}
|
|
3399
3406
|
declare class AssetsModule {
|
|
3400
3407
|
private http;
|
|
3401
3408
|
constructor(http: HttpClient);
|
|
3409
|
+
/**
|
|
3410
|
+
* Validate file before upload
|
|
3411
|
+
*/
|
|
3412
|
+
private validateFile;
|
|
3402
3413
|
/**
|
|
3403
3414
|
* List all assets
|
|
3404
3415
|
*/
|
|
@@ -3412,9 +3423,22 @@ declare class AssetsModule {
|
|
|
3412
3423
|
*
|
|
3413
3424
|
* @param file - The file to upload (File or Blob)
|
|
3414
3425
|
* @param metadata - Asset metadata (slug, name, altText, description, metadata)
|
|
3426
|
+
* @param options - Upload options (file size limits, allowed types)
|
|
3415
3427
|
* @returns The created asset with extracted metadata
|
|
3428
|
+
*
|
|
3429
|
+
* @example
|
|
3430
|
+
* ```typescript
|
|
3431
|
+
* // Upload with default limits (100MB, all types)
|
|
3432
|
+
* const asset = await assets.upload(file, { slug: 'my-image', name: 'My Image' });
|
|
3433
|
+
*
|
|
3434
|
+
* // Upload with restrictions
|
|
3435
|
+
* const asset = await assets.upload(file,
|
|
3436
|
+
* { slug: 'avatar', name: 'Avatar' },
|
|
3437
|
+
* { maxFileSize: 5 * 1024 * 1024, allowedMimeTypes: ['image/*'] }
|
|
3438
|
+
* );
|
|
3439
|
+
* ```
|
|
3416
3440
|
*/
|
|
3417
|
-
upload(file: File | Blob, metadata: PlatformAssetUpload): Promise<PlatformAsset>;
|
|
3441
|
+
upload(file: File | Blob, metadata: PlatformAssetUpload, options?: FileUploadOptions): Promise<PlatformAsset>;
|
|
3418
3442
|
/**
|
|
3419
3443
|
* Update an asset (editable fields only: slug, name, altText, description, metadata)
|
|
3420
3444
|
*/
|
|
@@ -3423,6 +3447,11 @@ declare class AssetsModule {
|
|
|
3423
3447
|
* Delete an asset (removes file from storage and database)
|
|
3424
3448
|
*/
|
|
3425
3449
|
delete(id: string): Promise<void>;
|
|
3450
|
+
/**
|
|
3451
|
+
* Get download URL for an asset file
|
|
3452
|
+
* Use this to create download links or fetch the file directly
|
|
3453
|
+
*/
|
|
3454
|
+
getDownloadUrl(id: string, baseUrl?: string): string;
|
|
3426
3455
|
}
|
|
3427
3456
|
|
|
3428
3457
|
/**
|
|
@@ -3571,11 +3600,21 @@ interface WorkspaceUpdate {
|
|
|
3571
3600
|
name?: string;
|
|
3572
3601
|
description?: string | null;
|
|
3573
3602
|
}
|
|
3603
|
+
/**
|
|
3604
|
+
* Workspace preferences - dynamic key-value store
|
|
3605
|
+
* Common keys include: theme, locale, notifications, etc.
|
|
3606
|
+
*/
|
|
3574
3607
|
interface WorkspacePreferences {
|
|
3575
|
-
|
|
3608
|
+
theme?: string;
|
|
3609
|
+
locale?: string;
|
|
3610
|
+
notifications?: boolean;
|
|
3611
|
+
[key: string]: unknown;
|
|
3576
3612
|
}
|
|
3577
3613
|
interface WorkspacePreferencesUpdate {
|
|
3578
|
-
|
|
3614
|
+
theme?: string;
|
|
3615
|
+
locale?: string;
|
|
3616
|
+
notifications?: boolean;
|
|
3617
|
+
[key: string]: unknown;
|
|
3579
3618
|
}
|
|
3580
3619
|
declare class WorkspacesModule {
|
|
3581
3620
|
private http;
|
|
@@ -3657,7 +3696,19 @@ declare class InvitesModule {
|
|
|
3657
3696
|
delete(tokenId: string): Promise<void>;
|
|
3658
3697
|
/**
|
|
3659
3698
|
* Generate invitation URL from a token
|
|
3660
|
-
*
|
|
3699
|
+
*
|
|
3700
|
+
* @param token - Invitation token
|
|
3701
|
+
* @param baseUrl - Base URL for the frontend (required in browser environments)
|
|
3702
|
+
* @returns Full invitation URL
|
|
3703
|
+
*
|
|
3704
|
+
* @example
|
|
3705
|
+
* ```typescript
|
|
3706
|
+
* // Node.js (can use env vars)
|
|
3707
|
+
* const url = invites.getInvitationUrl(token);
|
|
3708
|
+
*
|
|
3709
|
+
* // Browser (must provide baseUrl)
|
|
3710
|
+
* const url = invites.getInvitationUrl(token, 'https://app.example.com');
|
|
3711
|
+
* ```
|
|
3661
3712
|
*/
|
|
3662
3713
|
getInvitationUrl(token: string, baseUrl?: string): string;
|
|
3663
3714
|
}
|
|
@@ -3743,6 +3794,10 @@ interface WebhookUpdate {
|
|
|
3743
3794
|
declare class WebhooksModule {
|
|
3744
3795
|
private http;
|
|
3745
3796
|
constructor(http: HttpClient);
|
|
3797
|
+
/**
|
|
3798
|
+
* Validate webhook URL to prevent SSRF attacks
|
|
3799
|
+
*/
|
|
3800
|
+
private validateWebhookUrl;
|
|
3746
3801
|
/**
|
|
3747
3802
|
* List all webhooks for the current workspace
|
|
3748
3803
|
*/
|
|
@@ -3753,10 +3808,12 @@ declare class WebhooksModule {
|
|
|
3753
3808
|
get(id: string): Promise<Webhook>;
|
|
3754
3809
|
/**
|
|
3755
3810
|
* Create a new webhook
|
|
3811
|
+
* Validates URL to prevent SSRF attacks
|
|
3756
3812
|
*/
|
|
3757
3813
|
create(data: WebhookCreate): Promise<Webhook>;
|
|
3758
3814
|
/**
|
|
3759
3815
|
* Update a webhook
|
|
3816
|
+
* Validates URL if provided to prevent SSRF attacks
|
|
3760
3817
|
*/
|
|
3761
3818
|
update(id: string, data: WebhookUpdate): Promise<Webhook>;
|
|
3762
3819
|
/**
|
|
@@ -3836,7 +3893,22 @@ declare class AdminUsersModule {
|
|
|
3836
3893
|
*/
|
|
3837
3894
|
|
|
3838
3895
|
type AdminAboutInfo = components['schemas']['AdminAboutInfo'];
|
|
3896
|
+
/**
|
|
3897
|
+
* Email settings returned from API (read-only)
|
|
3898
|
+
* Password is never returned for security reasons
|
|
3899
|
+
*/
|
|
3839
3900
|
interface EmailSettings {
|
|
3901
|
+
host?: string;
|
|
3902
|
+
port?: number;
|
|
3903
|
+
username?: string;
|
|
3904
|
+
from?: string;
|
|
3905
|
+
useTls?: boolean;
|
|
3906
|
+
}
|
|
3907
|
+
/**
|
|
3908
|
+
* Email settings for updates (write-only)
|
|
3909
|
+
* Password can be provided to update settings
|
|
3910
|
+
*/
|
|
3911
|
+
interface EmailSettingsUpdate {
|
|
3840
3912
|
host?: string;
|
|
3841
3913
|
port?: number;
|
|
3842
3914
|
username?: string;
|
|
@@ -3852,6 +3924,18 @@ interface SystemStatistics {
|
|
|
3852
3924
|
resources?: number;
|
|
3853
3925
|
assets?: number;
|
|
3854
3926
|
}
|
|
3927
|
+
interface StartupInfo {
|
|
3928
|
+
version: string;
|
|
3929
|
+
api_port: number;
|
|
3930
|
+
api_docs: boolean;
|
|
3931
|
+
database_url: string;
|
|
3932
|
+
database_provider: string;
|
|
3933
|
+
default_group?: string;
|
|
3934
|
+
allow_signup: boolean;
|
|
3935
|
+
theme?: string;
|
|
3936
|
+
custom_middleware?: string[];
|
|
3937
|
+
[key: string]: unknown;
|
|
3938
|
+
}
|
|
3855
3939
|
declare class AdminSystemModule {
|
|
3856
3940
|
private http;
|
|
3857
3941
|
constructor(http: HttpClient);
|
|
@@ -3868,7 +3952,7 @@ declare class AdminSystemModule {
|
|
|
3868
3952
|
/**
|
|
3869
3953
|
* Get startup information
|
|
3870
3954
|
*/
|
|
3871
|
-
getStartupInfo(): Promise<
|
|
3955
|
+
getStartupInfo(): Promise<StartupInfo>;
|
|
3872
3956
|
/**
|
|
3873
3957
|
* Get system statistics
|
|
3874
3958
|
*/
|
|
@@ -3879,8 +3963,9 @@ declare class AdminSystemModule {
|
|
|
3879
3963
|
getEmailSettings(): Promise<EmailSettings>;
|
|
3880
3964
|
/**
|
|
3881
3965
|
* Update email settings
|
|
3966
|
+
* Note: Password field is write-only and will not be returned in response
|
|
3882
3967
|
*/
|
|
3883
|
-
updateEmailSettings(data:
|
|
3968
|
+
updateEmailSettings(data: EmailSettingsUpdate): Promise<EmailSettings>;
|
|
3884
3969
|
}
|
|
3885
3970
|
|
|
3886
3971
|
/**
|
|
@@ -4138,10 +4223,6 @@ declare class EventLogModule {
|
|
|
4138
4223
|
* Authenticated session management (logout, refresh)
|
|
4139
4224
|
*/
|
|
4140
4225
|
|
|
4141
|
-
interface AuthToken {
|
|
4142
|
-
accessToken: string;
|
|
4143
|
-
tokenType: string;
|
|
4144
|
-
}
|
|
4145
4226
|
declare class AuthModule {
|
|
4146
4227
|
private http;
|
|
4147
4228
|
constructor(http: HttpClient);
|
|
@@ -4212,7 +4293,7 @@ interface EmailTemplateSummary {
|
|
|
4212
4293
|
description?: string;
|
|
4213
4294
|
enabled: boolean;
|
|
4214
4295
|
created_at: string;
|
|
4215
|
-
|
|
4296
|
+
updated_at: string;
|
|
4216
4297
|
}
|
|
4217
4298
|
interface EmailTemplateRead extends EmailTemplateSummary {
|
|
4218
4299
|
subject: string;
|
|
@@ -4366,6 +4447,13 @@ declare class ScheduledTasksModule {
|
|
|
4366
4447
|
declare class FormsModule {
|
|
4367
4448
|
private http;
|
|
4368
4449
|
constructor(http: HttpClient);
|
|
4450
|
+
/**
|
|
4451
|
+
* Validate form submission data
|
|
4452
|
+
* - Prevents XSS by checking for script tags
|
|
4453
|
+
* - Validates data is a proper object
|
|
4454
|
+
* - Checks for reasonable size limits
|
|
4455
|
+
*/
|
|
4456
|
+
private validateFormData;
|
|
4369
4457
|
/**
|
|
4370
4458
|
* List all forms
|
|
4371
4459
|
*/
|
|
@@ -4396,6 +4484,7 @@ declare class FormsModule {
|
|
|
4396
4484
|
getPublishedForm(slug: string): Promise<PlatformForm>;
|
|
4397
4485
|
/**
|
|
4398
4486
|
* Submit data to a published form (Publishing API - public access)
|
|
4487
|
+
* Validates data before submission to prevent XSS and malicious content
|
|
4399
4488
|
*/
|
|
4400
4489
|
submitForm(slug: string, data: Record<string, unknown>): Promise<PlatformFormSubmission>;
|
|
4401
4490
|
}
|
|
@@ -4407,10 +4496,14 @@ declare class FormsModule {
|
|
|
4407
4496
|
*/
|
|
4408
4497
|
|
|
4409
4498
|
interface PlatformClientConfig {
|
|
4410
|
-
apiUrl
|
|
4499
|
+
apiUrl?: string;
|
|
4411
4500
|
userToken?: string;
|
|
4412
4501
|
credentials?: RequestCredentials;
|
|
4413
4502
|
}
|
|
4503
|
+
/**
|
|
4504
|
+
* Create Platform API config from environment
|
|
4505
|
+
*/
|
|
4506
|
+
declare function createPlatformConfigFromEnv(overrides?: Partial<PlatformClientConfig>): PlatformClientConfig;
|
|
4414
4507
|
declare class PlatformClient extends HttpClient {
|
|
4415
4508
|
entries: EntriesModule;
|
|
4416
4509
|
collections: CollectionsModule;
|
|
@@ -4438,7 +4531,23 @@ declare class PlatformClient extends HttpClient {
|
|
|
4438
4531
|
}
|
|
4439
4532
|
/**
|
|
4440
4533
|
* Create a Platform API client
|
|
4534
|
+
*
|
|
4535
|
+
* @example
|
|
4536
|
+
* ```ts
|
|
4537
|
+
* // From environment (MARVIN_API_URL, MARVIN_USER_TOKEN)
|
|
4538
|
+
* const platform = createPlatformClient();
|
|
4539
|
+
*
|
|
4540
|
+
* // With explicit user token (for programmatic admin)
|
|
4541
|
+
* const platform = createPlatformClient({
|
|
4542
|
+
* userToken: 'user-token-here'
|
|
4543
|
+
* });
|
|
4544
|
+
*
|
|
4545
|
+
* // Browser with session cookies (admin UI)
|
|
4546
|
+
* const platform = createPlatformClient({
|
|
4547
|
+
* credentials: 'include'
|
|
4548
|
+
* });
|
|
4549
|
+
* ```
|
|
4441
4550
|
*/
|
|
4442
|
-
declare function createPlatformClient(config
|
|
4551
|
+
declare function createPlatformClient(config?: Partial<PlatformClientConfig>): PlatformClient;
|
|
4443
4552
|
|
|
4444
|
-
export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule,
|
|
4553
|
+
export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, CollectionsModule, type EmailInvitationRequest, type EmailSettings, type EmailSettingsUpdate, type EmailTemplateCreate, type EmailTemplateRead, type EmailTemplateSummary, type EmailTemplateUpdate, EmailTemplatesClient, EntriesModule, EntryTypesModule, type EventLogEntry, EventLogModule, type EventLogQueryParams, type EventLogSummary, type EventOption, EventsModule, FormsModule, 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 PlatformAssetUpdate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformForm, type PlatformFormCreate, type PlatformFormSubmission, type PlatformFormUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, type ScheduledTask, type ScheduledTaskCreate, type ScheduledTaskExecutionLog, type ScheduledTaskUpdate, ScheduledTasksModule, type StartupInfo, type SystemStatistics, type TaskTypeInfo, type TestEmailRequest, type TestEmailResponse, 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, createPlatformConfigFromEnv };
|
package/dist/platform.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { H as HttpClient } from './HttpClient-
|
|
1
|
+
import { H as HttpClient } from './HttpClient-CdF3IHM1.js';
|
|
2
|
+
import { AuthToken } from './types/index.js';
|
|
2
3
|
|
|
3
4
|
interface components {
|
|
4
5
|
schemas: {
|
|
@@ -3396,9 +3397,19 @@ declare class ResourcesModule {
|
|
|
3396
3397
|
* CRUD operations and file upload for assets
|
|
3397
3398
|
*/
|
|
3398
3399
|
|
|
3400
|
+
interface FileUploadOptions {
|
|
3401
|
+
/** Maximum file size in bytes (default: 100MB) */
|
|
3402
|
+
maxFileSize?: number;
|
|
3403
|
+
/** Allowed MIME types (if not provided, all types allowed) */
|
|
3404
|
+
allowedMimeTypes?: string[];
|
|
3405
|
+
}
|
|
3399
3406
|
declare class AssetsModule {
|
|
3400
3407
|
private http;
|
|
3401
3408
|
constructor(http: HttpClient);
|
|
3409
|
+
/**
|
|
3410
|
+
* Validate file before upload
|
|
3411
|
+
*/
|
|
3412
|
+
private validateFile;
|
|
3402
3413
|
/**
|
|
3403
3414
|
* List all assets
|
|
3404
3415
|
*/
|
|
@@ -3412,9 +3423,22 @@ declare class AssetsModule {
|
|
|
3412
3423
|
*
|
|
3413
3424
|
* @param file - The file to upload (File or Blob)
|
|
3414
3425
|
* @param metadata - Asset metadata (slug, name, altText, description, metadata)
|
|
3426
|
+
* @param options - Upload options (file size limits, allowed types)
|
|
3415
3427
|
* @returns The created asset with extracted metadata
|
|
3428
|
+
*
|
|
3429
|
+
* @example
|
|
3430
|
+
* ```typescript
|
|
3431
|
+
* // Upload with default limits (100MB, all types)
|
|
3432
|
+
* const asset = await assets.upload(file, { slug: 'my-image', name: 'My Image' });
|
|
3433
|
+
*
|
|
3434
|
+
* // Upload with restrictions
|
|
3435
|
+
* const asset = await assets.upload(file,
|
|
3436
|
+
* { slug: 'avatar', name: 'Avatar' },
|
|
3437
|
+
* { maxFileSize: 5 * 1024 * 1024, allowedMimeTypes: ['image/*'] }
|
|
3438
|
+
* );
|
|
3439
|
+
* ```
|
|
3416
3440
|
*/
|
|
3417
|
-
upload(file: File | Blob, metadata: PlatformAssetUpload): Promise<PlatformAsset>;
|
|
3441
|
+
upload(file: File | Blob, metadata: PlatformAssetUpload, options?: FileUploadOptions): Promise<PlatformAsset>;
|
|
3418
3442
|
/**
|
|
3419
3443
|
* Update an asset (editable fields only: slug, name, altText, description, metadata)
|
|
3420
3444
|
*/
|
|
@@ -3423,6 +3447,11 @@ declare class AssetsModule {
|
|
|
3423
3447
|
* Delete an asset (removes file from storage and database)
|
|
3424
3448
|
*/
|
|
3425
3449
|
delete(id: string): Promise<void>;
|
|
3450
|
+
/**
|
|
3451
|
+
* Get download URL for an asset file
|
|
3452
|
+
* Use this to create download links or fetch the file directly
|
|
3453
|
+
*/
|
|
3454
|
+
getDownloadUrl(id: string, baseUrl?: string): string;
|
|
3426
3455
|
}
|
|
3427
3456
|
|
|
3428
3457
|
/**
|
|
@@ -3571,11 +3600,21 @@ interface WorkspaceUpdate {
|
|
|
3571
3600
|
name?: string;
|
|
3572
3601
|
description?: string | null;
|
|
3573
3602
|
}
|
|
3603
|
+
/**
|
|
3604
|
+
* Workspace preferences - dynamic key-value store
|
|
3605
|
+
* Common keys include: theme, locale, notifications, etc.
|
|
3606
|
+
*/
|
|
3574
3607
|
interface WorkspacePreferences {
|
|
3575
|
-
|
|
3608
|
+
theme?: string;
|
|
3609
|
+
locale?: string;
|
|
3610
|
+
notifications?: boolean;
|
|
3611
|
+
[key: string]: unknown;
|
|
3576
3612
|
}
|
|
3577
3613
|
interface WorkspacePreferencesUpdate {
|
|
3578
|
-
|
|
3614
|
+
theme?: string;
|
|
3615
|
+
locale?: string;
|
|
3616
|
+
notifications?: boolean;
|
|
3617
|
+
[key: string]: unknown;
|
|
3579
3618
|
}
|
|
3580
3619
|
declare class WorkspacesModule {
|
|
3581
3620
|
private http;
|
|
@@ -3657,7 +3696,19 @@ declare class InvitesModule {
|
|
|
3657
3696
|
delete(tokenId: string): Promise<void>;
|
|
3658
3697
|
/**
|
|
3659
3698
|
* Generate invitation URL from a token
|
|
3660
|
-
*
|
|
3699
|
+
*
|
|
3700
|
+
* @param token - Invitation token
|
|
3701
|
+
* @param baseUrl - Base URL for the frontend (required in browser environments)
|
|
3702
|
+
* @returns Full invitation URL
|
|
3703
|
+
*
|
|
3704
|
+
* @example
|
|
3705
|
+
* ```typescript
|
|
3706
|
+
* // Node.js (can use env vars)
|
|
3707
|
+
* const url = invites.getInvitationUrl(token);
|
|
3708
|
+
*
|
|
3709
|
+
* // Browser (must provide baseUrl)
|
|
3710
|
+
* const url = invites.getInvitationUrl(token, 'https://app.example.com');
|
|
3711
|
+
* ```
|
|
3661
3712
|
*/
|
|
3662
3713
|
getInvitationUrl(token: string, baseUrl?: string): string;
|
|
3663
3714
|
}
|
|
@@ -3743,6 +3794,10 @@ interface WebhookUpdate {
|
|
|
3743
3794
|
declare class WebhooksModule {
|
|
3744
3795
|
private http;
|
|
3745
3796
|
constructor(http: HttpClient);
|
|
3797
|
+
/**
|
|
3798
|
+
* Validate webhook URL to prevent SSRF attacks
|
|
3799
|
+
*/
|
|
3800
|
+
private validateWebhookUrl;
|
|
3746
3801
|
/**
|
|
3747
3802
|
* List all webhooks for the current workspace
|
|
3748
3803
|
*/
|
|
@@ -3753,10 +3808,12 @@ declare class WebhooksModule {
|
|
|
3753
3808
|
get(id: string): Promise<Webhook>;
|
|
3754
3809
|
/**
|
|
3755
3810
|
* Create a new webhook
|
|
3811
|
+
* Validates URL to prevent SSRF attacks
|
|
3756
3812
|
*/
|
|
3757
3813
|
create(data: WebhookCreate): Promise<Webhook>;
|
|
3758
3814
|
/**
|
|
3759
3815
|
* Update a webhook
|
|
3816
|
+
* Validates URL if provided to prevent SSRF attacks
|
|
3760
3817
|
*/
|
|
3761
3818
|
update(id: string, data: WebhookUpdate): Promise<Webhook>;
|
|
3762
3819
|
/**
|
|
@@ -3836,7 +3893,22 @@ declare class AdminUsersModule {
|
|
|
3836
3893
|
*/
|
|
3837
3894
|
|
|
3838
3895
|
type AdminAboutInfo = components['schemas']['AdminAboutInfo'];
|
|
3896
|
+
/**
|
|
3897
|
+
* Email settings returned from API (read-only)
|
|
3898
|
+
* Password is never returned for security reasons
|
|
3899
|
+
*/
|
|
3839
3900
|
interface EmailSettings {
|
|
3901
|
+
host?: string;
|
|
3902
|
+
port?: number;
|
|
3903
|
+
username?: string;
|
|
3904
|
+
from?: string;
|
|
3905
|
+
useTls?: boolean;
|
|
3906
|
+
}
|
|
3907
|
+
/**
|
|
3908
|
+
* Email settings for updates (write-only)
|
|
3909
|
+
* Password can be provided to update settings
|
|
3910
|
+
*/
|
|
3911
|
+
interface EmailSettingsUpdate {
|
|
3840
3912
|
host?: string;
|
|
3841
3913
|
port?: number;
|
|
3842
3914
|
username?: string;
|
|
@@ -3852,6 +3924,18 @@ interface SystemStatistics {
|
|
|
3852
3924
|
resources?: number;
|
|
3853
3925
|
assets?: number;
|
|
3854
3926
|
}
|
|
3927
|
+
interface StartupInfo {
|
|
3928
|
+
version: string;
|
|
3929
|
+
api_port: number;
|
|
3930
|
+
api_docs: boolean;
|
|
3931
|
+
database_url: string;
|
|
3932
|
+
database_provider: string;
|
|
3933
|
+
default_group?: string;
|
|
3934
|
+
allow_signup: boolean;
|
|
3935
|
+
theme?: string;
|
|
3936
|
+
custom_middleware?: string[];
|
|
3937
|
+
[key: string]: unknown;
|
|
3938
|
+
}
|
|
3855
3939
|
declare class AdminSystemModule {
|
|
3856
3940
|
private http;
|
|
3857
3941
|
constructor(http: HttpClient);
|
|
@@ -3868,7 +3952,7 @@ declare class AdminSystemModule {
|
|
|
3868
3952
|
/**
|
|
3869
3953
|
* Get startup information
|
|
3870
3954
|
*/
|
|
3871
|
-
getStartupInfo(): Promise<
|
|
3955
|
+
getStartupInfo(): Promise<StartupInfo>;
|
|
3872
3956
|
/**
|
|
3873
3957
|
* Get system statistics
|
|
3874
3958
|
*/
|
|
@@ -3879,8 +3963,9 @@ declare class AdminSystemModule {
|
|
|
3879
3963
|
getEmailSettings(): Promise<EmailSettings>;
|
|
3880
3964
|
/**
|
|
3881
3965
|
* Update email settings
|
|
3966
|
+
* Note: Password field is write-only and will not be returned in response
|
|
3882
3967
|
*/
|
|
3883
|
-
updateEmailSettings(data:
|
|
3968
|
+
updateEmailSettings(data: EmailSettingsUpdate): Promise<EmailSettings>;
|
|
3884
3969
|
}
|
|
3885
3970
|
|
|
3886
3971
|
/**
|
|
@@ -4138,10 +4223,6 @@ declare class EventLogModule {
|
|
|
4138
4223
|
* Authenticated session management (logout, refresh)
|
|
4139
4224
|
*/
|
|
4140
4225
|
|
|
4141
|
-
interface AuthToken {
|
|
4142
|
-
accessToken: string;
|
|
4143
|
-
tokenType: string;
|
|
4144
|
-
}
|
|
4145
4226
|
declare class AuthModule {
|
|
4146
4227
|
private http;
|
|
4147
4228
|
constructor(http: HttpClient);
|
|
@@ -4212,7 +4293,7 @@ interface EmailTemplateSummary {
|
|
|
4212
4293
|
description?: string;
|
|
4213
4294
|
enabled: boolean;
|
|
4214
4295
|
created_at: string;
|
|
4215
|
-
|
|
4296
|
+
updated_at: string;
|
|
4216
4297
|
}
|
|
4217
4298
|
interface EmailTemplateRead extends EmailTemplateSummary {
|
|
4218
4299
|
subject: string;
|
|
@@ -4366,6 +4447,13 @@ declare class ScheduledTasksModule {
|
|
|
4366
4447
|
declare class FormsModule {
|
|
4367
4448
|
private http;
|
|
4368
4449
|
constructor(http: HttpClient);
|
|
4450
|
+
/**
|
|
4451
|
+
* Validate form submission data
|
|
4452
|
+
* - Prevents XSS by checking for script tags
|
|
4453
|
+
* - Validates data is a proper object
|
|
4454
|
+
* - Checks for reasonable size limits
|
|
4455
|
+
*/
|
|
4456
|
+
private validateFormData;
|
|
4369
4457
|
/**
|
|
4370
4458
|
* List all forms
|
|
4371
4459
|
*/
|
|
@@ -4396,6 +4484,7 @@ declare class FormsModule {
|
|
|
4396
4484
|
getPublishedForm(slug: string): Promise<PlatformForm>;
|
|
4397
4485
|
/**
|
|
4398
4486
|
* Submit data to a published form (Publishing API - public access)
|
|
4487
|
+
* Validates data before submission to prevent XSS and malicious content
|
|
4399
4488
|
*/
|
|
4400
4489
|
submitForm(slug: string, data: Record<string, unknown>): Promise<PlatformFormSubmission>;
|
|
4401
4490
|
}
|
|
@@ -4407,10 +4496,14 @@ declare class FormsModule {
|
|
|
4407
4496
|
*/
|
|
4408
4497
|
|
|
4409
4498
|
interface PlatformClientConfig {
|
|
4410
|
-
apiUrl
|
|
4499
|
+
apiUrl?: string;
|
|
4411
4500
|
userToken?: string;
|
|
4412
4501
|
credentials?: RequestCredentials;
|
|
4413
4502
|
}
|
|
4503
|
+
/**
|
|
4504
|
+
* Create Platform API config from environment
|
|
4505
|
+
*/
|
|
4506
|
+
declare function createPlatformConfigFromEnv(overrides?: Partial<PlatformClientConfig>): PlatformClientConfig;
|
|
4414
4507
|
declare class PlatformClient extends HttpClient {
|
|
4415
4508
|
entries: EntriesModule;
|
|
4416
4509
|
collections: CollectionsModule;
|
|
@@ -4438,7 +4531,23 @@ declare class PlatformClient extends HttpClient {
|
|
|
4438
4531
|
}
|
|
4439
4532
|
/**
|
|
4440
4533
|
* Create a Platform API client
|
|
4534
|
+
*
|
|
4535
|
+
* @example
|
|
4536
|
+
* ```ts
|
|
4537
|
+
* // From environment (MARVIN_API_URL, MARVIN_USER_TOKEN)
|
|
4538
|
+
* const platform = createPlatformClient();
|
|
4539
|
+
*
|
|
4540
|
+
* // With explicit user token (for programmatic admin)
|
|
4541
|
+
* const platform = createPlatformClient({
|
|
4542
|
+
* userToken: 'user-token-here'
|
|
4543
|
+
* });
|
|
4544
|
+
*
|
|
4545
|
+
* // Browser with session cookies (admin UI)
|
|
4546
|
+
* const platform = createPlatformClient({
|
|
4547
|
+
* credentials: 'include'
|
|
4548
|
+
* });
|
|
4549
|
+
* ```
|
|
4441
4550
|
*/
|
|
4442
|
-
declare function createPlatformClient(config
|
|
4551
|
+
declare function createPlatformClient(config?: Partial<PlatformClientConfig>): PlatformClient;
|
|
4443
4552
|
|
|
4444
|
-
export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule,
|
|
4553
|
+
export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, CollectionsModule, type EmailInvitationRequest, type EmailSettings, type EmailSettingsUpdate, type EmailTemplateCreate, type EmailTemplateRead, type EmailTemplateSummary, type EmailTemplateUpdate, EmailTemplatesClient, EntriesModule, EntryTypesModule, type EventLogEntry, EventLogModule, type EventLogQueryParams, type EventLogSummary, type EventOption, EventsModule, FormsModule, 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 PlatformAssetUpdate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformForm, type PlatformFormCreate, type PlatformFormSubmission, type PlatformFormUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, type ScheduledTask, type ScheduledTaskCreate, type ScheduledTaskExecutionLog, type ScheduledTaskUpdate, ScheduledTasksModule, type StartupInfo, type SystemStatistics, type TaskTypeInfo, type TestEmailRequest, type TestEmailResponse, 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, createPlatformConfigFromEnv };
|