@sayren/store-sdk 0.7.0 → 0.9.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 +185 -42
- package/dist/index.mjs +412 -239
- package/package.json +1 -1
- package/src/client.ts +69 -2
- package/src/schemas/common.ts +3 -0
- package/src/schemas/order.ts +10 -0
- package/src/schemas/payment.ts +84 -32
- package/src/schemas/product.ts +63 -8
- package/src/schemas/store.ts +27 -0
- package/src/schemas/upload.ts +86 -0
package/dist/index.d.mts
CHANGED
|
@@ -1050,6 +1050,7 @@ export declare const changeTypeSchema: z.ZodEnum<{
|
|
|
1050
1050
|
"CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
|
|
1051
1051
|
"CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
|
|
1052
1052
|
"CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
|
|
1053
|
+
"CLAIM.COMPLETED": "CLAIM.COMPLETED";
|
|
1053
1054
|
}>;
|
|
1054
1055
|
export type ChangeType = z.infer<typeof changeTypeSchema>;
|
|
1055
1056
|
//#endregion
|
|
@@ -2011,6 +2012,7 @@ export declare const orderItemSchema: z.ZodObject<{
|
|
|
2011
2012
|
"CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
|
|
2012
2013
|
"CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
|
|
2013
2014
|
"CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
|
|
2015
|
+
"CLAIM.COMPLETED": "CLAIM.COMPLETED";
|
|
2014
2016
|
}>;
|
|
2015
2017
|
testPayment: z.ZodBoolean;
|
|
2016
2018
|
}, z.core.$strip>;
|
|
@@ -2042,6 +2044,7 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
2042
2044
|
MIXED: "MIXED";
|
|
2043
2045
|
}>;
|
|
2044
2046
|
approvedMethod: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2047
|
+
easyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2045
2048
|
productAmount: z.ZodNumber;
|
|
2046
2049
|
deliveryFee: z.ZodNumber;
|
|
2047
2050
|
discountAmount: z.ZodNumber;
|
|
@@ -2094,6 +2097,7 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
2094
2097
|
"CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
|
|
2095
2098
|
"CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
|
|
2096
2099
|
"CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
|
|
2100
|
+
"CLAIM.COMPLETED": "CLAIM.COMPLETED";
|
|
2097
2101
|
}>;
|
|
2098
2102
|
testPayment: z.ZodBoolean;
|
|
2099
2103
|
}, z.core.$strip>>;
|
|
@@ -2176,6 +2180,7 @@ export declare const orderItemPageSchema: z.ZodObject<{
|
|
|
2176
2180
|
"CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
|
|
2177
2181
|
"CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
|
|
2178
2182
|
"CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
|
|
2183
|
+
"CLAIM.COMPLETED": "CLAIM.COMPLETED";
|
|
2179
2184
|
}>;
|
|
2180
2185
|
testPayment: z.ZodBoolean;
|
|
2181
2186
|
}, z.core.$strip>>;
|
|
@@ -2226,6 +2231,7 @@ export declare const orderItemListQuerySchema: z.ZodObject<{
|
|
|
2226
2231
|
"CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
|
|
2227
2232
|
"CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
|
|
2228
2233
|
"CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
|
|
2234
|
+
"CLAIM.COMPLETED": "CLAIM.COMPLETED";
|
|
2229
2235
|
}>>;
|
|
2230
2236
|
testPayment: z.ZodOptional<z.ZodEnum<{
|
|
2231
2237
|
true: "true";
|
|
@@ -2401,18 +2407,23 @@ export declare const pgPaymentMethodSchema: z.ZodEnum<{
|
|
|
2401
2407
|
EASY_PAY: "EASY_PAY";
|
|
2402
2408
|
}>;
|
|
2403
2409
|
export type PgPaymentMethod = z.infer<typeof pgPaymentMethodSchema>;
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
export
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
SINGLE: "SINGLE";
|
|
2410
|
+
/**
|
|
2411
|
+
* 간편결제사 — 결제 옵션(스토어프론트 `paymentOptions`)과 PG 설정의 `easyPayProviders`에 쓴다.
|
|
2412
|
+
* `@sayren/storefront-sdk`의 `easyPayProviderSchema`와 같은 값이다(api 계약 테스트가 고정한다)
|
|
2413
|
+
*/
|
|
2414
|
+
export declare const easyPayProviderSchema: z.ZodEnum<{
|
|
2415
|
+
NAVERPAY: "NAVERPAY";
|
|
2416
|
+
KAKAOPAY: "KAKAOPAY";
|
|
2417
|
+
TOSSPAY: "TOSSPAY";
|
|
2418
|
+
PAYCO: "PAYCO";
|
|
2414
2419
|
}>;
|
|
2415
|
-
export type
|
|
2420
|
+
export type EasyPayProvider = z.infer<typeof easyPayProviderSchema>;
|
|
2421
|
+
/**
|
|
2422
|
+
* 응답에 실리는 간편결제사 — 서버가 간편결제사를 추가해도 파싱이 깨지지 않게 문자열로 받는다
|
|
2423
|
+
* (`pgProvider`·결제수단과 같은 방식). 요청(`easyPayProviders`)은 값을 골라 보내는 자리라 enum 그대로다.
|
|
2424
|
+
* 현재 값은 `NAVERPAY`·`KAKAOPAY`·`TOSSPAY`·`PAYCO`이고 화면은 모르는 값을 원문 그대로 보여 준다.
|
|
2425
|
+
*/
|
|
2426
|
+
export declare const easyPayProviderResponseSchema: z.ZodString;
|
|
2416
2427
|
export declare const pgEnvironmentSchema: z.ZodEnum<{
|
|
2417
2428
|
TEST: "TEST";
|
|
2418
2429
|
LIVE: "LIVE";
|
|
@@ -2512,6 +2523,12 @@ export type UpsertPortOneProviderRequest = z.infer<typeof upsertPortOneProviderR
|
|
|
2512
2523
|
export declare const updatePaymentProviderRequestSchema: z.ZodObject<{
|
|
2513
2524
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2514
2525
|
sandboxMode: z.ZodOptional<z.ZodBoolean>;
|
|
2526
|
+
easyPayProviders: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
2527
|
+
NAVERPAY: "NAVERPAY";
|
|
2528
|
+
KAKAOPAY: "KAKAOPAY";
|
|
2529
|
+
TOSSPAY: "TOSSPAY";
|
|
2530
|
+
PAYCO: "PAYCO";
|
|
2531
|
+
}>>>;
|
|
2515
2532
|
}, z.core.$strip>;
|
|
2516
2533
|
export type UpdatePaymentProviderRequest = z.infer<typeof updatePaymentProviderRequestSchema>;
|
|
2517
2534
|
export declare const verifyPaymentProviderRequestSchema: z.ZodObject<{
|
|
@@ -2522,14 +2539,11 @@ export declare const verifyPaymentProviderRequestSchema: z.ZodObject<{
|
|
|
2522
2539
|
}, z.core.$strip>;
|
|
2523
2540
|
export type VerifyPaymentProviderRequest = z.infer<typeof verifyPaymentProviderRequestSchema>;
|
|
2524
2541
|
export declare const updatePaymentSettingsRequestSchema: z.ZodObject<{
|
|
2525
|
-
|
|
2526
|
-
PRIORITY_DISPLAY: "PRIORITY_DISPLAY";
|
|
2527
|
-
AUTO_FAILOVER: "AUTO_FAILOVER";
|
|
2528
|
-
}>;
|
|
2529
|
-
priority: z.ZodArray<z.ZodEnum<{
|
|
2542
|
+
priority: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
2530
2543
|
tosspayments: "tosspayments";
|
|
2531
2544
|
portone: "portone";
|
|
2532
|
-
}
|
|
2545
|
+
}>>>;
|
|
2546
|
+
checkoutOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2533
2547
|
}, z.core.$strip>;
|
|
2534
2548
|
export type UpdatePaymentSettingsRequest = z.infer<typeof updatePaymentSettingsRequestSchema>;
|
|
2535
2549
|
export declare const maskedSecretSchema: z.ZodObject<{
|
|
@@ -2768,6 +2782,7 @@ export declare const paymentProviderSchema: z.ZodObject<{
|
|
|
2768
2782
|
}, z.core.$strip>>;
|
|
2769
2783
|
openedAt: z.ZodNullable<z.ZodString>;
|
|
2770
2784
|
}, z.core.$strip>;
|
|
2785
|
+
easyPayProviders: z.ZodArray<z.ZodString>;
|
|
2771
2786
|
retiredCredentialCount: z.ZodNumber;
|
|
2772
2787
|
routingExclusion: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2773
2788
|
}, z.core.$strip>;
|
|
@@ -2779,16 +2794,7 @@ export type PaymentProvider = z.infer<typeof paymentProviderSchema>;
|
|
|
2779
2794
|
export declare const PAYMENT_ROUTING_EXCLUSION_CODES: readonly ["NOT_CONNECTED", "DISABLED", "CREDENTIAL_MISSING", "SANDBOX_IN_LIVE_STORE", "PLATFORM_BLOCKED", "MODE_MISMATCH"];
|
|
2780
2795
|
export type KnownPaymentRoutingExclusion = (typeof PAYMENT_ROUTING_EXCLUSION_CODES)[number];
|
|
2781
2796
|
export declare const paymentSettingsSchema: z.ZodObject<{
|
|
2782
|
-
|
|
2783
|
-
PRIORITY_DISPLAY: "PRIORITY_DISPLAY";
|
|
2784
|
-
AUTO_FAILOVER: "AUTO_FAILOVER";
|
|
2785
|
-
}>;
|
|
2786
|
-
effectiveRoutingMode: z.ZodEnum<{
|
|
2787
|
-
PRIORITY_DISPLAY: "PRIORITY_DISPLAY";
|
|
2788
|
-
AUTO_FAILOVER: "AUTO_FAILOVER";
|
|
2789
|
-
NONE: "NONE";
|
|
2790
|
-
SINGLE: "SINGLE";
|
|
2791
|
-
}>;
|
|
2797
|
+
checkoutOrigins: z.ZodArray<z.ZodString>;
|
|
2792
2798
|
providers: z.ZodArray<z.ZodObject<{
|
|
2793
2799
|
provider: z.ZodEnum<{
|
|
2794
2800
|
tosspayments: "tosspayments";
|
|
@@ -2925,6 +2931,7 @@ export declare const paymentSettingsSchema: z.ZodObject<{
|
|
|
2925
2931
|
}, z.core.$strip>>;
|
|
2926
2932
|
openedAt: z.ZodNullable<z.ZodString>;
|
|
2927
2933
|
}, z.core.$strip>;
|
|
2934
|
+
easyPayProviders: z.ZodArray<z.ZodString>;
|
|
2928
2935
|
retiredCredentialCount: z.ZodNumber;
|
|
2929
2936
|
routingExclusion: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2930
2937
|
}, z.core.$strip>>;
|
|
@@ -3109,6 +3116,7 @@ export declare const paymentRecordSchema: z.ZodObject<{
|
|
|
3109
3116
|
MOBILE: "MOBILE";
|
|
3110
3117
|
EASY_PAY: "EASY_PAY";
|
|
3111
3118
|
}>>;
|
|
3119
|
+
easyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3112
3120
|
environment: z.ZodNullable<z.ZodEnum<{
|
|
3113
3121
|
TEST: "TEST";
|
|
3114
3122
|
LIVE: "LIVE";
|
|
@@ -3153,6 +3161,7 @@ export declare const paymentRecordPageSchema: z.ZodObject<{
|
|
|
3153
3161
|
MOBILE: "MOBILE";
|
|
3154
3162
|
EASY_PAY: "EASY_PAY";
|
|
3155
3163
|
}>>;
|
|
3164
|
+
easyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3156
3165
|
environment: z.ZodNullable<z.ZodEnum<{
|
|
3157
3166
|
TEST: "TEST";
|
|
3158
3167
|
LIVE: "LIVE";
|
|
@@ -3183,6 +3192,7 @@ export declare const paymentAttemptRecordSchema: z.ZodObject<{
|
|
|
3183
3192
|
MOBILE: "MOBILE";
|
|
3184
3193
|
EASY_PAY: "EASY_PAY";
|
|
3185
3194
|
}>;
|
|
3195
|
+
easyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3186
3196
|
approvedMethod: z.ZodNullable<z.ZodEnum<{
|
|
3187
3197
|
CARD: "CARD";
|
|
3188
3198
|
BANK_TRANSFER: "BANK_TRANSFER";
|
|
@@ -3190,6 +3200,7 @@ export declare const paymentAttemptRecordSchema: z.ZodObject<{
|
|
|
3190
3200
|
MOBILE: "MOBILE";
|
|
3191
3201
|
EASY_PAY: "EASY_PAY";
|
|
3192
3202
|
}>>;
|
|
3203
|
+
approvedEasyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3193
3204
|
amount: z.ZodNumber;
|
|
3194
3205
|
environment: z.ZodEnum<{
|
|
3195
3206
|
TEST: "TEST";
|
|
@@ -3238,6 +3249,7 @@ export declare const paymentRecordDetailSchema: z.ZodObject<{
|
|
|
3238
3249
|
MOBILE: "MOBILE";
|
|
3239
3250
|
EASY_PAY: "EASY_PAY";
|
|
3240
3251
|
}>>;
|
|
3252
|
+
easyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3241
3253
|
environment: z.ZodNullable<z.ZodEnum<{
|
|
3242
3254
|
TEST: "TEST";
|
|
3243
3255
|
LIVE: "LIVE";
|
|
@@ -3267,6 +3279,7 @@ export declare const paymentRecordDetailSchema: z.ZodObject<{
|
|
|
3267
3279
|
MOBILE: "MOBILE";
|
|
3268
3280
|
EASY_PAY: "EASY_PAY";
|
|
3269
3281
|
}>;
|
|
3282
|
+
easyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3270
3283
|
approvedMethod: z.ZodNullable<z.ZodEnum<{
|
|
3271
3284
|
CARD: "CARD";
|
|
3272
3285
|
BANK_TRANSFER: "BANK_TRANSFER";
|
|
@@ -3274,6 +3287,7 @@ export declare const paymentRecordDetailSchema: z.ZodObject<{
|
|
|
3274
3287
|
MOBILE: "MOBILE";
|
|
3275
3288
|
EASY_PAY: "EASY_PAY";
|
|
3276
3289
|
}>>;
|
|
3290
|
+
approvedEasyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3277
3291
|
amount: z.ZodNumber;
|
|
3278
3292
|
environment: z.ZodEnum<{
|
|
3279
3293
|
TEST: "TEST";
|
|
@@ -3449,6 +3463,33 @@ export declare const productSchema: z.ZodObject<{
|
|
|
3449
3463
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
3450
3464
|
}, z.core.$strip>;
|
|
3451
3465
|
export type Product = z.infer<typeof productSchema>;
|
|
3466
|
+
/** 상품 하나에 등록할 수 있는 이미지 최대 장수 — 첫 장이 대표(썸네일)다 */
|
|
3467
|
+
export declare const MAX_PRODUCT_IMAGES = 10;
|
|
3468
|
+
/**
|
|
3469
|
+
* 상품 이미지 주소의 와이어 형식 — URL이고 2048자 이하다.
|
|
3470
|
+
*
|
|
3471
|
+
* https·확장자 규칙은 여기서 강제하지 않고 `productImageRejection`이 판정한다. 서버가
|
|
3472
|
+
* **새로 추가된 주소에만** 그 규칙을 적용해야 하기 때문이다(규칙이 생기기 전에 저장된
|
|
3473
|
+
* 주소 하나로 상품 수정 전체가 막히면 셀러가 빠져나갈 길이 없다).
|
|
3474
|
+
*
|
|
3475
|
+
* 응답 스키마(`productSchema.images`)도 넓게 둔다. 과거에 저장된 주소를 파싱 오류로
|
|
3476
|
+
* 만들면 상품 조회 자체가 막힌다.
|
|
3477
|
+
*/
|
|
3478
|
+
export declare const productImageUrlSchema: z.ZodURL;
|
|
3479
|
+
export interface ProductImageRejection {
|
|
3480
|
+
code: "INVALID_IMAGE_URL" | "UNSUPPORTED_FILE_TYPE";
|
|
3481
|
+
message: string;
|
|
3482
|
+
}
|
|
3483
|
+
/**
|
|
3484
|
+
* 상품에 **새로 붙이는** 이미지 주소의 규칙. 통과하면 `null`.
|
|
3485
|
+
*
|
|
3486
|
+
* - https만 받는다. http는 https 스토어프론트에서 혼합 콘텐츠로 차단되고 `data:`·`javascript:`는
|
|
3487
|
+
* 상세 화면에 박히는 주입 경로가 된다.
|
|
3488
|
+
* - 호스트는 제한하지 않는다 — 셀러가 이미 쓰는 이미지 호스트를 그대로 붙일 수 있어야 한다.
|
|
3489
|
+
* - 경로에 확장자가 있으면 상품 이미지 형식이어야 한다(svg·동영상 거부). **확장자가 없으면 통과시킨다**
|
|
3490
|
+
* — 외부 이미지 CDN은 확장자 없는 키를 쓰는 경우가 흔하고, 주소만으로는 실제 형식을 알 수 없다.
|
|
3491
|
+
*/
|
|
3492
|
+
export declare function productImageRejection(url: string): ProductImageRejection | null;
|
|
3452
3493
|
/** 옵션 축(그룹) 최대 개수 — 스키마 상한의 단일 원천 */
|
|
3453
3494
|
export declare const MAX_OPTION_GROUPS = 3;
|
|
3454
3495
|
/** 축 하나가 가질 수 있는 값의 최대 개수 */
|
|
@@ -3646,15 +3687,6 @@ export declare const productListQuerySchema: z.ZodObject<{
|
|
|
3646
3687
|
"updatedAt.desc": "updatedAt.desc";
|
|
3647
3688
|
}>>;
|
|
3648
3689
|
}, z.core.$strip>;
|
|
3649
|
-
/** `POST /v1/product-images` 응답 — 업로드된 이미지의 CDN 주소 */
|
|
3650
|
-
export declare const productImageUploadResultSchema: z.ZodObject<{
|
|
3651
|
-
images: z.ZodArray<z.ZodObject<{
|
|
3652
|
-
url: z.ZodURL;
|
|
3653
|
-
width: z.ZodNumber;
|
|
3654
|
-
height: z.ZodNumber;
|
|
3655
|
-
}, z.core.$strip>>;
|
|
3656
|
-
}, z.core.$strip>;
|
|
3657
|
-
export type ProductImageUploadResult = z.infer<typeof productImageUploadResultSchema>;
|
|
3658
3690
|
export declare const discountSchema: z.ZodObject<{
|
|
3659
3691
|
productId: z.ZodString;
|
|
3660
3692
|
discountType: z.ZodEnum<{
|
|
@@ -3697,6 +3729,8 @@ export declare function isWebOrigin(value: string): boolean;
|
|
|
3697
3729
|
export declare const analyticsOriginSchema: z.ZodString;
|
|
3698
3730
|
/** 허용 오리진 상한 */
|
|
3699
3731
|
export declare const MAX_ANALYTICS_ALLOWED_ORIGINS = 20;
|
|
3732
|
+
/** 자동 배송완료·자동 구매확정 대기일 상한 */
|
|
3733
|
+
export declare const MAX_AUTO_TRANSITION_DAYS = 30;
|
|
3700
3734
|
/** `PATCH /v1/store` 본문 — 바꿀 필드만 보낸다 */
|
|
3701
3735
|
export declare const updateStoreRequestSchema: z.ZodObject<{
|
|
3702
3736
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -3706,6 +3740,8 @@ export declare const updateStoreRequestSchema: z.ZodObject<{
|
|
|
3706
3740
|
analyticsAllowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3707
3741
|
storefrontOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3708
3742
|
guestCheckoutEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
3743
|
+
autoDeliverDays: z.ZodOptional<z.ZodNumber>;
|
|
3744
|
+
autoConfirmDays: z.ZodOptional<z.ZodNumber>;
|
|
3709
3745
|
}, z.core.$strip>;
|
|
3710
3746
|
export type UpdateStoreRequest = z.infer<typeof updateStoreRequestSchema>;
|
|
3711
3747
|
export declare const storeSchema: z.ZodObject<{
|
|
@@ -3724,6 +3760,8 @@ export declare const storeSchema: z.ZodObject<{
|
|
|
3724
3760
|
analyticsAllowedOrigins: z.ZodArray<z.ZodString>;
|
|
3725
3761
|
storefrontOrigins: z.ZodArray<z.ZodString>;
|
|
3726
3762
|
guestCheckoutEnabled: z.ZodBoolean;
|
|
3763
|
+
autoDeliverDays: z.ZodNumber;
|
|
3764
|
+
autoConfirmDays: z.ZodNumber;
|
|
3727
3765
|
memberCount: z.ZodNumber;
|
|
3728
3766
|
createdAt: z.ZodString;
|
|
3729
3767
|
}, z.core.$strip>;
|
|
@@ -3820,6 +3858,42 @@ export declare const sellerAddressRequestSchema: z.ZodObject<{
|
|
|
3820
3858
|
export type SellerAddressRequest = z.infer<typeof sellerAddressRequestSchema>;
|
|
3821
3859
|
//#endregion
|
|
3822
3860
|
//#region src/schemas/upload.d.ts
|
|
3861
|
+
/**
|
|
3862
|
+
* 업로드 용도. 허용 확장자와 크기 상한이 용도별로 다르다.
|
|
3863
|
+
*
|
|
3864
|
+
* - `product-image`: 상품 목록·상세의 상품 이미지. 목록 썸네일로 쓰이므로 정지 이미지만 받는다.
|
|
3865
|
+
* - `description`: 상세설명 본문에 삽입하는 미디어. 동영상과 svg도 받는다.
|
|
3866
|
+
*/
|
|
3867
|
+
export declare const uploadPurposeSchema: z.ZodEnum<{
|
|
3868
|
+
"product-image": "product-image";
|
|
3869
|
+
description: "description";
|
|
3870
|
+
}>;
|
|
3871
|
+
export type UploadPurpose = z.infer<typeof uploadPurposeSchema>;
|
|
3872
|
+
export interface UploadPurposeLimit {
|
|
3873
|
+
/** 소문자 확장자 목록 */
|
|
3874
|
+
extensions: readonly string[];
|
|
3875
|
+
maxBytes: number;
|
|
3876
|
+
}
|
|
3877
|
+
/**
|
|
3878
|
+
* 용도별 업로드 제한 — 서버(`POST /v1/uploads`)와 클라이언트가 공유하는 단일 원천이다.
|
|
3879
|
+
*
|
|
3880
|
+
* 크기는 **요청이 스스로 신고한 값**으로만 검사한다. 바이트는 api를 거치지 않고 CDN으로
|
|
3881
|
+
* 직접 PUT되므로 이 검사는 셀러가 올리기 전에 알게 하는 장치이고, 실제 상한은 CDN이 강제한다.
|
|
3882
|
+
*/
|
|
3883
|
+
export declare const UPLOAD_PURPOSE_LIMITS: Record<UploadPurpose, UploadPurposeLimit>;
|
|
3884
|
+
/** 파일명의 소문자 확장자. 확장자가 없으면 `""` */
|
|
3885
|
+
export declare function uploadExtensionOf(filename: string): string;
|
|
3886
|
+
export interface UploadRejection {
|
|
3887
|
+
/** 400 형식 불일치 / 413 크기 초과 */
|
|
3888
|
+
status: 400 | 413;
|
|
3889
|
+
code: "UNSUPPORTED_FILE_TYPE" | "FILE_TOO_LARGE";
|
|
3890
|
+
message: string;
|
|
3891
|
+
}
|
|
3892
|
+
/**
|
|
3893
|
+
* 용도 제한 위반 여부. 통과하면 `null`.
|
|
3894
|
+
* 서버가 던지는 오류와 콘솔이 먼저 띄우는 안내가 갈리지 않도록 한 함수로 판정한다.
|
|
3895
|
+
*/
|
|
3896
|
+
export declare function uploadRejection(purpose: UploadPurpose, filename: string, size?: number): UploadRejection | null;
|
|
3823
3897
|
/**
|
|
3824
3898
|
* 미디어 업로드 자리 발급 — `POST /v1/uploads`.
|
|
3825
3899
|
*
|
|
@@ -3829,6 +3903,11 @@ export type SellerAddressRequest = z.infer<typeof sellerAddressRequestSchema>;
|
|
|
3829
3903
|
*/
|
|
3830
3904
|
export declare const uploadRequestSchema: z.ZodObject<{
|
|
3831
3905
|
filename: z.ZodString;
|
|
3906
|
+
purpose: z.ZodDefault<z.ZodEnum<{
|
|
3907
|
+
"product-image": "product-image";
|
|
3908
|
+
description: "description";
|
|
3909
|
+
}>>;
|
|
3910
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
3832
3911
|
}, z.core.$strip>;
|
|
3833
3912
|
export type UploadRequest = z.infer<typeof uploadRequestSchema>;
|
|
3834
3913
|
export declare const uploadTicketSchema: z.ZodObject<{
|
|
@@ -4114,6 +4193,16 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
4114
4193
|
url: string;
|
|
4115
4194
|
uploadUrl: string;
|
|
4116
4195
|
}>;
|
|
4196
|
+
/**
|
|
4197
|
+
* 자리 발급 + 바이트 PUT을 한 번에 — 끝나면 `url`이 공개 주소다.
|
|
4198
|
+
*
|
|
4199
|
+
* 용도 제한(확장자·크기)은 서버가 판정하지만, 같은 규칙으로 여기서 먼저 걸러
|
|
4200
|
+
* 큰 파일을 CDN까지 보내고 나서 거절되는 왕복을 없앤다.
|
|
4201
|
+
*/
|
|
4202
|
+
upload: (file: Blob, options?: {
|
|
4203
|
+
purpose?: UploadPurpose;
|
|
4204
|
+
filename?: string;
|
|
4205
|
+
}) => Promise<UploadTicket>;
|
|
4117
4206
|
};
|
|
4118
4207
|
products: {
|
|
4119
4208
|
list: (params?: ProductListParams) => Promise<{
|
|
@@ -4570,6 +4659,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
4570
4659
|
payment: {
|
|
4571
4660
|
method: "CARD" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE" | "POINT" | "MIXED";
|
|
4572
4661
|
approvedMethod: string | null;
|
|
4662
|
+
easyPayProvider: string | null;
|
|
4573
4663
|
productAmount: number;
|
|
4574
4664
|
deliveryFee: number;
|
|
4575
4665
|
discountAmount: number;
|
|
@@ -4599,7 +4689,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
4599
4689
|
sellerMemo: string | null;
|
|
4600
4690
|
orderedAt: string;
|
|
4601
4691
|
lastChangedAt: string;
|
|
4602
|
-
lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED";
|
|
4692
|
+
lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED" | "CLAIM.COMPLETED";
|
|
4603
4693
|
testPayment: boolean;
|
|
4604
4694
|
}[];
|
|
4605
4695
|
}>;
|
|
@@ -4633,7 +4723,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
4633
4723
|
sellerMemo: string | null;
|
|
4634
4724
|
orderedAt: string;
|
|
4635
4725
|
lastChangedAt: string;
|
|
4636
|
-
lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED";
|
|
4726
|
+
lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED" | "CLAIM.COMPLETED";
|
|
4637
4727
|
testPayment: boolean;
|
|
4638
4728
|
}[];
|
|
4639
4729
|
}>;
|
|
@@ -4686,6 +4776,46 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
4686
4776
|
}[];
|
|
4687
4777
|
}>;
|
|
4688
4778
|
updateTracking: (orderItemId: string, carrierCode: string, trackingNumber: string) => Promise<void>;
|
|
4779
|
+
/**
|
|
4780
|
+
* 배송완료 처리 — `DISPATCHED`·`DELIVERING`만 넘어간다. 응답의 `autoDecisionDate`가 자동 구매확정 예정일이다
|
|
4781
|
+
* (스토어 설정 `autoConfirmDays`가 0이면 null).
|
|
4782
|
+
*/
|
|
4783
|
+
markDelivered: (orderItemId: string, idempotencyKey?: string) => Promise<{
|
|
4784
|
+
orderItemId: string;
|
|
4785
|
+
orderId: string;
|
|
4786
|
+
status: "PAID" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
|
|
4787
|
+
claimStatus: "CANCEL_REQUESTED" | "RETURN_REQUESTED" | "EXCHANGE_REQUESTED" | null;
|
|
4788
|
+
productId: string;
|
|
4789
|
+
productName: string;
|
|
4790
|
+
optionId: string | null;
|
|
4791
|
+
optionName: string | null;
|
|
4792
|
+
sellerCode: string | null;
|
|
4793
|
+
quantity: number;
|
|
4794
|
+
unitPrice: number;
|
|
4795
|
+
discountAmount: number;
|
|
4796
|
+
totalPrice: number;
|
|
4797
|
+
hold: {
|
|
4798
|
+
reason: string;
|
|
4799
|
+
expectedDispatchDate: string;
|
|
4800
|
+
} | null;
|
|
4801
|
+
autoDecisionDate: string | null;
|
|
4802
|
+
sellerMemo: string | null;
|
|
4803
|
+
orderedAt: string;
|
|
4804
|
+
lastChangedAt: string;
|
|
4805
|
+
lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED" | "CLAIM.COMPLETED";
|
|
4806
|
+
testPayment: boolean;
|
|
4807
|
+
}>;
|
|
4808
|
+
/** 배송완료 일괄 처리 — 항목별 부분 성공이다 */
|
|
4809
|
+
markDeliveredBulk: (orderItemIds: string[], idempotencyKey?: string) => Promise<{
|
|
4810
|
+
succeeded: string[];
|
|
4811
|
+
failed: {
|
|
4812
|
+
code: string;
|
|
4813
|
+
message: string;
|
|
4814
|
+
id?: string | undefined;
|
|
4815
|
+
productId?: string | undefined;
|
|
4816
|
+
orderItemId?: string | undefined;
|
|
4817
|
+
}[];
|
|
4818
|
+
}>;
|
|
4689
4819
|
getDelivery: (orderItemId: string) => Promise<{
|
|
4690
4820
|
orderItemId: string;
|
|
4691
4821
|
deliveryMethod: "COURIER" | "DIRECT" | "QUICK" | "NOTHING";
|
|
@@ -5396,6 +5526,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5396
5526
|
refundedAmount: number;
|
|
5397
5527
|
provider: "tosspayments" | "portone" | null;
|
|
5398
5528
|
method: "CARD" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE" | "EASY_PAY" | null;
|
|
5529
|
+
easyPayProvider: string | null;
|
|
5399
5530
|
environment: "TEST" | "LIVE" | null;
|
|
5400
5531
|
testPayment: boolean;
|
|
5401
5532
|
pgTransactionId: string | null;
|
|
@@ -5418,6 +5549,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5418
5549
|
refundedAmount: number;
|
|
5419
5550
|
provider: "tosspayments" | "portone" | null;
|
|
5420
5551
|
method: "CARD" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE" | "EASY_PAY" | null;
|
|
5552
|
+
easyPayProvider: string | null;
|
|
5421
5553
|
environment: "TEST" | "LIVE" | null;
|
|
5422
5554
|
testPayment: boolean;
|
|
5423
5555
|
pgTransactionId: string | null;
|
|
@@ -5435,7 +5567,9 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5435
5567
|
provider: "tosspayments" | "portone";
|
|
5436
5568
|
status: string;
|
|
5437
5569
|
method: "CARD" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE" | "EASY_PAY";
|
|
5570
|
+
easyPayProvider: string | null;
|
|
5438
5571
|
approvedMethod: "CARD" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE" | "EASY_PAY" | null;
|
|
5572
|
+
approvedEasyPayProvider: string | null;
|
|
5439
5573
|
amount: number;
|
|
5440
5574
|
environment: "TEST" | "LIVE";
|
|
5441
5575
|
pgTransactionId: string | null;
|
|
@@ -5465,8 +5599,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5465
5599
|
paymentSettings: {
|
|
5466
5600
|
/** `GET /v1/store/payment-settings` — 라우팅 모드와 지원 PG 전부(연결된 것은 우선순위순) */
|
|
5467
5601
|
get: () => Promise<{
|
|
5468
|
-
|
|
5469
|
-
effectiveRoutingMode: "PRIORITY_DISPLAY" | "AUTO_FAILOVER" | "NONE" | "SINGLE";
|
|
5602
|
+
checkoutOrigins: string[];
|
|
5470
5603
|
providers: {
|
|
5471
5604
|
provider: "tosspayments" | "portone";
|
|
5472
5605
|
displayName: string;
|
|
@@ -5555,6 +5688,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5555
5688
|
}[];
|
|
5556
5689
|
openedAt: string | null;
|
|
5557
5690
|
};
|
|
5691
|
+
easyPayProviders: string[];
|
|
5558
5692
|
retiredCredentialCount: number;
|
|
5559
5693
|
routingExclusion: string | null;
|
|
5560
5694
|
}[];
|
|
@@ -5566,8 +5700,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5566
5700
|
* (빠지거나 중복되면 400 `INVALID_PRIORITY`). 진행 중인 결제에는 적용되지 않는다.
|
|
5567
5701
|
*/
|
|
5568
5702
|
update: (body: UpdatePaymentSettingsRequest) => Promise<{
|
|
5569
|
-
|
|
5570
|
-
effectiveRoutingMode: "PRIORITY_DISPLAY" | "AUTO_FAILOVER" | "NONE" | "SINGLE";
|
|
5703
|
+
checkoutOrigins: string[];
|
|
5571
5704
|
providers: {
|
|
5572
5705
|
provider: "tosspayments" | "portone";
|
|
5573
5706
|
displayName: string;
|
|
@@ -5656,6 +5789,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5656
5789
|
}[];
|
|
5657
5790
|
openedAt: string | null;
|
|
5658
5791
|
};
|
|
5792
|
+
easyPayProviders: string[];
|
|
5659
5793
|
retiredCredentialCount: number;
|
|
5660
5794
|
routingExclusion: string | null;
|
|
5661
5795
|
}[];
|
|
@@ -5761,6 +5895,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5761
5895
|
}[];
|
|
5762
5896
|
openedAt: string | null;
|
|
5763
5897
|
};
|
|
5898
|
+
easyPayProviders: string[];
|
|
5764
5899
|
retiredCredentialCount: number;
|
|
5765
5900
|
routingExclusion: string | null;
|
|
5766
5901
|
}>;
|
|
@@ -5856,6 +5991,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5856
5991
|
}[];
|
|
5857
5992
|
openedAt: string | null;
|
|
5858
5993
|
};
|
|
5994
|
+
easyPayProviders: string[];
|
|
5859
5995
|
retiredCredentialCount: number;
|
|
5860
5996
|
routingExclusion: string | null;
|
|
5861
5997
|
}>;
|
|
@@ -5961,6 +6097,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5961
6097
|
}[];
|
|
5962
6098
|
openedAt: string | null;
|
|
5963
6099
|
};
|
|
6100
|
+
easyPayProviders: string[];
|
|
5964
6101
|
retiredCredentialCount: number;
|
|
5965
6102
|
routingExclusion: string | null;
|
|
5966
6103
|
}>;
|
|
@@ -6056,6 +6193,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6056
6193
|
}[];
|
|
6057
6194
|
openedAt: string | null;
|
|
6058
6195
|
};
|
|
6196
|
+
easyPayProviders: string[];
|
|
6059
6197
|
retiredCredentialCount: number;
|
|
6060
6198
|
routingExclusion: string | null;
|
|
6061
6199
|
}>;
|
|
@@ -6160,6 +6298,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6160
6298
|
}[];
|
|
6161
6299
|
openedAt: string | null;
|
|
6162
6300
|
};
|
|
6301
|
+
easyPayProviders: string[];
|
|
6163
6302
|
retiredCredentialCount: number;
|
|
6164
6303
|
routingExclusion: string | null;
|
|
6165
6304
|
}>;
|
|
@@ -6399,6 +6538,8 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6399
6538
|
analyticsAllowedOrigins: string[];
|
|
6400
6539
|
storefrontOrigins: string[];
|
|
6401
6540
|
guestCheckoutEnabled: boolean;
|
|
6541
|
+
autoDeliverDays: number;
|
|
6542
|
+
autoConfirmDays: number;
|
|
6402
6543
|
memberCount: number;
|
|
6403
6544
|
createdAt: string;
|
|
6404
6545
|
}>;
|
|
@@ -6418,6 +6559,8 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6418
6559
|
analyticsAllowedOrigins: string[];
|
|
6419
6560
|
storefrontOrigins: string[];
|
|
6420
6561
|
guestCheckoutEnabled: boolean;
|
|
6562
|
+
autoDeliverDays: number;
|
|
6563
|
+
autoConfirmDays: number;
|
|
6421
6564
|
memberCount: number;
|
|
6422
6565
|
createdAt: string;
|
|
6423
6566
|
}>;
|