@scalemule/nextjs 0.1.24 → 0.1.26
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 +14 -1
- package/dist/client.d.ts +14 -1
- package/dist/client.js +22 -1
- package/dist/client.mjs +22 -1
- package/dist/{index-DTWyUcyd.d.mts → index-zQloSkpW.d.mts} +5 -1
- package/dist/{index-DTWyUcyd.d.ts → index-zQloSkpW.d.ts} +5 -1
- package/dist/index.d.mts +94 -20
- package/dist/index.d.ts +94 -20
- package/dist/index.js +395 -485
- package/dist/index.mjs +394 -485
- package/dist/server/index.d.mts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +7 -9
- package/dist/server/index.mjs +7 -9
- package/dist/server/ledvery.js +1 -5
- package/dist/server/ledvery.mjs +1 -5
- 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-DsxJS_He.d.mts → webhook-handler-C_bKDevj.d.mts} +1 -1
- package/dist/{webhook-handler-CTx4Uh8u.d.ts → webhook-handler-D4uulN2T.d.ts} +1 -1
- package/package.json +1 -1
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-C_bKDevj.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-C_bKDevj.mjs';
|
|
3
|
+
import { p as ClientContext, A as ApiError } from '../index-zQloSkpW.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-D4uulN2T.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-D4uulN2T.js';
|
|
3
|
+
import { p as ClientContext, A as ApiError } from '../index-zQloSkpW.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';
|
package/dist/server/index.js
CHANGED
|
@@ -1945,7 +1945,7 @@ var require_server = __commonJS({
|
|
|
1945
1945
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1946
1946
|
var server_exports = {};
|
|
1947
1947
|
__export(server_exports, {
|
|
1948
|
-
FlagClient: () =>
|
|
1948
|
+
FlagClient: () => FlagClient2,
|
|
1949
1949
|
allConditionsMatch: () => allConditionsMatch,
|
|
1950
1950
|
evaluateFlag: () => evaluateFlag,
|
|
1951
1951
|
hashToBucket: () => hashToBucket
|
|
@@ -2197,7 +2197,7 @@ var require_server = __commonJS({
|
|
|
2197
2197
|
bucket: null
|
|
2198
2198
|
};
|
|
2199
2199
|
}
|
|
2200
|
-
var
|
|
2200
|
+
var FlagClient2 = class {
|
|
2201
2201
|
constructor(options) {
|
|
2202
2202
|
this.config = null;
|
|
2203
2203
|
this.flagIndex = /* @__PURE__ */ new Map();
|
|
@@ -4501,10 +4501,8 @@ function getLedverySession(request) {
|
|
|
4501
4501
|
if (!raw) return null;
|
|
4502
4502
|
try {
|
|
4503
4503
|
const parsed = JSON.parse(raw);
|
|
4504
|
-
const accessToken = getCookie(request, SM_LEDVERY_ACCESS_TOKEN_COOKIE);
|
|
4505
4504
|
return {
|
|
4506
4505
|
idToken: parsed.idToken || "",
|
|
4507
|
-
accessToken,
|
|
4508
4506
|
claims: parsed.claims,
|
|
4509
4507
|
expiresAt: parsed.expiresAt
|
|
4510
4508
|
};
|
|
@@ -4606,11 +4604,9 @@ function createLedveryRoutes(config) {
|
|
|
4606
4604
|
async function handleLogin(request) {
|
|
4607
4605
|
const url = new URL(request.url);
|
|
4608
4606
|
const returnTo = url.searchParams.get("returnTo");
|
|
4609
|
-
const provider = url.searchParams.get("provider");
|
|
4610
4607
|
const validatedReturnTo = validateSafeRedirect(returnTo, { defaultPath: postLoginRedirect });
|
|
4611
4608
|
const authResult = await client.createAuthorizationUrl({
|
|
4612
|
-
scope: defaultScope
|
|
4613
|
-
extraParams: provider ? { upstream: provider } : void 0
|
|
4609
|
+
scope: defaultScope
|
|
4614
4610
|
});
|
|
4615
4611
|
const response = new Response(null, {
|
|
4616
4612
|
status: 302,
|
|
@@ -5197,6 +5193,9 @@ function createWebhookHandler(config = {}) {
|
|
|
5197
5193
|
}
|
|
5198
5194
|
};
|
|
5199
5195
|
}
|
|
5196
|
+
|
|
5197
|
+
// src/server/bootstrap-flags.ts
|
|
5198
|
+
var import_server2 = __toESM(require_server());
|
|
5200
5199
|
var _clients = /* @__PURE__ */ new Map();
|
|
5201
5200
|
var _initPromises = /* @__PURE__ */ new Map();
|
|
5202
5201
|
var _serverClient = null;
|
|
@@ -5224,8 +5223,7 @@ async function getFlagClient(environment) {
|
|
|
5224
5223
|
const pending = _initPromises.get(key);
|
|
5225
5224
|
if (pending) return pending;
|
|
5226
5225
|
const promise = (async () => {
|
|
5227
|
-
const
|
|
5228
|
-
const client = new FlagClient({ apiKey, environment, gatewayUrl });
|
|
5226
|
+
const client = new import_server2.FlagClient({ apiKey, environment, gatewayUrl });
|
|
5229
5227
|
await Promise.race([
|
|
5230
5228
|
client.init(),
|
|
5231
5229
|
new Promise(
|
package/dist/server/index.mjs
CHANGED
|
@@ -1943,7 +1943,7 @@ var require_server = __commonJS({
|
|
|
1943
1943
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1944
1944
|
var server_exports = {};
|
|
1945
1945
|
__export(server_exports, {
|
|
1946
|
-
FlagClient: () =>
|
|
1946
|
+
FlagClient: () => FlagClient2,
|
|
1947
1947
|
allConditionsMatch: () => allConditionsMatch,
|
|
1948
1948
|
evaluateFlag: () => evaluateFlag,
|
|
1949
1949
|
hashToBucket: () => hashToBucket
|
|
@@ -2195,7 +2195,7 @@ var require_server = __commonJS({
|
|
|
2195
2195
|
bucket: null
|
|
2196
2196
|
};
|
|
2197
2197
|
}
|
|
2198
|
-
var
|
|
2198
|
+
var FlagClient2 = class {
|
|
2199
2199
|
constructor(options) {
|
|
2200
2200
|
this.config = null;
|
|
2201
2201
|
this.flagIndex = /* @__PURE__ */ new Map();
|
|
@@ -4499,10 +4499,8 @@ function getLedverySession(request) {
|
|
|
4499
4499
|
if (!raw) return null;
|
|
4500
4500
|
try {
|
|
4501
4501
|
const parsed = JSON.parse(raw);
|
|
4502
|
-
const accessToken = getCookie(request, SM_LEDVERY_ACCESS_TOKEN_COOKIE);
|
|
4503
4502
|
return {
|
|
4504
4503
|
idToken: parsed.idToken || "",
|
|
4505
|
-
accessToken,
|
|
4506
4504
|
claims: parsed.claims,
|
|
4507
4505
|
expiresAt: parsed.expiresAt
|
|
4508
4506
|
};
|
|
@@ -4604,11 +4602,9 @@ function createLedveryRoutes(config) {
|
|
|
4604
4602
|
async function handleLogin(request) {
|
|
4605
4603
|
const url = new URL(request.url);
|
|
4606
4604
|
const returnTo = url.searchParams.get("returnTo");
|
|
4607
|
-
const provider = url.searchParams.get("provider");
|
|
4608
4605
|
const validatedReturnTo = validateSafeRedirect(returnTo, { defaultPath: postLoginRedirect });
|
|
4609
4606
|
const authResult = await client.createAuthorizationUrl({
|
|
4610
|
-
scope: defaultScope
|
|
4611
|
-
extraParams: provider ? { upstream: provider } : void 0
|
|
4607
|
+
scope: defaultScope
|
|
4612
4608
|
});
|
|
4613
4609
|
const response = new Response(null, {
|
|
4614
4610
|
status: 302,
|
|
@@ -5195,6 +5191,9 @@ function createWebhookHandler(config = {}) {
|
|
|
5195
5191
|
}
|
|
5196
5192
|
};
|
|
5197
5193
|
}
|
|
5194
|
+
|
|
5195
|
+
// src/server/bootstrap-flags.ts
|
|
5196
|
+
var import_server2 = __toESM(require_server());
|
|
5198
5197
|
var _clients = /* @__PURE__ */ new Map();
|
|
5199
5198
|
var _initPromises = /* @__PURE__ */ new Map();
|
|
5200
5199
|
var _serverClient = null;
|
|
@@ -5222,8 +5221,7 @@ async function getFlagClient(environment) {
|
|
|
5222
5221
|
const pending = _initPromises.get(key);
|
|
5223
5222
|
if (pending) return pending;
|
|
5224
5223
|
const promise = (async () => {
|
|
5225
|
-
const
|
|
5226
|
-
const client = new FlagClient({ apiKey, environment, gatewayUrl });
|
|
5224
|
+
const client = new import_server2.FlagClient({ apiKey, environment, gatewayUrl });
|
|
5227
5225
|
await Promise.race([
|
|
5228
5226
|
client.init(),
|
|
5229
5227
|
new Promise(
|
package/dist/server/ledvery.js
CHANGED
|
@@ -80,10 +80,8 @@ function getLedverySession(request) {
|
|
|
80
80
|
if (!raw) return null;
|
|
81
81
|
try {
|
|
82
82
|
const parsed = JSON.parse(raw);
|
|
83
|
-
const accessToken = getCookie(request, SM_LEDVERY_ACCESS_TOKEN_COOKIE);
|
|
84
83
|
return {
|
|
85
84
|
idToken: parsed.idToken || "",
|
|
86
|
-
accessToken,
|
|
87
85
|
claims: parsed.claims,
|
|
88
86
|
expiresAt: parsed.expiresAt
|
|
89
87
|
};
|
|
@@ -179,11 +177,9 @@ function createLedveryRoutes(config) {
|
|
|
179
177
|
async function handleLogin(request) {
|
|
180
178
|
const url = new URL(request.url);
|
|
181
179
|
const returnTo = url.searchParams.get("returnTo");
|
|
182
|
-
const provider = url.searchParams.get("provider");
|
|
183
180
|
const validatedReturnTo = validateSafeRedirect(returnTo, { defaultPath: postLoginRedirect });
|
|
184
181
|
const authResult = await client.createAuthorizationUrl({
|
|
185
|
-
scope: defaultScope
|
|
186
|
-
extraParams: provider ? { upstream: provider } : void 0
|
|
182
|
+
scope: defaultScope
|
|
187
183
|
});
|
|
188
184
|
const response = new Response(null, {
|
|
189
185
|
status: 302,
|
package/dist/server/ledvery.mjs
CHANGED
|
@@ -78,10 +78,8 @@ function getLedverySession(request) {
|
|
|
78
78
|
if (!raw) return null;
|
|
79
79
|
try {
|
|
80
80
|
const parsed = JSON.parse(raw);
|
|
81
|
-
const accessToken = getCookie(request, SM_LEDVERY_ACCESS_TOKEN_COOKIE);
|
|
82
81
|
return {
|
|
83
82
|
idToken: parsed.idToken || "",
|
|
84
|
-
accessToken,
|
|
85
83
|
claims: parsed.claims,
|
|
86
84
|
expiresAt: parsed.expiresAt
|
|
87
85
|
};
|
|
@@ -177,11 +175,9 @@ function createLedveryRoutes(config) {
|
|
|
177
175
|
async function handleLogin(request) {
|
|
178
176
|
const url = new URL(request.url);
|
|
179
177
|
const returnTo = url.searchParams.get("returnTo");
|
|
180
|
-
const provider = url.searchParams.get("provider");
|
|
181
178
|
const validatedReturnTo = validateSafeRedirect(returnTo, { defaultPath: postLoginRedirect });
|
|
182
179
|
const authResult = await client.createAuthorizationUrl({
|
|
183
|
-
scope: defaultScope
|
|
184
|
-
extraParams: provider ? { upstream: provider } : void 0
|
|
180
|
+
scope: defaultScope
|
|
185
181
|
});
|
|
186
182
|
const response = new Response(null, {
|
|
187
183
|
status: 302,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { g as createWebhookHandler } from '../webhook-handler-
|
|
1
|
+
export { g as createWebhookHandler } from '../webhook-handler-C_bKDevj.mjs';
|
|
2
2
|
import '@scalemule/money';
|
|
3
|
-
import '../index-
|
|
3
|
+
import '../index-zQloSkpW.mjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { g as createWebhookHandler } from '../webhook-handler-
|
|
1
|
+
export { g as createWebhookHandler } from '../webhook-handler-D4uulN2T.js';
|
|
2
2
|
import '@scalemule/money';
|
|
3
|
-
import '../index-
|
|
3
|
+
import '../index-zQloSkpW.js';
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { U as User, A as ApiError, a9 as StorageFile } from './index-
|
|
3
|
+
import { U as User, A as ApiError, a9 as StorageFile } from './index-zQloSkpW.mjs';
|
|
4
4
|
|
|
5
5
|
interface MockUserOptions {
|
|
6
6
|
id?: string;
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { U as User, A as ApiError, a9 as StorageFile } from './index-
|
|
3
|
+
import { U as User, A as ApiError, a9 as StorageFile } from './index-zQloSkpW.js';
|
|
4
4
|
|
|
5
5
|
interface MockUserOptions {
|
|
6
6
|
id?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MoneyClient } from '@scalemule/money';
|
|
2
|
-
import { A as ApiError, $ as RegisterRequest, p as ClientContext, U as User, v as LoginRequest, L as LoginResponse, c as ListFilesParams, t as ListFilesResponse, a9 as StorageFile, af as UploadResponse } from './index-
|
|
2
|
+
import { A as ApiError, $ as RegisterRequest, p as ClientContext, U as User, v as LoginRequest, L as LoginResponse, c as ListFilesParams, t as ListFilesResponse, a9 as StorageFile, af as UploadResponse } from './index-zQloSkpW.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Server-Side ScaleMule Client
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MoneyClient } from '@scalemule/money';
|
|
2
|
-
import { A as ApiError, $ as RegisterRequest, p as ClientContext, U as User, v as LoginRequest, L as LoginResponse, c as ListFilesParams, t as ListFilesResponse, a9 as StorageFile, af as UploadResponse } from './index-
|
|
2
|
+
import { A as ApiError, $ as RegisterRequest, p as ClientContext, U as User, v as LoginRequest, L as LoginResponse, c as ListFilesParams, t as ListFilesResponse, a9 as StorageFile, af as UploadResponse } from './index-zQloSkpW.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Server-Side ScaleMule Client
|
package/package.json
CHANGED