@01.software/sdk 0.71.0 → 0.73.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/CHANGELOG.md +118 -0
- package/README.md +71 -1
- package/dist/client.cjs +83 -9
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.js +83 -9
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-D18xyUq_.d.cts → collection-client-BH4dIZ6c.d.cts} +4 -4
- package/dist/{collection-client-CUGJcTpl.d.ts → collection-client-lLAl3xCZ.d.ts} +4 -4
- package/dist/{const-oGEoxCXZ.d.cts → const-BS2EaIp4.d.cts} +1 -1
- package/dist/{const-Dlu0mXmj.d.ts → const-CCvoknRY.d.ts} +1 -1
- package/dist/{index-HHVtIKXs.d.cts → index-CHdrzJ8-.d.cts} +3 -3
- package/dist/{index-Ccd4NYTL.d.ts → index-DVqNpmsc.d.ts} +3 -3
- package/dist/index.cjs +84 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -11
- package/dist/index.d.ts +14 -11
- package/dist/index.js +84 -10
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-BgOEk6Y9.d.cts → payload-types-PXkmefhZ.d.cts} +267 -185
- package/dist/{payload-types-BgOEk6Y9.d.ts → payload-types-PXkmefhZ.d.ts} +267 -185
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +113 -17
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +8 -7
- package/dist/server.d.ts +8 -7
- package/dist/server.js +113 -17
- package/dist/server.js.map +1 -1
- package/dist/{types-CSvp2fJ_.d.ts → types-CQRsG6sA.d.ts} +2 -2
- package/dist/{types-DLHEIsAx.d.cts → types-Chwgg4CQ.d.cts} +63 -7
- package/dist/{types-BzG3NO7R.d.cts → types-CyMz0Kzc.d.cts} +2 -2
- package/dist/{types-nyOvcO0K.d.ts → types-lbzbJSZh.d.ts} +63 -7
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.d.cts +5 -5
- package/dist/webhook.d.ts +5 -5
- package/package.json +2 -4
package/dist/client.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AddItemParams,
|
|
3
|
-
import { R as ReadOnlyCollectionClient } from './collection-client-
|
|
1
|
+
import { d2 as CustomerScopedApi, bo as ListMyBenefitVouchersRequest, bp as ListMyBenefitVouchersResponse, d3 as CustomerCreditsApi, d4 as CommerceClient, n as CommunityClient, d5 as ContentClient, aP as EventsClient, d6 as CustomerNamespace, M as MarketDiscovery, aw as CustomerMembershipView, C as CancelMembershipParams, e as CancelMembershipResponse, q as ClientState, d7 as ClientConfig } from './types-Chwgg4CQ.cjs';
|
|
2
|
+
export { A as AddItemParams, d8 as ApiQueryOptions, d9 as CancelBrowserPaymentSessionParams, da as CartMergeParams, F as CartMergeResult, G as CartMineResult, H as CartMutationResult, J as CheckoutAbandonedReason, K as CheckoutAmounts, P as CheckoutOrderReference, Q as CheckoutPaymentSessionRef, Y as CheckoutShippingAddress, $ as ClearCartParams, db as ClientMetadata, dc as ContentClientOptions, a9 as CreateCartParams, aa as CreateCartResult, dd as CreateCheckoutParams, de as CreateCheckoutResult, ad as CreatePaymentSessionParams, ae as CreatePortOnePaymentSessionParams, ax as CustomerSnapshot, df as DebugConfig, dg as DeepPartial, dh as ExtractArrayType, bq as MembershipStatus, bs as Money, bz as OpenCheckoutPaymentState, di as PayloadFindResponse, dj as PayloadMutationResponse, bA as PaymentFailureReason, bB as PaymentNextAction, bC as PaymentProviderStatus, bD as PaymentReconciliationReason, bG as PaymentSessionRole, bH as PortOneHostedPaymentMethod, bJ as PortOnePaymentNextAction, bM as PortOnePublicPaymentSession, bQ as ProductUpsertInput, bR as ProductUpsertParams, bS as ProductUpsertResponse, bT as ProductUpsertVariantInput, bU as PublicAttribute, bV as PublicCaptureEvidence, bW as PublicCart, bX as PublicCartItem, bY as PublicCartItemAdmission, bZ as PublicCartMarket, b_ as PublicCartReference, b$ as PublicCheckout, c0 as PublicCheckoutItem, c1 as PublicMediaAsset, c2 as PublicMediaSize, c3 as PublicOrder, c4 as PublicOrderAmounts, c5 as PublicOrderItem, c6 as PublicOrderReference, c7 as PublicPaymentSession, ca as ReconciliationRequired, cd as RemoveItemParams, dk as RetrieveBrowserPaymentSessionParams, cg as RetrieveCartParams, ch as RetrieveCheckoutParams, dl as RetryConfig, dm as RootClient, dm as RootClientType, dn as RootCollectionClient, dp as RootReadOnlyQueryBuilder, cv as ShippingLine, dq as Sort, cw as SpentCheckoutPaymentState, dr as StorefrontContentListOptions, ds as StorefrontContentReference, dt as StorefrontGalleryItem, du as StorefrontGalleryItemsListOptions, dv as StorefrontGalleryItemsSort, dw as StorefrontLink, dx as StorefrontLinksListOptions, dy as StorefrontLinksSort, cN as UpdateCartAttributesParams, cO as UpdateDiscountCodesParams, cP as UpdateItemParams, cQ as VariantInput, dz as Where } from './types-Chwgg4CQ.cjs';
|
|
3
|
+
import { R as ReadOnlyCollectionClient } from './collection-client-BH4dIZ6c.cjs';
|
|
4
4
|
export { isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.cjs';
|
|
5
|
-
export { C as Collection, P as PublicCollection } from './const-
|
|
6
|
-
import './types-
|
|
7
|
-
import './payload-types-
|
|
5
|
+
export { C as Collection, P as PublicCollection } from './const-BS2EaIp4.cjs';
|
|
6
|
+
import './types-CyMz0Kzc.cjs';
|
|
7
|
+
import './payload-types-PXkmefhZ.cjs';
|
|
8
8
|
import './metadata.cjs';
|
|
9
9
|
|
|
10
10
|
declare class CustomerBenefitVouchersApi extends CustomerScopedApi {
|
package/dist/client.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AddItemParams,
|
|
3
|
-
import { R as ReadOnlyCollectionClient } from './collection-client-
|
|
1
|
+
import { d2 as CustomerScopedApi, bo as ListMyBenefitVouchersRequest, bp as ListMyBenefitVouchersResponse, d3 as CustomerCreditsApi, d4 as CommerceClient, n as CommunityClient, d5 as ContentClient, aP as EventsClient, d6 as CustomerNamespace, M as MarketDiscovery, aw as CustomerMembershipView, C as CancelMembershipParams, e as CancelMembershipResponse, q as ClientState, d7 as ClientConfig } from './types-lbzbJSZh.js';
|
|
2
|
+
export { A as AddItemParams, d8 as ApiQueryOptions, d9 as CancelBrowserPaymentSessionParams, da as CartMergeParams, F as CartMergeResult, G as CartMineResult, H as CartMutationResult, J as CheckoutAbandonedReason, K as CheckoutAmounts, P as CheckoutOrderReference, Q as CheckoutPaymentSessionRef, Y as CheckoutShippingAddress, $ as ClearCartParams, db as ClientMetadata, dc as ContentClientOptions, a9 as CreateCartParams, aa as CreateCartResult, dd as CreateCheckoutParams, de as CreateCheckoutResult, ad as CreatePaymentSessionParams, ae as CreatePortOnePaymentSessionParams, ax as CustomerSnapshot, df as DebugConfig, dg as DeepPartial, dh as ExtractArrayType, bq as MembershipStatus, bs as Money, bz as OpenCheckoutPaymentState, di as PayloadFindResponse, dj as PayloadMutationResponse, bA as PaymentFailureReason, bB as PaymentNextAction, bC as PaymentProviderStatus, bD as PaymentReconciliationReason, bG as PaymentSessionRole, bH as PortOneHostedPaymentMethod, bJ as PortOnePaymentNextAction, bM as PortOnePublicPaymentSession, bQ as ProductUpsertInput, bR as ProductUpsertParams, bS as ProductUpsertResponse, bT as ProductUpsertVariantInput, bU as PublicAttribute, bV as PublicCaptureEvidence, bW as PublicCart, bX as PublicCartItem, bY as PublicCartItemAdmission, bZ as PublicCartMarket, b_ as PublicCartReference, b$ as PublicCheckout, c0 as PublicCheckoutItem, c1 as PublicMediaAsset, c2 as PublicMediaSize, c3 as PublicOrder, c4 as PublicOrderAmounts, c5 as PublicOrderItem, c6 as PublicOrderReference, c7 as PublicPaymentSession, ca as ReconciliationRequired, cd as RemoveItemParams, dk as RetrieveBrowserPaymentSessionParams, cg as RetrieveCartParams, ch as RetrieveCheckoutParams, dl as RetryConfig, dm as RootClient, dm as RootClientType, dn as RootCollectionClient, dp as RootReadOnlyQueryBuilder, cv as ShippingLine, dq as Sort, cw as SpentCheckoutPaymentState, dr as StorefrontContentListOptions, ds as StorefrontContentReference, dt as StorefrontGalleryItem, du as StorefrontGalleryItemsListOptions, dv as StorefrontGalleryItemsSort, dw as StorefrontLink, dx as StorefrontLinksListOptions, dy as StorefrontLinksSort, cN as UpdateCartAttributesParams, cO as UpdateDiscountCodesParams, cP as UpdateItemParams, cQ as VariantInput, dz as Where } from './types-lbzbJSZh.js';
|
|
3
|
+
import { R as ReadOnlyCollectionClient } from './collection-client-lLAl3xCZ.js';
|
|
4
4
|
export { isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.js';
|
|
5
|
-
export { C as Collection, P as PublicCollection } from './const-
|
|
6
|
-
import './types-
|
|
7
|
-
import './payload-types-
|
|
5
|
+
export { C as Collection, P as PublicCollection } from './const-CCvoknRY.js';
|
|
6
|
+
import './types-CQRsG6sA.js';
|
|
7
|
+
import './payload-types-PXkmefhZ.js';
|
|
8
8
|
import './metadata.js';
|
|
9
9
|
|
|
10
10
|
declare class CustomerBenefitVouchersApi extends CustomerScopedApi {
|
package/dist/client.js
CHANGED
|
@@ -853,7 +853,7 @@ async function httpFetch(url, options) {
|
|
|
853
853
|
);
|
|
854
854
|
const usageError = attachRequestId(
|
|
855
855
|
createUsageLimitError(
|
|
856
|
-
`Monthly API usage limit exceeded (${current.toLocaleString()}/${limit.toLocaleString()})`,
|
|
856
|
+
`Monthly API usage limit exceeded (${current.toLocaleString("en-US")}/${limit.toLocaleString("en-US")})`,
|
|
857
857
|
{ limit, current, remaining },
|
|
858
858
|
{
|
|
859
859
|
url,
|
|
@@ -2570,7 +2570,18 @@ var ABANDONED_REASONS = ["expired", "customer", "operator"];
|
|
|
2570
2570
|
function managedPaymentProviders(providers) {
|
|
2571
2571
|
return providers;
|
|
2572
2572
|
}
|
|
2573
|
-
var PAYMENT_PROVIDERS = managedPaymentProviders([
|
|
2573
|
+
var PAYMENT_PROVIDERS = managedPaymentProviders([
|
|
2574
|
+
"toss",
|
|
2575
|
+
"portone",
|
|
2576
|
+
"stripe"
|
|
2577
|
+
]);
|
|
2578
|
+
var CANCEL_RECOVERY_METHODS = {
|
|
2579
|
+
toss: "cancel()",
|
|
2580
|
+
portone: "cancelPortOne()",
|
|
2581
|
+
stripe: null
|
|
2582
|
+
};
|
|
2583
|
+
var STRIPE_RETURN_URL_RAW_CHARACTERS = /^[^\s\u0000-\u001F\u007F\\]+$/;
|
|
2584
|
+
var STRIPE_RETURN_URL_AUTHORITY = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/[^/?#@]+(?:[/?#]|$)/;
|
|
2574
2585
|
var PAYMENT_PROVIDER_STATUSES = [
|
|
2575
2586
|
"requires_payment_method",
|
|
2576
2587
|
"requires_action",
|
|
@@ -2619,11 +2630,8 @@ function fail(resource, path, expected) {
|
|
|
2619
2630
|
invalidCanonicalResponse(resource, { path, expected });
|
|
2620
2631
|
}
|
|
2621
2632
|
function providerMismatch(resource, expected, actual, operation2) {
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
toss: "cancel()",
|
|
2625
|
-
portone: "cancelPortOne()"
|
|
2626
|
-
}[actual];
|
|
2633
|
+
const method = CANCEL_RECOVERY_METHODS[actual];
|
|
2634
|
+
if (operation2 === "cancel" && method !== null) {
|
|
2627
2635
|
throw createApiError(
|
|
2628
2636
|
`Canonical ${resource} response provider mismatch: expected ${expected}, received ${actual}.`,
|
|
2629
2637
|
502,
|
|
@@ -3867,6 +3875,65 @@ function validateRequiredReconciliation(value, allowed, resource, path) {
|
|
|
3867
3875
|
}
|
|
3868
3876
|
function validateNextAction(value, provider, resource, path) {
|
|
3869
3877
|
const action = record(value, resource, path);
|
|
3878
|
+
if (provider === "stripe") {
|
|
3879
|
+
exact(
|
|
3880
|
+
action,
|
|
3881
|
+
["type", "clientSecret", "publishableKey", "returnUrl"],
|
|
3882
|
+
[],
|
|
3883
|
+
resource,
|
|
3884
|
+
path
|
|
3885
|
+
);
|
|
3886
|
+
if (action.type !== "stripe_payment_element")
|
|
3887
|
+
fail(resource, `${path}.type`, "stripe_payment_element");
|
|
3888
|
+
const clientSecret = boundedString(
|
|
3889
|
+
action.clientSecret,
|
|
3890
|
+
255,
|
|
3891
|
+
resource,
|
|
3892
|
+
`${path}.clientSecret`
|
|
3893
|
+
);
|
|
3894
|
+
if (!/^pi_[A-Za-z0-9]+_secret_[A-Za-z0-9]+$/.test(clientSecret)) {
|
|
3895
|
+
fail(
|
|
3896
|
+
resource,
|
|
3897
|
+
`${path}.clientSecret`,
|
|
3898
|
+
"Stripe PaymentIntent client secret"
|
|
3899
|
+
);
|
|
3900
|
+
}
|
|
3901
|
+
const publishableKey = boundedString(
|
|
3902
|
+
action.publishableKey,
|
|
3903
|
+
255,
|
|
3904
|
+
resource,
|
|
3905
|
+
`${path}.publishableKey`
|
|
3906
|
+
);
|
|
3907
|
+
if (!/^pk_(?:test|live)_[A-Za-z0-9]+$/.test(publishableKey)) {
|
|
3908
|
+
fail(resource, `${path}.publishableKey`, "Stripe publishable key");
|
|
3909
|
+
}
|
|
3910
|
+
const returnUrl = boundedString(
|
|
3911
|
+
action.returnUrl,
|
|
3912
|
+
2048,
|
|
3913
|
+
resource,
|
|
3914
|
+
`${path}.returnUrl`
|
|
3915
|
+
);
|
|
3916
|
+
if (!STRIPE_RETURN_URL_RAW_CHARACTERS.test(returnUrl) || !STRIPE_RETURN_URL_AUTHORITY.test(returnUrl)) {
|
|
3917
|
+
fail(
|
|
3918
|
+
resource,
|
|
3919
|
+
`${path}.returnUrl`,
|
|
3920
|
+
"HTTPS or loopback URL without embedded credentials"
|
|
3921
|
+
);
|
|
3922
|
+
}
|
|
3923
|
+
try {
|
|
3924
|
+
const parsed = new URL(returnUrl);
|
|
3925
|
+
const loopback = parsed.protocol === "http:" && (parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1");
|
|
3926
|
+
if (!loopback && parsed.protocol !== "https:" || parsed.username || parsed.password)
|
|
3927
|
+
throw new Error("unsafe return URL");
|
|
3928
|
+
} catch {
|
|
3929
|
+
fail(
|
|
3930
|
+
resource,
|
|
3931
|
+
`${path}.returnUrl`,
|
|
3932
|
+
"HTTPS or loopback URL without embedded credentials"
|
|
3933
|
+
);
|
|
3934
|
+
}
|
|
3935
|
+
return;
|
|
3936
|
+
}
|
|
3870
3937
|
if (provider === "portone") {
|
|
3871
3938
|
if (action.type === "portone_sdk") {
|
|
3872
3939
|
const hasCancelable = "cancelable" in action;
|
|
@@ -4242,7 +4309,7 @@ function validatePublicPaymentSession(value, expectedProvider, operation2) {
|
|
|
4242
4309
|
);
|
|
4243
4310
|
}
|
|
4244
4311
|
if (expectedProvider !== void 0 && provider !== expectedProvider) {
|
|
4245
|
-
if (operation2 === "cancel" && status !== "canceling" && status !== "canceled") {
|
|
4312
|
+
if (operation2 === "cancel" && CANCEL_RECOVERY_METHODS[provider] !== null && status !== "canceling" && status !== "canceled") {
|
|
4246
4313
|
fail(
|
|
4247
4314
|
resource,
|
|
4248
4315
|
"$.providerStatus",
|
|
@@ -5503,6 +5570,11 @@ function getRelationID(value) {
|
|
|
5503
5570
|
}
|
|
5504
5571
|
return void 0;
|
|
5505
5572
|
}
|
|
5573
|
+
function compareOrdinal(left, right) {
|
|
5574
|
+
if (left < right) return -1;
|
|
5575
|
+
if (left > right) return 1;
|
|
5576
|
+
return 0;
|
|
5577
|
+
}
|
|
5506
5578
|
function extractEntityId(value) {
|
|
5507
5579
|
if (typeof value === "string") return value;
|
|
5508
5580
|
if (typeof value === "number") return String(value);
|
|
@@ -6115,7 +6187,7 @@ function compareVariantOrder(a, b) {
|
|
|
6115
6187
|
}
|
|
6116
6188
|
const aId = String(getRelationID(a.id) ?? "");
|
|
6117
6189
|
const bId = String(getRelationID(b.id) ?? "");
|
|
6118
|
-
return aId
|
|
6190
|
+
return compareOrdinal(aId, bId);
|
|
6119
6191
|
}
|
|
6120
6192
|
function getVariantAvailableForSale(variant) {
|
|
6121
6193
|
if (variant.isActive === false) return false;
|
|
@@ -6720,6 +6792,8 @@ function buildRangeEndpoint(params) {
|
|
|
6720
6792
|
function buildAdmissionAvailabilityEndpoint(params) {
|
|
6721
6793
|
const urlParams = new URLSearchParams();
|
|
6722
6794
|
urlParams.set("occurrence", params.occurrence);
|
|
6795
|
+
const normalizedMarket2 = params.market?.trim();
|
|
6796
|
+
if (normalizedMarket2) urlParams.set("market", normalizedMarket2);
|
|
6723
6797
|
return resolveOperationPath(
|
|
6724
6798
|
EVENTS_ENDPOINT_OPERATIONS.occurrences.admissionAvailability,
|
|
6725
6799
|
{ query: urlParams }
|