@scalemule/nextjs 0.1.29 → 0.1.30
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/client.d.mts +16 -1
- package/dist/client.d.ts +16 -1
- package/dist/client.js +199 -13
- package/dist/client.mjs +199 -13
- package/dist/index-Tq5WdDfS.d.mts +939 -0
- package/dist/index-Tq5WdDfS.d.ts +939 -0
- package/dist/index.d.mts +20 -4
- package/dist/index.d.ts +20 -4
- package/dist/index.js +1254 -41
- package/dist/index.mjs +1255 -43
- package/dist/ledvery-CxPzZpxP.d.mts +44 -0
- package/dist/ledvery-CxPzZpxP.d.ts +44 -0
- package/dist/server/auth.js +6 -1
- package/dist/server/auth.mjs +6 -1
- package/dist/server/index.d.mts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +645 -675
- package/dist/server/index.mjs +646 -676
- package/dist/server/ledvery.d.mts +1 -0
- package/dist/server/ledvery.d.ts +1 -0
- package/dist/server/ledvery.js +336 -0
- package/dist/server/ledvery.mjs +333 -0
- 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-Cfa7-yKN.d.ts +808 -0
- package/dist/webhook-handler-DN4WBjbm.d.mts +808 -0
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare const SM_LEDVERY_STATE_COOKIE = "sm_ledvery_state";
|
|
2
|
+
declare const SM_LEDVERY_PKCE_VERIFIER_COOKIE = "sm_ledvery_pkce_verifier";
|
|
3
|
+
declare const SM_LEDVERY_NONCE_COOKIE = "sm_ledvery_nonce";
|
|
4
|
+
declare const SM_LEDVERY_ID_TOKEN_COOKIE = "sm_ledvery_id_token";
|
|
5
|
+
declare const SM_LEDVERY_ACCESS_TOKEN_COOKIE = "sm_ledvery_access_token";
|
|
6
|
+
interface SessionCookieOverrides {
|
|
7
|
+
maxAge?: number;
|
|
8
|
+
domain?: string;
|
|
9
|
+
path?: string;
|
|
10
|
+
sameSite?: 'strict' | 'lax' | 'none';
|
|
11
|
+
secure?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface LedverySessionData {
|
|
14
|
+
idToken: string;
|
|
15
|
+
accessToken?: string;
|
|
16
|
+
claims: Record<string, unknown>;
|
|
17
|
+
expiresAt: string;
|
|
18
|
+
}
|
|
19
|
+
declare function getLedverySession(request: Request): LedverySessionData | null;
|
|
20
|
+
|
|
21
|
+
interface LedveryRoutesConfig {
|
|
22
|
+
issuer: string;
|
|
23
|
+
clientId: string;
|
|
24
|
+
clientSecret?: string;
|
|
25
|
+
redirectUri: string;
|
|
26
|
+
defaultScope?: string;
|
|
27
|
+
postLoginRedirect?: string;
|
|
28
|
+
postLogoutRedirect?: string;
|
|
29
|
+
cookies?: SessionCookieOverrides;
|
|
30
|
+
storeAccessToken?: boolean;
|
|
31
|
+
fetch?: typeof fetch;
|
|
32
|
+
gatewayUrl?: string;
|
|
33
|
+
}
|
|
34
|
+
type RouteHandler = (request: Request, context: {
|
|
35
|
+
params: Promise<{
|
|
36
|
+
action?: string[];
|
|
37
|
+
}>;
|
|
38
|
+
}) => Promise<Response>;
|
|
39
|
+
declare function createLedveryRoutes(config: LedveryRoutesConfig): {
|
|
40
|
+
GET: RouteHandler;
|
|
41
|
+
POST: RouteHandler;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { type LedveryRoutesConfig as L, SM_LEDVERY_ACCESS_TOKEN_COOKIE as S, type LedverySessionData as a, SM_LEDVERY_ID_TOKEN_COOKIE as b, SM_LEDVERY_NONCE_COOKIE as c, SM_LEDVERY_PKCE_VERIFIER_COOKIE as d, SM_LEDVERY_STATE_COOKIE as e, createLedveryRoutes as f, getLedverySession as g };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare const SM_LEDVERY_STATE_COOKIE = "sm_ledvery_state";
|
|
2
|
+
declare const SM_LEDVERY_PKCE_VERIFIER_COOKIE = "sm_ledvery_pkce_verifier";
|
|
3
|
+
declare const SM_LEDVERY_NONCE_COOKIE = "sm_ledvery_nonce";
|
|
4
|
+
declare const SM_LEDVERY_ID_TOKEN_COOKIE = "sm_ledvery_id_token";
|
|
5
|
+
declare const SM_LEDVERY_ACCESS_TOKEN_COOKIE = "sm_ledvery_access_token";
|
|
6
|
+
interface SessionCookieOverrides {
|
|
7
|
+
maxAge?: number;
|
|
8
|
+
domain?: string;
|
|
9
|
+
path?: string;
|
|
10
|
+
sameSite?: 'strict' | 'lax' | 'none';
|
|
11
|
+
secure?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface LedverySessionData {
|
|
14
|
+
idToken: string;
|
|
15
|
+
accessToken?: string;
|
|
16
|
+
claims: Record<string, unknown>;
|
|
17
|
+
expiresAt: string;
|
|
18
|
+
}
|
|
19
|
+
declare function getLedverySession(request: Request): LedverySessionData | null;
|
|
20
|
+
|
|
21
|
+
interface LedveryRoutesConfig {
|
|
22
|
+
issuer: string;
|
|
23
|
+
clientId: string;
|
|
24
|
+
clientSecret?: string;
|
|
25
|
+
redirectUri: string;
|
|
26
|
+
defaultScope?: string;
|
|
27
|
+
postLoginRedirect?: string;
|
|
28
|
+
postLogoutRedirect?: string;
|
|
29
|
+
cookies?: SessionCookieOverrides;
|
|
30
|
+
storeAccessToken?: boolean;
|
|
31
|
+
fetch?: typeof fetch;
|
|
32
|
+
gatewayUrl?: string;
|
|
33
|
+
}
|
|
34
|
+
type RouteHandler = (request: Request, context: {
|
|
35
|
+
params: Promise<{
|
|
36
|
+
action?: string[];
|
|
37
|
+
}>;
|
|
38
|
+
}) => Promise<Response>;
|
|
39
|
+
declare function createLedveryRoutes(config: LedveryRoutesConfig): {
|
|
40
|
+
GET: RouteHandler;
|
|
41
|
+
POST: RouteHandler;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { type LedveryRoutesConfig as L, SM_LEDVERY_ACCESS_TOKEN_COOKIE as S, type LedverySessionData as a, SM_LEDVERY_ID_TOKEN_COOKIE as b, SM_LEDVERY_NONCE_COOKIE as c, SM_LEDVERY_PKCE_VERIFIER_COOKIE as d, SM_LEDVERY_STATE_COOKIE as e, createLedveryRoutes as f, getLedverySession as g };
|
package/dist/server/auth.js
CHANGED
|
@@ -73,11 +73,13 @@ function extractClientContext(request) {
|
|
|
73
73
|
const userAgent = headers.get("user-agent") || void 0;
|
|
74
74
|
const deviceFingerprint = headers.get("x-device-fingerprint") || void 0;
|
|
75
75
|
const referrer = headers.get("referer") || void 0;
|
|
76
|
+
const anonymousId = headers.get("x-anonymous-id") || void 0;
|
|
76
77
|
return {
|
|
77
78
|
ip,
|
|
78
79
|
userAgent,
|
|
79
80
|
deviceFingerprint,
|
|
80
|
-
referrer
|
|
81
|
+
referrer,
|
|
82
|
+
anonymousId
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
85
|
function buildClientContextHeaders(context) {
|
|
@@ -98,6 +100,9 @@ function buildClientContextHeaders(context) {
|
|
|
98
100
|
if (context.referrer) {
|
|
99
101
|
headers["X-Client-Referrer"] = context.referrer;
|
|
100
102
|
}
|
|
103
|
+
if (context.anonymousId) {
|
|
104
|
+
headers["x-anonymous-id"] = context.anonymousId;
|
|
105
|
+
}
|
|
101
106
|
return headers;
|
|
102
107
|
}
|
|
103
108
|
|
package/dist/server/auth.mjs
CHANGED
|
@@ -71,11 +71,13 @@ function extractClientContext(request) {
|
|
|
71
71
|
const userAgent = headers.get("user-agent") || void 0;
|
|
72
72
|
const deviceFingerprint = headers.get("x-device-fingerprint") || void 0;
|
|
73
73
|
const referrer = headers.get("referer") || void 0;
|
|
74
|
+
const anonymousId = headers.get("x-anonymous-id") || void 0;
|
|
74
75
|
return {
|
|
75
76
|
ip,
|
|
76
77
|
userAgent,
|
|
77
78
|
deviceFingerprint,
|
|
78
|
-
referrer
|
|
79
|
+
referrer,
|
|
80
|
+
anonymousId
|
|
79
81
|
};
|
|
80
82
|
}
|
|
81
83
|
function buildClientContextHeaders(context) {
|
|
@@ -96,6 +98,9 @@ function buildClientContextHeaders(context) {
|
|
|
96
98
|
if (context.referrer) {
|
|
97
99
|
headers["X-Client-Referrer"] = context.referrer;
|
|
98
100
|
}
|
|
101
|
+
if (context.anonymousId) {
|
|
102
|
+
headers["x-anonymous-id"] = context.anonymousId;
|
|
103
|
+
}
|
|
99
104
|
return headers;
|
|
100
105
|
}
|
|
101
106
|
|
package/dist/server/index.d.mts
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 { p as ClientContext, A as ApiError } from '../index-
|
|
1
|
+
import { S as ServerConfig } from '../webhook-handler-DN4WBjbm.mjs';
|
|
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-DN4WBjbm.mjs';
|
|
3
|
+
import { p as ClientContext, A as ApiError } from '../index-Tq5WdDfS.mjs';
|
|
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.mjs';
|
|
5
5
|
import { NextRequest, NextResponse } from 'next/server';
|
|
6
6
|
import '@scalemule/money';
|
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 { p as ClientContext, A as ApiError } from '../index-
|
|
1
|
+
import { S as ServerConfig } from '../webhook-handler-Cfa7-yKN.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-Cfa7-yKN.js';
|
|
3
|
+
import { p as ClientContext, A as ApiError } from '../index-Tq5WdDfS.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';
|