@proxy-checkout/server-js 0.0.6-prx-93.48.1 → 0.0.6-prx-94.50.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.
@@ -29,4 +29,6 @@ export declare class ProxyCheckoutApiError extends Error {
29
29
  readonly statusCode: number;
30
30
  constructor(message: string, details: ProxyCheckoutApiErrorDetails);
31
31
  }
32
+ export declare const PROXY_SESSION_NOT_FOUND_ERROR_CODE = "proxy_session_not_found";
33
+ export declare function isProxySessionNotFoundError(error: unknown): error is ProxyCheckoutApiError;
32
34
  export declare function toApiError(statusCode: number, responseBody: unknown, headerRequestId?: string): ProxyCheckoutApiError;
@@ -29,4 +29,6 @@ export declare class ProxyCheckoutApiError extends Error {
29
29
  readonly statusCode: number;
30
30
  constructor(message: string, details: ProxyCheckoutApiErrorDetails);
31
31
  }
32
+ export declare const PROXY_SESSION_NOT_FOUND_ERROR_CODE = "proxy_session_not_found";
33
+ export declare function isProxySessionNotFoundError(error: unknown): error is ProxyCheckoutApiError;
32
34
  export declare function toApiError(statusCode: number, responseBody: unknown, headerRequestId?: string): ProxyCheckoutApiError;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProxyCheckoutApiError = exports.ProxyCheckoutValidationError = void 0;
3
+ exports.PROXY_SESSION_NOT_FOUND_ERROR_CODE = exports.ProxyCheckoutApiError = exports.ProxyCheckoutValidationError = void 0;
4
+ exports.isProxySessionNotFoundError = isProxySessionNotFoundError;
4
5
  exports.toApiError = toApiError;
