@sayren/store-sdk 0.18.0 → 0.19.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.d.mts +704 -25
- package/dist/index.mjs +228 -4
- package/package.json +1 -1
- package/src/client.ts +96 -0
- package/src/index.ts +1 -0
- package/src/schemas/scope.ts +3 -0
- package/src/schemas/storefront-hosting.ts +283 -0
package/dist/index.mjs
CHANGED
|
@@ -4559,6 +4559,193 @@ const sellerAddressRequestSchema = z.object({
|
|
|
4559
4559
|
address2: z.string().optional()
|
|
4560
4560
|
});
|
|
4561
4561
|
//#endregion
|
|
4562
|
+
//#region src/schemas/storefront-hosting.ts
|
|
4563
|
+
/**
|
|
4564
|
+
* 스토어프론트 호스팅 (이슈 #53, M1: 템플릿 발행) — 관리 API `/v1/storefront/**`의 계약이다.
|
|
4565
|
+
*
|
|
4566
|
+
* 셀러는 템플릿을 골라 사이트를 만들고 `{slug}.{호스팅 도메인}` 주소를 받는다. 발행은 버전 단위이고,
|
|
4567
|
+
* 되돌리기는 이전 버전을 다시 발행하는 것이다(재빌드 없음). 상태의 원천은 api DB이고 Cloudflare 쪽 반영
|
|
4568
|
+
* (라우팅 표·사이트 Worker)은 커밋 뒤 비동기다 — 반영 상태는 `provisioning`으로 본다.
|
|
4569
|
+
*
|
|
4570
|
+
* 스코프는 조회 `storefront:r`, 쓰기 `storefront:rw`(역할 OWNER·ADMIN)다. 에이전트(MCP)의 발행·되돌리기·템플릿 변경·
|
|
4571
|
+
* 공개 전환·슬러그 변경·호스팅 끄기는 승인(`APPROVAL_REQUIRED`)이다 — 구매자가 보는 화면을 바꾸는 쓰기다.
|
|
4572
|
+
*
|
|
4573
|
+
* 오류 코드:
|
|
4574
|
+
* - 403 `STOREFRONT_HOSTING_DISABLED` — 플랫폼 스위치가 꺼져 새 사이트를 만들 수 없다
|
|
4575
|
+
* - 404 `STOREFRONT_SITE_NOT_FOUND` · `STOREFRONT_TEMPLATE_NOT_FOUND` · `STOREFRONT_VERSION_NOT_FOUND`
|
|
4576
|
+
* - 409 `STOREFRONT_SITE_EXISTS` — 이미 사이트가 있다(스토어당 1개)
|
|
4577
|
+
* - 409 `STOREFRONT_SLUG_TAKEN` — 다른 사이트가 쓰거나 보류 중인 슬러그다
|
|
4578
|
+
* - 409 `STOREFRONT_SLUG_CHANGE_LIMIT` — 슬러그는 스토어당 30일에 3번까지 바꾼다
|
|
4579
|
+
* - 409 `STOREFRONT_SITE_CREATE_LIMIT` — 사이트는 스토어당 30일에 3번까지 만든다
|
|
4580
|
+
* - 409 `STOREFRONT_SITE_CHANGED` — 읽은 상태(`expected*`)와 현재 상태가 다르다. 다시 읽고 시도한다
|
|
4581
|
+
* - 409 `STOREFRONT_SITE_NOT_ACTIVE` — 정지(`SUSPENDED`)된 사이트는 바꾸거나 끌 수 없다
|
|
4582
|
+
* - 409 `STOREFRONT_VERSION_NOT_READY` — 빌드가 끝나지 않았거나 실패한 버전은 발행할 수 없다
|
|
4583
|
+
* - 409 `STOREFRONT_NO_ROLLBACK_TARGET` — 되돌릴 이전 발행 버전이 없다
|
|
4584
|
+
* - 400 `STOREFRONT_SLUG_CONFIRM_MISMATCH` — 호스팅 끄기 확인 입력이 현재 슬러그와 다르다
|
|
4585
|
+
* - 503 `STOREFRONT_PREVIEW_NOT_CONFIGURED` — 미리보기 서명 키가 설정되지 않았다
|
|
4586
|
+
*/
|
|
4587
|
+
/**
|
|
4588
|
+
* 슬러그 형식 — 스토어 코드와 같은 DNS 라벨 규칙(소문자·숫자·하이픈 3~30자, 하이픈으로 시작·끝 불가)에
|
|
4589
|
+
* 연속 하이픈 금지를 더한다. `--`는 버전 미리보기 주소(`v3--{slug}`)와 punycode(`xn--`)가 쓰는 구분자다.
|
|
4590
|
+
*/
|
|
4591
|
+
const STOREFRONT_SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9-]{1,28}[a-z0-9])$/;
|
|
4592
|
+
/** 호스팅 도메인에서 플랫폼이 쓰거나 쓸 이름 — 스토어 코드 예약어에 호스팅 전용 이름을 더한다 */
|
|
4593
|
+
const RESERVED_STOREFRONT_SLUGS = [
|
|
4594
|
+
...RESERVED_STORE_CODES,
|
|
4595
|
+
"mcp",
|
|
4596
|
+
"preview",
|
|
4597
|
+
"previews",
|
|
4598
|
+
"sayren",
|
|
4599
|
+
"shop",
|
|
4600
|
+
"shops",
|
|
4601
|
+
"abuse",
|
|
4602
|
+
"security",
|
|
4603
|
+
"closed",
|
|
4604
|
+
"coming-soon",
|
|
4605
|
+
"suspended",
|
|
4606
|
+
"dispatch",
|
|
4607
|
+
"control",
|
|
4608
|
+
"outbound"
|
|
4609
|
+
];
|
|
4610
|
+
function isReservedStorefrontSlug(slug) {
|
|
4611
|
+
return RESERVED_STOREFRONT_SLUGS.includes(slug.toLowerCase());
|
|
4612
|
+
}
|
|
4613
|
+
const storefrontSlugSchema = z.string().regex(STOREFRONT_SLUG_PATTERN, "소문자·숫자·하이픈 3~30자여야 하고 하이픈으로 시작하거나 끝날 수 없습니다").refine((slug) => !slug.includes("--"), "하이픈을 연달아 쓸 수 없습니다").refine((slug) => !isReservedStorefrontSlug(slug), "플랫폼이 쓰는 이름이라 쓸 수 없습니다").describe("주소 슬러그. `{slug}.{호스팅 도메인}`이 사이트 주소가 된다");
|
|
4614
|
+
/** 바꾼 슬러그를 다른 사이트가 가져가지 못하게 막는 기간(일). 보류 동안 옛 주소는 새 주소로 301한다 */
|
|
4615
|
+
const STOREFRONT_SLUG_HOLD_DAYS = 90;
|
|
4616
|
+
/** 슬러그 변경 한도 — 이 기간(일) 안에 */
|
|
4617
|
+
const STOREFRONT_SLUG_CHANGE_WINDOW_DAYS = 30;
|
|
4618
|
+
/** 슬러그 변경 한도 — 횟수(스토어 단위. 끄고 다시 만들어도 이어서 센다) */
|
|
4619
|
+
const STOREFRONT_SLUG_CHANGE_LIMIT = 3;
|
|
4620
|
+
/** 사이트 만들기 한도 — 같은 창(30일) 안의 횟수(스토어 단위). 끄고 만들기를 되풀이해 이름을 묶어 두지 못하게 한다 */
|
|
4621
|
+
const STOREFRONT_SITE_CREATE_LIMIT = 3;
|
|
4622
|
+
const storefrontTemplateSchema = z.object({
|
|
4623
|
+
templateId: z.string().describe("템플릿 id (예: `basic`)"),
|
|
4624
|
+
name: z.string().describe("템플릿 이름"),
|
|
4625
|
+
industry: z.string().describe("업종 (예: `general`·`fashion`·`food`). 목록 필터에 쓴다"),
|
|
4626
|
+
description: z.string().describe("템플릿 설명"),
|
|
4627
|
+
thumbnailUrl: z.string().nullable().describe("썸네일 이미지 주소. 없으면 null"),
|
|
4628
|
+
version: z.string().describe("현재 템플릿 버전. 새 사이트·템플릿 변경은 이 버전으로 만든다"),
|
|
4629
|
+
isDefault: z.boolean().describe("기본 템플릿인가 (스토어 생성 시 자동 생성에 쓴다)")
|
|
4630
|
+
});
|
|
4631
|
+
/**
|
|
4632
|
+
* 버전 상태 — M1은 템플릿 빌드 산출물을 그대로 쓰므로 만들 때 곧바로 `READY`다. `BUILDING`·`FAILED`는
|
|
4633
|
+
* 셀러 편집 빌드(M2)가 쓴다. 발행 여부는 상태가 아니라 사이트의 발행 포인터가 원천이다(`published`).
|
|
4634
|
+
*/
|
|
4635
|
+
const storefrontVersionStatusSchema = z.enum([
|
|
4636
|
+
"BUILDING",
|
|
4637
|
+
"READY",
|
|
4638
|
+
"FAILED"
|
|
4639
|
+
]).describe("`BUILDING` 빌드 중 · `READY` 발행 가능 · `FAILED` 빌드 실패");
|
|
4640
|
+
const storefrontVersionSchema = z.object({
|
|
4641
|
+
versionId: z.string(),
|
|
4642
|
+
number: z.number().int().min(1).describe("사이트 안에서 1부터 늘어나는 번호 (v1, v2…)"),
|
|
4643
|
+
templateId: z.string().describe("이 버전의 기준 템플릿"),
|
|
4644
|
+
templateVersion: z.string().describe("이 버전의 기준 템플릿 버전"),
|
|
4645
|
+
status: storefrontVersionStatusSchema,
|
|
4646
|
+
published: z.boolean().describe("지금 발행된 버전인가"),
|
|
4647
|
+
publishedAt: z.string().nullable().describe("마지막으로 발행한 시각 (ISO 8601). 발행한 적 없으면 null"),
|
|
4648
|
+
message: z.string().nullable().describe("버전 메모"),
|
|
4649
|
+
createdByType: z.string().describe("만든 행위자 유형 (`USER`·`AGENT`·`APP`·`TOKEN`·`SYSTEM`). 늘어날 수 있다"),
|
|
4650
|
+
createdAt: z.string().describe("만든 시각 (ISO 8601)")
|
|
4651
|
+
});
|
|
4652
|
+
const storefrontSiteStatusSchema = z.enum([
|
|
4653
|
+
"ACTIVE",
|
|
4654
|
+
"SUSPENDED",
|
|
4655
|
+
"CLOSED"
|
|
4656
|
+
]).describe("`ACTIVE` 운영 중 · `SUSPENDED` 운영자 정지 · `CLOSED` 호스팅 끔·스토어 폐쇄");
|
|
4657
|
+
const storefrontVisibilitySchema = z.enum(["COMING_SOON", "PUBLIC"]).describe("`COMING_SOON` 오픈 준비 중(방문자에게 준비 중 페이지) · `PUBLIC` 공개");
|
|
4658
|
+
const storefrontSourceModeSchema = z.enum(["MANAGED", "CUSTOM"]).describe("`MANAGED` 템플릿 그대로 · `CUSTOM` 한 번이라도 편집함");
|
|
4659
|
+
const storefrontDomainSchema = z.object({
|
|
4660
|
+
hostname: z.string().describe("호스트 이름 (예: `mystore.sayren.co`)"),
|
|
4661
|
+
kind: z.enum(["PLATFORM", "CUSTOM"]).describe("`PLATFORM` 슬러그 주소 · `CUSTOM` 내 도메인"),
|
|
4662
|
+
status: z.enum(["ACTIVE", "HELD"]).describe("`ACTIVE` 사용 중 · `HELD` 슬러그를 바꿔 보류 중(새 주소로 301)"),
|
|
4663
|
+
isPrimary: z.boolean().describe("대표 주소인가 (`Store.storefrontUrl`)"),
|
|
4664
|
+
holdUntil: z.string().nullable().describe("보류가 끝나는 시각 (ISO 8601). 보류가 아니면 null")
|
|
4665
|
+
});
|
|
4666
|
+
/**
|
|
4667
|
+
* 호스팅 반영 상태 — 발행·슬러그·공개 전환은 DB에 먼저 확정되고 Cloudflare 반영은 커밋 뒤에 한다.
|
|
4668
|
+
* `PENDING`이면 반영 중이거나 재시도 대기다(잡이 다시 한다). 반영 뒤에도 라우팅 전파에 최대 1분이 걸린다.
|
|
4669
|
+
*/
|
|
4670
|
+
const storefrontProvisioningSchema = z.object({
|
|
4671
|
+
status: z.enum([
|
|
4672
|
+
"SYNCED",
|
|
4673
|
+
"PENDING",
|
|
4674
|
+
"FAILED"
|
|
4675
|
+
]).describe("`SYNCED` 반영됨 · `PENDING` 반영 대기 · `FAILED` 반영이 여러 번 실패함(자동 재시도는 계속한다)"),
|
|
4676
|
+
lastErrorCode: z.string().nullable().describe("마지막 반영 실패 코드. 없으면 null"),
|
|
4677
|
+
syncedAt: z.string().nullable().describe("마지막으로 반영한 시각 (ISO 8601)")
|
|
4678
|
+
});
|
|
4679
|
+
const storefrontSiteSchema = z.object({
|
|
4680
|
+
siteId: z.string(),
|
|
4681
|
+
slug: z.string().describe("주소 슬러그"),
|
|
4682
|
+
hostname: z.string().describe("대표 호스트 이름"),
|
|
4683
|
+
url: z.string().describe("대표 주소 (`https://{hostname}`)"),
|
|
4684
|
+
domains: z.array(storefrontDomainSchema).describe("사용 중·보류 중인 호스트 이름"),
|
|
4685
|
+
templateId: z.string().describe("지금 발행된 버전의 템플릿 (발행 전이면 만든 템플릿)"),
|
|
4686
|
+
sourceMode: storefrontSourceModeSchema,
|
|
4687
|
+
status: storefrontSiteStatusSchema,
|
|
4688
|
+
visibility: storefrontVisibilitySchema,
|
|
4689
|
+
publishedVersion: storefrontVersionSchema.nullable().describe("지금 발행된 버전"),
|
|
4690
|
+
provisioning: storefrontProvisioningSchema,
|
|
4691
|
+
slugChangesRemaining: z.number().int().min(0).describe(`최근 30일 기준 남은 슬러그 변경 횟수`),
|
|
4692
|
+
createdAt: z.string(),
|
|
4693
|
+
updatedAt: z.string()
|
|
4694
|
+
});
|
|
4695
|
+
/** `GET /v1/storefront/site` — 스위치 상태와 현재 사이트(없으면 null. 끈 사이트는 싣지 않는다) */
|
|
4696
|
+
const storefrontHostingSchema = z.object({
|
|
4697
|
+
enabled: z.boolean().describe("새 사이트를 만들 수 있는가 (플랫폼 스위치)"),
|
|
4698
|
+
domain: z.string().describe("호스팅 도메인 (예: `sayren.co`). 사이트 주소는 `{slug}.{domain}`"),
|
|
4699
|
+
site: storefrontSiteSchema.nullable()
|
|
4700
|
+
});
|
|
4701
|
+
const storefrontSlugAvailabilitySchema = z.object({
|
|
4702
|
+
slug: z.string(),
|
|
4703
|
+
available: z.boolean(),
|
|
4704
|
+
reason: z.enum([
|
|
4705
|
+
"INVALID",
|
|
4706
|
+
"RESERVED",
|
|
4707
|
+
"TAKEN",
|
|
4708
|
+
"CURRENT"
|
|
4709
|
+
]).nullable().describe("쓸 수 없는 이유. `INVALID` 형식 · `RESERVED` 예약어 · `TAKEN` 사용·보류 중 · `CURRENT` 지금 내 슬러그")
|
|
4710
|
+
});
|
|
4711
|
+
const createStorefrontSiteRequestSchema = z.object({
|
|
4712
|
+
templateId: z.string().min(1).max(64).describe("템플릿 id"),
|
|
4713
|
+
slug: storefrontSlugSchema.optional().describe("주소 슬러그. 생략하면 스토어 코드")
|
|
4714
|
+
});
|
|
4715
|
+
const changeStorefrontTemplateRequestSchema = z.object({
|
|
4716
|
+
templateId: z.string().min(1).max(64).describe("바꿀 템플릿 id"),
|
|
4717
|
+
publish: z.boolean().optional().describe("새 버전을 곧바로 발행하는가 (기본 true). false면 버전만 만든다"),
|
|
4718
|
+
message: z.string().max(200).optional().describe("버전 메모")
|
|
4719
|
+
});
|
|
4720
|
+
/**
|
|
4721
|
+
* 발행·되돌리기 — 발행은 사이트의 발행 포인터를 바꾸는 조건부 쓰기다. `expectedPublishedVersionId`를 주면
|
|
4722
|
+
* 지금 발행 버전이 그 값일 때만 바꾼다(화면을 본 뒤 다른 사람이 바꿨으면 409 `STOREFRONT_SITE_CHANGED`).
|
|
4723
|
+
* 이미 그 버전이 발행돼 있으면 아무것도 바꾸지 않고 200이다(같은 요청의 재실행이 안전하다).
|
|
4724
|
+
*/
|
|
4725
|
+
const publishStorefrontVersionRequestSchema = z.object({ expectedPublishedVersionId: z.string().nullable().optional().describe("화면에서 본 발행 버전 id (발행 전이었으면 null). 생략하면 확인하지 않는다") });
|
|
4726
|
+
const rollbackStorefrontRequestSchema = z.object({
|
|
4727
|
+
versionId: z.string().optional().describe("되돌릴 버전. 생략하면 지금 버전 직전에 발행했던 버전"),
|
|
4728
|
+
expectedPublishedVersionId: z.string().nullable().optional()
|
|
4729
|
+
});
|
|
4730
|
+
const changeStorefrontSlugRequestSchema = z.object({ slug: storefrontSlugSchema });
|
|
4731
|
+
const setStorefrontVisibilityRequestSchema = z.object({
|
|
4732
|
+
visibility: storefrontVisibilitySchema,
|
|
4733
|
+
expectedVisibility: storefrontVisibilitySchema.optional().describe("화면에서 본 공개 상태. 주면 지금 값이 같을 때만 바꾼다")
|
|
4734
|
+
});
|
|
4735
|
+
/** 호스팅 끄기 — 사이트를 닫고(`CLOSED`) 슬러그를 보류한다. 확인 입력은 현재 슬러그다 */
|
|
4736
|
+
const disableStorefrontHostingRequestSchema = z.object({ confirmSlug: z.string().min(1).describe("확인 입력 — 현재 슬러그") });
|
|
4737
|
+
const storefrontSlugAvailabilityQuerySchema = z.object({ slug: z.string().describe("확인할 슬러그") });
|
|
4738
|
+
/**
|
|
4739
|
+
* 오픈 준비 중 미리보기 링크 — 콘솔에서 로그인한 OWNER·ADMIN만 받는다(PAT·에이전트 불가). 링크는 5분 안에 한 번 열면
|
|
4740
|
+
* 그 브라우저에 12시간짜리 미리보기 쿠키가 생기고 오픈 준비 중인 사이트의 실제 화면을 본다. 링크를 남에게 넘기면 그 사람도
|
|
4741
|
+
* 볼 수 있으므로 공유하지 않는다.
|
|
4742
|
+
*/
|
|
4743
|
+
const createStorefrontPreviewLinkRequestSchema = z.object({ path: z.string().max(512).optional().describe("열 경로 (`/`로 시작). 생략하면 `/`") });
|
|
4744
|
+
const storefrontPreviewLinkSchema = z.object({
|
|
4745
|
+
url: z.string().describe("미리보기 링크 — 5분 안에 연다"),
|
|
4746
|
+
expiresAt: z.string().describe("링크 만료 시각 (ISO 8601)")
|
|
4747
|
+
});
|
|
4748
|
+
//#endregion
|
|
4562
4749
|
//#region src/client.ts
|
|
4563
4750
|
function formBody(fields) {
|
|
4564
4751
|
return new URLSearchParams(fields).toString();
|
|
@@ -5161,6 +5348,40 @@ list: (params) => storeHttp.request("GET", "/audit-logs", auditLogPageSchema, {
|
|
|
5161
5348
|
remove: (addressId) => storeHttp.requestVoid("DELETE", path`/seller-addresses/${addressId}`),
|
|
5162
5349
|
setDefault: (addressId) => storeHttp.requestVoid("POST", path`/seller-addresses/${addressId}/default`)
|
|
5163
5350
|
},
|
|
5351
|
+
/**
|
|
5352
|
+
* 스토어프론트 호스팅 (이슈 #53) — 조회 `storefront:r`, 쓰기 `storefront:rw`(OWNER·ADMIN).
|
|
5353
|
+
* 쓰기 응답은 바뀐 사이트다. Cloudflare 반영은 커밋 뒤라 `provisioning.status`가 잠시 `PENDING`일 수 있다.
|
|
5354
|
+
* 에이전트 토큰의 발행·되돌리기·템플릿 변경·공개 전환·슬러그 변경·끄기는 승인 대기(`ApprovalPendingError`)다.
|
|
5355
|
+
*/
|
|
5356
|
+
storefront: {
|
|
5357
|
+
/** `GET /v1/storefront/templates` — 템플릿 카탈로그 */
|
|
5358
|
+
listTemplates: () => storeHttp.request("GET", "/storefront/templates", z.array(storefrontTemplateSchema)),
|
|
5359
|
+
/** `GET /v1/storefront/site` — 스위치 상태와 현재 사이트(없으면 `site: null`) */
|
|
5360
|
+
get: () => storeHttp.request("GET", "/storefront/site", storefrontHostingSchema),
|
|
5361
|
+
/** `GET /v1/storefront/slug-availability?slug=` — 슬러그를 쓸 수 있는가 */
|
|
5362
|
+
checkSlug: (slug) => storeHttp.request("GET", "/storefront/slug-availability", storefrontSlugAvailabilitySchema, { query: { slug } }),
|
|
5363
|
+
/** `POST /v1/storefront/site` (201) — 템플릿으로 사이트를 만들고 v1을 발행한다. 공개 상태는 오픈 준비 중이다 */
|
|
5364
|
+
create: (body) => storeHttp.request("POST", "/storefront/site", storefrontSiteSchema, { body: createStorefrontSiteRequestSchema.parse(body) }),
|
|
5365
|
+
/** `POST /v1/storefront/site/template` — 템플릿을 바꾼다. 새 버전을 만들고 기본으로 곧바로 발행한다 */
|
|
5366
|
+
changeTemplate: (body) => storeHttp.request("POST", "/storefront/site/template", storefrontSiteSchema, { body: changeStorefrontTemplateRequestSchema.parse(body) }),
|
|
5367
|
+
/** `GET /v1/storefront/site/versions` — 버전 목록(최신 먼저) */
|
|
5368
|
+
listVersions: () => storeHttp.request("GET", "/storefront/site/versions", z.array(storefrontVersionSchema)),
|
|
5369
|
+
/** `POST /v1/storefront/site/versions/{versionId}/publish` — 그 버전을 발행한다(이미 발행돼 있으면 그대로 200) */
|
|
5370
|
+
publish: (versionId, body = {}) => storeHttp.request("POST", path`/storefront/site/versions/${versionId}/publish`, storefrontSiteSchema, { body: publishStorefrontVersionRequestSchema.parse(body) }),
|
|
5371
|
+
/** `POST /v1/storefront/site/rollback` — 이전 발행 버전으로 되돌린다(재빌드 없음) */
|
|
5372
|
+
rollback: (body = {}) => storeHttp.request("POST", "/storefront/site/rollback", storefrontSiteSchema, { body: rollbackStorefrontRequestSchema.parse(body) }),
|
|
5373
|
+
/** `PUT /v1/storefront/site/slug` — 슬러그를 바꾼다. 옛 슬러그는 90일 보류되고 새 주소로 301한다 */
|
|
5374
|
+
changeSlug: (body) => storeHttp.request("PUT", "/storefront/site/slug", storefrontSiteSchema, { body: changeStorefrontSlugRequestSchema.parse(body) }),
|
|
5375
|
+
/** `PUT /v1/storefront/site/visibility` — 오픈 준비 중 ↔ 공개 */
|
|
5376
|
+
setVisibility: (body) => storeHttp.request("PUT", "/storefront/site/visibility", storefrontSiteSchema, { body: setStorefrontVisibilityRequestSchema.parse(body) }),
|
|
5377
|
+
/**
|
|
5378
|
+
* `POST /v1/storefront/site/preview-link` — 오픈 준비 중인 사이트를 구성원이 볼 수 있는 5분짜리 링크.
|
|
5379
|
+
* 콘솔에서 로그인한 OWNER·ADMIN만 받는다
|
|
5380
|
+
*/
|
|
5381
|
+
createPreviewLink: (body = {}) => storeHttp.request("POST", "/storefront/site/preview-link", storefrontPreviewLinkSchema, { body: createStorefrontPreviewLinkRequestSchema.parse(body) }),
|
|
5382
|
+
/** `POST /v1/storefront/site/disable` — 호스팅을 끈다(사이트 `CLOSED`, 슬러그 90일 보류). 다시 만들 수 있다 */
|
|
5383
|
+
disable: (body) => storeHttp.request("POST", "/storefront/site/disable", storefrontSiteSchema, { body: disableStorefrontHostingRequestSchema.parse(body) })
|
|
5384
|
+
},
|
|
5164
5385
|
store: {
|
|
5165
5386
|
get: () => storeHttp.request("GET", "/store", storeSchema),
|
|
5166
5387
|
/**
|
|
@@ -5289,7 +5510,8 @@ const STORE_SCOPE_RESOURCES = {
|
|
|
5289
5510
|
member: ["r", "rw"],
|
|
5290
5511
|
customer: ["r", "rw"],
|
|
5291
5512
|
audit: ["r"],
|
|
5292
|
-
promotion: ["r", "rw"]
|
|
5513
|
+
promotion: ["r", "rw"],
|
|
5514
|
+
storefront: ["r", "rw"]
|
|
5293
5515
|
};
|
|
5294
5516
|
const storeScopeResourceSchema = z.enum(Object.keys(STORE_SCOPE_RESOURCES)).describe("스코프 리소스");
|
|
5295
5517
|
/** 카탈로그상 존재하는 스코프 문자열인가 (예: `settlement:rw`는 false) */
|
|
@@ -5318,7 +5540,8 @@ const STORE_ROLE_SCOPES = {
|
|
|
5318
5540
|
"member:rw",
|
|
5319
5541
|
"customer:rw",
|
|
5320
5542
|
"audit:r",
|
|
5321
|
-
"promotion:rw"
|
|
5543
|
+
"promotion:rw",
|
|
5544
|
+
"storefront:rw"
|
|
5322
5545
|
],
|
|
5323
5546
|
ADMIN: [
|
|
5324
5547
|
"product:rw",
|
|
@@ -5333,7 +5556,8 @@ const STORE_ROLE_SCOPES = {
|
|
|
5333
5556
|
"member:rw",
|
|
5334
5557
|
"customer:rw",
|
|
5335
5558
|
"audit:r",
|
|
5336
|
-
"promotion:rw"
|
|
5559
|
+
"promotion:rw",
|
|
5560
|
+
"storefront:rw"
|
|
5337
5561
|
],
|
|
5338
5562
|
STAFF: [
|
|
5339
5563
|
"product:rw",
|
|
@@ -5669,4 +5893,4 @@ function createStoreSession(options) {
|
|
|
5669
5893
|
};
|
|
5670
5894
|
}
|
|
5671
5895
|
//#endregion
|
|
5672
|
-
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, DOWNLOAD_DEFAULTS, FULFILLMENT_RULES, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_CODES_PER_UPLOAD, MAX_CODE_LENGTH, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, 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, PRIVATE_UPLOAD_HEADERS, REFUND_POLICY_DEFAULTS, REFUND_POLICY_DELIVERY_FEE_KEYS, REMOTE_AREA_ZIP_RANGES, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, 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_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, 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, autoFulfillableOf, buildAuthorizeUrl, buildQuery, bulkResultSchema, cancelBySellerRequestSchema, cancelBySellerResultSchema, carrierSchema, cashReceiptSchema, categoryAttributeSchema, categoryCreateRequestSchema, categoryDeleteQuerySchema, categoryDeleteStrategySchema, categoryListQuerySchema, categoryPatchRequestSchema, categoryProductSortSchema, categorySchema, categorySearchResultSchema, categoryTreeNodeSchema, categoryWithPathSchema, 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, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, digitalAssetAttachRequestSchema, digitalAssetPreviewSchema, digitalAssetSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, exchangeStoreTokenViaOAuth, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentCodeBatchSchema, fulfillmentCodeListQuerySchema, fulfillmentCodePageSchema, fulfillmentCodeRejectionSchema, fulfillmentCodeRevealSchema, fulfillmentCodeSchema, fulfillmentCodeStatusSchema, fulfillmentCodeUploadRequestSchema, fulfillmentMailResendSchema, fulfillmentModeOf, fulfillmentModeSchema, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isReservedStoreCode, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, mcpRuleResultSchema, mcpToolEventSchema, myAccountSchema, myStoreSchema, normalizeCouponCode, oauthClientRegistrationRequestSchema, oauthClientRegistrationResponseSchema, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemCodeSchema, orderItemDownloadSchema, 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, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, quoteDelivery, quotePricing, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, requiresCollection, requiresShipping, resolveFulfillmentMode, resolveRefundPolicy, resolveShippingPolicy, reviewListQuerySchema, reviewReportResultSchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, scopeAccessSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, stockTrackingOf, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeTokenResponseSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, userTokenResponseSchema, usesCodePool, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, withdrawalRestrictedOf, writeDryRunResultSchema, writePreviewSchema };
|
|
5896
|
+
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, DOWNLOAD_DEFAULTS, FULFILLMENT_RULES, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_CODES_PER_UPLOAD, MAX_CODE_LENGTH, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, 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, PRIVATE_UPLOAD_HEADERS, REFUND_POLICY_DEFAULTS, REFUND_POLICY_DELIVERY_FEE_KEYS, REMOTE_AREA_ZIP_RANGES, RESERVED_STOREFRONT_SLUGS, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, STOREFRONT_SITE_CREATE_LIMIT, STOREFRONT_SLUG_CHANGE_LIMIT, STOREFRONT_SLUG_CHANGE_WINDOW_DAYS, STOREFRONT_SLUG_HOLD_DAYS, STOREFRONT_SLUG_PATTERN, 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_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, 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, autoFulfillableOf, 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, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, digitalAssetAttachRequestSchema, digitalAssetPreviewSchema, digitalAssetSchema, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, exchangeStoreTokenViaOAuth, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentCodeBatchSchema, fulfillmentCodeListQuerySchema, fulfillmentCodePageSchema, fulfillmentCodeRejectionSchema, fulfillmentCodeRevealSchema, fulfillmentCodeSchema, fulfillmentCodeStatusSchema, fulfillmentCodeUploadRequestSchema, fulfillmentMailResendSchema, fulfillmentModeOf, fulfillmentModeSchema, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isReservedStoreCode, isReservedStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, mcpRuleResultSchema, mcpToolEventSchema, myAccountSchema, myStoreSchema, normalizeCouponCode, oauthClientRegistrationRequestSchema, oauthClientRegistrationResponseSchema, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemCodeSchema, orderItemDownloadSchema, 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, resolveFulfillmentMode, resolveRefundPolicy, resolveShippingPolicy, reviewListQuerySchema, reviewReportResultSchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, scopeAccessSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, stockTrackingOf, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeTokenResponseSchema, storefrontDomainSchema, storefrontHostingSchema, storefrontPreviewLinkSchema, storefrontProvisioningSchema, storefrontSiteSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceModeSchema, storefrontTemplateSchema, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, userTokenResponseSchema, usesCodePool, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, withdrawalRestrictedOf, writeDryRunResultSchema, writePreviewSchema };
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -236,6 +236,30 @@ import {
|
|
|
236
236
|
updateMemberRoleRequestSchema,
|
|
237
237
|
updateStoreRequestSchema,
|
|
238
238
|
} from "./schemas/store";
|
|
239
|
+
import {
|
|
240
|
+
type ChangeStorefrontSlugRequest,
|
|
241
|
+
type ChangeStorefrontTemplateRequest,
|
|
242
|
+
type CreateStorefrontPreviewLinkRequest,
|
|
243
|
+
type CreateStorefrontSiteRequest,
|
|
244
|
+
changeStorefrontSlugRequestSchema,
|
|
245
|
+
changeStorefrontTemplateRequestSchema,
|
|
246
|
+
createStorefrontPreviewLinkRequestSchema,
|
|
247
|
+
createStorefrontSiteRequestSchema,
|
|
248
|
+
type DisableStorefrontHostingRequest,
|
|
249
|
+
disableStorefrontHostingRequestSchema,
|
|
250
|
+
type PublishStorefrontVersionRequest,
|
|
251
|
+
publishStorefrontVersionRequestSchema,
|
|
252
|
+
type RollbackStorefrontRequest,
|
|
253
|
+
rollbackStorefrontRequestSchema,
|
|
254
|
+
type SetStorefrontVisibilityRequest,
|
|
255
|
+
setStorefrontVisibilityRequestSchema,
|
|
256
|
+
storefrontHostingSchema,
|
|
257
|
+
storefrontPreviewLinkSchema,
|
|
258
|
+
storefrontSiteSchema,
|
|
259
|
+
storefrontSlugAvailabilitySchema,
|
|
260
|
+
storefrontTemplateSchema,
|
|
261
|
+
storefrontVersionSchema,
|
|
262
|
+
} from "./schemas/storefront-hosting";
|
|
239
263
|
import {
|
|
240
264
|
type UploadPurpose,
|
|
241
265
|
type UploadRequest,
|
|
@@ -1329,6 +1353,78 @@ export function createStoreClient(options: StoreClientOptions) {
|
|
|
1329
1353
|
storeHttp.requestVoid("POST", path`/seller-addresses/${addressId}/default`),
|
|
1330
1354
|
},
|
|
1331
1355
|
|
|
1356
|
+
/**
|
|
1357
|
+
* 스토어프론트 호스팅 (이슈 #53) — 조회 `storefront:r`, 쓰기 `storefront:rw`(OWNER·ADMIN).
|
|
1358
|
+
* 쓰기 응답은 바뀐 사이트다. Cloudflare 반영은 커밋 뒤라 `provisioning.status`가 잠시 `PENDING`일 수 있다.
|
|
1359
|
+
* 에이전트 토큰의 발행·되돌리기·템플릿 변경·공개 전환·슬러그 변경·끄기는 승인 대기(`ApprovalPendingError`)다.
|
|
1360
|
+
*/
|
|
1361
|
+
storefront: {
|
|
1362
|
+
/** `GET /v1/storefront/templates` — 템플릿 카탈로그 */
|
|
1363
|
+
listTemplates: () =>
|
|
1364
|
+
storeHttp.request("GET", "/storefront/templates", z.array(storefrontTemplateSchema)),
|
|
1365
|
+
/** `GET /v1/storefront/site` — 스위치 상태와 현재 사이트(없으면 `site: null`) */
|
|
1366
|
+
get: () => storeHttp.request("GET", "/storefront/site", storefrontHostingSchema),
|
|
1367
|
+
/** `GET /v1/storefront/slug-availability?slug=` — 슬러그를 쓸 수 있는가 */
|
|
1368
|
+
checkSlug: (slug: string) =>
|
|
1369
|
+
storeHttp.request(
|
|
1370
|
+
"GET",
|
|
1371
|
+
"/storefront/slug-availability",
|
|
1372
|
+
storefrontSlugAvailabilitySchema,
|
|
1373
|
+
{
|
|
1374
|
+
query: { slug },
|
|
1375
|
+
},
|
|
1376
|
+
),
|
|
1377
|
+
/** `POST /v1/storefront/site` (201) — 템플릿으로 사이트를 만들고 v1을 발행한다. 공개 상태는 오픈 준비 중이다 */
|
|
1378
|
+
create: (body: CreateStorefrontSiteRequest) =>
|
|
1379
|
+
storeHttp.request("POST", "/storefront/site", storefrontSiteSchema, {
|
|
1380
|
+
body: createStorefrontSiteRequestSchema.parse(body),
|
|
1381
|
+
}),
|
|
1382
|
+
/** `POST /v1/storefront/site/template` — 템플릿을 바꾼다. 새 버전을 만들고 기본으로 곧바로 발행한다 */
|
|
1383
|
+
changeTemplate: (body: ChangeStorefrontTemplateRequest) =>
|
|
1384
|
+
storeHttp.request("POST", "/storefront/site/template", storefrontSiteSchema, {
|
|
1385
|
+
body: changeStorefrontTemplateRequestSchema.parse(body),
|
|
1386
|
+
}),
|
|
1387
|
+
/** `GET /v1/storefront/site/versions` — 버전 목록(최신 먼저) */
|
|
1388
|
+
listVersions: () =>
|
|
1389
|
+
storeHttp.request("GET", "/storefront/site/versions", z.array(storefrontVersionSchema)),
|
|
1390
|
+
/** `POST /v1/storefront/site/versions/{versionId}/publish` — 그 버전을 발행한다(이미 발행돼 있으면 그대로 200) */
|
|
1391
|
+
publish: (versionId: string, body: PublishStorefrontVersionRequest = {}) =>
|
|
1392
|
+
storeHttp.request(
|
|
1393
|
+
"POST",
|
|
1394
|
+
path`/storefront/site/versions/${versionId}/publish`,
|
|
1395
|
+
storefrontSiteSchema,
|
|
1396
|
+
{ body: publishStorefrontVersionRequestSchema.parse(body) },
|
|
1397
|
+
),
|
|
1398
|
+
/** `POST /v1/storefront/site/rollback` — 이전 발행 버전으로 되돌린다(재빌드 없음) */
|
|
1399
|
+
rollback: (body: RollbackStorefrontRequest = {}) =>
|
|
1400
|
+
storeHttp.request("POST", "/storefront/site/rollback", storefrontSiteSchema, {
|
|
1401
|
+
body: rollbackStorefrontRequestSchema.parse(body),
|
|
1402
|
+
}),
|
|
1403
|
+
/** `PUT /v1/storefront/site/slug` — 슬러그를 바꾼다. 옛 슬러그는 90일 보류되고 새 주소로 301한다 */
|
|
1404
|
+
changeSlug: (body: ChangeStorefrontSlugRequest) =>
|
|
1405
|
+
storeHttp.request("PUT", "/storefront/site/slug", storefrontSiteSchema, {
|
|
1406
|
+
body: changeStorefrontSlugRequestSchema.parse(body),
|
|
1407
|
+
}),
|
|
1408
|
+
/** `PUT /v1/storefront/site/visibility` — 오픈 준비 중 ↔ 공개 */
|
|
1409
|
+
setVisibility: (body: SetStorefrontVisibilityRequest) =>
|
|
1410
|
+
storeHttp.request("PUT", "/storefront/site/visibility", storefrontSiteSchema, {
|
|
1411
|
+
body: setStorefrontVisibilityRequestSchema.parse(body),
|
|
1412
|
+
}),
|
|
1413
|
+
/**
|
|
1414
|
+
* `POST /v1/storefront/site/preview-link` — 오픈 준비 중인 사이트를 구성원이 볼 수 있는 5분짜리 링크.
|
|
1415
|
+
* 콘솔에서 로그인한 OWNER·ADMIN만 받는다
|
|
1416
|
+
*/
|
|
1417
|
+
createPreviewLink: (body: CreateStorefrontPreviewLinkRequest = {}) =>
|
|
1418
|
+
storeHttp.request("POST", "/storefront/site/preview-link", storefrontPreviewLinkSchema, {
|
|
1419
|
+
body: createStorefrontPreviewLinkRequestSchema.parse(body),
|
|
1420
|
+
}),
|
|
1421
|
+
/** `POST /v1/storefront/site/disable` — 호스팅을 끈다(사이트 `CLOSED`, 슬러그 90일 보류). 다시 만들 수 있다 */
|
|
1422
|
+
disable: (body: DisableStorefrontHostingRequest) =>
|
|
1423
|
+
storeHttp.request("POST", "/storefront/site/disable", storefrontSiteSchema, {
|
|
1424
|
+
body: disableStorefrontHostingRequestSchema.parse(body),
|
|
1425
|
+
}),
|
|
1426
|
+
},
|
|
1427
|
+
|
|
1332
1428
|
store: {
|
|
1333
1429
|
get: () => storeHttp.request("GET", "/store", storeSchema),
|
|
1334
1430
|
/**
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * from "./schemas/refund-policy";
|
|
|
40
40
|
export * from "./schemas/scope";
|
|
41
41
|
export * from "./schemas/shipping-policy";
|
|
42
42
|
export * from "./schemas/store";
|
|
43
|
+
export * from "./schemas/storefront-hosting";
|
|
43
44
|
export * from "./schemas/telemetry";
|
|
44
45
|
export * from "./schemas/upload";
|
|
45
46
|
export * from "./schemas/webhook-event";
|
package/src/schemas/scope.ts
CHANGED
|
@@ -30,6 +30,7 @@ export const STORE_SCOPE_RESOURCES = {
|
|
|
30
30
|
customer: ["r", "rw"],
|
|
31
31
|
audit: ["r"],
|
|
32
32
|
promotion: ["r", "rw"],
|
|
33
|
+
storefront: ["r", "rw"],
|
|
33
34
|
} as const satisfies Record<string, readonly ScopeAccess[]>;
|
|
34
35
|
|
|
35
36
|
export type StoreScopeResource = keyof typeof STORE_SCOPE_RESOURCES;
|
|
@@ -67,6 +68,7 @@ export const STORE_ROLE_SCOPES = {
|
|
|
67
68
|
"customer:rw",
|
|
68
69
|
"audit:r",
|
|
69
70
|
"promotion:rw",
|
|
71
|
+
"storefront:rw",
|
|
70
72
|
],
|
|
71
73
|
ADMIN: [
|
|
72
74
|
"product:rw",
|
|
@@ -82,6 +84,7 @@ export const STORE_ROLE_SCOPES = {
|
|
|
82
84
|
"customer:rw",
|
|
83
85
|
"audit:r",
|
|
84
86
|
"promotion:rw",
|
|
87
|
+
"storefront:rw",
|
|
85
88
|
],
|
|
86
89
|
STAFF: [
|
|
87
90
|
"product:rw",
|