@qelos/integrator-next 4.2.0 → 4.2.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/README.md CHANGED
@@ -7,9 +7,6 @@ route proxies `/api/**` to Qelos with `Set-Cookie` domain rewriting, and the
7
7
  SDK reads live `Cookie` / `Authorization` headers on every call — no
8
8
  integrator-managed access or refresh tokens.
9
9
 
10
- Supports the **App Router** and the **Pages Router** on Next.js **14** and
11
- **15**.
12
-
13
10
  > Requires **Node 18+** — the middleware and proxy use
14
11
  > [`Response.headers.getSetCookie()`](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
15
12
  > to forward individual upstream `Set-Cookie` headers.
@@ -22,6 +19,20 @@ pnpm add @qelos/integrator-next @qelos/sdk
22
19
 
23
20
  `next` (>=13.4) and `react` are peer dependencies.
24
21
 
22
+ ## Version support
23
+
24
+ | | |
25
+ |---|---|
26
+ | **Minimum** | Next.js **13.4+** (App Router and Pages Router) |
27
+ | **Tested through** | Next.js **15.x** (see `devDependencies.next` in this package) |
28
+ | **Peer range** | `>=13.4.0` — forward-compatible; no upper bound so future Next majors remain supported until a breaking API change requires a new integrator release |
29
+ | **React** | `>=18.2.0` (optional peer) |
30
+ | **Node.js** | `>=18` |
31
+
32
+ The integrator avoids APIs tied to a single Next major where possible (for
33
+ example, `next/headers` is consumed in a way that accepts both sync and async
34
+ return shapes). Report issues on newer Next releases if you hit a regression.
35
+
25
36
  ## Quick start
26
37
 
27
38
  Set `QELOS_APP_URL`, then wire Edge middleware and a catch-all API proxy route.
@@ -199,3 +210,11 @@ export const getServerSideProps = withQelosSSR(
199
210
  `completeSocialAuthCallback` and the re-exported SDK helpers forward Qelos
200
211
  session cookies from `socialCallback` onto your Node response — use them from
201
212
  a route handler that owns the response object.
213
+
214
+ ## MCP OAuth
215
+
216
+ When your app is the MCP OAuth issuer on a custom domain, host `/login` and
217
+ `/mcp/authorize` and use the re-exported MCP helpers (`resolveMcpLoginRedirect`,
218
+ `decodeMcpOAuthStatePayload`, `completeMcpAuthorizationCallback`, …). See
219
+ [MCP OAuth for integrator apps](https://docs.qelos.io/auth/mcp-oauth-integrators)
220
+ in the Qelos docs.
package/dist/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export { rewriteSetCookieDomain, rewriteSetCookieDomains } from './cookies';
9
9
  export { resolveQelosProxyTarget } from './proxy-target';
10
10
  export { createQelosApiProxyHandlers } from './runtime/api-proxy';
11
11
  export { completeSocialAuthCallback, applySocialAuthCookiesToServerResponse, getSocialAuthSetCookieParts, parseSocialCallbackRefreshToken, type SocialAuthCallbackPayload, type SocialCallbackInput, } from './social-auth';
12
+ export { completeMcpAuthorizationCallback, appendMcpAccessDeniedRedirect, buildMcpAuthorizePath, buildMcpAuthorizePathFromQuery, buildMcpConsentPageUrl, buildMcpLoginRedirectUrl, buildMcpTokenExchangeBody, decodeMcpOAuthStatePayload, parseMcpCallbackParams, resolveMcpLoginRedirect, type CompleteMcpAuthorizationCallbackOptions, type DecodedMcpOAuthStatePayload, type McpAuthorizeOptions, type McpCallbackInput, type McpCallbackParams, type McpPagePathOptions, type McpTokenExchangeOptions, type McpTokenExchangeResult, } from './mcp-auth';
package/dist/index.js CHANGED
@@ -9,4 +9,5 @@ export { rewriteSetCookieDomain, rewriteSetCookieDomains } from './cookies';
9
9
  export { resolveQelosProxyTarget } from './proxy-target';
10
10
  export { createQelosApiProxyHandlers } from './runtime/api-proxy';
11
11
  export { completeSocialAuthCallback, applySocialAuthCookiesToServerResponse, getSocialAuthSetCookieParts, parseSocialCallbackRefreshToken, } from './social-auth';
12
+ export { completeMcpAuthorizationCallback, appendMcpAccessDeniedRedirect, buildMcpAuthorizePath, buildMcpAuthorizePathFromQuery, buildMcpConsentPageUrl, buildMcpLoginRedirectUrl, buildMcpTokenExchangeBody, decodeMcpOAuthStatePayload, parseMcpCallbackParams, resolveMcpLoginRedirect, } from './mcp-auth';
12
13
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAwB,MAAM,eAAe,CAAC;AAEvE,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GAEjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,mBAAmB,GAEpB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,cAAc,GAGf,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GAGvB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EACL,0BAA0B,EAC1B,sCAAsC,EACtC,2BAA2B,EAC3B,+BAA+B,GAGhC,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAwB,MAAM,eAAe,CAAC;AAEvE,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GAEjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,mBAAmB,GAEpB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,cAAc,GAGf,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GAGvB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EACL,0BAA0B,EAC1B,sCAAsC,EACtC,2BAA2B,EAC3B,+BAA+B,GAGhC,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,qBAAqB,EACrB,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,GASxB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type QelosSDK from '@qelos/sdk';
2
+ import type { McpCallbackInput, McpTokenExchangeResult } from '@qelos/sdk';
3
+ export interface CompleteMcpAuthorizationCallbackOptions {
4
+ redirectUri: string;
5
+ codeVerifier: string;
6
+ }
7
+ /**
8
+ * Parse an MCP OAuth callback and exchange the authorization code for tokens.
9
+ * Use when your app owns the MCP client callback URL (e.g. a local loopback server).
10
+ */
11
+ export declare function completeMcpAuthorizationCallback(sdk: QelosSDK, input: McpCallbackInput, options: CompleteMcpAuthorizationCallbackOptions): Promise<McpTokenExchangeResult>;
12
+ export { appendMcpAccessDeniedRedirect, buildMcpAuthorizePath, buildMcpAuthorizePathFromQuery, buildMcpConsentPageUrl, buildMcpLoginRedirectUrl, buildMcpTokenExchangeBody, decodeMcpOAuthStatePayload, parseMcpCallbackParams, resolveMcpLoginRedirect, type DecodedMcpOAuthStatePayload, type McpAuthorizeOptions, type McpCallbackInput, type McpCallbackParams, type McpPagePathOptions, type McpTokenExchangeOptions, type McpTokenExchangeResult, } from '@qelos/sdk';
@@ -0,0 +1,21 @@
1
+ import { parseMcpCallbackParams } from '@qelos/sdk';
2
+ /**
3
+ * Parse an MCP OAuth callback and exchange the authorization code for tokens.
4
+ * Use when your app owns the MCP client callback URL (e.g. a local loopback server).
5
+ */
6
+ export async function completeMcpAuthorizationCallback(sdk, input, options) {
7
+ const params = parseMcpCallbackParams(input);
8
+ if (params.error) {
9
+ throw new Error(params.errorDescription || params.error);
10
+ }
11
+ if (!params.code) {
12
+ throw new Error('missing authorization code');
13
+ }
14
+ return sdk.authentication.exchangeMcpAuthorizationCode({
15
+ code: params.code,
16
+ redirectUri: options.redirectUri,
17
+ codeVerifier: options.codeVerifier,
18
+ });
19
+ }
20
+ export { appendMcpAccessDeniedRedirect, buildMcpAuthorizePath, buildMcpAuthorizePathFromQuery, buildMcpConsentPageUrl, buildMcpLoginRedirectUrl, buildMcpTokenExchangeBody, decodeMcpOAuthStatePayload, parseMcpCallbackParams, resolveMcpLoginRedirect, } from '@qelos/sdk';
21
+ //# sourceMappingURL=mcp-auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-auth.js","sourceRoot":"","sources":["../src/mcp-auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAOpD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,GAAa,EACb,KAAuB,EACvB,OAAgD;IAEhD,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,gBAAgB,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,GAAG,CAAC,cAAc,CAAC,4BAA4B,CAAC;QACrD,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,YAAY,EAAE,OAAO,CAAC,YAAY;KACnC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,GAQxB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Declared Next.js compatibility policy for `@qelos/integrator-next`.
3
+ * Keep in sync with `peerDependencies.next` in package.json and README.
4
+ */
5
+ export declare const MIN_NEXT_VERSION = "13.4.0";
6
+ /** Latest major we type-check and unit-test against (see devDependencies.next). */
7
+ export declare const TESTED_NEXT_MAJOR = 15;
8
+ /** Forward-compatible peer range — no upper bound so future majors stay supported. */
9
+ export declare const NEXT_PEER_RANGE = ">=13.4.0";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Declared Next.js compatibility policy for `@qelos/integrator-next`.
3
+ * Keep in sync with `peerDependencies.next` in package.json and README.
4
+ */
5
+ export const MIN_NEXT_VERSION = '13.4.0';
6
+ /** Latest major we type-check and unit-test against (see devDependencies.next). */
7
+ export const TESTED_NEXT_MAJOR = 15;
8
+ /** Forward-compatible peer range — no upper bound so future majors stay supported. */
9
+ export const NEXT_PEER_RANGE = '>=13.4.0';
10
+ //# sourceMappingURL=version-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-support.js","sourceRoot":"","sources":["../src/version-support.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAEzC,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC,sFAAsF;AACtF,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qelos/integrator-next",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "Qelos integrator middleware for Next.js (App Router and Pages Router): identifies the user and workspace via the Qelos SDK before the application's own handler runs.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -70,11 +70,11 @@
70
70
  }
71
71
  },
72
72
  "dependencies": {
73
- "@qelos/sdk": "4.2.0"
73
+ "@qelos/sdk": "4.2.2"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/node": "^22.5.4",
77
- "next": "^14.2.5",
77
+ "next": "^15.5.23",
78
78
  "react": "^18.3.1",
79
79
  "tsx": "^4.21.0",
80
80
  "typescript": "^5.4.5"