@sayren/store-sdk 0.30.7 → 0.30.9

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.
@@ -130,6 +130,8 @@ export const storefrontSlugSchema = z
130
130
 
131
131
  /** 바꾼 슬러그를 다른 사이트가 가져가지 못하게 막는 기간(일). 보류 동안 옛 주소는 새 주소로 301한다 */
132
132
  export const STOREFRONT_SLUG_HOLD_DAYS = 90;
133
+ /** 닫은 사이트(호스팅 끄기·상점 폐쇄)의 주소 보류·보관 기간(일, 2026-10-07). 지나면 주소가 풀리고 사이트가 지워진다 */
134
+ export const STOREFRONT_CLOSED_SITE_HOLD_DAYS = 30;
133
135
  /** 슬러그 변경 한도 — 이 기간(일) 안에 */
134
136
  export const STOREFRONT_SLUG_CHANGE_WINDOW_DAYS = 30;
135
137
  /** 슬러그 변경 한도 — 횟수(상점 단위. 끄고 다시 만들어도 이어서 센다) */
@@ -163,10 +165,66 @@ export const storefrontTemplateSchema = z.object({
163
165
  .string()
164
166
  .nullable()
165
167
  .default(null)
166
- .describe("공식 쇼케이스 사이트 주소. 연결된 쇼케이스가 공개 중일 때만 싣고 그 밖에는 null"),
168
+ .describe(
169
+ "미리보기 사이트 주소. 공식 템플릿은 연결된 쇼케이스, 템플릿 상점의 템플릿은 그 상점의 사이트가 공개 중일 때만 싣고 그 밖에는 null",
170
+ ),
171
+ source: z
172
+ .enum(["CATALOG", "STORE"])
173
+ .default("CATALOG")
174
+ .describe(
175
+ "`CATALOG` 공식 템플릿 · `STORE` 템플릿 상점의 템플릿(사이트를 만들 때 `copyContent`로 콘텐츠를 복사할 수 있다). 옛 서버 응답은 `CATALOG`로 읽는다",
176
+ ),
167
177
  });
168
178
  export type StorefrontTemplate = z.infer<typeof storefrontTemplateSchema>;
169
179
 
180
+ // ─── 템플릿 상점 (#123) ────────────────────────────────────
181
+
182
+ /**
183
+ * 템플릿 상점의 템플릿 정보 — 상점을 만들 때 템플릿 상점으로 고른 상점만 있다. 발행한 스토어프론트가 템플릿이 되고, 이 이름·소개·
184
+ * 썸네일로 모든 셀러의 템플릿 목록에 보인다
185
+ */
186
+ export const storeTemplateSchema = z.object({
187
+ templateId: z.string().describe("템플릿 id. 다른 상점이 사이트를 만들 때 이 값을 쓴다"),
188
+ name: z.string().describe("템플릿 이름"),
189
+ description: z.string().describe("템플릿 소개"),
190
+ thumbnailUrl: z.string().nullable().describe("썸네일 이미지 주소. 없으면 null"),
191
+ status: z
192
+ .enum(["DRAFT", "ACTIVE", "RETIRED"])
193
+ .describe(
194
+ "`DRAFT` 아직 편집한 스토어프론트를 발행하지 않아 목록에 보이지 않음 · `ACTIVE` 목록에 보임 · `RETIRED` 상점을 닫아 내려감",
195
+ ),
196
+ version: z
197
+ .string()
198
+ .nullable()
199
+ .describe("목록에 보이는 템플릿 버전. 발행한 스토어프론트 버전에서 정해진다. `DRAFT`면 null"),
200
+ });
201
+ export type StoreTemplate = z.infer<typeof storeTemplateSchema>;
202
+
203
+ /**
204
+ * 템플릿 상점의 고정 사업자 정보 필드 — 상점 수정에서 다른 값을 보내면 409 `TEMPLATE_STORE_BUSINESS_LOCKED`다(값은 플랫폼이 정한다)
205
+ */
206
+ export const TEMPLATE_STORE_LOCKED_BUSINESS_FIELDS = [
207
+ "businessName",
208
+ "representativeName",
209
+ "businessNumber",
210
+ "mailOrderSalesNumber",
211
+ "customerCenterPhone",
212
+ "customerCenterEmail",
213
+ ] as const;
214
+
215
+ export const updateStoreTemplateRequestSchema = z.object({
216
+ name: z.string().trim().min(1).max(40).describe("템플릿 이름(1~40자)"),
217
+ description: z.string().trim().max(200).describe("템플릿 소개(200자까지)"),
218
+ thumbnailUrl: z
219
+ .url({ protocol: /^https$/ })
220
+ .max(2048)
221
+ .nullable()
222
+ .describe(
223
+ "썸네일 이미지 주소(https). 이미지 업로드(`POST /v1/uploads`)로 받은 주소를 쓴다. 없으면 null",
224
+ ),
225
+ });
226
+ export type UpdateStoreTemplateRequest = z.infer<typeof updateStoreTemplateRequestSchema>;
227
+
170
228
  // ─── 버전 ─────────────────────────────────────────────────
