@01.software/sdk 0.49.0 → 0.51.0
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 +130 -1
- package/MIGRATION.md +56 -0
- package/README.md +215 -45
- package/dist/client.cjs +188 -137
- 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 +188 -137
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-XfGLPuTf.d.cts → collection-client-CWAeuzV4.d.cts} +6 -4
- package/dist/{collection-client-DnDt6EQz.d.ts → collection-client-hYvVfHIm.d.ts} +6 -4
- package/dist/{const-DCNV5Kq7.d.ts → const-D8LixhAJ.d.cts} +5 -5
- package/dist/{const-CBba4lDo.d.cts → const-JD8obaKg.d.ts} +5 -5
- package/dist/embedded-admin/server.cjs +306 -0
- package/dist/embedded-admin/server.cjs.map +1 -0
- package/dist/embedded-admin/server.d.cts +33 -0
- package/dist/embedded-admin/server.d.ts +33 -0
- package/dist/embedded-admin/server.js +288 -0
- package/dist/embedded-admin/server.js.map +1 -0
- package/dist/embedded-admin.cjs +400 -0
- package/dist/embedded-admin.cjs.map +1 -0
- package/dist/embedded-admin.d.cts +61 -0
- package/dist/embedded-admin.d.ts +61 -0
- package/dist/embedded-admin.js +377 -0
- package/dist/embedded-admin.js.map +1 -0
- package/dist/errors.cjs +1 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +3 -3
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +1 -0
- package/dist/errors.js.map +1 -1
- package/dist/{index-CbKyoEzy.d.cts → index-B0Hjh3Ey.d.ts} +72 -10
- package/dist/{index-DUuIqUS8.d.ts → index-Bu0kCc6o.d.cts} +72 -10
- package/dist/index.cjs +320 -383
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -66
- package/dist/index.d.ts +8 -66
- package/dist/index.js +320 -383
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-MKbx5MuJ.d.cts → payload-types-BOsckg8B.d.cts} +263 -54
- package/dist/{payload-types-MKbx5MuJ.d.ts → payload-types-BOsckg8B.d.ts} +263 -54
- package/dist/query.cjs +94 -70
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/query.js +94 -70
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +404 -162
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.js +404 -162
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +1 -0
- package/dist/storefront-cache.cjs.map +1 -1
- package/dist/storefront-cache.js +1 -0
- package/dist/storefront-cache.js.map +1 -1
- package/dist/{types-L_nh-ED7.d.ts → types-5ZlcAFuU.d.ts} +2 -2
- package/dist/{types-BKr_2avj.d.cts → types-B14sEt1z.d.cts} +2 -2
- package/dist/{types-1UeOk1Uy.d.cts → types-Bj8j7VHU.d.ts} +79 -23
- package/dist/{types-Du4s5anw.d.ts → types-CM5qiR2k.d.cts} +79 -23
- 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.cjs +124 -80
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +21 -5
- package/dist/webhook.d.ts +21 -5
- package/dist/webhook.js +124 -80
- package/dist/webhook.js.map +1 -1
- package/package.json +23 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as PublicCollection, C as Collection, S as ServerCollection } from './const-
|
|
2
|
-
import { C as CollectionType, a as PublicProduct, P as PublicMarket } from './types-
|
|
3
|
-
import { O as Order, k as Transaction, l as Fulfillment, R as Return } from './payload-types-
|
|
1
|
+
import { P as PublicCollection, C as Collection, S as ServerCollection } from './const-D8LixhAJ.cjs';
|
|
2
|
+
import { C as CollectionType, a as PublicProduct, P as PublicMarket } from './types-B14sEt1z.cjs';
|
|
3
|
+
import { O as Order, k as Transaction, l as Fulfillment, R as Return } from './payload-types-BOsckg8B.cjs';
|
|
4
4
|
|
|
5
5
|
declare const operationBrand: unique symbol;
|
|
6
6
|
type HttpOperation = {
|
|
@@ -9,27 +9,15 @@ type HttpOperation = {
|
|
|
9
9
|
readonly method: 'get' | 'post' | 'patch' | 'delete';
|
|
10
10
|
readonly path: `/${string}`;
|
|
11
11
|
readonly errorFamily?: 'commerce';
|
|
12
|
+
/**
|
|
13
|
+
* Canonical commerce reasons emitted by an otherwise legacy-compatible
|
|
14
|
+
* endpoint. Only these responses may be normalized and parsed as the strict
|
|
15
|
+
* commerce envelope; every other response retains its established shape.
|
|
16
|
+
*/
|
|
17
|
+
readonly typedCommerceErrorReasons?: readonly string[];
|
|
12
18
|
};
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
* Single source of truth for the commerce HTTP paths the SDK calls.
|
|
16
|
-
*
|
|
17
|
-
* Console exposes these as `slug + Endpoint.path` on collection configs; the SDK
|
|
18
|
-
* has to hardcode the joined `/api/<slug>/<path>` because it cannot import the
|
|
19
|
-
* Console at build time. To stop a Console path change from silently turning into
|
|
20
|
-
* a runtime 404, non-quarantined values are cross-checked against live Console
|
|
21
|
-
* endpoint registration by `apps/console/tests/unit/sdk/endpoint-parity.test.ts`.
|
|
22
|
-
* That test also records canonical Phase 1 operations whose route is absent or
|
|
23
|
-
* whose same-path legacy handler is not yet contract-compatible; registration
|
|
24
|
-
* alone must never be interpreted as transport parity.
|
|
25
|
-
*
|
|
26
|
-
* Keep this internal — it is the transport contract, not public SDK surface.
|
|
27
|
-
*/
|
|
28
|
-
type CanonicalCommerceEndpointDescriptor = {
|
|
29
|
-
readonly method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
30
|
-
readonly path: string;
|
|
31
|
-
};
|
|
32
|
-
type CommerceEndpointDescriptor = CanonicalCommerceEndpointDescriptor | HttpOperation;
|
|
20
|
+
type CommerceEndpointDescriptor = HttpOperation;
|
|
33
21
|
|
|
34
22
|
interface CustomerScopedApiOptions {
|
|
35
23
|
publishableKey?: string;
|
|
@@ -380,6 +368,7 @@ interface RequestOptions {
|
|
|
380
368
|
method?: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
381
369
|
headers?: Record<string, string>;
|
|
382
370
|
errorFamily?: 'commerce';
|
|
371
|
+
typedCommerceErrorReasons?: readonly string[];
|
|
383
372
|
}
|
|
384
373
|
type EndpointRequestOptions = {
|
|
385
374
|
headers?: Record<string, string>;
|
|
@@ -816,6 +805,7 @@ type ReturnWithRefundParams = WithIdempotencyKey<{
|
|
|
816
805
|
initialShippingRefundOverrideNote?: string;
|
|
817
806
|
pgPaymentId: string;
|
|
818
807
|
paymentKey?: string;
|
|
808
|
+
/** Canonical trimmed receipt URL; the server rejects values over 2048 characters. */
|
|
819
809
|
refundReceiptUrl?: string;
|
|
820
810
|
}>;
|
|
821
811
|
type CreateFulfillmentParams = WithIdempotencyKey<{
|
|
@@ -2359,6 +2349,16 @@ type RetrieveBrowserPaymentSessionParams = {
|
|
|
2359
2349
|
type RetrieveServerPaymentSessionParams = {
|
|
2360
2350
|
paymentSessionId: string;
|
|
2361
2351
|
};
|
|
2352
|
+
type PortOnePaymentSelector = {
|
|
2353
|
+
provider: 'portone';
|
|
2354
|
+
providerAccountKey: string;
|
|
2355
|
+
environment: 'test' | 'live';
|
|
2356
|
+
providerPaymentId: string;
|
|
2357
|
+
};
|
|
2358
|
+
type FindPortOnePaymentParams = PortOnePaymentSelector;
|
|
2359
|
+
type ReconcilePortOnePaymentParams = PortOnePaymentSelector & {
|
|
2360
|
+
idempotencyKey: string;
|
|
2361
|
+
};
|
|
2362
2362
|
type CancelBrowserPaymentSessionParams = RetrieveBrowserPaymentSessionParams & {
|
|
2363
2363
|
idempotencyKey: string;
|
|
2364
2364
|
};
|
|
@@ -2404,6 +2404,44 @@ type RetrievedCustomPaymentSession = {
|
|
|
2404
2404
|
money: Money;
|
|
2405
2405
|
orderId: string | null;
|
|
2406
2406
|
};
|
|
2407
|
+
type PortOnePaymentCurrentState = {
|
|
2408
|
+
paymentSession: {
|
|
2409
|
+
id: string;
|
|
2410
|
+
provider: 'portone';
|
|
2411
|
+
providerStatus: PaymentProviderStatus;
|
|
2412
|
+
finalizationStatus: 'not_ready' | 'pending' | 'committed';
|
|
2413
|
+
sessionRole: PaymentSessionRole;
|
|
2414
|
+
reconciliation: {
|
|
2415
|
+
status: 'none';
|
|
2416
|
+
} | {
|
|
2417
|
+
status: 'required';
|
|
2418
|
+
reasons: readonly PaymentReconciliationReason[];
|
|
2419
|
+
};
|
|
2420
|
+
};
|
|
2421
|
+
checkout: {
|
|
2422
|
+
id: string;
|
|
2423
|
+
};
|
|
2424
|
+
order: {
|
|
2425
|
+
id: string;
|
|
2426
|
+
orderNumber: string;
|
|
2427
|
+
} | null;
|
|
2428
|
+
money: Money;
|
|
2429
|
+
};
|
|
2430
|
+
type FindPortOnePaymentResult = {
|
|
2431
|
+
found: false;
|
|
2432
|
+
} | {
|
|
2433
|
+
found: true;
|
|
2434
|
+
current: PortOnePaymentCurrentState;
|
|
2435
|
+
};
|
|
2436
|
+
type PortOneReconciliationDisposition = 'applied' | 'observed' | 'recovered_after_ambiguous_result' | 'requires_attention';
|
|
2437
|
+
type ReconcilePortOnePaymentResult = {
|
|
2438
|
+
found: false;
|
|
2439
|
+
disposition: 'requires_attention';
|
|
2440
|
+
} | {
|
|
2441
|
+
found: true;
|
|
2442
|
+
disposition: PortOneReconciliationDisposition;
|
|
2443
|
+
current: PortOnePaymentCurrentState;
|
|
2444
|
+
};
|
|
2407
2445
|
type ConfirmCustomPaymentSessionParams = {
|
|
2408
2446
|
provider: string;
|
|
2409
2447
|
providerSessionId: string;
|
|
@@ -2453,6 +2491,10 @@ type PortOnePaymentNextAction = {
|
|
|
2453
2491
|
type PortOneSdkPaymentNextAction = {
|
|
2454
2492
|
type: 'portone_sdk';
|
|
2455
2493
|
version: 'v2';
|
|
2494
|
+
/** Standard V2 actions cannot release their Checkout payment slot. */
|
|
2495
|
+
cancelable: false;
|
|
2496
|
+
/** Retry only this exact action and payment ID; never start a sibling session. */
|
|
2497
|
+
retryPolicy: 'same_action_only';
|
|
2456
2498
|
storeId: string;
|
|
2457
2499
|
channelKey: string;
|
|
2458
2500
|
paymentId: string;
|
|
@@ -2634,6 +2676,12 @@ declare class PaymentSessionApi extends CustomerScopedApi {
|
|
|
2634
2676
|
cancelPortOne(params: CancelBrowserPaymentSessionParams | CancelServerPaymentSessionParams): Promise<PortOnePublicPaymentSession>;
|
|
2635
2677
|
confirm(params: ConfirmTossPaymentSessionParams): Promise<PublicPaymentSession>;
|
|
2636
2678
|
}
|
|
2679
|
+
/** Server-only facade over the managed PortOne local/convergence engine. */
|
|
2680
|
+
declare class PortOnePaymentReconciliationApi extends BaseApi {
|
|
2681
|
+
constructor(options: ServerApiOptions);
|
|
2682
|
+
find(params: FindPortOnePaymentParams): Promise<FindPortOnePaymentResult>;
|
|
2683
|
+
reconcile(params: ReconcilePortOnePaymentParams): Promise<ReconcilePortOnePaymentResult>;
|
|
2684
|
+
}
|
|
2637
2685
|
|
|
2638
2686
|
interface CommerceClientOptions {
|
|
2639
2687
|
publishableKey: string;
|
|
@@ -2846,6 +2894,8 @@ declare class ServerCommerceClient {
|
|
|
2846
2894
|
cancel: (params: CancelServerPaymentSessionParams) => Promise<PublicPaymentSession>;
|
|
2847
2895
|
cancelPortOne: (params: CancelServerPaymentSessionParams) => Promise<PortOnePublicPaymentSession>;
|
|
2848
2896
|
confirm: (params: ConfirmTossPaymentSessionParams) => Promise<PublicPaymentSession>;
|
|
2897
|
+
findPortOne: (params: FindPortOnePaymentParams) => Promise<FindPortOnePaymentResult>;
|
|
2898
|
+
reconcilePortOne: (params: ReconcilePortOnePaymentParams) => Promise<ReconcilePortOnePaymentResult>;
|
|
2849
2899
|
custom: {
|
|
2850
2900
|
create: (params: CreateCustomPaymentSessionParams) => Promise<CustomPaymentSession>;
|
|
2851
2901
|
retrieve: (params: RetrieveCustomPaymentSessionParams) => Promise<RetrievedCustomPaymentSession>;
|
|
@@ -2930,6 +2980,8 @@ interface EventsRangeEvent {
|
|
|
2930
2980
|
endsAt?: string | null;
|
|
2931
2981
|
timezone?: string | null;
|
|
2932
2982
|
isAllDay: boolean;
|
|
2983
|
+
allDayStartDate?: string | null;
|
|
2984
|
+
allDayEndDateExclusive?: string | null;
|
|
2933
2985
|
visibility?: string | null;
|
|
2934
2986
|
sourceType?: string | null;
|
|
2935
2987
|
registrationPolicy?: string | null;
|
|
@@ -2947,6 +2999,8 @@ interface EventsRangeOccurrence {
|
|
|
2947
2999
|
endsAt?: string | null;
|
|
2948
3000
|
timezone?: string | null;
|
|
2949
3001
|
isAllDay: boolean;
|
|
3002
|
+
allDayStartDate?: string | null;
|
|
3003
|
+
allDayEndDateExclusive?: string | null;
|
|
2950
3004
|
status?: string | null;
|
|
2951
3005
|
capacity?: number;
|
|
2952
3006
|
registrationCount?: number;
|
|
@@ -3233,6 +3287,8 @@ interface TenantIntrospectionClient {
|
|
|
3233
3287
|
collectionSchema: (collection: string) => Promise<CollectionSchemaResponse>;
|
|
3234
3288
|
featureProgress: (params: TenantFeatureProgressInput) => Promise<TenantFeatureProgressResponse>;
|
|
3235
3289
|
}
|
|
3290
|
+
/** Canonical tenant-context transport identity shared by SDK-backed callers. */
|
|
3291
|
+
declare const TENANT_CONTEXT_PATH = "/api/tenants/context";
|
|
3236
3292
|
declare class TenantIntrospectionApi extends RawBaseApi implements TenantIntrospectionClient {
|
|
3237
3293
|
constructor(options: TenantIntrospectionApiOptions);
|
|
3238
3294
|
context(params?: TenantContextInput): Promise<TenantContextResponse>;
|
|
@@ -3554,4 +3610,4 @@ type DeepPartial<T> = {
|
|
|
3554
3610
|
};
|
|
3555
3611
|
type ExtractArrayType<T> = T extends (infer U)[] ? U : never;
|
|
3556
3612
|
|
|
3557
|
-
export { type PublicAttribute as $, type AddItemParams as A, type CreatePaymentSessionParams as B, CommerceClient as C, type CreatePortOnePaymentSessionParams as D, EventsClient as E, type CustomerSnapshot as F, type DebugConfig as G, type DeepPartial as H, type ExtractArrayType as I, type MembershipStatus as J, type Money as K, type PayloadMutationResponse as L, MarketDiscovery as M, type PaymentFailureReason as N, type OpenCheckoutPaymentState as O, type PayloadFindResponse as P, type PaymentNextAction as Q, type PaymentProviderStatus as R, type PaymentReconciliationReason as S, type PaymentSessionRole as T, type PortOneHostedPaymentMethod as U, type PortOnePaymentNextAction as V, type PortOnePublicPaymentSession as W, type ProductUpsertInput as X, type ProductUpsertParams as Y, type ProductUpsertResponse as Z, type ProductUpsertVariantInput as _, CommunityClient as a, type CollectionSchemaResponse as a$, type PublicCaptureEvidence as a0, type PublicCart as a1, type PublicCartItem as a2, type PublicCartItemAdmission as a3, type PublicCartMarket as a4, type PublicCartReference as a5, type PublicCheckout as a6, type PublicCheckoutItem as a7, type PublicMediaAsset as a8, type PublicMediaSize as a9, type UpdateDiscountCodesParams as aA, type UpdateItemParams as aB, type VariantInput as aC, type Where as aD, RawBaseApi as aE, type ServerApiOptions as aF, ServerCommerceClient as aG, type TenantIntrospectionClient as aH, type SubscribeMembershipParams as aI, type SubscribeMembershipResponse as aJ, type BanCustomerParams as aK, type CommunityBan as aL, type UnbanCustomerParams as aM, type ClientServerConfig as aN, type RootServerClientWithEvents as aO, type CancelServerPaymentSessionParams as aP, CartApi as aQ, type CartApiOptions as aR, CheckoutApi as aS, type CheckoutApiOptions as aT, type CheckoutListItem as aU, type CheckoutQueryParams as aV, type CheckoutQueryResult as aW, type CheckoutStatus as aX, type CollectionCustomFieldDefinition as aY, type CollectionCustomFields as aZ, type CollectionFieldSchema as a_, type PublicOrder as aa, type PublicOrderAmounts as ab, type PublicOrderItem as ac, type PublicOrderReference as ad, type PublicPaymentSession as ae, type ReconciliationRequired as af, type RemoveItemParams as ag, type RetrieveBrowserPaymentSessionParams as ah, type RetrieveCartParams as ai, type RetrieveCheckoutParams as aj, type RetryConfig as ak, type RootClient as al, type RootCollectionClient as am, type RootReadOnlyQueryBuilder as an, type ShippingLine as ao, type Sort as ap, type SpentCheckoutPaymentState as aq, type StorefrontContentListOptions as ar, type StorefrontContentReference as as, type StorefrontGalleryItem as at, type StorefrontGalleryItemsListOptions as au, type StorefrontGalleryItemsSort as av, type StorefrontLink as aw, type StorefrontLinksListOptions as ax, type StorefrontLinksSort as ay, type UpdateCartAttributesParams as az, ContentClient as b, type CustomerLoginData as b$, type ConfirmCustomPaymentSessionOptions as b0, type ConfirmCustomPaymentSessionParams as b1, type ConfirmCustomPaymentSessionResponse as b2, type ConfirmTossPaymentSessionParams as b3, type CreateCustomPaymentSessionParams as b4, type CreateServerCheckoutParams as b5, type CreateServerCheckoutResult as b6, type CustomPaymentSession as b7, type CustomPaymentSessionProof as b8, type EventAdmissionAvailabilityParams as b9, type RetrieveServerCheckoutParams as bA, type RetrieveServerPaymentSessionParams as bB, type RetrievedCustomPaymentSession as bC, type RootServerClient as bD, type ServerCartMergeParams as bE, type ServerCartMineParams as bF, type ServerCheckout as bG, type TenantContextInput as bH, type TenantContextResponse as bI, type TenantCustomFieldType as bJ, type TenantFeatureProgressEvidenceValue as bK, type TenantFeatureProgressFeature as bL, type TenantFeatureProgressGroup as bM, type TenantFeatureProgressInput as bN, type TenantFeatureProgressItem as bO, type TenantFeatureProgressItemState as bP, type TenantFeatureProgressResponse as bQ, type TenantFeatureProgressSeverity as bR, type TenantFeatureProgressStatus as bS, type TenantFieldConfigState as bT, TenantIntrospectionApi as bU, type TenantIntrospectionApiOptions as bV, type ApiDeleteOptions as bW, type PublicReadQueryOptions as bX, CustomerAuth as bY, type CustomerProfile as bZ, type CustomerAuthResponse as b_, type EventAdmissionAvailabilityResponse as ba, type EventAdmissionAvailabilityType as bb, type EventAdmissionPricePresentment as bc, type EventGuestCancelParams as bd, type EventGuestRegistration as be, type EventGuestRegistrationResponse as bf, type EventRegistrationAnswerInput as bg, type EventRegistrationAttendeeInput as bh, type EventRegistrationPublic as bi, type EventRegistrationRegisterParams as bj, type EventRegistrationRegisterResponse as bk, type EventsCalendarItem as bl, type EventsClientOptions as bm, type EventsDateParam as bn, type EventsExternalSource as bo, type EventsLocation as bp, type EventsOccurrenceLocation as bq, type EventsRangeEvent as br, type EventsRangeOccurrence as bs, type EventsRangeParams as bt, type EventsRangeResponse as bu, type EventsTaxonomyItem as bv, ModerationApi as bw, PaymentSessionApi as bx, type PaymentSessionApiOptions as by, type RetrieveCustomPaymentSessionParams as bz, CustomerNamespace as c, MAX_CART_LINE_ADMISSIONS as c$, type CustomerRegisterResponse as c0, type CustomerRegisterData as c1, type CustomerRefreshResponse as c2, type UpdateProfileData as c3, type ProductListingPageParams as c4, type ProductListingPageBaseParams as c5, type ProductDetailParams as c6, type ProductDetailCatalogResult as c7, type ProductListingPageCatalogParams as c8, type ProductListingPageResult as c9, type CommunityComment as cA, type CommunityCommentListSort as cB, type CommunityPost as cC, type CommunityPostCategory as cD, type CommunityPostListSort as cE, type CommunityPostTag as cF, type CommunityPublicAuthorSnapshot as cG, type CommunityPublicMediaAsset as cH, type CommunityPublicReference as cI, type CompatibilityProductSelectionParamEvent as cJ, type CreateFulfillmentParams as cK, type CreateReturnParams as cL, type CustomerAuthOptions as cM, type CustomerAuthorizationUrlInput as cN, type CustomerAuthorizationUrlResult as cO, CustomerOAuth as cP, type CustomerOAuthCallbackResult as cQ, type CustomerOAuthConfig as cR, type CustomerOAuthTokenSet as cS, type CustomerOrderListOptions as cT, DiscountApi as cU, type DiscountApiOptions as cV, type DiscountErrorReasonCode as cW, type FeaturedImagePointerInput as cX, type GetOrderByPaymentIdParams as cY, type LegacyProductSelectionParamEvent as cZ, type ListingGroupsParams as c_, type ProductListingGroupsCatalogItem as ca, type ProductListingPageFullParams as cb, type ProductListingGroupsItem as cc, BaseApi as cd, type ProductDetail as ce, type ProductDetailCatalog as cf, type StockSnapshotResponse as cg, type ProductSelectionMediaSource as ch, type ProductDisplayMediaSource as ci, type ResolveProductSelectionMediaInput as cj, type ResolveProductSelectionMediaResult as ck, type ProductSelectionMediaPointer as cl, type RootClientWithEvents as cm, type BulkImportFulfillmentsParams as cn, type BulkImportFulfillmentsResponse as co, type CalculateShippingParams as cp, type CalculateShippingResult as cq, type CancelOrderParams as cr, type CancelOrderResponse as cs, type CancelReasonCode as ct, type CartDiscountCode as cu, type CartWarning as cv, type CartWarningCode as cw, type Comment as cx, type CommerceClientOptions as cy, type CommunityClientOptions as cz, type CustomerMembershipView as d, type ProductOptionShape as d$, type ManagedPaymentNextAction as d0, type ManagedPublicPaymentSession as d1, type MarketDTO as d2, type MediaValue as d3, type NormalizedOptionSwatch as d4, type NormalizedProductSelection as d5, OrderApi as d6, type OrderApiOptions as d7, type OrderByPaymentResult as d8, PRODUCT_PLP_FIND_OPTIONS as d9, type ProductListingCardOptions as dA, type ProductListingCardPriceRange as dB, type ProductListingCardRepresentativeVariant as dC, type ProductListingGroup as dD, type ProductListingGroupCatalogSummary as dE, type ProductListingGroupCatalogVariant as dF, type ProductListingGroupProjection as dG, type ProductListingGroupSummary as dH, type ProductListingGroupVariant as dI, type ProductListingGroupsCatalogProduct as dJ, type ProductListingGroupsCatalogResponse as dK, type ProductListingGroupsProduct as dL, type ProductListingGroupsResponse as dM, type ProductListingPageFilters as dN, type ProductListingPageSort as dO, type ProductListingProductShape as dP, type ProductListingSwatch as dQ, type ProductLocaleOption as dR, type ProductLocaleReadParams as dS, type ProductLocalizedText as dT, type ProductLocalizedValue as dU, type ProductMediaResolutionSource as dV, type ProductMoneyRange as dW, type ProductOptionMatrix as dX, type ProductOptionMatrixOption as dY, type ProductOptionMatrixValue as dZ, type ProductOptionMatrixVariant as d_, PRODUCT_UPSERT_READONLY_FIELD_REASON as da, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as db, type PrepareFulfillmentOrderParams as dc, type PrepareFulfillmentOrderResponse as dd, ProductApi as de, type ProductApiOptions as df, type ProductDetailBrand as dg, type ProductDetailCatalogVariant as dh, type ProductDetailCategory as di, type ProductDetailImage as dj, type ProductDetailImageMedia as dk, type ProductDetailMedia as dl, type ProductDetailOption as dm, type ProductDetailOptionValue as dn, type ProductDetailResult as dp, type ProductDetailTag as dq, type ProductDetailUnavailableReason as dr, type ProductDetailVariant as ds, type ProductDetailVariantOptionValue as dt, type ProductDetailVideo as du, type ProductFallbackLocaleOption as dv, type ProductHrefGroup as dw, type ProductHrefOptions as dx, type ProductHrefProduct as dy, type ProductListingCard as dz, type CancelMembershipParams as e, projectProductToListingShape as e$, type ProductOptionValueShape as e0, type ProductOptionValueSwatch as e1, type ProductOptionValueSwatchInput as e2, type ProductPriceRange as e3, type ProductSelectionAvailableSwatch as e4, type ProductSelectionAvailableValue as e5, type ProductSelectionByOptionValue as e6, ProductSelectionCodecError as e7, type ProductSelectionCodecOptions as e8, type ProductSelectionInput as e9, type StockCheckResponse as eA, type StockCheckResult as eB, type StockSnapshotItem as eC, type StockSnapshotParams as eD, type UpdateFulfillmentParams as eE, type UpdateOrderParams as eF, type UpdateReturnParams as eG, type ValidateDiscountParams as eH, type ValidateDiscountResult as eI, type WithIdempotencyKey as eJ, buildProductHref as eK, buildProductListingCard as eL, buildProductListingGroupProjection as eM, buildProductListingGroupsByOption as eN, buildProductOptionMatrix as eO, buildProductOptionMatrixFromDetail as eP, createProductSelectionCodec as eQ, getAvailableOptionValues as eR, getProductSelectionImages as eS, getSelectedValueByOptionId as eT, getVariantAvailableForSale as eU, getVariantAvailableStock as eV, isProductUpsertFieldValidationErrorBody as eW, normalizeProductSelection as eX, normalizeProductSelectionFromMatrix as eY, normalizeSelectedValueIds as eZ, parseProductSelection as e_, type ProductSelectionOptionValue as ea, type ProductSelectionResolution as eb, type ProductSelectionResolutionContext as ec, type ProductSelectionUrlEmit as ed, type ProductSelectionVariant$1 as ee, type ProductUpsertFieldValidationErrorBody as ef, type ProductUpsertFieldValidationErrorReason as eg, type ProductVariantShape as eh, type PublicCheckoutBase as ei, type RequestOptions as ej, type ResolveCancelRefundFailedResponse as ek, type ResolveCancelRefundOutcome as el, type ResolveCancelRefundParams as em, type ResolveCancelRefundResponse as en, type ResolveCancelRefundSucceededResponse as eo, type ResolveProductDisplayMediaInput as ep, type ResolveProductDisplayMediaResult as eq, type ResolvedCatalogPrice as er, type ReturnCancellationReasonCode as es, type ReturnItem as et, type ReturnReason as eu, type ReturnWithRefundItem as ev, type ReturnWithRefundParams as ew, ShippingApi as ex, type ShippingApiOptions as ey, type StockCheckParams as ez, type CancelMembershipResponse as f, resolveFeaturedImagePointer as f0, resolveProductDisplayMedia as f1, resolveProductSelection as f2, resolveProductSelectionFromMatrix as f3, resolveProductSelectionMedia as f4, resolveVariantForSelection as f5, selectNext as f6, selectedSwatchMediaItemId as f7, stringifyProductSelection as f8, toShopifyPriceRangeV2 as f9, type ClientState as g, type ClientConfig as h, type ApiQueryOptions as i, type CancelBrowserPaymentSessionParams as j, type CartMergeParams as k, type CartMergeResult as l, type CartMineResult as m, type CartMutationResult as n, type CheckoutAbandonedReason as o, type CheckoutAmounts as p, type CheckoutOrderReference as q, type CheckoutPaymentSessionRef as r, type CheckoutShippingAddress as s, type ClearCartParams as t, type ClientMetadata as u, type ContentClientOptions as v, type CreateCartParams as w, type CreateCartResult as x, type CreateCheckoutParams as y, type CreateCheckoutResult as z };
|
|
3613
|
+
export { type PublicAttribute as $, type AddItemParams as A, type CreatePaymentSessionParams as B, CommerceClient as C, type CreatePortOnePaymentSessionParams as D, EventsClient as E, type CustomerSnapshot as F, type DebugConfig as G, type DeepPartial as H, type ExtractArrayType as I, type MembershipStatus as J, type Money as K, type PayloadMutationResponse as L, MarketDiscovery as M, type PaymentFailureReason as N, type OpenCheckoutPaymentState as O, type PayloadFindResponse as P, type PaymentNextAction as Q, type PaymentProviderStatus as R, type PaymentReconciliationReason as S, type PaymentSessionRole as T, type PortOneHostedPaymentMethod as U, type PortOnePaymentNextAction as V, type PortOnePublicPaymentSession as W, type ProductUpsertInput as X, type ProductUpsertParams as Y, type ProductUpsertResponse as Z, type ProductUpsertVariantInput as _, CommunityClient as a, type CollectionSchemaResponse as a$, type PublicCaptureEvidence as a0, type PublicCart as a1, type PublicCartItem as a2, type PublicCartItemAdmission as a3, type PublicCartMarket as a4, type PublicCartReference as a5, type PublicCheckout as a6, type PublicCheckoutItem as a7, type PublicMediaAsset as a8, type PublicMediaSize as a9, type UpdateDiscountCodesParams as aA, type UpdateItemParams as aB, type VariantInput as aC, type Where as aD, RawBaseApi as aE, type ServerApiOptions as aF, ServerCommerceClient as aG, type TenantIntrospectionClient as aH, type SubscribeMembershipParams as aI, type SubscribeMembershipResponse as aJ, type BanCustomerParams as aK, type CommunityBan as aL, type UnbanCustomerParams as aM, type ClientServerConfig as aN, type RootServerClientWithEvents as aO, type CancelServerPaymentSessionParams as aP, CartApi as aQ, type CartApiOptions as aR, CheckoutApi as aS, type CheckoutApiOptions as aT, type CheckoutListItem as aU, type CheckoutQueryParams as aV, type CheckoutQueryResult as aW, type CheckoutStatus as aX, type CollectionCustomFieldDefinition as aY, type CollectionCustomFields as aZ, type CollectionFieldSchema as a_, type PublicOrder as aa, type PublicOrderAmounts as ab, type PublicOrderItem as ac, type PublicOrderReference as ad, type PublicPaymentSession as ae, type ReconciliationRequired as af, type RemoveItemParams as ag, type RetrieveBrowserPaymentSessionParams as ah, type RetrieveCartParams as ai, type RetrieveCheckoutParams as aj, type RetryConfig as ak, type RootClient as al, type RootCollectionClient as am, type RootReadOnlyQueryBuilder as an, type ShippingLine as ao, type Sort as ap, type SpentCheckoutPaymentState as aq, type StorefrontContentListOptions as ar, type StorefrontContentReference as as, type StorefrontGalleryItem as at, type StorefrontGalleryItemsListOptions as au, type StorefrontGalleryItemsSort as av, type StorefrontLink as aw, type StorefrontLinksListOptions as ax, type StorefrontLinksSort as ay, type UpdateCartAttributesParams as az, ContentClient as b, type TenantFeatureProgressStatus as b$, type ConfirmCustomPaymentSessionOptions as b0, type ConfirmCustomPaymentSessionParams as b1, type ConfirmCustomPaymentSessionResponse as b2, type ConfirmTossPaymentSessionParams as b3, type CreateCustomPaymentSessionParams as b4, type CreateServerCheckoutParams as b5, type CreateServerCheckoutResult as b6, type CustomPaymentSession as b7, type CustomPaymentSessionProof as b8, type EventAdmissionAvailabilityParams as b9, type PaymentSessionApiOptions as bA, type PortOnePaymentCurrentState as bB, PortOnePaymentReconciliationApi as bC, type PortOnePaymentSelector as bD, type PortOneReconciliationDisposition as bE, type ReconcilePortOnePaymentParams as bF, type ReconcilePortOnePaymentResult as bG, type RetrieveCustomPaymentSessionParams as bH, type RetrieveServerCheckoutParams as bI, type RetrieveServerPaymentSessionParams as bJ, type RetrievedCustomPaymentSession as bK, type RootServerClient as bL, type ServerCartMergeParams as bM, type ServerCartMineParams as bN, type ServerCheckout as bO, TENANT_CONTEXT_PATH as bP, type TenantContextInput as bQ, type TenantContextResponse as bR, type TenantCustomFieldType as bS, type TenantFeatureProgressEvidenceValue as bT, type TenantFeatureProgressFeature as bU, type TenantFeatureProgressGroup as bV, type TenantFeatureProgressInput as bW, type TenantFeatureProgressItem as bX, type TenantFeatureProgressItemState as bY, type TenantFeatureProgressResponse as bZ, type TenantFeatureProgressSeverity as b_, type EventAdmissionAvailabilityResponse as ba, type EventAdmissionAvailabilityType as bb, type EventAdmissionPricePresentment as bc, type EventGuestCancelParams as bd, type EventGuestRegistration as be, type EventGuestRegistrationResponse as bf, type EventRegistrationAnswerInput as bg, type EventRegistrationAttendeeInput as bh, type EventRegistrationPublic as bi, type EventRegistrationRegisterParams as bj, type EventRegistrationRegisterResponse as bk, type EventsCalendarItem as bl, type EventsClientOptions as bm, type EventsDateParam as bn, type EventsExternalSource as bo, type EventsLocation as bp, type EventsOccurrenceLocation as bq, type EventsRangeEvent as br, type EventsRangeOccurrence as bs, type EventsRangeParams as bt, type EventsRangeResponse as bu, type EventsTaxonomyItem as bv, type FindPortOnePaymentParams as bw, type FindPortOnePaymentResult as bx, ModerationApi as by, PaymentSessionApi as bz, CustomerNamespace as c, type FeaturedImagePointerInput as c$, type TenantFieldConfigState as c0, TenantIntrospectionApi as c1, type TenantIntrospectionApiOptions as c2, type ApiDeleteOptions as c3, type PublicReadQueryOptions as c4, CustomerAuth as c5, type CustomerProfile as c6, type CustomerAuthResponse as c7, type CustomerLoginData as c8, type CustomerRegisterResponse as c9, type CartWarningCode as cA, type Comment as cB, type CommerceClientOptions as cC, type CommunityClientOptions as cD, type CommunityComment as cE, type CommunityCommentListSort as cF, type CommunityPost as cG, type CommunityPostCategory as cH, type CommunityPostListSort as cI, type CommunityPostTag as cJ, type CommunityPublicAuthorSnapshot as cK, type CommunityPublicMediaAsset as cL, type CommunityPublicReference as cM, type CompatibilityProductSelectionParamEvent as cN, type CreateFulfillmentParams as cO, type CreateReturnParams as cP, type CustomerAuthOptions as cQ, type CustomerAuthorizationUrlInput as cR, type CustomerAuthorizationUrlResult as cS, CustomerOAuth as cT, type CustomerOAuthCallbackResult as cU, type CustomerOAuthConfig as cV, type CustomerOAuthTokenSet as cW, type CustomerOrderListOptions as cX, DiscountApi as cY, type DiscountApiOptions as cZ, type DiscountErrorReasonCode as c_, type CustomerRegisterData as ca, type CustomerRefreshResponse as cb, type UpdateProfileData as cc, type ProductListingPageParams as cd, type ProductListingPageBaseParams as ce, type ProductDetailParams as cf, type ProductDetailCatalogResult as cg, type ProductListingPageCatalogParams as ch, type ProductListingPageResult as ci, type ProductListingGroupsCatalogItem as cj, type ProductListingPageFullParams as ck, type ProductListingGroupsItem as cl, BaseApi as cm, type ProductDetail as cn, type ProductDetailCatalog as co, type StockSnapshotResponse as cp, type RootClientWithEvents as cq, type BulkImportFulfillmentsParams as cr, type BulkImportFulfillmentsResponse as cs, type CalculateShippingParams as ct, type CalculateShippingResult as cu, type CancelOrderParams as cv, type CancelOrderResponse as cw, type CancelReasonCode as cx, type CartDiscountCode as cy, type CartWarning as cz, type CustomerMembershipView as d, type ProductMoneyRange as d$, type GetOrderByPaymentIdParams as d0, type LegacyProductSelectionParamEvent as d1, type ListingGroupsParams as d2, MAX_CART_LINE_ADMISSIONS as d3, type ManagedPaymentNextAction as d4, type ManagedPublicPaymentSession as d5, type MarketDTO as d6, type MediaValue as d7, type NormalizedOptionSwatch as d8, type NormalizedProductSelection as d9, type ProductFallbackLocaleOption as dA, type ProductHrefGroup as dB, type ProductHrefOptions as dC, type ProductHrefProduct as dD, type ProductListingCard as dE, type ProductListingCardOptions as dF, type ProductListingCardPriceRange as dG, type ProductListingCardRepresentativeVariant as dH, type ProductListingGroup as dI, type ProductListingGroupCatalogSummary as dJ, type ProductListingGroupCatalogVariant as dK, type ProductListingGroupProjection as dL, type ProductListingGroupSummary as dM, type ProductListingGroupVariant as dN, type ProductListingGroupsCatalogProduct as dO, type ProductListingGroupsCatalogResponse as dP, type ProductListingGroupsProduct as dQ, type ProductListingGroupsResponse as dR, type ProductListingPageFilters as dS, type ProductListingPageSort as dT, type ProductListingProductShape as dU, type ProductListingSwatch as dV, type ProductLocaleOption as dW, type ProductLocaleReadParams as dX, type ProductLocalizedText as dY, type ProductLocalizedValue as dZ, type ProductMediaResolutionSource as d_, OrderApi as da, type OrderApiOptions as db, type OrderByPaymentResult as dc, PRODUCT_PLP_FIND_OPTIONS as dd, PRODUCT_UPSERT_READONLY_FIELD_REASON as de, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as df, type PrepareFulfillmentOrderParams as dg, type PrepareFulfillmentOrderResponse as dh, ProductApi as di, type ProductApiOptions as dj, type ProductDetailBrand as dk, type ProductDetailCatalogVariant as dl, type ProductDetailCategory as dm, type ProductDetailImage as dn, type ProductDetailImageMedia as dp, type ProductDetailMedia as dq, type ProductDetailOption as dr, type ProductDetailOptionValue as ds, type ProductDetailResult as dt, type ProductDetailTag as du, type ProductDetailUnavailableReason as dv, type ProductDetailVariant as dw, type ProductDetailVariantOptionValue as dx, type ProductDetailVideo as dy, type ProductDisplayMediaSource as dz, type CancelMembershipParams as e, getProductSelectionImages as e$, type ProductOptionMatrix as e0, type ProductOptionMatrixOption as e1, type ProductOptionMatrixValue as e2, type ProductOptionMatrixVariant as e3, type ProductOptionShape as e4, type ProductOptionValueShape as e5, type ProductOptionValueSwatch as e6, type ProductOptionValueSwatchInput as e7, type ProductPriceRange as e8, type ProductSelectionAvailableSwatch as e9, type ResolvedCatalogPrice as eA, type ReturnCancellationReasonCode as eB, type ReturnItem as eC, type ReturnReason as eD, type ReturnWithRefundItem as eE, type ReturnWithRefundParams as eF, ShippingApi as eG, type ShippingApiOptions as eH, type StockCheckParams as eI, type StockCheckResponse as eJ, type StockCheckResult as eK, type StockSnapshotItem as eL, type StockSnapshotParams as eM, type UpdateFulfillmentParams as eN, type UpdateOrderParams as eO, type UpdateReturnParams as eP, type ValidateDiscountParams as eQ, type ValidateDiscountResult as eR, type WithIdempotencyKey as eS, buildProductHref as eT, buildProductListingCard as eU, buildProductListingGroupProjection as eV, buildProductListingGroupsByOption as eW, buildProductOptionMatrix as eX, buildProductOptionMatrixFromDetail as eY, createProductSelectionCodec as eZ, getAvailableOptionValues as e_, type ProductSelectionAvailableValue as ea, type ProductSelectionByOptionValue as eb, ProductSelectionCodecError as ec, type ProductSelectionCodecOptions as ed, type ProductSelectionInput as ee, type ProductSelectionMediaPointer as ef, type ProductSelectionMediaSource as eg, type ProductSelectionOptionValue as eh, type ProductSelectionResolution as ei, type ProductSelectionResolutionContext as ej, type ProductSelectionUrlEmit as ek, type ProductSelectionVariant$1 as el, type ProductUpsertFieldValidationErrorBody as em, type ProductUpsertFieldValidationErrorReason as en, type ProductVariantShape as eo, type PublicCheckoutBase as ep, type RequestOptions as eq, type ResolveCancelRefundFailedResponse as er, type ResolveCancelRefundOutcome as es, type ResolveCancelRefundParams as et, type ResolveCancelRefundResponse as eu, type ResolveCancelRefundSucceededResponse as ev, type ResolveProductDisplayMediaInput as ew, type ResolveProductDisplayMediaResult as ex, type ResolveProductSelectionMediaInput as ey, type ResolveProductSelectionMediaResult as ez, type CancelMembershipResponse as f, getSelectedValueByOptionId as f0, getVariantAvailableForSale as f1, getVariantAvailableStock as f2, isProductUpsertFieldValidationErrorBody as f3, normalizeProductSelection as f4, normalizeProductSelectionFromMatrix as f5, normalizeSelectedValueIds as f6, parseProductSelection as f7, projectProductToListingShape as f8, resolveFeaturedImagePointer as f9, resolveProductDisplayMedia as fa, resolveProductSelection as fb, resolveProductSelectionFromMatrix as fc, resolveProductSelectionMedia as fd, resolveVariantForSelection as fe, selectNext as ff, selectedSwatchMediaItemId as fg, stringifyProductSelection as fh, toShopifyPriceRangeV2 as fi, type ClientState as g, type ClientConfig as h, type ApiQueryOptions as i, type CancelBrowserPaymentSessionParams as j, type CartMergeParams as k, type CartMergeResult as l, type CartMineResult as m, type CartMutationResult as n, type CheckoutAbandonedReason as o, type CheckoutAmounts as p, type CheckoutOrderReference as q, type CheckoutPaymentSessionRef as r, type CheckoutShippingAddress as s, type ClearCartParams as t, type ClientMetadata as u, type ContentClientOptions as v, type CreateCartParams as w, type CreateCartResult as x, type CreateCheckoutParams as y, type CreateCheckoutResult as z };
|
package/dist/ui/form.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { F as Form } from '../payload-types-
|
|
2
|
+
import { F as Form } from '../payload-types-BOsckg8B.cjs';
|
|
3
3
|
import { RichTextData } from './rich-text.cjs';
|
|
4
4
|
import '@payloadcms/richtext-lexical';
|
|
5
5
|
import '@payloadcms/richtext-lexical/lexical';
|
package/dist/ui/form.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { F as Form } from '../payload-types-
|
|
2
|
+
import { F as Form } from '../payload-types-BOsckg8B.js';
|
|
3
3
|
import { RichTextData } from './rich-text.js';
|
|
4
4
|
import '@payloadcms/richtext-lexical';
|
|
5
5
|
import '@payloadcms/richtext-lexical/lexical';
|
package/dist/ui/video.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { MuxPlayerProps, MuxPlayerRefAttributes } from '@mux/mux-player-react';
|
|
3
3
|
export { MuxPlayerRefAttributes as VideoPlayerRef } from '@mux/mux-player-react';
|
|
4
|
-
import { V as Video } from '../payload-types-
|
|
4
|
+
import { V as Video } from '../payload-types-BOsckg8B.cjs';
|
|
5
5
|
export { V as VideoGifOptions, a as VideoThumbnailOptions, g as getVideoGif, b as getVideoMp4Url, c as getVideoStoryboard, d as getVideoStreamUrl, e as getVideoThumbnail } from '../video-WR_TFO9a.cjs';
|
|
6
6
|
|
|
7
7
|
interface VideoPlayerCSSProperties extends CSSProperties {
|
package/dist/ui/video.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { MuxPlayerProps, MuxPlayerRefAttributes } from '@mux/mux-player-react';
|
|
3
3
|
export { MuxPlayerRefAttributes as VideoPlayerRef } from '@mux/mux-player-react';
|
|
4
|
-
import { V as Video } from '../payload-types-
|
|
4
|
+
import { V as Video } from '../payload-types-BOsckg8B.js';
|
|
5
5
|
export { V as VideoGifOptions, a as VideoThumbnailOptions, g as getVideoGif, b as getVideoMp4Url, c as getVideoStoryboard, d as getVideoStreamUrl, e as getVideoThumbnail } from '../video-WR_TFO9a.js';
|
|
6
6
|
|
|
7
7
|
interface VideoPlayerCSSProperties extends CSSProperties {
|
package/dist/webhook.cjs
CHANGED
|
@@ -31,6 +31,8 @@ __export(webhook_exports, {
|
|
|
31
31
|
createTypedWebhookHandler: () => createTypedWebhookHandler,
|
|
32
32
|
defineCommerceEmailConfig: () => defineCommerceEmailConfig,
|
|
33
33
|
getCommerceNotificationIdempotencyKey: () => getCommerceNotificationIdempotencyKey,
|
|
34
|
+
handleSignedWebhook: () => handleSignedWebhook,
|
|
35
|
+
handleUnsignedWebhook: () => handleUnsignedWebhook,
|
|
34
36
|
handleWebhook: () => handleWebhook,
|
|
35
37
|
isCommerceNotificationWebhookEvent: () => isCommerceNotificationWebhookEvent,
|
|
36
38
|
isCustomerPasswordResetWebhookEvent: () => isCustomerPasswordResetWebhookEvent,
|
|
@@ -41,13 +43,109 @@ __export(webhook_exports, {
|
|
|
41
43
|
});
|
|
42
44
|
module.exports = __toCommonJS(webhook_exports);
|
|
43
45
|
|
|
46
|
+
// src/core/webhook/validation.ts
|
|
47
|
+
function isValidWebhookEventData(data) {
|
|
48
|
+
if (typeof data !== "object" || data === null) return false;
|
|
49
|
+
const event = data;
|
|
50
|
+
return typeof event.collection === "string" && typeof event.operation === "string" && event.operation.length > 0 && typeof event.data === "object" && event.data !== null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// src/core/webhook/receiver.ts
|
|
54
|
+
async function verifySignature(rawBody, secret, signature, timestamp, deliveryId) {
|
|
55
|
+
const encoder = new TextEncoder();
|
|
56
|
+
const signedPrefix = encoder.encode(`${timestamp}.${deliveryId}.`);
|
|
57
|
+
const signedPayload = new Uint8Array(signedPrefix.length + rawBody.length);
|
|
58
|
+
signedPayload.set(signedPrefix);
|
|
59
|
+
signedPayload.set(rawBody, signedPrefix.length);
|
|
60
|
+
const key = await crypto.subtle.importKey(
|
|
61
|
+
"raw",
|
|
62
|
+
encoder.encode(secret),
|
|
63
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
64
|
+
false,
|
|
65
|
+
["verify"]
|
|
66
|
+
);
|
|
67
|
+
if (signature.length % 2 !== 0 || !/^[0-9a-fA-F]*$/.test(signature)) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
const sigBytes = new Uint8Array(
|
|
71
|
+
(signature.match(/.{2}/g) ?? []).map((byte) => parseInt(byte, 16))
|
|
72
|
+
);
|
|
73
|
+
return crypto.subtle.verify("HMAC", key, sigBytes, signedPayload);
|
|
74
|
+
}
|
|
75
|
+
function timestampIsFresh(timestamp, toleranceSeconds) {
|
|
76
|
+
if (!/^\d+$/.test(timestamp)) return false;
|
|
77
|
+
const timestampMs = Number(timestamp);
|
|
78
|
+
if (!Number.isFinite(timestampMs)) return false;
|
|
79
|
+
const skewMs = Math.abs(Date.now() - timestampMs);
|
|
80
|
+
return skewMs <= toleranceSeconds * 1e3;
|
|
81
|
+
}
|
|
82
|
+
var MAX_TOLERANCE_SECONDS = 86400;
|
|
83
|
+
function toleranceIsValid(toleranceSeconds) {
|
|
84
|
+
return typeof toleranceSeconds === "number" && Number.isFinite(toleranceSeconds) && toleranceSeconds >= 0 && toleranceSeconds <= MAX_TOLERANCE_SECONDS;
|
|
85
|
+
}
|
|
86
|
+
async function processWebhookRequest(request, handler, verify) {
|
|
87
|
+
try {
|
|
88
|
+
const rawBody = new Uint8Array(await request.arrayBuffer());
|
|
89
|
+
const verificationFailure = await verify?.(rawBody);
|
|
90
|
+
if (verificationFailure) return verificationFailure;
|
|
91
|
+
const body = JSON.parse(new TextDecoder().decode(rawBody));
|
|
92
|
+
if (!isValidWebhookEventData(body)) {
|
|
93
|
+
return new Response(
|
|
94
|
+
JSON.stringify({ error: "Invalid webhook event format" }),
|
|
95
|
+
{ status: 400, headers: { "Content-Type": "application/json" } }
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
await handler(body);
|
|
99
|
+
return new Response(
|
|
100
|
+
JSON.stringify({ success: true, message: "Webhook processed" }),
|
|
101
|
+
{ status: 200, headers: { "Content-Type": "application/json" } }
|
|
102
|
+
);
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.error("Webhook processing error:", error);
|
|
105
|
+
return new Response(JSON.stringify({ error: "Internal server error" }), {
|
|
106
|
+
status: 500,
|
|
107
|
+
headers: { "Content-Type": "application/json" }
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async function handleSignedWebhook(request, handler, options) {
|
|
112
|
+
const secret = options?.secret;
|
|
113
|
+
const configuredTolerance = options?.toleranceSeconds;
|
|
114
|
+
const toleranceSeconds = configuredTolerance ?? 300;
|
|
115
|
+
if (typeof secret !== "string" || secret.trim().length === 0) {
|
|
116
|
+
return new Response(
|
|
117
|
+
JSON.stringify({ error: "Webhook signing secret is not configured" }),
|
|
118
|
+
{ status: 500, headers: { "Content-Type": "application/json" } }
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
if (!toleranceIsValid(toleranceSeconds)) {
|
|
122
|
+
return new Response(
|
|
123
|
+
JSON.stringify({ error: "Webhook signature tolerance is not valid" }),
|
|
124
|
+
{ status: 500, headers: { "Content-Type": "application/json" } }
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
return processWebhookRequest(request, handler, async (rawBody) => {
|
|
128
|
+
const signature = request.headers.get("x-webhook-signature") || "";
|
|
129
|
+
const timestamp = request.headers.get("x-webhook-timestamp") || "";
|
|
130
|
+
const deliveryId = request.headers.get("x-webhook-delivery-id") || "";
|
|
131
|
+
const valid = Boolean(timestamp && deliveryId) && timestampIsFresh(timestamp, toleranceSeconds) && await verifySignature(rawBody, secret, signature, timestamp, deliveryId);
|
|
132
|
+
if (!valid) {
|
|
133
|
+
return new Response(
|
|
134
|
+
JSON.stringify({ error: "Invalid webhook signature" }),
|
|
135
|
+
{ status: 401, headers: { "Content-Type": "application/json" } }
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
async function handleUnsignedWebhook(request, handler) {
|
|
141
|
+
return processWebhookRequest(request, handler);
|
|
142
|
+
}
|
|
143
|
+
|
|
44
144
|
// src/core/webhook/index.ts
|
|
45
145
|
var ORDER_CHANGED_EVENT_TYPE = "collection.orderChanged";
|
|
46
146
|
var COMMERCE_NOTIFICATION_EVENT_TYPE = "commerce.notification";
|
|
47
147
|
function isValidWebhookEvent(data) {
|
|
48
|
-
|
|
49
|
-
const obj = data;
|
|
50
|
-
return typeof obj.collection === "string" && typeof obj.operation === "string" && obj.operation.length > 0 && typeof obj.data === "object" && obj.data !== null;
|
|
148
|
+
return isValidWebhookEventData(data);
|
|
51
149
|
}
|
|
52
150
|
var COMMERCE_NOTIFICATION_OPERATION = "notification";
|
|
53
151
|
var COMMERCE_NOTIFICATION_EVENTS = [
|
|
@@ -59,7 +157,9 @@ var COMMERCE_NOTIFICATION_EVENTS = [
|
|
|
59
157
|
"returnApproved",
|
|
60
158
|
"returnRejected",
|
|
61
159
|
"returnCanceled",
|
|
62
|
-
"returnCompleted"
|
|
160
|
+
"returnCompleted",
|
|
161
|
+
"paymentReconciliationRequired",
|
|
162
|
+
"paymentRefundRequiresAttention"
|
|
63
163
|
];
|
|
64
164
|
function isStringOrNumber(value) {
|
|
65
165
|
return typeof value === "string" || typeof value === "number";
|
|
@@ -89,18 +189,25 @@ function isCommerceNotificationEventName(value) {
|
|
|
89
189
|
return typeof value === "string" && COMMERCE_NOTIFICATION_EVENTS.includes(value);
|
|
90
190
|
}
|
|
91
191
|
function isCommerceNotificationSourceCollection(value) {
|
|
92
|
-
return value === "orders" || value === "fulfillments" || value === "returns";
|
|
192
|
+
return value === "orders" || value === "fulfillments" || value === "returns" || value === "payment-sessions" || value === "payment-refund-attempts";
|
|
93
193
|
}
|
|
94
194
|
function isCommerceNotificationData(value) {
|
|
95
195
|
if (!isRecord(value)) return false;
|
|
96
196
|
if (value.source !== void 0 && (!isRecord(value.source) || !isCommerceNotificationSourceCollection(value.source.collection) || !isStringOrNumber(value.source.id))) {
|
|
97
197
|
return false;
|
|
98
198
|
}
|
|
99
|
-
return (value.orderId === void 0 || isStringOrNumber(value.orderId)) && (value.orderNumber === void 0 || typeof value.orderNumber === "string") && (value.status === void 0 || typeof value.status === "string") && (value.totalAmount === void 0 || typeof value.totalAmount === "number") && (value.currency === void 0 || typeof value.currency === "string") && (value.fulfillmentId === void 0 || isStringOrNumber(value.fulfillmentId)) && (value.fulfillmentStatus === void 0 || typeof value.fulfillmentStatus === "string") && (value.shippedAt === void 0 || typeof value.shippedAt === "string") && (value.returnId === void 0 || isStringOrNumber(value.returnId)) && (value.returnStatus === void 0 || typeof value.returnStatus === "string") && (value.refundAmount === void 0 || typeof value.refundAmount === "number") && (value.completedAt === void 0 || typeof value.completedAt === "string");
|
|
199
|
+
return (value.orderId === void 0 || isStringOrNumber(value.orderId)) && (value.orderNumber === void 0 || typeof value.orderNumber === "string") && (value.status === void 0 || typeof value.status === "string") && (value.totalAmount === void 0 || typeof value.totalAmount === "number") && (value.currency === void 0 || typeof value.currency === "string") && (value.fulfillmentId === void 0 || isStringOrNumber(value.fulfillmentId)) && (value.fulfillmentStatus === void 0 || typeof value.fulfillmentStatus === "string") && (value.shippedAt === void 0 || typeof value.shippedAt === "string") && (value.returnId === void 0 || isStringOrNumber(value.returnId)) && (value.returnStatus === void 0 || typeof value.returnStatus === "string") && (value.refundAmount === void 0 || typeof value.refundAmount === "number") && (value.completedAt === void 0 || typeof value.completedAt === "string") && (value.paymentSessionId === void 0 || typeof value.paymentSessionId === "string") && (value.checkoutId === void 0 || typeof value.checkoutId === "string") && (value.refundAttemptId === void 0 || typeof value.refundAttemptId === "string") && (value.reason === void 0 || typeof value.reason === "string") && (value.observedAt === void 0 || typeof value.observedAt === "string") && (value.providerObject === void 0 || isRecord(value.providerObject) && typeof value.providerObject.provider === "string" && (value.providerObject.kind === "payment" || value.providerObject.kind === "refund") && typeof value.providerObject.id === "string") && (value.money === void 0 || isRecord(value.money) && Number.isSafeInteger(value.money.amountMinor) && Number(value.money.amountMinor) > 0 && typeof value.money.currency === "string");
|
|
100
200
|
}
|
|
101
201
|
function isCommerceNotification(value) {
|
|
102
202
|
if (!isRecord(value)) return false;
|
|
103
|
-
return isCommerceNotificationEventName(value.event) && typeof value.intentId === "string" && value.intentId.length > 0 && typeof value.dedupeKey === "string" && value.dedupeKey.length > 0 && (value.orderId === void 0 || typeof value.orderId === "string") && (value.fulfillmentId === void 0 || typeof value.fulfillmentId === "string") && (value.returnId === void 0 || typeof value.returnId === "string");
|
|
203
|
+
return isCommerceNotificationEventName(value.event) && typeof value.intentId === "string" && value.intentId.length > 0 && typeof value.dedupeKey === "string" && value.dedupeKey.length > 0 && (value.orderId === void 0 || typeof value.orderId === "string") && (value.fulfillmentId === void 0 || typeof value.fulfillmentId === "string") && (value.returnId === void 0 || typeof value.returnId === "string") && (value.paymentSessionId === void 0 || typeof value.paymentSessionId === "string") && (value.refundAttemptId === void 0 || typeof value.refundAttemptId === "string");
|
|
204
|
+
}
|
|
205
|
+
function isPaymentIncidentNotificationData(value, event) {
|
|
206
|
+
const reconciliation = event === "paymentReconciliationRequired";
|
|
207
|
+
const expectedCollection = reconciliation ? "payment-sessions" : "payment-refund-attempts";
|
|
208
|
+
const expectedStatus = reconciliation ? "reconciliation_required" : "requires_attention";
|
|
209
|
+
const expectedReason = reconciliation ? "orderless_capture" : "local_commit_ambiguous";
|
|
210
|
+
return value.source?.collection === expectedCollection && typeof value.source.id === "string" && value.source.id.length > 0 && typeof value.paymentSessionId === "string" && value.paymentSessionId.length > 0 && isRecord(value.providerObject) && typeof value.providerObject.provider === "string" && value.providerObject.provider.length > 0 && (value.providerObject.kind === "payment" || value.providerObject.kind === "refund") && typeof value.providerObject.id === "string" && value.providerObject.id.length > 0 && isRecord(value.money) && Number.isSafeInteger(value.money.amountMinor) && Number(value.money.amountMinor) > 0 && typeof value.money.currency === "string" && value.money.currency.length > 0 && value.status === expectedStatus && value.reason === expectedReason && typeof value.observedAt === "string" && value.observedAt.length > 0 && !Number.isNaN(Date.parse(value.observedAt)) && (value.checkoutId === void 0 || typeof value.checkoutId === "string" && value.checkoutId.length > 0) && (value.orderId === void 0 || typeof value.orderId === "string" && value.orderId.length > 0) && (reconciliation ? value.source.id === value.paymentSessionId && value.providerObject.kind === "payment" && value.refundAttemptId === void 0 : typeof value.refundAttemptId === "string" && value.refundAttemptId.length > 0 && value.source.id === value.refundAttemptId);
|
|
104
211
|
}
|
|
105
212
|
function isWebhookCommerceNotificationChange(value) {
|
|
106
213
|
if (!isRecord(value)) return false;
|
|
@@ -141,6 +248,15 @@ function isCommerceNotificationWebhookEvent(event) {
|
|
|
141
248
|
if (!matchesOptionalId(change.sourceId, sourceId)) return false;
|
|
142
249
|
}
|
|
143
250
|
const changeSourceId = isWebhookCommerceNotificationChange(change) ? change.sourceId : void 0;
|
|
251
|
+
if (notification.event === "paymentReconciliationRequired" || notification.event === "paymentRefundRequiresAttention") {
|
|
252
|
+
if (!isPaymentIncidentNotificationData(data, notification.event)) {
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
const incidentData = data;
|
|
256
|
+
const expectedCollection = notification.event === "paymentReconciliationRequired" ? "payment-sessions" : "payment-refund-attempts";
|
|
257
|
+
const notificationSourceId = notification.event === "paymentReconciliationRequired" ? notification.paymentSessionId : notification.refundAttemptId;
|
|
258
|
+
return sourceCollection === expectedCollection && typeof notification.paymentSessionId === "string" && notification.paymentSessionId === incidentData.paymentSessionId && typeof notificationSourceId === "string" && notificationSourceId === incidentData.source.id && matchesOptionalId(changeSourceId, incidentData.source.id);
|
|
259
|
+
}
|
|
144
260
|
if (notification.event === "orderPaid" || notification.event === "orderCanceled" || notification.event === "orderDelivered") {
|
|
145
261
|
return sourceCollection === "orders" && typeof notification.orderId === "string" && notification.orderId.length > 0 && matchesOptionalId(data.orderId, sourceId) && matchesOptionalId(notification.orderId, sourceId) && matchesOptionalId(data.orderId, notification.orderId) && matchesOptionalId(changeSourceId, data.orderId ?? notification.orderId);
|
|
146
262
|
}
|
|
@@ -209,80 +325,8 @@ function createCustomerAuthWebhookHandler(handlers) {
|
|
|
209
325
|
await handlers.unhandled?.(event);
|
|
210
326
|
};
|
|
211
327
|
}
|
|
212
|
-
async function verifySignature(payload, secret, signature, timestamp, deliveryId) {
|
|
213
|
-
const encoder = new TextEncoder();
|
|
214
|
-
const key = await crypto.subtle.importKey(
|
|
215
|
-
"raw",
|
|
216
|
-
encoder.encode(secret),
|
|
217
|
-
{ name: "HMAC", hash: "SHA-256" },
|
|
218
|
-
false,
|
|
219
|
-
["verify"]
|
|
220
|
-
);
|
|
221
|
-
if (signature.length % 2 !== 0 || !/^[0-9a-fA-F]*$/.test(signature)) {
|
|
222
|
-
return false;
|
|
223
|
-
}
|
|
224
|
-
const sigBytes = new Uint8Array(
|
|
225
|
-
(signature.match(/.{2}/g) ?? []).map((byte) => parseInt(byte, 16))
|
|
226
|
-
);
|
|
227
|
-
return crypto.subtle.verify(
|
|
228
|
-
"HMAC",
|
|
229
|
-
key,
|
|
230
|
-
sigBytes,
|
|
231
|
-
encoder.encode(`${timestamp}.${deliveryId}.${payload}`)
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
function timestampIsFresh(timestamp, toleranceSeconds) {
|
|
235
|
-
if (!/^\d+$/.test(timestamp)) return false;
|
|
236
|
-
const timestampMs = Number(timestamp);
|
|
237
|
-
if (!Number.isFinite(timestampMs)) return false;
|
|
238
|
-
const skewMs = Math.abs(Date.now() - timestampMs);
|
|
239
|
-
return skewMs <= toleranceSeconds * 1e3;
|
|
240
|
-
}
|
|
241
328
|
async function handleWebhook(request, handler, options) {
|
|
242
|
-
|
|
243
|
-
const rawBody = await request.text();
|
|
244
|
-
if (options?.secret) {
|
|
245
|
-
const signature = request.headers.get("x-webhook-signature") || "";
|
|
246
|
-
const timestamp = request.headers.get("x-webhook-timestamp") || "";
|
|
247
|
-
const deliveryId = request.headers.get("x-webhook-delivery-id") || "";
|
|
248
|
-
const toleranceSeconds = options.toleranceSeconds ?? 300;
|
|
249
|
-
const valid = Boolean(timestamp && deliveryId) && timestampIsFresh(timestamp, toleranceSeconds) && await verifySignature(
|
|
250
|
-
rawBody,
|
|
251
|
-
options.secret,
|
|
252
|
-
signature,
|
|
253
|
-
timestamp,
|
|
254
|
-
deliveryId
|
|
255
|
-
);
|
|
256
|
-
if (!valid) {
|
|
257
|
-
return new Response(
|
|
258
|
-
JSON.stringify({ error: "Invalid webhook signature" }),
|
|
259
|
-
{ status: 401, headers: { "Content-Type": "application/json" } }
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
} else {
|
|
263
|
-
console.warn(
|
|
264
|
-
"[@01.software/sdk] Webhook signature verification is disabled. Set { secret } in handleWebhook() options to enable HMAC-SHA256 verification."
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
const body = JSON.parse(rawBody);
|
|
268
|
-
if (!isValidWebhookEvent(body)) {
|
|
269
|
-
return new Response(
|
|
270
|
-
JSON.stringify({ error: "Invalid webhook event format" }),
|
|
271
|
-
{ status: 400, headers: { "Content-Type": "application/json" } }
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
await handler(body);
|
|
275
|
-
return new Response(
|
|
276
|
-
JSON.stringify({ success: true, message: "Webhook processed" }),
|
|
277
|
-
{ status: 200, headers: { "Content-Type": "application/json" } }
|
|
278
|
-
);
|
|
279
|
-
} catch (error) {
|
|
280
|
-
console.error("Webhook processing error:", error);
|
|
281
|
-
return new Response(JSON.stringify({ error: "Internal server error" }), {
|
|
282
|
-
status: 500,
|
|
283
|
-
headers: { "Content-Type": "application/json" }
|
|
284
|
-
});
|
|
285
|
-
}
|
|
329
|
+
return handleSignedWebhook(request, handler, options);
|
|
286
330
|
}
|
|
287
331
|
function createTypedWebhookHandler(collection, handler) {
|
|
288
332
|
return async (event) => {
|