@scalemule/nextjs 0.1.1 → 0.1.2
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.mts +139 -2
- package/dist/index.d.ts +139 -2
- package/dist/index.js +362 -28
- package/dist/index.mjs +362 -29
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ReactNode, ReactElement } from 'react';
|
|
3
3
|
import { MoneyClient } from '@scalemule/money';
|
|
4
4
|
export { MoneyClient, MoneyClientConfig, createMoneyClient } from '@scalemule/money';
|
|
5
|
-
import { RealtimeService } from '@scalemule/sdk';
|
|
5
|
+
import { RealtimeService, StorageService, PhotoService, ApiError as ApiError$1 } from '@scalemule/sdk';
|
|
6
6
|
import { ScaleMuleClient } from './client.mjs';
|
|
7
7
|
export { ClientConfig, RequestOptions, createClient } from './client.mjs';
|
|
8
8
|
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-BIIUrnPr.mjs';
|
|
@@ -15,6 +15,10 @@ interface ScaleMuleContextValue {
|
|
|
15
15
|
money: MoneyClient;
|
|
16
16
|
/** Base SDK realtime service — shared singleton for WebSocket connections */
|
|
17
17
|
realtime: RealtimeService;
|
|
18
|
+
/** Base SDK storage service — exposed for `useMedia()` and direct chat-attachment uploads */
|
|
19
|
+
storage: StorageService;
|
|
20
|
+
/** Base SDK photo service — exposed for `useMedia()` and `photo.uploadViaStorage()` */
|
|
21
|
+
photo: PhotoService;
|
|
18
22
|
/** Current authenticated user */
|
|
19
23
|
user: User | null;
|
|
20
24
|
/** Set the current user */
|
|
@@ -102,6 +106,17 @@ interface UseContentOptions {
|
|
|
102
106
|
* Provides file upload, listing, and deletion functionality.
|
|
103
107
|
* Automatically includes user ID for proper multi-tenancy.
|
|
104
108
|
*
|
|
109
|
+
* **For chat / progressive media use, prefer {@link useMedia} instead.**
|
|
110
|
+
* `useContent()` is a thin wrapper over generic storage and does NOT register
|
|
111
|
+
* uploaded images with the photo service or videos with the video service —
|
|
112
|
+
* so optimized thumbnails and HLS streaming don't light up automatically.
|
|
113
|
+
* It also defaults to `is_public: true` and compresses images by default;
|
|
114
|
+
* `useMedia()` defaults to private + uncompressed (the right choice for chat).
|
|
115
|
+
*
|
|
116
|
+
* Use `useContent()` for plain file gallery / browser surfaces where you
|
|
117
|
+
* want flat storage and no media pipeline integration. See
|
|
118
|
+
* `docs/MEDIA-UPLOADS.md` in the platform repo for the decision tree.
|
|
119
|
+
*
|
|
105
120
|
* @example
|
|
106
121
|
* ```tsx
|
|
107
122
|
* function Gallery() {
|
|
@@ -140,6 +155,117 @@ interface UseContentOptions {
|
|
|
140
155
|
*/
|
|
141
156
|
declare function useContent(options?: UseContentOptions): UseContentReturn;
|
|
142
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Result of a single {@link useMedia} upload call.
|
|
160
|
+
*
|
|
161
|
+
* The shape is normalized regardless of MIME type — `optimized_url_promise`
|
|
162
|
+
* resolves on image uploads after the photo optimizer finishes; for non-image
|
|
163
|
+
* uploads it resolves to `null` immediately. (Video / audio branches will
|
|
164
|
+
* populate `hls_url_promise` in later phases — today they fall through to
|
|
165
|
+
* generic storage and that field stays `null`.)
|
|
166
|
+
*/
|
|
167
|
+
interface MediaUploadResult {
|
|
168
|
+
/** Storage file_id — store this in chat-attachment metadata. */
|
|
169
|
+
file_id: string;
|
|
170
|
+
/** Photo service id — null for non-image uploads or when register() failed. */
|
|
171
|
+
photo_id: string | null;
|
|
172
|
+
/** Short-lived signed URL to the original bytes (private uploads) or
|
|
173
|
+
* a public CDN URL (when caller passed `is_public: true`). */
|
|
174
|
+
original_view_url: string | null;
|
|
175
|
+
/** Resolves once the photo optimizer finishes. `null` for non-image
|
|
176
|
+
* MIME types or when register() failed. */
|
|
177
|
+
optimized_url_promise: Promise<string | null>;
|
|
178
|
+
/** Resolves once the video transcoder finishes (Phase 2 / S5b). `null` today. */
|
|
179
|
+
hls_url_promise: Promise<string | null>;
|
|
180
|
+
/** The file's MIME type — preserved from the input File / Blob. */
|
|
181
|
+
mime_type: string;
|
|
182
|
+
/** Whether the resulting storage object is public-readable. */
|
|
183
|
+
is_public: boolean;
|
|
184
|
+
}
|
|
185
|
+
interface UseMediaUploadOptions {
|
|
186
|
+
/** Whether the resulting storage object should be public-readable.
|
|
187
|
+
* Default: `false` (private). Public is opt-in for surfaces that
|
|
188
|
+
* genuinely need it (avatars, public listings). Chat / DM uploads
|
|
189
|
+
* should always be private. */
|
|
190
|
+
is_public?: boolean;
|
|
191
|
+
/** Display filename (sanitized server-side). */
|
|
192
|
+
filename?: string;
|
|
193
|
+
/** Custom metadata attached to the file. */
|
|
194
|
+
metadata?: Record<string, unknown>;
|
|
195
|
+
/** Upload progress callback (0-100). */
|
|
196
|
+
onProgress?: (percent: number) => void;
|
|
197
|
+
/** AbortSignal for cancellation. */
|
|
198
|
+
signal?: AbortSignal;
|
|
199
|
+
/** Force a non-photo path even for image MIME types — useful for
|
|
200
|
+
* generic file uploads where you don't want the photo optimizer
|
|
201
|
+
* to register the file. Default: `false`. */
|
|
202
|
+
skipPhotoRegister?: boolean;
|
|
203
|
+
}
|
|
204
|
+
interface UseMediaReturn {
|
|
205
|
+
/** Upload a file. MIME-aware: images go through photo register +
|
|
206
|
+
* optimization; everything else goes through generic storage. */
|
|
207
|
+
upload: (file: File | Blob, options?: UseMediaUploadOptions) => Promise<MediaUploadResult>;
|
|
208
|
+
/** Cancel an upload by its `file_id`. Deletes the storage object so
|
|
209
|
+
* it doesn't orphan in S3 — useful when a chat composer accepts a
|
|
210
|
+
* file but the user removes it before sending. Idempotent. */
|
|
211
|
+
cancelUpload: (fileId: string) => Promise<void>;
|
|
212
|
+
/** Last error from `upload` or `cancelUpload`. */
|
|
213
|
+
error: ApiError$1 | null;
|
|
214
|
+
/** True while an upload is in progress. */
|
|
215
|
+
uploading: boolean;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Opinionated, MIME-aware media upload hook.
|
|
219
|
+
*
|
|
220
|
+
* `useMedia()` is the canonical upload primitive for chat / progressive
|
|
221
|
+
* media use. It branches by MIME type:
|
|
222
|
+
* - `image/*` → `client.photo.uploadViaStorage()` — upload to storage,
|
|
223
|
+
* then register with the photo service so the on-demand transform
|
|
224
|
+
* endpoint resolves to optimized variants. The returned
|
|
225
|
+
* `optimized_url_promise` resolves once the optimizer finishes.
|
|
226
|
+
* - everything else → `client.storage.uploadPrivate()` — a private,
|
|
227
|
+
* uncompressed, fail-closed upload to generic storage.
|
|
228
|
+
*
|
|
229
|
+
* **Default visibility is `is_public: false`.** Public is opt-in per call.
|
|
230
|
+
* `useMedia()` does not expose `is_public` via app-level config — visibility
|
|
231
|
+
* is always an explicit per-call surface choice.
|
|
232
|
+
*
|
|
233
|
+
* Compared to `useContent()`:
|
|
234
|
+
* - `useContent()` is a thin wrapper over generic storage and does not
|
|
235
|
+
* register photos / videos with their typed services. Use it for plain
|
|
236
|
+
* file uploads where you don't need optimization or transcoding.
|
|
237
|
+
* - `useMedia()` defaults to private + no compression, integrates with the
|
|
238
|
+
* typed media services automatically, and is the right primitive for
|
|
239
|
+
* anything chat- or media-shaped.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```tsx
|
|
243
|
+
* 'use client';
|
|
244
|
+
*
|
|
245
|
+
* import { useMedia, ScaleMuleMedia } from '@scalemule/nextjs';
|
|
246
|
+
*
|
|
247
|
+
* function ChatComposer({ onAttach }) {
|
|
248
|
+
* const { upload, uploading } = useMedia();
|
|
249
|
+
*
|
|
250
|
+
* async function handlePick(file: File) {
|
|
251
|
+
* const result = await upload(file);
|
|
252
|
+
* onAttach({
|
|
253
|
+
* file_id: result.file_id,
|
|
254
|
+
* mime_type: result.mime_type,
|
|
255
|
+
* optimized_url_promise: result.optimized_url_promise,
|
|
256
|
+
* });
|
|
257
|
+
* }
|
|
258
|
+
*
|
|
259
|
+
* return <input type="file" disabled={uploading}
|
|
260
|
+
* onChange={(e) => e.target.files?.[0] && handlePick(e.target.files[0])} />;
|
|
261
|
+
* }
|
|
262
|
+
* ```
|
|
263
|
+
*
|
|
264
|
+
* See `docs/MEDIA-UPLOADS.md` in the platform repo for the decision
|
|
265
|
+
* tree and the full anti-patterns list.
|
|
266
|
+
*/
|
|
267
|
+
declare function useMedia(): UseMediaReturn;
|
|
268
|
+
|
|
143
269
|
declare const useMoney: typeof useMoneyClient;
|
|
144
270
|
|
|
145
271
|
/**
|
|
@@ -373,6 +499,17 @@ interface FeedbackItem {
|
|
|
373
499
|
created_at: string;
|
|
374
500
|
updated_at: string;
|
|
375
501
|
}
|
|
502
|
+
/**
|
|
503
|
+
* Public widget configuration returned by `GET /v1/feedback/widget-config`.
|
|
504
|
+
* The SDK uses this to drive runtime widget behavior per application.
|
|
505
|
+
*/
|
|
506
|
+
interface FeedbackWidgetConfig {
|
|
507
|
+
enabled: boolean;
|
|
508
|
+
allow_anonymous: boolean;
|
|
509
|
+
widget_theme: 'light' | 'dark' | 'auto';
|
|
510
|
+
widget_position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
511
|
+
allowed_types: FeedbackType[] | null;
|
|
512
|
+
}
|
|
376
513
|
/**
|
|
377
514
|
* Body for `POST /v1/feedback/submit`.
|
|
378
515
|
*
|
|
@@ -612,4 +749,4 @@ declare function createSafeLogger(prefix: string): {
|
|
|
612
749
|
error: (message: string, data?: unknown) => void;
|
|
613
750
|
};
|
|
614
751
|
|
|
615
|
-
export { ApiError, type FeatureFlagEvaluation, type FeatureFlagEvaluation as FeatureFlagResult, type FeedbackItem, type FeedbackItemInput, type FeedbackPriority, type FeedbackStatus, type FeedbackType, FeedbackWidget, type FeedbackWidgetProps, ListFilesParams, LoginResponse, type PasswordValidationResult, type PhoneCountry, type PhoneValidationResult, type RealtimeEvent, type RealtimeMessage, type RealtimeStatus, ScaleMuleClient, ScaleMuleConfig, ScaleMuleProvider, type ScaleMuleProviderProps, UseAnalyticsOptions, UseAnalyticsReturn, UseAuthReturn, UseBillingReturn, UseContentReturn, type UseFeatureFlagsOptions, type UseFeatureFlagsReturn, type UseFeedbackOptions, type UseFeedbackResult, type UseFeatureFlagsOptions as UseFlagsOptions, type UseFeatureFlagsReturn as UseFlagsReturn, type UsePushNotificationsOptions, type UsePushNotificationsReturn, type UseRealtimeOptions, type UseRealtimeReturn, type UseShareOptions, type UseShareReturn, UseUserReturn, User, type UsernameValidationResult, composePhone, createSafeLogger, normalizePhone, phoneCountries, sanitizeForLog, useAnalytics, useAuth, useBilling, useContent, useFeatureFlags, useFeedback, useMoney, useMoneyClient, usePushNotifications, useRealtime, useScaleMule, useScaleMuleClient, useShare, useUser, validateForm, validators };
|
|
752
|
+
export { ApiError, type FeatureFlagEvaluation, type FeatureFlagEvaluation as FeatureFlagResult, type FeedbackItem, type FeedbackItemInput, type FeedbackPriority, type FeedbackStatus, type FeedbackType, FeedbackWidget, type FeedbackWidgetConfig, type FeedbackWidgetProps, ListFilesParams, LoginResponse, type MediaUploadResult, type PasswordValidationResult, type PhoneCountry, type PhoneValidationResult, type RealtimeEvent, type RealtimeMessage, type RealtimeStatus, ScaleMuleClient, ScaleMuleConfig, ScaleMuleProvider, type ScaleMuleProviderProps, UseAnalyticsOptions, UseAnalyticsReturn, UseAuthReturn, UseBillingReturn, UseContentReturn, type UseFeatureFlagsOptions, type UseFeatureFlagsReturn, type UseFeedbackOptions, type UseFeedbackResult, type UseFeatureFlagsOptions as UseFlagsOptions, type UseFeatureFlagsReturn as UseFlagsReturn, type UseMediaReturn, type UseMediaUploadOptions, type UsePushNotificationsOptions, type UsePushNotificationsReturn, type UseRealtimeOptions, type UseRealtimeReturn, type UseShareOptions, type UseShareReturn, UseUserReturn, User, type UsernameValidationResult, composePhone, createSafeLogger, normalizePhone, phoneCountries, sanitizeForLog, useAnalytics, useAuth, useBilling, useContent, useFeatureFlags, useFeedback, useMedia, useMoney, useMoneyClient, usePushNotifications, useRealtime, useScaleMule, useScaleMuleClient, useShare, useUser, validateForm, validators };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ReactNode, ReactElement } from 'react';
|
|
3
3
|
import { MoneyClient } from '@scalemule/money';
|
|
4
4
|
export { MoneyClient, MoneyClientConfig, createMoneyClient } from '@scalemule/money';
|
|
5
|
-
import { RealtimeService } from '@scalemule/sdk';
|
|
5
|
+
import { RealtimeService, StorageService, PhotoService, ApiError as ApiError$1 } from '@scalemule/sdk';
|
|
6
6
|
import { ScaleMuleClient } from './client.js';
|
|
7
7
|
export { ClientConfig, RequestOptions, createClient } from './client.js';
|
|
8
8
|
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-BIIUrnPr.js';
|
|
@@ -15,6 +15,10 @@ interface ScaleMuleContextValue {
|
|
|
15
15
|
money: MoneyClient;
|
|
16
16
|
/** Base SDK realtime service — shared singleton for WebSocket connections */
|
|
17
17
|
realtime: RealtimeService;
|
|
18
|
+
/** Base SDK storage service — exposed for `useMedia()` and direct chat-attachment uploads */
|
|
19
|
+
storage: StorageService;
|
|
20
|
+
/** Base SDK photo service — exposed for `useMedia()` and `photo.uploadViaStorage()` */
|
|
21
|
+
photo: PhotoService;
|
|
18
22
|
/** Current authenticated user */
|
|
19
23
|
user: User | null;
|
|
20
24
|
/** Set the current user */
|
|
@@ -102,6 +106,17 @@ interface UseContentOptions {
|
|
|
102
106
|
* Provides file upload, listing, and deletion functionality.
|
|
103
107
|
* Automatically includes user ID for proper multi-tenancy.
|
|
104
108
|
*
|
|
109
|
+
* **For chat / progressive media use, prefer {@link useMedia} instead.**
|
|
110
|
+
* `useContent()` is a thin wrapper over generic storage and does NOT register
|
|
111
|
+
* uploaded images with the photo service or videos with the video service —
|
|
112
|
+
* so optimized thumbnails and HLS streaming don't light up automatically.
|
|
113
|
+
* It also defaults to `is_public: true` and compresses images by default;
|
|
114
|
+
* `useMedia()` defaults to private + uncompressed (the right choice for chat).
|
|
115
|
+
*
|
|
116
|
+
* Use `useContent()` for plain file gallery / browser surfaces where you
|
|
117
|
+
* want flat storage and no media pipeline integration. See
|
|
118
|
+
* `docs/MEDIA-UPLOADS.md` in the platform repo for the decision tree.
|
|
119
|
+
*
|
|
105
120
|
* @example
|
|
106
121
|
* ```tsx
|
|
107
122
|
* function Gallery() {
|
|
@@ -140,6 +155,117 @@ interface UseContentOptions {
|
|
|
140
155
|
*/
|
|
141
156
|
declare function useContent(options?: UseContentOptions): UseContentReturn;
|
|
142
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Result of a single {@link useMedia} upload call.
|
|
160
|
+
*
|
|
161
|
+
* The shape is normalized regardless of MIME type — `optimized_url_promise`
|
|
162
|
+
* resolves on image uploads after the photo optimizer finishes; for non-image
|
|
163
|
+
* uploads it resolves to `null` immediately. (Video / audio branches will
|
|
164
|
+
* populate `hls_url_promise` in later phases — today they fall through to
|
|
165
|
+
* generic storage and that field stays `null`.)
|
|
166
|
+
*/
|
|
167
|
+
interface MediaUploadResult {
|
|
168
|
+
/** Storage file_id — store this in chat-attachment metadata. */
|
|
169
|
+
file_id: string;
|
|
170
|
+
/** Photo service id — null for non-image uploads or when register() failed. */
|
|
171
|
+
photo_id: string | null;
|
|
172
|
+
/** Short-lived signed URL to the original bytes (private uploads) or
|
|
173
|
+
* a public CDN URL (when caller passed `is_public: true`). */
|
|
174
|
+
original_view_url: string | null;
|
|
175
|
+
/** Resolves once the photo optimizer finishes. `null` for non-image
|
|
176
|
+
* MIME types or when register() failed. */
|
|
177
|
+
optimized_url_promise: Promise<string | null>;
|
|
178
|
+
/** Resolves once the video transcoder finishes (Phase 2 / S5b). `null` today. */
|
|
179
|
+
hls_url_promise: Promise<string | null>;
|
|
180
|
+
/** The file's MIME type — preserved from the input File / Blob. */
|
|
181
|
+
mime_type: string;
|
|
182
|
+
/** Whether the resulting storage object is public-readable. */
|
|
183
|
+
is_public: boolean;
|
|
184
|
+
}
|
|
185
|
+
interface UseMediaUploadOptions {
|
|
186
|
+
/** Whether the resulting storage object should be public-readable.
|
|
187
|
+
* Default: `false` (private). Public is opt-in for surfaces that
|
|
188
|
+
* genuinely need it (avatars, public listings). Chat / DM uploads
|
|
189
|
+
* should always be private. */
|
|
190
|
+
is_public?: boolean;
|
|
191
|
+
/** Display filename (sanitized server-side). */
|
|
192
|
+
filename?: string;
|
|
193
|
+
/** Custom metadata attached to the file. */
|
|
194
|
+
metadata?: Record<string, unknown>;
|
|
195
|
+
/** Upload progress callback (0-100). */
|
|
196
|
+
onProgress?: (percent: number) => void;
|
|
197
|
+
/** AbortSignal for cancellation. */
|
|
198
|
+
signal?: AbortSignal;
|
|
199
|
+
/** Force a non-photo path even for image MIME types — useful for
|
|
200
|
+
* generic file uploads where you don't want the photo optimizer
|
|
201
|
+
* to register the file. Default: `false`. */
|
|
202
|
+
skipPhotoRegister?: boolean;
|
|
203
|
+
}
|
|
204
|
+
interface UseMediaReturn {
|
|
205
|
+
/** Upload a file. MIME-aware: images go through photo register +
|
|
206
|
+
* optimization; everything else goes through generic storage. */
|
|
207
|
+
upload: (file: File | Blob, options?: UseMediaUploadOptions) => Promise<MediaUploadResult>;
|
|
208
|
+
/** Cancel an upload by its `file_id`. Deletes the storage object so
|
|
209
|
+
* it doesn't orphan in S3 — useful when a chat composer accepts a
|
|
210
|
+
* file but the user removes it before sending. Idempotent. */
|
|
211
|
+
cancelUpload: (fileId: string) => Promise<void>;
|
|
212
|
+
/** Last error from `upload` or `cancelUpload`. */
|
|
213
|
+
error: ApiError$1 | null;
|
|
214
|
+
/** True while an upload is in progress. */
|
|
215
|
+
uploading: boolean;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Opinionated, MIME-aware media upload hook.
|
|
219
|
+
*
|
|
220
|
+
* `useMedia()` is the canonical upload primitive for chat / progressive
|
|
221
|
+
* media use. It branches by MIME type:
|
|
222
|
+
* - `image/*` → `client.photo.uploadViaStorage()` — upload to storage,
|
|
223
|
+
* then register with the photo service so the on-demand transform
|
|
224
|
+
* endpoint resolves to optimized variants. The returned
|
|
225
|
+
* `optimized_url_promise` resolves once the optimizer finishes.
|
|
226
|
+
* - everything else → `client.storage.uploadPrivate()` — a private,
|
|
227
|
+
* uncompressed, fail-closed upload to generic storage.
|
|
228
|
+
*
|
|
229
|
+
* **Default visibility is `is_public: false`.** Public is opt-in per call.
|
|
230
|
+
* `useMedia()` does not expose `is_public` via app-level config — visibility
|
|
231
|
+
* is always an explicit per-call surface choice.
|
|
232
|
+
*
|
|
233
|
+
* Compared to `useContent()`:
|
|
234
|
+
* - `useContent()` is a thin wrapper over generic storage and does not
|
|
235
|
+
* register photos / videos with their typed services. Use it for plain
|
|
236
|
+
* file uploads where you don't need optimization or transcoding.
|
|
237
|
+
* - `useMedia()` defaults to private + no compression, integrates with the
|
|
238
|
+
* typed media services automatically, and is the right primitive for
|
|
239
|
+
* anything chat- or media-shaped.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```tsx
|
|
243
|
+
* 'use client';
|
|
244
|
+
*
|
|
245
|
+
* import { useMedia, ScaleMuleMedia } from '@scalemule/nextjs';
|
|
246
|
+
*
|
|
247
|
+
* function ChatComposer({ onAttach }) {
|
|
248
|
+
* const { upload, uploading } = useMedia();
|
|
249
|
+
*
|
|
250
|
+
* async function handlePick(file: File) {
|
|
251
|
+
* const result = await upload(file);
|
|
252
|
+
* onAttach({
|
|
253
|
+
* file_id: result.file_id,
|
|
254
|
+
* mime_type: result.mime_type,
|
|
255
|
+
* optimized_url_promise: result.optimized_url_promise,
|
|
256
|
+
* });
|
|
257
|
+
* }
|
|
258
|
+
*
|
|
259
|
+
* return <input type="file" disabled={uploading}
|
|
260
|
+
* onChange={(e) => e.target.files?.[0] && handlePick(e.target.files[0])} />;
|
|
261
|
+
* }
|
|
262
|
+
* ```
|
|
263
|
+
*
|
|
264
|
+
* See `docs/MEDIA-UPLOADS.md` in the platform repo for the decision
|
|
265
|
+
* tree and the full anti-patterns list.
|
|
266
|
+
*/
|
|
267
|
+
declare function useMedia(): UseMediaReturn;
|
|
268
|
+
|
|
143
269
|
declare const useMoney: typeof useMoneyClient;
|
|
144
270
|
|
|
145
271
|
/**
|
|
@@ -373,6 +499,17 @@ interface FeedbackItem {
|
|
|
373
499
|
created_at: string;
|
|
374
500
|
updated_at: string;
|
|
375
501
|
}
|
|
502
|
+
/**
|
|
503
|
+
* Public widget configuration returned by `GET /v1/feedback/widget-config`.
|
|
504
|
+
* The SDK uses this to drive runtime widget behavior per application.
|
|
505
|
+
*/
|
|
506
|
+
interface FeedbackWidgetConfig {
|
|
507
|
+
enabled: boolean;
|
|
508
|
+
allow_anonymous: boolean;
|
|
509
|
+
widget_theme: 'light' | 'dark' | 'auto';
|
|
510
|
+
widget_position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
511
|
+
allowed_types: FeedbackType[] | null;
|
|
512
|
+
}
|
|
376
513
|
/**
|
|
377
514
|
* Body for `POST /v1/feedback/submit`.
|
|
378
515
|
*
|
|
@@ -612,4 +749,4 @@ declare function createSafeLogger(prefix: string): {
|
|
|
612
749
|
error: (message: string, data?: unknown) => void;
|
|
613
750
|
};
|
|
614
751
|
|
|
615
|
-
export { ApiError, type FeatureFlagEvaluation, type FeatureFlagEvaluation as FeatureFlagResult, type FeedbackItem, type FeedbackItemInput, type FeedbackPriority, type FeedbackStatus, type FeedbackType, FeedbackWidget, type FeedbackWidgetProps, ListFilesParams, LoginResponse, type PasswordValidationResult, type PhoneCountry, type PhoneValidationResult, type RealtimeEvent, type RealtimeMessage, type RealtimeStatus, ScaleMuleClient, ScaleMuleConfig, ScaleMuleProvider, type ScaleMuleProviderProps, UseAnalyticsOptions, UseAnalyticsReturn, UseAuthReturn, UseBillingReturn, UseContentReturn, type UseFeatureFlagsOptions, type UseFeatureFlagsReturn, type UseFeedbackOptions, type UseFeedbackResult, type UseFeatureFlagsOptions as UseFlagsOptions, type UseFeatureFlagsReturn as UseFlagsReturn, type UsePushNotificationsOptions, type UsePushNotificationsReturn, type UseRealtimeOptions, type UseRealtimeReturn, type UseShareOptions, type UseShareReturn, UseUserReturn, User, type UsernameValidationResult, composePhone, createSafeLogger, normalizePhone, phoneCountries, sanitizeForLog, useAnalytics, useAuth, useBilling, useContent, useFeatureFlags, useFeedback, useMoney, useMoneyClient, usePushNotifications, useRealtime, useScaleMule, useScaleMuleClient, useShare, useUser, validateForm, validators };
|
|
752
|
+
export { ApiError, type FeatureFlagEvaluation, type FeatureFlagEvaluation as FeatureFlagResult, type FeedbackItem, type FeedbackItemInput, type FeedbackPriority, type FeedbackStatus, type FeedbackType, FeedbackWidget, type FeedbackWidgetConfig, type FeedbackWidgetProps, ListFilesParams, LoginResponse, type MediaUploadResult, type PasswordValidationResult, type PhoneCountry, type PhoneValidationResult, type RealtimeEvent, type RealtimeMessage, type RealtimeStatus, ScaleMuleClient, ScaleMuleConfig, ScaleMuleProvider, type ScaleMuleProviderProps, UseAnalyticsOptions, UseAnalyticsReturn, UseAuthReturn, UseBillingReturn, UseContentReturn, type UseFeatureFlagsOptions, type UseFeatureFlagsReturn, type UseFeedbackOptions, type UseFeedbackResult, type UseFeatureFlagsOptions as UseFlagsOptions, type UseFeatureFlagsReturn as UseFlagsReturn, type UseMediaReturn, type UseMediaUploadOptions, type UsePushNotificationsOptions, type UsePushNotificationsReturn, type UseRealtimeOptions, type UseRealtimeReturn, type UseShareOptions, type UseShareReturn, UseUserReturn, User, type UsernameValidationResult, composePhone, createSafeLogger, normalizePhone, phoneCountries, sanitizeForLog, useAnalytics, useAuth, useBilling, useContent, useFeatureFlags, useFeedback, useMedia, useMoney, useMoneyClient, usePushNotifications, useRealtime, useScaleMule, useScaleMuleClient, useShare, useUser, validateForm, validators };
|