@sayren/storefront-sdk 0.11.1 → 0.12.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/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.mjs +1 -1
- package/dist/{client-Do4cw2Ez.mjs → client-DkyvDLXK.mjs} +9 -2
- package/dist/{http-CeRVoUGu.d.mts → http-1ab7tP4-.d.mts} +5 -1
- package/dist/{index-OqvbJ6Xi.d.mts → index-SXEtj3N5.d.mts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/payments/index.d.mts +1 -1
- package/package.json +1 -1
- package/src/http.ts +16 -1
package/dist/auth/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AnonymousSession, d as MemberIdentities, f as SignupRequest, g as WithdrawalBlockedDetails, h as WithdrawRequest, m as TokenPair, p as SocialProvider, t as ApiError, u as LoginRequest } from "../http-
|
|
1
|
+
import { a as AnonymousSession, d as MemberIdentities, f as SignupRequest, g as WithdrawalBlockedDetails, h as WithdrawRequest, m as TokenPair, p as SocialProvider, t as ApiError, u as LoginRequest } from "../http-1ab7tP4-.mjs";
|
|
2
2
|
//#region src/auth/index.d.ts
|
|
3
3
|
/** 소셜 로그인 시작 결과 — `codeVerifier`와 `state`는 돌아올 때까지 서버 세션(httpOnly 쿠키 등)에 보관한다 */
|
|
4
4
|
export interface IdpStart {
|
package/dist/auth/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pt as ApiError, t as createStorefrontClient } from "../client-
|
|
1
|
+
import { pt as ApiError, t as createStorefrontClient } from "../client-DkyvDLXK.mjs";
|
|
2
2
|
//#region src/auth/index.ts
|
|
3
3
|
/** 소셜 로그인 실패 — 구매자가 취소했거나(`access_denied`) state가 맞지 않는다 */
|
|
4
4
|
var IdpCallbackError = class extends Error {
|
|
@@ -8,6 +8,11 @@ const errorDetailSchema = z.object({
|
|
|
8
8
|
message: z.string(),
|
|
9
9
|
traceId: z.string().optional(),
|
|
10
10
|
/**
|
|
11
|
+
* 이 에러 코드를 설명하는 문서 URL(선택). 서버가 코드별 매핑을 가진 코드에만 실린다 —
|
|
12
|
+
* 없으면 필드가 아예 없으므로 소비측은 있을 때만 쓴다
|
|
13
|
+
*/
|
|
14
|
+
docs: z.url().optional().catch(void 0),
|
|
15
|
+
/**
|
|
11
16
|
* 에러 코드별 보조 데이터(선택). 예: 관리 API `LIVE_GATE_NOT_MET`·`LIVE_PAYMENTS_DISABLED`의
|
|
12
17
|
* `{ conditions: LiveGateCondition[] }`. 형태는 에러 코드마다 다르므로 소비측이 코드별 스키마로 다시 파싱한다
|
|
13
18
|
*/
|
|
@@ -38,13 +43,15 @@ var ApiError = class extends Error {
|
|
|
38
43
|
traceId;
|
|
39
44
|
body;
|
|
40
45
|
details;
|
|
41
|
-
|
|
46
|
+
docs;
|
|
47
|
+
constructor(status, code, message, traceId, body, details, docs) {
|
|
42
48
|
super(message);
|
|
43
49
|
this.status = status;
|
|
44
50
|
this.code = code;
|
|
45
51
|
this.traceId = traceId;
|
|
46
52
|
this.body = body;
|
|
47
53
|
this.details = details;
|
|
54
|
+
this.docs = docs;
|
|
48
55
|
this.name = "ApiError";
|
|
49
56
|
}
|
|
50
57
|
};
|
|
@@ -56,7 +63,7 @@ var ApiError = class extends Error {
|
|
|
56
63
|
function toApiError(status, raw) {
|
|
57
64
|
const envelope = envelopeSchema.safeParse(raw);
|
|
58
65
|
const detail = envelope.success ? envelope.data.error : errorDetailSchema.safeParse(raw).data ?? null;
|
|
59
|
-
if (detail) return new ApiError(status, detail.code, detail.message, detail.traceId, raw, detail.details);
|
|
66
|
+
if (detail) return new ApiError(status, detail.code, detail.message, detail.traceId, raw, detail.details, detail.docs);
|
|
60
67
|
return new ApiError(status, "UNKNOWN", `HTTP ${status}`, void 0, raw);
|
|
61
68
|
}
|
|
62
69
|
/**
|
|
@@ -123,9 +123,13 @@ declare class ApiError extends Error {
|
|
|
123
123
|
readonly body?: unknown | undefined;
|
|
124
124
|
/** 엔벨로프 `$.error.details` — 에러 코드별 보조 데이터. 없으면 undefined */
|
|
125
125
|
readonly details?: Record<string, unknown> | undefined;
|
|
126
|
+
/** 엔벨로프 `$.error.docs` — 이 에러 코드를 설명하는 문서 URL. 매핑이 없으면 undefined */
|
|
127
|
+
readonly docs?: string | undefined;
|
|
126
128
|
constructor(status: number, code: string, message: string, traceId?: string | undefined, body?: unknown | undefined,
|
|
127
129
|
/** 엔벨로프 `$.error.details` — 에러 코드별 보조 데이터. 없으면 undefined */
|
|
128
|
-
details?: Record<string, unknown> | undefined
|
|
130
|
+
details?: Record<string, unknown> | undefined,
|
|
131
|
+
/** 엔벨로프 `$.error.docs` — 이 에러 코드를 설명하는 문서 URL. 매핑이 없으면 undefined */
|
|
132
|
+
docs?: string | undefined);
|
|
129
133
|
}
|
|
130
134
|
type TokenSource = string | null | undefined | (() => string | null | undefined);
|
|
131
135
|
type Query = Record<string, string | number | boolean | undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as IdpTokenRequest, f as SignupRequest, h as WithdrawRequest, l as LinkIdentityRequest, p as SocialProvider, r as TokenSource, s as IdpAuthorizeRequest, u as LoginRequest } from "./http-
|
|
1
|
+
import { c as IdpTokenRequest, f as SignupRequest, h as WithdrawRequest, l as LinkIdentityRequest, p as SocialProvider, r as TokenSource, s as IdpAuthorizeRequest, u as LoginRequest } from "./http-1ab7tP4-.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/analytics-ids.d.ts
|
|
4
4
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as loginRequestSchema, D as tokenPairSchema, E as socialProviderSchema, O as withdrawRequestSchema, S as linkIdentityRequestSchema, T as signupRequestSchema, _ as anonymousSessionSchema, a as AnonymousSession, b as idpAuthorizeResponseSchema, c as IdpTokenRequest, d as MemberIdentities, f as SignupRequest, g as WithdrawalBlockedDetails, h as WithdrawRequest, i as buildQuery, k as withdrawalBlockedDetailsSchema, l as LinkIdentityRequest, m as TokenPair, n as Query, o as IdpAgreements, p as SocialProvider, r as TokenSource, s as IdpAuthorizeRequest, t as ApiError, u as LoginRequest, v as idpAgreementsSchema, w as memberIdentitiesSchema, x as idpTokenRequestSchema, y as idpAuthorizeRequestSchema } from "./http-
|
|
2
|
-
import { $ as Member, $n as productCardSchema, $t as DeliveryQuoteRequest, A as StorefrontClientOptions, An as guestInfoSchema, At as consentStateSchema, B as ReviewPage, Bn as remoteAreaSchema, Bt as claimReturnAddressSchema, C as AnalyticsServerEventName, Cn as checkoutDeliverySchema, Ct as ConsentSource, D as analyticsIdSchema, Dn as deliveryQuoteSchema, Dt as consentActionSchema, E as analyticsClientEventSchema, En as deliveryQuoteRequestSchema, Et as MemberConsents, F as StorefrontSessionOptions, Fn as paymentOptionListSchema, Ft as ClaimType, G as createReviewRequestSchema, Gn as CategoryNode, Gt as AvailablePaymentOption, H as UpdateReviewRequest, Hn as retryPaymentRequestSchema, Ht as createClaimRequestSchema, I as createStorefrontSession, In as paymentOptionSchema, It as CreateClaimRequest, J as reviewPageSchema, Jn as ProductFacets, Jt as CashReceiptRequest, K as createReviewResultSchema, Kn as ProductCard, Kt as CASH_RECEIPT_METHODS, L as CreateReviewRequest, Ln as paymentStartSchema, Lt as CreateClaimResult, M as STOREFRONT_SESSION_KEYS, Mn as paymentMessageSchema, Mt as memberConsentsSchema, N as SessionStorage, Nn as paymentMethodSchema, Nt as ClaimReason, O as analyticsServerEventNameSchema, On as easyPayProviderResponseSchema, Ot as consentKindSchema, P as StorefrontSession, Pn as paymentOptionKey, Pt as ClaimReturnAddress, Q as writableReviewSchema, Qn as categoryNodeSchema, Qt as CreateCheckoutRequest, R as CreateReviewResult, Rn as paymentStatusSchema, Rt as MyClaim, S as AnalyticsEventName, Sn as cashReceiptTypeSchema, St as ConsentKind, T as analyticsClientEventNameSchema, Tn as createCheckoutRequestSchema, Tt as ConsentUpdateRequest, U as UpdateReviewResult, Un as shippingAddressInputSchema, Ut as createClaimResultSchema, V as ReviewSummary, Vn as residentNumberLike, Vt as claimTypeSchema, W as WritableReview, Wn as startPaymentRequestSchema, Wt as myClaimSchema, X as updateReviewRequestSchema, Xn as ProductSearchParams, Xt as CheckoutDelivery, Y as reviewSummarySchema, Yn as ProductPage, Yt as CashReceiptType, Z as updateReviewResultSchema, Zn as ProductSort, Zt as CheckoutSession, _ as ANALYTICS_VISITOR_COOKIE, _n as StartPaymentRequest, _r as cartItemSchema, _t as CustomerInquiryCategory, a as MyOrderItem, an as PAYMENT_RESULT_VALUES, ar as OrderItemStatus, at as memberAddressSchema, b as AnalyticsClientEvent, bn as cashReceiptIdentityTypeOf, br as analyticsIdsFromCookie, bt as customerInquirySchema, c as deliveryTrackingSchema, cn as PaymentMessage, cr as claimStatusSchema, ct as wishlistAddResultSchema, d as orderShippingAddressSchema, dn as PaymentStart, dr as pageSchema, dt as PublicInquiry, en as DeliveryQuoteResult, er as productDetailSchema, et as MemberAddress, f as purchaseDecisionResultSchema, fn as PaymentStatus, fr as AddCartItemRequest, ft as createInquiryRequestSchema, g as ANALYTICS_SESSION_HEADER, gn as ShippingAddressInput, gr as addCartItemRequestSchema, gt as CustomerInquiry, h as ANALYTICS_SESSION_COOKIE, hn as RetryPaymentRequest, hr as UpdateCartItemRequest, ht as CreateCustomerInquiryRequest, i as MyOrder, in as KnownPaymentStatus, ir as ClaimStatus, it as memberAddressRequestSchema, j as createStorefrontClient, jn as paymentFailureCategorySchema, jt as consentUpdateRequestSchema, k as StorefrontClient, kn as easyPayProviderSchema, kt as consentSourceSchema, l as myOrderItemSchema, ln as PaymentMethod, lr as orderItemStatusSchema, lt as CreateInquiryRequest, m as ANALYTICS_MAX_BATCH_BYTES, mn as RemoteArea, mr as CartItem, mt as publicInquirySchema, n as storefrontStoreSchema, nn as GuestInfo, nr as productPageSchema, nt as UpdateProfileRequest, o as OrderShippingAddress, on as PAYMENT_STATUS_VALUES, or as PageInfo, ot as memberSchema, p as trackingStageResponseSchema, pn as PgProvider, pr as Cart, pt as createInquiryResultSchema, q as publicReviewSchema, qn as ProductDetail, qt as CashReceiptIdentityType, r as DeliveryTracking, rn as KnownPaymentResult, rr as productSortSchema, rt as WishlistAddResult, s as PurchaseDecisionResult, sn as PaymentFailureCategory, sr as PageParams, st as updateProfileRequestSchema, t as StorefrontStore, tn as EasyPayProvider, tr as productFacetsSchema, tt as MemberAddressRequest, u as myOrderSchema, un as PaymentOption, ur as pageInfoSchema, ut as CreateInquiryResult, v as ANALYTICS_VISITOR_HEADER, vn as availablePaymentOptionSchema, vr as cartSchema, vt as createCustomerInquiryRequestSchema, w as analyticsBatchSchema, wn as checkoutSessionSchema, wt as ConsentState, x as AnalyticsClientEventName, xn as cashReceiptRequestSchema, xt as ConsentAction, y as AnalyticsBatch, yn as cashReceiptAvailable, yr as updateCartItemRequestSchema, yt as customerInquiryCategorySchema, z as PublicReview, zn as pgProviderSchema, zt as claimReasonSchema } from "./index-
|
|
1
|
+
import { C as loginRequestSchema, D as tokenPairSchema, E as socialProviderSchema, O as withdrawRequestSchema, S as linkIdentityRequestSchema, T as signupRequestSchema, _ as anonymousSessionSchema, a as AnonymousSession, b as idpAuthorizeResponseSchema, c as IdpTokenRequest, d as MemberIdentities, f as SignupRequest, g as WithdrawalBlockedDetails, h as WithdrawRequest, i as buildQuery, k as withdrawalBlockedDetailsSchema, l as LinkIdentityRequest, m as TokenPair, n as Query, o as IdpAgreements, p as SocialProvider, r as TokenSource, s as IdpAuthorizeRequest, t as ApiError, u as LoginRequest, v as idpAgreementsSchema, w as memberIdentitiesSchema, x as idpTokenRequestSchema, y as idpAuthorizeRequestSchema } from "./http-1ab7tP4-.mjs";
|
|
2
|
+
import { $ as Member, $n as productCardSchema, $t as DeliveryQuoteRequest, A as StorefrontClientOptions, An as guestInfoSchema, At as consentStateSchema, B as ReviewPage, Bn as remoteAreaSchema, Bt as claimReturnAddressSchema, C as AnalyticsServerEventName, Cn as checkoutDeliverySchema, Ct as ConsentSource, D as analyticsIdSchema, Dn as deliveryQuoteSchema, Dt as consentActionSchema, E as analyticsClientEventSchema, En as deliveryQuoteRequestSchema, Et as MemberConsents, F as StorefrontSessionOptions, Fn as paymentOptionListSchema, Ft as ClaimType, G as createReviewRequestSchema, Gn as CategoryNode, Gt as AvailablePaymentOption, H as UpdateReviewRequest, Hn as retryPaymentRequestSchema, Ht as createClaimRequestSchema, I as createStorefrontSession, In as paymentOptionSchema, It as CreateClaimRequest, J as reviewPageSchema, Jn as ProductFacets, Jt as CashReceiptRequest, K as createReviewResultSchema, Kn as ProductCard, Kt as CASH_RECEIPT_METHODS, L as CreateReviewRequest, Ln as paymentStartSchema, Lt as CreateClaimResult, M as STOREFRONT_SESSION_KEYS, Mn as paymentMessageSchema, Mt as memberConsentsSchema, N as SessionStorage, Nn as paymentMethodSchema, Nt as ClaimReason, O as analyticsServerEventNameSchema, On as easyPayProviderResponseSchema, Ot as consentKindSchema, P as StorefrontSession, Pn as paymentOptionKey, Pt as ClaimReturnAddress, Q as writableReviewSchema, Qn as categoryNodeSchema, Qt as CreateCheckoutRequest, R as CreateReviewResult, Rn as paymentStatusSchema, Rt as MyClaim, S as AnalyticsEventName, Sn as cashReceiptTypeSchema, St as ConsentKind, T as analyticsClientEventNameSchema, Tn as createCheckoutRequestSchema, Tt as ConsentUpdateRequest, U as UpdateReviewResult, Un as shippingAddressInputSchema, Ut as createClaimResultSchema, V as ReviewSummary, Vn as residentNumberLike, Vt as claimTypeSchema, W as WritableReview, Wn as startPaymentRequestSchema, Wt as myClaimSchema, X as updateReviewRequestSchema, Xn as ProductSearchParams, Xt as CheckoutDelivery, Y as reviewSummarySchema, Yn as ProductPage, Yt as CashReceiptType, Z as updateReviewResultSchema, Zn as ProductSort, Zt as CheckoutSession, _ as ANALYTICS_VISITOR_COOKIE, _n as StartPaymentRequest, _r as cartItemSchema, _t as CustomerInquiryCategory, a as MyOrderItem, an as PAYMENT_RESULT_VALUES, ar as OrderItemStatus, at as memberAddressSchema, b as AnalyticsClientEvent, bn as cashReceiptIdentityTypeOf, br as analyticsIdsFromCookie, bt as customerInquirySchema, c as deliveryTrackingSchema, cn as PaymentMessage, cr as claimStatusSchema, ct as wishlistAddResultSchema, d as orderShippingAddressSchema, dn as PaymentStart, dr as pageSchema, dt as PublicInquiry, en as DeliveryQuoteResult, er as productDetailSchema, et as MemberAddress, f as purchaseDecisionResultSchema, fn as PaymentStatus, fr as AddCartItemRequest, ft as createInquiryRequestSchema, g as ANALYTICS_SESSION_HEADER, gn as ShippingAddressInput, gr as addCartItemRequestSchema, gt as CustomerInquiry, h as ANALYTICS_SESSION_COOKIE, hn as RetryPaymentRequest, hr as UpdateCartItemRequest, ht as CreateCustomerInquiryRequest, i as MyOrder, in as KnownPaymentStatus, ir as ClaimStatus, it as memberAddressRequestSchema, j as createStorefrontClient, jn as paymentFailureCategorySchema, jt as consentUpdateRequestSchema, k as StorefrontClient, kn as easyPayProviderSchema, kt as consentSourceSchema, l as myOrderItemSchema, ln as PaymentMethod, lr as orderItemStatusSchema, lt as CreateInquiryRequest, m as ANALYTICS_MAX_BATCH_BYTES, mn as RemoteArea, mr as CartItem, mt as publicInquirySchema, n as storefrontStoreSchema, nn as GuestInfo, nr as productPageSchema, nt as UpdateProfileRequest, o as OrderShippingAddress, on as PAYMENT_STATUS_VALUES, or as PageInfo, ot as memberSchema, p as trackingStageResponseSchema, pn as PgProvider, pr as Cart, pt as createInquiryResultSchema, q as publicReviewSchema, qn as ProductDetail, qt as CashReceiptIdentityType, r as DeliveryTracking, rn as KnownPaymentResult, rr as productSortSchema, rt as WishlistAddResult, s as PurchaseDecisionResult, sn as PaymentFailureCategory, sr as PageParams, st as updateProfileRequestSchema, t as StorefrontStore, tn as EasyPayProvider, tr as productFacetsSchema, tt as MemberAddressRequest, u as myOrderSchema, un as PaymentOption, ur as pageInfoSchema, ut as CreateInquiryResult, v as ANALYTICS_VISITOR_HEADER, vn as availablePaymentOptionSchema, vr as cartSchema, vt as createCustomerInquiryRequestSchema, w as analyticsBatchSchema, wn as checkoutSessionSchema, wt as ConsentState, x as AnalyticsClientEventName, xn as cashReceiptRequestSchema, xt as ConsentAction, y as AnalyticsBatch, yn as cashReceiptAvailable, yr as updateCartItemRequestSchema, yt as customerInquiryCategorySchema, z as PublicReview, zn as pgProviderSchema, zt as claimReasonSchema } from "./index-SXEtj3N5.mjs";
|
|
3
3
|
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, AddCartItemRequest, AnalyticsBatch, AnalyticsClientEvent, AnalyticsClientEventName, AnalyticsEventName, AnalyticsServerEventName, AnonymousSession, ApiError, AvailablePaymentOption, CASH_RECEIPT_METHODS, Cart, CartItem, CashReceiptIdentityType, CashReceiptRequest, CashReceiptType, CategoryNode, CheckoutDelivery, CheckoutSession, ClaimReason, ClaimReturnAddress, ClaimStatus, ClaimType, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStatus, LinkIdentityRequest, LoginRequest, Member, MemberAddress, MemberAddressRequest, MemberConsents, MemberIdentities, MyClaim, MyOrder, MyOrderItem, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, ProductCard, ProductDetail, ProductFacets, ProductPage, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RemoteArea, RetryPaymentRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, type StorefrontClient, type StorefrontClientOptions, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as ANALYTICS_VISITOR_HEADER, c as analyticsClientEventSchema, i as ANALYTICS_VISITOR_COOKIE, l as analyticsIdSchema, n as ANALYTICS_SESSION_COOKIE, o as analyticsBatchSchema, r as ANALYTICS_SESSION_HEADER, s as analyticsClientEventNameSchema, t as ANALYTICS_MAX_BATCH_BYTES, u as analyticsServerEventNameSchema } from "./analytics-CgD70OqH.mjs";
|
|
2
2
|
import { t as analyticsIdsFromCookie } from "./analytics-ids-COElZiI3.mjs";
|
|
3
|
-
import { $ as updateCartItemRequestSchema, A as consentSourceSchema, B as categoryNodeSchema, C as createInquiryResultSchema, D as customerInquirySchema, E as customerInquiryCategorySchema, F as claimReturnAddressSchema, G as productSortSchema, H as productDetailSchema, I as claimTypeSchema, J as pageInfoSchema, K as claimStatusSchema, L as createClaimRequestSchema, M as consentUpdateRequestSchema, N as memberConsentsSchema, O as consentActionSchema, P as claimReasonSchema, Q as cartSchema, R as createClaimResultSchema, S as createInquiryRequestSchema, T as createCustomerInquiryRequestSchema, U as productFacetsSchema, V as productCardSchema, W as productPageSchema, X as addCartItemRequestSchema, Y as pageSchema, Z as cartItemSchema, _ as memberAddressRequestSchema, a as publicReviewSchema, at as linkIdentityRequestSchema, b as updateProfileRequestSchema, c as updateReviewRequestSchema, ct as signupRequestSchema, d as deliveryTrackingSchema, dt as withdrawRequestSchema, et as anonymousSessionSchema, f as myOrderItemSchema, ft as withdrawalBlockedDetailsSchema, g as trackingStageResponseSchema, gt as unwrapData, h as purchaseDecisionResultSchema, ht as toApiError, i as createReviewResultSchema, it as idpTokenRequestSchema, j as consentStateSchema, k as consentKindSchema, l as updateReviewResultSchema, lt as socialProviderSchema, m as orderShippingAddressSchema, mt as buildQuery, n as storefrontStoreSchema, nt as idpAuthorizeRequestSchema, o as reviewPageSchema, ot as loginRequestSchema, p as myOrderSchema, pt as ApiError, q as orderItemStatusSchema, r as createReviewRequestSchema, rt as idpAuthorizeResponseSchema, s as reviewSummarySchema, st as memberIdentitiesSchema, t as createStorefrontClient, tt as idpAgreementsSchema, u as writableReviewSchema, ut as tokenPairSchema, v as memberAddressSchema, w as publicInquirySchema, x as wishlistAddResultSchema, y as memberSchema, z as myClaimSchema } from "./client-
|
|
3
|
+
import { $ as updateCartItemRequestSchema, A as consentSourceSchema, B as categoryNodeSchema, C as createInquiryResultSchema, D as customerInquirySchema, E as customerInquiryCategorySchema, F as claimReturnAddressSchema, G as productSortSchema, H as productDetailSchema, I as claimTypeSchema, J as pageInfoSchema, K as claimStatusSchema, L as createClaimRequestSchema, M as consentUpdateRequestSchema, N as memberConsentsSchema, O as consentActionSchema, P as claimReasonSchema, Q as cartSchema, R as createClaimResultSchema, S as createInquiryRequestSchema, T as createCustomerInquiryRequestSchema, U as productFacetsSchema, V as productCardSchema, W as productPageSchema, X as addCartItemRequestSchema, Y as pageSchema, Z as cartItemSchema, _ as memberAddressRequestSchema, a as publicReviewSchema, at as linkIdentityRequestSchema, b as updateProfileRequestSchema, c as updateReviewRequestSchema, ct as signupRequestSchema, d as deliveryTrackingSchema, dt as withdrawRequestSchema, et as anonymousSessionSchema, f as myOrderItemSchema, ft as withdrawalBlockedDetailsSchema, g as trackingStageResponseSchema, gt as unwrapData, h as purchaseDecisionResultSchema, ht as toApiError, i as createReviewResultSchema, it as idpTokenRequestSchema, j as consentStateSchema, k as consentKindSchema, l as updateReviewResultSchema, lt as socialProviderSchema, m as orderShippingAddressSchema, mt as buildQuery, n as storefrontStoreSchema, nt as idpAuthorizeRequestSchema, o as reviewPageSchema, ot as loginRequestSchema, p as myOrderSchema, pt as ApiError, q as orderItemStatusSchema, r as createReviewRequestSchema, rt as idpAuthorizeResponseSchema, s as reviewSummarySchema, st as memberIdentitiesSchema, t as createStorefrontClient, tt as idpAgreementsSchema, u as writableReviewSchema, ut as tokenPairSchema, v as memberAddressSchema, w as publicInquirySchema, x as wishlistAddResultSchema, y as memberSchema, z as myClaimSchema } from "./client-DkyvDLXK.mjs";
|
|
4
4
|
import { A as startPaymentRequestSchema, C as paymentStartSchema, D as residentNumberLike, E as remoteAreaSchema, O as retryPaymentRequestSchema, S as paymentOptionSchema, T as pgProviderSchema, _ as paymentFailureCategorySchema, a as cashReceiptAvailable, b as paymentOptionKey, c as cashReceiptTypeSchema, d as createCheckoutRequestSchema, f as deliveryQuoteRequestSchema, g as guestInfoSchema, h as easyPayProviderSchema, i as availablePaymentOptionSchema, k as shippingAddressInputSchema, l as checkoutDeliverySchema, m as easyPayProviderResponseSchema, n as PAYMENT_RESULT_VALUES, o as cashReceiptIdentityTypeOf, p as deliveryQuoteSchema, r as PAYMENT_STATUS_VALUES, s as cashReceiptRequestSchema, t as CASH_RECEIPT_METHODS, u as checkoutSessionSchema, v as paymentMessageSchema, w as paymentStatusSchema, x as paymentOptionListSchema, y as paymentMethodSchema } from "./checkout-BeZKjYJz.mjs";
|
|
5
5
|
//#region src/session.ts
|
|
6
6
|
/** 세션 키 상수 — SDK가 소유한다. store-sdk와 겹치지 않는 별도 네임스페이스. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Jt as CashReceiptRequest, dn as PaymentStart, fn as PaymentStatus, gn as ShippingAddressInput, j as createStorefrontClient, nn as GuestInfo, un as PaymentOption } from "../index-
|
|
1
|
+
import { Jt as CashReceiptRequest, dn as PaymentStart, fn as PaymentStatus, gn as ShippingAddressInput, j as createStorefrontClient, nn as GuestInfo, un as PaymentOption } from "../index-SXEtj3N5.mjs";
|
|
2
2
|
//#region src/payments/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* 스토어프론트 결제 — 브라우저 전용(`@sayren/storefront-sdk/payments`).
|
package/package.json
CHANGED
package/src/http.ts
CHANGED
|
@@ -5,6 +5,11 @@ export const errorDetailSchema = z.object({
|
|
|
5
5
|
code: z.string(),
|
|
6
6
|
message: z.string(),
|
|
7
7
|
traceId: z.string().optional(),
|
|
8
|
+
/**
|
|
9
|
+
* 이 에러 코드를 설명하는 문서 URL(선택). 서버가 코드별 매핑을 가진 코드에만 실린다 —
|
|
10
|
+
* 없으면 필드가 아예 없으므로 소비측은 있을 때만 쓴다
|
|
11
|
+
*/
|
|
12
|
+
docs: z.url().optional().catch(undefined),
|
|
8
13
|
/**
|
|
9
14
|
* 에러 코드별 보조 데이터(선택). 예: 관리 API `LIVE_GATE_NOT_MET`·`LIVE_PAYMENTS_DISABLED`의
|
|
10
15
|
* `{ conditions: LiveGateCondition[] }`. 형태는 에러 코드마다 다르므로 소비측이 코드별 스키마로 다시 파싱한다
|
|
@@ -44,6 +49,8 @@ export class ApiError extends Error {
|
|
|
44
49
|
public readonly body?: unknown,
|
|
45
50
|
/** 엔벨로프 `$.error.details` — 에러 코드별 보조 데이터. 없으면 undefined */
|
|
46
51
|
public readonly details?: Record<string, unknown>,
|
|
52
|
+
/** 엔벨로프 `$.error.docs` — 이 에러 코드를 설명하는 문서 URL. 매핑이 없으면 undefined */
|
|
53
|
+
public readonly docs?: string,
|
|
47
54
|
) {
|
|
48
55
|
super(message);
|
|
49
56
|
this.name = "ApiError";
|
|
@@ -61,7 +68,15 @@ export function toApiError(status: number, raw: unknown): ApiError {
|
|
|
61
68
|
? envelope.data.error
|
|
62
69
|
: (errorDetailSchema.safeParse(raw).data ?? null);
|
|
63
70
|
if (detail) {
|
|
64
|
-
return new ApiError(
|
|
71
|
+
return new ApiError(
|
|
72
|
+
status,
|
|
73
|
+
detail.code,
|
|
74
|
+
detail.message,
|
|
75
|
+
detail.traceId,
|
|
76
|
+
raw,
|
|
77
|
+
detail.details,
|
|
78
|
+
detail.docs,
|
|
79
|
+
);
|
|
65
80
|
}
|
|
66
81
|
return new ApiError(status, "UNKNOWN", `HTTP ${status}`, undefined, raw);
|
|
67
82
|
}
|