171
229
 
172
230
  /**
@@ -281,6 +339,14 @@ export const storefrontSuspensionSchema = z.object({
281
339
  });
282
340
  export type StorefrontSuspension = z.infer<typeof storefrontSuspensionSchema>;
283
341
 
342
+ /** 사이트 첫 화면 스냅샷 — 발행·되돌리기로 발행 버전이 바뀌면 반영된 뒤 다시 찍는다(데스크톱 1280×800) */
343
+ export const storefrontSiteSnapshotSchema = z.object({
344
+ url: z.string().describe("스냅샷 이미지 주소 (jpeg)"),
345
+ versionId: z.string().nullable().describe("스냅샷이 보여 주는 발행 버전"),
346
+ capturedAt: z.string().nullable().describe("찍은 시각 (ISO 8601)"),
347
+ });
348
+ export type StorefrontSiteSnapshot = z.infer<typeof storefrontSiteSnapshotSchema>;
349
+
284
350
  export const storefrontSiteSchema = z.object({
285
351
  siteId: z.string(),
286
352
  slug: z.string().describe("주소 슬러그"),
@@ -303,6 +369,10 @@ export const storefrontSiteSchema = z.object({
303
369
  .nullable()
304
370
  .optional()
305
371
  .describe("정지 정보. `status`가 `SUSPENDED`일 때만 있고 그 밖은 null"),
372
+ snapshot: storefrontSiteSnapshotSchema
373
+ .nullable()
374
+ .optional()
375
+ .describe("사이트 첫 화면 스냅샷. 발행한 버전이 반영되면 찍고, 아직 찍지 않았으면 null"),
306
376
  createdAt: z.string(),
307
377
  updatedAt: z.string(),
308
378
  });
@@ -351,7 +421,7 @@ export const storefrontDeploymentLogSchema = z.object({
351
421
  code: z
352
422
  .string()
353
423
  .describe(
354
- "기록 종류 (`SITE_CREATED`·`ADDRESS_RESERVED`·`WAITING`·`SYNCING`·`VERSION_UPLOADED`·`SYNC_FAILED`·`RETRY_SCHEDULED`·`PUBLISHED`)",
424
+ "기록 종류 (`SITE_CREATED`·`ADDRESS_RESERVED`·`WAITING`·`SYNCING`·`VERSION_UPLOADED`·`SYNC_FAILED`·`RETRY_SCHEDULED`·`PUBLISHED`, 템플릿 상점의 템플릿은 `BUILDING`·`BUILD_FAILED`·`CONTENT_COPYING`·`CONTENT_COPIED`·`CONTENT_COPY_FAILED`)",
355
425
  ),
356
426
  message: z.string().describe("사람이 읽는 문장"),
357
427
  });
@@ -380,6 +450,12 @@ export type StorefrontDeployment = z.infer<typeof storefrontDeploymentSchema>;
380
450
  export const createStorefrontSiteRequestSchema = z.object({
381
451
  templateId: z.string().min(1).max(64).describe("템플릿 id"),
382
452
  slug: storefrontSlugSchema.optional().describe("주소 슬러그. 생략하면 상점 코드"),
453
+ copyContent: z
454
+ .boolean()
455
+ .optional()
456
+ .describe(
457
+ "템플릿 상점의 템플릿일 때만 — true면 템플릿 상점의 콘텐츠(레이아웃, 상품·카테고리·컬렉션·주문 흐름·배송·환불 정책)를 이 상점으로 복사한다. 쿠폰·적립금·리뷰는 복사하지 않는다. 생략하거나 false면 레이아웃 콘텐츠를 비우고 빌드한다",
458
+ ),
383
459
  });
384
460
  export type CreateStorefrontSiteRequest = z.infer<typeof createStorefrontSiteRequestSchema>;
385
461