@proxy-checkout/server-js 0.0.8-prx-109.80.1 → 0.0.8-prx-109.82.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 +4 -2
- package/dist/cjs/sessions.d.cts +7 -0
- package/dist/cjs/sessions.d.ts +7 -0
- package/dist/cjs/version.d.cts +2 -2
- package/dist/cjs/version.d.ts +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/webhook-handler.d.cts +15 -3
- package/dist/cjs/webhook-handler.d.ts +15 -3
- package/dist/esm/sessions.d.ts +7 -0
- package/dist/esm/version.d.ts +2 -2
- package/dist/esm/version.js +1 -1
- package/dist/esm/webhook-handler.d.ts +15 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ const handoff = await proxy.sessions.createHandoff({
|
|
|
39
39
|
// use a pending entitlement id instead of an email address.
|
|
40
40
|
buyerReference: "buyer_123",
|
|
41
41
|
// Optional beneficiary contact for the person receiving access.
|
|
42
|
-
beneficiaryContact: { email: "
|
|
42
|
+
beneficiaryContact: { email: "recipient@example.com" },
|
|
43
43
|
currency: "usd",
|
|
44
44
|
cartSnapshot: {
|
|
45
45
|
items: [{ product_id: "prod_123", quantity: 1 }],
|
|
@@ -93,7 +93,9 @@ await proxy.webhooks.handle(request, {
|
|
|
93
93
|
});
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
`fulfillmentReference` is copied to Proxy's `proxy_session.provisioned` session/audit event. Use it for support and reconciliation, for example "Proxy session `psess_...` was fulfilled by Fiveable pending entitlement `pent_...`." It does not grant access and is not used for future claim validation.
|
|
97
|
+
|
|
98
|
+
For pre-account purchases, create a durable pending entitlement before `sessions.createHandoff(...)`, use that pending entitlement id as `buyerReference`, pass the future recipient's contact as `beneficiaryContact`, and claim the entitlement after signup/login with your own high-entropy claim token. Store only the token hash on the pending entitlement; use `sessionStorage` or an emailed merchant-owned claim link to carry the plaintext token to the authenticated claim endpoint. Treat `proxy_session_id` as public correlation, not as a claim secret.
|
|
97
99
|
|
|
98
100
|
Verify and parse outbound webhooks with the exact raw request body:
|
|
99
101
|
|
package/dist/cjs/sessions.d.cts
CHANGED
|
@@ -95,7 +95,14 @@ export interface ProxySessionProviderBinding {
|
|
|
95
95
|
readonly updatedAt: string;
|
|
96
96
|
}
|
|
97
97
|
export interface MarkProxySessionProvisionedInput extends ProxyCheckoutServerRequestOptions {
|
|
98
|
+
/**
|
|
99
|
+
* Optional merchant-side fulfillment row id to store on Proxy's provisioned
|
|
100
|
+
* session/audit event, for example a pending entitlement id or durable role
|
|
101
|
+
* id. This is for support and reconciliation only; do not put claim tokens or
|
|
102
|
+
* secrets here.
|
|
103
|
+
*/
|
|
98
104
|
readonly fulfillmentReference?: string;
|
|
105
|
+
/** Optional non-secret metadata to store with the provisioned acknowledgement. */
|
|
99
106
|
readonly metadata?: JsonObject;
|
|
100
107
|
}
|
|
101
108
|
export interface MarkProxySessionProvisioningFailedInput extends ProxyCheckoutServerRequestOptions {
|
package/dist/cjs/sessions.d.ts
CHANGED
|
@@ -95,7 +95,14 @@ export interface ProxySessionProviderBinding {
|
|
|
95
95
|
readonly updatedAt: string;
|
|
96
96
|
}
|
|
97
97
|
export interface MarkProxySessionProvisionedInput extends ProxyCheckoutServerRequestOptions {
|
|
98
|
+
/**
|
|
99
|
+
* Optional merchant-side fulfillment row id to store on Proxy's provisioned
|
|
100
|
+
* session/audit event, for example a pending entitlement id or durable role
|
|
101
|
+
* id. This is for support and reconciliation only; do not put claim tokens or
|
|
102
|
+
* secrets here.
|
|
103
|
+
*/
|
|
98
104
|
readonly fulfillmentReference?: string;
|
|
105
|
+
/** Optional non-secret metadata to store with the provisioned acknowledgement. */
|
|
99
106
|
readonly metadata?: JsonObject;
|
|
100
107
|
}
|
|
101
108
|
export interface MarkProxySessionProvisioningFailedInput extends ProxyCheckoutServerRequestOptions {
|
package/dist/cjs/version.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-109.
|
|
3
|
-
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-109.
|
|
2
|
+
export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-109.82.1";
|
|
3
|
+
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-109.82.1";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-109.
|
|
3
|
-
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-109.
|
|
2
|
+
export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-109.82.1";
|
|
3
|
+
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-109.82.1";
|
package/dist/cjs/version.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.proxyCheckoutServerSdkUserAgent = exports.proxyCheckoutServerSdkVersion = exports.proxyCheckoutServerSdkName = void 0;
|
|
4
4
|
exports.proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
5
|
-
exports.proxyCheckoutServerSdkVersion = "0.0.8-prx-109.
|
|
5
|
+
exports.proxyCheckoutServerSdkVersion = "0.0.8-prx-109.82.1";
|
|
6
6
|
exports.proxyCheckoutServerSdkUserAgent = `${exports.proxyCheckoutServerSdkName}/${exports.proxyCheckoutServerSdkVersion}`;
|
|
@@ -40,11 +40,20 @@ export interface ProxyWebhookProvisioningFailure {
|
|
|
40
40
|
readonly errorMessage: string;
|
|
41
41
|
readonly metadata?: JsonObject;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Optional data recorded when the handler acknowledges successful initial
|
|
45
|
+
* provisioning back to Proxy. This is audit/reconciliation data only. It does
|
|
46
|
+
* not grant access, does not participate in future claim-token validation, and
|
|
47
|
+
* should not contain secrets.
|
|
48
|
+
*/
|
|
43
49
|
export interface ProxyWebhookProvisioningSuccess {
|
|
50
|
+
/** Stable merchant-side row id that fulfilled the session, such as a pending entitlement or role id. */
|
|
44
51
|
readonly fulfillmentReference?: string;
|
|
52
|
+
/** Small non-secret facts to store on Proxy's provisioned session/audit event. */
|
|
45
53
|
readonly metadata?: JsonObject;
|
|
46
54
|
}
|
|
47
|
-
|
|
55
|
+
type ProxyWebhookNoProvisioningMetadataResult = void;
|
|
56
|
+
export type ProxyWebhookProvisioningSuccessResult = ProxyWebhookProvisioningSuccess | null | undefined | ProxyWebhookNoProvisioningMetadataResult;
|
|
48
57
|
export interface ProxyWebhookPayloadInput {
|
|
49
58
|
readonly body: Buffer | string;
|
|
50
59
|
readonly signature?: string | null;
|
|
@@ -63,8 +72,10 @@ export interface ProxyWebhookHandlerOptions {
|
|
|
63
72
|
readonly classifyProvisioningFailure?: (error: unknown, resolved: ResolvedProxyEvent) => Promise<ProxyWebhookProvisioningFailure | null | undefined> | ProxyWebhookProvisioningFailure | null | undefined;
|
|
64
73
|
/**
|
|
65
74
|
* Merchant entitlement callback, invoked once per claimed event after
|
|
66
|
-
* current-state resolution. For initial provisioning,
|
|
67
|
-
*
|
|
75
|
+
* current-state resolution. For initial provisioning, mutate the merchant's
|
|
76
|
+
* entitlement store first, then optionally return the merchant-side row id
|
|
77
|
+
* and non-secret metadata to record on Proxy's provisioned acknowledgement.
|
|
78
|
+
* Do not return claim tokens or other secrets here.
|
|
68
79
|
*/
|
|
69
80
|
readonly onResolved: (resolved: ResolvedProxyEvent) => Promise<ProxyWebhookProvisioningSuccessResult> | ProxyWebhookProvisioningSuccessResult;
|
|
70
81
|
/** Optional request id forwarded to the current-state retrieval calls. */
|
|
@@ -111,3 +122,4 @@ export declare class ProxyWebhooksResource {
|
|
|
111
122
|
private runResolvedHandler;
|
|
112
123
|
private requireSessionsResource;
|
|
113
124
|
}
|
|
125
|
+
export {};
|
|
@@ -40,11 +40,20 @@ export interface ProxyWebhookProvisioningFailure {
|
|
|
40
40
|
readonly errorMessage: string;
|
|
41
41
|
readonly metadata?: JsonObject;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Optional data recorded when the handler acknowledges successful initial
|
|
45
|
+
* provisioning back to Proxy. This is audit/reconciliation data only. It does
|
|
46
|
+
* not grant access, does not participate in future claim-token validation, and
|
|
47
|
+
* should not contain secrets.
|
|
48
|
+
*/
|
|
43
49
|
export interface ProxyWebhookProvisioningSuccess {
|
|
50
|
+
/** Stable merchant-side row id that fulfilled the session, such as a pending entitlement or role id. */
|
|
44
51
|
readonly fulfillmentReference?: string;
|
|
52
|
+
/** Small non-secret facts to store on Proxy's provisioned session/audit event. */
|
|
45
53
|
readonly metadata?: JsonObject;
|
|
46
54
|
}
|
|
47
|
-
|
|
55
|
+
type ProxyWebhookNoProvisioningMetadataResult = void;
|
|
56
|
+
export type ProxyWebhookProvisioningSuccessResult = ProxyWebhookProvisioningSuccess | null | undefined | ProxyWebhookNoProvisioningMetadataResult;
|
|
48
57
|
export interface ProxyWebhookPayloadInput {
|
|
49
58
|
readonly body: Buffer | string;
|
|
50
59
|
readonly signature?: string | null;
|
|
@@ -63,8 +72,10 @@ export interface ProxyWebhookHandlerOptions {
|
|
|
63
72
|
readonly classifyProvisioningFailure?: (error: unknown, resolved: ResolvedProxyEvent) => Promise<ProxyWebhookProvisioningFailure | null | undefined> | ProxyWebhookProvisioningFailure | null | undefined;
|
|
64
73
|
/**
|
|
65
74
|
* Merchant entitlement callback, invoked once per claimed event after
|
|
66
|
-
* current-state resolution. For initial provisioning,
|
|
67
|
-
*
|
|
75
|
+
* current-state resolution. For initial provisioning, mutate the merchant's
|
|
76
|
+
* entitlement store first, then optionally return the merchant-side row id
|
|
77
|
+
* and non-secret metadata to record on Proxy's provisioned acknowledgement.
|
|
78
|
+
* Do not return claim tokens or other secrets here.
|
|
68
79
|
*/
|
|
69
80
|
readonly onResolved: (resolved: ResolvedProxyEvent) => Promise<ProxyWebhookProvisioningSuccessResult> | ProxyWebhookProvisioningSuccessResult;
|
|
70
81
|
/** Optional request id forwarded to the current-state retrieval calls. */
|
|
@@ -111,3 +122,4 @@ export declare class ProxyWebhooksResource {
|
|
|
111
122
|
private runResolvedHandler;
|
|
112
123
|
private requireSessionsResource;
|
|
113
124
|
}
|
|
125
|
+
export {};
|
package/dist/esm/sessions.d.ts
CHANGED
|
@@ -95,7 +95,14 @@ export interface ProxySessionProviderBinding {
|
|
|
95
95
|
readonly updatedAt: string;
|
|
96
96
|
}
|
|
97
97
|
export interface MarkProxySessionProvisionedInput extends ProxyCheckoutServerRequestOptions {
|
|
98
|
+
/**
|
|
99
|
+
* Optional merchant-side fulfillment row id to store on Proxy's provisioned
|
|
100
|
+
* session/audit event, for example a pending entitlement id or durable role
|
|
101
|
+
* id. This is for support and reconciliation only; do not put claim tokens or
|
|
102
|
+
* secrets here.
|
|
103
|
+
*/
|
|
98
104
|
readonly fulfillmentReference?: string;
|
|
105
|
+
/** Optional non-secret metadata to store with the provisioned acknowledgement. */
|
|
99
106
|
readonly metadata?: JsonObject;
|
|
100
107
|
}
|
|
101
108
|
export interface MarkProxySessionProvisioningFailedInput extends ProxyCheckoutServerRequestOptions {
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-109.
|
|
3
|
-
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-109.
|
|
2
|
+
export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-109.82.1";
|
|
3
|
+
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-109.82.1";
|
package/dist/esm/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export const proxyCheckoutServerSdkVersion = "0.0.8-prx-109.
|
|
2
|
+
export const proxyCheckoutServerSdkVersion = "0.0.8-prx-109.82.1";
|
|
3
3
|
export const proxyCheckoutServerSdkUserAgent = `${proxyCheckoutServerSdkName}/${proxyCheckoutServerSdkVersion}`;
|
|
@@ -40,11 +40,20 @@ export interface ProxyWebhookProvisioningFailure {
|
|
|
40
40
|
readonly errorMessage: string;
|
|
41
41
|
readonly metadata?: JsonObject;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Optional data recorded when the handler acknowledges successful initial
|
|
45
|
+
* provisioning back to Proxy. This is audit/reconciliation data only. It does
|
|
46
|
+
* not grant access, does not participate in future claim-token validation, and
|
|
47
|
+
* should not contain secrets.
|
|
48
|
+
*/
|
|
43
49
|
export interface ProxyWebhookProvisioningSuccess {
|
|
50
|
+
/** Stable merchant-side row id that fulfilled the session, such as a pending entitlement or role id. */
|
|
44
51
|
readonly fulfillmentReference?: string;
|
|
52
|
+
/** Small non-secret facts to store on Proxy's provisioned session/audit event. */
|
|
45
53
|
readonly metadata?: JsonObject;
|
|
46
54
|
}
|
|
47
|
-
|
|
55
|
+
type ProxyWebhookNoProvisioningMetadataResult = void;
|
|
56
|
+
export type ProxyWebhookProvisioningSuccessResult = ProxyWebhookProvisioningSuccess | null | undefined | ProxyWebhookNoProvisioningMetadataResult;
|
|
48
57
|
export interface ProxyWebhookPayloadInput {
|
|
49
58
|
readonly body: Buffer | string;
|
|
50
59
|
readonly signature?: string | null;
|
|
@@ -63,8 +72,10 @@ export interface ProxyWebhookHandlerOptions {
|
|
|
63
72
|
readonly classifyProvisioningFailure?: (error: unknown, resolved: ResolvedProxyEvent) => Promise<ProxyWebhookProvisioningFailure | null | undefined> | ProxyWebhookProvisioningFailure | null | undefined;
|
|
64
73
|
/**
|
|
65
74
|
* Merchant entitlement callback, invoked once per claimed event after
|
|
66
|
-
* current-state resolution. For initial provisioning,
|
|
67
|
-
*
|
|
75
|
+
* current-state resolution. For initial provisioning, mutate the merchant's
|
|
76
|
+
* entitlement store first, then optionally return the merchant-side row id
|
|
77
|
+
* and non-secret metadata to record on Proxy's provisioned acknowledgement.
|
|
78
|
+
* Do not return claim tokens or other secrets here.
|
|
68
79
|
*/
|
|
69
80
|
readonly onResolved: (resolved: ResolvedProxyEvent) => Promise<ProxyWebhookProvisioningSuccessResult> | ProxyWebhookProvisioningSuccessResult;
|
|
70
81
|
/** Optional request id forwarded to the current-state retrieval calls. */
|
|
@@ -111,3 +122,4 @@ export declare class ProxyWebhooksResource {
|
|
|
111
122
|
private runResolvedHandler;
|
|
112
123
|
private requireSessionsResource;
|
|
113
124
|
}
|
|
125
|
+
export {};
|
package/package.json
CHANGED