@sayren/store-sdk 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4451,6 +4451,16 @@ const sellerAddressRequestSchema = z.object({
4451
4451
  * - 409 `STOREFRONT_BUILD_IN_PROGRESS` — 이 사이트에 끝나지 않은 빌드가 있다(사이트당 하나)
4452
4452
  * - 404 `STOREFRONT_BUILD_NOT_FOUND`
4453
4453
  * - 502 `STOREFRONT_SANDBOX_UNAVAILABLE` — 편집 Sandbox 호출이 실패했다. 잠시 뒤 다시 한다
4454
+ *
4455
+ * 소스 내려받기·올리기(#60, `/v1/storefront/site/source/**`, `sayren` CLI):
4456
+ * - 409 `SOURCE_CHANGED` — 작업 트리가 내려받은 뒤(`expectedBaseRef`) 바뀌었다(콘솔·AI 편집). `error.details.currentRef`
4457
+ * - 409 `EDIT_SESSION_OPEN` — 편집 환경이 열려 있다. `endEditSession: true`로 끄고 진행할 수 있다
4458
+ * - 409 `SOURCE_BLOBS_MISSING` — 올리지 않은 파일 내용이 있다(`error.details.hashes`). `POST source/blobs`로 올리고 다시 한다
4459
+ * - 409 `DEPENDENCY_REJECTED` — 쓸 수 없는 npm 의존성이다(`error.details.rejected: [{ name, version, reason, detail }]`)
4460
+ * - 413 `SOURCE_TOO_MANY_NEW_FILES` — 한 번에 새 내용이 800개를 넘는다(`error.details.max`). 나눠서 바꾼다
4461
+ * - 400 `DEPENDENCY_FILES_MISMATCH` — `packageJson`·`lockfile` 내용이 목록의 해시와 다르거나 빠졌다
4462
+ * - 400 `INVALID_SOURCE_REF` · `BLOB_HASH_MISMATCH` · `INVALID_FILE_PATH`(`.env*`·작업 트리 밖 경로)
4463
+ * - 404 `STOREFRONT_SOURCE_NOT_FOUND` — 그 스냅샷이 없다
4454
4464
  */
4455
4465
  /**
4456
4466
  * 슬러그 형식 — 스토어 코드와 같은 DNS 라벨 규칙(소문자·숫자·하이픈 3~30자, 하이픈으로 시작·끝 불가)에
@@ -4473,7 +4483,8 @@ const RESERVED_STOREFRONT_SLUGS = [
4473
4483
  "suspended",
4474
4484
  "dispatch",
4475
4485
  "control",
4476
- "outbound"
4486
+ "outbound",
4487
+ "sites"
4477
4488
  ];
4478
4489
  /**
4479
4490
  * 편집 미리보기 호스트 접미사 — 편집 미리보기 주소는 `{사이트 id 정규화}-preview.{호스팅 도메인}`이다(M2b). 사이트 주소와 같은
@@ -4533,6 +4544,7 @@ const storefrontVersionSchema = z.object({
4533
4544
  source: z.enum(["TEMPLATE", "EDIT"]).describe("`TEMPLATE` 템플릿 산출물 그대로 · `EDIT` 편집 작업 트리를 빌드함"),
4534
4545
  buildId: z.string().nullable().describe("편집 버전의 빌드 (`GET /v1/storefront/site/builds/{buildId}`). 템플릿 버전은 null"),
4535
4546
  createdByType: z.string().describe("만든 행위자 유형 (`USER`·`AGENT`·`APP`·`TOKEN`·`SYSTEM`). 늘어날 수 있다"),
4547
+ createdVia: z.string().nullable().optional().describe("만든 경로 (`CONSOLE` 콘솔 · `AI` AI 에이전트(MCP) · `CLI` `sayren` CLI · `API` 관리 API · `SYSTEM` 자동). 늘어날 수 있다"),
4536
4548
  createdAt: z.string().describe("만든 시각 (ISO 8601)")
4537
4549
  });
4538
4550
  const storefrontSiteStatusSchema = z.enum([
@@ -4545,7 +4557,7 @@ const storefrontSourceModeSchema = z.enum(["MANAGED", "CUSTOM"]).describe("`MANA
4545
4557
  const storefrontDomainSchema = z.object({
4546
4558
  hostname: z.string().describe("호스트 이름 (예: `mystore.sayren.co`)"),
4547
4559
  kind: z.enum(["PLATFORM", "CUSTOM"]).describe("`PLATFORM` 슬러그 주소 · `CUSTOM` 내 도메인"),
4548
- status: z.enum(["ACTIVE", "HELD"]).describe("`ACTIVE` 사용 중 · `HELD` 슬러그를 바꿔 보류 중(새 주소로 301)"),
4560
+ status: z.enum(["ACTIVE", "HELD"]).describe("`ACTIVE` 사용 중 · `HELD` 슬러그를 바꿔 보류 중(새 주소로 301). 연결 중인 내 도메인은 싣지 않는다(`GET /v1/storefront/site/domains`)"),
4549
4561
  isPrimary: z.boolean().describe("대표 주소인가 (`Store.storefrontUrl`)"),
4550
4562
  holdUntil: z.string().nullable().describe("보류가 끝나는 시각 (ISO 8601). 보류가 아니면 null")
4551
4563
  });
@@ -4647,6 +4659,186 @@ const storefrontPreviewLinkSchema = z.object({
4647
4659
  url: z.string().describe("미리보기 링크 — 5분 안에 연다"),
4648
4660
  expiresAt: z.string().describe("링크 만료 시각 (ISO 8601)")
4649
4661
  });
4662
+ /**
4663
+ * 연결할 수 없는 도메인 — 플랫폼이 쓰는 도메인과 그 하위(기본 주소는 슬러그로 바꾼다). 호스팅 도메인은 서버 설정이라
4664
+ * `storefrontCustomHostnameProblem`의 인자로 따로 받는다.
4665
+ */
4666
+ const STOREFRONT_PLATFORM_DOMAINS = [
4667
+ "sayren.co",
4668
+ "sayren.app",
4669
+ "sayren.shop",
4670
+ "avarlabs.com"
4671
+ ];
4672
+ /** 공개 인터넷에서 쓸 수 없는 최상위 도메인(RFC 2606·6761·6762 등) */
4673
+ const NON_PUBLIC_TLDS = [
4674
+ "example",
4675
+ "localhost",
4676
+ "local",
4677
+ "test",
4678
+ "invalid",
4679
+ "onion",
4680
+ "internal",
4681
+ "arpa",
4682
+ "home",
4683
+ "lan",
4684
+ "corp",
4685
+ "intranet",
4686
+ "alt"
4687
+ ];
4688
+ /**
4689
+ * 공용 접미사 — 누구나 그 아래 이름을 받는 도메인이라 접미사 자체는 연결할 수 없다. Public Suffix List 전체가 아니라 자주 틀리는
4690
+ * 것만 둔다(여기 없는 접미사도 TXT 소유 확인을 통과할 수 없어 연결되지 않는다 — 이 목록은 추가 단계에서 빨리 알려 주는 안내다).
4691
+ */
4692
+ const STOREFRONT_PUBLIC_SUFFIXES = [
4693
+ "co.kr",
4694
+ "or.kr",
4695
+ "ne.kr",
4696
+ "go.kr",
4697
+ "ac.kr",
4698
+ "re.kr",
4699
+ "pe.kr",
4700
+ "mil.kr",
4701
+ "hs.kr",
4702
+ "ms.kr",
4703
+ "es.kr",
4704
+ "sc.kr",
4705
+ "kg.kr",
4706
+ "seoul.kr",
4707
+ "busan.kr",
4708
+ "incheon.kr",
4709
+ "daegu.kr",
4710
+ "gwangju.kr",
4711
+ "daejeon.kr",
4712
+ "ulsan.kr",
4713
+ "gyeonggi.kr",
4714
+ "gangwon.kr",
4715
+ "chungbuk.kr",
4716
+ "chungnam.kr",
4717
+ "jeonbuk.kr",
4718
+ "jeonnam.kr",
4719
+ "gyeongbuk.kr",
4720
+ "gyeongnam.kr",
4721
+ "jeju.kr",
4722
+ "co.jp",
4723
+ "ne.jp",
4724
+ "or.jp",
4725
+ "com.cn",
4726
+ "net.cn",
4727
+ "com.tw",
4728
+ "com.hk",
4729
+ "co.uk",
4730
+ "org.uk",
4731
+ "com.au",
4732
+ "net.au",
4733
+ "com.sg",
4734
+ "co.nz",
4735
+ "com.br",
4736
+ "github.io",
4737
+ "gitlab.io",
4738
+ "pages.dev",
4739
+ "workers.dev",
4740
+ "vercel.app",
4741
+ "netlify.app",
4742
+ "herokuapp.com",
4743
+ "web.app",
4744
+ "firebaseapp.com",
4745
+ "blogspot.com",
4746
+ "cloudfront.net",
4747
+ "azurewebsites.net",
4748
+ "myshopify.com",
4749
+ "wixsite.com",
4750
+ "cafe24.com",
4751
+ "imweb.me"
4752
+ ];
4753
+ /** 스토어당 연결할 수 있는 도메인 수 기본값 — 요금제(#44) 전의 상한이다. 실제 값은 `GET …/domains`의 `limit` */
4754
+ const STOREFRONT_CUSTOM_DOMAIN_LIMIT_DEFAULT = 2;
4755
+ /** DNS를 넣을 때까지 기다리는 기간(일) — 지나면 `FAILED`(`DNS_NOT_CONFIGURED`) */
4756
+ const STOREFRONT_DOMAIN_DNS_WAIT_DAYS = 7;
4757
+ /** 연결된 도메인의 DNS가 이 서비스를 가리키지 않아도 연결을 유지하는 기간(일) — 지나면 서버가 해제한다 */
4758
+ const STOREFRONT_DOMAIN_DNS_GRACE_DAYS = 7;
4759
+ /** 소유 확인 TXT 레코드의 이름 앞부분 — `_sayren-verify.{도메인}` */
4760
+ const STOREFRONT_DOMAIN_TXT_LABEL = "_sayren-verify";
4761
+ const LABEL = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
4762
+ const PUNYCODE_TLD = /^xn--[a-z0-9-]{1,59}$/;
4763
+ const ALPHA_TLD = /^[a-z]{2,63}$/;
4764
+ /**
4765
+ * 도메인 정규화 — 앞뒤 공백·끝 점을 떼고 소문자로 바꾸며 국제화 도메인은 punycode(`xn--`)로 바꾼다. 스킴·경로·포트가 붙은 입력
4766
+ * (`https://www.a.com/`)은 호스트만 남기지 않고 그대로 두어 형식 검사에서 떨어진다(서버는 사용자가 적은 도메인만 받는다).
4767
+ * 변환할 수 없으면 입력을 소문자로만 바꿔 돌려준다(형식 검사가 거부한다).
4768
+ */
4769
+ function normalizeStorefrontHostname(input) {
4770
+ const trimmed = input.trim().replace(/\.+$/, "");
4771
+ if (!trimmed || /[\s/:?#@\\[\]%]/.test(trimmed)) return trimmed.toLowerCase();
4772
+ if (/^[\x21-\x7e]+$/.test(trimmed)) return trimmed.toLowerCase();
4773
+ try {
4774
+ return new URL(`http://${trimmed}`).hostname.toLowerCase();
4775
+ } catch {
4776
+ return trimmed.toLowerCase();
4777
+ }
4778
+ }
4779
+ /**
4780
+ * 연결할 수 있는 도메인인가(정규화한 값 기준). 문제가 없으면 null이다. 규칙: 253자 이하, 라벨 2개 이상, 라벨은 소문자·숫자·하이픈
4781
+ * 63자 이하(하이픈으로 시작·끝 불가), 최상위 도메인은 영문자이거나 punycode, IP 주소·와일드카드·공개 인터넷 밖 최상위 도메인·
4782
+ * 플랫폼 도메인과 그 하위·공용 접미사 자체는 안 된다. 제어·디스패치 Worker가 형식 규칙의 복제본을 들고 있다(api
4783
+ * `test/storefront-hosting-parity.spec.ts`가 대조한다).
4784
+ */
4785
+ function storefrontCustomHostnameProblem(hostname, hostingDomain = "sayren.co") {
4786
+ if (hostname.startsWith("*.")) return "WILDCARD";
4787
+ if (/^\d{1,3}(\.\d{1,3}){3}$/.test(hostname) || /^\[?[0-9a-f:.]*:[0-9a-f:.]*\]?$/.test(hostname)) return "IP_ADDRESS";
4788
+ if (hostname.length === 0 || hostname.length > 253) return "FORMAT";
4789
+ const labels = hostname.split(".");
4790
+ if (labels.length < 2) return "SINGLE_LABEL";
4791
+ if (!labels.every((label) => LABEL.test(label))) return "FORMAT";
4792
+ const tld = labels[labels.length - 1] ?? "";
4793
+ if (!ALPHA_TLD.test(tld) && !PUNYCODE_TLD.test(tld)) return "FORMAT";
4794
+ if (NON_PUBLIC_TLDS.includes(tld)) return "NON_PUBLIC_TLD";
4795
+ const platform = /* @__PURE__ */ new Set([...STOREFRONT_PLATFORM_DOMAINS, hostingDomain.toLowerCase()]);
4796
+ for (const domain of platform) if (hostname === domain || hostname.endsWith(`.${domain}`)) return "PLATFORM_DOMAIN";
4797
+ if (STOREFRONT_PUBLIC_SUFFIXES.includes(hostname)) return "PUBLIC_SUFFIX";
4798
+ return null;
4799
+ }
4800
+ /** 소유 확인 TXT 레코드의 전체 이름 */
4801
+ function storefrontDomainTxtNameOf(hostname) {
4802
+ return `${STOREFRONT_DOMAIN_TXT_LABEL}.${hostname}`;
4803
+ }
4804
+ const storefrontCustomDomainStatusSchema = z.enum([
4805
+ "PENDING_DNS",
4806
+ "PENDING_VALIDATION",
4807
+ "ACTIVE",
4808
+ "FAILED"
4809
+ ]).describe("`PENDING_DNS` DNS 설정 대기(소유 확인 전) · `PENDING_VALIDATION` 소유 확인됨, 인증서 발급 중 · `ACTIVE` 연결됨 · `FAILED` 연결 실패(`failureCode`)");
4810
+ const storefrontDnsRecordSchema = z.object({
4811
+ type: z.enum(["CNAME", "TXT"]).describe("레코드 유형"),
4812
+ name: z.string().describe("레코드 이름 (전체 이름, 예: `_sayren-verify.shop.brand.com`)"),
4813
+ value: z.string().describe("레코드 값"),
4814
+ purpose: z.enum(["ROUTING", "OWNERSHIP"]).describe("`ROUTING` 연결 · `OWNERSHIP` 소유 확인")
4815
+ });
4816
+ const storefrontSiteDomainSchema = z.object({
4817
+ domainId: z.string(),
4818
+ hostname: z.string().describe("호스트 이름 (punycode, 소문자)"),
4819
+ kind: z.enum(["PLATFORM", "CUSTOM"]).describe("`PLATFORM` 기본 주소(슬러그) · `CUSTOM` 내 도메인"),
4820
+ status: storefrontCustomDomainStatusSchema.describe("기본 주소는 늘 `ACTIVE`다. 내 도메인은 연결 단계"),
4821
+ isPrimary: z.boolean().describe("대표 주소인가 (`Store.storefrontUrl`). 대표가 아닌 주소는 대표로 301한다"),
4822
+ dnsRecords: z.array(storefrontDnsRecordSchema).describe("DNS에 넣을 레코드. 기본 주소는 빈 배열"),
4823
+ certificateStatus: z.enum([
4824
+ "PENDING",
4825
+ "ACTIVE",
4826
+ "FAILED"
4827
+ ]).nullable().describe("인증서 상태. 소유 확인 전·기본 주소는 null"),
4828
+ failureCode: z.string().nullable().describe("실패·경고 코드. `DNS_NOT_CONFIGURED` 기한 안에 TXT를 찾지 못함 · `VALIDATION_TIMEOUT` 인증서 발급 기한 지남 · `CERTIFICATE_FAILED` 인증서 발급 실패 · `DNS_NOT_POINTING` 연결된 뒤 DNS가 이 서비스를 가리키지 않음(기한이 지나면 해제) · `DOMAIN_TAKEN` 다른 스토어가 먼저 소유를 확인함 · `HOSTNAME_BLOCKED` 연결이 막힘 · `HOSTNAME_CONFLICT` 연결 준비 중 충돌(운영 확인). 늘어날 수 있다"),
4829
+ verifiedAt: z.string().nullable().describe("소유를 확인한 시각 (ISO 8601)"),
4830
+ activatedAt: z.string().nullable().describe("연결된 시각 (ISO 8601)"),
4831
+ checkedAt: z.string().nullable().describe("마지막으로 확인한 시각 (ISO 8601)"),
4832
+ createdAt: z.string()
4833
+ });
4834
+ /** `GET /v1/storefront/site/domains` — 사이트의 주소 목록(기본 주소 + 내 도메인)과 연결 설정 */
4835
+ const storefrontSiteDomainsSchema = z.object({
4836
+ enabled: z.boolean().describe("내 도메인을 추가할 수 있는가 (플랫폼 스위치)"),
4837
+ limit: z.number().int().min(0).describe("스토어당 내 도메인 수 상한 (해제한 도메인은 세지 않는다)"),
4838
+ target: z.string().describe("CNAME 대상 (예: `sites.sayren.co`)"),
4839
+ domains: z.array(storefrontSiteDomainSchema).describe("대표 주소 먼저, 그다음 추가한 순서")
4840
+ });
4841
+ const addStorefrontDomainRequestSchema = z.object({ hostname: z.string().min(1).max(300).describe("연결할 도메인 (예: `shop.brand.com`). 서버가 소문자·punycode로 정규화한다") });
4650
4842
  /** 플랫폼 전체 동시 편집 환경 상한 */
4651
4843
  const STOREFRONT_EDIT_CAPACITY = 20;
4652
4844
  /** 활동이 없으면 편집 환경이 잠드는 시간(분). 작업 트리는 보존된다 */
@@ -4923,9 +5115,11 @@ const STOREFRONT_BUILD_TERMINAL_STATUSES = [
4923
5115
  ];
4924
5116
  /**
4925
5117
  * 빌드 단계 — 이 순서로 돈다. 첫 실패에서 멈추지만 규칙 검증(`VERIFY`)은 실패해도 타입 검사까지 이어서 해 한 번에 알려 준다.
4926
- * `UPLOAD`는 사이트 버전 Worker 업로드다(성공하면 발행할 수 있다). 값은 늘어날 수 있다.
5118
+ * `UPLOAD`는 사이트 버전 Worker 업로드다(성공하면 발행할 수 있다). `DEPENDENCIES`는 빌드 시작 전 의존성 검사(거절 목록·보안 권고)다.
5119
+ * 값은 늘어날 수 있다.
4927
5120
  */
4928
5121
  const STOREFRONT_BUILD_STAGES = [
5122
+ "DEPENDENCIES",
4929
5123
  "VERIFY",
4930
5124
  "RESTORE",
4931
5125
  "INSTALL",
@@ -4935,13 +5129,37 @@ const STOREFRONT_BUILD_STAGES = [
4935
5129
  "PACK",
4936
5130
  "UPLOAD"
4937
5131
  ];
5132
+ /**
5133
+ * 의존성 검사 결과 한 줄(#61) — 거절(`DEPENDENCY_REJECTED`의 `details.rejected`)·경고(빌드 `dependencies`, 소스 교체 `dependencyWarnings`)가
5134
+ * 같은 모양이다. 대상 패키지와 사유. 셀러가 고칠 수 있게 버전·권고 id·거절 사유를 싣는다.
5135
+ * `reason`: `DENYLISTED`(거절 목록) · `ADVISORY`(보안 권고) · `MALWARE`(악성 코드 권고, 패키지 전체) · `INSTALL_SCRIPT`(루트
5136
+ * package.json의 설치 훅은 거절, 의존성의 설치 스크립트는 경고) · `UNSUPPORTED_SOURCE`(레지스트리 밖 설치 경로) · `BUNDLED_DEPENDENCIES`(묶여
5137
+ * 오는 의존성, 경고) · `INVALID_MANIFEST`(package.json·잠금 파일 형식), 늘어날 수 있다.
5138
+ */
5139
+ const storefrontDependencyFindingSchema = z.object({
5140
+ name: z.string().describe("패키지 이름. 파일 전체의 문제면 `package.json`·`pnpm-lock.yaml`"),
5141
+ version: z.string().nullable().describe("해당 버전. 버전과 무관하면 null"),
5142
+ reason: z.string().describe("사유 코드"),
5143
+ detail: z.string().describe("셀러용 설명"),
5144
+ advisory: z.object({
5145
+ id: z.string(),
5146
+ url: z.string().nullable(),
5147
+ severity: z.string(),
5148
+ title: z.string()
5149
+ }).nullable().optional().describe("보안 권고(사유가 `ADVISORY`·`MALWARE`일 때)")
5150
+ });
5151
+ const storefrontBuildDependenciesSchema = z.object({
5152
+ checkedPackages: z.number().int().min(0).describe("검사한 설치 트리의 패키지(이름·버전) 수"),
5153
+ rejected: z.array(storefrontDependencyFindingSchema).describe("빌드를 막은 의존성"),
5154
+ warnings: z.array(storefrontDependencyFindingSchema).describe("빌드는 막지 않는 경고(중간 이하 심각도 권고)")
5155
+ });
4938
5156
  const storefrontBuildSchema = z.object({
4939
5157
  buildId: z.string(),
4940
5158
  versionId: z.string(),
4941
5159
  versionNumber: z.number().int().min(1),
4942
5160
  status: storefrontBuildStatusSchema,
4943
- failureStage: z.string().nullable().describe("실패한 단계 (`VERIFY`·`RESTORE`·`INSTALL`·`TYPECHECK`·`BUILD`·`BUNDLE`·`PACK`·`UPLOAD`, 늘어날 수 있다). 실패가 아니면 null"),
4944
- errorCode: z.string().nullable().describe("실패 코드 (`RULES_VIOLATED`·`INSTALL_FAILED`·`TYPECHECK_FAILED`·`BUILD_FAILED`·`BUNDLE_FAILED`·`ARTIFACT_INVALID`·`UPLOAD_FAILED`·`SOURCE_NOT_FOUND`·`CAPACITY_EXHAUSTED`·`INTERNAL`, 늘어날 수 있다). 실패가 아니면 null"),
5161
+ failureStage: z.string().nullable().describe("실패한 단계 (`DEPENDENCIES`·`VERIFY`·`RESTORE`·`INSTALL`·`TYPECHECK`·`BUILD`·`BUNDLE`·`PACK`·`UPLOAD`, 늘어날 수 있다). 실패가 아니면 null"),
5162
+ errorCode: z.string().nullable().describe("실패 코드 (`DEPENDENCY_REJECTED`·`DEPENDENCY_CHECK_UNAVAILABLE`·`DEPENDENCIES_CHANGED`·`RULES_VIOLATED`·`INSTALL_FAILED`·`INSTALL_TOO_LARGE`·`TYPECHECK_FAILED`·`BUILD_FAILED`·`BUILD_TIMEOUT`·`BUNDLE_FAILED`·`ARTIFACT_TOO_LARGE`·`ARTIFACT_INVALID`·`UPLOAD_FAILED`·`SOURCE_NOT_FOUND`·`CAPACITY_EXHAUSTED`·`INTERNAL`, 늘어날 수 있다). 실패가 아니면 null"),
4945
5163
  logTail: z.string().nullable().describe("실패 단계 출력 꼬리 (최대 8KB). 없으면 null"),
4946
5164
  stages: z.array(z.object({
4947
5165
  stage: z.string(),
@@ -4949,6 +5167,7 @@ const storefrontBuildSchema = z.object({
4949
5167
  durationMs: z.number().int().min(0)
4950
5168
  })).describe("끝난 단계 (도는 순서)"),
4951
5169
  verify: storefrontVerifyReportSchema.nullable().describe("규칙 검증 보고서(위반 상세는 50건까지). 그 단계까지 가지 못했으면 null"),
5170
+ dependencies: storefrontBuildDependenciesSchema.nullable().optional().describe("의존성 검사 결과(거절 목록·보안 권고). 빌드 시작 전에 돈다. 거절이 있으면 `failureStage: DEPENDENCIES`, `errorCode: DEPENDENCY_REJECTED`다. 아직 검사 전이면 null(옛 서버는 싣지 않는다)"),
4952
5171
  queuedAt: z.string(),
4953
5172
  startedAt: z.string().nullable(),
4954
5173
  finishedAt: z.string().nullable(),
@@ -4959,7 +5178,10 @@ const storefrontBuildListQuerySchema = z.object({ limit: z.coerce.number().int()
4959
5178
  * `POST /v1/storefront/site/versions` — 지금 작업 트리를 고정해 버전을 만든다(빌드 시작). 사이트당 끝나지 않은 빌드는
4960
5179
  * 하나다(409 `STOREFRONT_BUILD_IN_PROGRESS`). 편집 환경이 없어도 된다.
4961
5180
  */
4962
- const createStorefrontVersionRequestSchema = z.object({ message: z.string().max(200).optional().describe("버전 메모 (에이전트는 바꾼 내용 요약)") });
5181
+ const createStorefrontVersionRequestSchema = z.object({
5182
+ message: z.string().max(200).optional().describe("버전 메모 (에이전트는 바꾼 내용 요약)"),
5183
+ expectedSourceRef: z.string().max(200).optional().describe("고정할 작업 트리 (`PUT /v1/storefront/site/source`의 `sourceRef`). 주면 지금 작업 트리가 이 값일 때만 버전을 만든다(다르면 409 `SOURCE_CHANGED`)")
5184
+ });
4963
5185
  /** 버전 만들기 응답 (201) — 버전은 `BUILDING`, 빌드는 `QUEUED`로 시작한다. 결과는 `GET builds/{buildId}`로 본다 */
4964
5186
  const storefrontVersionCreatedSchema = z.object({
4965
5187
  version: storefrontVersionSchema,
@@ -4971,6 +5193,80 @@ const storefrontVersionCreatedSchema = z.object({
4971
5193
  * 없으면 409 `EDIT_SESSION_REQUIRED`다(편집 환경이 `STARTING`이면 링크는 주고, 미리보기 화면이 기동 대기를 보여 준다).
4972
5194
  */
4973
5195
  const createStorefrontEditPreviewLinkRequestSchema = createStorefrontPreviewLinkRequestSchema;
5196
+ /** 압축 파일 조각 하나의 최대 크기(바이트) */
5197
+ const STOREFRONT_SOURCE_PART_BYTES = 4194304;
5198
+ /** 내용 올리기 한 번의 최대 파일 수 */
5199
+ const STOREFRONT_SOURCE_BLOB_BATCH_MAX = 200;
5200
+ /** 작업 트리 파일 수 상한 */
5201
+ const STOREFRONT_WORKSPACE_MAX_FILES = 2e3;
5202
+ /** 작업 트리 스냅샷 키 — `sources/{siteId}/{sha256}.tgz` */
5203
+ const storefrontSourceRefSchema = z.string().regex(/^sources\/sfs_[a-z0-9]{8,40}\/[0-9a-f]{64}\.tgz$/, "작업 트리 스냅샷 키 형식이 아닙니다").describe("작업 트리 스냅샷 (`sources/{siteId}/{sha256}.tgz`, 내용 주소)");
5204
+ /** `GET /v1/storefront/site/source` — 지금 작업 트리(편집 환경이 떠 있으면 지금 내용을 고정한다) */
5205
+ const storefrontSourceSchema = z.object({
5206
+ siteId: z.string(),
5207
+ storeId: z.string(),
5208
+ storeCode: z.string().describe("스토어 코드 — 로컬 개발 서버의 `SAYREN_STORE_CODE`"),
5209
+ sourceRef: storefrontSourceRefSchema,
5210
+ treeSha256: z.string().describe("트리 지문 (경로 오름차순 `{path}\\t{sha256}\\n`의 SHA-256)"),
5211
+ files: z.number().int().min(0).describe("파일 수"),
5212
+ bytes: z.number().int().min(0).describe("파일 크기 합"),
5213
+ archive: z.object({
5214
+ format: z.literal("tar+gzip"),
5215
+ bytes: z.number().int().min(0).describe("압축 파일 크기"),
5216
+ sha256: z.string().describe("압축 파일의 SHA-256 (`sourceRef`의 해시와 같다)"),
5217
+ parts: z.number().int().min(0).describe("`GET source/archive`로 받을 조각 수"),
5218
+ partBytes: z.number().int().describe("조각 하나의 최대 크기")
5219
+ }),
5220
+ editSessionOpen: z.boolean().describe("편집 환경이 열려 있는가 (올리기 전에 끄거나 `endEditSession`)")
5221
+ });
5222
+ const storefrontSourceArchiveQuerySchema = z.object({
5223
+ sourceRef: storefrontSourceRefSchema,
5224
+ part: z.coerce.number().int().min(0).max(100).optional().describe("조각 번호 (0부터, 기본 0)")
5225
+ });
5226
+ /** `GET /v1/storefront/site/source/archive` — 압축 파일 조각 */
5227
+ const storefrontSourceArchivePartSchema = z.object({
5228
+ sourceRef: storefrontSourceRefSchema,
5229
+ part: z.number().int().min(0),
5230
+ parts: z.number().int().min(0),
5231
+ offset: z.number().int().min(0),
5232
+ bytes: z.number().int().min(0).describe("이 조각의 크기"),
5233
+ totalBytes: z.number().int().min(0),
5234
+ content: z.string().describe("조각 내용 (base64)")
5235
+ });
5236
+ /** `POST /v1/storefront/site/source/blobs` — 파일 내용 올리기(해시 키, 다시 올려도 안전하다). 작업 트리는 바뀌지 않는다 */
5237
+ const uploadStorefrontSourceBlobsRequestSchema = z.object({ blobs: z.array(z.object({
5238
+ hash: storefrontFileHashSchema,
5239
+ content: z.string().describe("파일 내용 (base64, 1MiB까지)")
5240
+ })).min(1).max(200) });
5241
+ const storefrontSourceBlobsResultSchema = z.object({
5242
+ stored: z.number().int().min(0).describe("새로 올린 수"),
5243
+ existing: z.number().int().min(0).describe("이미 있던 수")
5244
+ });
5245
+ /**
5246
+ * `PUT /v1/storefront/site/source` — 작업 트리 전체를 이 목록으로 바꾼다(없는 경로는 지운다). 전부 아니면 전무다.
5247
+ * `package.json`·`pnpm-lock.yaml`도 바꿀 수 있고 의존성은 허용 목록 안이어야 한다. `.env*`·작업 트리 밖 경로는 받지 않는다.
5248
+ */
5249
+ const replaceStorefrontSourceRequestSchema = z.object({
5250
+ expectedBaseRef: storefrontSourceRefSchema.optional().describe("내려받은 작업 트리. 지금 작업 트리가 이 값일 때만 바꾼다. 생략하면 조건 없이 덮어쓴다"),
5251
+ files: z.array(z.object({
5252
+ path: storefrontFilePathSchema,
5253
+ hash: storefrontFileHashSchema,
5254
+ size: z.number().int().min(0).max(STOREFRONT_FILE_MAX_BYTES)
5255
+ })).min(1).max(STOREFRONT_WORKSPACE_MAX_FILES).refine((files) => new Set(files.map((file) => file.path)).size === files.length, { message: "같은 경로를 두 번 실을 수 없습니다" }),
5256
+ endEditSession: z.boolean().optional().describe("열린 편집 환경을 끄고 진행한다 (기본 false — 열려 있으면 409 `EDIT_SESSION_OPEN`)"),
5257
+ packageJson: z.string().max(STOREFRONT_FILE_MAX_BYTES).optional().describe("`files`에 `package.json`이 있으면 그 내용(utf8). 서버가 의존성을 판정한다. 해시가 목록과 다르면 400 `DEPENDENCY_FILES_MISMATCH`"),
5258
+ lockfile: z.string().max(STOREFRONT_FILE_MAX_BYTES).optional().describe("`files`에 `pnpm-lock.yaml`이 있으면 그 내용(utf8)")
5259
+ });
5260
+ const storefrontSourceReplacedSchema = z.object({
5261
+ sourceRef: storefrontSourceRefSchema.describe("새 작업 트리 — 다음 올리기의 `expectedBaseRef`"),
5262
+ previousRef: z.string().describe("바꾸기 전 작업 트리"),
5263
+ treeSha256: z.string(),
5264
+ files: z.number().int().min(0),
5265
+ bytes: z.number().int().min(0),
5266
+ changed: z.boolean().describe("내용이 바뀌었는가 (같은 트리를 다시 올리면 false)"),
5267
+ endedEditSession: z.boolean().describe("열린 편집 환경을 끄고 진행했는가"),
5268
+ dependencyWarnings: z.array(storefrontDependencyFindingSchema).describe("배포를 막지 않는 의존성 경고 (보안 권고 등)")
5269
+ });
4974
5270
  //#endregion
4975
5271
  //#region src/client.ts
4976
5272
  function formBody(fields) {
@@ -5583,6 +5879,19 @@ list: (params) => storeHttp.request("GET", "/audit-logs", auditLogPageSchema, {
5583
5879
  * 콘솔에서 로그인한 OWNER·ADMIN만 받는다
5584
5880
  */
5585
5881
  createPreviewLink: (body = {}) => storeHttp.request("POST", "/storefront/site/preview-link", storefrontPreviewLinkSchema, { body: createStorefrontPreviewLinkRequestSchema.parse(body) }),
5882
+ /** `GET /v1/storefront/site/domains` — 주소 목록(기본 주소 + 내 도메인)과 DNS 안내 */
5883
+ listDomains: () => storeHttp.request("GET", "/storefront/site/domains", storefrontSiteDomainsSchema),
5884
+ /**
5885
+ * `POST /v1/storefront/site/domains` (201) — 내 도메인을 추가한다. 응답의 `dnsRecords`를 DNS에 넣으면 서버가 소유를 확인하고
5886
+ * 인증서를 발급한다
5887
+ */
5888
+ addDomain: (body) => storeHttp.request("POST", "/storefront/site/domains", storefrontSiteDomainSchema, { body: addStorefrontDomainRequestSchema.parse(body) }),
5889
+ /** `POST /v1/storefront/site/domains/{domainId}/verify` — DNS를 곧바로 다시 확인한다(실패한 도메인은 처음부터 다시) */
5890
+ verifyDomain: (domainId) => storeHttp.request("POST", path`/storefront/site/domains/${domainId}/verify`, storefrontSiteDomainSchema),
5891
+ /** `POST /v1/storefront/site/domains/{domainId}/primary` — 대표 주소로 지정한다. 다른 주소는 대표 주소로 301한다 */
5892
+ setPrimaryDomain: (domainId) => storeHttp.request("POST", path`/storefront/site/domains/${domainId}/primary`, storefrontSiteDomainsSchema),
5893
+ /** `DELETE /v1/storefront/site/domains/{domainId}` — 내 도메인 연결을 해제한다(곧바로 끊긴다) */
5894
+ removeDomain: (domainId) => storeHttp.requestVoid("DELETE", path`/storefront/site/domains/${domainId}`),
5586
5895
  /** `POST /v1/storefront/site/disable` — 호스팅을 끈다(사이트 `CLOSED`, 슬러그 90일 보류). 다시 만들 수 있다 */
5587
5896
  disable: (body) => storeHttp.request("POST", "/storefront/site/disable", storefrontSiteSchema, { body: disableStorefrontHostingRequestSchema.parse(body) }),
5588
5897
  /** `GET /v1/storefront/site/editing` — 편집 환경 상태(열린 환경·동시 상한·미리보기 인증서) */
@@ -5631,7 +5940,18 @@ list: (params) => storeHttp.request("GET", "/audit-logs", auditLogPageSchema, {
5631
5940
  /** `GET /v1/storefront/site/builds?limit=` — 빌드 목록(최신 먼저) */
5632
5941
  listBuilds: (params = {}) => storeHttp.request("GET", "/storefront/site/builds", z.array(storefrontBuildSchema), { query: params }),
5633
5942
  /** `GET /v1/storefront/site/builds/{buildId}` — 빌드 상태·실패 단계·로그 꼬리·규칙 결과 */
5634
- getBuild: (buildId) => storeHttp.request("GET", path`/storefront/site/builds/${buildId}`, storefrontBuildSchema)
5943
+ getBuild: (buildId) => storeHttp.request("GET", path`/storefront/site/builds/${buildId}`, storefrontBuildSchema),
5944
+ /** `GET /v1/storefront/site/source` — 지금 작업 트리를 고정하고 압축 파일(tar.gz) 크기·조각 수를 알린다 */
5945
+ getSource: () => storeHttp.request("GET", "/storefront/site/source", storefrontSourceSchema),
5946
+ /** `GET /v1/storefront/site/source/archive?sourceRef=&part=` — 압축 파일 조각(base64, 4MiB까지) */
5947
+ getSourceArchive: (params) => storeHttp.request("GET", "/storefront/site/source/archive", storefrontSourceArchivePartSchema, { query: storefrontSourceArchiveQuerySchema.parse(params) }),
5948
+ /** `POST /v1/storefront/site/source/blobs` — 파일 내용 올리기(해시 키). 작업 트리는 바뀌지 않는다 */
5949
+ uploadSourceBlobs: (body) => storeHttp.request("POST", "/storefront/site/source/blobs", storefrontSourceBlobsResultSchema, { body: uploadStorefrontSourceBlobsRequestSchema.parse(body) }),
5950
+ /**
5951
+ * `PUT /v1/storefront/site/source` — 작업 트리 전체를 바꾼다. 409 `SOURCE_CHANGED`(내려받은 뒤 바뀜)·`EDIT_SESSION_OPEN`·
5952
+ * `SOURCE_BLOBS_MISSING`(`details.hashes`를 올리고 다시)
5953
+ */
5954
+ replaceSource: (body) => storeHttp.request("PUT", "/storefront/site/source", storefrontSourceReplacedSchema, { body: replaceStorefrontSourceRequestSchema.parse(body) })
5635
5955
  },
5636
5956
  store: {
5637
5957
  get: () => storeHttp.request("GET", "/store", storeSchema),
@@ -6148,4 +6468,4 @@ function createStoreSession(options) {
6148
6468
  };
6149
6469
  }
6150
6470
  //#endregion
6151
- export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, ApiError, ApprovalPendingError, CASH_RECEIPT_STATUS_VALUES, COUPON_CODE_PATTERN, COUPON_CONDITIONS_DEFAULTS, COUPON_TARGET_ALL, COUPON_TARGET_LIST_MAX, CUSTOM_INPUT_FORBIDDEN_WORDS, FULFILLMENT_RULES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_CUSTOM_INPUTS, MAX_CUSTOM_INPUT_LENGTH, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NO_COUPON_SETTLEMENT, NO_SHIPPING_BUNDLE_KEY, PAYMENT_ROUTING_EXCLUSION_CODES, PORTONE_CHANNEL_NAME_MAX_LENGTH, PORTONE_MAX_CHANNELS, PORTONE_MIN_CHANNELS, REFUND_POLICY_DEFAULTS, REFUND_POLICY_DELIVERY_FEE_KEYS, REMOTE_AREA_ZIP_RANGES, RESERVED_STOREFRONT_SLUGS, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_EDIT_ACTIVITY_TIMEOUT_MINUTES, STOREFRONT_EDIT_CAPACITY, STOREFRONT_EDIT_IDLE_MINUTES, STOREFRONT_EDIT_PREVIEW_SUFFIX, STOREFRONT_EDIT_START_STAGES, STOREFRONT_FILE_BATCH_MAX, STOREFRONT_FILE_MAX_BYTES, STOREFRONT_PATH_SEGMENT_PATTERN, STOREFRONT_SEARCH_REGEX_MAX_LENGTH, STOREFRONT_SITE_CREATE_LIMIT, STOREFRONT_SLUG_CHANGE_LIMIT, STOREFRONT_SLUG_CHANGE_WINDOW_DAYS, STOREFRONT_SLUG_HOLD_DAYS, STOREFRONT_SLUG_PATTERN, STOREFRONT_WORKSPACE_MAX_BYTES, STORE_CODE_PATTERN, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, TOSS_WIDGET_CLIENT_KEY_PATTERN, TOSS_WIDGET_KEY_MESSAGE, TOSS_WIDGET_SECRET_KEY_PATTERN, UPLOAD_PURPOSE_LIMITS, VARIANT_COUNT_WARNING, VARIANT_STOCK_EXCLUSIVE_MESSAGE, WEBHOOK_DEFAULT_TOLERANCE_SEC, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_FAILURE_REASONS, WEBHOOK_HEADERS, WEBHOOK_PAYLOAD_EXCERPT_MAX_BYTES, WEBHOOK_RESOURCE_TYPES, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_USER_AGENT, addonGroupRequestSchema, addonGroupSchema, addonValueRequestSchema, addonValueSchema, addressChangeRequestListSchema, addressTypeSchema, agentPolicyDecisionSchema, allocateByWeight, analyticsChannelSchema, analyticsCheckoutOutcomeSchema, analyticsCheckoutSchema, analyticsDeviceRowSchema, analyticsDevicesSchema, analyticsFunnelStepSchema, analyticsOriginSchema, analyticsOverviewSchema, analyticsPagesQuerySchema, analyticsPagesSchema, analyticsProductRowSchema, analyticsProductSortSchema, analyticsProductsQuerySchema, analyticsProductsSchema, analyticsRangeQuerySchema, analyticsRealtimeSchema, analyticsSearchQuerySchema, analyticsSearchSchema, analyticsSourceGroupBySchema, analyticsSourceRowSchema, analyticsSourcesQuerySchema, analyticsSourcesSchema, analyticsTotalsSchema, apiClientListQuerySchema, apiClientSchema, apiClientSecretRotatedSchema, apiClientStatusSchema, apiClientTypeSchema, apiLogErrorSchema, apiLogListQuerySchema, apiLogPageSchema, apiLogPrincipalSchema, apiLogPrincipalTypeSchema, apiLogSchema, apiLogStatusFilterSchema, apiLogSummarySchema, apiTokenCreateRequestSchema, apiTokenCreatedSchema, apiTokenSchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, buildAuthorizeUrl, buildQuery, bulkResultSchema, cancelBySellerRequestSchema, cancelBySellerResultSchema, carrierSchema, cashReceiptSchema, categoryAttributeSchema, categoryCreateRequestSchema, categoryDeleteQuerySchema, categoryDeleteStrategySchema, categoryListQuerySchema, categoryPatchRequestSchema, categoryProductSortSchema, categorySchema, categorySearchResultSchema, categoryTreeNodeSchema, categoryWithPathSchema, changeStorefrontSlugRequestSchema, changeStorefrontTemplateRequestSchema, changeTypeSchema, claimDetailSchema, claimHoldResultSchema, claimListQuerySchema, claimReasonSchema, claimReturnAddressSchema, claimSchema, claimStatusSchema, claimTypeSchema, claimWebhookEventDataSchema, claimWebhookEventSchema, clientCredentialsTokenResponseSchema, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createCouponRequestSchema, createPkcePair, createStoreClient, createStoreSession, createStorefrontEditPreviewLinkRequestSchema, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, createStorefrontVersionRequestSchema, customInputLabelForbiddenWord, customInputRequestSchema, customInputSchema, customInputValueSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, exchangeStoreTokenViaOAuth, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isEditableStorefrontPath, isReservedStoreCode, isReservedStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, mcpRuleResultSchema, mcpToolEventSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, normalizeCouponCode, normalizeStorefrontPath, oauthClientRegistrationRequestSchema, oauthClientRegistrationResponseSchema, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderSchema, pgVerificationResultSchema, policyDocumentUrlSchema, policyVersionSchema, portOneChannelSchema, portOneCredentialsInputSchema, productCreateRequestSchema, productFulfillmentCreateSchema, productFulfillmentResponseSchema, productFulfillmentSchema, productFulfillmentUpdateSchema, productImageRejection, productImageUrlSchema, productListQuerySchema, productOutOfStockWebhookEventDataSchema, productOutOfStockWebhookEventSchema, productPatchRequestSchema, productRefundPolicyOverride, productRefundPolicyPatchSchema, productReplaceRequestSchema, productSchema, productSortSchema, productStatusSchema, productSummarySchema, productVariantRequestSchema, productVariantSchema, proratedPaidRefundBase, proratedRefundBase, publishStorefrontVersionRequestSchema, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, quoteDelivery, quotePricing, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, requiresCollection, requiresShipping, resolveRefundPolicy, resolveShippingPolicy, reviewListQuerySchema, reviewReportResultSchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeTokenResponseSchema, storefrontBuildListQuerySchema, storefrontBuildSchema, storefrontBuildStatusSchema, storefrontCheckSchema, storefrontCheckStatusSchema, storefrontDomainSchema, storefrontEditPreviewLabelOf, storefrontEditPreviewSchema, storefrontEditSessionSchema, storefrontEditSessionStatusSchema, storefrontEditingSchema, storefrontFileConflictDetailsSchema, storefrontFileContentQuerySchema, storefrontFileContentSchema, storefrontFileDeleteResultSchema, storefrontFileEncodingSchema, storefrontFileEntrySchema, storefrontFileHashSchema, storefrontFileListQuerySchema, storefrontFileListSchema, storefrontFileMoveResultSchema, storefrontFilePathSchema, storefrontFileSearchResultSchema, storefrontFileWriteResultSchema, storefrontHostingSchema, storefrontPreviewLinkSchema, storefrontProvisioningSchema, storefrontRuleResultSchema, storefrontRuleSeveritySchema, storefrontSiteSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceModeSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, userTokenResponseSchema, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, writeDryRunResultSchema, writePreviewSchema, writeStorefrontFilesRequestSchema };
6471
+ export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, ApiError, ApprovalPendingError, CASH_RECEIPT_STATUS_VALUES, COUPON_CODE_PATTERN, COUPON_CONDITIONS_DEFAULTS, COUPON_TARGET_ALL, COUPON_TARGET_LIST_MAX, CUSTOM_INPUT_FORBIDDEN_WORDS, FULFILLMENT_RULES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_CUSTOM_INPUTS, MAX_CUSTOM_INPUT_LENGTH, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NO_COUPON_SETTLEMENT, NO_SHIPPING_BUNDLE_KEY, PAYMENT_ROUTING_EXCLUSION_CODES, PORTONE_CHANNEL_NAME_MAX_LENGTH, PORTONE_MAX_CHANNELS, PORTONE_MIN_CHANNELS, REFUND_POLICY_DEFAULTS, REFUND_POLICY_DELIVERY_FEE_KEYS, REMOTE_AREA_ZIP_RANGES, RESERVED_STOREFRONT_SLUGS, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_CUSTOM_DOMAIN_LIMIT_DEFAULT, STOREFRONT_DOMAIN_DNS_GRACE_DAYS, STOREFRONT_DOMAIN_DNS_WAIT_DAYS, STOREFRONT_DOMAIN_TXT_LABEL, STOREFRONT_EDIT_ACTIVITY_TIMEOUT_MINUTES, STOREFRONT_EDIT_CAPACITY, STOREFRONT_EDIT_IDLE_MINUTES, STOREFRONT_EDIT_PREVIEW_SUFFIX, STOREFRONT_EDIT_START_STAGES, STOREFRONT_FILE_BATCH_MAX, STOREFRONT_FILE_MAX_BYTES, STOREFRONT_PATH_SEGMENT_PATTERN, STOREFRONT_PLATFORM_DOMAINS, STOREFRONT_PUBLIC_SUFFIXES, STOREFRONT_SEARCH_REGEX_MAX_LENGTH, STOREFRONT_SITE_CREATE_LIMIT, STOREFRONT_SLUG_CHANGE_LIMIT, STOREFRONT_SLUG_CHANGE_WINDOW_DAYS, STOREFRONT_SLUG_HOLD_DAYS, STOREFRONT_SLUG_PATTERN, STOREFRONT_SOURCE_BLOB_BATCH_MAX, STOREFRONT_SOURCE_PART_BYTES, STOREFRONT_WORKSPACE_MAX_BYTES, STOREFRONT_WORKSPACE_MAX_FILES, STORE_CODE_PATTERN, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, TOSS_WIDGET_CLIENT_KEY_PATTERN, TOSS_WIDGET_KEY_MESSAGE, TOSS_WIDGET_SECRET_KEY_PATTERN, UPLOAD_PURPOSE_LIMITS, VARIANT_COUNT_WARNING, VARIANT_STOCK_EXCLUSIVE_MESSAGE, WEBHOOK_DEFAULT_TOLERANCE_SEC, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_FAILURE_REASONS, WEBHOOK_HEADERS, WEBHOOK_PAYLOAD_EXCERPT_MAX_BYTES, WEBHOOK_RESOURCE_TYPES, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_USER_AGENT, addStorefrontDomainRequestSchema, addonGroupRequestSchema, addonGroupSchema, addonValueRequestSchema, addonValueSchema, addressChangeRequestListSchema, addressTypeSchema, agentPolicyDecisionSchema, allocateByWeight, analyticsChannelSchema, analyticsCheckoutOutcomeSchema, analyticsCheckoutSchema, analyticsDeviceRowSchema, analyticsDevicesSchema, analyticsFunnelStepSchema, analyticsOriginSchema, analyticsOverviewSchema, analyticsPagesQuerySchema, analyticsPagesSchema, analyticsProductRowSchema, analyticsProductSortSchema, analyticsProductsQuerySchema, analyticsProductsSchema, analyticsRangeQuerySchema, analyticsRealtimeSchema, analyticsSearchQuerySchema, analyticsSearchSchema, analyticsSourceGroupBySchema, analyticsSourceRowSchema, analyticsSourcesQuerySchema, analyticsSourcesSchema, analyticsTotalsSchema, apiClientListQuerySchema, apiClientSchema, apiClientSecretRotatedSchema, apiClientStatusSchema, apiClientTypeSchema, apiLogErrorSchema, apiLogListQuerySchema, apiLogPageSchema, apiLogPrincipalSchema, apiLogPrincipalTypeSchema, apiLogSchema, apiLogStatusFilterSchema, apiLogSummarySchema, apiTokenCreateRequestSchema, apiTokenCreatedSchema, apiTokenSchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, buildAuthorizeUrl, buildQuery, bulkResultSchema, cancelBySellerRequestSchema, cancelBySellerResultSchema, carrierSchema, cashReceiptSchema, categoryAttributeSchema, categoryCreateRequestSchema, categoryDeleteQuerySchema, categoryDeleteStrategySchema, categoryListQuerySchema, categoryPatchRequestSchema, categoryProductSortSchema, categorySchema, categorySearchResultSchema, categoryTreeNodeSchema, categoryWithPathSchema, changeStorefrontSlugRequestSchema, changeStorefrontTemplateRequestSchema, changeTypeSchema, claimDetailSchema, claimHoldResultSchema, claimListQuerySchema, claimReasonSchema, claimReturnAddressSchema, claimSchema, claimStatusSchema, claimTypeSchema, claimWebhookEventDataSchema, claimWebhookEventSchema, clientCredentialsTokenResponseSchema, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createCouponRequestSchema, createPkcePair, createStoreClient, createStoreSession, createStorefrontEditPreviewLinkRequestSchema, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, createStorefrontVersionRequestSchema, customInputLabelForbiddenWord, customInputRequestSchema, customInputSchema, customInputValueSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, exchangeStoreTokenViaOAuth, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isEditableStorefrontPath, isReservedStoreCode, isReservedStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, mcpRuleResultSchema, mcpToolEventSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, normalizeCouponCode, normalizeStorefrontHostname, normalizeStorefrontPath, oauthClientRegistrationRequestSchema, oauthClientRegistrationResponseSchema, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderSchema, pgVerificationResultSchema, policyDocumentUrlSchema, policyVersionSchema, portOneChannelSchema, portOneCredentialsInputSchema, productCreateRequestSchema, productFulfillmentCreateSchema, productFulfillmentResponseSchema, productFulfillmentSchema, productFulfillmentUpdateSchema, productImageRejection, productImageUrlSchema, productListQuerySchema, productOutOfStockWebhookEventDataSchema, productOutOfStockWebhookEventSchema, productPatchRequestSchema, productRefundPolicyOverride, productRefundPolicyPatchSchema, productReplaceRequestSchema, productSchema, productSortSchema, productStatusSchema, productSummarySchema, productVariantRequestSchema, productVariantSchema, proratedPaidRefundBase, proratedRefundBase, publishStorefrontVersionRequestSchema, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, quoteDelivery, quotePricing, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, replaceStorefrontSourceRequestSchema, requiresCollection, requiresShipping, resolveRefundPolicy, resolveShippingPolicy, reviewListQuerySchema, reviewReportResultSchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeTokenResponseSchema, storefrontBuildDependenciesSchema, storefrontBuildListQuerySchema, storefrontBuildSchema, storefrontBuildStatusSchema, storefrontCheckSchema, storefrontCheckStatusSchema, storefrontCustomDomainStatusSchema, storefrontCustomHostnameProblem, storefrontDependencyFindingSchema, storefrontDnsRecordSchema, storefrontDomainSchema, storefrontDomainTxtNameOf, storefrontEditPreviewLabelOf, storefrontEditPreviewSchema, storefrontEditSessionSchema, storefrontEditSessionStatusSchema, storefrontEditingSchema, storefrontFileConflictDetailsSchema, storefrontFileContentQuerySchema, storefrontFileContentSchema, storefrontFileDeleteResultSchema, storefrontFileEncodingSchema, storefrontFileEntrySchema, storefrontFileHashSchema, storefrontFileListQuerySchema, storefrontFileListSchema, storefrontFileMoveResultSchema, storefrontFilePathSchema, storefrontFileSearchResultSchema, storefrontFileWriteResultSchema, storefrontHostingSchema, storefrontPreviewLinkSchema, storefrontProvisioningSchema, storefrontRuleResultSchema, storefrontRuleSeveritySchema, storefrontSiteDomainSchema, storefrontSiteDomainsSchema, storefrontSiteSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceArchivePartSchema, storefrontSourceArchiveQuerySchema, storefrontSourceBlobsResultSchema, storefrontSourceModeSchema, storefrontSourceRefSchema, storefrontSourceReplacedSchema, storefrontSourceSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadStorefrontSourceBlobsRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, userTokenResponseSchema, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, writeDryRunResultSchema, writePreviewSchema, writeStorefrontFilesRequestSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayren/store-sdk",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
package/src/client.ts CHANGED
@@ -230,6 +230,8 @@ import {
230
230
  updateStoreRequestSchema,
231
231
  } from "./schemas/store";
232
232
  import {
233
+ type AddStorefrontDomainRequest,
234
+ addStorefrontDomainRequestSchema,
233
235
  type ChangeStorefrontSlugRequest,
234
236
  type ChangeStorefrontTemplateRequest,
235
237
  type CreateStorefrontEditPreviewLinkRequest,
@@ -250,8 +252,10 @@ import {
250
252
  moveStorefrontFileRequestSchema,
251
253
  type PublishStorefrontVersionRequest,
252
254
  publishStorefrontVersionRequestSchema,
255
+ type ReplaceStorefrontSourceRequest,
253
256
  type RollbackStorefrontRequest,
254
257
  type RunStorefrontCheckRequest,
258
+ replaceStorefrontSourceRequestSchema,
255
259
  rollbackStorefrontRequestSchema,
256
260
  runStorefrontCheckRequestSchema,
257
261
  type SearchStorefrontFilesRequest,
@@ -269,12 +273,21 @@ import {
269
273
  storefrontFileWriteResultSchema,
270
274
  storefrontHostingSchema,
271
275
  storefrontPreviewLinkSchema,
276
+ storefrontSiteDomainSchema,
277
+ storefrontSiteDomainsSchema,
272
278
  storefrontSiteSchema,
273
279
  storefrontSlugAvailabilitySchema,
280
+ storefrontSourceArchivePartSchema,
281
+ storefrontSourceArchiveQuerySchema,
282
+ storefrontSourceBlobsResultSchema,
283
+ storefrontSourceReplacedSchema,
284
+ storefrontSourceSchema,
274
285
  storefrontTemplateSchema,
275
286
  storefrontVerifyReportSchema,
276
287
  storefrontVersionCreatedSchema,
277
288
  storefrontVersionSchema,
289
+ type UploadStorefrontSourceBlobsRequest,
290
+ uploadStorefrontSourceBlobsRequestSchema,
278
291
  type WriteStorefrontFilesRequest,
279
292
  writeStorefrontFilesRequestSchema,
280
293
  } from "./schemas/storefront-hosting";
@@ -1389,6 +1402,34 @@ export function createStoreClient(options: StoreClientOptions) {
1389
1402
  storeHttp.request("POST", "/storefront/site/preview-link", storefrontPreviewLinkSchema, {
1390
1403
  body: createStorefrontPreviewLinkRequestSchema.parse(body),
1391
1404
  }),
1405
+ /** `GET /v1/storefront/site/domains` — 주소 목록(기본 주소 + 내 도메인)과 DNS 안내 */
1406
+ listDomains: () =>
1407
+ storeHttp.request("GET", "/storefront/site/domains", storefrontSiteDomainsSchema),
1408
+ /**
1409
+ * `POST /v1/storefront/site/domains` (201) — 내 도메인을 추가한다. 응답의 `dnsRecords`를 DNS에 넣으면 서버가 소유를 확인하고
1410
+ * 인증서를 발급한다
1411
+ */
1412
+ addDomain: (body: AddStorefrontDomainRequest) =>
1413
+ storeHttp.request("POST", "/storefront/site/domains", storefrontSiteDomainSchema, {
1414
+ body: addStorefrontDomainRequestSchema.parse(body),
1415
+ }),
1416
+ /** `POST /v1/storefront/site/domains/{domainId}/verify` — DNS를 곧바로 다시 확인한다(실패한 도메인은 처음부터 다시) */
1417
+ verifyDomain: (domainId: string) =>
1418
+ storeHttp.request(
1419
+ "POST",
1420
+ path`/storefront/site/domains/${domainId}/verify`,
1421
+ storefrontSiteDomainSchema,
1422
+ ),
1423
+ /** `POST /v1/storefront/site/domains/{domainId}/primary` — 대표 주소로 지정한다. 다른 주소는 대표 주소로 301한다 */
1424
+ setPrimaryDomain: (domainId: string) =>
1425
+ storeHttp.request(
1426
+ "POST",
1427
+ path`/storefront/site/domains/${domainId}/primary`,
1428
+ storefrontSiteDomainsSchema,
1429
+ ),
1430
+ /** `DELETE /v1/storefront/site/domains/{domainId}` — 내 도메인 연결을 해제한다(곧바로 끊긴다) */
1431
+ removeDomain: (domainId: string) =>
1432
+ storeHttp.requestVoid("DELETE", path`/storefront/site/domains/${domainId}`),
1392
1433
  /** `POST /v1/storefront/site/disable` — 호스팅을 끈다(사이트 `CLOSED`, 슬러그 90일 보류). 다시 만들 수 있다 */
1393
1434
  disable: (body: DisableStorefrontHostingRequest) =>
1394
1435
  storeHttp.request("POST", "/storefront/site/disable", storefrontSiteSchema, {
@@ -1495,6 +1536,35 @@ export function createStoreClient(options: StoreClientOptions) {
1495
1536
  /** `GET /v1/storefront/site/builds/{buildId}` — 빌드 상태·실패 단계·로그 꼬리·규칙 결과 */
1496
1537
  getBuild: (buildId: string) =>
1497
1538
  storeHttp.request("GET", path`/storefront/site/builds/${buildId}`, storefrontBuildSchema),
1539
+
1540
+ // ─── 소스 내려받기·올리기 (#60, `sayren` CLI) ───
1541
+
1542
+ /** `GET /v1/storefront/site/source` — 지금 작업 트리를 고정하고 압축 파일(tar.gz) 크기·조각 수를 알린다 */
1543
+ getSource: () => storeHttp.request("GET", "/storefront/site/source", storefrontSourceSchema),
1544
+ /** `GET /v1/storefront/site/source/archive?sourceRef=&part=` — 압축 파일 조각(base64, 4MiB까지) */
1545
+ getSourceArchive: (params: { sourceRef: string; part?: number }) =>
1546
+ storeHttp.request(
1547
+ "GET",
1548
+ "/storefront/site/source/archive",
1549
+ storefrontSourceArchivePartSchema,
1550
+ { query: storefrontSourceArchiveQuerySchema.parse(params) as Query },
1551
+ ),
1552
+ /** `POST /v1/storefront/site/source/blobs` — 파일 내용 올리기(해시 키). 작업 트리는 바뀌지 않는다 */
1553
+ uploadSourceBlobs: (body: UploadStorefrontSourceBlobsRequest) =>
1554
+ storeHttp.request(
1555
+ "POST",
1556
+ "/storefront/site/source/blobs",
1557
+ storefrontSourceBlobsResultSchema,
1558
+ { body: uploadStorefrontSourceBlobsRequestSchema.parse(body) },
1559
+ ),
1560
+ /**
1561
+ * `PUT /v1/storefront/site/source` — 작업 트리 전체를 바꾼다. 409 `SOURCE_CHANGED`(내려받은 뒤 바뀜)·`EDIT_SESSION_OPEN`·
1562
+ * `SOURCE_BLOBS_MISSING`(`details.hashes`를 올리고 다시)
1563
+ */
1564
+ replaceSource: (body: ReplaceStorefrontSourceRequest) =>
1565
+ storeHttp.request("PUT", "/storefront/site/source", storefrontSourceReplacedSchema, {
1566
+ body: replaceStorefrontSourceRequestSchema.parse(body),
1567
+ }),
1498
1568
  },
1499
1569
 
1500
1570
  store: {