@sayren/storefront-sdk 0.8.0 → 0.10.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.
@@ -1,4 +1,4 @@
1
- import { a as AnonymousSession, d as SignupRequest, f as SocialProvider, h as WithdrawalBlockedDetails, l as LoginRequest, m as WithdrawRequest, p as TokenPair, t as ApiError, u as MemberIdentities } from "../http-BbFHVGBf.mjs";
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-CeRVoUGu.mjs";
2
2
  //#region src/auth/index.d.ts
3
3
  /** 소셜 로그인 시작 결과 — `codeVerifier`와 `state`는 돌아올 때까지 서버 세션(httpOnly 쿠키 등)에 보관한다 */
4
4
  export interface IdpStart {
@@ -56,14 +56,23 @@ export declare function createStorefrontAuth(options: StorefrontAuthOptions): {
56
56
  /**
57
57
  * 소셜 로그인 시작 — PKCE(S256)와 state를 만들고 공급자 로그인 주소를 받는다. 반환한 `state`·`codeVerifier`를
58
58
  * 서버 세션에 보관하고 구매자를 `url`로 보낸다. 로그인을 마치면 `redirectUri`로 `?code=&state=`가 붙어 돌아온다.
59
- * `redirectUri`는 스토어프론트 도메인 목록 안이어야 한다
59
+ * `redirectUri`는 스토어프론트 도메인 목록 안이어야 한다.
60
+ *
61
+ * 가입 화면에서 받은 약관 동의는 `agreements`로 함께 보낸다. **이 로그인으로 가입이 되는 경우에만** 이력에
62
+ * 남고(기존 회원의 로그인이면 무시한다), 보내지 않으면 가입은 되지만 필수 동의 이력이 없어
63
+ * `GET /me`의 `reconsentRequired`가 true다(첫 진입에서 `updateConsents()`로 받는다)
60
64
  */
61
65
  idp(provider: SocialProvider, options: {
62
66
  redirectUri: string;
67
+ agreements?: {
68
+ terms: true;
69
+ privacy: true;
70
+ marketing?: boolean;
71
+ };
63
72
  }): Promise<IdpStart>;
64
73
  /**
65
74
  * 소셜 로그인 마무리 — 돌아온 `code`를 구매자 토큰으로 바꾼다. state가 다르거나 구매자가 취소했으면
66
- * `IdpCallbackError`. code는 1회용이고 1분 안에 바꿔야 한다
75
+ * `IdpCallbackError`. code는 1회용이고 1분 안에 바꿔야 한다. 약관 동의는 `idp()`에서 받는다
67
76
  */
68
77
  idpCallback(input: IdpCallbackInput & {
69
78
  error?: string | null;
@@ -1,4 +1,4 @@
1
- import { it as ApiError, t as createStorefrontClient } from "../client-DwqExvZN.mjs";
1
+ import { dt as ApiError, t as createStorefrontClient } from "../client-DEMo7UZc.mjs";
2
2
  //#region src/auth/index.ts
3
3
  /** 소셜 로그인 실패 — 구매자가 취소했거나(`access_denied`) state가 맞지 않는다 */
4
4
  var IdpCallbackError = class extends Error {
@@ -60,7 +60,11 @@ function createStorefrontAuth(options) {
60
60
  /**
61
61
  * 소셜 로그인 시작 — PKCE(S256)와 state를 만들고 공급자 로그인 주소를 받는다. 반환한 `state`·`codeVerifier`를
62
62
  * 서버 세션에 보관하고 구매자를 `url`로 보낸다. 로그인을 마치면 `redirectUri`로 `?code=&state=`가 붙어 돌아온다.
63
- * `redirectUri`는 스토어프론트 도메인 목록 안이어야 한다
63
+ * `redirectUri`는 스토어프론트 도메인 목록 안이어야 한다.
64
+ *
65
+ * 가입 화면에서 받은 약관 동의는 `agreements`로 함께 보낸다. **이 로그인으로 가입이 되는 경우에만** 이력에
66
+ * 남고(기존 회원의 로그인이면 무시한다), 보내지 않으면 가입은 되지만 필수 동의 이력이 없어
67
+ * `GET /me`의 `reconsentRequired`가 true다(첫 진입에서 `updateConsents()`로 받는다)
64
68
  */
65
69
  async idp(provider, options) {
66
70
  const state = randomToken(24);
@@ -68,7 +72,12 @@ function createStorefrontAuth(options) {
68
72
  const { url } = await client().auth.idpAuthorize(provider, {
69
73
  redirectUri: options.redirectUri,
70
74
  codeChallenge: await s256(codeVerifier),
71
- state
75
+ state,
76
+ agreements: options.agreements && {
77
+ terms: true,
78
+ privacy: true,
79
+ marketing: options.agreements.marketing ?? false
80
+ }
72
81
  });
73
82
  return {
74
83
  url,
@@ -78,7 +87,7 @@ function createStorefrontAuth(options) {
78
87
  },
79
88
  /**
80
89
  * 소셜 로그인 마무리 — 돌아온 `code`를 구매자 토큰으로 바꾼다. state가 다르거나 구매자가 취소했으면
81
- * `IdpCallbackError`. code는 1회용이고 1분 안에 바꿔야 한다
90
+ * `IdpCallbackError`. code는 1회용이고 1분 안에 바꿔야 한다. 약관 동의는 `idp()`에서 받는다
82
91
  */
83
92
  idpCallback(input) {
84
93
  if (input.error) return Promise.reject(new IdpCallbackError(input.error));
@@ -177,6 +177,18 @@ const socialProviderSchema = z.enum([
177
177
  "naver",
178
178
  "google"
179
179
  ]);
180
+ /**
181
+ * 소셜 가입 화면에서 받은 필수·선택 동의 — 공급자로 보내기 전에 함께 보낸다.
182
+ *
183
+ * **이 흐름으로 회원이 처음 만들어질 때만 쓴다.** 이미 있는 회원의 로그인이면 무시한다(동의는 늘어나지 않는다).
184
+ * 보내지 않으면 필수 동의 이력이 남지 않아 `GET /me`의 `reconsentRequired`가 true가 되고,
185
+ * 스토어프론트가 첫 진입에서 `POST /me/consents`로 받는다(가입 자체는 거부하지 않는다).
186
+ */
187
+ const idpAgreementsSchema = z.object({
188
+ terms: z.literal(true),
189
+ privacy: z.literal(true),
190
+ marketing: z.boolean().default(false)
191
+ });
180
192
  /** `POST /auth/idp/{provider}/authorize` 본문 — PKCE(S256)와 state는 SDK가 만든다 */
181
193
  const idpAuthorizeRequestSchema = z.object({
182
194
  /** 로그인을 마치고 돌아올 스토어프론트 주소. 스토어프론트 도메인 목록 안이어야 한다 */
@@ -184,7 +196,9 @@ const idpAuthorizeRequestSchema = z.object({
184
196
  /** base64url(SHA-256(codeVerifier)) */
185
197
  codeChallenge: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
186
198
  /** 스토어프론트가 만든 값 — 돌아올 때 그대로 붙어 온다. 세션에 저장해 두고 비교한다 */
187
- state: z.string().min(16).max(128)
199
+ state: z.string().min(16).max(128),
200
+ /** 가입이 되는 경우 남길 동의. 기존 회원 로그인이면 무시한다 */
201
+ agreements: idpAgreementsSchema.optional()
188
202
  });
189
203
  const idpAuthorizeResponseSchema = z.object({
190
204
  /** 구매자를 보낼 공급자 로그인 주소 */
@@ -219,7 +233,7 @@ const cartItemSchema = z.object({
219
233
  cartItemId: z.string(),
220
234
  productId: z.string(),
221
235
  productName: z.string(),
222
- thumbnailUrl: z.url(),
236
+ thumbnailUrl: z.url().nullable().describe("담은 상품의 대표 이미지. 없으면 null"),
223
237
  optionId: z.string().nullable(),
224
238
  optionName: z.string().nullable(),
225
239
  quantity: z.number().int(),
@@ -292,7 +306,7 @@ const categoryNodeSchema = z.lazy(() => z.object({
292
306
  const productCardSchema = z.object({
293
307
  productId: z.string(),
294
308
  name: z.string(),
295
- thumbnailUrl: z.url(),
309
+ thumbnailUrl: z.url().nullable().describe("대표 이미지 주소. 등록된 이미지가 없으면 null"),
296
310
  salePrice: z.number().int().describe("판매가. 원(KRW) 단위 정수"),
297
311
  discountedPrice: z.number().int().nullable().describe("즉시 할인 적용가. 원 단위. 할인이 없으면 null"),
298
312
  discountRate: z.number().int().nullable().describe("할인율(%). 할인이 없으면 null"),
@@ -384,13 +398,16 @@ const createClaimRequestSchema = z.object({
384
398
  reason: claimReasonSchema,
385
399
  reasonDetail: z.string().max(1e3).optional(),
386
400
  evidenceImages: z.array(z.url()).max(5).optional(),
387
- exchangeOptionId: z.string().optional()
401
+ exchangeOptionId: z.string().optional(),
402
+ quantity: z.number().int().min(1).optional().describe("취소·반품·교환할 수량. 생략하면 남은 수량 전체다. 남은 수량보다 크면 400 `INVALID_QUANTITY`")
388
403
  });
389
404
  const createClaimResultSchema = z.object({
390
405
  claimId: z.string(),
391
406
  status: z.literal("REQUESTED"),
392
- expectedRefundAmount: z.number().int().nullable(),
393
- claimDeliveryFee: z.number().int()
407
+ expectedRefundAmount: z.number().int().nullable().describe("예상 환불액 — 수량 비율 상품 금액 − 반품 배송비. **배송비 환불은 여기 포함되지 않고 `deliveryFeeRefundAmount`로 따로 온다**(승인 시점의 배송 묶음 상태로 확정되기 때문이다). 교환은 환불이 없어 null이다"),
408
+ claimDeliveryFee: z.number().int().describe("구매자가 부담하는 반품·교환 배송비. 원 단위"),
409
+ quantity: z.number().int().describe("접수된 수량. 요청에서 생략하면 남은 수량 전체다"),
410
+ deliveryFeeRefundAmount: z.number().int().describe("환불 예정 배송비. 배송 묶음이 모두 취소되거나 판매자 귀책일 때만 0보다 크다")
394
411
  });
395
412
  const myClaimSchema = z.object({
396
413
  claimId: z.string(),
@@ -398,13 +415,76 @@ const myClaimSchema = z.object({
398
415
  status: claimStatusSchema,
399
416
  orderItemId: z.string(),
400
417
  productName: z.string(),
418
+ quantity: z.number().int().describe("접수된 수량"),
401
419
  reason: z.string(),
402
- expectedRefundAmount: z.number().int().nullable(),
420
+ expectedRefundAmount: z.number().int().nullable().describe("예상 환불액 — 수량 비율 상품 금액 − 반품 배송비 − 조건부 무료배송 미달 차감. **배송비 환불은 포함되지 않고 `expectedDeliveryFeeRefundAmount`로 따로 온다.** 교환은 null이다"),
421
+ expectedDeliveryFeeRefundAmount: z.number().int().nullable().describe("예상 배송비 환불액. 배송 묶음이 모두 취소되거나 판매자 귀책일 때만 0보다 크다. 이 필드가 생기기 전에 접수된 클레임은 null이다"),
403
422
  rejectReason: z.string().nullable(),
404
423
  requestedAt: z.string(),
405
424
  completedAt: z.string().nullable()
406
425
  });
407
426
  //#endregion
427
+ //#region src/schemas/consent.ts
428
+ /**
429
+ * 동의 종류 — 이용약관(`TERMS`)·개인정보 수집이용(`PRIVACY`)은 가입 필수, 마케팅 수신(`MARKETING`)은 선택이다.
430
+ * 필수 동의는 철회할 수 없다(철회 = 탈퇴).
431
+ */
432
+ const consentKindSchema = z.enum([
433
+ "TERMS",
434
+ "PRIVACY",
435
+ "MARKETING"
436
+ ]);
437
+ /** 동의 이력의 한 줄이 무엇인가 — 동의했거나 철회했다 */
438
+ const consentActionSchema = z.enum(["AGREED", "WITHDRAWN"]);
439
+ /**
440
+ * 동의가 일어난 경로. 값이 추가될 수 있어 모르는 값은 그대로 보여 준다.
441
+ * `SIGNUP` 비밀번호 가입 · `SOCIAL_SIGNUP` 소셜 가입 · `DELEGATED` 셀러 자체 회원 연동 ·
442
+ * `RECONSENT` 약관 개정 재동의 · `MEMBER_UPDATE` 구매자가 직접 변경 · `SELLER` 셀러가 처리
443
+ */
444
+ const consentSourceSchema = z.enum([
445
+ "SIGNUP",
446
+ "SOCIAL_SIGNUP",
447
+ "DELEGATED",
448
+ "RECONSENT",
449
+ "MEMBER_UPDATE",
450
+ "SELLER"
451
+ ]);
452
+ /** 종류별 현재 동의 상태 */
453
+ const consentStateSchema = z.object({
454
+ kind: consentKindSchema,
455
+ agreed: z.boolean(),
456
+ /** 동의한 약관 버전. 마케팅은 버전이 없어 null이고, 동의 이력이 없으면 null이다 */
457
+ agreedVersion: z.string().nullable(),
458
+ /** 스토어의 현재 약관 버전. 마케팅은 null */
459
+ currentVersion: z.string().nullable(),
460
+ /**
461
+ * 스토어가 정한 현재 약관 문서 주소. 재동의 화면에서 이 주소를 보여 준다.
462
+ * 스토어가 정하지 않았거나 마케팅이면 null이다(동의한 시점의 주소는 셀러가 보는 이력에 남는다).
463
+ */
464
+ currentDocumentUrl: z.string().nullable(),
465
+ /** 마지막으로 동의·철회한 시각. 이력이 없으면 null */
466
+ updatedAt: z.string().nullable(),
467
+ /** 약관이 개정돼 다시 받아야 하는가. 마케팅은 항상 false */
468
+ reconsentRequired: z.boolean()
469
+ });
470
+ /** `GET /storefront/v1/me/consents` 응답 */
471
+ const memberConsentsSchema = z.object({
472
+ terms: consentStateSchema,
473
+ privacy: consentStateSchema,
474
+ marketing: consentStateSchema,
475
+ /** 필수 동의 중 하나라도 다시 받아야 하면 true — `POST /me/consents`로 받는다 */
476
+ reconsentRequired: z.boolean()
477
+ });
478
+ /**
479
+ * `POST /storefront/v1/me/consents` 본문 — 바꿀 항목만 보낸다.
480
+ * 필수 동의는 동의(`true`)만 보낼 수 있다. 이미 현재 버전에 동의한 항목은 이력을 더 남기지 않는다.
481
+ */
482
+ const consentUpdateRequestSchema = z.object({
483
+ terms: z.literal(true).optional().describe("이용약관 재동의"),
484
+ privacy: z.literal(true).optional().describe("개인정보 수집이용 재동의"),
485
+ marketing: z.boolean().optional().describe("마케팅 수신 동의(false면 철회)")
486
+ }).refine((value) => Object.values(value).some((v) => v !== void 0), { message: "최소 1개 항목이 필요합니다" });
487
+ //#endregion
408
488
  //#region src/schemas/customer-inquiry.ts
409
489
  const customerInquiryCategorySchema = z.enum([
410
490
  "DELIVERY",
@@ -466,7 +546,8 @@ const memberSchema = z.object({
466
546
  phone: z.string().nullable(),
467
547
  point: z.number().int(),
468
548
  marketingAgreed: z.boolean(),
469
- joinedAt: z.string()
549
+ joinedAt: z.string(),
550
+ reconsentRequired: z.boolean().describe("약관이 개정돼 필수 동의를 다시 받아야 하는가. true면 `GET /me/consents`로 어떤 항목인지 확인하고 `POST /me/consents`로 받는다. 받기 전에도 스토어 이용은 막히지 않는다")
470
551
  });
471
552
  const updateProfileRequestSchema = z.object({
472
553
  name: z.string().max(50).optional(),
@@ -503,9 +584,11 @@ const myOrderItemSchema = z.object({
503
584
  orderItemId: z.string(),
504
585
  productId: z.string(),
505
586
  productName: z.string(),
506
- thumbnailUrl: z.url(),
587
+ thumbnailUrl: z.url().nullable().describe("주문 시점의 대표 이미지. 없었으면 null"),
507
588
  optionName: z.string().nullable(),
508
- quantity: z.number().int(),
589
+ quantity: z.number().int().describe("주문 수량"),
590
+ canceledQuantity: z.number().int().describe("취소·반품으로 환불된 누적 수량. 부분 취소가 없었으면 0이다"),
591
+ activeQuantity: z.number().int().describe("남은 수량 (`quantity` − `canceledQuantity`). 취소·반품·교환 요청 수량의 상한이다"),
509
592
  totalPrice: z.number().int(),
510
593
  status: orderItemStatusSchema,
511
594
  claimStatus: z.string().nullable(),
@@ -585,7 +668,7 @@ const writableReviewSchema = z.object({
585
668
  productId: z.string(),
586
669
  productName: z.string(),
587
670
  optionName: z.string().nullable(),
588
- thumbnailUrl: z.url(),
671
+ thumbnailUrl: z.url().nullable().describe("주문 시점의 대표 이미지. 없었으면 null"),
589
672
  writableUntil: z.string()
590
673
  });
591
674
  const createReviewRequestSchema = z.object({
@@ -765,6 +848,10 @@ get: () => http.request("GET", "/store", storefrontStoreSchema) },
765
848
  member: {
766
849
  me: () => http.request("GET", "/me", memberSchema),
767
850
  updateMe: (body) => http.requestVoid("PATCH", "/me", { body: updateProfileRequestSchema.parse(body) }),
851
+ /** 약관·개인정보·마케팅 동의의 현재 상태와 재동의 필요 여부 */
852
+ consents: () => http.request("GET", "/me/consents", memberConsentsSchema),
853
+ /** 재동의·마케팅 동의 변경 — 바꾼 뒤의 상태를 돌려준다 */
854
+ updateConsents: (body) => http.request("POST", "/me/consents", memberConsentsSchema, { body: consentUpdateRequestSchema.parse(body) }),
768
855
  listAddresses: () => http.request("GET", "/me/addresses", z.array(memberAddressSchema)),
769
856
  createAddress: (body) => http.requestVoid("POST", "/me/addresses", { body: memberAddressRequestSchema.parse(body) }),
770
857
  updateAddress: (addressId, body) => http.requestVoid("PUT", path`/me/addresses/${addressId}`, { body: memberAddressRequestSchema.parse(body) }),
@@ -788,4 +875,4 @@ get: () => http.request("GET", "/store", storefrontStoreSchema) },
788
875
  };
789
876
  }
790
877
  //#endregion
791
- export { signupRequestSchema as $, createClaimResultSchema as A, pageInfoSchema as B, publicInquirySchema as C, claimReasonSchema as D, customerInquirySchema as E, productFacetsSchema as F, updateCartItemRequestSchema as G, addCartItemRequestSchema as H, productPageSchema as I, idpAuthorizeResponseSchema as J, anonymousSessionSchema as K, productSortSchema as L, categoryNodeSchema as M, productCardSchema as N, claimTypeSchema as O, productDetailSchema as P, memberIdentitiesSchema as Q, claimStatusSchema as R, createInquiryResultSchema as S, customerInquiryCategorySchema as T, cartItemSchema as U, pageSchema as V, cartSchema as W, linkIdentityRequestSchema as X, idpTokenRequestSchema as Y, loginRequestSchema as Z, memberAddressSchema as _, publicReviewSchema as a, buildQuery as at, wishlistAddResultSchema as b, updateReviewRequestSchema as c, deliveryTrackingSchema as d, socialProviderSchema as et, myOrderItemSchema as f, memberAddressRequestSchema as g, purchaseDecisionResultSchema as h, createReviewResultSchema as i, ApiError as it, myClaimSchema as j, createClaimRequestSchema as k, updateReviewResultSchema as l, orderShippingAddressSchema as m, storefrontStoreSchema as n, withdrawRequestSchema as nt, reviewPageSchema as o, toApiError as ot, myOrderSchema as p, idpAuthorizeRequestSchema as q, createReviewRequestSchema as r, withdrawalBlockedDetailsSchema as rt, reviewSummarySchema as s, unwrapData as st, createStorefrontClient as t, tokenPairSchema as tt, writableReviewSchema as u, memberSchema as v, createCustomerInquiryRequestSchema as w, createInquiryRequestSchema as x, updateProfileRequestSchema as y, orderItemStatusSchema as z };
878
+ export { idpAgreementsSchema as $, consentStateSchema as A, productDetailSchema as B, publicInquirySchema as C, consentActionSchema as D, customerInquirySchema as E, createClaimRequestSchema as F, orderItemStatusSchema as G, productPageSchema as H, createClaimResultSchema as I, addCartItemRequestSchema as J, pageInfoSchema as K, myClaimSchema as L, memberConsentsSchema as M, claimReasonSchema as N, consentKindSchema as O, claimTypeSchema as P, anonymousSessionSchema as Q, categoryNodeSchema as R, createInquiryResultSchema as S, customerInquiryCategorySchema as T, productSortSchema as U, productFacetsSchema as V, claimStatusSchema as W, cartSchema as X, cartItemSchema as Y, updateCartItemRequestSchema as Z, memberAddressSchema as _, publicReviewSchema as a, memberIdentitiesSchema as at, wishlistAddResultSchema as b, updateReviewRequestSchema as c, tokenPairSchema as ct, deliveryTrackingSchema as d, ApiError as dt, idpAuthorizeRequestSchema as et, myOrderItemSchema as f, buildQuery as ft, memberAddressRequestSchema as g, purchaseDecisionResultSchema as h, createReviewResultSchema as i, loginRequestSchema as it, consentUpdateRequestSchema as j, consentSourceSchema as k, updateReviewResultSchema as l, withdrawRequestSchema as lt, orderShippingAddressSchema as m, unwrapData as mt, storefrontStoreSchema as n, idpTokenRequestSchema as nt, reviewPageSchema as o, signupRequestSchema as ot, myOrderSchema as p, toApiError as pt, pageSchema as q, createReviewRequestSchema as r, linkIdentityRequestSchema as rt, reviewSummarySchema as s, socialProviderSchema as st, createStorefrontClient as t, idpAuthorizeResponseSchema as tt, writableReviewSchema as u, withdrawalBlockedDetailsSchema as ut, memberSchema as v, createCustomerInquiryRequestSchema as w, createInquiryRequestSchema as x, updateProfileRequestSchema as y, productCardSchema as z };
@@ -58,11 +58,29 @@ declare const socialProviderSchema: z.ZodEnum<{
58
58
  google: "google";
59
59
  }>;
60
60
  type SocialProvider = z.infer<typeof socialProviderSchema>;
61
+ /**
62
+ * 소셜 가입 화면에서 받은 필수·선택 동의 — 공급자로 보내기 전에 함께 보낸다.
63
+ *
64
+ * **이 흐름으로 회원이 처음 만들어질 때만 쓴다.** 이미 있는 회원의 로그인이면 무시한다(동의는 늘어나지 않는다).
65
+ * 보내지 않으면 필수 동의 이력이 남지 않아 `GET /me`의 `reconsentRequired`가 true가 되고,
66
+ * 스토어프론트가 첫 진입에서 `POST /me/consents`로 받는다(가입 자체는 거부하지 않는다).
67
+ */
68
+ declare const idpAgreementsSchema: z.ZodObject<{
69
+ terms: z.ZodLiteral<true>;
70
+ privacy: z.ZodLiteral<true>;
71
+ marketing: z.ZodDefault<z.ZodBoolean>;
72
+ }, z.core.$strip>;
73
+ type IdpAgreements = z.infer<typeof idpAgreementsSchema>;
61
74
  /** `POST /auth/idp/{provider}/authorize` 본문 — PKCE(S256)와 state는 SDK가 만든다 */
62
75
  declare const idpAuthorizeRequestSchema: z.ZodObject<{
63
76
  redirectUri: z.ZodURL;
64
77
  codeChallenge: z.ZodString;
65
78
  state: z.ZodString;
79
+ agreements: z.ZodOptional<z.ZodObject<{
80
+ terms: z.ZodLiteral<true>;
81
+ privacy: z.ZodLiteral<true>;
82
+ marketing: z.ZodDefault<z.ZodBoolean>;
83
+ }, z.core.$strip>>;
66
84
  }, z.core.$strip>;
67
85
  type IdpAuthorizeRequest = z.infer<typeof idpAuthorizeRequestSchema>;
68
86
  declare const idpAuthorizeResponseSchema: z.ZodObject<{
@@ -113,4 +131,4 @@ type TokenSource = string | null | undefined | (() => string | null | undefined)
113
131
  type Query = Record<string, string | number | boolean | undefined>;
114
132
  declare function buildQuery(query?: Query): string;
115
133
  //#endregion
116
- export { signupRequestSchema as C, withdrawalBlockedDetailsSchema as D, withdrawRequestSchema as E, memberIdentitiesSchema as S, tokenPairSchema as T, idpAuthorizeRequestSchema as _, AnonymousSession as a, linkIdentityRequestSchema as b, LinkIdentityRequest as c, SignupRequest as d, SocialProvider as f, anonymousSessionSchema as g, WithdrawalBlockedDetails as h, buildQuery as i, LoginRequest as l, WithdrawRequest as m, Query as n, IdpAuthorizeRequest as o, TokenPair as p, TokenSource as r, IdpTokenRequest as s, ApiError as t, MemberIdentities as u, idpAuthorizeResponseSchema as v, socialProviderSchema as w, loginRequestSchema as x, idpTokenRequestSchema as y };
134
+ export { loginRequestSchema as C, tokenPairSchema as D, socialProviderSchema as E, withdrawRequestSchema as O, linkIdentityRequestSchema as S, signupRequestSchema as T, anonymousSessionSchema as _, AnonymousSession as a, idpAuthorizeResponseSchema as b, IdpTokenRequest as c, MemberIdentities as d, SignupRequest as f, WithdrawalBlockedDetails as g, WithdrawRequest as h, buildQuery as i, withdrawalBlockedDetailsSchema as k, LinkIdentityRequest as l, TokenPair as m, Query as n, IdpAgreements as o, SocialProvider as p, TokenSource as r, IdpAuthorizeRequest as s, ApiError as t, LoginRequest as u, idpAgreementsSchema as v, memberIdentitiesSchema as w, idpTokenRequestSchema as x, idpAuthorizeRequestSchema as y };
@@ -1,4 +1,4 @@
1
- import { c as LinkIdentityRequest, d as SignupRequest, f as SocialProvider, l as LoginRequest, m as WithdrawRequest, o as IdpAuthorizeRequest, r as TokenSource, s as IdpTokenRequest } from "./http-BbFHVGBf.mjs";
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-CeRVoUGu.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/analytics-ids.d.ts
4
4
  /**
@@ -20,7 +20,7 @@ declare const cartItemSchema: z.ZodObject<{
20
20
  cartItemId: z.ZodString;
21
21
  productId: z.ZodString;
22
22
  productName: z.ZodString;
23
- thumbnailUrl: z.ZodURL;
23
+ thumbnailUrl: z.ZodNullable<z.ZodURL>;
24
24
  optionId: z.ZodNullable<z.ZodString>;
25
25
  optionName: z.ZodNullable<z.ZodString>;
26
26
  quantity: z.ZodNumber;
@@ -39,7 +39,7 @@ declare const cartSchema: z.ZodObject<{
39
39
  cartItemId: z.ZodString;
40
40
  productId: z.ZodString;
41
41
  productName: z.ZodString;
42
- thumbnailUrl: z.ZodURL;
42
+ thumbnailUrl: z.ZodNullable<z.ZodURL>;
43
43
  optionId: z.ZodNullable<z.ZodString>;
44
44
  optionName: z.ZodNullable<z.ZodString>;
45
45
  quantity: z.ZodNumber;
@@ -125,7 +125,7 @@ declare const categoryNodeSchema: z.ZodType<CategoryNode>;
125
125
  declare const productCardSchema: z.ZodObject<{
126
126
  productId: z.ZodString;
127
127
  name: z.ZodString;
128
- thumbnailUrl: z.ZodURL;
128
+ thumbnailUrl: z.ZodNullable<z.ZodURL>;
129
129
  salePrice: z.ZodNumber;
130
130
  discountedPrice: z.ZodNullable<z.ZodNumber>;
131
131
  discountRate: z.ZodNullable<z.ZodNumber>;
@@ -138,7 +138,7 @@ type ProductCard = z.infer<typeof productCardSchema>;
138
138
  declare const productDetailSchema: z.ZodObject<{
139
139
  productId: z.ZodString;
140
140
  name: z.ZodString;
141
- thumbnailUrl: z.ZodURL;
141
+ thumbnailUrl: z.ZodNullable<z.ZodURL>;
142
142
  salePrice: z.ZodNumber;
143
143
  discountedPrice: z.ZodNullable<z.ZodNumber>;
144
144
  discountRate: z.ZodNullable<z.ZodNumber>;
@@ -222,7 +222,7 @@ declare const productPageSchema: z.ZodObject<{
222
222
  contents: z.ZodArray<z.ZodObject<{
223
223
  productId: z.ZodString;
224
224
  name: z.ZodString;
225
- thumbnailUrl: z.ZodURL;
225
+ thumbnailUrl: z.ZodNullable<z.ZodURL>;
226
226
  salePrice: z.ZodNumber;
227
227
  discountedPrice: z.ZodNullable<z.ZodNumber>;
228
228
  discountRate: z.ZodNullable<z.ZodNumber>;
@@ -718,6 +718,7 @@ declare const createClaimRequestSchema: z.ZodObject<{
718
718
  reasonDetail: z.ZodOptional<z.ZodString>;
719
719
  evidenceImages: z.ZodOptional<z.ZodArray<z.ZodURL>>;
720
720
  exchangeOptionId: z.ZodOptional<z.ZodString>;
721
+ quantity: z.ZodOptional<z.ZodNumber>;
721
722
  }, z.core.$strip>;
722
723
  type CreateClaimRequest = z.infer<typeof createClaimRequestSchema>;
723
724
  declare const createClaimResultSchema: z.ZodObject<{
@@ -725,6 +726,8 @@ declare const createClaimResultSchema: z.ZodObject<{
725
726
  status: z.ZodLiteral<"REQUESTED">;
726
727
  expectedRefundAmount: z.ZodNullable<z.ZodNumber>;
727
728
  claimDeliveryFee: z.ZodNumber;
729
+ quantity: z.ZodNumber;
730
+ deliveryFeeRefundAmount: z.ZodNumber;
728
731
  }, z.core.$strip>;
729
732
  type CreateClaimResult = z.infer<typeof createClaimResultSchema>;
730
733
  declare const myClaimSchema: z.ZodObject<{
@@ -747,14 +750,117 @@ declare const myClaimSchema: z.ZodObject<{
747
750
  }>;
748
751
  orderItemId: z.ZodString;
749
752
  productName: z.ZodString;
753
+ quantity: z.ZodNumber;
750
754
  reason: z.ZodString;
751
755
  expectedRefundAmount: z.ZodNullable<z.ZodNumber>;
756
+ expectedDeliveryFeeRefundAmount: z.ZodNullable<z.ZodNumber>;
752
757
  rejectReason: z.ZodNullable<z.ZodString>;
753
758
  requestedAt: z.ZodString;
754
759
  completedAt: z.ZodNullable<z.ZodString>;
755
760
  }, z.core.$strip>;
756
761
  type MyClaim = z.infer<typeof myClaimSchema>;
757
762
  //#endregion
763
+ //#region src/schemas/consent.d.ts
764
+ /**
765
+ * 동의 종류 — 이용약관(`TERMS`)·개인정보 수집이용(`PRIVACY`)은 가입 필수, 마케팅 수신(`MARKETING`)은 선택이다.
766
+ * 필수 동의는 철회할 수 없다(철회 = 탈퇴).
767
+ */
768
+ declare const consentKindSchema: z.ZodEnum<{
769
+ TERMS: "TERMS";
770
+ PRIVACY: "PRIVACY";
771
+ MARKETING: "MARKETING";
772
+ }>;
773
+ type ConsentKind = z.infer<typeof consentKindSchema>;
774
+ /** 동의 이력의 한 줄이 무엇인가 — 동의했거나 철회했다 */
775
+ declare const consentActionSchema: z.ZodEnum<{
776
+ WITHDRAWN: "WITHDRAWN";
777
+ AGREED: "AGREED";
778
+ }>;
779
+ type ConsentAction = z.infer<typeof consentActionSchema>;
780
+ /**
781
+ * 동의가 일어난 경로. 값이 추가될 수 있어 모르는 값은 그대로 보여 준다.
782
+ * `SIGNUP` 비밀번호 가입 · `SOCIAL_SIGNUP` 소셜 가입 · `DELEGATED` 셀러 자체 회원 연동 ·
783
+ * `RECONSENT` 약관 개정 재동의 · `MEMBER_UPDATE` 구매자가 직접 변경 · `SELLER` 셀러가 처리
784
+ */
785
+ declare const consentSourceSchema: z.ZodEnum<{
786
+ SIGNUP: "SIGNUP";
787
+ SOCIAL_SIGNUP: "SOCIAL_SIGNUP";
788
+ DELEGATED: "DELEGATED";
789
+ RECONSENT: "RECONSENT";
790
+ MEMBER_UPDATE: "MEMBER_UPDATE";
791
+ SELLER: "SELLER";
792
+ }>;
793
+ type ConsentSource = z.infer<typeof consentSourceSchema>;
794
+ /** 종류별 현재 동의 상태 */
795
+ declare const consentStateSchema: z.ZodObject<{
796
+ kind: z.ZodEnum<{
797
+ TERMS: "TERMS";
798
+ PRIVACY: "PRIVACY";
799
+ MARKETING: "MARKETING";
800
+ }>;
801
+ agreed: z.ZodBoolean;
802
+ agreedVersion: z.ZodNullable<z.ZodString>;
803
+ currentVersion: z.ZodNullable<z.ZodString>;
804
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
805
+ updatedAt: z.ZodNullable<z.ZodString>;
806
+ reconsentRequired: z.ZodBoolean;
807
+ }, z.core.$strip>;
808
+ type ConsentState = z.infer<typeof consentStateSchema>;
809
+ /** `GET /storefront/v1/me/consents` 응답 */
810
+ declare const memberConsentsSchema: z.ZodObject<{
811
+ terms: z.ZodObject<{
812
+ kind: z.ZodEnum<{
813
+ TERMS: "TERMS";
814
+ PRIVACY: "PRIVACY";
815
+ MARKETING: "MARKETING";
816
+ }>;
817
+ agreed: z.ZodBoolean;
818
+ agreedVersion: z.ZodNullable<z.ZodString>;
819
+ currentVersion: z.ZodNullable<z.ZodString>;
820
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
821
+ updatedAt: z.ZodNullable<z.ZodString>;
822
+ reconsentRequired: z.ZodBoolean;
823
+ }, z.core.$strip>;
824
+ privacy: z.ZodObject<{
825
+ kind: z.ZodEnum<{
826
+ TERMS: "TERMS";
827
+ PRIVACY: "PRIVACY";
828
+ MARKETING: "MARKETING";
829
+ }>;
830
+ agreed: z.ZodBoolean;
831
+ agreedVersion: z.ZodNullable<z.ZodString>;
832
+ currentVersion: z.ZodNullable<z.ZodString>;
833
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
834
+ updatedAt: z.ZodNullable<z.ZodString>;
835
+ reconsentRequired: z.ZodBoolean;
836
+ }, z.core.$strip>;
837
+ marketing: z.ZodObject<{
838
+ kind: z.ZodEnum<{
839
+ TERMS: "TERMS";
840
+ PRIVACY: "PRIVACY";
841
+ MARKETING: "MARKETING";
842
+ }>;
843
+ agreed: z.ZodBoolean;
844
+ agreedVersion: z.ZodNullable<z.ZodString>;
845
+ currentVersion: z.ZodNullable<z.ZodString>;
846
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
847
+ updatedAt: z.ZodNullable<z.ZodString>;
848
+ reconsentRequired: z.ZodBoolean;
849
+ }, z.core.$strip>;
850
+ reconsentRequired: z.ZodBoolean;
851
+ }, z.core.$strip>;
852
+ type MemberConsents = z.infer<typeof memberConsentsSchema>;
853
+ /**
854
+ * `POST /storefront/v1/me/consents` 본문 — 바꿀 항목만 보낸다.
855
+ * 필수 동의는 동의(`true`)만 보낼 수 있다. 이미 현재 버전에 동의한 항목은 이력을 더 남기지 않는다.
856
+ */
857
+ declare const consentUpdateRequestSchema: z.ZodObject<{
858
+ terms: z.ZodOptional<z.ZodLiteral<true>>;
859
+ privacy: z.ZodOptional<z.ZodLiteral<true>>;
860
+ marketing: z.ZodOptional<z.ZodBoolean>;
861
+ }, z.core.$strip>;
862
+ type ConsentUpdateRequest = z.infer<typeof consentUpdateRequestSchema>;
863
+ //#endregion
758
864
  //#region src/schemas/customer-inquiry.d.ts
759
865
  declare const customerInquiryCategorySchema: z.ZodEnum<{
760
866
  RETURN: "RETURN";
@@ -834,6 +940,7 @@ declare const memberSchema: z.ZodObject<{
834
940
  point: z.ZodNumber;
835
941
  marketingAgreed: z.ZodBoolean;
836
942
  joinedAt: z.ZodString;
943
+ reconsentRequired: z.ZodBoolean;
837
944
  }, z.core.$strip>;
838
945
  type Member = z.infer<typeof memberSchema>;
839
946
  declare const updateProfileRequestSchema: z.ZodObject<{
@@ -896,7 +1003,7 @@ declare const writableReviewSchema: z.ZodObject<{
896
1003
  productId: z.ZodString;
897
1004
  productName: z.ZodString;
898
1005
  optionName: z.ZodNullable<z.ZodString>;
899
- thumbnailUrl: z.ZodURL;
1006
+ thumbnailUrl: z.ZodNullable<z.ZodURL>;
900
1007
  writableUntil: z.ZodString;
901
1008
  }, z.core.$strip>;
902
1009
  type WritableReview = z.infer<typeof writableReviewSchema>;
@@ -1055,6 +1162,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1055
1162
  point: number;
1056
1163
  marketingAgreed: boolean;
1057
1164
  joinedAt: string;
1165
+ reconsentRequired: boolean;
1058
1166
  } | null>;
1059
1167
  auth: {
1060
1168
  /** 비회원 익명 세션 발급 — 응답의 cartToken을 `cartToken` 옵션(X-Cart-Token)으로 쓴다 */
@@ -1147,7 +1255,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1147
1255
  contents: {
1148
1256
  productId: string;
1149
1257
  name: string;
1150
- thumbnailUrl: string;
1258
+ thumbnailUrl: string | null;
1151
1259
  salePrice: number;
1152
1260
  discountedPrice: number | null;
1153
1261
  discountRate: number | null;
@@ -1171,7 +1279,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1171
1279
  getProduct: (productId: string) => Promise<{
1172
1280
  productId: string;
1173
1281
  name: string;
1174
- thumbnailUrl: string;
1282
+ thumbnailUrl: string | null;
1175
1283
  salePrice: number;
1176
1284
  discountedPrice: number | null;
1177
1285
  discountRate: number | null;
@@ -1266,7 +1374,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1266
1374
  cartItemId: string;
1267
1375
  productId: string;
1268
1376
  productName: string;
1269
- thumbnailUrl: string;
1377
+ thumbnailUrl: string | null;
1270
1378
  optionId: string | null;
1271
1379
  optionName: string | null;
1272
1380
  quantity: number;
@@ -1286,7 +1394,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1286
1394
  cartItemId: string;
1287
1395
  productId: string;
1288
1396
  productName: string;
1289
- thumbnailUrl: string;
1397
+ thumbnailUrl: string | null;
1290
1398
  optionId: string | null;
1291
1399
  optionName: string | null;
1292
1400
  quantity: number;
@@ -1306,7 +1414,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1306
1414
  cartItemId: string;
1307
1415
  productId: string;
1308
1416
  productName: string;
1309
- thumbnailUrl: string;
1417
+ thumbnailUrl: string | null;
1310
1418
  optionId: string | null;
1311
1419
  optionName: string | null;
1312
1420
  quantity: number;
@@ -1467,9 +1575,11 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1467
1575
  orderItemId: string;
1468
1576
  productId: string;
1469
1577
  productName: string;
1470
- thumbnailUrl: string;
1578
+ thumbnailUrl: string | null;
1471
1579
  optionName: string | null;
1472
1580
  quantity: number;
1581
+ canceledQuantity: number;
1582
+ activeQuantity: number;
1473
1583
  totalPrice: number;
1474
1584
  status: "CANCELED" | "PAYMENT_WAITING" | "PAID" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
1475
1585
  claimStatus: string | null;
@@ -1502,9 +1612,11 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1502
1612
  orderItemId: string;
1503
1613
  productId: string;
1504
1614
  productName: string;
1505
- thumbnailUrl: string;
1615
+ thumbnailUrl: string | null;
1506
1616
  optionName: string | null;
1507
1617
  quantity: number;
1618
+ canceledQuantity: number;
1619
+ activeQuantity: number;
1508
1620
  totalPrice: number;
1509
1621
  status: "CANCELED" | "PAYMENT_WAITING" | "PAID" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
1510
1622
  claimStatus: string | null;
@@ -1539,9 +1651,11 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1539
1651
  orderItemId: string;
1540
1652
  productId: string;
1541
1653
  productName: string;
1542
- thumbnailUrl: string;
1654
+ thumbnailUrl: string | null;
1543
1655
  optionName: string | null;
1544
1656
  quantity: number;
1657
+ canceledQuantity: number;
1658
+ activeQuantity: number;
1545
1659
  totalPrice: number;
1546
1660
  status: "CANCELED" | "PAYMENT_WAITING" | "PAID" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
1547
1661
  claimStatus: string | null;
@@ -1585,6 +1699,8 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1585
1699
  status: "REQUESTED";
1586
1700
  expectedRefundAmount: number | null;
1587
1701
  claimDeliveryFee: number;
1702
+ quantity: number;
1703
+ deliveryFeeRefundAmount: number;
1588
1704
  }>;
1589
1705
  list: (params?: PageParams & {
1590
1706
  status?: ClaimStatus;
@@ -1599,8 +1715,10 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1599
1715
  status: "COMPLETED" | "REQUESTED" | "HELD" | "COLLECTING" | "COLLECTED" | "REDELIVERING" | "APPROVED" | "REJECTED" | "WITHDRAWN";
1600
1716
  orderItemId: string;
1601
1717
  productName: string;
1718
+ quantity: number;
1602
1719
  reason: string;
1603
1720
  expectedRefundAmount: number | null;
1721
+ expectedDeliveryFeeRefundAmount: number | null;
1604
1722
  rejectReason: string | null;
1605
1723
  requestedAt: string;
1606
1724
  completedAt: string | null;
@@ -1617,8 +1735,71 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1617
1735
  point: number;
1618
1736
  marketingAgreed: boolean;
1619
1737
  joinedAt: string;
1738
+ reconsentRequired: boolean;
1620
1739
  }>;
1621
1740
  updateMe: (body: UpdateProfileRequest) => Promise<void>;
1741
+ /** 약관·개인정보·마케팅 동의의 현재 상태와 재동의 필요 여부 */
1742
+ consents: () => Promise<{
1743
+ terms: {
1744
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
1745
+ agreed: boolean;
1746
+ agreedVersion: string | null;
1747
+ currentVersion: string | null;
1748
+ currentDocumentUrl: string | null;
1749
+ updatedAt: string | null;
1750
+ reconsentRequired: boolean;
1751
+ };
1752
+ privacy: {
1753
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
1754
+ agreed: boolean;
1755
+ agreedVersion: string | null;
1756
+ currentVersion: string | null;
1757
+ currentDocumentUrl: string | null;
1758
+ updatedAt: string | null;
1759
+ reconsentRequired: boolean;
1760
+ };
1761
+ marketing: {
1762
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
1763
+ agreed: boolean;
1764
+ agreedVersion: string | null;
1765
+ currentVersion: string | null;
1766
+ currentDocumentUrl: string | null;
1767
+ updatedAt: string | null;
1768
+ reconsentRequired: boolean;
1769
+ };
1770
+ reconsentRequired: boolean;
1771
+ }>;
1772
+ /** 재동의·마케팅 동의 변경 — 바꾼 뒤의 상태를 돌려준다 */
1773
+ updateConsents: (body: ConsentUpdateRequest) => Promise<{
1774
+ terms: {
1775
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
1776
+ agreed: boolean;
1777
+ agreedVersion: string | null;
1778
+ currentVersion: string | null;
1779
+ currentDocumentUrl: string | null;
1780
+ updatedAt: string | null;
1781
+ reconsentRequired: boolean;
1782
+ };
1783
+ privacy: {
1784
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
1785
+ agreed: boolean;
1786
+ agreedVersion: string | null;
1787
+ currentVersion: string | null;
1788
+ currentDocumentUrl: string | null;
1789
+ updatedAt: string | null;
1790
+ reconsentRequired: boolean;
1791
+ };
1792
+ marketing: {
1793
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
1794
+ agreed: boolean;
1795
+ agreedVersion: string | null;
1796
+ currentVersion: string | null;
1797
+ currentDocumentUrl: string | null;
1798
+ updatedAt: string | null;
1799
+ reconsentRequired: boolean;
1800
+ };
1801
+ reconsentRequired: boolean;
1802
+ }>;
1622
1803
  listAddresses: () => Promise<{
1623
1804
  addressId: string;
1624
1805
  alias: string;
@@ -1640,7 +1821,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1640
1821
  contents: {
1641
1822
  productId: string;
1642
1823
  name: string;
1643
- thumbnailUrl: string;
1824
+ thumbnailUrl: string | null;
1644
1825
  salePrice: number;
1645
1826
  discountedPrice: number | null;
1646
1827
  discountRate: number | null;
@@ -1659,7 +1840,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
1659
1840
  productId: string;
1660
1841
  productName: string;
1661
1842
  optionName: string | null;
1662
- thumbnailUrl: string;
1843
+ thumbnailUrl: string | null;
1663
1844
  writableUntil: string;
1664
1845
  }[]>;
1665
1846
  create: (orderItemId: string, body: CreateReviewRequest) => Promise<{
@@ -1868,9 +2049,11 @@ declare const myOrderItemSchema: z.ZodObject<{
1868
2049
  orderItemId: z.ZodString;
1869
2050
  productId: z.ZodString;
1870
2051
  productName: z.ZodString;
1871
- thumbnailUrl: z.ZodURL;
2052
+ thumbnailUrl: z.ZodNullable<z.ZodURL>;
1872
2053
  optionName: z.ZodNullable<z.ZodString>;
1873
2054
  quantity: z.ZodNumber;
2055
+ canceledQuantity: z.ZodNumber;
2056
+ activeQuantity: z.ZodNumber;
1874
2057
  totalPrice: z.ZodNumber;
1875
2058
  status: z.ZodEnum<{
1876
2059
  CANCELED: "CANCELED";
@@ -1908,9 +2091,11 @@ declare const myOrderSchema: z.ZodObject<{
1908
2091
  orderItemId: z.ZodString;
1909
2092
  productId: z.ZodString;
1910
2093
  productName: z.ZodString;
1911
- thumbnailUrl: z.ZodURL;
2094
+ thumbnailUrl: z.ZodNullable<z.ZodURL>;
1912
2095
  optionName: z.ZodNullable<z.ZodString>;
1913
2096
  quantity: z.ZodNumber;
2097
+ canceledQuantity: z.ZodNumber;
2098
+ activeQuantity: z.ZodNumber;
1914
2099
  totalPrice: z.ZodNumber;
1915
2100
  status: z.ZodEnum<{
1916
2101
  CANCELED: "CANCELED";
@@ -1995,4 +2180,4 @@ declare const storefrontStoreSchema: z.ZodObject<{
1995
2180
  }, z.core.$strip>;
1996
2181
  type StorefrontStore = z.infer<typeof storefrontStoreSchema>;
1997
2182
  //#endregion
1998
- export { MemberAddress as $, easyPayProviderSchema as $t, createStorefrontClient as A, claimStatusSchema as An, AvailablePaymentOption as At, ReviewSummary as B, cartSchema as Bn, PaymentMessage as Bt, analyticsBatchSchema as C, productFacetsSchema as Cn, CreateClaimResult as Ct, analyticsServerEventNameSchema as D, OrderItemStatus as Dn, createClaimRequestSchema as Dt, analyticsIdSchema as E, ClaimStatus as En, claimTypeSchema as Et, createStorefrontSession as F, Cart as Fn, KnownPaymentResult as Ft, createReviewResultSchema as G, PgProvider as Gt, UpdateReviewResult as H, analyticsIdsFromCookie as Hn, PaymentOption as Ht, CreateReviewRequest as I, CartItem as In, KnownPaymentStatus as It, reviewSummarySchema as J, StartPaymentRequest as Jt, publicReviewSchema as K, RetryPaymentRequest as Kt, CreateReviewResult as L, UpdateCartItemRequest as Ln, PAYMENT_RESULT_VALUES as Lt, SessionStorage as M, pageInfoSchema as Mn, CreateCheckoutRequest as Mt, StorefrontSession as N, pageSchema as Nn, EasyPayProvider as Nt, StorefrontClient as O, PageInfo as On, createClaimResultSchema as Ot, StorefrontSessionOptions as P, AddCartItemRequest as Pn, GuestInfo as Pt, Member as Q, easyPayProviderResponseSchema as Qt, PublicReview as R, addCartItemRequestSchema as Rn, PAYMENT_STATUS_VALUES as Rt, AnalyticsServerEventName as S, productDetailSchema as Sn, CreateClaimRequest as St, analyticsClientEventSchema as T, productSortSchema as Tn, claimReasonSchema as Tt, WritableReview as U, PaymentStart as Ut, UpdateReviewRequest as V, updateCartItemRequestSchema as Vn, PaymentMethod as Vt, createReviewRequestSchema as W, PaymentStatus as Wt, updateReviewResultSchema as X, checkoutSessionSchema as Xt, updateReviewRequestSchema as Y, availablePaymentOptionSchema as Yt, writableReviewSchema as Z, createCheckoutRequestSchema as Zt, ANALYTICS_VISITOR_HEADER as _, ProductPage as _n, createCustomerInquiryRequestSchema as _t, MyOrderItem as a, paymentOptionListSchema as an, memberSchema as at, AnalyticsClientEventName as b, categoryNodeSchema as bn, ClaimReason as bt, deliveryTrackingSchema as c, paymentStatusSchema as cn, CreateInquiryRequest as ct, orderShippingAddressSchema as d, shippingAddressInputSchema as dn, createInquiryRequestSchema as dt, guestInfoSchema as en, MemberAddressRequest as et, purchaseDecisionResultSchema as f, startPaymentRequestSchema as fn, createInquiryResultSchema as ft, ANALYTICS_VISITOR_COOKIE as g, ProductFacets as gn, CustomerInquiryCategory as gt, ANALYTICS_SESSION_HEADER as h, ProductDetail as hn, CustomerInquiry as ht, MyOrder as i, paymentOptionKey as in, memberAddressSchema as it, STOREFRONT_SESSION_KEYS as j, orderItemStatusSchema as jn, CheckoutSession as jt, StorefrontClientOptions as k, PageParams as kn, myClaimSchema as kt, myOrderItemSchema as l, pgProviderSchema as ln, CreateInquiryResult as lt, ANALYTICS_SESSION_COOKIE as m, ProductCard as mn, CreateCustomerInquiryRequest as mt, storefrontStoreSchema as n, paymentMessageSchema as nn, WishlistAddResult as nt, OrderShippingAddress as o, paymentOptionSchema as on, updateProfileRequestSchema as ot, ANALYTICS_MAX_BATCH_BYTES as p, CategoryNode as pn, publicInquirySchema as pt, reviewPageSchema as q, ShippingAddressInput as qt, DeliveryTracking as r, paymentMethodSchema as rn, memberAddressRequestSchema as rt, PurchaseDecisionResult as s, paymentStartSchema as sn, wishlistAddResultSchema as st, StorefrontStore as t, paymentFailureCategorySchema as tn, UpdateProfileRequest as tt, myOrderSchema as u, retryPaymentRequestSchema as un, PublicInquiry as ut, AnalyticsBatch as v, ProductSearchParams as vn, customerInquiryCategorySchema as vt, analyticsClientEventNameSchema as w, productPageSchema as wn, MyClaim as wt, AnalyticsEventName as x, productCardSchema as xn, ClaimType as xt, AnalyticsClientEvent as y, ProductSort as yn, customerInquirySchema as yt, ReviewPage as z, cartItemSchema as zn, PaymentFailureCategory as zt };
2183
+ export { MemberAddress as $, updateCartItemRequestSchema as $n, PaymentMethod as $t, createStorefrontClient as A, ProductSearchParams as An, consentUpdateRequestSchema as At, ReviewSummary as B, PageInfo as Bn, createClaimResultSchema as Bt, analyticsBatchSchema as C, shippingAddressInputSchema as Cn, ConsentState as Ct, analyticsServerEventNameSchema as D, ProductDetail as Dn, consentKindSchema as Dt, analyticsIdSchema as E, ProductCard as En, consentActionSchema as Et, createStorefrontSession as F, productFacetsSchema as Fn, CreateClaimResult as Ft, createReviewResultSchema as G, pageSchema as Gn, EasyPayProvider as Gt, UpdateReviewResult as H, claimStatusSchema as Hn, AvailablePaymentOption as Ht, CreateReviewRequest as I, productPageSchema as In, MyClaim as It, reviewSummarySchema as J, CartItem as Jn, KnownPaymentStatus as Jt, publicReviewSchema as K, AddCartItemRequest as Kn, GuestInfo as Kt, CreateReviewResult as L, productSortSchema as Ln, claimReasonSchema as Lt, SessionStorage as M, categoryNodeSchema as Mn, ClaimReason as Mt, StorefrontSession as N, productCardSchema as Nn, ClaimType as Nt, StorefrontClient as O, ProductFacets as On, consentSourceSchema as Ot, StorefrontSessionOptions as P, productDetailSchema as Pn, CreateClaimRequest as Pt, Member as Q, cartSchema as Qn, PaymentMessage as Qt, PublicReview as R, ClaimStatus as Rn, claimTypeSchema as Rt, AnalyticsServerEventName as S, retryPaymentRequestSchema as Sn, ConsentSource as St, analyticsClientEventSchema as T, CategoryNode as Tn, MemberConsents as Tt, WritableReview as U, orderItemStatusSchema as Un, CheckoutSession as Ut, UpdateReviewRequest as V, PageParams as Vn, myClaimSchema as Vt, createReviewRequestSchema as W, pageInfoSchema as Wn, CreateCheckoutRequest as Wt, updateReviewResultSchema as X, addCartItemRequestSchema as Xn, PAYMENT_STATUS_VALUES as Xt, updateReviewRequestSchema as Y, UpdateCartItemRequest as Yn, PAYMENT_RESULT_VALUES as Yt, writableReviewSchema as Z, cartItemSchema as Zn, PaymentFailureCategory as Zt, ANALYTICS_VISITOR_HEADER as _, paymentOptionListSchema as _n, createCustomerInquiryRequestSchema as _t, MyOrderItem as a, ShippingAddressInput as an, memberSchema as at, AnalyticsClientEventName as b, paymentStatusSchema as bn, ConsentAction as bt, deliveryTrackingSchema as c, checkoutSessionSchema as cn, CreateInquiryRequest as ct, orderShippingAddressSchema as d, easyPayProviderSchema as dn, createInquiryRequestSchema as dt, PaymentOption as en, analyticsIdsFromCookie as er, MemberAddressRequest as et, purchaseDecisionResultSchema as f, guestInfoSchema as fn, createInquiryResultSchema as ft, ANALYTICS_VISITOR_COOKIE as g, paymentOptionKey as gn, CustomerInquiryCategory as gt, ANALYTICS_SESSION_HEADER as h, paymentMethodSchema as hn, CustomerInquiry as ht, MyOrder as i, RetryPaymentRequest as in, memberAddressSchema as it, STOREFRONT_SESSION_KEYS as j, ProductSort as jn, memberConsentsSchema as jt, StorefrontClientOptions as k, ProductPage as kn, consentStateSchema as kt, myOrderItemSchema as l, createCheckoutRequestSchema as ln, CreateInquiryResult as lt, ANALYTICS_SESSION_COOKIE as m, paymentMessageSchema as mn, CreateCustomerInquiryRequest as mt, storefrontStoreSchema as n, PaymentStatus as nn, WishlistAddResult as nt, OrderShippingAddress as o, StartPaymentRequest as on, updateProfileRequestSchema as ot, ANALYTICS_MAX_BATCH_BYTES as p, paymentFailureCategorySchema as pn, publicInquirySchema as pt, reviewPageSchema as q, Cart as qn, KnownPaymentResult as qt, DeliveryTracking as r, PgProvider as rn, memberAddressRequestSchema as rt, PurchaseDecisionResult as s, availablePaymentOptionSchema as sn, wishlistAddResultSchema as st, StorefrontStore as t, PaymentStart as tn, UpdateProfileRequest as tt, myOrderSchema as u, easyPayProviderResponseSchema as un, PublicInquiry as ut, AnalyticsBatch as v, paymentOptionSchema as vn, customerInquiryCategorySchema as vt, analyticsClientEventNameSchema as w, startPaymentRequestSchema as wn, ConsentUpdateRequest as wt, AnalyticsEventName as x, pgProviderSchema as xn, ConsentKind as xt, AnalyticsClientEvent as y, paymentStartSchema as yn, customerInquirySchema as yt, ReviewPage as z, OrderItemStatus as zn, createClaimRequestSchema as zt };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { C as signupRequestSchema, D as withdrawalBlockedDetailsSchema, E as withdrawRequestSchema, S as memberIdentitiesSchema, T as tokenPairSchema, _ as idpAuthorizeRequestSchema, a as AnonymousSession, b as linkIdentityRequestSchema, c as LinkIdentityRequest, d as SignupRequest, f as SocialProvider, g as anonymousSessionSchema, h as WithdrawalBlockedDetails, i as buildQuery, l as LoginRequest, m as WithdrawRequest, n as Query, o as IdpAuthorizeRequest, p as TokenPair, r as TokenSource, s as IdpTokenRequest, t as ApiError, u as MemberIdentities, v as idpAuthorizeResponseSchema, w as socialProviderSchema, x as loginRequestSchema, y as idpTokenRequestSchema } from "./http-BbFHVGBf.mjs";
2
- import { $ as MemberAddress, $t as easyPayProviderSchema, A as createStorefrontClient, An as claimStatusSchema, At as AvailablePaymentOption, B as ReviewSummary, Bn as cartSchema, Bt as PaymentMessage, C as analyticsBatchSchema, Cn as productFacetsSchema, Ct as CreateClaimResult, D as analyticsServerEventNameSchema, Dn as OrderItemStatus, Dt as createClaimRequestSchema, E as analyticsIdSchema, En as ClaimStatus, Et as claimTypeSchema, F as createStorefrontSession, Fn as Cart, Ft as KnownPaymentResult, G as createReviewResultSchema, Gt as PgProvider, H as UpdateReviewResult, Hn as analyticsIdsFromCookie, Ht as PaymentOption, I as CreateReviewRequest, In as CartItem, It as KnownPaymentStatus, J as reviewSummarySchema, Jt as StartPaymentRequest, K as publicReviewSchema, Kt as RetryPaymentRequest, L as CreateReviewResult, Ln as UpdateCartItemRequest, Lt as PAYMENT_RESULT_VALUES, M as SessionStorage, Mn as pageInfoSchema, Mt as CreateCheckoutRequest, N as StorefrontSession, Nn as pageSchema, Nt as EasyPayProvider, O as StorefrontClient, On as PageInfo, Ot as createClaimResultSchema, P as StorefrontSessionOptions, Pn as AddCartItemRequest, Pt as GuestInfo, Q as Member, Qt as easyPayProviderResponseSchema, R as PublicReview, Rn as addCartItemRequestSchema, Rt as PAYMENT_STATUS_VALUES, S as AnalyticsServerEventName, Sn as productDetailSchema, St as CreateClaimRequest, T as analyticsClientEventSchema, Tn as productSortSchema, Tt as claimReasonSchema, U as WritableReview, Ut as PaymentStart, V as UpdateReviewRequest, Vn as updateCartItemRequestSchema, Vt as PaymentMethod, W as createReviewRequestSchema, Wt as PaymentStatus, X as updateReviewResultSchema, Xt as checkoutSessionSchema, Y as updateReviewRequestSchema, Yt as availablePaymentOptionSchema, Z as writableReviewSchema, Zt as createCheckoutRequestSchema, _ as ANALYTICS_VISITOR_HEADER, _n as ProductPage, _t as createCustomerInquiryRequestSchema, a as MyOrderItem, an as paymentOptionListSchema, at as memberSchema, b as AnalyticsClientEventName, bn as categoryNodeSchema, bt as ClaimReason, c as deliveryTrackingSchema, cn as paymentStatusSchema, ct as CreateInquiryRequest, d as orderShippingAddressSchema, dn as shippingAddressInputSchema, dt as createInquiryRequestSchema, en as guestInfoSchema, et as MemberAddressRequest, f as purchaseDecisionResultSchema, fn as startPaymentRequestSchema, ft as createInquiryResultSchema, g as ANALYTICS_VISITOR_COOKIE, gn as ProductFacets, gt as CustomerInquiryCategory, h as ANALYTICS_SESSION_HEADER, hn as ProductDetail, ht as CustomerInquiry, i as MyOrder, in as paymentOptionKey, it as memberAddressSchema, j as STOREFRONT_SESSION_KEYS, jn as orderItemStatusSchema, jt as CheckoutSession, k as StorefrontClientOptions, kn as PageParams, kt as myClaimSchema, l as myOrderItemSchema, ln as pgProviderSchema, lt as CreateInquiryResult, m as ANALYTICS_SESSION_COOKIE, mn as ProductCard, mt as CreateCustomerInquiryRequest, n as storefrontStoreSchema, nn as paymentMessageSchema, nt as WishlistAddResult, o as OrderShippingAddress, on as paymentOptionSchema, ot as updateProfileRequestSchema, p as ANALYTICS_MAX_BATCH_BYTES, pn as CategoryNode, pt as publicInquirySchema, q as reviewPageSchema, qt as ShippingAddressInput, r as DeliveryTracking, rn as paymentMethodSchema, rt as memberAddressRequestSchema, s as PurchaseDecisionResult, sn as paymentStartSchema, st as wishlistAddResultSchema, t as StorefrontStore, tn as paymentFailureCategorySchema, tt as UpdateProfileRequest, u as myOrderSchema, un as retryPaymentRequestSchema, ut as PublicInquiry, v as AnalyticsBatch, vn as ProductSearchParams, vt as customerInquiryCategorySchema, w as analyticsClientEventNameSchema, wn as productPageSchema, wt as MyClaim, x as AnalyticsEventName, xn as productCardSchema, xt as ClaimType, y as AnalyticsClientEvent, yn as ProductSort, yt as customerInquirySchema, z as ReviewPage, zn as cartItemSchema, zt as PaymentFailureCategory } from "./index-BRXStiK2.mjs";
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, Cart, CartItem, CategoryNode, CheckoutSession, ClaimReason, ClaimStatus, ClaimType, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomerInquiry, CustomerInquiryCategory, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStatus, LinkIdentityRequest, LoginRequest, Member, MemberAddress, MemberAddressRequest, 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, 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, categoryNodeSchema, checkoutSessionSchema, claimReasonSchema, claimStatusSchema, claimTypeSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, 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, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
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-CeRVoUGu.mjs";
2
+ import { $ as MemberAddress, $n as updateCartItemRequestSchema, $t as PaymentMethod, A as createStorefrontClient, An as ProductSearchParams, At as consentUpdateRequestSchema, B as ReviewSummary, Bn as PageInfo, Bt as createClaimResultSchema, C as analyticsBatchSchema, Cn as shippingAddressInputSchema, Ct as ConsentState, D as analyticsServerEventNameSchema, Dn as ProductDetail, Dt as consentKindSchema, E as analyticsIdSchema, En as ProductCard, Et as consentActionSchema, F as createStorefrontSession, Fn as productFacetsSchema, Ft as CreateClaimResult, G as createReviewResultSchema, Gn as pageSchema, Gt as EasyPayProvider, H as UpdateReviewResult, Hn as claimStatusSchema, Ht as AvailablePaymentOption, I as CreateReviewRequest, In as productPageSchema, It as MyClaim, J as reviewSummarySchema, Jn as CartItem, Jt as KnownPaymentStatus, K as publicReviewSchema, Kn as AddCartItemRequest, Kt as GuestInfo, L as CreateReviewResult, Ln as productSortSchema, Lt as claimReasonSchema, M as SessionStorage, Mn as categoryNodeSchema, Mt as ClaimReason, N as StorefrontSession, Nn as productCardSchema, Nt as ClaimType, O as StorefrontClient, On as ProductFacets, Ot as consentSourceSchema, P as StorefrontSessionOptions, Pn as productDetailSchema, Pt as CreateClaimRequest, Q as Member, Qn as cartSchema, Qt as PaymentMessage, R as PublicReview, Rn as ClaimStatus, Rt as claimTypeSchema, S as AnalyticsServerEventName, Sn as retryPaymentRequestSchema, St as ConsentSource, T as analyticsClientEventSchema, Tn as CategoryNode, Tt as MemberConsents, U as WritableReview, Un as orderItemStatusSchema, Ut as CheckoutSession, V as UpdateReviewRequest, Vn as PageParams, Vt as myClaimSchema, W as createReviewRequestSchema, Wn as pageInfoSchema, Wt as CreateCheckoutRequest, X as updateReviewResultSchema, Xn as addCartItemRequestSchema, Xt as PAYMENT_STATUS_VALUES, Y as updateReviewRequestSchema, Yn as UpdateCartItemRequest, Yt as PAYMENT_RESULT_VALUES, Z as writableReviewSchema, Zn as cartItemSchema, Zt as PaymentFailureCategory, _ as ANALYTICS_VISITOR_HEADER, _n as paymentOptionListSchema, _t as createCustomerInquiryRequestSchema, a as MyOrderItem, an as ShippingAddressInput, at as memberSchema, b as AnalyticsClientEventName, bn as paymentStatusSchema, bt as ConsentAction, c as deliveryTrackingSchema, cn as checkoutSessionSchema, ct as CreateInquiryRequest, d as orderShippingAddressSchema, dn as easyPayProviderSchema, dt as createInquiryRequestSchema, en as PaymentOption, er as analyticsIdsFromCookie, et as MemberAddressRequest, f as purchaseDecisionResultSchema, fn as guestInfoSchema, ft as createInquiryResultSchema, g as ANALYTICS_VISITOR_COOKIE, gn as paymentOptionKey, gt as CustomerInquiryCategory, h as ANALYTICS_SESSION_HEADER, hn as paymentMethodSchema, ht as CustomerInquiry, i as MyOrder, in as RetryPaymentRequest, it as memberAddressSchema, j as STOREFRONT_SESSION_KEYS, jn as ProductSort, jt as memberConsentsSchema, k as StorefrontClientOptions, kn as ProductPage, kt as consentStateSchema, l as myOrderItemSchema, ln as createCheckoutRequestSchema, lt as CreateInquiryResult, m as ANALYTICS_SESSION_COOKIE, mn as paymentMessageSchema, mt as CreateCustomerInquiryRequest, n as storefrontStoreSchema, nn as PaymentStatus, nt as WishlistAddResult, o as OrderShippingAddress, on as StartPaymentRequest, ot as updateProfileRequestSchema, p as ANALYTICS_MAX_BATCH_BYTES, pn as paymentFailureCategorySchema, pt as publicInquirySchema, q as reviewPageSchema, qn as Cart, qt as KnownPaymentResult, r as DeliveryTracking, rn as PgProvider, rt as memberAddressRequestSchema, s as PurchaseDecisionResult, sn as availablePaymentOptionSchema, st as wishlistAddResultSchema, t as StorefrontStore, tn as PaymentStart, tt as UpdateProfileRequest, u as myOrderSchema, un as easyPayProviderResponseSchema, ut as PublicInquiry, v as AnalyticsBatch, vn as paymentOptionSchema, vt as customerInquiryCategorySchema, w as analyticsClientEventNameSchema, wn as startPaymentRequestSchema, wt as ConsentUpdateRequest, x as AnalyticsEventName, xn as pgProviderSchema, xt as ConsentKind, y as AnalyticsClientEvent, yn as paymentStartSchema, yt as customerInquirySchema, z as ReviewPage, zn as OrderItemStatus, zt as createClaimRequestSchema } from "./index-UeHUNywG.mjs";
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, Cart, CartItem, CategoryNode, CheckoutSession, ClaimReason, ClaimStatus, ClaimType, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomerInquiry, CustomerInquiryCategory, 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, 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, categoryNodeSchema, checkoutSessionSchema, claimReasonSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, 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, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, 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 signupRequestSchema, A as createClaimResultSchema, B as pageInfoSchema, C as publicInquirySchema, D as claimReasonSchema, E as customerInquirySchema, F as productFacetsSchema, G as updateCartItemRequestSchema, H as addCartItemRequestSchema, I as productPageSchema, J as idpAuthorizeResponseSchema, K as anonymousSessionSchema, L as productSortSchema, M as categoryNodeSchema, N as productCardSchema, O as claimTypeSchema, P as productDetailSchema, Q as memberIdentitiesSchema, R as claimStatusSchema, S as createInquiryResultSchema, T as customerInquiryCategorySchema, U as cartItemSchema, V as pageSchema, W as cartSchema, X as linkIdentityRequestSchema, Y as idpTokenRequestSchema, Z as loginRequestSchema, _ as memberAddressSchema, a as publicReviewSchema, at as buildQuery, b as wishlistAddResultSchema, c as updateReviewRequestSchema, d as deliveryTrackingSchema, et as socialProviderSchema, f as myOrderItemSchema, g as memberAddressRequestSchema, h as purchaseDecisionResultSchema, i as createReviewResultSchema, it as ApiError, j as myClaimSchema, k as createClaimRequestSchema, l as updateReviewResultSchema, m as orderShippingAddressSchema, n as storefrontStoreSchema, nt as withdrawRequestSchema, o as reviewPageSchema, ot as toApiError, p as myOrderSchema, q as idpAuthorizeRequestSchema, r as createReviewRequestSchema, rt as withdrawalBlockedDetailsSchema, s as reviewSummarySchema, st as unwrapData, t as createStorefrontClient, tt as tokenPairSchema, u as writableReviewSchema, v as memberSchema, w as createCustomerInquiryRequestSchema, x as createInquiryRequestSchema, y as updateProfileRequestSchema, z as orderItemStatusSchema } from "./client-DwqExvZN.mjs";
3
+ import { $ as idpAgreementsSchema, A as consentStateSchema, B as productDetailSchema, C as publicInquirySchema, D as consentActionSchema, E as customerInquirySchema, F as createClaimRequestSchema, G as orderItemStatusSchema, H as productPageSchema, I as createClaimResultSchema, J as addCartItemRequestSchema, K as pageInfoSchema, L as myClaimSchema, M as memberConsentsSchema, N as claimReasonSchema, O as consentKindSchema, P as claimTypeSchema, Q as anonymousSessionSchema, R as categoryNodeSchema, S as createInquiryResultSchema, T as customerInquiryCategorySchema, U as productSortSchema, V as productFacetsSchema, W as claimStatusSchema, X as cartSchema, Y as cartItemSchema, Z as updateCartItemRequestSchema, _ as memberAddressSchema, a as publicReviewSchema, at as memberIdentitiesSchema, b as wishlistAddResultSchema, c as updateReviewRequestSchema, ct as tokenPairSchema, d as deliveryTrackingSchema, dt as ApiError, et as idpAuthorizeRequestSchema, f as myOrderItemSchema, ft as buildQuery, g as memberAddressRequestSchema, h as purchaseDecisionResultSchema, i as createReviewResultSchema, it as loginRequestSchema, j as consentUpdateRequestSchema, k as consentSourceSchema, l as updateReviewResultSchema, lt as withdrawRequestSchema, m as orderShippingAddressSchema, mt as unwrapData, n as storefrontStoreSchema, nt as idpTokenRequestSchema, o as reviewPageSchema, ot as signupRequestSchema, p as myOrderSchema, pt as toApiError, q as pageSchema, r as createReviewRequestSchema, rt as linkIdentityRequestSchema, s as reviewSummarySchema, st as socialProviderSchema, t as createStorefrontClient, tt as idpAuthorizeResponseSchema, u as writableReviewSchema, ut as withdrawalBlockedDetailsSchema, v as memberSchema, w as createCustomerInquiryRequestSchema, x as createInquiryRequestSchema, y as updateProfileRequestSchema, z as productCardSchema } from "./client-DEMo7UZc.mjs";
4
4
  import { _ as pgProviderSchema, a as createCheckoutRequestSchema, b as startPaymentRequestSchema, c as guestInfoSchema, d as paymentMethodSchema, f as paymentOptionKey, g as paymentStatusSchema, h as paymentStartSchema, i as checkoutSessionSchema, l as paymentFailureCategorySchema, m as paymentOptionSchema, n as PAYMENT_STATUS_VALUES, o as easyPayProviderResponseSchema, p as paymentOptionListSchema, r as availablePaymentOptionSchema, s as easyPayProviderSchema, t as PAYMENT_RESULT_VALUES, u as paymentMessageSchema, v as retryPaymentRequestSchema, y as shippingAddressInputSchema } from "./checkout-JFk3b8RG.mjs";
5
5
  //#region src/session.ts
6
6
  /** 세션 키 상수 — SDK가 소유한다. store-sdk와 겹치지 않는 별도 네임스페이스. */
@@ -125,4 +125,4 @@ function createStorefrontSession(options) {
125
125
  };
126
126
  }
127
127
  //#endregion
128
- export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, ApiError, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, categoryNodeSchema, checkoutSessionSchema, claimReasonSchema, claimStatusSchema, claimTypeSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, 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, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
128
+ export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, ApiError, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, categoryNodeSchema, checkoutSessionSchema, claimReasonSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, 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, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
@@ -1,4 +1,4 @@
1
- import { A as createStorefrontClient, Ht as PaymentOption, Pt as GuestInfo, Ut as PaymentStart, Wt as PaymentStatus, qt as ShippingAddressInput } from "../index-BRXStiK2.mjs";
1
+ import { A as createStorefrontClient, Kt as GuestInfo, an as ShippingAddressInput, en as PaymentOption, nn as PaymentStatus, tn as PaymentStart } from "../index-UeHUNywG.mjs";
2
2
  //#region src/payments/index.d.ts
3
3
  /**
4
4
  * 스토어프론트 결제 — 브라우저 전용(`@sayren/storefront-sdk/payments`).
@@ -4,7 +4,17 @@ import { u as paymentMessageSchema } from "../checkout-JFk3b8RG.mjs";
4
4
  const RETURN_PAYMENT_ID = "sayrenPaymentId";
5
5
  /** 팝업 이름 — 같은 이름으로 열면 결제창이 하나만 뜬다 */
6
6
  const POPUP_NAME = "sayren-payment";
7
- const POPUP_FEATURES = "width=500,height=720,resizable=yes,scrollbars=yes";
7
+ /**
8
+ * 결제 팝업 크기 — PG 결제창이 안에서 그대로 뜬다. KG이니시스 PC 결제창이 폭 800px 안팎이라 그보다 넓게 연다
9
+ * (포트원 샌드박스 확인). 화면이 더 작으면 화면에 맞춘다.
10
+ */
11
+ const POPUP_SIZE = {
12
+ width: 860,
13
+ height: 760
14
+ };
15
+ function popupFeatures() {
16
+ return `width=${Math.min(POPUP_SIZE.width, window.screen?.availWidth || POPUP_SIZE.width)},height=${Math.min(POPUP_SIZE.height, window.screen?.availHeight || POPUP_SIZE.height)},resizable=yes,scrollbars=yes`;
17
+ }
8
18
  /** 팝업이 메시지 없이 닫혔는지 보는 간격 */
9
19
  const POPUP_POLL_MS = 500;
10
20
  /** opener를 잃은 팝업 대비 — 결제 상태를 직접 조회하기 시작하는 시점(5초)과 그 뒤 간격(3초) */
@@ -66,7 +76,7 @@ function paymentResultOf(status, options = {}) {
66
76
  function browserEnv() {
67
77
  return {
68
78
  openPopup() {
69
- const popup = window.open("about:blank", POPUP_NAME, POPUP_FEATURES);
79
+ const popup = window.open("about:blank", POPUP_NAME, popupFeatures());
70
80
  if (!popup) return null;
71
81
  return {
72
82
  get closed() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayren/storefront-sdk",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
package/src/auth/index.ts CHANGED
@@ -120,21 +120,36 @@ export function createStorefrontAuth(options: StorefrontAuthOptions) {
120
120
  /**
121
121
  * 소셜 로그인 시작 — PKCE(S256)와 state를 만들고 공급자 로그인 주소를 받는다. 반환한 `state`·`codeVerifier`를
122
122
  * 서버 세션에 보관하고 구매자를 `url`로 보낸다. 로그인을 마치면 `redirectUri`로 `?code=&state=`가 붙어 돌아온다.
123
- * `redirectUri`는 스토어프론트 도메인 목록 안이어야 한다
123
+ * `redirectUri`는 스토어프론트 도메인 목록 안이어야 한다.
124
+ *
125
+ * 가입 화면에서 받은 약관 동의는 `agreements`로 함께 보낸다. **이 로그인으로 가입이 되는 경우에만** 이력에
126
+ * 남고(기존 회원의 로그인이면 무시한다), 보내지 않으면 가입은 되지만 필수 동의 이력이 없어
127
+ * `GET /me`의 `reconsentRequired`가 true다(첫 진입에서 `updateConsents()`로 받는다)
124
128
  */
125
- async idp(provider: SocialProvider, options: { redirectUri: string }): Promise<IdpStart> {
129
+ async idp(
130
+ provider: SocialProvider,
131
+ options: {
132
+ redirectUri: string;
133
+ agreements?: { terms: true; privacy: true; marketing?: boolean };
134
+ },
135
+ ): Promise<IdpStart> {
126
136
  const state = randomToken(24);
127
137
  const codeVerifier = randomToken(32);
128
138
  const { url } = await client().auth.idpAuthorize(provider, {
129
139
  redirectUri: options.redirectUri,
130
140
  codeChallenge: await s256(codeVerifier),
131
141
  state,
142
+ agreements: options.agreements && {
143
+ terms: true,
144
+ privacy: true,
145
+ marketing: options.agreements.marketing ?? false,
146
+ },
132
147
  });
133
148
  return { url, state, codeVerifier };
134
149
  },
135
150
  /**
136
151
  * 소셜 로그인 마무리 — 돌아온 `code`를 구매자 토큰으로 바꾼다. state가 다르거나 구매자가 취소했으면
137
- * `IdpCallbackError`. code는 1회용이고 1분 안에 바꿔야 한다
152
+ * `IdpCallbackError`. code는 1회용이고 1분 안에 바꿔야 한다. 약관 동의는 `idp()`에서 받는다
138
153
  */
139
154
  idpCallback(input: IdpCallbackInput & { error?: string | null }): Promise<TokenPair> {
140
155
  if (input.error) return Promise.reject(new IdpCallbackError(input.error));
package/src/client.ts CHANGED
@@ -56,6 +56,11 @@ import {
56
56
  type PageParams,
57
57
  pageSchema,
58
58
  } from "./schemas/common";
59
+ import {
60
+ type ConsentUpdateRequest,
61
+ consentUpdateRequestSchema,
62
+ memberConsentsSchema,
63
+ } from "./schemas/consent";
59
64
  import {
60
65
  type CreateCustomerInquiryRequest,
61
66
  type CustomerInquiryCategory,
@@ -335,6 +340,13 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
335
340
  me: () => http.request("GET", "/me", memberSchema),
336
341
  updateMe: (body: UpdateProfileRequest) =>
337
342
  http.requestVoid("PATCH", "/me", { body: updateProfileRequestSchema.parse(body) }),
343
+ /** 약관·개인정보·마케팅 동의의 현재 상태와 재동의 필요 여부 */
344
+ consents: () => http.request("GET", "/me/consents", memberConsentsSchema),
345
+ /** 재동의·마케팅 동의 변경 — 바꾼 뒤의 상태를 돌려준다 */
346
+ updateConsents: (body: ConsentUpdateRequest) =>
347
+ http.request("POST", "/me/consents", memberConsentsSchema, {
348
+ body: consentUpdateRequestSchema.parse(body),
349
+ }),
338
350
  listAddresses: () => http.request("GET", "/me/addresses", z.array(memberAddressSchema)),
339
351
  createAddress: (body: MemberAddressRequest) =>
340
352
  http.requestVoid("POST", "/me/addresses", { body: memberAddressRequestSchema.parse(body) }),
package/src/index.ts CHANGED
@@ -10,6 +10,7 @@ export * from "./schemas/catalog";
10
10
  export * from "./schemas/checkout";
11
11
  export * from "./schemas/claim";
12
12
  export * from "./schemas/common";
13
+ export * from "./schemas/consent";
13
14
  export * from "./schemas/customer-inquiry";
14
15
  export * from "./schemas/inquiry";
15
16
  export * from "./schemas/member";
@@ -112,7 +112,17 @@ export interface PaymentsEnv {
112
112
  const RETURN_PAYMENT_ID = "sayrenPaymentId";
113
113
  /** 팝업 이름 — 같은 이름으로 열면 결제창이 하나만 뜬다 */
114
114
  const POPUP_NAME = "sayren-payment";
115
- const POPUP_FEATURES = "width=500,height=720,resizable=yes,scrollbars=yes";
115
+ /**
116
+ * 결제 팝업 크기 — PG 결제창이 안에서 그대로 뜬다. KG이니시스 PC 결제창이 폭 800px 안팎이라 그보다 넓게 연다
117
+ * (포트원 샌드박스 확인). 화면이 더 작으면 화면에 맞춘다.
118
+ */
119
+ const POPUP_SIZE = { width: 860, height: 760 };
120
+
121
+ function popupFeatures(): string {
122
+ const width = Math.min(POPUP_SIZE.width, window.screen?.availWidth || POPUP_SIZE.width);
123
+ const height = Math.min(POPUP_SIZE.height, window.screen?.availHeight || POPUP_SIZE.height);
124
+ return `width=${width},height=${height},resizable=yes,scrollbars=yes`;
125
+ }
116
126
  /** 팝업이 메시지 없이 닫혔는지 보는 간격 */
117
127
  const POPUP_POLL_MS = 500;
118
128
  /** opener를 잃은 팝업 대비 — 결제 상태를 직접 조회하기 시작하는 시점(5초)과 그 뒤 간격(3초) */
@@ -182,7 +192,7 @@ export function paymentResultOf(
182
192
  function browserEnv(): PaymentsEnv {
183
193
  return {
184
194
  openPopup() {
185
- const popup = window.open("about:blank", POPUP_NAME, POPUP_FEATURES);
195
+ const popup = window.open("about:blank", POPUP_NAME, popupFeatures());
186
196
  if (!popup) return null;
187
197
  return {
188
198
  get closed() {
@@ -86,6 +86,20 @@ export type WithdrawalBlockedDetails = z.infer<typeof withdrawalBlockedDetailsSc
86
86
  export const socialProviderSchema = z.enum(["kakao", "naver", "google"]);
87
87
  export type SocialProvider = z.infer<typeof socialProviderSchema>;
88
88
 
89
+ /**
90
+ * 소셜 가입 화면에서 받은 필수·선택 동의 — 공급자로 보내기 전에 함께 보낸다.
91
+ *
92
+ * **이 흐름으로 회원이 처음 만들어질 때만 쓴다.** 이미 있는 회원의 로그인이면 무시한다(동의는 늘어나지 않는다).
93
+ * 보내지 않으면 필수 동의 이력이 남지 않아 `GET /me`의 `reconsentRequired`가 true가 되고,
94
+ * 스토어프론트가 첫 진입에서 `POST /me/consents`로 받는다(가입 자체는 거부하지 않는다).
95
+ */
96
+ export const idpAgreementsSchema = z.object({
97
+ terms: z.literal(true),
98
+ privacy: z.literal(true),
99
+ marketing: z.boolean().default(false),
100
+ });
101
+ export type IdpAgreements = z.infer<typeof idpAgreementsSchema>;
102
+
89
103
  /** `POST /auth/idp/{provider}/authorize` 본문 — PKCE(S256)와 state는 SDK가 만든다 */
90
104
  export const idpAuthorizeRequestSchema = z.object({
91
105
  /** 로그인을 마치고 돌아올 스토어프론트 주소. 스토어프론트 도메인 목록 안이어야 한다 */
@@ -94,6 +108,8 @@ export const idpAuthorizeRequestSchema = z.object({
94
108
  codeChallenge: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
95
109
  /** 스토어프론트가 만든 값 — 돌아올 때 그대로 붙어 온다. 세션에 저장해 두고 비교한다 */
96
110
  state: z.string().min(16).max(128),
111
+ /** 가입이 되는 경우 남길 동의. 기존 회원 로그인이면 무시한다 */
112
+ agreements: idpAgreementsSchema.optional(),
97
113
  });
98
114
  export type IdpAuthorizeRequest = z.infer<typeof idpAuthorizeRequestSchema>;
99
115
 
@@ -4,7 +4,7 @@ export const cartItemSchema = z.object({
4
4
  cartItemId: z.string(),
5
5
  productId: z.string(),
6
6
  productName: z.string(),
7
- thumbnailUrl: z.url(),
7
+ thumbnailUrl: z.url().nullable().describe("담은 상품의 대표 이미지. 없으면 null"),
8
8
  optionId: z.string().nullable(),
9
9
  optionName: z.string().nullable(),
10
10
  quantity: z.number().int(),
@@ -20,7 +20,7 @@ export const categoryNodeSchema: z.ZodType<CategoryNode> = z.lazy(() =>
20
20
  export const productCardSchema = z.object({
21
21
  productId: z.string(),
22
22
  name: z.string(),
23
- thumbnailUrl: z.url(),
23
+ thumbnailUrl: z.url().nullable().describe("대표 이미지 주소. 등록된 이미지가 없으면 null"),
24
24
  salePrice: z.number().int().describe("판매가. 원(KRW) 단위 정수"),
25
25
  discountedPrice: z
26
26
  .number()
@@ -22,6 +22,14 @@ export const createClaimRequestSchema = z.object({
22
22
  reasonDetail: z.string().max(1000).optional(),
23
23
  evidenceImages: z.array(z.url()).max(5).optional(),
24
24
  exchangeOptionId: z.string().optional(),
25
+ quantity: z
26
+ .number()
27
+ .int()
28
+ .min(1)
29
+ .optional()
30
+ .describe(
31
+ "취소·반품·교환할 수량. 생략하면 남은 수량 전체다. 남은 수량보다 크면 400 `INVALID_QUANTITY`",
32
+ ),
25
33
  });
26
34
 
27
35
  export type CreateClaimRequest = z.infer<typeof createClaimRequestSchema>;
@@ -29,8 +37,21 @@ export type CreateClaimRequest = z.infer<typeof createClaimRequestSchema>;
29
37
  export const createClaimResultSchema = z.object({
30
38
  claimId: z.string(),
31
39
  status: z.literal("REQUESTED"),
32
- expectedRefundAmount: z.number().int().nullable(),
33
- claimDeliveryFee: z.number().int(),
40
+ expectedRefundAmount: z
41
+ .number()
42
+ .int()
43
+ .nullable()
44
+ .describe(
45
+ "예상 환불액 — 수량 비율 상품 금액 − 반품 배송비. **배송비 환불은 여기 포함되지 않고 " +
46
+ "`deliveryFeeRefundAmount`로 따로 온다**(승인 시점의 배송 묶음 상태로 확정되기 때문이다). " +
47
+ "교환은 환불이 없어 null이다",
48
+ ),
49
+ claimDeliveryFee: z.number().int().describe("구매자가 부담하는 반품·교환 배송비. 원 단위"),
50
+ quantity: z.number().int().describe("접수된 수량. 요청에서 생략하면 남은 수량 전체다"),
51
+ deliveryFeeRefundAmount: z
52
+ .number()
53
+ .int()
54
+ .describe("환불 예정 배송비. 배송 묶음이 모두 취소되거나 판매자 귀책일 때만 0보다 크다"),
34
55
  });
35
56
 
36
57
  export type CreateClaimResult = z.infer<typeof createClaimResultSchema>;
@@ -41,8 +62,24 @@ export const myClaimSchema = z.object({
41
62
  status: claimStatusSchema,
42
63
  orderItemId: z.string(),
43
64
  productName: z.string(),
65
+ quantity: z.number().int().describe("접수된 수량"),
44
66
  reason: z.string(),
45
- expectedRefundAmount: z.number().int().nullable(),
67
+ expectedRefundAmount: z
68
+ .number()
69
+ .int()
70
+ .nullable()
71
+ .describe(
72
+ "예상 환불액 — 수량 비율 상품 금액 − 반품 배송비 − 조건부 무료배송 미달 차감. " +
73
+ "**배송비 환불은 포함되지 않고 `expectedDeliveryFeeRefundAmount`로 따로 온다.** 교환은 null이다",
74
+ ),
75
+ expectedDeliveryFeeRefundAmount: z
76
+ .number()
77
+ .int()
78
+ .nullable()
79
+ .describe(
80
+ "예상 배송비 환불액. 배송 묶음이 모두 취소되거나 판매자 귀책일 때만 0보다 크다. " +
81
+ "이 필드가 생기기 전에 접수된 클레임은 null이다",
82
+ ),
46
83
  rejectReason: z.string().nullable(),
47
84
  requestedAt: z.string(),
48
85
  completedAt: z.string().nullable(),
@@ -0,0 +1,72 @@
1
+ import { z } from "zod";
2
+
3
+ /**
4
+ * 동의 종류 — 이용약관(`TERMS`)·개인정보 수집이용(`PRIVACY`)은 가입 필수, 마케팅 수신(`MARKETING`)은 선택이다.
5
+ * 필수 동의는 철회할 수 없다(철회 = 탈퇴).
6
+ */
7
+ export const consentKindSchema = z.enum(["TERMS", "PRIVACY", "MARKETING"]);
8
+ export type ConsentKind = z.infer<typeof consentKindSchema>;
9
+
10
+ /** 동의 이력의 한 줄이 무엇인가 — 동의했거나 철회했다 */
11
+ export const consentActionSchema = z.enum(["AGREED", "WITHDRAWN"]);
12
+ export type ConsentAction = z.infer<typeof consentActionSchema>;
13
+
14
+ /**
15
+ * 동의가 일어난 경로. 값이 추가될 수 있어 모르는 값은 그대로 보여 준다.
16
+ * `SIGNUP` 비밀번호 가입 · `SOCIAL_SIGNUP` 소셜 가입 · `DELEGATED` 셀러 자체 회원 연동 ·
17
+ * `RECONSENT` 약관 개정 재동의 · `MEMBER_UPDATE` 구매자가 직접 변경 · `SELLER` 셀러가 처리
18
+ */
19
+ export const consentSourceSchema = z.enum([
20
+ "SIGNUP",
21
+ "SOCIAL_SIGNUP",
22
+ "DELEGATED",
23
+ "RECONSENT",
24
+ "MEMBER_UPDATE",
25
+ "SELLER",
26
+ ]);
27
+ export type ConsentSource = z.infer<typeof consentSourceSchema>;
28
+
29
+ /** 종류별 현재 동의 상태 */
30
+ export const consentStateSchema = z.object({
31
+ kind: consentKindSchema,
32
+ agreed: z.boolean(),
33
+ /** 동의한 약관 버전. 마케팅은 버전이 없어 null이고, 동의 이력이 없으면 null이다 */
34
+ agreedVersion: z.string().nullable(),
35
+ /** 스토어의 현재 약관 버전. 마케팅은 null */
36
+ currentVersion: z.string().nullable(),
37
+ /**
38
+ * 스토어가 정한 현재 약관 문서 주소. 재동의 화면에서 이 주소를 보여 준다.
39
+ * 스토어가 정하지 않았거나 마케팅이면 null이다(동의한 시점의 주소는 셀러가 보는 이력에 남는다).
40
+ */
41
+ currentDocumentUrl: z.string().nullable(),
42
+ /** 마지막으로 동의·철회한 시각. 이력이 없으면 null */
43
+ updatedAt: z.string().nullable(),
44
+ /** 약관이 개정돼 다시 받아야 하는가. 마케팅은 항상 false */
45
+ reconsentRequired: z.boolean(),
46
+ });
47
+ export type ConsentState = z.infer<typeof consentStateSchema>;
48
+
49
+ /** `GET /storefront/v1/me/consents` 응답 */
50
+ export const memberConsentsSchema = z.object({
51
+ terms: consentStateSchema,
52
+ privacy: consentStateSchema,
53
+ marketing: consentStateSchema,
54
+ /** 필수 동의 중 하나라도 다시 받아야 하면 true — `POST /me/consents`로 받는다 */
55
+ reconsentRequired: z.boolean(),
56
+ });
57
+ export type MemberConsents = z.infer<typeof memberConsentsSchema>;
58
+
59
+ /**
60
+ * `POST /storefront/v1/me/consents` 본문 — 바꿀 항목만 보낸다.
61
+ * 필수 동의는 동의(`true`)만 보낼 수 있다. 이미 현재 버전에 동의한 항목은 이력을 더 남기지 않는다.
62
+ */
63
+ export const consentUpdateRequestSchema = z
64
+ .object({
65
+ terms: z.literal(true).optional().describe("이용약관 재동의"),
66
+ privacy: z.literal(true).optional().describe("개인정보 수집이용 재동의"),
67
+ marketing: z.boolean().optional().describe("마케팅 수신 동의(false면 철회)"),
68
+ })
69
+ .refine((value) => Object.values(value).some((v) => v !== undefined), {
70
+ message: "최소 1개 항목이 필요합니다",
71
+ });
72
+ export type ConsentUpdateRequest = z.infer<typeof consentUpdateRequestSchema>;
@@ -9,6 +9,12 @@ export const memberSchema = z.object({
9
9
  point: z.number().int(),
10
10
  marketingAgreed: z.boolean(),
11
11
  joinedAt: z.string(),
12
+ reconsentRequired: z
13
+ .boolean()
14
+ .describe(
15
+ "약관이 개정돼 필수 동의를 다시 받아야 하는가. true면 `GET /me/consents`로 어떤 항목인지 확인하고 " +
16
+ "`POST /me/consents`로 받는다. 받기 전에도 스토어 이용은 막히지 않는다",
17
+ ),
12
18
  });
13
19
 
14
20
  export type Member = z.infer<typeof memberSchema>;
@@ -6,9 +6,20 @@ export const myOrderItemSchema = z.object({
6
6
  orderItemId: z.string(),
7
7
  productId: z.string(),
8
8
  productName: z.string(),
9
- thumbnailUrl: z.url(),
9
+ thumbnailUrl: z.url().nullable().describe("주문 시점의 대표 이미지. 없었으면 null"),
10
10
  optionName: z.string().nullable(),
11
- quantity: z.number().int(),
11
+ quantity: z.number().int().describe("주문 수량"),
12
+ // 두 수량은 서버가 언제나 함께 싣는다. `store-sdk`의 `orderItemSchema`와 같은 규칙으로 **둘 다 필수**다 —
13
+ // 응답 스키마는 OpenAPI 계약이기도 해서 기본값을 두면 선택 필드로 문서화되고, 필드가 빠진 응답이
14
+ // 조용히 0으로 읽혀 남은 수량을 잘못 계산한다
15
+ canceledQuantity: z
16
+ .number()
17
+ .int()
18
+ .describe("취소·반품으로 환불된 누적 수량. 부분 취소가 없었으면 0이다"),
19
+ activeQuantity: z
20
+ .number()
21
+ .int()
22
+ .describe("남은 수량 (`quantity` − `canceledQuantity`). 취소·반품·교환 요청 수량의 상한이다"),
12
23
  totalPrice: z.number().int(),
13
24
  status: orderItemStatusSchema,
14
25
  claimStatus: z.string().nullable(),
@@ -32,7 +32,7 @@ export const writableReviewSchema = z.object({
32
32
  productId: z.string(),
33
33
  productName: z.string(),
34
34
  optionName: z.string().nullable(),
35
- thumbnailUrl: z.url(),
35
+ thumbnailUrl: z.url().nullable().describe("주문 시점의 대표 이미지. 없었으면 null"),
36
36
  writableUntil: z.string(),
37
37
  });
38
38