@qelos/integrator-next 4.1.1 → 4.2.1
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 +22 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-auth.d.ts +12 -0
- package/dist/mcp-auth.js +21 -0
- package/dist/mcp-auth.js.map +1 -0
- package/dist/version-support.d.ts +9 -0
- package/dist/version-support.js +10 -0
- package/dist/version-support.js.map +1 -0
- package/package.json +10 -10
- package/LICENSE +0 -20
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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@ -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';
|
package/dist/mcp-auth.js
ADDED
|
@@ -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.
|
|
3
|
+
"version": "4.2.1",
|
|
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",
|
|
@@ -60,6 +60,12 @@
|
|
|
60
60
|
"dist",
|
|
61
61
|
"README.md"
|
|
62
62
|
],
|
|
63
|
+
"scripts": {
|
|
64
|
+
"type-check": "tsc --noEmit",
|
|
65
|
+
"build": "tsc",
|
|
66
|
+
"pre-build": "tsc",
|
|
67
|
+
"test": "node --import tsx --test \"src/**/*.test.ts\""
|
|
68
|
+
},
|
|
63
69
|
"peerDependencies": {
|
|
64
70
|
"next": ">=13.4.0",
|
|
65
71
|
"react": ">=18.2.0"
|
|
@@ -70,11 +76,11 @@
|
|
|
70
76
|
}
|
|
71
77
|
},
|
|
72
78
|
"dependencies": {
|
|
73
|
-
"@qelos/sdk": "
|
|
79
|
+
"@qelos/sdk": "workspace:*"
|
|
74
80
|
},
|
|
75
81
|
"devDependencies": {
|
|
76
82
|
"@types/node": "^22.5.4",
|
|
77
|
-
"next": "^
|
|
83
|
+
"next": "^15.5.23",
|
|
78
84
|
"react": "^18.3.1",
|
|
79
85
|
"tsx": "^4.21.0",
|
|
80
86
|
"typescript": "^5.4.5"
|
|
@@ -86,11 +92,5 @@
|
|
|
86
92
|
},
|
|
87
93
|
"engines": {
|
|
88
94
|
"node": ">=18"
|
|
89
|
-
},
|
|
90
|
-
"scripts": {
|
|
91
|
-
"type-check": "tsc --noEmit",
|
|
92
|
-
"build": "tsc",
|
|
93
|
-
"pre-build": "tsc",
|
|
94
|
-
"test": "node --import tsx --test \"src/**/*.test.ts\""
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Polyform Shield License 1.0.0
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Velocitech LTD
|
|
4
|
-
|
|
5
|
-
Your use of this software is governed by the Polyform Shield License 1.0.0.
|
|
6
|
-
|
|
7
|
-
You may obtain a copy of the License at:
|
|
8
|
-
https://polyformproject.org/licenses/shield/1.0.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
|
|
12
|
-
Additional Terms – Exception Notice:
|
|
13
|
-
|
|
14
|
-
The author of this software grants additional permissions beyond the Polyform Shield License 1.0.0:
|
|
15
|
-
|
|
16
|
-
✅ All uses of the software are permitted — including modification, distribution, commercial use, and sublicensing — as long as the software is not used to create, offer, or operate any product or service that competes directly with Qelos (https://qelos.io), a no-code platform for building AI-assisted SaaS applications.
|
|
17
|
-
|
|
18
|
-
❌ "Direct competition" includes platforms, tools, or services that enable users to visually or programmatically create SaaS applications with the assistance of artificial intelligence.
|
|
19
|
-
|
|
20
|
-
This exception does not modify the terms of the original Polyform Shield License for other users and applies only by explicit permission of the licensor.
|