@solvapay/react 1.2.1 → 1.3.0-preview-cb8ad16e16ce8f8f357bd7f2e7068d85159df587
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/CHANGELOG.md +11 -0
- package/dist/adapters/auth0.cjs +60 -0
- package/dist/adapters/auth0.d.cts +16 -0
- package/dist/adapters/auth0.d.ts +16 -0
- package/dist/adapters/auth0.js +15 -0
- package/dist/adapters/session-auth.cjs +49 -0
- package/dist/adapters/session-auth.d.cts +20 -0
- package/dist/adapters/session-auth.d.ts +20 -0
- package/dist/adapters/session-auth.js +6 -0
- package/dist/{chunk-XRNCDI2T.js → chunk-3UR4QQ5P.js} +1 -1
- package/dist/chunk-JTW665JR.js +25 -0
- package/dist/{chunk-Y2UAJG67.js → chunk-ORMHGGOU.js} +244 -73
- package/dist/{chunk-MYD6KTR2.js → chunk-WGDHMTDO.js} +1 -1
- package/dist/{index-DPoqku6R.d.cts → index-BwwdMBdt.d.ts} +20 -5
- package/dist/{index-Cs-QqpkJ.d.ts → index-kXLvp7EU.d.cts} +20 -5
- package/dist/index.cjs +294 -106
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +8 -3
- package/dist/mcp/index.cjs +328 -70
- package/dist/mcp/index.d.cts +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +131 -34
- package/dist/mcp/styles.css +39 -0
- package/dist/primitives/index.cjs +207 -38
- package/dist/primitives/index.d.cts +22 -5
- package/dist/primitives/index.d.ts +22 -5
- package/dist/primitives/index.js +6 -2
- package/dist/{shared-DpS2yEah.d.cts → shared-BNZAIWkU.d.cts} +196 -7
- package/dist/{shared-CXRbrNFw.d.ts → shared-lIhc8DS3.d.ts} +196 -7
- package/dist/styles.css +25 -0
- package/package.json +12 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @solvapay/react changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.0-preview-cb8ad16e16ce8f8f357bd7f2e7068d85159df587
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2de7fd8: Add Auth0 identity adapters across `@solvapay/auth`, `@solvapay/react`, and `@solvapay/next` (`createAuth0AuthMiddleware`), plus a `next-auth0` scaffolder template. The Next.js middleware now strips client-supplied identity headers (`x-user-id`, `authorization`) before forwarding a verified session identity downstream.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- c2a1169: Loosen internal `@solvapay/*` peerDependency ranges from `workspace:*` (exact) to `workspace:^` so a patch/minor bump of a peer no longer forces a major bump on its dependents. Affects `@solvapay/react` → `@solvapay/mcp-core`, `@solvapay/server` → `@solvapay/auth`, and `@solvapay/mcp` → `@solvapay/mcp-core`. This is a widening of the published peer range and is non-breaking for consumers.
|
|
12
|
+
- 2de7fd8: Surface server `{ error }` messages from failed plans and checkout fetches instead of generic HTTP status text.
|
|
13
|
+
|
|
3
14
|
## 1.2.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/adapters/auth0.ts
|
|
21
|
+
var auth0_exports = {};
|
|
22
|
+
__export(auth0_exports, {
|
|
23
|
+
createAuth0ClientAuthAdapter: () => createAuth0ClientAuthAdapter
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(auth0_exports);
|
|
26
|
+
|
|
27
|
+
// src/adapters/session-auth.ts
|
|
28
|
+
var DEFAULT_SENTINEL = "session-authenticated";
|
|
29
|
+
async function resolveValue(value) {
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
function createSessionAuthAdapter(options) {
|
|
33
|
+
const sentinel = options.sentinelToken ?? DEFAULT_SENTINEL;
|
|
34
|
+
return {
|
|
35
|
+
async getToken() {
|
|
36
|
+
if (options.getToken) {
|
|
37
|
+
return resolveValue(options.getToken());
|
|
38
|
+
}
|
|
39
|
+
const userId = await resolveValue(options.getUserId());
|
|
40
|
+
return userId ? sentinel : null;
|
|
41
|
+
},
|
|
42
|
+
async getUserId() {
|
|
43
|
+
return resolveValue(options.getUserId());
|
|
44
|
+
},
|
|
45
|
+
subscribe: options.subscribe
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/adapters/auth0.ts
|
|
50
|
+
function createAuth0ClientAuthAdapter(options) {
|
|
51
|
+
return createSessionAuthAdapter({
|
|
52
|
+
getUserId: () => options.userId ?? null,
|
|
53
|
+
sentinelToken: "auth0-session",
|
|
54
|
+
subscribe: options.subscribe
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
createAuth0ClientAuthAdapter
|
|
60
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AuthAdapter } from './auth.cjs';
|
|
2
|
+
import { createSessionAuthAdapter } from './session-auth.cjs';
|
|
3
|
+
|
|
4
|
+
interface Auth0ClientAuthAdapterOptions {
|
|
5
|
+
userId: string | null | undefined;
|
|
6
|
+
subscribe?: ReturnType<typeof createSessionAuthAdapter>['subscribe'];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Client adapter for `@auth0/nextjs-auth0` httpOnly session cookies.
|
|
10
|
+
*
|
|
11
|
+
* Pair with `createAuth0AuthAdapter` server middleware — the real credential
|
|
12
|
+
* is the session cookie; this adapter only reports sign-in state to the SDK.
|
|
13
|
+
*/
|
|
14
|
+
declare function createAuth0ClientAuthAdapter(options: Auth0ClientAuthAdapterOptions): AuthAdapter;
|
|
15
|
+
|
|
16
|
+
export { type Auth0ClientAuthAdapterOptions, createAuth0ClientAuthAdapter };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AuthAdapter } from './auth.js';
|
|
2
|
+
import { createSessionAuthAdapter } from './session-auth.js';
|
|
3
|
+
|
|
4
|
+
interface Auth0ClientAuthAdapterOptions {
|
|
5
|
+
userId: string | null | undefined;
|
|
6
|
+
subscribe?: ReturnType<typeof createSessionAuthAdapter>['subscribe'];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Client adapter for `@auth0/nextjs-auth0` httpOnly session cookies.
|
|
10
|
+
*
|
|
11
|
+
* Pair with `createAuth0AuthAdapter` server middleware — the real credential
|
|
12
|
+
* is the session cookie; this adapter only reports sign-in state to the SDK.
|
|
13
|
+
*/
|
|
14
|
+
declare function createAuth0ClientAuthAdapter(options: Auth0ClientAuthAdapterOptions): AuthAdapter;
|
|
15
|
+
|
|
16
|
+
export { type Auth0ClientAuthAdapterOptions, createAuth0ClientAuthAdapter };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSessionAuthAdapter
|
|
3
|
+
} from "../chunk-JTW665JR.js";
|
|
4
|
+
|
|
5
|
+
// src/adapters/auth0.ts
|
|
6
|
+
function createAuth0ClientAuthAdapter(options) {
|
|
7
|
+
return createSessionAuthAdapter({
|
|
8
|
+
getUserId: () => options.userId ?? null,
|
|
9
|
+
sentinelToken: "auth0-session",
|
|
10
|
+
subscribe: options.subscribe
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
createAuth0ClientAuthAdapter
|
|
15
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/adapters/session-auth.ts
|
|
21
|
+
var session_auth_exports = {};
|
|
22
|
+
__export(session_auth_exports, {
|
|
23
|
+
createSessionAuthAdapter: () => createSessionAuthAdapter
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(session_auth_exports);
|
|
26
|
+
var DEFAULT_SENTINEL = "session-authenticated";
|
|
27
|
+
async function resolveValue(value) {
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
function createSessionAuthAdapter(options) {
|
|
31
|
+
const sentinel = options.sentinelToken ?? DEFAULT_SENTINEL;
|
|
32
|
+
return {
|
|
33
|
+
async getToken() {
|
|
34
|
+
if (options.getToken) {
|
|
35
|
+
return resolveValue(options.getToken());
|
|
36
|
+
}
|
|
37
|
+
const userId = await resolveValue(options.getUserId());
|
|
38
|
+
return userId ? sentinel : null;
|
|
39
|
+
},
|
|
40
|
+
async getUserId() {
|
|
41
|
+
return resolveValue(options.getUserId());
|
|
42
|
+
},
|
|
43
|
+
subscribe: options.subscribe
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
createSessionAuthAdapter
|
|
49
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AuthAdapter } from './auth.cjs';
|
|
2
|
+
|
|
3
|
+
interface SessionAuthAdapterOptions {
|
|
4
|
+
/** Returns the stable user id (e.g. Auth0 `sub`). */
|
|
5
|
+
getUserId: () => Promise<string | null> | string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Optional token for SDK session-alive checks. When omitted, a non-null sentinel
|
|
8
|
+
* is returned whenever `getUserId` resolves to a value.
|
|
9
|
+
*/
|
|
10
|
+
getToken?: () => Promise<string | null> | string | null;
|
|
11
|
+
sentinelToken?: string;
|
|
12
|
+
subscribe?: AuthAdapter['subscribe'];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Client adapter for httpOnly-cookie session auth where the browser cannot read
|
|
16
|
+
* the real credential. Reports authenticated state via a sentinel token.
|
|
17
|
+
*/
|
|
18
|
+
declare function createSessionAuthAdapter(options: SessionAuthAdapterOptions): AuthAdapter;
|
|
19
|
+
|
|
20
|
+
export { type SessionAuthAdapterOptions, createSessionAuthAdapter };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AuthAdapter } from './auth.js';
|
|
2
|
+
|
|
3
|
+
interface SessionAuthAdapterOptions {
|
|
4
|
+
/** Returns the stable user id (e.g. Auth0 `sub`). */
|
|
5
|
+
getUserId: () => Promise<string | null> | string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Optional token for SDK session-alive checks. When omitted, a non-null sentinel
|
|
8
|
+
* is returned whenever `getUserId` resolves to a value.
|
|
9
|
+
*/
|
|
10
|
+
getToken?: () => Promise<string | null> | string | null;
|
|
11
|
+
sentinelToken?: string;
|
|
12
|
+
subscribe?: AuthAdapter['subscribe'];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Client adapter for httpOnly-cookie session auth where the browser cannot read
|
|
16
|
+
* the real credential. Reports authenticated state via a sentinel token.
|
|
17
|
+
*/
|
|
18
|
+
declare function createSessionAuthAdapter(options: SessionAuthAdapterOptions): AuthAdapter;
|
|
19
|
+
|
|
20
|
+
export { type SessionAuthAdapterOptions, createSessionAuthAdapter };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/adapters/session-auth.ts
|
|
2
|
+
var DEFAULT_SENTINEL = "session-authenticated";
|
|
3
|
+
async function resolveValue(value) {
|
|
4
|
+
return value;
|
|
5
|
+
}
|
|
6
|
+
function createSessionAuthAdapter(options) {
|
|
7
|
+
const sentinel = options.sentinelToken ?? DEFAULT_SENTINEL;
|
|
8
|
+
return {
|
|
9
|
+
async getToken() {
|
|
10
|
+
if (options.getToken) {
|
|
11
|
+
return resolveValue(options.getToken());
|
|
12
|
+
}
|
|
13
|
+
const userId = await resolveValue(options.getUserId());
|
|
14
|
+
return userId ? sentinel : null;
|
|
15
|
+
},
|
|
16
|
+
async getUserId() {
|
|
17
|
+
return resolveValue(options.getUserId());
|
|
18
|
+
},
|
|
19
|
+
subscribe: options.subscribe
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
createSessionAuthAdapter
|
|
25
|
+
};
|