@proxy-checkout/server-js 0.0.8-prx-124.133.1 → 0.0.8-prx-124.134.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 CHANGED
@@ -76,6 +76,8 @@ For delegated checkout, prefer the high-level flow:
76
76
 
77
77
  Use `payerHandoff`, `payerOpened`, raw event construction, or manual provisioning acknowledgements only for custom integrations that cannot use the default helpers.
78
78
 
79
+ The legacy `proxy.sessions.recordProviderBinding(...)` compatibility adapter is deprecated. If a custom Stripe integration still calls it directly, pass canonical `psp: "stripe"` plus `commercialMode: "one_time"` for Checkout `mode: "payment"` or `commercialMode: "subscription"` for Checkout `mode: "subscription"`. Current TypeScript callers receive that requirement at compile time; `openCheckout(...)` derives it automatically.
80
+
79
81
  `proxy.webhooks.handle(...)` automatically marks successful initial provisioning as provisioned after `onResolved` completes. Return a fulfillment reference and/or metadata from `onResolved` when you want that acknowledgement to record the merchant-side access row:
80
82
 
81
83
  ```ts
@@ -100,12 +100,21 @@ export interface ProxySessionCartResult {
100
100
  readonly cartVersion: number;
101
101
  readonly currency: string;
102
102
  }
103
- export interface RecordProviderBindingInput extends ProxyCheckoutServerRequestOptions {
104
- /** Required for Stripe so Proxy can safely infer the deprecated binding into an acquisition. */
105
- readonly commercialMode?: "one_time" | "subscription";
103
+ interface RecordProviderBindingBaseInput extends ProxyCheckoutServerRequestOptions {
106
104
  readonly providerCheckoutSessionId: string;
107
- readonly psp: string;
108
105
  }
106
+ /**
107
+ * Input for the deprecated provider-binding compatibility adapter.
108
+ * Canonical Stripe literals require `commercialMode` at compile time; dynamic
109
+ * or untyped inputs remain protected by the matching runtime validation.
110
+ */
111
+ export type RecordProviderBindingInput<TPsp extends string = string> = RecordProviderBindingBaseInput & {
112
+ readonly psp: TPsp;
113
+ } & (Lowercase<TPsp> extends "stripe" ? {
114
+ readonly commercialMode: "one_time" | "subscription";
115
+ } : {
116
+ readonly commercialMode?: "one_time" | "subscription";
117
+ });
109
118
  export interface ProxySessionProviderBinding {
110
119
  readonly providerCheckoutSessionId: string;
111
120
  readonly proxySessionId: string;
@@ -199,8 +208,11 @@ export declare class ProxySessionsResource {
199
208
  * Bind a provider (PSP) checkout object to a Proxy session so later cart sync
200
209
  * can verify ownership. Idempotent for the same provider object; conflicts when
201
210
  * the session is already bound to a different one.
211
+ *
212
+ * @deprecated Prefer provider acquisition attempts or a provider-specific
213
+ * helper such as `@proxy-checkout/stripe-server-js` `openCheckout(...)`.
202
214
  */
203
- recordProviderBinding(proxySessionId: string, input: RecordProviderBindingInput): Promise<ProxySessionProviderBinding>;
215
+ recordProviderBinding<const TPsp extends string>(proxySessionId: string, input: RecordProviderBindingInput<TPsp>): Promise<ProxySessionProviderBinding>;
204
216
  markProvisioned(proxySessionId: string, input?: MarkProxySessionProvisionedInput): Promise<ProxySessionProvisioningAcknowledgement>;
205
217
  markProvisioningFailed(proxySessionId: string, input: MarkProxySessionProvisioningFailedInput): Promise<ProxySessionProvisioningAcknowledgement>;
206
218
  }
@@ -209,3 +221,4 @@ export declare class ProxySessionCartResource {
209
221
  constructor(httpClient: ProxyCheckoutHttpClient);
210
222
  set(proxySessionId: string, input: SetProxySessionCartInput): Promise<ProxySessionCartResult>;
211
223
  }
224
+ export {};
@@ -100,12 +100,21 @@ export interface ProxySessionCartResult {
100
100
  readonly cartVersion: number;
101
101
  readonly currency: string;
102
102
  }
103
- export interface RecordProviderBindingInput extends ProxyCheckoutServerRequestOptions {
104
- /** Required for Stripe so Proxy can safely infer the deprecated binding into an acquisition. */
105
- readonly commercialMode?: "one_time" | "subscription";
103
+ interface RecordProviderBindingBaseInput extends ProxyCheckoutServerRequestOptions {
106
104
  readonly providerCheckoutSessionId: string;
107
- readonly psp: string;
108
105
  }
106
+ /**
107
+ * Input for the deprecated provider-binding compatibility adapter.
108
+ * Canonical Stripe literals require `commercialMode` at compile time; dynamic
109
+ * or untyped inputs remain protected by the matching runtime validation.
110
+ */
111
+ export type RecordProviderBindingInput<TPsp extends string = string> = RecordProviderBindingBaseInput & {
112
+ readonly psp: TPsp;
113
+ } & (Lowercase<TPsp> extends "stripe" ? {
114
+ readonly commercialMode: "one_time" | "subscription";
115
+ } : {
116
+ readonly commercialMode?: "one_time" | "subscription";
117
+ });
109
118
  export interface ProxySessionProviderBinding {
110
119
  readonly providerCheckoutSessionId: string;
111
120
  readonly proxySessionId: string;
@@ -199,8 +208,11 @@ export declare class ProxySessionsResource {
199
208
  * Bind a provider (PSP) checkout object to a Proxy session so later cart sync
200
209
  * can verify ownership. Idempotent for the same provider object; conflicts when
201
210
  * the session is already bound to a different one.
211
+ *
212
+ * @deprecated Prefer provider acquisition attempts or a provider-specific
213
+ * helper such as `@proxy-checkout/stripe-server-js` `openCheckout(...)`.
202
214
  */
203
- recordProviderBinding(proxySessionId: string, input: RecordProviderBindingInput): Promise<ProxySessionProviderBinding>;
215
+ recordProviderBinding<const TPsp extends string>(proxySessionId: string, input: RecordProviderBindingInput<TPsp>): Promise<ProxySessionProviderBinding>;
204
216
  markProvisioned(proxySessionId: string, input?: MarkProxySessionProvisionedInput): Promise<ProxySessionProvisioningAcknowledgement>;
205
217
  markProvisioningFailed(proxySessionId: string, input: MarkProxySessionProvisioningFailedInput): Promise<ProxySessionProvisioningAcknowledgement>;
206
218
  }
@@ -209,3 +221,4 @@ export declare class ProxySessionCartResource {
209
221
  constructor(httpClient: ProxyCheckoutHttpClient);
210
222
  set(proxySessionId: string, input: SetProxySessionCartInput): Promise<ProxySessionCartResult>;
211
223
  }
224
+ export {};
@@ -140,6 +140,9 @@ class ProxySessionsResource {
140
140
  * Bind a provider (PSP) checkout object to a Proxy session so later cart sync
141
141
  * can verify ownership. Idempotent for the same provider object; conflicts when
142
142
  * the session is already bound to a different one.
143
+ *
144
+ * @deprecated Prefer provider acquisition attempts or a provider-specific
145
+ * helper such as `@proxy-checkout/stripe-server-js` `openCheckout(...)`.
143
146
  */
144
147
  async recordProviderBinding(proxySessionId, input) {
145
148
  if (input.psp.trim().toLowerCase() === "stripe" && input.commercialMode === undefined) {
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-124.133.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-124.133.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-124.134.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-124.134.1";
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-124.133.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-124.133.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-124.134.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-124.134.1";
@@ -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-124.133.1";
5
+ exports.proxyCheckoutServerSdkVersion = "0.0.8-prx-124.134.1";
6
6
  exports.proxyCheckoutServerSdkUserAgent = `${exports.proxyCheckoutServerSdkName}/${exports.proxyCheckoutServerSdkVersion}`;
@@ -100,12 +100,21 @@ export interface ProxySessionCartResult {
100
100
  readonly cartVersion: number;
101
101
  readonly currency: string;
102
102
  }
103
- export interface RecordProviderBindingInput extends ProxyCheckoutServerRequestOptions {
104
- /** Required for Stripe so Proxy can safely infer the deprecated binding into an acquisition. */
105
- readonly commercialMode?: "one_time" | "subscription";
103
+ interface RecordProviderBindingBaseInput extends ProxyCheckoutServerRequestOptions {
106
104
  readonly providerCheckoutSessionId: string;
107
- readonly psp: string;
108
105
  }
106
+ /**
107
+ * Input for the deprecated provider-binding compatibility adapter.
108
+ * Canonical Stripe literals require `commercialMode` at compile time; dynamic
109
+ * or untyped inputs remain protected by the matching runtime validation.
110
+ */
111
+ export type RecordProviderBindingInput<TPsp extends string = string> = RecordProviderBindingBaseInput & {
112
+ readonly psp: TPsp;
113
+ } & (Lowercase<TPsp> extends "stripe" ? {
114
+ readonly commercialMode: "one_time" | "subscription";
115
+ } : {
116
+ readonly commercialMode?: "one_time" | "subscription";
117
+ });
109
118
  export interface ProxySessionProviderBinding {
110
119
  readonly providerCheckoutSessionId: string;
111
120
  readonly proxySessionId: string;
@@ -199,8 +208,11 @@ export declare class ProxySessionsResource {
199
208
  * Bind a provider (PSP) checkout object to a Proxy session so later cart sync
200
209
  * can verify ownership. Idempotent for the same provider object; conflicts when
201
210
  * the session is already bound to a different one.
211
+ *
212
+ * @deprecated Prefer provider acquisition attempts or a provider-specific
213
+ * helper such as `@proxy-checkout/stripe-server-js` `openCheckout(...)`.
202
214
  */
203
- recordProviderBinding(proxySessionId: string, input: RecordProviderBindingInput): Promise<ProxySessionProviderBinding>;
215
+ recordProviderBinding<const TPsp extends string>(proxySessionId: string, input: RecordProviderBindingInput<TPsp>): Promise<ProxySessionProviderBinding>;
204
216
  markProvisioned(proxySessionId: string, input?: MarkProxySessionProvisionedInput): Promise<ProxySessionProvisioningAcknowledgement>;
205
217
  markProvisioningFailed(proxySessionId: string, input: MarkProxySessionProvisioningFailedInput): Promise<ProxySessionProvisioningAcknowledgement>;
206
218
  }
@@ -209,3 +221,4 @@ export declare class ProxySessionCartResource {
209
221
  constructor(httpClient: ProxyCheckoutHttpClient);
210
222
  set(proxySessionId: string, input: SetProxySessionCartInput): Promise<ProxySessionCartResult>;
211
223
  }
224
+ export {};
@@ -137,6 +137,9 @@ export class ProxySessionsResource {
137
137
  * Bind a provider (PSP) checkout object to a Proxy session so later cart sync
138
138
  * can verify ownership. Idempotent for the same provider object; conflicts when
139
139
  * the session is already bound to a different one.
140
+ *
141
+ * @deprecated Prefer provider acquisition attempts or a provider-specific
142
+ * helper such as `@proxy-checkout/stripe-server-js` `openCheckout(...)`.
140
143
  */
141
144
  async recordProviderBinding(proxySessionId, input) {
142
145
  if (input.psp.trim().toLowerCase() === "stripe" && input.commercialMode === undefined) {
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-124.133.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-124.133.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.8-prx-124.134.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.8-prx-124.134.1";
@@ -1,3 +1,3 @@
1
1
  export const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export const proxyCheckoutServerSdkVersion = "0.0.8-prx-124.133.1";
2
+ export const proxyCheckoutServerSdkVersion = "0.0.8-prx-124.134.1";
3
3
  export const proxyCheckoutServerSdkUserAgent = `${proxyCheckoutServerSdkName}/${proxyCheckoutServerSdkVersion}`;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "sideEffects": false,
8
8
  "type": "module",
9
9
  "types": "./dist/esm/index.d.ts",
10
- "version": "0.0.8-prx-124.133.1",
10
+ "version": "0.0.8-prx-124.134.1",
11
11
  "devDependencies": {
12
12
  "@types/node": "^24.12.4",
13
13
  "@vitest/coverage-v8": "4.1.7",