@sayren/store-sdk 0.14.0 → 0.15.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 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
- APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
169
168
  DENIED: "DENIED";
169
+ APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
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
- APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
194
193
  DENIED: "DENIED";
194
+ APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
195
195
  ALLOW: "ALLOW";
196
196
  }>;
197
197
  reason: z.ZodNullable<z.ZodString>;
@@ -1073,9 +1073,9 @@ export type ApiLogSummary = z.infer<typeof apiLogSummarySchema>;
1073
1073
  //#endregion
1074
1074
  //#region src/schemas/auth.d.ts
1075
1075
  export declare const storeRoleSchema: z.ZodEnum<{
1076
- OWNER: "OWNER";
1077
1076
  ADMIN: "ADMIN";
1078
1077
  STAFF: "STAFF";
1078
+ OWNER: "OWNER";
1079
1079
  }>;
1080
1080
  export type StoreRole = z.infer<typeof storeRoleSchema>;
1081
1081
  export declare const userTokenResponseSchema: z.ZodObject<{
@@ -1099,9 +1099,9 @@ export declare const storeTokenResponseSchema: z.ZodObject<{
1099
1099
  expires_in: z.ZodNumber;
1100
1100
  storeId: z.ZodString;
1101
1101
  role: z.ZodEnum<{
1102
- OWNER: "OWNER";
1103
1102
  ADMIN: "ADMIN";
1104
1103
  STAFF: "STAFF";
1104
+ OWNER: "OWNER";
1105
1105
  }>;
1106
1106
  scopes: z.ZodArray<z.ZodString>;
1107
1107
  }, z.core.$strip>;
@@ -1111,9 +1111,9 @@ export declare const myStoreSchema: z.ZodObject<{
1111
1111
  storeName: z.ZodString;
1112
1112
  storeCode: z.ZodString;
1113
1113
  role: z.ZodEnum<{
1114
- OWNER: "OWNER";
1115
1114
  ADMIN: "ADMIN";
1116
1115
  STAFF: "STAFF";
1116
+ OWNER: "OWNER";
1117
1117
  }>;
1118
1118
  status: z.ZodEnum<{
1119
1119
  ACTIVE: "ACTIVE";
@@ -1438,13 +1438,13 @@ export declare const bulkResultSchema: z.ZodObject<{
1438
1438
  export type BulkResult = z.infer<typeof bulkResultSchema>;
1439
1439
  export declare const orderItemStatusSchema: z.ZodEnum<{
1440
1440
  PAID: "PAID";
1441
+ CANCELED: "CANCELED";
1441
1442
  PAYMENT_WAITING: "PAYMENT_WAITING";
1442
1443
  CONFIRMED: "CONFIRMED";
1443
1444
  DISPATCHED: "DISPATCHED";
1444
1445
  DELIVERING: "DELIVERING";
1445
1446
  DELIVERED: "DELIVERED";
1446
1447
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
1447
- CANCELED: "CANCELED";
1448
1448
  }>;
1449
1449
  export type OrderItemStatus = z.infer<typeof orderItemStatusSchema>;
1450
1450
  export declare const changeTypeSchema: z.ZodEnum<{
@@ -1975,13 +1975,13 @@ export declare const customerOrderSchema: z.ZodObject<{
1975
1975
  quantity: z.ZodNumber;
1976
1976
  status: z.ZodEnum<{
1977
1977
  PAID: "PAID";
1978
+ CANCELED: "CANCELED";
1978
1979
  PAYMENT_WAITING: "PAYMENT_WAITING";
1979
1980
  CONFIRMED: "CONFIRMED";
1980
1981
  DISPATCHED: "DISPATCHED";
1981
1982
  DELIVERING: "DELIVERING";
1982
1983
  DELIVERED: "DELIVERED";
1983
1984
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
1984
- CANCELED: "CANCELED";
1985
1985
  }>;
1986
1986
  claimStatus: z.ZodNullable<z.ZodEnum<{
1987
1987
  CANCEL_REQUESTED: "CANCEL_REQUESTED";
@@ -2664,13 +2664,13 @@ export declare const orderSummarySchema: z.ZodObject<{
2664
2664
  totalAmount: z.ZodNumber;
2665
2665
  representativeStatus: z.ZodEnum<{
2666
2666
  PAID: "PAID";
2667
+ CANCELED: "CANCELED";
2667
2668
  PAYMENT_WAITING: "PAYMENT_WAITING";
2668
2669
  CONFIRMED: "CONFIRMED";
2669
2670
  DISPATCHED: "DISPATCHED";
2670
2671
  DELIVERING: "DELIVERING";
2671
2672
  DELIVERED: "DELIVERED";
2672
2673
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
2673
- CANCELED: "CANCELED";
2674
2674
  }>;
2675
2675
  orderedAt: z.ZodString;
2676
2676
  testPayment: z.ZodBoolean;
@@ -2691,13 +2691,13 @@ export declare const orderItemSchema: z.ZodObject<{
2691
2691
  orderId: z.ZodString;
2692
2692
  status: z.ZodEnum<{
2693
2693
  PAID: "PAID";
2694
+ CANCELED: "CANCELED";
2694
2695
  PAYMENT_WAITING: "PAYMENT_WAITING";
2695
2696
  CONFIRMED: "CONFIRMED";
2696
2697
  DISPATCHED: "DISPATCHED";
2697
2698
  DELIVERING: "DELIVERING";
2698
2699
  DELIVERED: "DELIVERED";
2699
2700
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
2700
- CANCELED: "CANCELED";
2701
2701
  }>;
2702
2702
  claimStatus: z.ZodNullable<z.ZodEnum<{
2703
2703
  CANCEL_REQUESTED: "CANCEL_REQUESTED";
@@ -2800,13 +2800,13 @@ export declare const orderSchema: z.ZodObject<{
2800
2800
  orderId: z.ZodString;
2801
2801
  status: z.ZodEnum<{
2802
2802
  PAID: "PAID";
2803
+ CANCELED: "CANCELED";
2803
2804
  PAYMENT_WAITING: "PAYMENT_WAITING";
2804
2805
  CONFIRMED: "CONFIRMED";
2805
2806
  DISPATCHED: "DISPATCHED";
2806
2807
  DELIVERING: "DELIVERING";
2807
2808
  DELIVERED: "DELIVERED";
2808
2809
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
2809
- CANCELED: "CANCELED";
2810
2810
  }>;
2811
2811
  claimStatus: z.ZodNullable<z.ZodEnum<{
2812
2812
  CANCEL_REQUESTED: "CANCEL_REQUESTED";
@@ -2861,13 +2861,13 @@ export declare const orderSummaryPageSchema: z.ZodObject<{
2861
2861
  totalAmount: z.ZodNumber;
2862
2862
  representativeStatus: z.ZodEnum<{
2863
2863
  PAID: "PAID";
2864
+ CANCELED: "CANCELED";
2864
2865
  PAYMENT_WAITING: "PAYMENT_WAITING";
2865
2866
  CONFIRMED: "CONFIRMED";
2866
2867
  DISPATCHED: "DISPATCHED";
2867
2868
  DELIVERING: "DELIVERING";
2868
2869
  DELIVERED: "DELIVERED";
2869
2870
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
2870
- CANCELED: "CANCELED";
2871
2871
  }>;
2872
2872
  orderedAt: z.ZodString;
2873
2873
  testPayment: z.ZodBoolean;
@@ -2885,13 +2885,13 @@ export declare const orderItemPageSchema: z.ZodObject<{
2885
2885
  orderId: z.ZodString;
2886
2886
  status: z.ZodEnum<{
2887
2887
  PAID: "PAID";
2888
+ CANCELED: "CANCELED";
2888
2889
  PAYMENT_WAITING: "PAYMENT_WAITING";
2889
2890
  CONFIRMED: "CONFIRMED";
2890
2891
  DISPATCHED: "DISPATCHED";
2891
2892
  DELIVERING: "DELIVERING";
2892
2893
  DELIVERED: "DELIVERED";
2893
2894
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
2894
- CANCELED: "CANCELED";
2895
2895
  }>;
2896
2896
  claimStatus: z.ZodNullable<z.ZodEnum<{
2897
2897
  CANCEL_REQUESTED: "CANCEL_REQUESTED";
@@ -2945,13 +2945,13 @@ export declare const orderListQuerySchema: z.ZodObject<{
2945
2945
  orderedTo: z.ZodOptional<z.ZodString>;
2946
2946
  status: z.ZodOptional<z.ZodEnum<{
2947
2947
  PAID: "PAID";
2948
+ CANCELED: "CANCELED";
2948
2949
  PAYMENT_WAITING: "PAYMENT_WAITING";
2949
2950
  CONFIRMED: "CONFIRMED";
2950
2951
  DISPATCHED: "DISPATCHED";
2951
2952
  DELIVERING: "DELIVERING";
2952
2953
  DELIVERED: "DELIVERED";
2953
2954
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
2954
- CANCELED: "CANCELED";
2955
2955
  }>>;
2956
2956
  keyword: z.ZodOptional<z.ZodString>;
2957
2957
  testPayment: z.ZodOptional<z.ZodEnum<{
@@ -3207,7 +3207,7 @@ export declare const TOSS_WIDGET_CLIENT_KEY_PATTERN: RegExp;
3207
3207
  /** 토스페이먼츠 결제위젯 시크릿 키 접두사. {@link TOSS_WIDGET_CLIENT_KEY_PATTERN} 참고 */
3208
3208
  export declare const TOSS_WIDGET_SECRET_KEY_PATTERN: RegExp;
3209
3209
  /** 결제위젯 키를 거부할 때의 필드 메시지 */
3210
- export declare const TOSS_WIDGET_KEY_MESSAGE = "결제위젯 키가 아니라 API 개별 연동 키를 입력해주세요";
3210
+ export declare const TOSS_WIDGET_KEY_MESSAGE = "결제위젯 키가 아니라 API 개별 연동 키를 입력해주십시오";
3211
3211
  export declare const tossPaymentsCredentialsInputSchema: z.ZodObject<{
3212
3212
  clientKey: z.ZodString;
3213
3213
  secretKey: z.ZodOptional<z.ZodString>;
@@ -4656,14 +4656,25 @@ export declare const storeMemberSchema: z.ZodObject<{
4656
4656
  name: z.ZodString;
4657
4657
  email: z.ZodEmail;
4658
4658
  role: z.ZodEnum<{
4659
- OWNER: "OWNER";
4660
4659
  ADMIN: "ADMIN";
4661
4660
  STAFF: "STAFF";
4661
+ OWNER: "OWNER";
4662
4662
  }>;
4663
4663
  joinedAt: z.ZodString;
4664
4664
  lastActiveAt: z.ZodNullable<z.ZodString>;
4665
4665
  }, z.core.$strip>;
4666
4666
  export type StoreMember = z.infer<typeof storeMemberSchema>;
4667
+ /**
4668
+ * 초대 메일 발송 결과 — `SENDING`은 발송 요청 중(결과를 아직 적지 못함), `NOT_CONFIGURED`는 메일 발송이 설정되지 않아
4669
+ * 보내지 않은 것이다. 발송 실패는 초대를 무효로 만들지 않는다 — 재발송으로 다시 보낸다
4670
+ */
4671
+ export declare const invitationDeliveryStatusSchema: z.ZodEnum<{
4672
+ FAILED: "FAILED";
4673
+ SENDING: "SENDING";
4674
+ SENT: "SENT";
4675
+ NOT_CONFIGURED: "NOT_CONFIGURED";
4676
+ }>;
4677
+ export type InvitationDeliveryStatus = z.infer<typeof invitationDeliveryStatusSchema>;
4667
4678
  export declare const invitationSchema: z.ZodObject<{
4668
4679
  invitationId: z.ZodString;
4669
4680
  email: z.ZodEmail;
@@ -4674,21 +4685,48 @@ export declare const invitationSchema: z.ZodObject<{
4674
4685
  status: z.ZodEnum<{
4675
4686
  PENDING: "PENDING";
4676
4687
  EXPIRED: "EXPIRED";
4677
- CANCELED: "CANCELED";
4678
4688
  ACCEPTED: "ACCEPTED";
4689
+ CANCELED: "CANCELED";
4679
4690
  }>;
4680
4691
  invitedBy: z.ZodString;
4681
4692
  expiresAt: z.ZodString;
4682
4693
  createdAt: z.ZodString;
4694
+ deliveryStatus: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
4695
+ FAILED: "FAILED";
4696
+ SENDING: "SENDING";
4697
+ SENT: "SENT";
4698
+ NOT_CONFIGURED: "NOT_CONFIGURED";
4699
+ }>>>;
4700
+ deliveryErrorCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4701
+ lastSentAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4702
+ sendCount: z.ZodDefault<z.ZodNumber>;
4703
+ acceptedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4683
4704
  }, z.core.$strip>;
4684
4705
  export type Invitation = z.infer<typeof invitationSchema>;
4706
+ /** `POST /v1/store/invitations` 요청 — ADMIN 초대는 OWNER만 할 수 있다 */
4707
+ export declare const inviteMemberRequestSchema: z.ZodObject<{
4708
+ email: z.ZodEmail;
4709
+ role: z.ZodEnum<{
4710
+ ADMIN: "ADMIN";
4711
+ STAFF: "STAFF";
4712
+ }>;
4713
+ }, z.core.$strip>;
4714
+ export type InviteMemberRequest = z.infer<typeof inviteMemberRequestSchema>;
4715
+ /** `PATCH /v1/store/members/{userId}` 요청 */
4716
+ export declare const updateMemberRoleRequestSchema: z.ZodObject<{
4717
+ role: z.ZodEnum<{
4718
+ ADMIN: "ADMIN";
4719
+ STAFF: "STAFF";
4720
+ }>;
4721
+ }, z.core.$strip>;
4722
+ export type UpdateMemberRoleRequest = z.infer<typeof updateMemberRoleRequestSchema>;
4685
4723
  /** `GET /v1/store/invitations` 쿼리 — OpenAPI 문서용 형태 */
4686
4724
  export declare const invitationListQuerySchema: z.ZodObject<{
4687
4725
  status: z.ZodOptional<z.ZodEnum<{
4688
4726
  PENDING: "PENDING";
4689
4727
  EXPIRED: "EXPIRED";
4690
- CANCELED: "CANCELED";
4691
4728
  ACCEPTED: "ACCEPTED";
4729
+ CANCELED: "CANCELED";
4692
4730
  }>>;
4693
4731
  }, z.core.$strip>;
4694
4732
  /** `PATCH /v1/store/members/{userId}` 응답 — 바뀐 역할 */
@@ -4942,7 +4980,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
4942
4980
  storeId: string;
4943
4981
  storeName: string;
4944
4982
  storeCode: string;
4945
- role: "OWNER" | "ADMIN" | "STAFF";
4983
+ role: "ADMIN" | "STAFF" | "OWNER";
4946
4984
  status: "ACTIVE" | "SUSPENDED" | "CLOSED";
4947
4985
  }[]>;
4948
4986
  /** RFC 7009 — token을 폐기한다 (public client는 client_id만 동반) */
@@ -5542,7 +5580,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
5542
5580
  ordererName: string;
5543
5581
  itemCount: number;
5544
5582
  totalAmount: number;
5545
- representativeStatus: "PAID" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
5583
+ representativeStatus: "PAID" | "CANCELED" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
5546
5584
  orderedAt: string;
5547
5585
  testPayment: boolean;
5548
5586
  }[];
@@ -5597,7 +5635,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
5597
5635
  items: {
5598
5636
  orderItemId: string;
5599
5637
  orderId: string;
5600
- status: "PAID" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
5638
+ status: "PAID" | "CANCELED" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
5601
5639
  claimStatus: "CANCEL_REQUESTED" | "RETURN_REQUESTED" | "EXCHANGE_REQUESTED" | null;
5602
5640
  productId: string;
5603
5641
  productName: string;
@@ -5656,7 +5694,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
5656
5694
  contents: {
5657
5695
  orderItemId: string;
5658
5696
  orderId: string;
5659
- status: "PAID" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
5697
+ status: "PAID" | "CANCELED" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
5660
5698
  claimStatus: "CANCEL_REQUESTED" | "RETURN_REQUESTED" | "EXCHANGE_REQUESTED" | null;
5661
5699
  productId: string;
5662
5700
  productName: string;
@@ -5741,7 +5779,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
5741
5779
  markDelivered: (orderItemId: string, idempotencyKey?: string) => Promise<{
5742
5780
  orderItemId: string;
5743
5781
  orderId: string;
5744
- status: "PAID" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
5782
+ status: "PAID" | "CANCELED" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
5745
5783
  claimStatus: "CANCEL_REQUESTED" | "RETURN_REQUESTED" | "EXCHANGE_REQUESTED" | null;
5746
5784
  productId: string;
5747
5785
  productName: string;
@@ -6191,7 +6229,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
6191
6229
  productName: string;
6192
6230
  optionName: string | null;
6193
6231
  quantity: number;
6194
- status: "PAID" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
6232
+ status: "PAID" | "CANCELED" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
6195
6233
  claimStatus: "CANCEL_REQUESTED" | "RETURN_REQUESTED" | "EXCHANGE_REQUESTED" | null;
6196
6234
  }[];
6197
6235
  }[];
@@ -7961,19 +7999,68 @@ export declare function createStoreClient(options: StoreClientOptions): {
7961
7999
  userId: string;
7962
8000
  name: string;
7963
8001
  email: string;
7964
- role: "OWNER" | "ADMIN" | "STAFF";
8002
+ role: "ADMIN" | "STAFF" | "OWNER";
7965
8003
  joinedAt: string;
7966
8004
  lastActiveAt: string | null;
7967
8005
  }[]>;
7968
- listInvitations: () => Promise<{
8006
+ /** `PATCH /v1/store/members/{userId}` — 스코프 `member:rw`. OWNER는 바꿀 수 없고 ADMIN 지정·ADMIN 변경은 OWNER만 한다 */
8007
+ updateMemberRole: (userId: string, body: UpdateMemberRoleRequest) => Promise<{
8008
+ userId: string;
8009
+ role: "ADMIN" | "STAFF";
8010
+ }>;
8011
+ /** `DELETE /v1/store/members/{userId}` (204) — OWNER는 내보낼 수 없고 ADMIN은 OWNER만 내보낸다 */
8012
+ removeMember: (userId: string) => Promise<void>;
8013
+ listInvitations: (params?: {
8014
+ status?: Invitation["status"];
8015
+ }) => Promise<{
7969
8016
  invitationId: string;
7970
8017
  email: string;
7971
8018
  role: "ADMIN" | "STAFF";
7972
- status: "PENDING" | "EXPIRED" | "CANCELED" | "ACCEPTED";
8019
+ status: "PENDING" | "EXPIRED" | "ACCEPTED" | "CANCELED";
7973
8020
  invitedBy: string;
7974
8021
  expiresAt: string;
7975
8022
  createdAt: string;
8023
+ deliveryStatus: "FAILED" | "SENDING" | "SENT" | "NOT_CONFIGURED" | null;
8024
+ deliveryErrorCode: string | null;
8025
+ lastSentAt: string | null;
8026
+ sendCount: number;
8027
+ acceptedAt: string | null;
7976
8028
  }[]>;
8029
+ /**
8030
+ * `POST /v1/store/invitations` (201) — 스코프 `member:rw`. 초대 메일을 보낸다. 발송 결과는 응답의
8031
+ * `deliveryStatus`다(발송이 실패해도 초대는 만들어진다). 스토어·초대한 사람·받는 주소별 발송 한도가 있다(429, `details.limit`).
8032
+ */
8033
+ invite: (body: InviteMemberRequest) => Promise<{
8034
+ invitationId: string;
8035
+ email: string;
8036
+ role: "ADMIN" | "STAFF";
8037
+ status: "PENDING" | "EXPIRED" | "ACCEPTED" | "CANCELED";
8038
+ invitedBy: string;
8039
+ expiresAt: string;
8040
+ createdAt: string;
8041
+ deliveryStatus: "FAILED" | "SENDING" | "SENT" | "NOT_CONFIGURED" | null;
8042
+ deliveryErrorCode: string | null;
8043
+ lastSentAt: string | null;
8044
+ sendCount: number;
8045
+ acceptedAt: string | null;
8046
+ }>;
8047
+ /** `POST /v1/store/invitations/{invitationId}/resend` — 새 수락 링크로 다시 보낸다. 이전 링크는 무효가 되고 만료가 다시 7일이 된다 */
8048
+ resendInvitation: (invitationId: string) => Promise<{
8049
+ invitationId: string;
8050
+ email: string;
8051
+ role: "ADMIN" | "STAFF";
8052
+ status: "PENDING" | "EXPIRED" | "ACCEPTED" | "CANCELED";
8053
+ invitedBy: string;
8054
+ expiresAt: string;
8055
+ createdAt: string;
8056
+ deliveryStatus: "FAILED" | "SENDING" | "SENT" | "NOT_CONFIGURED" | null;
8057
+ deliveryErrorCode: string | null;
8058
+ lastSentAt: string | null;
8059
+ sendCount: number;
8060
+ acceptedAt: string | null;
8061
+ }>;
8062
+ /** `DELETE /v1/store/invitations/{invitationId}` (204) — 대기 중 초대를 취소한다 */
8063
+ cancelInvitation: (invitationId: string) => Promise<void>;
7977
8064
  };
7978
8065
  };
7979
8066
  type StoreClient = ReturnType<typeof createStoreClient>;
@@ -8409,13 +8496,13 @@ export declare const orderWebhookEventDataSchema: z.ZodObject<{
8409
8496
  orderId: z.ZodString;
8410
8497
  status: z.ZodEnum<{
8411
8498
  PAID: "PAID";
8499
+ CANCELED: "CANCELED";
8412
8500
  PAYMENT_WAITING: "PAYMENT_WAITING";
8413
8501
  CONFIRMED: "CONFIRMED";
8414
8502
  DISPATCHED: "DISPATCHED";
8415
8503
  DELIVERING: "DELIVERING";
8416
8504
  DELIVERED: "DELIVERED";
8417
8505
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
8418
- CANCELED: "CANCELED";
8419
8506
  }>;
8420
8507
  testPayment: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
8421
8508
  }, z.core.$strip>;
@@ -8477,13 +8564,13 @@ export declare const orderWebhookEventSchema: z.ZodObject<{
8477
8564
  orderId: z.ZodString;
8478
8565
  status: z.ZodEnum<{
8479
8566
  PAID: "PAID";
8567
+ CANCELED: "CANCELED";
8480
8568
  PAYMENT_WAITING: "PAYMENT_WAITING";
8481
8569
  CONFIRMED: "CONFIRMED";
8482
8570
  DISPATCHED: "DISPATCHED";
8483
8571
  DELIVERING: "DELIVERING";
8484
8572
  DELIVERED: "DELIVERED";
8485
8573
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
8486
- CANCELED: "CANCELED";
8487
8574
  }>;
8488
8575
  testPayment: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
8489
8576
  }, z.core.$strip>;
@@ -8574,13 +8661,13 @@ export declare const webhookEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8574
8661
  orderId: z.ZodString;
8575
8662
  status: z.ZodEnum<{
8576
8663
  PAID: "PAID";
8664
+ CANCELED: "CANCELED";
8577
8665
  PAYMENT_WAITING: "PAYMENT_WAITING";
8578
8666
  CONFIRMED: "CONFIRMED";
8579
8667
  DISPATCHED: "DISPATCHED";
8580
8668
  DELIVERING: "DELIVERING";
8581
8669
  DELIVERED: "DELIVERED";
8582
8670
  PURCHASE_DECIDED: "PURCHASE_DECIDED";
8583
- CANCELED: "CANCELED";
8584
8671
  }>;
8585
8672
  testPayment: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
8586
8673
  }, z.core.$strip>;
package/dist/index.mjs CHANGED
@@ -1577,7 +1577,7 @@ const TOSS_WIDGET_CLIENT_KEY_PATTERN = /^(test|live)_gck_/;
1577
1577
  /** 토스페이먼츠 결제위젯 시크릿 키 접두사. {@link TOSS_WIDGET_CLIENT_KEY_PATTERN} 참고 */
1578
1578
  const TOSS_WIDGET_SECRET_KEY_PATTERN = /^(test|live)_gsk_/;
1579
1579
  /** 결제위젯 키를 거부할 때의 필드 메시지 */
1580
- const TOSS_WIDGET_KEY_MESSAGE = "결제위젯 키가 아니라 API 개별 연동 키를 입력해주세요";
1580
+ const TOSS_WIDGET_KEY_MESSAGE = "결제위젯 키가 아니라 API 개별 연동 키를 입력해주십시오";
1581
1581
  const tossPaymentsCredentialsInputSchema = z.object({
1582
1582
  clientKey: z.string().trim().min(8).max(200).describe("클라이언트 키 (`test_ck_…`/`live_ck_…`). 공개 값 — 결제창에서 쓰인다"),
1583
1583
  secretKey: secretInput().optional().describe("시크릿 키 (`test_sk_…`/`live_sk_…`). 비밀 값. 최초 연결 시 필수, 수정 시 생략하면 기존 값을 유지한다"),
@@ -1624,12 +1624,12 @@ const updatePaymentProviderRequestSchema = z.object({
1624
1624
  enabled: z.boolean().optional().describe("사용 여부. 켜려면 활성 환경(샌드박스면 TEST, 아니면 LIVE) 자격 증명이 모두 저장돼 있어야 한다(`PAYMENT_PROVIDER_INCOMPLETE`)"),
1625
1625
  sandboxMode: z.boolean().optional().describe("샌드박스 스위치. `true`면 새 결제에 TEST 세트를 쓴다(항상 허용). `false`(라이브 전환)는 라이브 개방 조건을 모두 충족해야 한다(`LIVE_GATE_NOT_MET`)"),
1626
1626
  easyPayProviders: z.array(easyPayProviderSchema).max(easyPayProviderSchema.options.length).optional().describe("이 PG로 받는 간편결제사 — 통째로 바꾼다. PG 계약(포트원은 채널)에 추가한 간편결제만 켠다. 켠 간편결제사마다 스토어프론트 결제 옵션이 하나씩 생긴다(포트원은 간편결제를 받는 채널이 있어야 한다)")
1627
- }).refine((body) => body.enabled !== void 0 || body.sandboxMode !== void 0 || body.easyPayProviders !== void 0, { message: "enabled·sandboxMode·easyPayProviders 중 하나는 보내야 해요" });
1627
+ }).refine((body) => body.enabled !== void 0 || body.sandboxMode !== void 0 || body.easyPayProviders !== void 0, { message: "enabled·sandboxMode·easyPayProviders 중 하나는 보내야 합니다" });
1628
1628
  const verifyPaymentProviderRequestSchema = z.object({ environment: pgEnvironmentSchema.optional().describe("연결 테스트할 자격 증명 세트. 생략하면 활성 환경(샌드박스면 TEST, 아니면 LIVE)") });
1629
1629
  const updatePaymentSettingsRequestSchema = z.object({
1630
1630
  priority: z.array(pgProviderSchema).min(1).max(50).optional().describe("PG 우선순위(앞이 1순위) — 스토어프론트 결제 옵션 목록의 PG 순서다. 연결된 PG 수만큼 **모두 한 번씩** 나열한다(길이 상한 50은 안전장치다). 빠지거나 중복되거나 연결되지 않은 PG가 있으면 `INVALID_PRIORITY`"),
1631
1631
  checkoutOrigins: z.array(z.string().max(200)).max(20).optional().describe("결제 도메인 — 통째로 바꾼다. 결제를 마친 구매자가 돌아올 스토어프론트 origin(`https://shop.example.com`, https·경로 없음). 결제 시작의 `returnUrl`은 이 목록 안이어야 한다. 비어 있으면 실결제를 시작할 수 없다(테스트 결제는 localhost 허용). 같은 도메인을 PG 가맹 정보에도 등록한다. 형식이 틀리면 `INVALID_CHECKOUT_ORIGIN`")
1632
- }).refine((body) => body.priority !== void 0 || body.checkoutOrigins !== void 0, { message: "priority 또는 checkoutOrigins 중 하나는 보내야 해요" });
1632
+ }).refine((body) => body.priority !== void 0 || body.checkoutOrigins !== void 0, { message: "priority 또는 checkoutOrigins 중 하나는 보내야 합니다" });
1633
1633
  const maskedSecretSchema = z.object({
1634
1634
  field: z.string().describe("비밀 필드 이름 (`secretKey`·`apiSecret`·`webhookSecret`)"),
1635
1635
  configured: z.boolean().describe("값이 저장돼 있는가"),
@@ -1888,7 +1888,7 @@ const orderSummarySchema = z.object({
1888
1888
  totalAmount: z.number().int(),
1889
1889
  representativeStatus: orderItemStatusSchema,
1890
1890
  orderedAt: z.string(),
1891
- testPayment: z.boolean().describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았어요. 상품을 발송하지 않도록 주의하세요")
1891
+ testPayment: z.boolean().describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았습니다. 상품을 발송하지 않도록 주의하십시오")
1892
1892
  });
1893
1893
  const shippingAddressSchema = z.object({
1894
1894
  receiverName: z.string(),
@@ -1928,7 +1928,7 @@ const orderItemSchema = z.object({
1928
1928
  orderedAt: z.string(),
1929
1929
  lastChangedAt: z.string(),
1930
1930
  lastChangedType: changeTypeSchema,
1931
- testPayment: z.boolean().describe("소속 주문이 테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았어요")
1931
+ testPayment: z.boolean().describe("소속 주문이 테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았습니다")
1932
1932
  });
1933
1933
  const orderSchema = z.object({
1934
1934
  orderId: z.string(),
@@ -1957,14 +1957,14 @@ const orderSchema = z.object({
1957
1957
  paidAt: z.string().nullable(),
1958
1958
  cashReceipt: cashReceiptSchema.nullable().optional().default(null).describe("현금영수증. 구매자가 계좌이체·가상계좌 결제에서 신청했을 때만 있고 그 밖에는 null. 서버는 항상 싣는다")
1959
1959
  }),
1960
- testPayment: z.boolean().describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았어요. 상품을 발송하지 않도록 주의하세요"),
1960
+ testPayment: z.boolean().describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았습니다. 상품을 발송하지 않도록 주의하십시오"),
1961
1961
  items: z.array(orderItemSchema)
1962
1962
  });
1963
1963
  /** 주문 목록 응답 — `GET /v1/orders` */
1964
1964
  const orderSummaryPageSchema = pageSchema(orderSummarySchema);
1965
1965
  /** 주문상품 변경 목록 응답 — `GET /v1/order-items` */
1966
1966
  const orderItemPageSchema = pageSchema(orderItemSchema);
1967
- const testPaymentQuery = z.enum(["true", "false"]).optional().describe("테스트 결제(샌드박스 결제) 필터. `true`면 테스트 결제만, `false`면 실결제만, 생략하면 전부예요");
1967
+ const testPaymentQuery = z.enum(["true", "false"]).optional().describe("테스트 결제(샌드박스 결제) 필터. `true`면 테스트 결제만, `false`면 실결제만, 생략하면 전부입니다");
1968
1968
  const pageQuery = { page: z.string().optional().describe("페이지 번호 (1부터, 기본 1)") };
1969
1969
  /**
1970
1970
  * `GET /v1/orders` 쿼리 — OpenAPI 문서용 형태(값은 쿼리 문자열). 검증 규칙은 서버가 적용한다:
@@ -2524,7 +2524,7 @@ const ADDRESS_DESCRIPTIONS = {
2524
2524
  };
2525
2525
  const productCreateRequestSchema = z.object({
2526
2526
  name: z.string().min(1).max(100),
2527
- categoryId: z.string().min(1, "카테고리를 선택해주세요"),
2527
+ categoryId: z.string().min(1, "카테고리를 선택해주십시오"),
2528
2528
  salePrice: z.number().int().min(10).multipleOf(10, "판매가는 10원 단위여야 합니다 (INVALID_PRICE_UNIT)").describe("판매가. 원(KRW) 단위 정수, 최소 10원, 10원 단위"),
2529
2529
  originalPrice: z.number().int().optional().describe("정가(할인 전 표시 가격). 원 단위"),
2530
2530
  description: z.string().optional(),
@@ -3080,7 +3080,7 @@ const RESERVED_STORE_CODES = [
3080
3080
  function isReservedStoreCode(code) {
3081
3081
  return RESERVED_STORE_CODES.includes(code.toLowerCase());
3082
3082
  }
3083
- const storeCodeSchema = z.string().regex(STORE_CODE_PATTERN, "소문자·숫자·하이픈 3~30자여야 하고 하이픈으로 시작하거나 끝날 수 없어요").refine((code) => !isReservedStoreCode(code), "플랫폼이 쓰는 이름이라 스토어 코드로 쓸 수 없어요");
3083
+ const storeCodeSchema = z.string().regex(STORE_CODE_PATTERN, "소문자·숫자·하이픈 3~30자여야 하고 하이픈으로 시작하거나 끝날 수 없습니다").refine((code) => !isReservedStoreCode(code), "플랫폼이 쓰는 이름이라 스토어 코드로 쓸 수 없습니다");
3084
3084
  /** `https://shop.example.com`처럼 경로·쿼리 없는 http(s) 오리진인가 */
3085
3085
  function isWebOrigin(value) {
3086
3086
  try {
@@ -3091,7 +3091,7 @@ function isWebOrigin(value) {
3091
3091
  }
3092
3092
  }
3093
3093
  /** 방문 분석을 보낼 수 있는 스토어프론트 오리진 — 스킴·호스트(·포트)만. 서버가 소문자·끝 슬래시 제거로 정규화한다 */
3094
- const analyticsOriginSchema = z.string().trim().max(255).refine(isWebOrigin, "https://shop.example.com 형식(경로 없이)으로 입력해 주세요").describe("스토어프론트 오리진. 예: `https://shop.example.com`");
3094
+ const analyticsOriginSchema = z.string().trim().max(255).refine(isWebOrigin, "https://shop.example.com 형식(경로 없이)으로 입력해 주십시오").describe("스토어프론트 오리진. 예: `https://shop.example.com`");
3095
3095
  /** 허용 오리진 상한 */
3096
3096
  const MAX_ANALYTICS_ALLOWED_ORIGINS = 20;
3097
3097
  /** 자동 배송완료·자동 구매확정 대기일 상한 */
@@ -3105,7 +3105,7 @@ const policyVersionSchema = z.string().trim().min(1).max(20).describe("약관
3105
3105
  * 약관 문서 주소 — 구매자에게 보여 주는 약관 본문의 주소다. 동의 시점 값이 이력 행에 복사되므로
3106
3106
  * 나중에 주소를 바꿔도 "무엇에 동의했는지"가 남는다. `null`로 지울 수 있다.
3107
3107
  */
3108
- const policyDocumentUrlSchema = z.url().max(500).refine((value) => value.startsWith("https://"), "https 주소만 쓸 수 있어요").nullable();
3108
+ const policyDocumentUrlSchema = z.url().max(500).refine((value) => value.startsWith("https://"), "https 주소만 쓸 수 있습니다").nullable();
3109
3109
  const autoDeliverDaysDescription = "발송 후 자동 배송완료까지의 일수(0~30, 기본 7). 발송(`DISPATCHED`)·배송중(`DELIVERING`) 주문상품을 이 기간이 지나면 배송완료(`DELIVERED`)로 바꾼다. `0`이면 자동 배송완료를 하지 않는다";
3110
3110
  const autoConfirmDaysDescription = "배송완료 후 자동 구매확정까지의 일수(0~30, 기본 7). 배송완료 시점에 구매확정 예정일(`autoDecisionDate`)을 이 값으로 잡고, 그 날짜가 지나면 구매확정(`PURCHASE_DECIDED`)으로 바꾼다. 진행 중인 클레임이 있으면 건너뛴다. `0`이면 자동 구매확정을 하지 않는다";
3111
3111
  /** `PATCH /v1/store` 본문 — 바꿀 필드만 보낸다 */
@@ -3163,10 +3163,21 @@ const storeMemberSchema = z.object({
3163
3163
  joinedAt: z.string(),
3164
3164
  lastActiveAt: z.string().nullable()
3165
3165
  });
3166
+ /**
3167
+ * 초대 메일 발송 결과 — `SENDING`은 발송 요청 중(결과를 아직 적지 못함), `NOT_CONFIGURED`는 메일 발송이 설정되지 않아
3168
+ * 보내지 않은 것이다. 발송 실패는 초대를 무효로 만들지 않는다 — 재발송으로 다시 보낸다
3169
+ */
3170
+ const invitationDeliveryStatusSchema = z.enum([
3171
+ "SENDING",
3172
+ "SENT",
3173
+ "FAILED",
3174
+ "NOT_CONFIGURED"
3175
+ ]);
3166
3176
  const invitationSchema = z.object({
3167
3177
  invitationId: z.string(),
3168
3178
  email: z.email(),
3169
3179
  role: z.enum(["ADMIN", "STAFF"]),
3180
+ /** 만료 시각이 지난 대기 초대는 `EXPIRED`로 보인다 */
3170
3181
  status: z.enum([
3171
3182
  "PENDING",
3172
3183
  "ACCEPTED",
@@ -3175,8 +3186,25 @@ const invitationSchema = z.object({
3175
3186
  ]),
3176
3187
  invitedBy: z.string(),
3177
3188
  expiresAt: z.string(),
3178
- createdAt: z.string()
3189
+ createdAt: z.string(),
3190
+ /** 마지막 발송 결과. 발송 기록이 없는 옛 초대는 null */
3191
+ deliveryStatus: invitationDeliveryStatusSchema.nullable().default(null),
3192
+ /**
3193
+ * 발송 실패 코드(`FAILED`일 때). `DELIVERY_UNKNOWN`은 발송 요청 뒤 결과를 적지 못한 경우다(받았는지 모른다 — 재발송한다)
3194
+ */
3195
+ deliveryErrorCode: z.string().nullable().default(null),
3196
+ lastSentAt: z.string().nullable().default(null),
3197
+ /** 발송 요청 횟수(첫 발송 포함) */
3198
+ sendCount: z.number().int().default(0),
3199
+ acceptedAt: z.string().nullable().default(null)
3200
+ });
3201
+ /** `POST /v1/store/invitations` 요청 — ADMIN 초대는 OWNER만 할 수 있다 */
3202
+ const inviteMemberRequestSchema = z.object({
3203
+ email: z.email(),
3204
+ role: z.enum(["ADMIN", "STAFF"])
3179
3205
  });
3206
+ /** `PATCH /v1/store/members/{userId}` 요청 */
3207
+ const updateMemberRoleRequestSchema = z.object({ role: z.enum(["ADMIN", "STAFF"]) });
3180
3208
  /** `GET /v1/store/invitations` 쿼리 — OpenAPI 문서용 형태 */
3181
3209
  const invitationListQuerySchema = z.object({ status: invitationSchema.shape.status.optional().describe("초대 상태 필터") });
3182
3210
  /** `PATCH /v1/store/members/{userId}` 응답 — 바뀐 역할 */
@@ -3741,7 +3769,20 @@ list: (params) => storeHttp.request("GET", "/audit-logs", auditLogPageSchema, {
3741
3769
  */
3742
3770
  update: (body) => storeHttp.request("PATCH", "/store", storeSchema, { body: updateStoreRequestSchema.parse(body) }),
3743
3771
  listMembers: () => storeHttp.request("GET", "/store/members", z.array(storeMemberSchema)),
3744
- listInvitations: () => storeHttp.request("GET", "/store/invitations", z.array(invitationSchema))
3772
+ /** `PATCH /v1/store/members/{userId}` — 스코프 `member:rw`. OWNER는 바꿀 수 없고 ADMIN 지정·ADMIN 변경은 OWNER만 한다 */
3773
+ updateMemberRole: (userId, body) => storeHttp.request("PATCH", path`/store/members/${userId}`, storeMemberRoleUpdatedSchema, { body: updateMemberRoleRequestSchema.parse(body) }),
3774
+ /** `DELETE /v1/store/members/{userId}` (204) — OWNER는 내보낼 수 없고 ADMIN은 OWNER만 내보낸다 */
3775
+ removeMember: (userId) => storeHttp.requestVoid("DELETE", path`/store/members/${userId}`),
3776
+ listInvitations: (params) => storeHttp.request("GET", "/store/invitations", z.array(invitationSchema), { query: params }),
3777
+ /**
3778
+ * `POST /v1/store/invitations` (201) — 스코프 `member:rw`. 초대 메일을 보낸다. 발송 결과는 응답의
3779
+ * `deliveryStatus`다(발송이 실패해도 초대는 만들어진다). 스토어·초대한 사람·받는 주소별 발송 한도가 있다(429, `details.limit`).
3780
+ */
3781
+ invite: (body) => storeHttp.request("POST", "/store/invitations", invitationSchema, { body: inviteMemberRequestSchema.parse(body) }),
3782
+ /** `POST /v1/store/invitations/{invitationId}/resend` — 새 수락 링크로 다시 보낸다. 이전 링크는 무효가 되고 만료가 다시 7일이 된다 */
3783
+ resendInvitation: (invitationId) => storeHttp.request("POST", path`/store/invitations/${invitationId}/resend`, invitationSchema),
3784
+ /** `DELETE /v1/store/invitations/{invitationId}` (204) — 대기 중 초대를 취소한다 */
3785
+ cancelInvitation: (invitationId) => storeHttp.requestVoid("DELETE", path`/store/invitations/${invitationId}`)
3745
3786
  }
3746
3787
  };
3747
3788
  }
@@ -4130,9 +4171,9 @@ function createStoreSession(options) {
4130
4171
  async function handleCallback(code, state) {
4131
4172
  const raw = storage.get(STORE_SESSION_KEYS.pkce);
4132
4173
  storage.remove(STORE_SESSION_KEYS.pkce);
4133
- if (!raw) throw new Error("로그인 세션이 만료되었습니다. 다시 시도해주세요");
4174
+ if (!raw) throw new Error("로그인 세션이 만료되었습니다. 다시 시도해주십시오");
4134
4175
  const saved = JSON.parse(raw);
4135
- if (saved.state !== state) throw new Error("state가 일치하지 않습니다. 다시 시도해주세요");
4176
+ if (saved.state !== state) throw new Error("state가 일치하지 않습니다. 다시 시도해주십시오");
4136
4177
  const tokens = await exchangeAuthorizationCode({
4137
4178
  baseUrl,
4138
4179
  clientId,
@@ -4172,4 +4213,4 @@ function createStoreSession(options) {
4172
4213
  };
4173
4214
  }
4174
4215
  //#endregion
4175
- export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, ApiError, ApprovalPendingError, CASH_RECEIPT_STATUS_VALUES, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, PAYMENT_ROUTING_EXCLUSION_CODES, PORTONE_CHANNEL_NAME_MAX_LENGTH, PORTONE_MAX_CHANNELS, PORTONE_MIN_CHANNELS, REFUND_POLICY_DEFAULTS, REMOTE_AREA_ZIP_RANGES, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, STORE_CODE_PATTERN, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, TOSS_WIDGET_CLIENT_KEY_PATTERN, TOSS_WIDGET_KEY_MESSAGE, TOSS_WIDGET_SECRET_KEY_PATTERN, UPLOAD_PURPOSE_LIMITS, VARIANT_STOCK_EXCLUSIVE_MESSAGE, WEBHOOK_DEFAULT_TOLERANCE_SEC, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_FAILURE_REASONS, WEBHOOK_HEADERS, WEBHOOK_PAYLOAD_EXCERPT_MAX_BYTES, WEBHOOK_RESOURCE_TYPES, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_USER_AGENT, addressChangeRequestListSchema, addressTypeSchema, agentPolicyDecisionSchema, 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, changeTypeSchema, claimDetailSchema, claimHoldResultSchema, claimListQuerySchema, claimReasonSchema, claimReturnAddressSchema, claimSchema, claimStatusSchema, claimTypeSchema, claimWebhookEventDataSchema, claimWebhookEventSchema, clientCredentialsTokenResponseSchema, consentActionSchema, consentKindSchema, consentSourceSchema, createPkcePair, createStoreClient, createStoreSession, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, exchangeStoreTokenViaOAuth, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationListQuerySchema, invitationSchema, isReservedStoreCode, isStoreScope, isWebOrigin, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, mcpRuleResultSchema, mcpToolEventSchema, myAccountSchema, myStoreSchema, oauthClientRegistrationRequestSchema, oauthClientRegistrationResponseSchema, oauthTokenResponseSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionValueRequestSchema, optionValueSchema, 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, productImageRejection, productImageUrlSchema, productListQuerySchema, productOutOfStockWebhookEventDataSchema, productOutOfStockWebhookEventSchema, productPatchRequestSchema, productRefundPolicyOverride, productSchema, productSortSchema, productStatusSchema, productSummarySchema, productVariantRequestSchema, productVariantSchema, proratedRefundBase, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, quoteDelivery, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, resolveRefundPolicy, resolveShippingPolicy, reviewListQuerySchema, reviewReportResultSchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, scopeAccessSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeTokenResponseSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, userTokenResponseSchema, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, writeDryRunResultSchema, writePreviewSchema };
4216
+ export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, ApiError, ApprovalPendingError, CASH_RECEIPT_STATUS_VALUES, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, PAYMENT_ROUTING_EXCLUSION_CODES, PORTONE_CHANNEL_NAME_MAX_LENGTH, PORTONE_MAX_CHANNELS, PORTONE_MIN_CHANNELS, REFUND_POLICY_DEFAULTS, REMOTE_AREA_ZIP_RANGES, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, STORE_CODE_PATTERN, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, TOSS_WIDGET_CLIENT_KEY_PATTERN, TOSS_WIDGET_KEY_MESSAGE, TOSS_WIDGET_SECRET_KEY_PATTERN, UPLOAD_PURPOSE_LIMITS, VARIANT_STOCK_EXCLUSIVE_MESSAGE, WEBHOOK_DEFAULT_TOLERANCE_SEC, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_FAILURE_REASONS, WEBHOOK_HEADERS, WEBHOOK_PAYLOAD_EXCERPT_MAX_BYTES, WEBHOOK_RESOURCE_TYPES, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_USER_AGENT, addressChangeRequestListSchema, addressTypeSchema, agentPolicyDecisionSchema, 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, changeTypeSchema, claimDetailSchema, claimHoldResultSchema, claimListQuerySchema, claimReasonSchema, claimReturnAddressSchema, claimSchema, claimStatusSchema, claimTypeSchema, claimWebhookEventDataSchema, claimWebhookEventSchema, clientCredentialsTokenResponseSchema, consentActionSchema, consentKindSchema, consentSourceSchema, createPkcePair, createStoreClient, createStoreSession, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, exchangeStoreTokenViaOAuth, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isReservedStoreCode, isStoreScope, isWebOrigin, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, mcpRuleResultSchema, mcpToolEventSchema, myAccountSchema, myStoreSchema, oauthClientRegistrationRequestSchema, oauthClientRegistrationResponseSchema, oauthTokenResponseSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionValueRequestSchema, optionValueSchema, 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, productImageRejection, productImageUrlSchema, productListQuerySchema, productOutOfStockWebhookEventDataSchema, productOutOfStockWebhookEventSchema, productPatchRequestSchema, productRefundPolicyOverride, productSchema, productSortSchema, productStatusSchema, productSummarySchema, productVariantRequestSchema, productVariantSchema, proratedRefundBase, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, quoteDelivery, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, resolveRefundPolicy, resolveShippingPolicy, reviewListQuerySchema, reviewReportResultSchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, scopeAccessSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeTokenResponseSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, userTokenResponseSchema, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, writeDryRunResultSchema, writePreviewSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayren/store-sdk",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
package/src/client.ts CHANGED
@@ -185,13 +185,19 @@ import {
185
185
  } from "./schemas/product";
186
186
  import {
187
187
  type AddressType,
188
+ type Invitation,
189
+ type InviteMemberRequest,
188
190
  invitationSchema,
191
+ inviteMemberRequestSchema,
189
192
  type SellerAddressRequest,
190
193
  sellerAddressRequestSchema,
191
194
  sellerAddressSchema,
195
+ storeMemberRoleUpdatedSchema,
192
196
  storeMemberSchema,
193
197
  storeSchema,
198
+ type UpdateMemberRoleRequest,
194
199
  type UpdateStoreRequest,
200
+ updateMemberRoleRequestSchema,
195
201
  updateStoreRequestSchema,
196
202
  } from "./schemas/store";
197
203
  import {
@@ -1145,8 +1151,36 @@ export function createStoreClient(options: StoreClientOptions) {
1145
1151
  body: updateStoreRequestSchema.parse(body),
1146
1152
  }),
1147
1153
  listMembers: () => storeHttp.request("GET", "/store/members", z.array(storeMemberSchema)),
1148
- listInvitations: () =>
1149
- storeHttp.request("GET", "/store/invitations", z.array(invitationSchema)),
1154
+ /** `PATCH /v1/store/members/{userId}` — 스코프 `member:rw`. OWNER는 바꿀 수 없고 ADMIN 지정·ADMIN 변경은 OWNER만 한다 */
1155
+ updateMemberRole: (userId: string, body: UpdateMemberRoleRequest) =>
1156
+ storeHttp.request("PATCH", path`/store/members/${userId}`, storeMemberRoleUpdatedSchema, {
1157
+ body: updateMemberRoleRequestSchema.parse(body),
1158
+ }),
1159
+ /** `DELETE /v1/store/members/{userId}` (204) — OWNER는 내보낼 수 없고 ADMIN은 OWNER만 내보낸다 */
1160
+ removeMember: (userId: string) =>
1161
+ storeHttp.requestVoid("DELETE", path`/store/members/${userId}`),
1162
+ listInvitations: (params?: { status?: Invitation["status"] }) =>
1163
+ storeHttp.request("GET", "/store/invitations", z.array(invitationSchema), {
1164
+ query: params as Query,
1165
+ }),
1166
+ /**
1167
+ * `POST /v1/store/invitations` (201) — 스코프 `member:rw`. 초대 메일을 보낸다. 발송 결과는 응답의
1168
+ * `deliveryStatus`다(발송이 실패해도 초대는 만들어진다). 스토어·초대한 사람·받는 주소별 발송 한도가 있다(429, `details.limit`).
1169
+ */
1170
+ invite: (body: InviteMemberRequest) =>
1171
+ storeHttp.request("POST", "/store/invitations", invitationSchema, {
1172
+ body: inviteMemberRequestSchema.parse(body),
1173
+ }),
1174
+ /** `POST /v1/store/invitations/{invitationId}/resend` — 새 수락 링크로 다시 보낸다. 이전 링크는 무효가 되고 만료가 다시 7일이 된다 */
1175
+ resendInvitation: (invitationId: string) =>
1176
+ storeHttp.request(
1177
+ "POST",
1178
+ path`/store/invitations/${invitationId}/resend`,
1179
+ invitationSchema,
1180
+ ),
1181
+ /** `DELETE /v1/store/invitations/{invitationId}` (204) — 대기 중 초대를 취소한다 */
1182
+ cancelInvitation: (invitationId: string) =>
1183
+ storeHttp.requestVoid("DELETE", path`/store/invitations/${invitationId}`),
1150
1184
  },
1151
1185
  };
1152
1186
  }
@@ -12,7 +12,7 @@ export const orderSummarySchema = z.object({
12
12
  testPayment: z
13
13
  .boolean()
14
14
  .describe(
15
- "테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았어요. 상품을 발송하지 않도록 주의하세요",
15
+ "테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았습니다. 상품을 발송하지 않도록 주의하십시오",
16
16
  ),
17
17
  });
18
18
 
@@ -61,7 +61,7 @@ export const orderItemSchema = z.object({
61
61
  testPayment: z
62
62
  .boolean()
63
63
  .describe(
64
- "소속 주문이 테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았어요",
64
+ "소속 주문이 테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았습니다",
65
65
  ),
66
66
  });
67
67
 
@@ -118,7 +118,7 @@ export const orderSchema = z.object({
118
118
  testPayment: z
119
119
  .boolean()
120
120
  .describe(
121
- "테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았어요. 상품을 발송하지 않도록 주의하세요",
121
+ "테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았습니다. 상품을 발송하지 않도록 주의하십시오",
122
122
  ),
123
123
  items: z.array(orderItemSchema),
124
124
  });
@@ -137,7 +137,7 @@ const testPaymentQuery = z
137
137
  .enum(["true", "false"])
138
138
  .optional()
139
139
  .describe(
140
- "테스트 결제(샌드박스 결제) 필터. `true`면 테스트 결제만, `false`면 실결제만, 생략하면 전부예요",
140
+ "테스트 결제(샌드박스 결제) 필터. `true`면 테스트 결제만, `false`면 실결제만, 생략하면 전부입니다",
141
141
  );
142
142
 
143
143
  const pageQuery = {
@@ -59,7 +59,7 @@ export const TOSS_WIDGET_CLIENT_KEY_PATTERN = /^(test|live)_gck_/;
59
59
  /** 토스페이먼츠 결제위젯 시크릿 키 접두사. {@link TOSS_WIDGET_CLIENT_KEY_PATTERN} 참고 */
60
60
  export const TOSS_WIDGET_SECRET_KEY_PATTERN = /^(test|live)_gsk_/;
61
61
  /** 결제위젯 키를 거부할 때의 필드 메시지 */
62
- export const TOSS_WIDGET_KEY_MESSAGE = "결제위젯 키가 아니라 API 개별 연동 키를 입력해주세요";
62
+ export const TOSS_WIDGET_KEY_MESSAGE = "결제위젯 키가 아니라 API 개별 연동 키를 입력해주십시오";
63
63
 
64
64
  export const tossPaymentsCredentialsInputSchema = z
65
65
  .object({
@@ -187,7 +187,7 @@ export const updatePaymentProviderRequestSchema = z
187
187
  body.enabled !== undefined ||
188
188
  body.sandboxMode !== undefined ||
189
189
  body.easyPayProviders !== undefined,
190
- { message: "enabled·sandboxMode·easyPayProviders 중 하나는 보내야 해요" },
190
+ { message: "enabled·sandboxMode·easyPayProviders 중 하나는 보내야 합니다" },
191
191
  );
192
192
  export type UpdatePaymentProviderRequest = z.infer<typeof updatePaymentProviderRequestSchema>;
193
193
 
@@ -221,7 +221,7 @@ export const updatePaymentSettingsRequestSchema = z
221
221
  ),
222
222
  })
223
223
  .refine((body) => body.priority !== undefined || body.checkoutOrigins !== undefined, {
224
- message: "priority 또는 checkoutOrigins 중 하나는 보내야 해요",
224
+ message: "priority 또는 checkoutOrigins 중 하나는 보내야 합니다",
225
225
  });
226
226
  export type UpdatePaymentSettingsRequest = z.infer<typeof updatePaymentSettingsRequestSchema>;
227
227
 
@@ -284,7 +284,7 @@ const ADDRESS_DESCRIPTIONS = {
284
284
  export const productCreateRequestSchema = z
285
285
  .object({
286
286
  name: z.string().min(1).max(100),
287
- categoryId: z.string().min(1, "카테고리를 선택해주세요"),
287
+ categoryId: z.string().min(1, "카테고리를 선택해주십시오"),
288
288
  salePrice: z
289
289
  .number()
290
290
  .int()
@@ -68,11 +68,11 @@ export const storeCodeSchema = z
68
68
  .string()
69
69
  .regex(
70
70
  STORE_CODE_PATTERN,
71
- "소문자·숫자·하이픈 3~30자여야 하고 하이픈으로 시작하거나 끝날 수 없어요",
71
+ "소문자·숫자·하이픈 3~30자여야 하고 하이픈으로 시작하거나 끝날 수 없습니다",
72
72
  )
73
73
  .refine(
74
74
  (code) => !isReservedStoreCode(code),
75
- "플랫폼이 쓰는 이름이라 스토어 코드로 쓸 수 없어요",
75
+ "플랫폼이 쓰는 이름이라 스토어 코드로 쓸 수 없습니다",
76
76
  );
77
77
 
78
78
  /** `https://shop.example.com`처럼 경로·쿼리 없는 http(s) 오리진인가 */
@@ -98,7 +98,7 @@ export const analyticsOriginSchema = z
98
98
  .string()
99
99
  .trim()
100
100
  .max(255)
101
- .refine(isWebOrigin, "https://shop.example.com 형식(경로 없이)으로 입력해 주세요")
101
+ .refine(isWebOrigin, "https://shop.example.com 형식(경로 없이)으로 입력해 주십시오")
102
102
  .describe("스토어프론트 오리진. 예: `https://shop.example.com`");
103
103
 
104
104
  /** 허용 오리진 상한 */
@@ -125,7 +125,7 @@ export const policyVersionSchema = z
125
125
  export const policyDocumentUrlSchema = z
126
126
  .url()
127
127
  .max(500)
128
- .refine((value) => value.startsWith("https://"), "https 주소만 쓸 수 있어요")
128
+ .refine((value) => value.startsWith("https://"), "https 주소만 쓸 수 있습니다")
129
129
  .nullable();
130
130
 
131
131
  const autoDeliverDaysDescription =
@@ -268,18 +268,58 @@ export const storeMemberSchema = z.object({
268
268
 
269
269
  export type StoreMember = z.infer<typeof storeMemberSchema>;
270
270
 
271
+ /**
272
+ * 초대 메일 발송 결과 — `SENDING`은 발송 요청 중(결과를 아직 적지 못함), `NOT_CONFIGURED`는 메일 발송이 설정되지 않아
273
+ * 보내지 않은 것이다. 발송 실패는 초대를 무효로 만들지 않는다 — 재발송으로 다시 보낸다
274
+ */
275
+ export const invitationDeliveryStatusSchema = z.enum([
276
+ "SENDING",
277
+ "SENT",
278
+ "FAILED",
279
+ "NOT_CONFIGURED",
280
+ ]);
281
+
282
+ export type InvitationDeliveryStatus = z.infer<typeof invitationDeliveryStatusSchema>;
283
+
271
284
  export const invitationSchema = z.object({
272
285
  invitationId: z.string(),
273
286
  email: z.email(),
274
287
  role: z.enum(["ADMIN", "STAFF"]),
288
+ /** 만료 시각이 지난 대기 초대는 `EXPIRED`로 보인다 */
275
289
  status: z.enum(["PENDING", "ACCEPTED", "EXPIRED", "CANCELED"]),
276
290
  invitedBy: z.string(),
277
291
  expiresAt: z.string(),
278
292
  createdAt: z.string(),
293
+ // 아래 필드는 이슈 #42에서 더했다. 옛 api 응답에는 없으므로 빠지면 기본값으로 읽는다(SDK가 api보다 먼저 올라가도 파싱된다)
294
+ /** 마지막 발송 결과. 발송 기록이 없는 옛 초대는 null */
295
+ deliveryStatus: invitationDeliveryStatusSchema.nullable().default(null),
296
+ /**
297
+ * 발송 실패 코드(`FAILED`일 때). `DELIVERY_UNKNOWN`은 발송 요청 뒤 결과를 적지 못한 경우다(받았는지 모른다 — 재발송한다)
298
+ */
299
+ deliveryErrorCode: z.string().nullable().default(null),
300
+ lastSentAt: z.string().nullable().default(null),
301
+ /** 발송 요청 횟수(첫 발송 포함) */
302
+ sendCount: z.number().int().default(0),
303
+ acceptedAt: z.string().nullable().default(null),
279
304
  });
280
305
 
281
306
  export type Invitation = z.infer<typeof invitationSchema>;
282
307
 
308
+ /** `POST /v1/store/invitations` 요청 — ADMIN 초대는 OWNER만 할 수 있다 */
309
+ export const inviteMemberRequestSchema = z.object({
310
+ email: z.email(),
311
+ role: z.enum(["ADMIN", "STAFF"]),
312
+ });
313
+
314
+ export type InviteMemberRequest = z.infer<typeof inviteMemberRequestSchema>;
315
+
316
+ /** `PATCH /v1/store/members/{userId}` 요청 */
317
+ export const updateMemberRoleRequestSchema = z.object({
318
+ role: z.enum(["ADMIN", "STAFF"]),
319
+ });
320
+
321
+ export type UpdateMemberRoleRequest = z.infer<typeof updateMemberRoleRequestSchema>;
322
+
283
323
  /** `GET /v1/store/invitations` 쿼리 — OpenAPI 문서용 형태 */
284
324
  export const invitationListQuerySchema = z.object({
285
325
  status: invitationSchema.shape.status.optional().describe("초대 상태 필터"),
package/src/session.ts CHANGED
@@ -203,10 +203,10 @@ export function createStoreSession(options: StoreSessionOptions): StoreSession {
203
203
  async function handleCallback(code: string, state: string): Promise<void> {
204
204
  const raw = storage.get(STORE_SESSION_KEYS.pkce);
205
205
  storage.remove(STORE_SESSION_KEYS.pkce); // 1회용
206
- if (!raw) throw new Error("로그인 세션이 만료되었습니다. 다시 시도해주세요");
206
+ if (!raw) throw new Error("로그인 세션이 만료되었습니다. 다시 시도해주십시오");
207
207
  const saved = JSON.parse(raw) as PkceBlob;
208
208
  if (saved.state !== state) {
209
- throw new Error("state가 일치하지 않습니다. 다시 시도해주세요");
209
+ throw new Error("state가 일치하지 않습니다. 다시 시도해주십시오");
210
210
  }
211
211
  const tokens = await exchangeAuthorizationCode({
212
212
  baseUrl,