@sayren/storefront-sdk 0.20.9 → 0.20.10

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 { Bt as ApiError, t as createStorefrontClient } from "../client-vjq513VD.mjs";
1
+ import { Ht as ApiError, t as createStorefrontClient } from "../client-DJjcGd_M.mjs";
2
2
  //#region src/auth/index.ts
3
3
  /** 소셜 로그인 실패 — 구매자가 취소했거나(`access_denied`) state가 맞지 않는다 */
4
4
  var IdpCallbackError = class extends Error {
@@ -1,5 +1,5 @@
1
1
  import { a as ANALYTICS_VISITOR_HEADER, r as ANALYTICS_SESSION_HEADER } from "./analytics-CgD70OqH.mjs";
2
- import { $ as customInputViewSchema, A as retryPaymentRequestSchema, F as applicableCouponSchema, I as checkoutPricingRequestSchema, J as addonGroupViewSchema, K as storefrontCouponSchema, L as checkoutPricingSchema, M as startPaymentRequestSchema, T as paymentStatusSchema, U as myCouponSchema, d as checkoutSessionSchema, dt as pickupLocationViewSchema, et as lineSelectionRequestShape, f as createCheckoutRequestSchema, ft as productCardFulfillmentSchema, h as easyPayProviderResponseSchema, k as responsePaymentMethodSchema, lt as lineFulfillmentSchema, m as deliveryQuoteSchema, ot as calendarDayViewSchema, p as deliveryQuoteRequestSchema, pt as productFulfillmentViewSchema, tt as lineSelectionResponseShape, ut as myOrderItemFulfillmentSnapshotSchema, w as paymentStartSchema } from "./checkout-BjJ4Efbn.mjs";
2
+ import { $ as customInputViewSchema, A as retryPaymentRequestSchema, F as applicableCouponSchema, I as checkoutPricingRequestSchema, J as addonGroupViewSchema, K as storefrontCouponSchema, L as checkoutPricingSchema, M as startPaymentRequestSchema, T as paymentStatusSchema, U as myCouponSchema, d as checkoutSessionSchema, dt as pickupLocationViewSchema, et as lineSelectionRequestShape, f as createCheckoutRequestSchema, ft as productCardFulfillmentSchema, h as easyPayProviderResponseSchema, it as orderInputUploadRequestSchema, k as responsePaymentMethodSchema, lt as lineFulfillmentSchema, m as deliveryQuoteSchema, ot as calendarDayViewSchema, p as deliveryQuoteRequestSchema, pt as productFulfillmentViewSchema, tt as lineSelectionResponseShape, ut as myOrderItemFulfillmentSnapshotSchema, w as paymentStartSchema } from "./checkout-BjJ4Efbn.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/http.ts
5
5
  /** 표준 엔벨로프의 $.error 상세 */
@@ -525,9 +525,10 @@ const myClaimSchema = z.object({
525
525
  */
526
526
  const flowInputFieldSchema = z.object({
527
527
  key: z.string(),
528
- type: z.string().describe("text · number · select · date · datetime · image (늘어날 수 있다)"),
528
+ type: z.string().describe("text · textarea · number · select · radio · checkbox · boolean · date · datetime · image (늘어날 수 있다). 값: checkbox는 고른 선택지 배열, boolean은 참거짓(필수면 true), date는 `YYYY-MM-DD`, datetime은 오프셋 있는 ISO 8601, image는 https 주소 배열"),
529
529
  required: z.boolean(),
530
530
  label: z.string(),
531
+ placeholder: z.string().optional().describe("입력 안내"),
531
532
  maxLength: z.number().int().optional(),
532
533
  maxFiles: z.number().int().optional(),
533
534
  options: z.array(z.union([z.string(), z.number()])).optional()
@@ -566,9 +567,51 @@ const flowStateSchema = z.object({
566
567
  enteredAt: z.string(),
567
568
  deadlineAt: z.string().optional().describe("가장 가까운 기한(ISO 8601)"),
568
569
  attachments: z.array(z.string()).optional().describe("가장 최근 행동이 붙인 첨부 주소(시안 등, #115). 없으면 생략"),
570
+ inputs: z.object({
571
+ by: z.string().describe("적은 사람 — seller · buyer"),
572
+ values: z.array(z.object({
573
+ key: z.string(),
574
+ label: z.string(),
575
+ type: z.string(),
576
+ value: z.union([
577
+ z.string(),
578
+ z.number(),
579
+ z.boolean(),
580
+ z.array(z.string())
581
+ ])
582
+ }))
583
+ }).optional().describe("이 상태로 오게 한 행동의 입력값(수정 내용 등, #115). 없으면 생략"),
569
584
  progress: z.boolean().optional(),
570
585
  fields: z.record(z.string(), flowFieldValueSchema).describe("구매자 공개 범위의 커스텀 필드")
571
586
  });
587
+ /**
588
+ * 주문상품의 지금 단계(#115) — 구매자 화면이 흐름 구조를 몰라도 그릴 수 있게 서버가 정리한 값이다. `type`으로 화면 모양을 고르고,
589
+ * `actions`(입력 칸 포함)로 버튼·폼을 그린다. 판정은 서버다.
590
+ */
591
+ const ORDER_STEP_TYPES = [
592
+ "BUYER_ACTION",
593
+ "SELLER_PROCESSING",
594
+ "IN_DELIVERY",
595
+ "DELIVERED",
596
+ "COMPLETED",
597
+ "CANCELED",
598
+ "CLAIM_IN_PROGRESS"
599
+ ];
600
+ const orderStepSchema = z.object({
601
+ type: z.string().describe("BUYER_ACTION 구매자 확인·입력 필요 · SELLER_PROCESSING 판매자 처리 중 · IN_DELIVERY 배송 중 · DELIVERED 배송·제공 완료 · COMPLETED 구매확정 · CANCELED 취소 · CLAIM_IN_PROGRESS 취소·반품·교환 처리 중. 값이 늘어날 수 있다(모르는 값은 SELLER_PROCESSING처럼 보인다)"),
602
+ label: z.string().describe("지금 상태 이름(구매자용)"),
603
+ message: z.string().optional().describe("판매자가 둔 안내문"),
604
+ deadlineAt: z.string().optional().describe("가장 가까운 기한(ISO 8601)"),
605
+ attachments: z.array(z.string()).optional().describe("판매자가 올린 자료(시안 등)"),
606
+ inputs: flowStateSchema.shape.inputs,
607
+ actions: z.array(flowActionSchema).describe("이 단계에서 구매자가 할 행동(입력 칸 포함). `BUYER_ACTION`이면 하나 이상이다. 취소·반품 요청·구매확정은 `actions`(주문상품)에 있다"),
608
+ data: z.object({ delivery: z.object({
609
+ carrierName: z.string().nullable(),
610
+ trackingNumber: z.string().nullable(),
611
+ trackingUrl: z.string().nullable(),
612
+ dispatchedAt: z.string()
613
+ }).optional().describe("`IN_DELIVERY` — 발송 정보") }).optional().describe("단계별 부가 정보. 없으면 생략")
614
+ });
572
615
  const flowActionRequestSchema = z.object({ input: z.record(z.string(), z.unknown()).optional() });
573
616
  /** 비회원 행동 — 비회원 주문 조회와 같은 확인(연락처·주문 조회 비밀번호)을 함께 보낸다 */
574
617
  const guestFlowActionRequestSchema = flowActionRequestSchema.extend({
@@ -802,7 +845,8 @@ const myOrderItemSchema = z.object({
802
845
  autoDecisionDate: z.string().nullable(),
803
846
  flowState: flowStateSchema.optional().describe("주문 플로우의 지금 상태(이슈 #115). 플로우가 없는 주문상품은 없다"),
804
847
  actions: z.array(flowActionSchema).optional().describe("지금 할 수 있는 행동. 화면은 이 목록으로 버튼을 그린다(상태 이름으로 분기하지 않는다)"),
805
- flowBranches: z.array(flowStateSchema).optional().describe("진행 위치가 둘 이상(병렬 진행·하위 흐름)이면 각 위치의 상태. `flowState`는 그 가운데 가장 앞 단계다")
848
+ flowBranches: z.array(flowStateSchema).optional().describe("진행 위치가 둘 이상(병렬 진행·하위 흐름)이면 각 위치의 상태. `flowState`는 그 가운데 가장 앞 단계다"),
849
+ step: orderStepSchema.optional().describe("지금 단계 요약(#115) — `type`으로 화면을 고르고 `actions`의 입력 칸으로 폼을 그린다. 플로우가 없는 주문상품은 없다")
806
850
  });
807
851
  /**
808
852
  * 주문 응답의 배송지 — 결제 요청 시 저장된 스냅샷. 요청 스키마(`shippingAddressInputSchema`)와 분리한 응답 스키마라
@@ -1167,7 +1211,13 @@ get: () => http.request("GET", "/store", storefrontStoreSchema) },
1167
1211
  get: () => http.request("GET", "/cart", cartSchema),
1168
1212
  addItem: (body) => http.request("POST", "/cart/items", cartSchema, { body: addCartItemRequestSchema.parse(body) }),
1169
1213
  updateItem: (cartItemId, body) => http.request("PATCH", path`/cart/items/${cartItemId}`, cartSchema, { body: updateCartItemRequestSchema.parse(body) }),
1170
- removeItem: (cartItemId) => http.requestVoid("DELETE", path`/cart/items/${cartItemId}`)
1214
+ removeItem: (cartItemId) => http.requestVoid("DELETE", path`/cart/items/${cartItemId}`),
1215
+ /**
1216
+ * 직접 입력 이미지(`type: "image"`) 업로드 자리 — 응답 `uploadUrl`에 파일을 PUT한 뒤 `url`을 담기·바로 구매의
1217
+ * `customInputs` 값에 넣는다(여러 장이면 줄바꿈으로 잇는다). 비회원도 부를 수 있다.
1218
+ * 형식·크기가 맞지 않으면 400 `UNSUPPORTED_FILE_TYPE`·413 `FILE_TOO_LARGE`, 연타하면 429 `TOO_MANY_REQUESTS`다
1219
+ */
1220
+ createInputImageUpload: (body) => http.request("POST", "/uploads/order-inputs", uploadTicketSchema, { body: orderInputUploadRequestSchema.parse(body) })
1171
1221
  },
1172
1222
  checkout: {
1173
1223
  create: (body) => http.request("POST", "/checkout", checkoutSessionSchema, { body: createCheckoutRequestSchema.parse(body) }),
@@ -1307,4 +1357,4 @@ get: () => http.request("GET", "/store", storefrontStoreSchema) },
1307
1357
  };
1308
1358
  }
1309
1359
  //#endregion
1310
- export { claimReturnAddressSchema as $, wishlistAddResultSchema as A, idpAuthorizeResponseSchema as At, consentSourceSchema as B, ApiError as Bt, orderShippingAddressSchema as C, addCartItemRequestSchema as Ct, memberAddressSchema as D, anonymousSessionSchema as Dt, memberAddressRequestSchema as E, updateCartItemRequestSchema as Et, createCustomerInquiryRequestSchema as F, signupRequestSchema as Ft, flowActionResultSchema as G, consentUpdateRequestSchema as H, toApiError as Ht, customerInquiryCategorySchema as I, socialProviderSchema as It, flowInputFieldSchema as J, flowActionSchema as K, customerInquirySchema as L, tokenPairSchema as Lt, createInquiryResultSchema as M, linkIdentityRequestSchema as Mt, productInquiryCategorySchema as N, loginRequestSchema as Nt, memberSchema as O, idpAgreementsSchema as Ot, publicInquirySchema as P, memberIdentitiesSchema as Pt, claimReasonSchema as Q, consentActionSchema as R, withdrawRequestSchema as Rt, myOrderSchema as S, pageSchema as St, trackingStageResponseSchema as T, cartSchema as Tt, memberConsentsSchema as U, unwrapData as Ut, consentStateSchema as V, buildQuery as Vt, flowActionRequestSchema as W, guestFlowActionRequestSchema as X, flowStateSchema as Y, orderFlowActionResultSchema as Z, memberPointEntrySchema as _, storefrontCollectionListQuerySchema as _t, myReviewSchema as a, formatOrderNo as at, deliveryTrackingSchema as b, orderItemStatusSchema as bt, publicReviewSchema as c, collectionProductPageSchema as ct, reviewSummarySchema as d, productCardSchema as dt, claimTypeSchema as et, updateReviewRequestSchema as f, productDetailSchema as ft, memberPointEntryPageSchema as g, storefrontCollectionDetailSchema as gt, writableReviewSchema as h, productSortSchema as ht, createReviewResultSchema as i, commerceNumberField as it, createInquiryRequestSchema as j, idpTokenRequestSchema as jt, updateProfileRequestSchema as k, idpAuthorizeRequestSchema as kt, reviewImageUploadRequestSchema as l, collectionProductQuerySchema as lt, uploadTicketSchema as m, productPageSchema as mt, storefrontStoreSchema as n, createClaimResultSchema as nt, productReviewQuerySchema as o, parseOrderNo as ot, updateReviewResultSchema as p, productFacetsSchema as pt, flowFieldValueSchema as q, createReviewRequestSchema as r, myClaimSchema as rt, productReviewSortSchema as s, categoryNodeSchema as st, createStorefrontClient as t, createClaimRequestSchema as tt, reviewPageSchema as u, collectionProductSortSchema as ut, memberPointsSchema as v, storefrontCollectionSchema as vt, purchaseDecisionResultSchema as w, cartItemSchema as wt, myOrderItemSchema as x, pageInfoSchema as xt, storefrontPointPolicySchema as y, claimStatusSchema as yt, consentKindSchema as z, withdrawalBlockedDetailsSchema as zt };
1360
+ export { orderStepSchema as $, wishlistAddResultSchema as A, idpAgreementsSchema as At, consentSourceSchema as B, withdrawRequestSchema as Bt, orderShippingAddressSchema as C, pageInfoSchema as Ct, memberAddressSchema as D, cartSchema as Dt, memberAddressRequestSchema as E, cartItemSchema as Et, createCustomerInquiryRequestSchema as F, loginRequestSchema as Ft, flowActionRequestSchema as G, unwrapData as Gt, consentUpdateRequestSchema as H, ApiError as Ht, customerInquiryCategorySchema as I, memberIdentitiesSchema as It, flowFieldValueSchema as J, flowActionResultSchema as K, customerInquirySchema as L, signupRequestSchema as Lt, createInquiryResultSchema as M, idpAuthorizeResponseSchema as Mt, productInquiryCategorySchema as N, idpTokenRequestSchema as Nt, memberSchema as O, updateCartItemRequestSchema as Ot, publicInquirySchema as P, linkIdentityRequestSchema as Pt, orderFlowActionResultSchema as Q, consentActionSchema as R, socialProviderSchema as Rt, myOrderSchema as S, orderItemStatusSchema as St, trackingStageResponseSchema as T, addCartItemRequestSchema as Tt, memberConsentsSchema as U, buildQuery as Ut, consentStateSchema as V, withdrawalBlockedDetailsSchema as Vt, ORDER_STEP_TYPES as W, toApiError as Wt, flowStateSchema as X, flowInputFieldSchema as Y, guestFlowActionRequestSchema as Z, memberPointEntrySchema as _, productSortSchema as _t, myReviewSchema as a, myClaimSchema as at, deliveryTrackingSchema as b, storefrontCollectionSchema as bt, publicReviewSchema as c, parseOrderNo as ct, reviewSummarySchema as d, collectionProductQuerySchema as dt, claimReasonSchema as et, updateReviewRequestSchema as f, collectionProductSortSchema as ft, memberPointEntryPageSchema as g, productPageSchema as gt, writableReviewSchema as h, productFacetsSchema as ht, createReviewResultSchema as i, createClaimResultSchema as it, createInquiryRequestSchema as j, idpAuthorizeRequestSchema as jt, updateProfileRequestSchema as k, anonymousSessionSchema as kt, reviewImageUploadRequestSchema as l, categoryNodeSchema as lt, uploadTicketSchema as m, productDetailSchema as mt, storefrontStoreSchema as n, claimTypeSchema as nt, productReviewQuerySchema as o, commerceNumberField as ot, updateReviewResultSchema as p, productCardSchema as pt, flowActionSchema as q, createReviewRequestSchema as r, createClaimRequestSchema as rt, productReviewSortSchema as s, formatOrderNo as st, createStorefrontClient as t, claimReturnAddressSchema as tt, reviewPageSchema as u, collectionProductPageSchema as ut, memberPointsSchema as v, storefrontCollectionDetailSchema as vt, purchaseDecisionResultSchema as w, pageSchema as wt, myOrderItemSchema as x, claimStatusSchema as xt, storefrontPointPolicySchema as y, storefrontCollectionListQuerySchema as yt, consentKindSchema as z, tokenPairSchema as zt };