@sylphx/sdk 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { SdkBillingPlan, SdkBillingSubscription, BillingCheckoutRequest, BillingCheckoutResponse, BillingPortalRequest, BillingPortalResponse, BillingBalanceResponse, BillingUsageResponse, SdkConsentType, UserConsent as UserConsent$1, AIModel as AIModel$1, GetModelsResponse, GetRateLimitResponse, GetUsageResponse, ReferralLeaderboardEntry, ReferralRewardDefaults as ReferralRewardDefaults$1, WebhookDelivery as WebhookDelivery$1, DeviceApproveRequest, DeviceApproveResponse, DeviceDenyRequest, DeviceDenyResponse, DeviceInitResponse, DeviceInitRequest, DevicePollResponse, LoginRequest as LoginRequest$1, LoginResponse as LoginResponse$1, UserFullProfile as UserFullProfile$1, LogoutInput, PlatformPasswordChangeRequest, PlatformPasswordChangeResponse, PlatformPasswordSetRequest, PlatformPasswordSetResponse, PlatformPasswordStatusResponse, RefreshTokenInput, RefreshTokenResult, PlatformSessionRenameRequest, PlatformSessionRenameResponse, PlatformSessionRevokeAllResponse, PlatformSessionRevokeRequest, PlatformSessionRevokeOtherResponse, PlatformSessionRevokeResponse, PlatformSessionsListResponse, AuthUserDeleteRequest, AuthUserDeleteResponse, AuthUserExportResponse, RegisterRequest as RegisterRequest$1, RegisterResponse as RegisterResponse$1, ResendEmailVerificationRequest as ResendEmailVerificationRequest$1, ResendEmailVerificationResponse as ResendEmailVerificationResponse$1, AuthTokensResponse, TwoFactorVerifyRequest as TwoFactorVerifyRequest$1, OAuthIntrospectResponse, PlatformAuditQueryRequest, PlatformAuditQueryResponse, PlatformRateLimitStatusRequest, PlatformRateLimitStatusResponse, PlatformRateLimitStrategiesListRequest, PlatformRateLimitStrategiesListResponse, PlatformRateLimitStrategyDeleteRequest, PlatformRateLimitStrategyDeleteResponse, PlatformRateLimitStrategyUpsertRequest, PlatformRateLimitStrategyUpsertResponse, CreateOrgInput as CreateOrgInput$1, InviteMemberInput as InviteMemberInput$1, OrgSdkRole, OrgInvitation, OrgMember, MembershipInfo, UpdateOrgInput as UpdateOrgInput$1, Organization } from '@sylphx/contract';
2
- export { BillingBalanceResponse as BalanceResponse, BillingCheckoutRequest as CheckoutRequest, BillingCheckoutResponse as CheckoutResponse, Organization, BillingPortalRequest as PortalRequest, BillingPortalResponse as PortalResponse, BillingUsageResponse as UsageResponse } from '@sylphx/contract';
1
+ import { SdkBillingPlan, SdkBillingSubscription, BillingCheckoutRequest, BillingCheckoutResponse, BillingPortalRequest, BillingPortalResponse, BillingBalanceResponse, BillingUsageResponse, SdkConsentType, UserConsent as UserConsent$1, AIModel as AIModel$1, GetModelsResponse, GetRateLimitResponse, GetUsageResponse, ReferralLeaderboardEntry, ReferralRewardDefaults as ReferralRewardDefaults$1, WebhookDelivery as WebhookDelivery$1, DeviceApproveRequest, DeviceApproveResponse, DeviceDenyRequest, DeviceDenyResponse, DeviceInitResponse, DeviceInitRequest, DevicePollResponse, LoginRequest as LoginRequest$1, LoginResponse as LoginResponse$1, UserFullProfile as UserFullProfile$1, LogoutInput, PlatformPasswordChangeRequest, PlatformPasswordChangeResponse, PlatformPasswordSetRequest, PlatformPasswordSetResponse, PlatformPasswordStatusResponse, RefreshTokenInput, RefreshTokenResult, PlatformSessionRenameRequest, PlatformSessionRenameResponse, PlatformSessionRevokeAllResponse, PlatformSessionRevokeRequest, PlatformSessionRevokeOtherResponse, PlatformSessionRevokeResponse, PlatformSessionsListResponse, AuthUserDeleteRequest, AuthUserDeleteResponse, AuthUserExportResponse, RegisterRequest as RegisterRequest$1, RegisterResponse as RegisterResponse$1, ResendEmailVerificationRequest as ResendEmailVerificationRequest$1, ResendEmailVerificationResponse as ResendEmailVerificationResponse$1, AuthTokensResponse, TwoFactorVerifyRequest as TwoFactorVerifyRequest$1, OAuthIntrospectResponse, PlatformAuditQueryRequest, PlatformAuditQueryResponse, PlatformRateLimitStatusRequest, PlatformRateLimitStatusResponse, PlatformRateLimitStrategiesListRequest, PlatformRateLimitStrategiesListResponse, PlatformRateLimitStrategyDeleteRequest, PlatformRateLimitStrategyDeleteResponse, PlatformRateLimitStrategyUpsertRequest, PlatformRateLimitStrategyUpsertResponse, File as File$1, UploadId, FileId, FileVersion, FileVersionId, CreateOrgInput as CreateOrgInput$1, InviteMemberInput as InviteMemberInput$1, OrgSdkRole, OrgInvitation, OrgMember, MembershipInfo, UpdateOrgInput as UpdateOrgInput$1, Organization } from '@sylphx/contract';
2
+ export { BillingBalanceResponse as BalanceResponse, BillingCheckoutRequest as CheckoutRequest, BillingCheckoutResponse as CheckoutResponse, FileId, FileVersion, FileVersionId, FileVisibility, Organization, BillingPortalRequest as PortalRequest, BillingPortalResponse as PortalResponse, SignedUrlDisposition, File as StorageFile, UploadId, BillingUsageResponse as UsageResponse } from '@sylphx/contract';
3
3
 
4
4
  /**
5
5
  * Functions Admin namespace — Platform-plane function-bundle admin
@@ -95,7 +95,7 @@ interface PlatformRealtimeDeleteChannelResult {
95
95
  *
96
96
  * Invariants:
97
97
  * - Protocol is always `sylphx:` (no exceptions)
98
- * - Credential matches `(pk|sk)_(dev|stg|prod|prev)_[a-f0-9]{32,64}`
98
+ * - Credential matches `(pk|sk)_(dev|stg|prod|prev)(_{ref})?_{hex}`
99
99
  * - Host's first DNS label is the resource slug (validated by slug regex)
100
100
  * - `apiBaseUrl` is always HTTPS, with `/v{version}` appended (default `v1`)
101
101
  *
@@ -135,7 +135,7 @@ declare class InvalidConnectionUrlError extends Error {
135
135
  * import { createClient } from '@sylphx/sdk'
136
136
  *
137
137
  * const sylphx = createClient(process.env.SYLPHX_URL!)
138
- * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
138
+ * // Parses: sylphx://pk_prod_{ref?}_{hex}@bold-river-a1b2c3.api.sylphx.com
139
139
  * ```
140
140
  */
141
141
 