5
6
  /**
6
7
  * Raised when the SDK receives Proxy data it cannot safely normalize, for
@@ -35,6 +36,17 @@ class ProxyCheckoutApiError extends Error {
35
36
  }
36
37
  }
37
38
  exports.ProxyCheckoutApiError = ProxyCheckoutApiError;
39
+ exports.PROXY_SESSION_NOT_FOUND_ERROR_CODE = "proxy_session_not_found";
40
+ function isProxySessionNotFoundError(error) {
41
+ return (typeof error === "object" &&
42
+ error !== null &&
43
+ "name" in error &&
44
+ error.name === "ProxyCheckoutApiError" &&
45
+ "statusCode" in error &&
46
+ error.statusCode === 404 &&
47
+ "code" in error &&
48
+ error.code === exports.PROXY_SESSION_NOT_FOUND_ERROR_CODE);
49
+ }
38
50
  function toApiError(statusCode, responseBody, headerRequestId) {
39
51
  const error = readApiError(responseBody);
40
52
  const message = error.message ?? `Proxy API request failed with status ${statusCode}.`;
@@ -1,7 +1,7 @@
1
1
  export { type ProxyCartParseOptions, type ProxyCartValidator, parseProxyCart, } from "./cart.js";
2
2
  export { createProxyCheckoutServerClient, ProxyCheckoutServerClient, } from "./client.js";
3
3
  export { assertCartBuyerReference, assertSubscriptionMatchesSession, } from "./consistency.js";
4
- export { ProxyCheckoutApiError, type ProxyCheckoutApiErrorDetails, type ProxyCheckoutValidationCode, ProxyCheckoutValidationError, } from "./errors.js";
4
+ export { isProxySessionNotFoundError, PROXY_SESSION_NOT_FOUND_ERROR_CODE, ProxyCheckoutApiError, type ProxyCheckoutApiErrorDetails, type ProxyCheckoutValidationCode, ProxyCheckoutValidationError, } from "./errors.js";
5
5
  export { ProxyEventsResource, type ResolvedIgnored, type ResolvedInitialProvision, type ResolvedPaymentAttempt, type ResolvedPaymentRisk, type ResolvedProxyEvent, type ResolvedProxyEventKind, type ResolvedSubscriptionCancelled, type ResolvedSubscriptionCancelScheduled, type ResolvedSubscriptionRenewed, type ResolvedTerminalSession, type ResolveProxyEventOptions, } from "./events.js";
6
6
  export { AT_RISK_SUBSCRIPTION_STATUSES, ENDED_SUBSCRIPTION_STATUSES, isSessionProvisionable, isSessionTerminal, isSubscriptionEnded, isSubscriptionPaymentAtRisk, PROVISIONABLE_SESSION_STATUSES, parseOptionalProxyDate, requireProxyDate, subscriptionAccessEndsAt, subscriptionWillRenew, TERMINAL_SESSION_STATUSES, } from "./lifecycle.js";
7
7
  export { type CreateProxySessionHandoffInput, type CreateProxySessionInput, type CreateProxySessionOptions, type MarkProxySessionProvisionedInput, type MarkProxySessionProvisioningFailedInput, type MerchantProxySession, type PayerHandoffResult, type PayerOpenedResult, type ProxySession, ProxySessionCartResource, type ProxySessionCartResult, type ProxySessionHandoff, type ProxySessionProviderBinding, type ProxySessionProvisioningAcknowledgement, ProxySessionsResource, proxyCheckoutServerEndpoints, type RecordProviderBindingInput, type SetProxySessionCartInput, type TypedMerchantProxySession, } from "./sessions.js";
@@ -1,7 +1,7 @@
1
1
  export { type ProxyCartParseOptions, type ProxyCartValidator, parseProxyCart, } from "./cart.js";
2
2
  export { createProxyCheckoutServerClient, ProxyCheckoutServerClient, } from "./client.js";
3
3
  export { assertCartBuyerReference, assertSubscriptionMatchesSession, } from "./consistency.js";
4
- export { ProxyCheckoutApiError, type ProxyCheckoutApiErrorDetails, type ProxyCheckoutValidationCode, ProxyCheckoutValidationError, } from "./errors.js";
4
+ export { isProxySessionNotFoundError, PROXY_SESSION_NOT_FOUND_ERROR_CODE, ProxyCheckoutApiError, type ProxyCheckoutApiErrorDetails, type ProxyCheckoutValidationCode, ProxyCheckoutValidationError, } from "./errors.js";
5
5
  export { ProxyEventsResource, type ResolvedIgnored, type ResolvedInitialProvision, type ResolvedPaymentAttempt, type ResolvedPaymentRisk, type ResolvedProxyEvent, type ResolvedProxyEventKind, type ResolvedSubscriptionCancelled, type ResolvedSubscriptionCancelScheduled, type ResolvedSubscriptionRenewed, type ResolvedTerminalSession, type ResolveProxyEventOptions, } from "./events.js";
6
6
  export { AT_RISK_SUBSCRIPTION_STATUSES, ENDED_SUBSCRIPTION_STATUSES, isSessionProvisionable, isSessionTerminal, isSubscriptionEnded, isSubscriptionPaymentAtRisk, PROVISIONABLE_SESSION_STATUSES, parseOptionalProxyDate, requireProxyDate, subscriptionAccessEndsAt, subscriptionWillRenew, TERMINAL_SESSION_STATUSES, } from "./lifecycle.js";
7
7
  export { type CreateProxySessionHandoffInput, type CreateProxySessionInput, type CreateProxySessionOptions, type MarkProxySessionProvisionedInput, type MarkProxySessionProvisioningFailedInput, type MerchantProxySession, type PayerHandoffResult, type PayerOpenedResult, type ProxySession, ProxySessionCartResource, type ProxySessionCartResult, type ProxySessionHandoff, type ProxySessionProviderBinding, type ProxySessionProvisioningAcknowledgement, ProxySessionsResource, proxyCheckoutServerEndpoints, type RecordProviderBindingInput, type SetProxySessionCartInput, type TypedMerchantProxySession, } from "./sessions.js";
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyProxyWebhookSignature = exports.proxyCheckoutWebhookEndpointEndpoints = exports.ProxyWebhookSignatureVerificationError = exports.ProxyWebhookEndpointsResource = exports.PROXY_SIGNATURE_HEADER = exports.constructProxyWebhookEvent = exports.ProxyWebhooksResource = exports.PROXY_WEBHOOK_RETRY_AFTER_SECONDS = exports.PROXY_WEBHOOK_EVENT_TYPES = exports.isProxySubscriptionEvent = exports.isProxySessionEvent = exports.isProxyPaymentAttemptEvent = exports.proxyCheckoutServerSdkVersion = exports.proxyCheckoutServerSdkUserAgent = exports.proxyCheckoutServerSdkName = exports.proxyCheckoutSubscriptionEndpoints = exports.ProxySubscriptionsResource = exports.proxyCheckoutServerEndpoints = exports.ProxySessionsResource = exports.ProxySessionCartResource = exports.TERMINAL_SESSION_STATUSES = exports.subscriptionWillRenew = exports.subscriptionAccessEndsAt = exports.requireProxyDate = exports.parseOptionalProxyDate = exports.PROVISIONABLE_SESSION_STATUSES = exports.isSubscriptionPaymentAtRisk = exports.isSubscriptionEnded = exports.isSessionTerminal = exports.isSessionProvisionable = exports.ENDED_SUBSCRIPTION_STATUSES = exports.AT_RISK_SUBSCRIPTION_STATUSES = exports.ProxyEventsResource = exports.ProxyCheckoutValidationError = exports.ProxyCheckoutApiError = exports.assertSubscriptionMatchesSession = exports.assertCartBuyerReference = exports.ProxyCheckoutServerClient = exports.createProxyCheckoutServerClient = exports.parseProxyCart = void 0;
3
+ exports.verifyProxyWebhookSignature = exports.proxyCheckoutWebhookEndpointEndpoints = exports.ProxyWebhookSignatureVerificationError = exports.ProxyWebhookEndpointsResource = exports.PROXY_SIGNATURE_HEADER = exports.constructProxyWebhookEvent = exports.ProxyWebhooksResource = exports.PROXY_WEBHOOK_RETRY_AFTER_SECONDS = exports.PROXY_WEBHOOK_EVENT_TYPES = exports.isProxySubscriptionEvent = exports.isProxySessionEvent = exports.isProxyPaymentAttemptEvent = exports.proxyCheckoutServerSdkVersion = exports.proxyCheckoutServerSdkUserAgent = exports.proxyCheckoutServerSdkName = exports.proxyCheckoutSubscriptionEndpoints = exports.ProxySubscriptionsResource = exports.proxyCheckoutServerEndpoints = exports.ProxySessionsResource = exports.ProxySessionCartResource = exports.TERMINAL_SESSION_STATUSES = exports.subscriptionWillRenew = exports.subscriptionAccessEndsAt = exports.requireProxyDate = exports.parseOptionalProxyDate = exports.PROVISIONABLE_SESSION_STATUSES = exports.isSubscriptionPaymentAtRisk = exports.isSubscriptionEnded = exports.isSessionTerminal = exports.isSessionProvisionable = exports.ENDED_SUBSCRIPTION_STATUSES = exports.AT_RISK_SUBSCRIPTION_STATUSES = exports.ProxyEventsResource = exports.ProxyCheckoutValidationError = exports.ProxyCheckoutApiError = exports.PROXY_SESSION_NOT_FOUND_ERROR_CODE = exports.isProxySessionNotFoundError = exports.assertSubscriptionMatchesSession = exports.assertCartBuyerReference = exports.ProxyCheckoutServerClient = exports.createProxyCheckoutServerClient = exports.parseProxyCart = void 0;
4
4
  var cart_js_1 = require("./cart.js");
5
5
  Object.defineProperty(exports, "parseProxyCart", { enumerable: true, get: function () { return cart_js_1.parseProxyCart; } });
6
6
  var client_js_1 = require("./client.js");
@@ -10,6 +10,8 @@ var consistency_js_1 = require("./consistency.js");
10
10
  Object.defineProperty(exports, "assertCartBuyerReference", { enumerable: true, get: function () { return consistency_js_1.assertCartBuyerReference; } });
11
11
  Object.defineProperty(exports, "assertSubscriptionMatchesSession", { enumerable: true, get: function () { return consistency_js_1.assertSubscriptionMatchesSession; } });
12
12
  var errors_js_1 = require("./errors.js");
13
+ Object.defineProperty(exports, "isProxySessionNotFoundError", { enumerable: true, get: function () { return errors_js_1.isProxySessionNotFoundError; } });
14
+ Object.defineProperty(exports, "PROXY_SESSION_NOT_FOUND_ERROR_CODE", { enumerable: true, get: function () { return errors_js_1.PROXY_SESSION_NOT_FOUND_ERROR_CODE; } });
13
15
  Object.defineProperty(exports, "ProxyCheckoutApiError", { enumerable: true, get: function () { return errors_js_1.ProxyCheckoutApiError; } });
14
16
  Object.defineProperty(exports, "ProxyCheckoutValidationError", { enumerable: true, get: function () { return errors_js_1.ProxyCheckoutValidationError; } });
15
17
  var events_js_1 = require("./events.js");
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-93.48.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-93.48.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-94.50.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-94.50.1";
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-93.48.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-93.48.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-94.50.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-94.50.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.6-prx-93.48.1";
5
+ exports.proxyCheckoutServerSdkVersion = "0.0.6-prx-94.50.1";
6
6
  exports.proxyCheckoutServerSdkUserAgent = `${exports.proxyCheckoutServerSdkName}/${exports.proxyCheckoutServerSdkVersion}`;
@@ -29,4 +29,6 @@ export declare class ProxyCheckoutApiError extends Error {
29
29
  readonly statusCode: number;
30
30
  constructor(message: string, details: ProxyCheckoutApiErrorDetails);
31
31
  }
32
+ export declare const PROXY_SESSION_NOT_FOUND_ERROR_CODE = "proxy_session_not_found";
33
+ export declare function isProxySessionNotFoundError(error: unknown): error is ProxyCheckoutApiError;
32
34
  export declare function toApiError(statusCode: number, responseBody: unknown, headerRequestId?: string): ProxyCheckoutApiError;
@@ -29,6 +29,17 @@ export class ProxyCheckoutApiError extends Error {
29
29
  this.statusCode = details.statusCode;
30
30
  }
31
31
  }
32
+ export const PROXY_SESSION_NOT_FOUND_ERROR_CODE = "proxy_session_not_found";
33
+ export function isProxySessionNotFoundError(error) {
34
+ return (typeof error === "object" &&
35
+ error !== null &&
36
+ "name" in error &&
37
+ error.name === "ProxyCheckoutApiError" &&
38
+ "statusCode" in error &&
39
+ error.statusCode === 404 &&
40
+ "code" in error &&
41
+ error.code === PROXY_SESSION_NOT_FOUND_ERROR_CODE);
42
+ }
32
43
  export function toApiError(statusCode, responseBody, headerRequestId) {
33
44
  const error = readApiError(responseBody);
34
45
  const message = error.message ?? `Proxy API request failed with status ${statusCode}.`;
@@ -1,7 +1,7 @@
1
1
  export { type ProxyCartParseOptions, type ProxyCartValidator, parseProxyCart, } from "./cart.js";
2
2
  export { createProxyCheckoutServerClient, ProxyCheckoutServerClient, } from "./client.js";
3
3
  export { assertCartBuyerReference, assertSubscriptionMatchesSession, } from "./consistency.js";
4
- export { ProxyCheckoutApiError, type ProxyCheckoutApiErrorDetails, type ProxyCheckoutValidationCode, ProxyCheckoutValidationError, } from "./errors.js";
4
+ export { isProxySessionNotFoundError, PROXY_SESSION_NOT_FOUND_ERROR_CODE, ProxyCheckoutApiError, type ProxyCheckoutApiErrorDetails, type ProxyCheckoutValidationCode, ProxyCheckoutValidationError, } from "./errors.js";
5
5
  export { ProxyEventsResource, type ResolvedIgnored, type ResolvedInitialProvision, type ResolvedPaymentAttempt, type ResolvedPaymentRisk, type ResolvedProxyEvent, type ResolvedProxyEventKind, type ResolvedSubscriptionCancelled, type ResolvedSubscriptionCancelScheduled, type ResolvedSubscriptionRenewed, type ResolvedTerminalSession, type ResolveProxyEventOptions, } from "./events.js";
6
6
  export { AT_RISK_SUBSCRIPTION_STATUSES, ENDED_SUBSCRIPTION_STATUSES, isSessionProvisionable, isSessionTerminal, isSubscriptionEnded, isSubscriptionPaymentAtRisk, PROVISIONABLE_SESSION_STATUSES, parseOptionalProxyDate, requireProxyDate, subscriptionAccessEndsAt, subscriptionWillRenew, TERMINAL_SESSION_STATUSES, } from "./lifecycle.js";
7
7
  export { type CreateProxySessionHandoffInput, type CreateProxySessionInput, type CreateProxySessionOptions, type MarkProxySessionProvisionedInput, type MarkProxySessionProvisioningFailedInput, type MerchantProxySession, type PayerHandoffResult, type PayerOpenedResult, type ProxySession, ProxySessionCartResource, type ProxySessionCartResult, type ProxySessionHandoff, type ProxySessionProviderBinding, type ProxySessionProvisioningAcknowledgement, ProxySessionsResource, proxyCheckoutServerEndpoints, type RecordProviderBindingInput, type SetProxySessionCartInput, type TypedMerchantProxySession, } from "./sessions.js";
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { parseProxyCart, } from "./cart.js";
2
2
  export { createProxyCheckoutServerClient, ProxyCheckoutServerClient, } from "./client.js";
3
3
  export { assertCartBuyerReference, assertSubscriptionMatchesSession, } from "./consistency.js";
4
- export { ProxyCheckoutApiError, ProxyCheckoutValidationError, } from "./errors.js";
4
+ export { isProxySessionNotFoundError, PROXY_SESSION_NOT_FOUND_ERROR_CODE, ProxyCheckoutApiError, ProxyCheckoutValidationError, } from "./errors.js";
5
5
  export { ProxyEventsResource, } from "./events.js";
6
6
  export { AT_RISK_SUBSCRIPTION_STATUSES, ENDED_SUBSCRIPTION_STATUSES, isSessionProvisionable, isSessionTerminal, isSubscriptionEnded, isSubscriptionPaymentAtRisk, PROVISIONABLE_SESSION_STATUSES, parseOptionalProxyDate, requireProxyDate, subscriptionAccessEndsAt, subscriptionWillRenew, TERMINAL_SESSION_STATUSES, } from "./lifecycle.js";
7
7
  export { ProxySessionCartResource, ProxySessionsResource, proxyCheckoutServerEndpoints, } from "./sessions.js";
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-93.48.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-93.48.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-94.50.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-94.50.1";
@@ -1,3 +1,3 @@
1
1
  export const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export const proxyCheckoutServerSdkVersion = "0.0.6-prx-93.48.1";
2
+ export const proxyCheckoutServerSdkVersion = "0.0.6-prx-94.50.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.6-prx-93.48.1",
10
+ "version": "0.0.6-prx-94.50.1",
11
11
  "devDependencies": {
12
12
  "@types/node": "^24.12.4",
13
13
  "@vitest/coverage-v8": "4.1.7",