@sayren/store-sdk 0.22.0 → 0.23.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 +149 -18
- package/dist/index.mjs +95 -9
- package/package.json +1 -1
- package/src/client.ts +18 -2
- package/src/schemas/storefront-hosting.ts +54 -6
- package/src/session.ts +42 -1
package/dist/index.d.mts
CHANGED
|
@@ -165,8 +165,8 @@ export declare const auditLogPageSchema: z.ZodObject<{
|
|
|
165
165
|
}, z.core.$strip>;
|
|
166
166
|
export type AuditLogPage = z.infer<typeof auditLogPageSchema>;
|
|
167
167
|
export declare const agentPolicyDecisionSchema: z.ZodEnum<{
|
|
168
|
-
DENIED: "DENIED";
|
|
169
168
|
APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
|
|
169
|
+
DENIED: "DENIED";
|
|
170
170
|
ALLOW: "ALLOW";
|
|
171
171
|
}>;
|
|
172
172
|
export type AgentPolicyDecision = z.infer<typeof agentPolicyDecisionSchema>;
|
|
@@ -190,8 +190,8 @@ export type WritePreview = z.infer<typeof writePreviewSchema>;
|
|
|
190
190
|
export declare const writeDryRunResultSchema: z.ZodObject<{
|
|
191
191
|
dryRun: z.ZodLiteral<true>;
|
|
192
192
|
decision: z.ZodEnum<{
|
|
193
|
-
DENIED: "DENIED";
|
|
194
193
|
APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
|
|
194
|
+
DENIED: "DENIED";
|
|
195
195
|
ALLOW: "ALLOW";
|
|
196
196
|
}>;
|
|
197
197
|
reason: z.ZodNullable<z.ZodString>;
|
|
@@ -5515,9 +5515,9 @@ export type ProductPatchRequest = z.infer<typeof productPatchRequestSchema>;
|
|
|
5515
5515
|
export declare const productSortSchema: z.ZodEnum<{
|
|
5516
5516
|
"createdAt.desc": "createdAt.desc";
|
|
5517
5517
|
"createdAt.asc": "createdAt.asc";
|
|
5518
|
+
"updatedAt.desc": "updatedAt.desc";
|
|
5518
5519
|
"salePrice.asc": "salePrice.asc";
|
|
5519
5520
|
"salePrice.desc": "salePrice.desc";
|
|
5520
|
-
"updatedAt.desc": "updatedAt.desc";
|
|
5521
5521
|
}>;
|
|
5522
5522
|
export type ProductSort = z.infer<typeof productSortSchema>;
|
|
5523
5523
|
export interface ProductListParams extends PageParams {
|
|
@@ -5543,9 +5543,9 @@ export declare const productListQuerySchema: z.ZodObject<{
|
|
|
5543
5543
|
sort: z.ZodOptional<z.ZodEnum<{
|
|
5544
5544
|
"createdAt.desc": "createdAt.desc";
|
|
5545
5545
|
"createdAt.asc": "createdAt.asc";
|
|
5546
|
+
"updatedAt.desc": "updatedAt.desc";
|
|
5546
5547
|
"salePrice.asc": "salePrice.asc";
|
|
5547
5548
|
"salePrice.desc": "salePrice.desc";
|
|
5548
|
-
"updatedAt.desc": "updatedAt.desc";
|
|
5549
5549
|
}>>;
|
|
5550
5550
|
}, z.core.$strip>;
|
|
5551
5551
|
export declare const discountRequestSchema: z.ZodObject<{
|
|
@@ -6003,11 +6003,12 @@ export type SellerAddressRequest = z.infer<typeof sellerAddressRequestSchema>;
|
|
|
6003
6003
|
/**
|
|
6004
6004
|
* 스토어프론트 호스팅 (이슈 #53, M1: 템플릿 발행) — 관리 API `/v1/storefront/**`의 계약이다.
|
|
6005
6005
|
*
|
|
6006
|
-
* 셀러는 템플릿을 골라 사이트를 만들고 `{slug}.{호스팅 도메인}` 주소를 받는다.
|
|
6006
|
+
* 셀러는 템플릿을 골라 사이트를 만들고 `{slug}.{호스팅 도메인}` 주소를 받는다. 스토어를 만들어도 사이트는 생기지 않고
|
|
6007
|
+
* `POST /v1/storefront/site`가 유일한 생성 경로다. 템플릿은 만들 때만 고르고 바꾸지 않는다. 발행은 버전 단위이고,
|
|
6007
6008
|
* 되돌리기는 이전 버전을 다시 발행하는 것이다(재빌드 없음). 상태의 원천은 api DB이고 Cloudflare 쪽 반영
|
|
6008
6009
|
* (라우팅 표·사이트 Worker)은 커밋 뒤 비동기다 — 반영 상태는 `provisioning`으로 본다.
|
|
6009
6010
|
*
|
|
6010
|
-
* 스코프는 조회 `storefront:r`, 쓰기 `storefront:rw`(역할 OWNER·ADMIN)다. 에이전트(MCP)의
|
|
6011
|
+
* 스코프는 조회 `storefront:r`, 쓰기 `storefront:rw`(역할 OWNER·ADMIN)다. 에이전트(MCP)의 발행·되돌리기·
|
|
6011
6012
|
* 공개 전환·슬러그 변경·호스팅 끄기는 승인(`APPROVAL_REQUIRED`)이다 — 구매자가 보는 화면을 바꾸는 쓰기다.
|
|
6012
6013
|
*
|
|
6013
6014
|
* 오류 코드:
|
|
@@ -6022,6 +6023,7 @@ export type SellerAddressRequest = z.infer<typeof sellerAddressRequestSchema>;
|
|
|
6022
6023
|
* - 409 `STORE_SUSPENDED` — 정지된 스토어에는 사이트를 만들 수 없다
|
|
6023
6024
|
* - 409 `STOREFRONT_VERSION_NOT_READY` — 빌드가 끝나지 않았거나 실패한 버전은 발행할 수 없다
|
|
6024
6025
|
* - 409 `STOREFRONT_NO_ROLLBACK_TARGET` — 되돌릴 이전 발행 버전이 없다
|
|
6026
|
+
* - 409 `TEMPLATE_CHANGE_NOT_SUPPORTED` — 템플릿 변경(`POST /v1/storefront/site/template`, 폐기)은 항상 이 오류다
|
|
6025
6027
|
* - 400 `STOREFRONT_SLUG_CONFIRM_MISMATCH` — 호스팅 끄기 확인 입력이 현재 슬러그와 다르다
|
|
6026
6028
|
* - 503 `STOREFRONT_PREVIEW_NOT_CONFIGURED` — 미리보기 서명 키가 설정되지 않았다
|
|
6027
6029
|
*
|
|
@@ -6177,7 +6179,7 @@ export declare const storefrontEditPreviewSchema: z.ZodObject<{
|
|
|
6177
6179
|
}, z.core.$strip>;
|
|
6178
6180
|
export type StorefrontEditPreview = z.infer<typeof storefrontEditPreviewSchema>;
|
|
6179
6181
|
/**
|
|
6180
|
-
* 사이트 정지 — 운영 정책에 따라 플랫폼 운영자가 사이트를 정지한다. 정지 중에는 방문자에게 정지 안내가 보이고
|
|
6182
|
+
* 사이트 정지 — 운영 정책에 따라 플랫폼 운영자가 사이트를 정지한다. 정지 중에는 방문자에게 정지 안내가 보이고 발행·되돌리기·
|
|
6181
6183
|
* 공개 전환·슬러그 변경·끄기·편집이 409 `STOREFRONT_SITE_NOT_ACTIVE`다. 셀러가 풀 수 없다(고객센터로 문의한다).
|
|
6182
6184
|
*/
|
|
6183
6185
|
export declare const storefrontSuspensionSchema: z.ZodObject<{
|
|
@@ -6352,16 +6354,88 @@ export declare const storefrontSlugAvailabilitySchema: z.ZodObject<{
|
|
|
6352
6354
|
}>>;
|
|
6353
6355
|
}, z.core.$strip>;
|
|
6354
6356
|
export type StorefrontSlugAvailability = z.infer<typeof storefrontSlugAvailabilitySchema>;
|
|
6357
|
+
/**
|
|
6358
|
+
* 배포 진행 — 사이트의 지금 발행 상태가 공개 주소에 반영되기까지의 단계와 기록이다(콘솔의 스토어프론트 만들기 3단계가 폴링한다).
|
|
6359
|
+
* 만들기(`POST /v1/storefront/site`)는 곧바로 201로 답하고 반영은 그 뒤에 비동기로 하므로, 끝났는지는 이 조회로 본다.
|
|
6360
|
+
* 템플릿 사이트는 미리 빌드한 템플릿 산출물을 올리므로 빌드 단계가 없다. 기록은 사이트 상태에서 만든 요약이다.
|
|
6361
|
+
*/
|
|
6362
|
+
export declare const storefrontDeploymentStepSchema: z.ZodObject<{
|
|
6363
|
+
key: z.ZodEnum<{
|
|
6364
|
+
SITE: "SITE";
|
|
6365
|
+
UPLOAD: "UPLOAD";
|
|
6366
|
+
PUBLISH: "PUBLISH";
|
|
6367
|
+
}>;
|
|
6368
|
+
status: z.ZodEnum<{
|
|
6369
|
+
PENDING: "PENDING";
|
|
6370
|
+
FAILED: "FAILED";
|
|
6371
|
+
RUNNING: "RUNNING";
|
|
6372
|
+
DONE: "DONE";
|
|
6373
|
+
}>;
|
|
6374
|
+
finishedAt: z.ZodNullable<z.ZodString>;
|
|
6375
|
+
}, z.core.$strip>;
|
|
6376
|
+
export type StorefrontDeploymentStep = z.infer<typeof storefrontDeploymentStepSchema>;
|
|
6377
|
+
export declare const storefrontDeploymentLogSchema: z.ZodObject<{
|
|
6378
|
+
at: z.ZodNullable<z.ZodString>;
|
|
6379
|
+
level: z.ZodEnum<{
|
|
6380
|
+
INFO: "INFO";
|
|
6381
|
+
WARN: "WARN";
|
|
6382
|
+
ERROR: "ERROR";
|
|
6383
|
+
}>;
|
|
6384
|
+
code: z.ZodString;
|
|
6385
|
+
message: z.ZodString;
|
|
6386
|
+
}, z.core.$strip>;
|
|
6387
|
+
export type StorefrontDeploymentLog = z.infer<typeof storefrontDeploymentLogSchema>;
|
|
6388
|
+
export declare const storefrontDeploymentSchema: z.ZodObject<{
|
|
6389
|
+
siteId: z.ZodString;
|
|
6390
|
+
status: z.ZodEnum<{
|
|
6391
|
+
FAILED: "FAILED";
|
|
6392
|
+
SUCCEEDED: "SUCCEEDED";
|
|
6393
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
6394
|
+
}>;
|
|
6395
|
+
url: z.ZodString;
|
|
6396
|
+
startedAt: z.ZodString;
|
|
6397
|
+
finishedAt: z.ZodNullable<z.ZodString>;
|
|
6398
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
6399
|
+
key: z.ZodEnum<{
|
|
6400
|
+
SITE: "SITE";
|
|
6401
|
+
UPLOAD: "UPLOAD";
|
|
6402
|
+
PUBLISH: "PUBLISH";
|
|
6403
|
+
}>;
|
|
6404
|
+
status: z.ZodEnum<{
|
|
6405
|
+
PENDING: "PENDING";
|
|
6406
|
+
FAILED: "FAILED";
|
|
6407
|
+
RUNNING: "RUNNING";
|
|
6408
|
+
DONE: "DONE";
|
|
6409
|
+
}>;
|
|
6410
|
+
finishedAt: z.ZodNullable<z.ZodString>;
|
|
6411
|
+
}, z.core.$strip>>;
|
|
6412
|
+
log: z.ZodArray<z.ZodObject<{
|
|
6413
|
+
at: z.ZodNullable<z.ZodString>;
|
|
6414
|
+
level: z.ZodEnum<{
|
|
6415
|
+
INFO: "INFO";
|
|
6416
|
+
WARN: "WARN";
|
|
6417
|
+
ERROR: "ERROR";
|
|
6418
|
+
}>;
|
|
6419
|
+
code: z.ZodString;
|
|
6420
|
+
message: z.ZodString;
|
|
6421
|
+
}, z.core.$strip>>;
|
|
6422
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
6423
|
+
attempts: z.ZodNumber;
|
|
6424
|
+
nextAttemptAt: z.ZodNullable<z.ZodString>;
|
|
6425
|
+
}, z.core.$strip>;
|
|
6426
|
+
export type StorefrontDeployment = z.infer<typeof storefrontDeploymentSchema>;
|
|
6355
6427
|
export declare const createStorefrontSiteRequestSchema: z.ZodObject<{
|
|
6356
6428
|
templateId: z.ZodString;
|
|
6357
6429
|
slug: z.ZodOptional<z.ZodString>;
|
|
6358
6430
|
}, z.core.$strip>;
|
|
6359
6431
|
export type CreateStorefrontSiteRequest = z.infer<typeof createStorefrontSiteRequestSchema>;
|
|
6432
|
+
/** @deprecated 템플릿 변경은 지원하지 않는다(항상 409 `TEMPLATE_CHANGE_NOT_SUPPORTED`). 호환을 위해 스키마만 남겼다 */
|
|
6360
6433
|
export declare const changeStorefrontTemplateRequestSchema: z.ZodObject<{
|
|
6361
6434
|
templateId: z.ZodString;
|
|
6362
6435
|
publish: z.ZodOptional<z.ZodBoolean>;
|
|
6363
6436
|
message: z.ZodOptional<z.ZodString>;
|
|
6364
6437
|
}, z.core.$strip>;
|
|
6438
|
+
/** @deprecated 템플릿 변경은 지원하지 않는다 */
|
|
6365
6439
|
export type ChangeStorefrontTemplateRequest = z.infer<typeof changeStorefrontTemplateRequestSchema>;
|
|
6366
6440
|
/**
|
|
6367
6441
|
* 발행·되돌리기 — 발행은 사이트의 발행 포인터를 바꾸는 조건부 쓰기다. `expectedPublishedVersionId`를 주면
|
|
@@ -6596,16 +6670,16 @@ export declare const storefrontFileEncodingSchema: z.ZodEnum<{
|
|
|
6596
6670
|
* 90초). `RUNNING`이면 미리보기와 파일 쓰기가 바로 반영된다(HMR).
|
|
6597
6671
|
*/
|
|
6598
6672
|
export declare const storefrontEditSessionStatusSchema: z.ZodEnum<{
|
|
6599
|
-
STARTING: "STARTING";
|
|
6600
6673
|
RUNNING: "RUNNING";
|
|
6674
|
+
STARTING: "STARTING";
|
|
6601
6675
|
}>;
|
|
6602
6676
|
/** 편집 환경을 띄우는 단계 — 콘솔 진행 표시용이다. 값은 늘어날 수 있다 */
|
|
6603
6677
|
export declare const STOREFRONT_EDIT_START_STAGES: readonly ["CONTAINER", "RESTORE", "DEV_SERVER"];
|
|
6604
6678
|
export declare const storefrontEditSessionSchema: z.ZodObject<{
|
|
6605
6679
|
sessionId: z.ZodString;
|
|
6606
6680
|
status: z.ZodEnum<{
|
|
6607
|
-
STARTING: "STARTING";
|
|
6608
6681
|
RUNNING: "RUNNING";
|
|
6682
|
+
STARTING: "STARTING";
|
|
6609
6683
|
}>;
|
|
6610
6684
|
startStage: z.ZodNullable<z.ZodString>;
|
|
6611
6685
|
startedAt: z.ZodString;
|
|
@@ -6621,8 +6695,8 @@ export declare const storefrontEditingSchema: z.ZodObject<{
|
|
|
6621
6695
|
session: z.ZodNullable<z.ZodObject<{
|
|
6622
6696
|
sessionId: z.ZodString;
|
|
6623
6697
|
status: z.ZodEnum<{
|
|
6624
|
-
STARTING: "STARTING";
|
|
6625
6698
|
RUNNING: "RUNNING";
|
|
6699
|
+
STARTING: "STARTING";
|
|
6626
6700
|
}>;
|
|
6627
6701
|
startStage: z.ZodNullable<z.ZodString>;
|
|
6628
6702
|
startedAt: z.ZodString;
|
|
@@ -6826,7 +6900,7 @@ export declare const storefrontRuleResultSchema: z.ZodObject<{
|
|
|
6826
6900
|
}, z.core.$strip>;
|
|
6827
6901
|
export type StorefrontRuleResult = z.infer<typeof storefrontRuleResultSchema>;
|
|
6828
6902
|
/**
|
|
6829
|
-
* 규칙 검증 보고서 — `@sayren/mcp`의 `verify_storefront`와 같은 모양이다(원천 `
|
|
6903
|
+
* 규칙 검증 보고서 — `@sayren/mcp`의 `verify_storefront`와 같은 모양이다(원천 `packages/mcp/src/verify.ts`). 위반마다
|
|
6830
6904
|
* 고칠 자리(`file`·`line`)와 방법(`fix`·`example`)을 싣는다. `POST /v1/storefront/site/verify`(편집 환경이 잠들어 있어도
|
|
6831
6905
|
* 된다)와 빌드의 `verify`가 이 모양이다.
|
|
6832
6906
|
*/
|
|
@@ -6892,7 +6966,7 @@ export declare const STOREFRONT_BUILD_STAGES: readonly ["DEPENDENCIES", "VERIFY"
|
|
|
6892
6966
|
* 의존성 검사 결과 한 줄(#61) — 거절(`DEPENDENCY_REJECTED`의 `details.rejected`)·경고(빌드 `dependencies`, 소스 교체 `dependencyWarnings`)가
|
|
6893
6967
|
* 같은 모양이다. 대상 패키지와 사유. 셀러가 고칠 수 있게 버전·권고 id·거절 사유를 싣는다.
|
|
6894
6968
|
* `reason`: `DENYLISTED`(거절 목록) · `ADVISORY`(보안 권고) · `MALWARE`(악성 코드 권고, 패키지 전체) · `INSTALL_SCRIPT`(루트
|
|
6895
|
-
* package.json의 설치
|
|
6969
|
+
* package.json의 설치 훅·의존성의 설치 스크립트, 경고) · `INSTALL_CONFIG`(설치 방식 필드, 경고) · `UNSUPPORTED_SOURCE`(레지스트리 밖 설치 경로) · `BUNDLED_DEPENDENCIES`(묶여
|
|
6896
6970
|
* 오는 의존성, 경고) · `INVALID_MANIFEST`(package.json·잠금 파일 형식), 늘어날 수 있다.
|
|
6897
6971
|
*/
|
|
6898
6972
|
export declare const storefrontDependencyFindingSchema: z.ZodObject<{
|
|
@@ -7378,8 +7452,14 @@ interface StoreSession {
|
|
|
7378
7452
|
* 회전이 실패(만료·재사용 폐기)하면 세션을 clear하고 false. (401 경로는 onUnauthorized→clear가 별도 처리.)
|
|
7379
7453
|
*/
|
|
7380
7454
|
refresh(): Promise<boolean>;
|
|
7381
|
-
/** 세션/리프레시 키를 지우고 구독자에게 통지한다 */
|
|
7455
|
+
/** 세션/리프레시 키를 지우고 구독자에게 통지한다(서버의 토큰은 그대로다 — 로그아웃은 `logout()`) */
|
|
7382
7456
|
clear(): void;
|
|
7457
|
+
/**
|
|
7458
|
+
* 로그아웃 — 서버에서 **refresh 토큰(패밀리째)과 access 토큰을 폐기**(`POST /oauth2/revoke`, RFC 7009)한 뒤 세션을 지운다.
|
|
7459
|
+
* refresh를 폐기하지 않으면 쿠키만 지워도 서버의 refresh 패밀리가 절대 만료까지 살아 있어, 새어 나간 refresh 토큰으로
|
|
7460
|
+
* 계속 새 userToken을 받을 수 있다. 폐기 요청 실패(네트워크·이미 무효)는 무시하고 세션은 항상 지운다.
|
|
7461
|
+
*/
|
|
7462
|
+
logout(): Promise<void>;
|
|
7383
7463
|
/** 변경 구독(useSyncExternalStore 소비용) — getToken을 스냅샷으로 쓴다. 해지 함수 반환 */
|
|
7384
7464
|
subscribe(cb: () => void): () => void;
|
|
7385
7465
|
/** 현재 userToken (getToken()과 동일 — 게터 형태 소비용) */
|
|
@@ -11324,7 +11404,10 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
11324
11404
|
available: boolean;
|
|
11325
11405
|
reason: "RESERVED" | "INVALID" | "TAKEN" | "CURRENT" | null;
|
|
11326
11406
|
}>;
|
|
11327
|
-
/**
|
|
11407
|
+
/**
|
|
11408
|
+
* `POST /v1/storefront/site` (201) — 템플릿으로 사이트를 만들고 v1을 발행한다. 공개 상태는 오픈 준비 중이다.
|
|
11409
|
+
* 사이트를 만드는 유일한 경로다(스토어를 만들어도 사이트는 생기지 않는다). 템플릿은 여기서만 고른다
|
|
11410
|
+
*/
|
|
11328
11411
|
create: (body: CreateStorefrontSiteRequest) => Promise<{
|
|
11329
11412
|
siteId: string;
|
|
11330
11413
|
slug: string;
|
|
@@ -11372,7 +11455,55 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
11372
11455
|
suspendedAt: string | null;
|
|
11373
11456
|
} | null | undefined;
|
|
11374
11457
|
}>;
|
|
11375
|
-
/** `
|
|
11458
|
+
/** `GET /v1/storefront/site/deployment` — 배포 진행(단계·기록). 만든 뒤 반영이 끝날 때까지 폴링한다 */
|
|
11459
|
+
getDeployment: () => Promise<{
|
|
11460
|
+
siteId: string;
|
|
11461
|
+
status: "FAILED" | "SUCCEEDED" | "IN_PROGRESS";
|
|
11462
|
+
url: string;
|
|
11463
|
+
startedAt: string;
|
|
11464
|
+
finishedAt: string | null;
|
|
11465
|
+
steps: {
|
|
11466
|
+
key: "SITE" | "UPLOAD" | "PUBLISH";
|
|
11467
|
+
status: "PENDING" | "FAILED" | "RUNNING" | "DONE";
|
|
11468
|
+
finishedAt: string | null;
|
|
11469
|
+
}[];
|
|
11470
|
+
log: {
|
|
11471
|
+
at: string | null;
|
|
11472
|
+
level: "INFO" | "WARN" | "ERROR";
|
|
11473
|
+
code: string;
|
|
11474
|
+
message: string;
|
|
11475
|
+
}[];
|
|
11476
|
+
errorCode: string | null;
|
|
11477
|
+
attempts: number;
|
|
11478
|
+
nextAttemptAt: string | null;
|
|
11479
|
+
}>;
|
|
11480
|
+
/** `POST /v1/storefront/site/deployment/retry` (202) — 밀린 반영을 곧바로 다시 시도한다. 이미 반영됐으면 그대로다 */
|
|
11481
|
+
retryDeployment: () => Promise<{
|
|
11482
|
+
siteId: string;
|
|
11483
|
+
status: "FAILED" | "SUCCEEDED" | "IN_PROGRESS";
|
|
11484
|
+
url: string;
|
|
11485
|
+
startedAt: string;
|
|
11486
|
+
finishedAt: string | null;
|
|
11487
|
+
steps: {
|
|
11488
|
+
key: "SITE" | "UPLOAD" | "PUBLISH";
|
|
11489
|
+
status: "PENDING" | "FAILED" | "RUNNING" | "DONE";
|
|
11490
|
+
finishedAt: string | null;
|
|
11491
|
+
}[];
|
|
11492
|
+
log: {
|
|
11493
|
+
at: string | null;
|
|
11494
|
+
level: "INFO" | "WARN" | "ERROR";
|
|
11495
|
+
code: string;
|
|
11496
|
+
message: string;
|
|
11497
|
+
}[];
|
|
11498
|
+
errorCode: string | null;
|
|
11499
|
+
attempts: number;
|
|
11500
|
+
nextAttemptAt: string | null;
|
|
11501
|
+
}>;
|
|
11502
|
+
/**
|
|
11503
|
+
* `POST /v1/storefront/site/template`
|
|
11504
|
+
* @deprecated 템플릿 변경은 지원하지 않는다. 서버가 항상 409 `TEMPLATE_CHANGE_NOT_SUPPORTED`로 답한다 — 템플릿은
|
|
11505
|
+
* 사이트를 만들 때(`create`)만 고른다. 호환을 위해 메서드만 남겼다
|
|
11506
|
+
*/
|
|
11376
11507
|
changeTemplate: (body: ChangeStorefrontTemplateRequest) => Promise<{
|
|
11377
11508
|
siteId: string;
|
|
11378
11509
|
slug: string;
|
|
@@ -11784,7 +11915,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
11784
11915
|
enabled: boolean;
|
|
11785
11916
|
session: {
|
|
11786
11917
|
sessionId: string;
|
|
11787
|
-
status: "
|
|
11918
|
+
status: "RUNNING" | "STARTING";
|
|
11788
11919
|
startStage: string | null;
|
|
11789
11920
|
startedAt: string;
|
|
11790
11921
|
lastEditedAt: string | null;
|
|
@@ -11812,7 +11943,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
11812
11943
|
enabled: boolean;
|
|
11813
11944
|
session: {
|
|
11814
11945
|
sessionId: string;
|
|
11815
|
-
status: "
|
|
11946
|
+
status: "RUNNING" | "STARTING";
|
|
11816
11947
|
startStage: string | null;
|
|
11817
11948
|
startedAt: string;
|
|
11818
11949
|
lastEditedAt: string | null;
|
|
@@ -11837,7 +11968,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
11837
11968
|
enabled: boolean;
|
|
11838
11969
|
session: {
|
|
11839
11970
|
sessionId: string;
|
|
11840
|
-
status: "
|
|
11971
|
+
status: "RUNNING" | "STARTING";
|
|
11841
11972
|
startStage: string | null;
|
|
11842
11973
|
startedAt: string;
|
|
11843
11974
|
lastEditedAt: string | null;
|
package/dist/index.mjs
CHANGED
|
@@ -4413,11 +4413,12 @@ const sellerAddressRequestSchema = z.object({
|
|
|
4413
4413
|
/**
|
|
4414
4414
|
* 스토어프론트 호스팅 (이슈 #53, M1: 템플릿 발행) — 관리 API `/v1/storefront/**`의 계약이다.
|
|
4415
4415
|
*
|
|
4416
|
-
* 셀러는 템플릿을 골라 사이트를 만들고 `{slug}.{호스팅 도메인}` 주소를 받는다.
|
|
4416
|
+
* 셀러는 템플릿을 골라 사이트를 만들고 `{slug}.{호스팅 도메인}` 주소를 받는다. 스토어를 만들어도 사이트는 생기지 않고
|
|
4417
|
+
* `POST /v1/storefront/site`가 유일한 생성 경로다. 템플릿은 만들 때만 고르고 바꾸지 않는다. 발행은 버전 단위이고,
|
|
4417
4418
|
* 되돌리기는 이전 버전을 다시 발행하는 것이다(재빌드 없음). 상태의 원천은 api DB이고 Cloudflare 쪽 반영
|
|
4418
4419
|
* (라우팅 표·사이트 Worker)은 커밋 뒤 비동기다 — 반영 상태는 `provisioning`으로 본다.
|
|
4419
4420
|
*
|
|
4420
|
-
* 스코프는 조회 `storefront:r`, 쓰기 `storefront:rw`(역할 OWNER·ADMIN)다. 에이전트(MCP)의
|
|
4421
|
+
* 스코프는 조회 `storefront:r`, 쓰기 `storefront:rw`(역할 OWNER·ADMIN)다. 에이전트(MCP)의 발행·되돌리기·
|
|
4421
4422
|
* 공개 전환·슬러그 변경·호스팅 끄기는 승인(`APPROVAL_REQUIRED`)이다 — 구매자가 보는 화면을 바꾸는 쓰기다.
|
|
4422
4423
|
*
|
|
4423
4424
|
* 오류 코드:
|
|
@@ -4432,6 +4433,7 @@ const sellerAddressRequestSchema = z.object({
|
|
|
4432
4433
|
* - 409 `STORE_SUSPENDED` — 정지된 스토어에는 사이트를 만들 수 없다
|
|
4433
4434
|
* - 409 `STOREFRONT_VERSION_NOT_READY` — 빌드가 끝나지 않았거나 실패한 버전은 발행할 수 없다
|
|
4434
4435
|
* - 409 `STOREFRONT_NO_ROLLBACK_TARGET` — 되돌릴 이전 발행 버전이 없다
|
|
4436
|
+
* - 409 `TEMPLATE_CHANGE_NOT_SUPPORTED` — 템플릿 변경(`POST /v1/storefront/site/template`, 폐기)은 항상 이 오류다
|
|
4435
4437
|
* - 400 `STOREFRONT_SLUG_CONFIRM_MISMATCH` — 호스팅 끄기 확인 입력이 현재 슬러그와 다르다
|
|
4436
4438
|
* - 503 `STOREFRONT_PREVIEW_NOT_CONFIGURED` — 미리보기 서명 키가 설정되지 않았다
|
|
4437
4439
|
*
|
|
@@ -4518,7 +4520,7 @@ const storefrontTemplateSchema = z.object({
|
|
|
4518
4520
|
industry: z.string().describe("업종 (예: `general`·`fashion`·`food`). 목록 필터에 쓴다"),
|
|
4519
4521
|
description: z.string().describe("템플릿 설명"),
|
|
4520
4522
|
thumbnailUrl: z.string().nullable().describe("썸네일 이미지 주소. 없으면 null"),
|
|
4521
|
-
version: z.string().describe("현재 템플릿 버전. 새
|
|
4523
|
+
version: z.string().describe("현재 템플릿 버전. 새 사이트는 이 버전으로 만든다"),
|
|
4522
4524
|
isDefault: z.boolean().describe("기본 템플릿인가 (스토어 생성 시 자동 생성에 쓴다)")
|
|
4523
4525
|
});
|
|
4524
4526
|
/**
|
|
@@ -4580,7 +4582,7 @@ const storefrontProvisioningSchema = z.object({
|
|
|
4580
4582
|
*/
|
|
4581
4583
|
const storefrontEditPreviewSchema = z.object({ hostname: z.string().nullable().describe("편집 미리보기 호스트 (예: `sfs-ab12cd34-preview.sayren.co`). 편집을 쓸 수 없으면 null") });
|
|
4582
4584
|
/**
|
|
4583
|
-
* 사이트 정지 — 운영 정책에 따라 플랫폼 운영자가 사이트를 정지한다. 정지 중에는 방문자에게 정지 안내가 보이고
|
|
4585
|
+
* 사이트 정지 — 운영 정책에 따라 플랫폼 운영자가 사이트를 정지한다. 정지 중에는 방문자에게 정지 안내가 보이고 발행·되돌리기·
|
|
4584
4586
|
* 공개 전환·슬러그 변경·끄기·편집이 409 `STOREFRONT_SITE_NOT_ACTIVE`다. 셀러가 풀 수 없다(고객센터로 문의한다).
|
|
4585
4587
|
*/
|
|
4586
4588
|
const storefrontSuspensionSchema = z.object({
|
|
@@ -4622,10 +4624,56 @@ const storefrontSlugAvailabilitySchema = z.object({
|
|
|
4622
4624
|
"CURRENT"
|
|
4623
4625
|
]).nullable().describe("쓸 수 없는 이유. `INVALID` 형식 · `RESERVED` 예약어 · `TAKEN` 사용·보류 중 · `CURRENT` 지금 내 슬러그")
|
|
4624
4626
|
});
|
|
4627
|
+
/**
|
|
4628
|
+
* 배포 진행 — 사이트의 지금 발행 상태가 공개 주소에 반영되기까지의 단계와 기록이다(콘솔의 스토어프론트 만들기 3단계가 폴링한다).
|
|
4629
|
+
* 만들기(`POST /v1/storefront/site`)는 곧바로 201로 답하고 반영은 그 뒤에 비동기로 하므로, 끝났는지는 이 조회로 본다.
|
|
4630
|
+
* 템플릿 사이트는 미리 빌드한 템플릿 산출물을 올리므로 빌드 단계가 없다. 기록은 사이트 상태에서 만든 요약이다.
|
|
4631
|
+
*/
|
|
4632
|
+
const storefrontDeploymentStepSchema = z.object({
|
|
4633
|
+
key: z.enum([
|
|
4634
|
+
"SITE",
|
|
4635
|
+
"UPLOAD",
|
|
4636
|
+
"PUBLISH"
|
|
4637
|
+
]).describe("`SITE` 사이트·첫 버전 기록 · `UPLOAD` 버전 올리기 · `PUBLISH` 주소 연결·발행"),
|
|
4638
|
+
status: z.enum([
|
|
4639
|
+
"PENDING",
|
|
4640
|
+
"RUNNING",
|
|
4641
|
+
"DONE",
|
|
4642
|
+
"FAILED"
|
|
4643
|
+
]),
|
|
4644
|
+
finishedAt: z.string().nullable().describe("끝난 시각 (ISO 8601). 모르거나 끝나지 않았으면 null")
|
|
4645
|
+
});
|
|
4646
|
+
const storefrontDeploymentLogSchema = z.object({
|
|
4647
|
+
at: z.string().nullable().describe("기록 시각 (ISO 8601). 모르면 null"),
|
|
4648
|
+
level: z.enum([
|
|
4649
|
+
"INFO",
|
|
4650
|
+
"WARN",
|
|
4651
|
+
"ERROR"
|
|
4652
|
+
]),
|
|
4653
|
+
code: z.string().describe("기록 종류 (`SITE_CREATED`·`ADDRESS_RESERVED`·`WAITING`·`SYNCING`·`VERSION_UPLOADED`·`SYNC_FAILED`·`RETRY_SCHEDULED`·`PUBLISHED`)"),
|
|
4654
|
+
message: z.string().describe("사람이 읽는 문장")
|
|
4655
|
+
});
|
|
4656
|
+
const storefrontDeploymentSchema = z.object({
|
|
4657
|
+
siteId: z.string(),
|
|
4658
|
+
status: z.enum([
|
|
4659
|
+
"IN_PROGRESS",
|
|
4660
|
+
"SUCCEEDED",
|
|
4661
|
+
"FAILED"
|
|
4662
|
+
]).describe("`IN_PROGRESS` 반영 중 · `SUCCEEDED` 공개 주소에 반영됨 · `FAILED` 여러 번 실패했거나 다음 자동 시도가 멀다(`POST …/deployment/retry`로 곧바로 다시 시도한다)"),
|
|
4663
|
+
url: z.string().describe("사이트 기본 주소 (`https://{slug}.{호스팅 도메인}`)"),
|
|
4664
|
+
startedAt: z.string().describe("사이트를 만든 시각 (ISO 8601)"),
|
|
4665
|
+
finishedAt: z.string().nullable().describe("반영을 마친 시각 (ISO 8601)"),
|
|
4666
|
+
steps: z.array(storefrontDeploymentStepSchema),
|
|
4667
|
+
log: z.array(storefrontDeploymentLogSchema).describe("오래된 것부터"),
|
|
4668
|
+
errorCode: z.string().nullable().describe("마지막 반영 실패 코드"),
|
|
4669
|
+
attempts: z.number().int().describe("연속 실패 횟수"),
|
|
4670
|
+
nextAttemptAt: z.string().nullable().describe("다음 자동 시도 시각 (ISO 8601)")
|
|
4671
|
+
});
|
|
4625
4672
|
const createStorefrontSiteRequestSchema = z.object({
|
|
4626
4673
|
templateId: z.string().min(1).max(64).describe("템플릿 id"),
|
|
4627
4674
|
slug: storefrontSlugSchema.optional().describe("주소 슬러그. 생략하면 스토어 코드")
|
|
4628
4675
|
});
|
|
4676
|
+
/** @deprecated 템플릿 변경은 지원하지 않는다(항상 409 `TEMPLATE_CHANGE_NOT_SUPPORTED`). 호환을 위해 스키마만 남겼다 */
|
|
4629
4677
|
const changeStorefrontTemplateRequestSchema = z.object({
|
|
4630
4678
|
templateId: z.string().min(1).max(64).describe("바꿀 템플릿 id"),
|
|
4631
4679
|
publish: z.boolean().optional().describe("새 버전을 곧바로 발행하는가 (기본 true). false면 버전만 만든다"),
|
|
@@ -5069,7 +5117,7 @@ const storefrontRuleResultSchema = z.object({
|
|
|
5069
5117
|
severity: storefrontRuleSeveritySchema.optional()
|
|
5070
5118
|
});
|
|
5071
5119
|
/**
|
|
5072
|
-
* 규칙 검증 보고서 — `@sayren/mcp`의 `verify_storefront`와 같은 모양이다(원천 `
|
|
5120
|
+
* 규칙 검증 보고서 — `@sayren/mcp`의 `verify_storefront`와 같은 모양이다(원천 `packages/mcp/src/verify.ts`). 위반마다
|
|
5073
5121
|
* 고칠 자리(`file`·`line`)와 방법(`fix`·`example`)을 싣는다. `POST /v1/storefront/site/verify`(편집 환경이 잠들어 있어도
|
|
5074
5122
|
* 된다)와 빌드의 `verify`가 이 모양이다.
|
|
5075
5123
|
*/
|
|
@@ -5133,7 +5181,7 @@ const STOREFRONT_BUILD_STAGES = [
|
|
|
5133
5181
|
* 의존성 검사 결과 한 줄(#61) — 거절(`DEPENDENCY_REJECTED`의 `details.rejected`)·경고(빌드 `dependencies`, 소스 교체 `dependencyWarnings`)가
|
|
5134
5182
|
* 같은 모양이다. 대상 패키지와 사유. 셀러가 고칠 수 있게 버전·권고 id·거절 사유를 싣는다.
|
|
5135
5183
|
* `reason`: `DENYLISTED`(거절 목록) · `ADVISORY`(보안 권고) · `MALWARE`(악성 코드 권고, 패키지 전체) · `INSTALL_SCRIPT`(루트
|
|
5136
|
-
* package.json의 설치
|
|
5184
|
+
* package.json의 설치 훅·의존성의 설치 스크립트, 경고) · `INSTALL_CONFIG`(설치 방식 필드, 경고) · `UNSUPPORTED_SOURCE`(레지스트리 밖 설치 경로) · `BUNDLED_DEPENDENCIES`(묶여
|
|
5137
5185
|
* 오는 의존성, 경고) · `INVALID_MANIFEST`(package.json·잠금 파일 형식), 늘어날 수 있다.
|
|
5138
5186
|
*/
|
|
5139
5187
|
const storefrontDependencyFindingSchema = z.object({
|
|
@@ -5860,9 +5908,20 @@ list: (params) => storeHttp.request("GET", "/audit-logs", auditLogPageSchema, {
|
|
|
5860
5908
|
get: () => storeHttp.request("GET", "/storefront/site", storefrontHostingSchema),
|
|
5861
5909
|
/** `GET /v1/storefront/slug-availability?slug=` — 슬러그를 쓸 수 있는가 */
|
|
5862
5910
|
checkSlug: (slug) => storeHttp.request("GET", "/storefront/slug-availability", storefrontSlugAvailabilitySchema, { query: { slug } }),
|
|
5863
|
-
/**
|
|
5911
|
+
/**
|
|
5912
|
+
* `POST /v1/storefront/site` (201) — 템플릿으로 사이트를 만들고 v1을 발행한다. 공개 상태는 오픈 준비 중이다.
|
|
5913
|
+
* 사이트를 만드는 유일한 경로다(스토어를 만들어도 사이트는 생기지 않는다). 템플릿은 여기서만 고른다
|
|
5914
|
+
*/
|
|
5864
5915
|
create: (body) => storeHttp.request("POST", "/storefront/site", storefrontSiteSchema, { body: createStorefrontSiteRequestSchema.parse(body) }),
|
|
5865
|
-
/** `
|
|
5916
|
+
/** `GET /v1/storefront/site/deployment` — 배포 진행(단계·기록). 만든 뒤 반영이 끝날 때까지 폴링한다 */
|
|
5917
|
+
getDeployment: () => storeHttp.request("GET", "/storefront/site/deployment", storefrontDeploymentSchema),
|
|
5918
|
+
/** `POST /v1/storefront/site/deployment/retry` (202) — 밀린 반영을 곧바로 다시 시도한다. 이미 반영됐으면 그대로다 */
|
|
5919
|
+
retryDeployment: () => storeHttp.request("POST", "/storefront/site/deployment/retry", storefrontDeploymentSchema, { body: {} }),
|
|
5920
|
+
/**
|
|
5921
|
+
* `POST /v1/storefront/site/template`
|
|
5922
|
+
* @deprecated 템플릿 변경은 지원하지 않는다. 서버가 항상 409 `TEMPLATE_CHANGE_NOT_SUPPORTED`로 답한다 — 템플릿은
|
|
5923
|
+
* 사이트를 만들 때(`create`)만 고른다. 호환을 위해 메서드만 남겼다
|
|
5924
|
+
*/
|
|
5866
5925
|
changeTemplate: (body) => storeHttp.request("POST", "/storefront/site/template", storefrontSiteSchema, { body: changeStorefrontTemplateRequestSchema.parse(body) }),
|
|
5867
5926
|
/** `GET /v1/storefront/site/versions` — 버전 목록(최신 먼저) */
|
|
5868
5927
|
listVersions: () => storeHttp.request("GET", "/storefront/site/versions", z.array(storefrontVersionSchema)),
|
|
@@ -6330,6 +6389,8 @@ const STORE_SESSION_KEYS = {
|
|
|
6330
6389
|
/** authorize() → handleCallback() 간 1회용 PKCE 블롭({ verifier, state, redirectUri }) 저장 키 */
|
|
6331
6390
|
pkce: "sayren.store.pkce"
|
|
6332
6391
|
};
|
|
6392
|
+
/** 로그아웃 폐기 요청 제한 시간 */
|
|
6393
|
+
const REVOKE_TIMEOUT_MS = 5e3;
|
|
6333
6394
|
/** Web Locks 이름 — 탭 간 refresh 회전 직렬화용 */
|
|
6334
6395
|
const REFRESH_LOCK = STORE_SESSION_KEYS.refresh;
|
|
6335
6396
|
function createStoreSession(options) {
|
|
@@ -6352,6 +6413,30 @@ function createStoreSession(options) {
|
|
|
6352
6413
|
storage.remove(STORE_SESSION_KEYS.refresh);
|
|
6353
6414
|
notify();
|
|
6354
6415
|
}
|
|
6416
|
+
/** RFC 7009 — 무효 토큰이어도 200이다. 실패는 호출부가 무시한다. 응답이 늦어도 로그아웃이 멈추지 않게 5초로 끊는다 */
|
|
6417
|
+
async function revokeToken(token) {
|
|
6418
|
+
await fetchFn(`${baseUrl}/oauth2/revoke`, {
|
|
6419
|
+
method: "POST",
|
|
6420
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
6421
|
+
body: new URLSearchParams({
|
|
6422
|
+
token,
|
|
6423
|
+
client_id: clientId
|
|
6424
|
+
}).toString(),
|
|
6425
|
+
signal: typeof AbortSignal !== "undefined" && typeof AbortSignal.timeout === "function" ? AbortSignal.timeout(REVOKE_TIMEOUT_MS) : void 0
|
|
6426
|
+
});
|
|
6427
|
+
}
|
|
6428
|
+
async function logout() {
|
|
6429
|
+
if (refreshInFlight) await refreshInFlight.catch(() => false);
|
|
6430
|
+
const refreshToken = storage.get(STORE_SESSION_KEYS.refresh);
|
|
6431
|
+
const accessToken = getToken();
|
|
6432
|
+
for (const token of [refreshToken, accessToken]) {
|
|
6433
|
+
if (!token) continue;
|
|
6434
|
+
try {
|
|
6435
|
+
await revokeToken(token);
|
|
6436
|
+
} catch {}
|
|
6437
|
+
}
|
|
6438
|
+
clear();
|
|
6439
|
+
}
|
|
6355
6440
|
let refreshInFlight = null;
|
|
6356
6441
|
function refresh() {
|
|
6357
6442
|
if (!refreshInFlight) refreshInFlight = doRefresh().finally(() => {
|
|
@@ -6455,6 +6540,7 @@ function createStoreSession(options) {
|
|
|
6455
6540
|
setTokens,
|
|
6456
6541
|
refresh,
|
|
6457
6542
|
clear,
|
|
6543
|
+
logout,
|
|
6458
6544
|
subscribe,
|
|
6459
6545
|
authorize,
|
|
6460
6546
|
handleCallback,
|
|
@@ -6468,4 +6554,4 @@ function createStoreSession(options) {
|
|
|
6468
6554
|
};
|
|
6469
6555
|
}
|
|
6470
6556
|
//#endregion
|
|
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 };
|
|
6557
|
+
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, storefrontDeploymentLogSchema, storefrontDeploymentSchema, storefrontDeploymentStepSchema, 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
package/src/client.ts
CHANGED
|
@@ -264,6 +264,7 @@ import {
|
|
|
264
264
|
setStorefrontVisibilityRequestSchema,
|
|
265
265
|
storefrontBuildSchema,
|
|
266
266
|
storefrontCheckSchema,
|
|
267
|
+
storefrontDeploymentSchema,
|
|
267
268
|
storefrontEditingSchema,
|
|
268
269
|
storefrontFileContentSchema,
|
|
269
270
|
storefrontFileDeleteResultSchema,
|
|
@@ -1358,12 +1359,27 @@ export function createStoreClient(options: StoreClientOptions) {
|
|
|
1358
1359
|
query: { slug },
|
|
1359
1360
|
},
|
|
1360
1361
|
),
|
|
1361
|
-
/**
|
|
1362
|
+
/**
|
|
1363
|
+
* `POST /v1/storefront/site` (201) — 템플릿으로 사이트를 만들고 v1을 발행한다. 공개 상태는 오픈 준비 중이다.
|
|
1364
|
+
* 사이트를 만드는 유일한 경로다(스토어를 만들어도 사이트는 생기지 않는다). 템플릿은 여기서만 고른다
|
|
1365
|
+
*/
|
|
1362
1366
|
create: (body: CreateStorefrontSiteRequest) =>
|
|
1363
1367
|
storeHttp.request("POST", "/storefront/site", storefrontSiteSchema, {
|
|
1364
1368
|
body: createStorefrontSiteRequestSchema.parse(body),
|
|
1365
1369
|
}),
|
|
1366
|
-
/** `
|
|
1370
|
+
/** `GET /v1/storefront/site/deployment` — 배포 진행(단계·기록). 만든 뒤 반영이 끝날 때까지 폴링한다 */
|
|
1371
|
+
getDeployment: () =>
|
|
1372
|
+
storeHttp.request("GET", "/storefront/site/deployment", storefrontDeploymentSchema),
|
|
1373
|
+
/** `POST /v1/storefront/site/deployment/retry` (202) — 밀린 반영을 곧바로 다시 시도한다. 이미 반영됐으면 그대로다 */
|
|
1374
|
+
retryDeployment: () =>
|
|
1375
|
+
storeHttp.request("POST", "/storefront/site/deployment/retry", storefrontDeploymentSchema, {
|
|
1376
|
+
body: {},
|
|
1377
|
+
}),
|
|
1378
|
+
/**
|
|
1379
|
+
* `POST /v1/storefront/site/template`
|
|
1380
|
+
* @deprecated 템플릿 변경은 지원하지 않는다. 서버가 항상 409 `TEMPLATE_CHANGE_NOT_SUPPORTED`로 답한다 — 템플릿은
|
|
1381
|
+
* 사이트를 만들 때(`create`)만 고른다. 호환을 위해 메서드만 남겼다
|
|
1382
|
+
*/
|
|
1367
1383
|
changeTemplate: (body: ChangeStorefrontTemplateRequest) =>
|
|
1368
1384
|
storeHttp.request("POST", "/storefront/site/template", storefrontSiteSchema, {
|
|
1369
1385
|
body: changeStorefrontTemplateRequestSchema.parse(body),
|
|
@@ -4,11 +4,12 @@ import { RESERVED_STORE_CODES } from "./store";
|
|
|
4
4
|
/**
|
|
5
5
|
* 스토어프론트 호스팅 (이슈 #53, M1: 템플릿 발행) — 관리 API `/v1/storefront/**`의 계약이다.
|
|
6
6
|
*
|
|
7
|
-
* 셀러는 템플릿을 골라 사이트를 만들고 `{slug}.{호스팅 도메인}` 주소를 받는다.
|
|
7
|
+
* 셀러는 템플릿을 골라 사이트를 만들고 `{slug}.{호스팅 도메인}` 주소를 받는다. 스토어를 만들어도 사이트는 생기지 않고
|
|
8
|
+
* `POST /v1/storefront/site`가 유일한 생성 경로다. 템플릿은 만들 때만 고르고 바꾸지 않는다. 발행은 버전 단위이고,
|
|
8
9
|
* 되돌리기는 이전 버전을 다시 발행하는 것이다(재빌드 없음). 상태의 원천은 api DB이고 Cloudflare 쪽 반영
|
|
9
10
|
* (라우팅 표·사이트 Worker)은 커밋 뒤 비동기다 — 반영 상태는 `provisioning`으로 본다.
|
|
10
11
|
*
|
|
11
|
-
* 스코프는 조회 `storefront:r`, 쓰기 `storefront:rw`(역할 OWNER·ADMIN)다. 에이전트(MCP)의
|
|
12
|
+
* 스코프는 조회 `storefront:r`, 쓰기 `storefront:rw`(역할 OWNER·ADMIN)다. 에이전트(MCP)의 발행·되돌리기·
|
|
12
13
|
* 공개 전환·슬러그 변경·호스팅 끄기는 승인(`APPROVAL_REQUIRED`)이다 — 구매자가 보는 화면을 바꾸는 쓰기다.
|
|
13
14
|
*
|
|
14
15
|
* 오류 코드:
|
|
@@ -23,6 +24,7 @@ import { RESERVED_STORE_CODES } from "./store";
|
|
|
23
24
|
* - 409 `STORE_SUSPENDED` — 정지된 스토어에는 사이트를 만들 수 없다
|
|
24
25
|
* - 409 `STOREFRONT_VERSION_NOT_READY` — 빌드가 끝나지 않았거나 실패한 버전은 발행할 수 없다
|
|
25
26
|
* - 409 `STOREFRONT_NO_ROLLBACK_TARGET` — 되돌릴 이전 발행 버전이 없다
|
|
27
|
+
* - 409 `TEMPLATE_CHANGE_NOT_SUPPORTED` — 템플릿 변경(`POST /v1/storefront/site/template`, 폐기)은 항상 이 오류다
|
|
26
28
|
* - 400 `STOREFRONT_SLUG_CONFIRM_MISMATCH` — 호스팅 끄기 확인 입력이 현재 슬러그와 다르다
|
|
27
29
|
* - 503 `STOREFRONT_PREVIEW_NOT_CONFIGURED` — 미리보기 서명 키가 설정되지 않았다
|
|
28
30
|
*
|
|
@@ -132,7 +134,7 @@ export const storefrontTemplateSchema = z.object({
|
|
|
132
134
|
industry: z.string().describe("업종 (예: `general`·`fashion`·`food`). 목록 필터에 쓴다"),
|
|
133
135
|
description: z.string().describe("템플릿 설명"),
|
|
134
136
|
thumbnailUrl: z.string().nullable().describe("썸네일 이미지 주소. 없으면 null"),
|
|
135
|
-
version: z.string().describe("현재 템플릿 버전. 새
|
|
137
|
+
version: z.string().describe("현재 템플릿 버전. 새 사이트는 이 버전으로 만든다"),
|
|
136
138
|
isDefault: z.boolean().describe("기본 템플릿인가 (스토어 생성 시 자동 생성에 쓴다)"),
|
|
137
139
|
});
|
|
138
140
|
export type StorefrontTemplate = z.infer<typeof storefrontTemplateSchema>;
|
|
@@ -242,7 +244,7 @@ export const storefrontEditPreviewSchema = z.object({
|
|
|
242
244
|
export type StorefrontEditPreview = z.infer<typeof storefrontEditPreviewSchema>;
|
|
243
245
|
|
|
244
246
|
/**
|
|
245
|
-
* 사이트 정지 — 운영 정책에 따라 플랫폼 운영자가 사이트를 정지한다. 정지 중에는 방문자에게 정지 안내가 보이고
|
|
247
|
+
* 사이트 정지 — 운영 정책에 따라 플랫폼 운영자가 사이트를 정지한다. 정지 중에는 방문자에게 정지 안내가 보이고 발행·되돌리기·
|
|
246
248
|
* 공개 전환·슬러그 변경·끄기·편집이 409 `STOREFRONT_SITE_NOT_ACTIVE`다. 셀러가 풀 수 없다(고객센터로 문의한다).
|
|
247
249
|
*/
|
|
248
250
|
export const storefrontSuspensionSchema = z.object({
|
|
@@ -301,6 +303,50 @@ export const storefrontSlugAvailabilitySchema = z.object({
|
|
|
301
303
|
});
|
|
302
304
|
export type StorefrontSlugAvailability = z.infer<typeof storefrontSlugAvailabilitySchema>;
|
|
303
305
|
|
|
306
|
+
/**
|
|
307
|
+
* 배포 진행 — 사이트의 지금 발행 상태가 공개 주소에 반영되기까지의 단계와 기록이다(콘솔의 스토어프론트 만들기 3단계가 폴링한다).
|
|
308
|
+
* 만들기(`POST /v1/storefront/site`)는 곧바로 201로 답하고 반영은 그 뒤에 비동기로 하므로, 끝났는지는 이 조회로 본다.
|
|
309
|
+
* 템플릿 사이트는 미리 빌드한 템플릿 산출물을 올리므로 빌드 단계가 없다. 기록은 사이트 상태에서 만든 요약이다.
|
|
310
|
+
*/
|
|
311
|
+
export const storefrontDeploymentStepSchema = z.object({
|
|
312
|
+
key: z
|
|
313
|
+
.enum(["SITE", "UPLOAD", "PUBLISH"])
|
|
314
|
+
.describe("`SITE` 사이트·첫 버전 기록 · `UPLOAD` 버전 올리기 · `PUBLISH` 주소 연결·발행"),
|
|
315
|
+
status: z.enum(["PENDING", "RUNNING", "DONE", "FAILED"]),
|
|
316
|
+
finishedAt: z.string().nullable().describe("끝난 시각 (ISO 8601). 모르거나 끝나지 않았으면 null"),
|
|
317
|
+
});
|
|
318
|
+
export type StorefrontDeploymentStep = z.infer<typeof storefrontDeploymentStepSchema>;
|
|
319
|
+
|
|
320
|
+
export const storefrontDeploymentLogSchema = z.object({
|
|
321
|
+
at: z.string().nullable().describe("기록 시각 (ISO 8601). 모르면 null"),
|
|
322
|
+
level: z.enum(["INFO", "WARN", "ERROR"]),
|
|
323
|
+
code: z
|
|
324
|
+
.string()
|
|
325
|
+
.describe(
|
|
326
|
+
"기록 종류 (`SITE_CREATED`·`ADDRESS_RESERVED`·`WAITING`·`SYNCING`·`VERSION_UPLOADED`·`SYNC_FAILED`·`RETRY_SCHEDULED`·`PUBLISHED`)",
|
|
327
|
+
),
|
|
328
|
+
message: z.string().describe("사람이 읽는 문장"),
|
|
329
|
+
});
|
|
330
|
+
export type StorefrontDeploymentLog = z.infer<typeof storefrontDeploymentLogSchema>;
|
|
331
|
+
|
|
332
|
+
export const storefrontDeploymentSchema = z.object({
|
|
333
|
+
siteId: z.string(),
|
|
334
|
+
status: z
|
|
335
|
+
.enum(["IN_PROGRESS", "SUCCEEDED", "FAILED"])
|
|
336
|
+
.describe(
|
|
337
|
+
"`IN_PROGRESS` 반영 중 · `SUCCEEDED` 공개 주소에 반영됨 · `FAILED` 여러 번 실패했거나 다음 자동 시도가 멀다(`POST …/deployment/retry`로 곧바로 다시 시도한다)",
|
|
338
|
+
),
|
|
339
|
+
url: z.string().describe("사이트 기본 주소 (`https://{slug}.{호스팅 도메인}`)"),
|
|
340
|
+
startedAt: z.string().describe("사이트를 만든 시각 (ISO 8601)"),
|
|
341
|
+
finishedAt: z.string().nullable().describe("반영을 마친 시각 (ISO 8601)"),
|
|
342
|
+
steps: z.array(storefrontDeploymentStepSchema),
|
|
343
|
+
log: z.array(storefrontDeploymentLogSchema).describe("오래된 것부터"),
|
|
344
|
+
errorCode: z.string().nullable().describe("마지막 반영 실패 코드"),
|
|
345
|
+
attempts: z.number().int().describe("연속 실패 횟수"),
|
|
346
|
+
nextAttemptAt: z.string().nullable().describe("다음 자동 시도 시각 (ISO 8601)"),
|
|
347
|
+
});
|
|
348
|
+
export type StorefrontDeployment = z.infer<typeof storefrontDeploymentSchema>;
|
|
349
|
+
|
|
304
350
|
// ─── 요청 ─────────────────────────────────────────────────
|
|
305
351
|
|
|
306
352
|
export const createStorefrontSiteRequestSchema = z.object({
|
|
@@ -309,6 +355,7 @@ export const createStorefrontSiteRequestSchema = z.object({
|
|
|
309
355
|
});
|
|
310
356
|
export type CreateStorefrontSiteRequest = z.infer<typeof createStorefrontSiteRequestSchema>;
|
|
311
357
|
|
|
358
|
+
/** @deprecated 템플릿 변경은 지원하지 않는다(항상 409 `TEMPLATE_CHANGE_NOT_SUPPORTED`). 호환을 위해 스키마만 남겼다 */
|
|
312
359
|
export const changeStorefrontTemplateRequestSchema = z.object({
|
|
313
360
|
templateId: z.string().min(1).max(64).describe("바꿀 템플릿 id"),
|
|
314
361
|
publish: z
|
|
@@ -317,6 +364,7 @@ export const changeStorefrontTemplateRequestSchema = z.object({
|
|
|
317
364
|
.describe("새 버전을 곧바로 발행하는가 (기본 true). false면 버전만 만든다"),
|
|
318
365
|
message: z.string().max(200).optional().describe("버전 메모"),
|
|
319
366
|
});
|
|
367
|
+
/** @deprecated 템플릿 변경은 지원하지 않는다 */
|
|
320
368
|
export type ChangeStorefrontTemplateRequest = z.infer<typeof changeStorefrontTemplateRequestSchema>;
|
|
321
369
|
|
|
322
370
|
/**
|
|
@@ -1002,7 +1050,7 @@ export const storefrontRuleResultSchema = z.object({
|
|
|
1002
1050
|
export type StorefrontRuleResult = z.infer<typeof storefrontRuleResultSchema>;
|
|
1003
1051
|
|
|
1004
1052
|
/**
|
|
1005
|
-
* 규칙 검증 보고서 — `@sayren/mcp`의 `verify_storefront`와 같은 모양이다(원천 `
|
|
1053
|
+
* 규칙 검증 보고서 — `@sayren/mcp`의 `verify_storefront`와 같은 모양이다(원천 `packages/mcp/src/verify.ts`). 위반마다
|
|
1006
1054
|
* 고칠 자리(`file`·`line`)와 방법(`fix`·`example`)을 싣는다. `POST /v1/storefront/site/verify`(편집 환경이 잠들어 있어도
|
|
1007
1055
|
* 된다)와 빌드의 `verify`가 이 모양이다.
|
|
1008
1056
|
*/
|
|
@@ -1074,7 +1122,7 @@ export const STOREFRONT_BUILD_STAGES = [
|
|
|
1074
1122
|
* 의존성 검사 결과 한 줄(#61) — 거절(`DEPENDENCY_REJECTED`의 `details.rejected`)·경고(빌드 `dependencies`, 소스 교체 `dependencyWarnings`)가
|
|
1075
1123
|
* 같은 모양이다. 대상 패키지와 사유. 셀러가 고칠 수 있게 버전·권고 id·거절 사유를 싣는다.
|
|
1076
1124
|
* `reason`: `DENYLISTED`(거절 목록) · `ADVISORY`(보안 권고) · `MALWARE`(악성 코드 권고, 패키지 전체) · `INSTALL_SCRIPT`(루트
|
|
1077
|
-
* package.json의 설치
|
|
1125
|
+
* package.json의 설치 훅·의존성의 설치 스크립트, 경고) · `INSTALL_CONFIG`(설치 방식 필드, 경고) · `UNSUPPORTED_SOURCE`(레지스트리 밖 설치 경로) · `BUNDLED_DEPENDENCIES`(묶여
|
|
1078
1126
|
* 오는 의존성, 경고) · `INVALID_MANIFEST`(package.json·잠금 파일 형식), 늘어날 수 있다.
|
|
1079
1127
|
*/
|
|
1080
1128
|
export const storefrontDependencyFindingSchema = z.object({
|
package/src/session.ts
CHANGED
|
@@ -32,6 +32,9 @@ export const STORE_SESSION_KEYS = {
|
|
|
32
32
|
pkce: "sayren.store.pkce",
|
|
33
33
|
} as const;
|
|
34
34
|
|
|
35
|
+
/** 로그아웃 폐기 요청 제한 시간 */
|
|
36
|
+
const REVOKE_TIMEOUT_MS = 5_000;
|
|
37
|
+
|
|
35
38
|
/** Web Locks 이름 — 탭 간 refresh 회전 직렬화용 */
|
|
36
39
|
const REFRESH_LOCK = STORE_SESSION_KEYS.refresh;
|
|
37
40
|
|
|
@@ -68,8 +71,14 @@ export interface StoreSession {
|
|
|
68
71
|
* 회전이 실패(만료·재사용 폐기)하면 세션을 clear하고 false. (401 경로는 onUnauthorized→clear가 별도 처리.)
|
|
69
72
|
*/
|
|
70
73
|
refresh(): Promise<boolean>;
|
|
71
|
-
/** 세션/리프레시 키를 지우고 구독자에게 통지한다 */
|
|
74
|
+
/** 세션/리프레시 키를 지우고 구독자에게 통지한다(서버의 토큰은 그대로다 — 로그아웃은 `logout()`) */
|
|
72
75
|
clear(): void;
|
|
76
|
+
/**
|
|
77
|
+
* 로그아웃 — 서버에서 **refresh 토큰(패밀리째)과 access 토큰을 폐기**(`POST /oauth2/revoke`, RFC 7009)한 뒤 세션을 지운다.
|
|
78
|
+
* refresh를 폐기하지 않으면 쿠키만 지워도 서버의 refresh 패밀리가 절대 만료까지 살아 있어, 새어 나간 refresh 토큰으로
|
|
79
|
+
* 계속 새 userToken을 받을 수 있다. 폐기 요청 실패(네트워크·이미 무효)는 무시하고 세션은 항상 지운다.
|
|
80
|
+
*/
|
|
81
|
+
logout(): Promise<void>;
|
|
73
82
|
/** 변경 구독(useSyncExternalStore 소비용) — getToken을 스냅샷으로 쓴다. 해지 함수 반환 */
|
|
74
83
|
subscribe(cb: () => void): () => void;
|
|
75
84
|
/** 현재 userToken (getToken()과 동일 — 게터 형태 소비용) */
|
|
@@ -116,6 +125,37 @@ export function createStoreSession(options: StoreSessionOptions): StoreSession {
|
|
|
116
125
|
notify();
|
|
117
126
|
}
|
|
118
127
|
|
|
128
|
+
/** RFC 7009 — 무효 토큰이어도 200이다. 실패는 호출부가 무시한다. 응답이 늦어도 로그아웃이 멈추지 않게 5초로 끊는다 */
|
|
129
|
+
async function revokeToken(token: string): Promise<void> {
|
|
130
|
+
await fetchFn(`${baseUrl}/oauth2/revoke`, {
|
|
131
|
+
method: "POST",
|
|
132
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
133
|
+
body: new URLSearchParams({ token, client_id: clientId }).toString(),
|
|
134
|
+
// AbortSignal.timeout이 없는 브라우저는 제한 없이 보낸다(로그아웃은 그래도 진행된다)
|
|
135
|
+
signal:
|
|
136
|
+
typeof AbortSignal !== "undefined" && typeof AbortSignal.timeout === "function"
|
|
137
|
+
? AbortSignal.timeout(REVOKE_TIMEOUT_MS)
|
|
138
|
+
: undefined,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
async function logout(): Promise<void> {
|
|
143
|
+
// 진행 중인 갱신이 있으면 끝나기를 기다린다 — 그 사이 회전된 새 refresh 토큰을 폐기해야 한다(옛 토큰만 폐기하면 새 패밀리 토큰이 남는다)
|
|
144
|
+
if (refreshInFlight) await refreshInFlight.catch(() => false);
|
|
145
|
+
const refreshToken = storage.get(STORE_SESSION_KEYS.refresh);
|
|
146
|
+
const accessToken = getToken();
|
|
147
|
+
// refresh 먼저 — 패밀리를 폐기해야 새 userToken 발급이 끊긴다. access는 남은 수명 동안의 사용을 끊는다
|
|
148
|
+
for (const token of [refreshToken, accessToken]) {
|
|
149
|
+
if (!token) continue;
|
|
150
|
+
try {
|
|
151
|
+
await revokeToken(token);
|
|
152
|
+
} catch {
|
|
153
|
+
// 네트워크 실패여도 로그아웃은 진행한다
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
clear();
|
|
157
|
+
}
|
|
158
|
+
|
|
119
159
|
let refreshInFlight: Promise<boolean> | null = null;
|
|
120
160
|
|
|
121
161
|
function refresh(): Promise<boolean> {
|
|
@@ -235,6 +275,7 @@ export function createStoreSession(options: StoreSessionOptions): StoreSession {
|
|
|
235
275
|
setTokens,
|
|
236
276
|
refresh,
|
|
237
277
|
clear,
|
|
278
|
+
logout,
|
|
238
279
|
subscribe,
|
|
239
280
|
authorize,
|
|
240
281
|
handleCallback,
|