@@ -207,7 +207,7 @@ interface SylphxClientInput {
207
207
  * @example Connection URL (recommended)
208
208
  * ```typescript
209
209
  * const sylphx = createClient(process.env.NEXT_PUBLIC_SYLPHX_URL!)
210
- * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
210
+ * // Parses: sylphx://pk_prod_{ref?}_{hex}@bold-river-a1b2c3.api.sylphx.com
211
211
  * ```
212
212
  *
213
213
  * @example Explicit components
@@ -228,7 +228,7 @@ declare function createClient(input: string | SylphxClientInput): SylphxConfig;
228
228
  * @example Connection URL (recommended)
229
229
  * ```typescript
230
230
  * const sylphx = createServerClient(process.env.SYLPHX_SECRET_URL!)
231
- * // Parses: sylphx://sk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
231
+ * // Parses: sylphx://sk_prod_{ref?}_{hex}@bold-river-a1b2c3.api.sylphx.com
232
232
  * ```
233
233
  *
234
234
  * @example Explicit components
@@ -354,7 +354,7 @@ declare function installGlobalDebugHelpers(): void;
354
354
  * import { createRestClient } from '@sylphx/sdk'
355
355
  *
356
356
  * const client = createRestClient({
357
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
357
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
358
358
  * })
359
359
  *
360
360
  * const { data: user, error } = await client.GET('/auth/me')
@@ -488,6 +488,10 @@ interface Middleware {
488
488
  onRequest?: (ctx: {
489
489
  request: Request;
490
490
  }) => Promise<Request | undefined> | Request | undefined;
491
+ onFetch?: (ctx: {
492
+ request: Request;
493
+ next: (request: Request) => Promise<Response>;
494
+ }) => Promise<Response | undefined> | Response | undefined;
491
495
  onResponse?: (ctx: {
492
496
  request: Request;
493
497
  response: Response;
@@ -573,7 +577,7 @@ declare function getCircuitBreakerState(): {
573
577
  * @example
574
578
  * ```typescript
575
579
  * const client = createRestClient({
576
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
580
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
577
581
  * })
578
582
  *
579
583
  * const { data: user } = await client.GET('/auth/me')
@@ -594,7 +598,7 @@ declare function createRestClient(config: RestClientConfig): RestClient;
594
598
  * @example
595
599
  * ```typescript
596
600
  * const client = createDynamicRestClient({
597
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
601
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
598
602
  * getAccessToken: async () => (await cookies()).get('session')?.value,
599
603
  * })
600
604
  * ```
@@ -1912,6 +1916,18 @@ interface OrgTokenPayload {
1912
1916
  /** RBAC role key (e.g. "hr_manager", "admin"). Permissions resolved server-side. */
1913
1917
  org_role: string;
1914
1918
  }
1919
+ interface OrgScopedTokenResponse {
1920
+ /** Org-scoped access token. */
1921
+ token: string;
1922
+ /** Org-scoped access token, matching the SDK's token naming convention. */
1923
+ accessToken: string;
1924
+ /** Token lifetime in seconds, when provided by the runtime. */
1925
+ expiresIn?: number;
1926
+ /** Bearer token type, when provided by the runtime. */
1927
+ tokenType?: string;
1928
+ /** User envelope returned by the runtime for session hydration. */
1929
+ user?: User;
1930
+ }
1915
1931
  /**
1916
1932
  * Invite a user request payload.
1917
1933
  */
@@ -2129,9 +2145,14 @@ declare function inviteUser(config: SylphxConfig, input: InviteUserRequest): Pro
2129
2145
  * The returned access_token JWT includes org_id, org_slug, org_role claims.
2130
2146
  *
2131
2147
  * @example
2132
- * const tokens = await switchOrg(withToken(config, currentToken), 'org_xxx')
2148
+ * const { token } = await getOrgScopedToken(withToken(config, currentToken), 'org_xxx')
2149
+ */
2150
+ declare function getOrgScopedToken(config: SylphxConfig, orgId: string): Promise<OrgScopedTokenResponse>;
2151
+ /**
2152
+ * @deprecated Use getOrgScopedToken(config, orgId). Kept as the shorter
2153
+ * organization switch alias for existing SDK callers.
2133
2154
  */
2134
- declare function switchOrg(config: SylphxConfig, orgId: string): Promise<TokenResponse>;
2155
+ declare function switchOrg(config: SylphxConfig, orgId: string): Promise<OrgScopedTokenResponse>;
2135
2156
  type DeviceInitInput = DeviceInitRequest;
2136
2157
  type DeviceGrant = DeviceInitResponse;
2137
2158
  type DevicePollResult = DevicePollResponse;
@@ -3371,7 +3392,7 @@ interface StreamMessage<T = unknown> {
3371
3392
  * import { createConfig, realtimeEmit } from '@sylphx/sdk'
3372
3393
  *
3373
3394
  * // Server: emit events to connected clients
3374
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY! })
3395
+ * const config = createConfig({ secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey! })
3375
3396
  * await realtimeEmit(config, {
3376
3397
  * channel: 'orders',
3377
3398
  * event: 'order.created',
@@ -3684,320 +3705,132 @@ declare function createTracker(config: SylphxConfig, defaultAnonymousId?: string
3684
3705
  getAnonymousId: () => string;
3685
3706
  };
3686
3707
 
3687
- interface UploadProgressEvent {
3688
- /** Bytes uploaded */
3689
- loaded: number;
3690
- /** Total bytes */
3691
- total: number;
3692
- /** Progress percentage (0-100) */
3693
- progress: number;
3694
- }
3695
- interface UploadResult {
3696
- /** Public URL of uploaded file */
3697
- url: string;
3698
- /** File path/key in storage */
3699
- pathname: string;
3700
- /** Content type */
3701
- contentType: string;
3702
- /** File size in bytes */
3703
- size: number;
3704
- }
3705
-
3706
3708
  /**
3707
- * Storage Functions
3709
+ * Storage SDK — pure functional, namespaced. Per ADR-100.
3708
3710
  *
3709
- * Pure functions for file storage operations.
3711
+ * Wire is the contract in `@sylphx/contract` (`schemas/storage.ts` +
3712
+ * `endpoints/storage.ts`). This module is the only public surface for
3713
+ * uploads / files; consumers import the `storage` namespace.
3710
3714
  *
3711
- * ## Industry Patterns Implemented
3712
- * - AbortController cancellation (Vercel Blob pattern)
3713
- * - Exponential backoff with jitter (AWS S3 pattern: 5 retries, 1s base)
3714
- * - Concurrent chunk uploads (Vercel pattern: 3 concurrent)
3715
+ * Features (built-in defaults, ADR-100 §2.8):
3716
+ * - Idempotency-Key auto-generated (UUIDv7) on every POST
3717
+ * - Single-part PUT or multipart, picked server-side from `size`
3718
+ * - Streaming SHA-256 via the Web Crypto API
3719
+ * - Resumable: persists `(uploadId, completedParts[])` to localStorage when available
3720
+ * - AbortSignal cancellation; auto-DELETE upload session on abort
3721
+ * - Exponential backoff with full jitter (5 retries, 1s base, 30s cap)
3722
+ * - Progress: byte-accurate via XHR (browser) or stream sampling (node)
3715
3723
  *
3716
- * Wire-shape types are re-exported from `@sylphx/contract` (ADR-084). The
3717
- * contract is the single source of truth — this module only adds ergonomic
3718
- * aliases (`StorageFile`, `UploadUrlRequest`, `UploadUrlResponse`) and local
3719
- * convenience shapes (`FileInfo`, `FileUploadOptions`, `SignedUrlOptions`,
3720
- * `SignedUrlResult`) that pre-date the contract and are preserved for SDK
3721
- * surface compatibility.
3724
+ * No vendor SDKs. Pure `fetch` + `XMLHttpRequest`.
3722
3725
  */
3723
3726
 
3724
- interface FileUploadOptions {
3725
- /** Folder path */
3726
- path?: string;
3727
- /** File type (file, avatar, etc.) */
3728
- type?: 'file' | 'avatar';
3729
- /** User ID (for avatar uploads) */
3730
- userId?: string;
3731
- /** Progress callback */
3732
- onProgress?: (event: UploadProgressEvent) => void;
3733
- /**
3734
- * Enable multipart upload for large files.
3735
- * - `true`: Always use multipart upload
3736
- * - `false`: Never use multipart upload
3737
- * - `'auto'` (default): Auto-enable for files > 5MB
3738
- *
3739
- * Multipart uploads support files up to 5TB with better
3740
- * reliability for large files.
3741
- */
3742
- multipart?: boolean | 'auto';
3743
- /**
3744
- * AbortSignal to cancel the upload.
3745
- * Vercel Blob pattern - enables cancellation of in-progress uploads.
3746
- *
3747
- * @example
3748
- * ```typescript
3749
- * const controller = new AbortController()
3750
- * // Cancel after 30 seconds
3751
- * setTimeout(() => controller.abort(), 30000)
3752
- * await uploadFile(config, file, { signal: controller.signal })
3753
- * ```
3754
- */
3727
+ interface UploadProgressEvent {
3728
+ loaded: number;
3729
+ total: number;
3730
+ partsCompleted: number;
3731
+ partsTotal: number;
3732
+ }
3733
+ interface UploadCreateOptions {
3734
+ /** Logical name; preserved as metadata. Defaults to `blob.name` if `File`. */
3735
+ filename?: string;
3736
+ /** MIME type override; defaults to `blob.type` or `application/octet-stream`. */
3737
+ contentType?: string;
3738
+ /** Logical folder path within the project namespace. */
3739
+ folder?: string;
3740
+ /** Defaults to `'private'`. */
3741
+ visibility?: 'public' | 'private';
3742
+ /** Arbitrary user-attached metadata. */
3743
+ metadata?: Record<string, unknown>;
3744
+ /** Pre-computed SHA-256 (hex). If absent, the SDK computes it. */
3745
+ checksumSha256?: string;
3746
+ /** Fail when a file already exists at `(folder, filename)`. */
3747
+ ifNoneMatch?: '*';
3748
+ /** Cancellation. Aborts in-flight PUTs and triggers `DELETE /uploads/{id}`. */
3755
3749
  signal?: AbortSignal;
3756
- /**
3757
- * Idempotency key for safe retries (Stripe pattern)
3758
- *
3759
- * Prevents duplicate uploads if the same request is retried.
3760
- * Use a unique key per logical upload operation.
3761
- *
3762
- * @example `upload-${userId}-${fileName}-${fileHash}`
3763
- */
3750
+ /** Override the auto-generated UUIDv7 idempotency key. */
3764
3751
  idempotencyKey?: string;
3752
+ /** Progress callback. */
3753
+ onProgress?: (event: UploadProgressEvent) => void;
3765
3754
  }
3766
- interface FileInfo {
3767
- id: string;
3768
- url: string;
3769
- name: string;
3770
- size: number;
3771
- contentType: string;
3772
- isPrivate: boolean;
3773
- createdAt: string;
3755
+ interface ListFilesOptions {
3756
+ folder?: string;
3757
+ cursor?: string;
3758
+ limit?: number;
3759
+ includeDeleted?: boolean;
3774
3760
  }
3775
3761
  interface SignedUrlOptions {
3776
- /** Expiration in seconds (default: 3600, max: 604800 = 7 days) */
3777
3762
  expiresIn?: number;
3778
- /** Force download (attachment) vs inline display (default: attachment) */
3779
3763
  disposition?: 'attachment' | 'inline';
3780
- /** Restrict access to specific user */
3781
3764
  userId?: string;
3782
3765
  }
3783
- interface SignedUrlResult {
3784
- /** The signed download URL */
3785
- url: string;
3786
- /** When the URL expires (ISO string) */
3787
- expiresAt: string;
3788
- /** File metadata */
3789
- file: {
3790
- id: string;
3791
- filename: string;
3792
- mimeType: string;
3793
- sizeBytes: number;
3794
- isPrivate: boolean;
3795
- };
3766
+ interface CopyFileOptions {
3767
+ folder?: string;
3768
+ filename?: string;
3769
+ visibility?: 'public' | 'private';
3770
+ metadata?: Record<string, unknown>;
3796
3771
  }
3797
- /**
3798
- * Upload a file to storage
3799
- *
3800
- * Uses client-side upload for optimal performance (direct to CDN).
3801
- *
3802
- * ## Industry-Standard Features
3803
- * - **Cancellation**: AbortController support (Vercel Blob pattern)
3804
- * - **Retry**: Exponential backoff with jitter (AWS S3 pattern: 5 retries)
3805
- * - **Progress**: Real-time upload progress tracking
3806
- *
3807
- * ## File Size Limits
3808
- * - Standard uploads: up to 500MB
3809
- * - For files > 500MB: use React hooks with `multipart: true` (supports up to 5TB)
3810
- *
3811
- * ## Multipart Uploads
3812
- * For large files (> 5MB), multipart uploads provide:
3813
- * - Better reliability with chunked uploads
3814
- * - Resumable upload capability
3815
- * - Progress tracking per chunk
3816
- *
3817
- * Use the `multipart` option or React hooks for large files:
3818
- * ```typescript
3819
- * // React hooks (recommended for large files)
3820
- * const { upload } = useStorage()
3821
- * await upload(file, { multipart: true })
3822
- * ```
3823
- *
3824
- * @example
3825
- * ```typescript
3826
- * const file = new File(['Hello'], 'hello.txt', { type: 'text/plain' })
3827
- * const result = await uploadFile(config, file, {
3828
- * path: 'documents',
3829
- * onProgress: (e) => console.log(`${e.progress}%`),
3830
- * })
3831
- *
3832
- * console.log(result.url)
3833
- * ```
3834
- *
3835
- * @example Cancellation
3836
- * ```typescript
3837
- * const controller = new AbortController()
3838
- * setTimeout(() => controller.abort(), 30000) // Cancel after 30s
3839
- *
3840
- * try {
3841
- * await uploadFile(config, file, { signal: controller.signal })
3842
- * } catch (e) {
3843
- * if (e.name === 'AbortError') {
3844
- * console.log('Upload cancelled')
3845
- * }
3846
- * }
3847
- * ```
3848
- */
3849
- declare function uploadFile(config: SylphxConfig, file: File, options?: FileUploadOptions): Promise<UploadResult>;
3850
- /**
3851
- * Upload a user avatar
3852
- *
3853
- * @example
3854
- * ```typescript
3855
- * const avatar = await uploadAvatar(config, file, 'user-123')
3856
- * console.log(avatar.url)
3857
- * ```
3858
- */
3859
- declare function uploadAvatar(config: SylphxConfig, file: File, userId: string, options?: Pick<FileUploadOptions, 'onProgress'>): Promise<UploadResult>;
3860
- /**
3861
- * Delete a file
3862
- *
3863
- * @example
3864
- * ```typescript
3865
- * await deleteFile(config, 'file-123')
3866
- * ```
3867
- */
3868
- declare function deleteFile(config: SylphxConfig, fileId: string): Promise<void>;
3869
- /**
3870
- * Get a file's URL by ID
3871
- *
3872
- * @example
3873
- * ```typescript
3874
- * const url = await getFileUrl(config, 'file-123')
3875
- * ```
3876
- */
3877
- declare function getFileUrl(config: SylphxConfig, fileId: string): Promise<string>;
3878
- /**
3879
- * Get file info by ID
3880
- *
3881
- * @example
3882
- * ```typescript
3883
- * const info = await getFileInfo(config, 'file-123')
3884
- * console.log(info.name, info.size)
3885
- * ```
3886
- */
3887
- declare function getFileInfo(config: SylphxConfig, fileId: string): Promise<FileInfo>;
3888
- /**
3889
- * A single version of a stored file. Mirrors the contract
3890
- * `StorageFileVersion` shape.
3891
- */
3892
- interface StorageFileVersion {
3893
- id: string;
3894
- fileId: string;
3895
- versionNumber: number;
3896
- sizeBytes: number;
3897
- contentType: string | null;
3898
- checksumSha256: string | null;
3899
- createdAt: string;
3900
- createdBy: string | null;
3901
- isCurrent: boolean;
3772
+ declare function uploadsCreate(config: SylphxConfig, blob: Blob | File, options: UploadCreateOptions): Promise<File$1>;
3773
+ declare function uploadsAbort(config: SylphxConfig, uploadId: UploadId | string): Promise<void>;
3774
+ interface ListPage {
3775
+ files: File$1[];
3776
+ nextCursor: string | null;
3902
3777
  }
3778
+ declare function filesList(config: SylphxConfig, options?: ListFilesOptions): AsyncIterable<File$1> & {
3779
+ fetchPage: (cursor?: string) => Promise<ListPage>;
3780
+ };
3781
+ declare function filesGet(config: SylphxConfig, fileId: FileId | string): Promise<File$1>;
3782
+ declare function filesDelete(config: SylphxConfig, fileId: FileId | string): Promise<{
3783
+ id: FileId;
3784
+ isDeleted: true;
3785
+ }>;
3786
+ declare function filesRestore(config: SylphxConfig, fileId: FileId | string): Promise<File$1>;
3787
+ declare function filesSignedUrl(config: SylphxConfig, fileId: FileId | string, options?: SignedUrlOptions): Promise<{
3788
+ url: string;
3789
+ expiresAt: string;
3790
+ file: File$1;
3791
+ }>;
3792
+ declare function filesCopy(config: SylphxConfig, fileId: FileId | string, options: CopyFileOptions): Promise<File$1>;
3793
+ declare function filesVersionsList(config: SylphxConfig, fileId: FileId | string): Promise<FileVersion[]>;
3794
+ declare function filesVersionsRestore(config: SylphxConfig, fileId: FileId | string, versionId: FileVersionId | string): Promise<{
3795
+ file: File$1;
3796
+ version: FileVersion;
3797
+ }>;
3903
3798
  /**
3904
- * List all versions of a file, newest first.
3905
- *
3906
- * Versions beyond the per-file retention cap (default 10) are pruned
3907
- * automatically on each upload — this list reflects the retained window.
3908
- *
3909
- * @example
3910
- * ```ts
3911
- * const versions = await listFileVersions(config, 'file_abc')
3912
- * const current = versions.find(v => v.isCurrent)
3913
- * ```
3914
- */
3915
- declare function listFileVersions(config: SylphxConfig, fileId: string): Promise<StorageFileVersion[]>;
3916
- /**
3917
- * Restore an older version as the new current. The operation creates a
3918
- * NEW version row pointing at the old object — the old row is NOT
3919
- * mutated, preserving the audit trail.
3920
- *
3921
- * Rate-limited to 10/min/project.
3922
- *
3923
- * @example
3924
- * ```ts
3925
- * const restored = await restoreFileVersion(config, 'file_abc', 'fver_xyz')
3926
- * console.log(restored.versionNumber) // e.g. 5 (the new current version #)
3927
- * ```
3928
- */
3929
- declare function restoreFileVersion(config: SylphxConfig, fileId: string, versionId: string): Promise<StorageFileVersion>;
3930
- /**
3931
- * Soft-delete a file. The version history is retained so
3932
- * {@link restoreFile} can reverse the operation.
3933
- *
3934
- * This is an alias of {@link deleteFile} — the SDK `deleteFile` function
3935
- * ALSO soft-deletes (ADR-089 Phase 5.8 changed DELETE semantics from
3936
- * hard-delete to soft-delete). `softDeleteFile` is the explicit name for
3937
- * code clarity.
3938
- *
3939
- * @example
3940
- * ```ts
3941
- * await softDeleteFile(config, 'file_abc')
3942
- * // Later…
3943
- * await restoreFile(config, 'file_abc')
3944
- * ```
3945
- */
3946
- declare function softDeleteFile(config: SylphxConfig, fileId: string): Promise<void>;
3947
- /**
3948
- * Reverse a soft-delete. Fails if the file is not currently soft-deleted
3949
- * (explicit over silent to catch admin-UI bugs).
3950
- *
3951
- * @example
3952
- * ```ts
3953
- * const file = await restoreFile(config, 'file_abc')
3954
- * ```
3955
- */
3956
- declare function restoreFile(config: SylphxConfig, fileId: string): Promise<FileInfo>;
3957
- /**
3958
- * Download the payload of a specific historical version via a short-lived
3959
- * signed URL. Useful for diffing current vs a previous version or serving
3960
- * an older variant to an admin audit UI.
3961
- *
3962
- * Internally calls {@link getSignedUrl} after flipping the version to be
3963
- * "temporarily current" would NOT be safe, so instead the server minted
3964
- * URL carries the explicit `versionId`. The resulting blob is streamed
3965
- * directly from storage — no server round-trip for the bytes.
3799
+ * `storage` namespace the only public surface for storage in `@sylphx/sdk`.
3966
3800
  *
3967
3801
  * @example
3968
3802
  * ```ts
3969
- * const blob = await downloadFileVersion(config, 'file_abc', 'fver_xyz')
3970
- * const bytes = new Uint8Array(await blob.arrayBuffer())
3971
- * ```
3972
- */
3973
- declare function downloadFileVersion(config: SylphxConfig, fileId: string, versionId: string): Promise<Blob>;
3974
- /**
3975
- * Generate a signed URL for accessing a private file
3976
- *
3977
- * Signed URLs provide time-limited access to private files without
3978
- * exposing permanent URLs. Useful for:
3979
- * - Secure document downloads
3980
- * - Private media streaming
3981
- * - Temporary file sharing
3803
+ * import { storage } from '@sylphx/sdk'
3982
3804
  *
3983
- * @example
3984
- * ```typescript
3985
- * // Generate a download URL valid for 1 hour
3986
- * const { url, expiresAt } = await getSignedUrl(config, 'file-123')
3987
- *
3988
- * // Generate an inline preview URL valid for 5 minutes
3989
- * const preview = await getSignedUrl(config, 'file-123', {
3990
- * expiresIn: 300,
3991
- * disposition: 'inline',
3805
+ * const file = await storage.uploads.create(config, blob, {
3806
+ * filename: 'report.pdf',
3807
+ * folder: 'documents',
3808
+ * onProgress: (e) => console.log(`${e.loaded}/${e.total}`),
3992
3809
  * })
3993
3810
  *
3994
- * // Restrict access to a specific user
3995
- * const userOnly = await getSignedUrl(config, 'file-123', {
3996
- * userId: 'user-456',
3997
- * })
3811
+ * for await (const f of storage.files.list(config, { folder: 'documents' })) {
3812
+ * console.log(f.id, f.filename)
3813
+ * }
3998
3814
  * ```
3999
3815
  */
4000
- declare function getSignedUrl(config: SylphxConfig, fileId: string, options?: SignedUrlOptions): Promise<SignedUrlResult>;
3816
+ declare const storage: {
3817
+ readonly uploads: {
3818
+ readonly create: typeof uploadsCreate;
3819
+ readonly abort: typeof uploadsAbort;
3820
+ };
3821
+ readonly files: {
3822
+ readonly list: typeof filesList;
3823
+ readonly get: typeof filesGet;
3824
+ readonly delete: typeof filesDelete;
3825
+ readonly restore: typeof filesRestore;
3826
+ readonly signedUrl: typeof filesSignedUrl;
3827
+ readonly copy: typeof filesCopy;
3828
+ readonly versions: {
3829
+ readonly list: typeof filesVersionsList;
3830
+ readonly restore: typeof filesVersionsRestore;
3831
+ };
3832
+ };
3833
+ };
4001
3834
 
4002
3835
  /**
4003
3836
  * Push Notification Service Worker Template
@@ -6262,7 +6095,7 @@ declare function assignMemberRole(config: SylphxConfig, orgIdOrSlug: string, mem
6262
6095
  * import { createConfig, getSecret, getSecrets, listSecretKeys } from '@sylphx/sdk'
6263
6096
  *
6264
6097
  * const config = createConfig({
6265
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
6098
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
6266
6099
  * })
6267
6100
  *
6268
6101
  * // Get a single secret
@@ -6413,7 +6246,7 @@ declare function getAllSecrets(config: SylphxConfig, environmentId?: string): Pr
6413
6246
  * import { createConfig, indexDocument, search, batchIndex } from '@sylphx/sdk'
6414
6247
  *
6415
6248
  * const config = createConfig({
6416
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
6249
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
6417
6250
  * })
6418
6251
  *
6419
6252
  * // Index a document
@@ -6829,7 +6662,7 @@ declare function trackClick(config: SylphxConfig, input: TrackClickInput): Promi
6829
6662
  * ```ts
6830
6663
  * import { createConfig, getDatabaseConnectionString } from '@sylphx/sdk'
6831
6664
  *
6832
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY! })
6665
+ * const config = createConfig({ secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey! })
6833
6666
  * const { connectionString } = await getDatabaseConnectionString(config)
6834
6667
  *
6835
6668
  * const pool = new Pool({ connectionString })
@@ -6944,7 +6777,7 @@ interface KvZMember {
6944
6777
  * ```ts
6945
6778
  * import { createConfig, kvSet, kvGet, kvDelete } from '@sylphx/sdk'
6946
6779
  *
6947
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY! })
6780
+ * const config = createConfig({ secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey! })
6948
6781
  *
6949
6782
  * // Basic key-value operations
6950
6783
  * await kvSet(config, { key: 'user:123', value: { name: 'Alice' }, ex: 3600 })
@@ -7290,7 +7123,7 @@ declare function kvSetJSON<T>(config: SylphxConfig, key: string, value: T, optio
7290
7123
  * ```ts
7291
7124
  * import { createConfig, triggerDeploy, getDeployStatus } from '@sylphx/sdk'
7292
7125
  *
7293
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY! })
7126
+ * const config = createConfig({ secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey! })
7294
7127
  *
7295
7128
  * // Trigger a deployment
7296
7129
  * const deploy = await triggerDeploy(config, { envId: 'env_prod_xxx' })
@@ -7649,7 +7482,7 @@ declare function captureMessage(config: SylphxConfig, message: string, options?:
7649
7482
  * ```typescript
7650
7483
  * import { createServerClient, SandboxClient } from '@sylphx/sdk'
7651
7484
  *
7652
- * const config = createServerClient(process.env.SYLPHX_URL!)
7485
+ * const config = createServerClient(process.env.SYLPHX_SECRET_URL!)
7653
7486
  *
7654
7487
  * // Create sandbox (Platform waits for pod ready before returning)
7655
7488
  * const sandbox = await SandboxClient.create(config)
@@ -8004,7 +7837,7 @@ declare class SandboxClient {
8004
7837
  * ```typescript
8005
7838
  * import { createServerClient, RunsClient } from '@sylphx/sdk'
8006
7839
  *
8007
- * const config = createServerClient(process.env.SYLPHX_URL!)
7840
+ * const config = createServerClient(process.env.SYLPHX_SECRET_URL!)
8008
7841
  *
8009
7842
  * const run = await RunsClient.create(config, {
8010
7843
  * image: 'registry.sylphx.com/sylphx/my-trainer:abc123',
@@ -8239,7 +8072,7 @@ declare class RunHandle {
8239
8072
  *
8240
8073
  * @example
8241
8074
  * ```typescript
8242
- * const config = createServerClient(process.env.SYLPHX_URL!)
8075
+ * const config = createServerClient(process.env.SYLPHX_SECRET_URL!)
8243
8076
  *
8244
8077
  * // Run a worker and wait for completion
8245
8078
  * const result = await RunsClient.create(config, { ... }).then(w => w.wait())
@@ -8384,7 +8217,7 @@ declare const WorkersClient: {
8384
8217
  * ### Cron → Task
8385
8218
  * ```typescript
8386
8219
  * import { createServerClient, TriggersClient } from '@sylphx/sdk'
8387
- * const config = createServerClient(process.env.SYLPHX_URL!)
8220
+ * const config = createServerClient(process.env.SYLPHX_SECRET_URL!)
8388
8221
  *
8389
8222
  * const trigger = await TriggersClient.create(config, {
8390
8223
  * name: 'daily-cleanup',
@@ -9461,4 +9294,4 @@ declare const functions: {
9461
9294
  };
9462
9295
  };
9463
9296
 
9464
- export { ACHIEVEMENT_TIER_CONFIG, type AIListModelsOptions, type AIListModelsResponse, type AIMessage, type AIMessageRole, type AIModel, type AIModelInfo, type AIModelsResponse, type AIProvider, type AIRateLimitInfo, type AIRateLimitResponse, type AIRequestType, type AIStreamChunk, type AITool, type AIToolCall, type AIUsageResponse, type AIUsageStats, type AccessTokenPayload, type AchievementCategory, type AchievementCriteria, type AchievementCriterion, type AchievementDefinition, type AchievementTier, type AchievementType, type AchievementUnlockEvent, type AdminUser, type AuditQueryFilter, type AuditQueryResult, AuthenticationError, AuthorizationError, type BackupCodesResult, type BatchEvent, type BatchIndexInput, type BatchIndexResult, type Breadcrumb, type BuildLog, type BuildLogHistoryResponse, type CaptureExceptionRequest, type CaptureMessageRequest, type ChallengeMethod, type ChallengeType, type ChallengeVerifyInput, type ChallengeVerifyResult, type ChatCompletionInput, type ChatCompletionResponse, type ChatInput, type ChatMessage, type ChatResult, type ChatStreamChunk, type CircuitBreakerConfig, CircuitBreakerOpenError, type CircuitState, type CommandResult, type ConsentCategory, type ConsentHistoryEntry, type ConsentHistoryResult, type ConsentPurposeDefaults, type ConsentType, type ContentPart, type CreateOrgInput, type CreatePermissionInput, type CreatePromoInput, type CreateRoleInput, type CreateRunOptions, type CreateTriggerOptions, type CriteriaOperator, type CronInput, type CronSchedule, type CronSource, type DatabaseConnectionInfo, type DatabaseStatus, type DatabaseStatusInfo, type DebugCategory, type DeduplicationConfig, type DeleteAccountResult, type DeleteDocumentInput, type DeployHistoryResponse, type DeployInfo, type DeployStatus, type DeviceApproveInput, type DeviceApproveResult, type DeviceDenyInput, type DeviceDenyResult, type DeviceGrant, type DeviceInitInput, type DevicePollResult, type DynamicRestClient, ERROR_CODE_STATUS, type EmailChangeInput, type EmailConfirmInput, type EmbedInput, type EmbedResult, type EmbeddingInput, type EmbeddingResponse, type LeaderboardEntry as EngagementLeaderboardEntry, type LeaderboardResult as EngagementLeaderboardResult, type EnvVar, type ErrorCode, type ErrorResponse, type EventSource, type ExceptionFrame, type ExceptionValue, type ExecEvent, type ExecOptions, type ExecResult, type FacetsResponse, type FileEvent, type FileInfo, type FileUploadOptions, type FlagContext, type FlagResult, type GetConsentHistoryInput, type GetConsentsInput, type GetFacetsInput, type GetSecretInput, type GetSecretResult, type GetSecretsInput, type GetSecretsResult, type HttpTarget, type IdentifyInput, type ImpersonationActive, type ImpersonationEndResult, type ImpersonationInfo, type ImpersonationStartResult, type IndexDocumentInput, type IndexDocumentResult, type IngestLogsResult, InvalidConnectionUrlError, type InviteMemberInput, type InviteUserRequest, type InviteUserResponse, type KvExpireRequest, type KvHgetRequest, type KvHgetallRequest, type KvHsetRequest, type KvIncrRequest, type KvLpushRequest, type KvLrangeRequest, type KvMgetRequest, type KvMsetRequest, type KvRateLimitRequest, type KvRateLimitResult, type KvScanOptions, type KvScanResult, type KvSetOptions, type KvSetRequest, type KvZMember, type KvZaddRequest, type KvZrangeRequest, type LeaderboardAggregation, type LeaderboardDefinition, type LeaderboardEntry$1 as LeaderboardEntry, type LeaderboardOptions, type LeaderboardQueryOptions, type LeaderboardResetPeriod, type LeaderboardResult$1 as LeaderboardResult, type LeaderboardSortDirection, type LinkAnonymousConsentsInput, type ListPromosOptions, type ListPromosResult, type ListRedemptionsOptions, type ListRedemptionsResult, type ListRunsOptions, type ListRunsResult, type ListScheduledEmailsOptions, type ListSecretKeysInput, type ListTriggersResult, type ListUsersOptions, type ListUsersResult, type LogEntry, type LogLevel, type LoginHistoryEntry, type LoginRequest, type LoginResponse, type MeResponse, type MemberPermissionsResult, type MintAccessTokenClaims, type MintAccessTokenResult, type MonitoringResponse, type MonitoringSeverity, type NativeStepContext, type NativeTaskDefinition, type TaskRunStatus as NativeTaskRunStatus, NetworkError, NotFoundError, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthCodeExchangeInput, type OAuthProvider, type OAuthProvidersResult, type OidcDiscoveryDocument, type OidcUserInfoResponse, type OrgRole, type OrgTokenPayload, type OrganizationInvitation, type OrganizationMember, type OrganizationMembership, type PageInput, type PaginatedResponse, type PaginationInput, type ParsedConnectionUrl, type PasskeyRegistrationInput, type PasskeyRegistrationOptions, type PasskeySummary, type PasskeysList, type PasswordSetInput, type Permission, type PkceMethod, type Plan, type PlatformAccessTokenClaims, type PlatformFunctionsDownloadBundleResult, type PlatformLogoutInput, type PlatformPasswordChangeInput, type PlatformPasswordChangeResult, type PlatformPasswordSetInput, type PlatformPasswordSetResult, type PlatformPasswordStatusResult, type PlatformRealtimeChannel, type PlatformRealtimeCreateChannelResult, type PlatformRealtimeDeleteChannelResult, type PlatformRealtimeListChannelsResult, type PlatformRealtimeStatusResult, type PlatformRefreshInput, type PlatformRefreshResult, type PlatformSessionRenameInput, type PlatformSessionRenameResult, type PlatformSessionRevokeAllResult, type PlatformSessionRevokeInput, type PlatformSessionRevokeOtherResult, type PlatformSessionRevokeResult, type PlatformSessionsListResult, type PlatformUserDeleteInput, type PlatformUserDeleteResult, type PlatformUserExportResult, type PlatformUserRecord, type PlatformUserResolution, type ProcessEvent, type ProcessInfo, type ProcessStartOptions, type ProcessSummary, type ProjectMetadata, type PromoCode, type PromoRedemption, type PromoStatus, type PromoType, type PromoValidationPreview, type PublishEventResult, type PushCampaign, type PushCampaignStats, type PushCampaignVariant, type PushNotification, type PushNotificationPayload, type PushSegment, type PushSegmentFilter, type PushServiceWorkerConfig, type PushSubscription, type QueryLogsOptions, type QueryLogsResult, RETRYABLE_CODES, RateLimitError, type RateLimitStatusFilter, type RateLimitStatusResult, type RateLimitStrategiesFilter, type RateLimitStrategiesResult, type RateLimitStrategyDeleteInput, type RateLimitStrategyDeleteResult, type RateLimitStrategyUpsertInput, type RateLimitStrategyUpsertResult, type RealtimeEmitRequest, type RealtimeEmitResponse, type RealtimeHistoryRequest, type RealtimeHistoryResponse, type RecordActivityInput, type RecordActivityResult, type RedeemPromoInput, type RedeemPromoResult, type RedeemReferralInput, type RedeemResult, type ReferralCode, type ReferralStats, type RegisterInput, type RegisterRequest, type RegisterResponse, type ResendEmailVerificationRequest, type ResendEmailVerificationResponse, type RestClient, type RestClientConfig, type RestDynamicConfig, type RetryConfig, type RevokeTokenOptions, type Role, type RollbackDeployRequest, type Run, RunHandle, type RunLogsResult, type RunResourceSpec, type RunResult, type RunStatus, type RunTarget, type RunVolumeMount, type CreateRunOptions as RunWorkerOptions, RunsClient, SandboxClient, type SandboxFile, SandboxFiles, type SandboxOptions, SandboxProcesses, type SandboxRecord, SandboxWatch, type ScheduleEmailOptions, type ScheduledEmail, type ScheduledEmailStats, type ScheduledEmailsResult, type SearchInput, type SearchResponse, type SearchResultItem, type SearchStatsResult, type SearchType, type SecretKeyInfo, type SecurityAlert, type SecurityAlertsList, type SecurityScoreResult, type SecuritySettings, type SendEmailOptions, type SendResult, type SendTemplatedEmailOptions, type SendToUserOptions, type SessionResult, type SetConsentsInput, type SetEnvVarRequest, type SignedUrlOptions, type SignedUrlResult, StepCompleteSignal, StepSleepSignal, type StorageFileVersion, type StoredLogEntry, type StreakDefinition, type StreakFrequency, type StreakState, type StreamMessage, type SubmitScoreInput, type SubmitScoreResult, type Subscription, type SuccessResponse, type SylphxClientInput, type SylphxConfig, type SylphxConfigInput, SylphxError, type SylphxErrorCode, type SylphxErrorOptions, type TaskInput, type TaskResult, type TaskStatus, type TaskTarget, type TextCompletionInput, type TextCompletionResponse, TimeoutError, type TokenIntrospectionResult, type TokenResponse, type Tool, type ToolCall, type TrackClickInput, type TrackInput, type Trigger, type TriggerDeployRequest, type TriggerSource, type TriggerSourceType, type TriggerStatus, type TriggerTarget, type TriggerTargetType, TriggersClient, type TwoFactorEnableResult, type TwoFactorSetupResult, type TwoFactorVerifyRequest, type UpdateOrgInput, type UpdatePromoInput, type UpdateRoleInput, type UpdateTriggerOptions, type UploadProgressEvent, type UploadResult, type UpsertDocumentInput, type UpsertDocumentResult, type User, type UserAchievement, type UserConsent, type UserDataExport, type UserFullProfile, type UserProfile, type UserSecuritySettings, type UserSession, type UserSessionsList, type UserUpdateProfileInput, type ValidatePromoInput, type ValidatePromoResult, ValidationError, type VisionInput, type WatchEntry, type WatchOptions, type WebhookConfig, type WebhookConfigUpdate, type WebhookDeliveriesResult, type WebhookDelivery, type WebhookStats, RunHandle as WorkerHandle, type RunLogsResult as WorkerLogsResult, type RunResourceSpec as WorkerResourceSpec, type RunResult as WorkerResult, type Run as WorkerRun, type RunStatus as WorkerStatus, type RunVolumeMount as WorkerVolumeMount, WorkersClient, acceptAllConsents, acceptOrganizationInvitation, assignMemberRole, audit, authorizeOAuth, batchIndex, canDeleteOrganization, canManageMembers, canManageSettings, cancelScheduledEmail, cancelTask, captureException, captureExceptionRaw, captureMessage, chat, chatStream, checkFlag, complete, confirmEmailChange, cookies, createCheckout, createClient, createConfig, createCron, createDynamicRestClient, createOrganization, createPermission, createPortalSession, createPromo, createRestClient, createRole, createServerClient, createServiceWorkerScript, createStepContext, createTasksHandler, createTracker, debugError, debugLog, debugTimer, debugWarn, declineOptionalConsents, deleteCron, deleteDocument, deleteEnvVar, deleteFile, deleteOrganization, deletePasskey, deletePermission, deletePromo, deleteRole, deleteUser, deleteUserAccount, device, disableDebug, disableTwoFactor, disconnectOAuthProvider, downloadFileVersion, dpop, embed, enableDebug, exchangeOAuthCode, exponentialBackoff, exportUserData, extendedSignUp, forgotPassword, functions, generateAnonymousId, generatePkce, getAchievement, getAchievementPoints, getAchievements, getAllFlags, getAllSecrets, getAllStreaks, getBackupCodes, getBillingBalance, getBillingUsage, getBuildLogHistory, getCircuitBreakerState, getConsentHistory, getConsentTypes, getDatabaseConnectionString, getDatabaseStatus, getDebugMode, getDeployHistory, getDeployStatus, getErrorCode, getErrorMessage, getFacets, getFileInfo, getFileUrl, getFlagPayload, getFlags, getLeaderboard, getMemberPermissions, getMyReferralCode, getOidcDiscoveryDocument, getOrganization, getOrganizationInvitations, getOrganizationMembers, getOrganizations, getPlans, getProjectMetadata, getPromo, getPushPreferences, getRealtimeHistory, getReferralLeaderboard, getReferralStats, getRestErrorMessage, getRole, getScheduledEmail, getScheduledEmailStats, getSearchStats, getSecret, getSecrets, getSecurityScore, getSession, getSignedUrl, getStreak, getSubscription, getTask, getUser, getUserByEmail, getUserConsents, getUserLeaderboardRank, getUserProfile, getUserSecurity, getVariant, getWebhookConfig, getWebhookDeliveries, getWebhookDelivery, getWebhookStats, hasAllPermissions, hasAnyPermission, hasConsent, hasError, hasPermission, hasRole, hasSecret, identify, impersonation, incrementAchievementProgress, indexDocument, ingestLogs, initPushServiceWorker, installGlobalDebugHelpers, introspectToken, inviteOrganizationMember, inviteUser, isEmailConfigured, isEnabled, isRetryableError, isSylphxError, kvDelete, kvExists, kvExpire, kvGet, kvGetJSON, kvHget, kvHgetall, kvHset, kvIncr, kvLpush, kvLrange, kvMget, kvMset, kvRateLimit, kvScan, kvSet, kvSetJSON, kvZadd, kvZrange, leaveOrganization, linkAnonymousConsents, listEnvVars, listFileVersions, listOAuthProviders, listPasskeys, listPermissions, listPromoRedemptions, listPromos, listRoles, listScheduledEmails, listSecretKeys, listSecurityAlerts, listTasks, listUserSessions, listUsers, markAllSecurityAlertsRead, markSecurityAlertRead, oauth, page, parseOAuthCallback, password, pauseCron, platformAuth, campaigns as pushCampaigns, segments as pushSegments, queryLogs, rateLimits, realtime, realtimeEmit, recordStreakActivity, recoverStreak, redeemPromo, redeemReferralCode, refreshToken, regenerateBackupCodes, regenerateReferralCode, registerPush, registerPushServiceWorker, removeOrganizationMember, renamePasskey, renameUserSession, replayWebhookDelivery, requestEmailChange, rescheduleEmail, resendVerificationEmail, resetCircuitBreaker, resetDebugModeCache, resetPassword, resetPlatformCookieCache, resetPlatformJwksCache, restoreFile, restoreFileVersion, resumeCron, revokeAllTokens, revokeOrganizationInvitation, revokeToken, revokeUserSession, rollbackDeploy, scheduleEmail, scheduleTask, search, sendEmail, sendEmailToUser, sendPush, sendTemplatedEmail, sessions, setConsents, setEnvVar, setPassword, setupTwoFactor, signIn, signOut, signUp, softDeleteFile, startPasskeyRegistration, streamToString, submitScore, suspendUser, switchOrg, toSylphxError, track, trackBatch, trackClick, triggerDeploy, unlockAchievement, unregisterPush, updateOrganization, updateOrganizationMemberRole, updatePromo, updatePushPreferences, updateRole, updateUser, updateUserMetadata, updateUserProfile, updateWebhookConfig, uploadAvatar, uploadFile, upsertDocument, user, userInfo, validatePromo, verifyAccessToken, verifyChallenge, verifyEmail, verifyPasskeyRegistration, verifySignature as verifyTaskSignature, verifyTwoFactor, verifyTwoFactorEnable, withToken };
9297
+ export { ACHIEVEMENT_TIER_CONFIG, type AIListModelsOptions, type AIListModelsResponse, type AIMessage, type AIMessageRole, type AIModel, type AIModelInfo, type AIModelsResponse, type AIProvider, type AIRateLimitInfo, type AIRateLimitResponse, type AIRequestType, type AIStreamChunk, type AITool, type AIToolCall, type AIUsageResponse, type AIUsageStats, type AccessTokenPayload, type AchievementCategory, type AchievementCriteria, type AchievementCriterion, type AchievementDefinition, type AchievementTier, type AchievementType, type AchievementUnlockEvent, type AdminUser, type AuditQueryFilter, type AuditQueryResult, AuthenticationError, AuthorizationError, type BackupCodesResult, type BatchEvent, type BatchIndexInput, type BatchIndexResult, type Breadcrumb, type BuildLog, type BuildLogHistoryResponse, type CaptureExceptionRequest, type CaptureMessageRequest, type ChallengeMethod, type ChallengeType, type ChallengeVerifyInput, type ChallengeVerifyResult, type ChatCompletionInput, type ChatCompletionResponse, type ChatInput, type ChatMessage, type ChatResult, type ChatStreamChunk, type CircuitBreakerConfig, CircuitBreakerOpenError, type CircuitState, type CommandResult, type ConsentCategory, type ConsentHistoryEntry, type ConsentHistoryResult, type ConsentPurposeDefaults, type ConsentType, type ContentPart, type CopyFileOptions, type CreateOrgInput, type CreatePermissionInput, type CreatePromoInput, type CreateRoleInput, type CreateRunOptions, type CreateTriggerOptions, type CriteriaOperator, type CronInput, type CronSchedule, type CronSource, type DatabaseConnectionInfo, type DatabaseStatus, type DatabaseStatusInfo, type DebugCategory, type DeduplicationConfig, type DeleteAccountResult, type DeleteDocumentInput, type DeployHistoryResponse, type DeployInfo, type DeployStatus, type DeviceApproveInput, type DeviceApproveResult, type DeviceDenyInput, type DeviceDenyResult, type DeviceGrant, type DeviceInitInput, type DevicePollResult, type DynamicRestClient, ERROR_CODE_STATUS, type EmailChangeInput, type EmailConfirmInput, type EmbedInput, type EmbedResult, type EmbeddingInput, type EmbeddingResponse, type LeaderboardEntry as EngagementLeaderboardEntry, type LeaderboardResult as EngagementLeaderboardResult, type EnvVar, type ErrorCode, type ErrorResponse, type EventSource, type ExceptionFrame, type ExceptionValue, type ExecEvent, type ExecOptions, type ExecResult, type FacetsResponse, type FileEvent, type FlagContext, type FlagResult, type GetConsentHistoryInput, type GetConsentsInput, type GetFacetsInput, type GetSecretInput, type GetSecretResult, type GetSecretsInput, type GetSecretsResult, type HttpTarget, type IdentifyInput, type ImpersonationActive, type ImpersonationEndResult, type ImpersonationInfo, type ImpersonationStartResult, type IndexDocumentInput, type IndexDocumentResult, type IngestLogsResult, InvalidConnectionUrlError, type InviteMemberInput, type InviteUserRequest, type InviteUserResponse, type KvExpireRequest, type KvHgetRequest, type KvHgetallRequest, type KvHsetRequest, type KvIncrRequest, type KvLpushRequest, type KvLrangeRequest, type KvMgetRequest, type KvMsetRequest, type KvRateLimitRequest, type KvRateLimitResult, type KvScanOptions, type KvScanResult, type KvSetOptions, type KvSetRequest, type KvZMember, type KvZaddRequest, type KvZrangeRequest, type LeaderboardAggregation, type LeaderboardDefinition, type LeaderboardEntry$1 as LeaderboardEntry, type LeaderboardOptions, type LeaderboardQueryOptions, type LeaderboardResetPeriod, type LeaderboardResult$1 as LeaderboardResult, type LeaderboardSortDirection, type LinkAnonymousConsentsInput, type ListFilesOptions, type ListPromosOptions, type ListPromosResult, type ListRedemptionsOptions, type ListRedemptionsResult, type ListRunsOptions, type ListRunsResult, type ListScheduledEmailsOptions, type ListSecretKeysInput, type ListTriggersResult, type ListUsersOptions, type ListUsersResult, type LogEntry, type LogLevel, type LoginHistoryEntry, type LoginRequest, type LoginResponse, type MeResponse, type MemberPermissionsResult, type MintAccessTokenClaims, type MintAccessTokenResult, type MonitoringResponse, type MonitoringSeverity, type NativeStepContext, type NativeTaskDefinition, type TaskRunStatus as NativeTaskRunStatus, NetworkError, NotFoundError, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthCodeExchangeInput, type OAuthProvider, type OAuthProvidersResult, type OidcDiscoveryDocument, type OidcUserInfoResponse, type OrgRole, type OrgScopedTokenResponse, type OrgTokenPayload, type OrganizationInvitation, type OrganizationMember, type OrganizationMembership, type PageInput, type PaginatedResponse, type PaginationInput, type ParsedConnectionUrl, type PasskeyRegistrationInput, type PasskeyRegistrationOptions, type PasskeySummary, type PasskeysList, type PasswordSetInput, type Permission, type PkceMethod, type Plan, type PlatformAccessTokenClaims, type PlatformFunctionsDownloadBundleResult, type PlatformLogoutInput, type PlatformPasswordChangeInput, type PlatformPasswordChangeResult, type PlatformPasswordSetInput, type PlatformPasswordSetResult, type PlatformPasswordStatusResult, type PlatformRealtimeChannel, type PlatformRealtimeCreateChannelResult, type PlatformRealtimeDeleteChannelResult, type PlatformRealtimeListChannelsResult, type PlatformRealtimeStatusResult, type PlatformRefreshInput, type PlatformRefreshResult, type PlatformSessionRenameInput, type PlatformSessionRenameResult, type PlatformSessionRevokeAllResult, type PlatformSessionRevokeInput, type PlatformSessionRevokeOtherResult, type PlatformSessionRevokeResult, type PlatformSessionsListResult, type PlatformUserDeleteInput, type PlatformUserDeleteResult, type PlatformUserExportResult, type PlatformUserRecord, type PlatformUserResolution, type ProcessEvent, type ProcessInfo, type ProcessStartOptions, type ProcessSummary, type ProjectMetadata, type PromoCode, type PromoRedemption, type PromoStatus, type PromoType, type PromoValidationPreview, type PublishEventResult, type PushCampaign, type PushCampaignStats, type PushCampaignVariant, type PushNotification, type PushNotificationPayload, type PushSegment, type PushSegmentFilter, type PushServiceWorkerConfig, type PushSubscription, type QueryLogsOptions, type QueryLogsResult, RETRYABLE_CODES, RateLimitError, type RateLimitStatusFilter, type RateLimitStatusResult, type RateLimitStrategiesFilter, type RateLimitStrategiesResult, type RateLimitStrategyDeleteInput, type RateLimitStrategyDeleteResult, type RateLimitStrategyUpsertInput, type RateLimitStrategyUpsertResult, type RealtimeEmitRequest, type RealtimeEmitResponse, type RealtimeHistoryRequest, type RealtimeHistoryResponse, type RecordActivityInput, type RecordActivityResult, type RedeemPromoInput, type RedeemPromoResult, type RedeemReferralInput, type RedeemResult, type ReferralCode, type ReferralStats, type RegisterInput, type RegisterRequest, type RegisterResponse, type ResendEmailVerificationRequest, type ResendEmailVerificationResponse, type RestClient, type RestClientConfig, type RestDynamicConfig, type RetryConfig, type RevokeTokenOptions, type Role, type RollbackDeployRequest, type Run, RunHandle, type RunLogsResult, type RunResourceSpec, type RunResult, type RunStatus, type RunTarget, type RunVolumeMount, type CreateRunOptions as RunWorkerOptions, RunsClient, SandboxClient, type SandboxFile, SandboxFiles, type SandboxOptions, SandboxProcesses, type SandboxRecord, SandboxWatch, type ScheduleEmailOptions, type ScheduledEmail, type ScheduledEmailStats, type ScheduledEmailsResult, type SearchInput, type SearchResponse, type SearchResultItem, type SearchStatsResult, type SearchType, type SecretKeyInfo, type SecurityAlert, type SecurityAlertsList, type SecurityScoreResult, type SecuritySettings, type SendEmailOptions, type SendResult, type SendTemplatedEmailOptions, type SendToUserOptions, type SessionResult, type SetConsentsInput, type SetEnvVarRequest, type SignedUrlOptions, StepCompleteSignal, StepSleepSignal, type StoredLogEntry, type StreakDefinition, type StreakFrequency, type StreakState, type StreamMessage, type SubmitScoreInput, type SubmitScoreResult, type Subscription, type SuccessResponse, type SylphxClientInput, type SylphxConfig, type SylphxConfigInput, SylphxError, type SylphxErrorCode, type SylphxErrorOptions, type TaskInput, type TaskResult, type TaskStatus, type TaskTarget, type TextCompletionInput, type TextCompletionResponse, TimeoutError, type TokenIntrospectionResult, type TokenResponse, type Tool, type ToolCall, type TrackClickInput, type TrackInput, type Trigger, type TriggerDeployRequest, type TriggerSource, type TriggerSourceType, type TriggerStatus, type TriggerTarget, type TriggerTargetType, TriggersClient, type TwoFactorEnableResult, type TwoFactorSetupResult, type TwoFactorVerifyRequest, type UpdateOrgInput, type UpdatePromoInput, type UpdateRoleInput, type UpdateTriggerOptions, type UploadCreateOptions, type UploadProgressEvent, type UpsertDocumentInput, type UpsertDocumentResult, type User, type UserAchievement, type UserConsent, type UserDataExport, type UserFullProfile, type UserProfile, type UserSecuritySettings, type UserSession, type UserSessionsList, type UserUpdateProfileInput, type ValidatePromoInput, type ValidatePromoResult, ValidationError, type VisionInput, type WatchEntry, type WatchOptions, type WebhookConfig, type WebhookConfigUpdate, type WebhookDeliveriesResult, type WebhookDelivery, type WebhookStats, RunHandle as WorkerHandle, type RunLogsResult as WorkerLogsResult, type RunResourceSpec as WorkerResourceSpec, type RunResult as WorkerResult, type Run as WorkerRun, type RunStatus as WorkerStatus, type RunVolumeMount as WorkerVolumeMount, WorkersClient, acceptAllConsents, acceptOrganizationInvitation, assignMemberRole, audit, authorizeOAuth, batchIndex, canDeleteOrganization, canManageMembers, canManageSettings, cancelScheduledEmail, cancelTask, captureException, captureExceptionRaw, captureMessage, chat, chatStream, checkFlag, complete, confirmEmailChange, cookies, createCheckout, createClient, createConfig, createCron, createDynamicRestClient, createOrganization, createPermission, createPortalSession, createPromo, createRestClient, createRole, createServerClient, createServiceWorkerScript, createStepContext, createTasksHandler, createTracker, debugError, debugLog, debugTimer, debugWarn, declineOptionalConsents, deleteCron, deleteDocument, deleteEnvVar, deleteOrganization, deletePasskey, deletePermission, deletePromo, deleteRole, deleteUser, deleteUserAccount, device, disableDebug, disableTwoFactor, disconnectOAuthProvider, dpop, embed, enableDebug, exchangeOAuthCode, exponentialBackoff, exportUserData, extendedSignUp, forgotPassword, functions, generateAnonymousId, generatePkce, getAchievement, getAchievementPoints, getAchievements, getAllFlags, getAllSecrets, getAllStreaks, getBackupCodes, getBillingBalance, getBillingUsage, getBuildLogHistory, getCircuitBreakerState, getConsentHistory, getConsentTypes, getDatabaseConnectionString, getDatabaseStatus, getDebugMode, getDeployHistory, getDeployStatus, getErrorCode, getErrorMessage, getFacets, getFlagPayload, getFlags, getLeaderboard, getMemberPermissions, getMyReferralCode, getOidcDiscoveryDocument, getOrgScopedToken, getOrganization, getOrganizationInvitations, getOrganizationMembers, getOrganizations, getPlans, getProjectMetadata, getPromo, getPushPreferences, getRealtimeHistory, getReferralLeaderboard, getReferralStats, getRestErrorMessage, getRole, getScheduledEmail, getScheduledEmailStats, getSearchStats, getSecret, getSecrets, getSecurityScore, getSession, getStreak, getSubscription, getTask, getUser, getUserByEmail, getUserConsents, getUserLeaderboardRank, getUserProfile, getUserSecurity, getVariant, getWebhookConfig, getWebhookDeliveries, getWebhookDelivery, getWebhookStats, hasAllPermissions, hasAnyPermission, hasConsent, hasError, hasPermission, hasRole, hasSecret, identify, impersonation, incrementAchievementProgress, indexDocument, ingestLogs, initPushServiceWorker, installGlobalDebugHelpers, introspectToken, inviteOrganizationMember, inviteUser, isEmailConfigured, isEnabled, isRetryableError, isSylphxError, kvDelete, kvExists, kvExpire, kvGet, kvGetJSON, kvHget, kvHgetall, kvHset, kvIncr, kvLpush, kvLrange, kvMget, kvMset, kvRateLimit, kvScan, kvSet, kvSetJSON, kvZadd, kvZrange, leaveOrganization, linkAnonymousConsents, listEnvVars, listOAuthProviders, listPasskeys, listPermissions, listPromoRedemptions, listPromos, listRoles, listScheduledEmails, listSecretKeys, listSecurityAlerts, listTasks, listUserSessions, listUsers, markAllSecurityAlertsRead, markSecurityAlertRead, oauth, page, parseOAuthCallback, password, pauseCron, platformAuth, campaigns as pushCampaigns, segments as pushSegments, queryLogs, rateLimits, realtime, realtimeEmit, recordStreakActivity, recoverStreak, redeemPromo, redeemReferralCode, refreshToken, regenerateBackupCodes, regenerateReferralCode, registerPush, registerPushServiceWorker, removeOrganizationMember, renamePasskey, renameUserSession, replayWebhookDelivery, requestEmailChange, rescheduleEmail, resendVerificationEmail, resetCircuitBreaker, resetDebugModeCache, resetPassword, resetPlatformCookieCache, resetPlatformJwksCache, resumeCron, revokeAllTokens, revokeOrganizationInvitation, revokeToken, revokeUserSession, rollbackDeploy, scheduleEmail, scheduleTask, search, sendEmail, sendEmailToUser, sendPush, sendTemplatedEmail, sessions, setConsents, setEnvVar, setPassword, setupTwoFactor, signIn, signOut, signUp, startPasskeyRegistration, storage, streamToString, submitScore, suspendUser, switchOrg, toSylphxError, track, trackBatch, trackClick, triggerDeploy, unlockAchievement, unregisterPush, updateOrganization, updateOrganizationMemberRole, updatePromo, updatePushPreferences, updateRole, updateUser, updateUserMetadata, updateUserProfile, updateWebhookConfig, upsertDocument, user, userInfo, validatePromo, verifyAccessToken, verifyChallenge, verifyEmail, verifyPasskeyRegistration, verifySignature as verifyTaskSignature, verifyTwoFactor, verifyTwoFactorEnable, withToken };