@scalemule/nextjs 0.1.51 → 0.1.53
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 +51 -5
- package/dist/client.d.mts +6 -1
- package/dist/client.d.ts +6 -1
- package/dist/client.js +24 -4
- package/dist/client.mjs +24 -4
- package/dist/{index-BQgmT53x.d.mts → index-2PnO4RAF.d.mts} +19 -5
- package/dist/{index-BQgmT53x.d.ts → index-2PnO4RAF.d.ts} +19 -5
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +136 -48
- package/dist/index.mjs +136 -48
- package/dist/server/auth.d.mts +7 -2
- package/dist/server/auth.d.ts +7 -2
- package/dist/server/auth.js +260 -39
- package/dist/server/auth.mjs +260 -40
- package/dist/server/index.d.mts +24 -5
- package/dist/server/index.d.ts +24 -5
- package/dist/server/index.js +286 -66
- package/dist/server/index.mjs +286 -66
- package/dist/server/webhook-handler.d.mts +2 -2
- package/dist/server/webhook-handler.d.ts +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{webhook-handler-44RRJH-r.d.ts → webhook-handler-1nnrmWT0.d.ts} +11 -1
- package/dist/{webhook-handler-DKt6H8FB.d.mts → webhook-handler-DNpCXDDA.d.mts} +11 -1
- package/docs/network-audio.md +10 -5
- package/package.json +2 -2
package/dist/server/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ServerConfig } from '../webhook-handler-
|
|
2
|
-
export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-
|
|
3
|
-
import {
|
|
1
|
+
import { S as ServerConfig } from '../webhook-handler-1nnrmWT0.js';
|
|
2
|
+
export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-1nnrmWT0.js';
|
|
3
|
+
import { q as ClientContext, A as ApiError } from '../index-2PnO4RAF.js';
|
|
4
4
|
export { L as LedveryRoutesConfig, a as LedverySessionData, S as SM_LEDVERY_ACCESS_TOKEN_COOKIE, b as SM_LEDVERY_ID_TOKEN_COOKIE, c as SM_LEDVERY_NONCE_COOKIE, d as SM_LEDVERY_PKCE_VERIFIER_COOKIE, e as SM_LEDVERY_STATE_COOKIE, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.js';
|
|
5
5
|
import { NextRequest, NextResponse } from 'next/server';
|
|
6
6
|
import '@scalemule/money';
|
|
@@ -61,7 +61,11 @@ interface IncomingMessageLike {
|
|
|
61
61
|
* }
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
interface ClientContextOptions {
|
|
65
|
+
/** Choose the header your ingress overwrites. ALB append mode uses the final XFF hop. */
|
|
66
|
+
trustedIpHeader?: 'x-forwarded-for' | 'x-real-ip' | 'cf-connecting-ip' | 'x-vercel-forwarded-for';
|
|
67
|
+
}
|
|
68
|
+
declare function extractClientContext(request: NextRequestLike, options?: ClientContextOptions): ClientContext;
|
|
65
69
|
/**
|
|
66
70
|
* Extract client context from a Pages Router API request.
|
|
67
71
|
*
|
|
@@ -119,6 +123,8 @@ declare const USER_ID_COOKIE_NAME = "sm_user_id";
|
|
|
119
123
|
*/
|
|
120
124
|
declare const KNOWN_ACCOUNTS_COOKIE_NAME = "sm_known_accounts";
|
|
121
125
|
interface SessionCookieOptions {
|
|
126
|
+
/** Isolate an embedded session in the top-level site cookie partition (CHIPS). */
|
|
127
|
+
partitioned?: boolean;
|
|
122
128
|
/** Cookie max age in seconds (default: 7 days) */
|
|
123
129
|
maxAge?: number;
|
|
124
130
|
/** Cookie domain (default: current domain) */
|
|
@@ -182,7 +188,9 @@ declare function clearSession<T extends Record<string, unknown>>(responseBody: T
|
|
|
182
188
|
* const user = await sm.auth.me(session.sessionToken)
|
|
183
189
|
* ```
|
|
184
190
|
*/
|
|
185
|
-
declare function getSession(
|
|
191
|
+
declare function getSession(options?: {
|
|
192
|
+
allowBearer?: boolean;
|
|
193
|
+
}): Promise<SessionData | null>;
|
|
186
194
|
/**
|
|
187
195
|
* Get session from a Request object (for edge/middleware)
|
|
188
196
|
*
|
|
@@ -267,6 +275,16 @@ declare function requireSession(): Promise<SessionData>;
|
|
|
267
275
|
*/
|
|
268
276
|
|
|
269
277
|
interface AuthRoutesConfig {
|
|
278
|
+
/** Fixed server-controlled audience used for OAuth-to-iframe session transfer. */
|
|
279
|
+
handoffAudience?: string;
|
|
280
|
+
/** Network boundary used to attest the browser IP on server-side auth calls. */
|
|
281
|
+
clientContext?: ClientContextOptions;
|
|
282
|
+
/** Publishable key for the cookie-authenticated browser data proxy. */
|
|
283
|
+
publishableKey?: string;
|
|
284
|
+
/** Public gateway used by the browser SDK, including WebSocket tickets. */
|
|
285
|
+
browserGatewayUrl?: string;
|
|
286
|
+
/** Explicit compatibility escape hatch. Cookie mode never returns session tokens. */
|
|
287
|
+
sessionMode?: 'cookie' | 'bearer';
|
|
270
288
|
/** Server client config (optional if using env vars) */
|
|
271
289
|
client?: Partial<ServerConfig>;
|
|
272
290
|
/** Cookie options */
|
|
@@ -334,6 +352,7 @@ declare function createAuthRoutes(config?: AuthRoutesConfig): {
|
|
|
334
352
|
POST: RouteHandler$2;
|
|
335
353
|
DELETE: RouteHandler$2;
|
|
336
354
|
PATCH: RouteHandler$2;
|
|
355
|
+
PUT: RouteHandler$2;
|
|
337
356
|
};
|
|
338
357
|
interface AnalyticsTrackingGateConfig {
|
|
339
358
|
/** Feature flag key used to decide whether to forward analytics */
|