@sayren/store-sdk 0.30.11 → 0.30.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2642,6 +2642,62 @@ const APP_SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
2642
2642
  const APP_SECRETS_MAX = 20;
2643
2643
  const APP_EVENTS_MAX = 50;
2644
2644
  const APP_NETWORK_HOSTS_MAX = 20;
2645
+ const APP_PUBLIC_HTTP_MAX = 20;
2646
+ const APP_SCHEDULES_MAX = 10;
2647
+ /** HTTP 핸들러 키 — `"<메서드> <경로>"`(`@sayren/app` `defineApp({ http })`와 같은 형식) */
2648
+ const APP_HTTP_KEY_PATTERN = /^(GET|POST|PUT|PATCH|DELETE) (\/[A-Za-z0-9._~:/-]*)$/;
2649
+ /** 예약 작업 이름 — 설정 키와 같은 형식 */
2650
+ const APP_SCHEDULE_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]{0,39}$/;
2651
+ /** 예약 작업 간격 → 분 */
2652
+ const APP_SCHEDULE_INTERVALS = {
2653
+ "15m": 15,
2654
+ "30m": 30,
2655
+ "1h": 60,
2656
+ "3h": 180,
2657
+ "6h": 360,
2658
+ "12h": 720,
2659
+ "1d": 1440
2660
+ };
2661
+ /** 흐름 알림 이름 — 흐름 알림 채널 `app.<handle>.<이름>`의 마지막 마디(소문자·숫자·하이픈) */
2662
+ const APP_FLOW_NOTIFICATION_PATTERN = /^[a-z][a-z0-9-]{0,39}$/;
2663
+ /** 흐름 사건 이름 — 사건 키 `app.<handle>.<이름>`의 마지막 마디 */
2664
+ const APP_FLOW_EVENT_PATTERN = /^[A-Z][A-Z0-9_]{0,39}$/;
2665
+ const APP_FLOW_ITEMS_MAX = 20;
2666
+ /** 흐름 알림 매개변수 — 셀러가 편집기에서 식으로 값을 연결한다 */
2667
+ const appFlowParamSchema = z.strictObject({
2668
+ type: z.enum([
2669
+ "string",
2670
+ "number",
2671
+ "boolean"
2672
+ ]),
2673
+ label: z.string().trim().min(1).max(60),
2674
+ required: z.boolean().optional()
2675
+ });
2676
+ const appFlowNotificationSchema = z.strictObject({
2677
+ label: z.string().trim().min(1).max(60),
2678
+ description: z.string().trim().max(200).optional(),
2679
+ params: z.record(z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,39}$/), appFlowParamSchema).refine((params) => Object.keys(params).length <= 20, { message: `매개변수는 20개까지입니다` }).default({})
2680
+ });
2681
+ const appFlowEventSchema = z.strictObject({
2682
+ label: z.string().trim().min(1).max(60),
2683
+ description: z.string().trim().max(200).optional()
2684
+ });
2685
+ /** 에이전트 도구 이름 — 소문자·숫자·하이픈 */
2686
+ const APP_TOOL_NAME_PATTERN = /^[a-z][a-z0-9-]{0,39}$/;
2687
+ const appToolInputSchema = z.strictObject({
2688
+ type: z.enum([
2689
+ "string",
2690
+ "number",
2691
+ "boolean"
2692
+ ]),
2693
+ description: z.string().trim().max(200).optional(),
2694
+ required: z.boolean().optional()
2695
+ });
2696
+ const appToolSchema = z.strictObject({
2697
+ description: z.string().trim().min(1).max(500),
2698
+ input: z.record(z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,39}$/), appToolInputSchema).refine((input) => Object.keys(input).length <= 20, { message: `입력은 20개까지입니다` }).default({})
2699
+ });
2700
+ const APP_SCHEDULE_INTERVAL_KEYS = Object.keys(APP_SCHEDULE_INTERVALS);
2645
2701
  /** 앱 목록에 보이는 아이콘·README(#22 앱 목록 시안) — 앱 폴더의 파일을 `sayren app deploy`가 버전과 함께 올린다 */
2646
2702
  const APP_ICON_MAX_BYTES = 262144;
2647
2703
  const APP_ICON_MIN_PX = 512;
@@ -2684,8 +2740,12 @@ const appManifestSchema = z.strictObject({
2684
2740
  icon: z.string().regex(APP_FOLDER_FILE).refine((path) => /\.(png|svg)$/i.test(path), { message: "아이콘은 .png 또는 .svg 파일입니다" }).optional(),
2685
2741
  /** 앱 상세에 보일 README(마크다운, 64KB 이하). 적지 않으면 앱 폴더의 README.md를 쓴다 */
2686
2742
  readme: z.string().regex(APP_FOLDER_FILE).refine((path) => /\.md$/i.test(path), { message: "README는 .md 파일입니다" }).optional(),
2687
- /** 실행 위치 — A1은 코드 업로드 앱만. 외부 런타임(`external`)은 A3에서 연다 */
2688
- runtime: z.literal("code").default("code"),
2743
+ /** 실행 위치 — `code`(sayren이 실행) 또는 `external`(개발자 서버, 매뉴얼 「개발자 서버에서 실행」) */
2744
+ runtime: z.enum(["code", "external"]).default("code"),
2745
+ /** `runtime: external`의 호출 주소 */
2746
+ external: z.strictObject({ url: z.url().startsWith("https://") }).optional(),
2747
+ /** AI 에이전트 도구(매뉴얼 「에이전트 도구」) */
2748
+ mcp: z.strictObject({ tools: z.record(z.string().regex(APP_TOOL_NAME_PATTERN), appToolSchema).refine((tools) => Object.keys(tools).length <= 20, { message: `도구는 20개까지입니다` }).default({}) }).optional(),
2689
2749
  /** 설치 때 전체 동의하는 스코프 */
2690
2750
  scopes: z.array(appScopeSchema).max(32).default([]),
2691
2751
  network: z.strictObject({ hosts: z.array(appNetworkHostSchema).max(20) }).default({ hosts: [] }),
@@ -2694,6 +2754,15 @@ const appManifestSchema = z.strictObject({
2694
2754
  ui: z.strictObject({
2695
2755
  /** 상점 플랫폼 앱 화면(iframe) — 정적 SPA 진입 파일 */
2696
2756
  adminPage: z.strictObject({ entry: z.string().regex(/^ui\/[A-Za-z0-9._/-]+\.html$/) }) }).optional(),
2757
+ /** 공개 HTTP — 여기 적은 핸들러만 `https://{handle}.{앱 도메인}/hooks/{설치 id}/…`로 외부에서 부를 수 있다 */
2758
+ http: z.strictObject({ public: z.array(z.string().regex(APP_HTTP_KEY_PATTERN)).max(20) }).optional(),
2759
+ /** 예약 작업 — 이름마다 실행 간격 */
2760
+ schedules: z.record(z.string().regex(APP_SCHEDULE_NAME_PATTERN), z.strictObject({ every: z.enum(APP_SCHEDULE_INTERVAL_KEYS) })).refine((schedules) => Object.keys(schedules).length <= 10, { message: `예약 작업은 10개까지입니다` }).default({}),
2761
+ /** 주문 흐름 연동(매뉴얼 「주문 흐름에서 앱 쓰기」) — 흐름 알림(흐름 → 앱)과 흐름 사건(앱 → 흐름) */
2762
+ flow: z.strictObject({
2763
+ notifications: z.record(z.string().regex(APP_FLOW_NOTIFICATION_PATTERN), appFlowNotificationSchema).refine((items) => Object.keys(items).length <= 20, { message: `흐름 알림은 20개까지입니다` }).default({}),
2764
+ events: z.record(z.string().regex(APP_FLOW_EVENT_PATTERN), appFlowEventSchema).refine((items) => Object.keys(items).length <= 20, { message: `흐름 사건은 20개까지입니다` }).default({})
2765
+ }).optional(),
2697
2766
  settings: z.record(z.string().regex(APP_SETTING_KEY_PATTERN), appSettingFieldSchema).refine((fields) => Object.keys(fields).length <= 30, { message: `설정 필드는 30개까지입니다` }).default({}),
2698
2767
  /** 개발자 비밀 값 이름 — 값은 CLI(`sayren app secret put`)로 따로 넣는다 */
2699
2768
  secrets: z.array(z.string().regex(APP_SECRET_NAME_PATTERN)).max(20).default([])
@@ -2727,6 +2796,26 @@ function appManifestProblems(manifest) {
2727
2796
  unique(manifest.events, "events", "이벤트");
2728
2797
  unique(manifest.network.hosts, "network.hosts", "호스트");
2729
2798
  unique(manifest.secrets, "secrets", "비밀 값 이름");
2799
+ unique(manifest.http?.public ?? [], "http.public", "공개 HTTP 핸들러");
2800
+ if (manifest.runtime === "external" !== Boolean(manifest.external)) problems.push({
2801
+ path: "external",
2802
+ code: "EXTERNAL_URL_REQUIRED",
2803
+ message: "runtime이 external이면 external.url이 필요하고, code면 external을 적지 않습니다"
2804
+ });
2805
+ if (manifest.runtime === "external" && manifest.network.hosts.length > 0) problems.push({
2806
+ path: "network.hosts",
2807
+ code: "EXTERNAL_NETWORK_HOSTS",
2808
+ message: "외부 런타임 앱은 network.hosts를 적지 않습니다"
2809
+ });
2810
+ if (manifest.external) {
2811
+ const host = new URL(manifest.external.url).hostname;
2812
+ const hostProblem = appNetworkHostProblem(host);
2813
+ if (hostProblem) problems.push({
2814
+ path: "external.url",
2815
+ code: "EXTERNAL_URL_INVALID",
2816
+ message: hostProblem
2817
+ });
2818
+ }
2730
2819
  for (const event of manifest.events) if (!scopesCoverEvent(manifest.scopes, event)) problems.push({
2731
2820
  path: `events.${event}`,
2732
2821
  code: "EVENT_SCOPE_MISSING",
@@ -2762,6 +2851,12 @@ function appCapabilitiesOf(manifest) {
2762
2851
  events: sorted(manifest.events),
2763
2852
  networkHosts: sorted(manifest.network.hosts),
2764
2853
  adminPage: Boolean(manifest.ui?.adminPage),
2854
+ publicHttp: sorted(manifest.http?.public ?? []),
2855
+ flowNotifications: manifest.flow?.notifications ?? {},
2856
+ flowEvents: manifest.flow?.events ?? {},
2857
+ externalHost: manifest.external ? new URL(manifest.external.url).hostname : null,
2858
+ tools: manifest.mcp?.tools ?? {},
2859
+ schedules: Object.fromEntries(Object.entries(manifest.schedules).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([name, schedule]) => [name, schedule.every])),
2765
2860
  requiredSettings: Object.entries(manifest.settings).filter(([, field]) => field.required).map(([key]) => key).sort(),
2766
2861
  secretSettings: Object.entries(manifest.settings).filter(([, field]) => field.secret).map(([key]) => key).sort()
2767
2862
  };
@@ -2799,8 +2894,85 @@ const APP_CAPABILITIES = [
2799
2894
  title: "상점 플랫폼 화면",
2800
2895
  describe: (c) => c.adminPage ? ["상점 플랫폼에 이 앱의 화면을 더합니다"] : [],
2801
2896
  widens: (p, n) => !p.adminPage && n.adminPage
2897
+ },
2898
+ {
2899
+ key: "publicHttp",
2900
+ title: "외부에서 이 앱을 부르는 주소",
2901
+ describe: (c) => c.publicHttp ?? [],
2902
+ widens: (p, n) => grew(p.publicHttp ?? [], n.publicHttp ?? [])
2903
+ },
2904
+ {
2905
+ key: "schedules",
2906
+ title: "주기적으로 실행되는 작업",
2907
+ describe: (c) => Object.entries(c.schedules ?? {}).map(([name, every]) => `${name} · ${appScheduleIntervalLabel(every)}마다`),
2908
+ widens: (p, n) => {
2909
+ const previous = p.schedules ?? {};
2910
+ return Object.entries(n.schedules ?? {}).some(([name, every]) => !previous[name] || APP_SCHEDULE_INTERVALS[every] < APP_SCHEDULE_INTERVALS[previous[name]]);
2911
+ }
2912
+ },
2913
+ {
2914
+ key: "runtime",
2915
+ title: "이 앱이 실행되는 곳",
2916
+ describe: (c) => c.externalHost ? [`개발자 서버 ${c.externalHost}`] : [],
2917
+ widens: (p, n) => Boolean(n.externalHost) && n.externalHost !== p.externalHost
2918
+ },
2919
+ {
2920
+ key: "tools",
2921
+ title: "AI 에이전트 도구",
2922
+ describe: (c) => Object.entries(c.tools ?? {}).map(([name, tool]) => `${name} · ${tool.description}`),
2923
+ widens: (p, n) => grew(Object.keys(p.tools ?? {}), Object.keys(n.tools ?? {}))
2802
2924
  }
2803
2925
  ];
2926
+ /** 요청(메서드·경로)이 HTTP 핸들러 키에 맞는가 — `:이름`은 경로 한 마디에 맞는다(`@sayren/app`의 핸들러 고르기와 같은 규칙) */
2927
+ function appHttpKeyMatches(key, method, path) {
2928
+ const match = APP_HTTP_KEY_PATTERN.exec(key.trim().replace(/\s+/g, " "));
2929
+ if (!match || match[1] !== method.toUpperCase()) return false;
2930
+ const pattern = match[2].split("/");
2931
+ const actual = (path.split("?")[0] ?? path).split("/");
2932
+ if (pattern.length !== actual.length) return false;
2933
+ return pattern.every((part, i) => part.startsWith(":") ? actual[i] !== "" : part === actual[i]);
2934
+ }
2935
+ /** 응답용 예약 작업 목록(이름순) — 옛 버전 행(`schedules` 없음)은 빈 목록 */
2936
+ function appScheduleListOf(capabilities) {
2937
+ return Object.entries(capabilities.schedules ?? {}).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([name, every]) => ({
2938
+ name,
2939
+ every
2940
+ }));
2941
+ }
2942
+ /** 응답용 흐름 알림·사건 목록(이름순) — 옛 버전 행은 빈 목록 */
2943
+ function appFlowSummaryOf(capabilities) {
2944
+ const byName = (entries) => entries.sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
2945
+ return {
2946
+ flowNotifications: byName(Object.entries(capabilities.flowNotifications ?? {})).map(([name, notice]) => ({
2947
+ name,
2948
+ label: notice.label,
2949
+ params: byName(Object.entries(notice.params ?? {})).map(([param, field]) => ({
2950
+ name: param,
2951
+ type: field.type,
2952
+ label: field.label,
2953
+ required: field.required ?? false
2954
+ }))
2955
+ })),
2956
+ flowEvents: byName(Object.entries(capabilities.flowEvents ?? {})).map(([name, event]) => ({
2957
+ name,
2958
+ label: event.label
2959
+ }))
2960
+ };
2961
+ }
2962
+ /** 응답용 도구 목록(이름순) — 옛 버전 행은 빈 목록 */
2963
+ function appToolListOf(capabilities) {
2964
+ return Object.entries(capabilities.tools ?? {}).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([name, tool]) => ({
2965
+ name,
2966
+ description: tool.description
2967
+ }));
2968
+ }
2969
+ /** 예약 간격의 표시 이름 — 동의 화면·상점 플랫폼이 같이 쓴다 */
2970
+ function appScheduleIntervalLabel(every) {
2971
+ const minutes = APP_SCHEDULE_INTERVALS[every];
2972
+ if (minutes < 60) return `${minutes}분`;
2973
+ if (minutes < 1440) return `${minutes / 60}시간`;
2974
+ return "하루";
2975
+ }
2804
2976
  /** 재동의가 필요한 capability 키 — 비어 있으면 release가 모든 설치에 곧바로 반영된다 */
2805
2977
  function appManifestWidens(previous, next) {
2806
2978
  return APP_CAPABILITIES.filter((c) => c.widens(previous, next)).map((c) => c.key);
@@ -3131,6 +3303,12 @@ const appInstallationStatusSchema = z.enum([
3131
3303
  "SUSPENDED"
3132
3304
  ]);
3133
3305
  /** 설치 앱의 앱 정보 — 상점이 보는 범위만(개발자 비밀 값·소스·빌드는 없다) */
3306
+ /** 상점이 보는 앱 공개 범위 — 개발 중(개발자 조직) · 이 상점 전용 · 공개 */
3307
+ const appVisibilitySchema = z.enum([
3308
+ "DEVELOPMENT",
3309
+ "PRIVATE",
3310
+ "PUBLIC"
3311
+ ]);
3134
3312
  const appInstallationAppSchema = z.object({
3135
3313
  appId: z.string(),
3136
3314
  handle: z.string().describe("앱 handle. 앱 화면 주소의 라벨"),
@@ -3159,6 +3337,45 @@ const appInstallationSettingsSchema = z.object({
3159
3337
  });
3160
3338
  /** 설정 저장 — 비밀 필드를 생략하면 현재 값을 유지한다. null은 비운다 */
3161
3339
  const appInstallationSettingsUpdateSchema = z.object({ values: z.record(z.string(), settingsValueSchema) });
3340
+ /** 예약 작업 한 줄 — 매니페스트 `schedules`의 이름과 간격 */
3341
+ const appScheduleSummarySchema = z.object({
3342
+ name: z.string(),
3343
+ every: z.enum([
3344
+ "15m",
3345
+ "30m",
3346
+ "1h",
3347
+ "3h",
3348
+ "6h",
3349
+ "12h",
3350
+ "1d"
3351
+ ])
3352
+ });
3353
+ const publicHttpField = z.array(z.string()).default([]).describe("외부에서 부를 수 있는 HTTP 핸들러(`GET /track/:id`)");
3354
+ /** 흐름 알림·사건(매뉴얼 「주문 흐름에서 앱 쓰기」) — 흐름 편집기가 알림 채널·매개변수와 사건 이름을 고른다 */
3355
+ const appFlowNotificationSummarySchema = z.object({
3356
+ name: z.string(),
3357
+ label: z.string(),
3358
+ params: z.array(z.object({
3359
+ name: z.string(),
3360
+ type: z.enum([
3361
+ "string",
3362
+ "number",
3363
+ "boolean"
3364
+ ]),
3365
+ label: z.string(),
3366
+ required: z.boolean()
3367
+ }))
3368
+ });
3369
+ const appFlowEventSummarySchema = z.object({
3370
+ name: z.string(),
3371
+ label: z.string()
3372
+ });
3373
+ const schedulesField = z.array(appScheduleSummarySchema).default([]).describe("주기적으로 실행되는 작업");
3374
+ const toolsField = z.array(z.object({
3375
+ name: z.string(),
3376
+ description: z.string()
3377
+ })).default([]).describe("AI 에이전트 도구");
3378
+ const externalHostField = z.string().nullable().default(null).describe("개발자 서버에서 실행하는 앱의 호출 호스트. sayren이 실행하면 null");
3162
3379
  const appInstallationSchema = z.object({
3163
3380
  installationId: z.string(),
3164
3381
  storeId: z.string(),
@@ -3170,12 +3387,22 @@ const appInstallationSchema = z.object({
3170
3387
  number: z.number().int(),
3171
3388
  scopes: z.array(z.string()),
3172
3389
  networkHosts: z.array(z.string()),
3173
- events: z.array(appEventTypeSchema)
3390
+ events: z.array(appEventTypeSchema),
3391
+ publicHttp: publicHttpField,
3392
+ schedules: schedulesField,
3393
+ tools: toolsField,
3394
+ externalHost: externalHostField
3174
3395
  }).nullable().optional().describe("재동의가 필요한 새 버전이 요청하는 권한·외부 호스트·이벤트(전체). 없으면 null"),
3175
3396
  grantedScopes: z.array(z.string()).describe("동의한 스코프"),
3176
3397
  grantedNetworkHosts: z.array(z.string()).describe("동의한 외부 호출 호스트"),
3177
3398
  events: z.array(appEventTypeSchema).describe("이 설치가 받는 이벤트"),
3178
3399
  adminPage: z.boolean().describe("상점 플랫폼 앱 화면이 있는가"),
3400
+ publicHttp: publicHttpField,
3401
+ schedules: schedulesField,
3402
+ tools: toolsField,
3403
+ externalHost: externalHostField,
3404
+ flowNotifications: z.array(appFlowNotificationSummarySchema).default([]).describe("주문 흐름에서 이 앱으로 보낼 수 있는 알림"),
3405
+ flowEvents: z.array(appFlowEventSummarySchema).default([]).describe("이 앱이 주문 흐름에 보내는 사건(`app.<handle>.<이름>`)"),
3179
3406
  /** 설치 결과의 캐시가 아니라 실행 버전 매니페스트의 요약 */
3180
3407
  settings: appInstallationSettingsSchema,
3181
3408
  installedBy: z.object({
@@ -3226,7 +3453,8 @@ const storeAppSchema = z.object({
3226
3453
  iconUrl: z.string().nullable(),
3227
3454
  developerName: z.string(),
3228
3455
  versionNumber: z.number().int().describe("현재 버전"),
3229
- installationId: z.string().nullable().describe("이 상점에 설치돼 있으면 설치 id")
3456
+ installationId: z.string().nullable().describe("이 상점에 설치돼 있으면 설치 id"),
3457
+ visibility: appVisibilitySchema.default("DEVELOPMENT").describe("공개 범위 — 개발 중(심사 전) · 이 상점 전용 · 공개(심사 통과)")
3230
3458
  });
3231
3459
  /** `GET /v1/apps/catalog/{appId}` — 앱 상세·설치 화면 */
3232
3460
  const storeAppDetailSchema = storeAppSchema.extend({
@@ -3235,6 +3463,10 @@ const storeAppDetailSchema = storeAppSchema.extend({
3235
3463
  scopes: z.array(z.string()).describe("설치 때 동의하는 스코프(Scope)"),
3236
3464
  events: z.array(appEventTypeSchema).describe("받는 이벤트(Hook)"),
3237
3465
  networkHosts: z.array(z.string()).describe("앱이 데이터를 보내는 외부 호스트"),
3466
+ publicHttp: publicHttpField,
3467
+ schedules: schedulesField,
3468
+ tools: toolsField,
3469
+ externalHost: externalHostField,
3238
3470
  settings: z.record(z.string(), appSettingFieldSchema).describe("설치 때 채우는 설정 필드"),
3239
3471
  updatedAt: z.string().nullable().describe("현재 버전을 release한 시각")
3240
3472
  });
@@ -3254,6 +3486,42 @@ const appInstallationSelfSchema = z.object({
3254
3486
  grantedScopes: z.array(z.string()),
3255
3487
  installedAt: z.string()
3256
3488
  });
3489
+ /** 에이전트 도구(매뉴얼 「에이전트 도구」) — `GET /v1/apps/tools` 한 줄 */
3490
+ const appToolSummarySchema = z.object({
3491
+ installationId: z.string(),
3492
+ app: z.object({
3493
+ appId: z.string(),
3494
+ handle: z.string(),
3495
+ name: z.string()
3496
+ }),
3497
+ name: z.string(),
3498
+ description: z.string(),
3499
+ input: z.array(z.object({
3500
+ name: z.string(),
3501
+ type: z.enum([
3502
+ "string",
3503
+ "number",
3504
+ "boolean"
3505
+ ]),
3506
+ description: z.string().nullable(),
3507
+ required: z.boolean()
3508
+ }))
3509
+ });
3510
+ const appToolCallSchema = z.object({ input: z.record(z.string(), z.unknown()).default({}) });
3511
+ const appToolResultSchema = z.object({ result: z.unknown().describe("앱 도구가 돌려준 값(JSON)") });
3512
+ /** 설치 저장소(`ctx.storage`, 매뉴얼 「앱 코드 › 저장소」) — 설치 토큰 전용 */
3513
+ const APP_STORAGE_KEY_PATTERN = /^[A-Za-z0-9._:-]{1,200}$/;
3514
+ const APP_STORAGE_MAX_KEYS = 1e3;
3515
+ /** 설치당 전체 크기(키 + JSON 값, UTF-8 바이트) */
3516
+ const APP_STORAGE_MAX_BYTES = 1048576;
3517
+ const appStorageEntrySchema = z.object({
3518
+ key: z.string(),
3519
+ value: z.unknown().describe("저장한 JSON 값"),
3520
+ updatedAt: z.string()
3521
+ });
3522
+ const appStorageKeysSchema = z.object({ keys: z.array(z.string()).describe("키 목록(이름순)") });
3523
+ const appStoragePutSchema = z.object({ value: z.unknown().refine((value) => value !== void 0, { message: "value가 필요합니다" }) });
3524
+ const appStorageListQuerySchema = z.object({ prefix: z.string().max(200).optional() });
3257
3525
  const developerOrgSchema = z.object({
3258
3526
  orgId: z.string(),
3259
3527
  name: z.string(),
@@ -3311,6 +3579,8 @@ const appVersionSchema = z.object({
3311
3579
  events: z.array(z.string()),
3312
3580
  networkHosts: z.array(z.string()),
3313
3581
  adminPage: z.boolean(),
3582
+ publicHttp: z.array(z.string()).optional(),
3583
+ schedules: z.record(z.string(), z.string()).optional(),
3314
3584
  requiredSettings: z.array(z.string()),
3315
3585
  secretSettings: z.array(z.string())
3316
3586
  }),
@@ -3320,6 +3590,20 @@ const appVersionSchema = z.object({
3320
3590
  revokedAt: z.string().nullable(),
3321
3591
  createdAt: z.string()
3322
3592
  });
3593
+ /** 앱 공개 심사(#22, 매뉴얼 「앱 공개 범위」) — 개발자가 신청하고 운영자가 승인·반려한다 */
3594
+ const appListingReviewStatusSchema = z.enum([
3595
+ "PENDING",
3596
+ "APPROVED",
3597
+ "REJECTED"
3598
+ ]);
3599
+ const appListingReviewSchema = z.object({
3600
+ reviewId: z.string(),
3601
+ status: appListingReviewStatusSchema,
3602
+ versionNumber: z.number().int().describe("신청 때 현재 버전"),
3603
+ reason: z.string().nullable().describe("반려 사유"),
3604
+ requestedAt: z.string(),
3605
+ reviewedAt: z.string().nullable()
3606
+ });
3323
3607
  const developerAppSchema = z.object({
3324
3608
  appId: z.string(),
3325
3609
  orgId: z.string(),
@@ -3333,6 +3617,8 @@ const developerAppSchema = z.object({
3333
3617
  status: appStatusSchema,
3334
3618
  suspendedReason: z.string().nullable(),
3335
3619
  currentVersionNumber: z.number().int().nullable(),
3620
+ privateStoreId: z.string().nullable().default(null).describe("비공개 앱이 묶인 상점. 개발 중·퍼블릭 앱은 null"),
3621
+ listingReview: appListingReviewSchema.nullable().default(null).describe("마지막 공개 신청. 없으면 null"),
3336
3622
  installations: z.object({
3337
3623
  active: z.number().int(),
3338
3624
  pendingReconsent: z.number().int()
@@ -3343,7 +3629,9 @@ const developerAppSchema = z.object({
3343
3629
  const developerAppCreateSchema = z.object({
3344
3630
  handle: appHandleSchema,
3345
3631
  name: z.string().trim().min(1).max(60),
3346
- description: z.string().trim().max(500).optional()
3632
+ description: z.string().trim().max(500).optional(),
3633
+ /** 비공개 앱 — 이 상점 하나에만 설치된다. 만드는 사람이 그 상점의 OWNER·ADMIN이어야 한다 */
3634
+ privateStoreId: z.string().min(1).optional()
3347
3635
  });
3348
3636
  /** `PUT /platform/v1/developer/apps/{appId}/versions` — CLI `app deploy`가 올리는 번들 */
3349
3637
  const appArtifactUploadSchema = z.object({
@@ -3391,6 +3679,13 @@ const devStoreSchema = z.object({
3391
3679
  ]),
3392
3680
  createdAt: z.string()
3393
3681
  });
3682
+ /** `GET /platform/v1/developer/stores` — 비공개 앱을 묶을 수 있는 상점(내가 소유자·관리자, 운영 중) */
3683
+ const developerStoreSchema = z.object({
3684
+ storeId: z.string(),
3685
+ name: z.string(),
3686
+ role: z.enum(["OWNER", "ADMIN"]),
3687
+ development: z.boolean().describe("개발 상점인가")
3688
+ });
3394
3689
  /** 개발자가 보는 설치 한 줄 */
3395
3690
  const developerInstallationSchema = z.object({
3396
3691
  installationId: z.string(),
@@ -3418,7 +3713,9 @@ const appInvocationSchema = z.object({
3418
3713
  kind: z.enum([
3419
3714
  "event",
3420
3715
  "http",
3421
- "schedule"
3716
+ "schedule",
3717
+ "flow",
3718
+ "tool"
3422
3719
  ]),
3423
3720
  eventType: z.string().nullable(),
3424
3721
  outcome: z.enum([
@@ -8231,7 +8528,8 @@ function createStoreClient(options) {
8231
8528
  }),
8232
8529
  /**
8233
8530
  * `POST /order-items/{id}/events/{key}` — 현장 단말·연동의 상점 사건(`custom.<이름>`)을 플로우에 넣는다(#115).
8234
- * 에러: 400 `FLOW_EVENT_KEY_INVALID`, 409 `FLOW_EVENT_NOT_ACCEPTED`
8531
+ * 앱 사건(`app.<handle>.<이름>`, #22)은 그 앱의 설치 토큰으로만 보낸다(`ctx.api`).
8532
+ * 에러: 400 `FLOW_EVENT_KEY_INVALID`, 403 `FLOW_EVENT_APP_FORBIDDEN`, 409 `FLOW_EVENT_NOT_ACCEPTED`
8235
8533
  */
8236
8534
  emitEvent: (orderItemId, key, input = {}, idempotencyKey) => storeHttp.request("POST", path`/order-items/${orderItemId}/events/${key}`, flowActionResultSchema, {
8237
8535
  body: flowActionRequestSchema.parse({ input }),
@@ -8525,6 +8823,11 @@ get: (params) => storeHttp.request("GET", "/sales-report", salesReportSchema, {
8525
8823
  verify: (provider, body) => storeHttp.request("POST", path`/store/payment-providers/${pgProviderSchema.parse(provider)}/verify`, paymentProviderVerificationSchema, { body: verifyPaymentProviderRequestSchema.parse(body ?? {}) })
8526
8824
  },
8527
8825
  /** 설치 앱(#22, 매뉴얼 「앱 설치와 관리 › 관리 API」) — 설치·설정·제거·세션은 상점 플랫폼 OWNER·ADMIN만 */
8826
+ /** 에이전트 도구(#22 「에이전트 도구」) — 설치된 앱이 제공하는 도구 목록·실행. 실행은 OWNER·ADMIN */
8827
+ appTools: {
8828
+ list: () => storeHttp.request("GET", "/apps/tools", z.array(appToolSummarySchema)),
8829
+ call: (installationId, name, input = {}) => storeHttp.request("POST", path`/apps/installations/${installationId}/tools/${name}`, appToolResultSchema, { body: { input } })
8830
+ },
8528
8831
  apps: {
8529
8832
  /** 이 상점에 설치할 수 있는 앱 — 앱 목록·상세(아이콘·README·Scope·Hook·설정 필드) */
8530
8833
  catalog: {
@@ -8550,7 +8853,16 @@ get: (params) => storeHttp.request("GET", "/sales-report", salesReportSchema, {
8550
8853
  }
8551
8854
  },
8552
8855
  /** 앱 설치 토큰 전용 — 자기 설치 */
8553
- app: { installation: () => storeHttp.request("GET", "/app/installation", appInstallationSelfSchema) },
8856
+ app: {
8857
+ installation: () => storeHttp.request("GET", "/app/installation", appInstallationSelfSchema),
8858
+ /** 설치 저장소(`ctx.storage`) — 없는 키는 404 `APP_STORAGE_KEY_NOT_FOUND`, 한도 초과는 409 `APP_STORAGE_LIMIT` */
8859
+ storage: {
8860
+ list: (params = {}) => storeHttp.request("GET", "/app/storage", appStorageKeysSchema, { query: params }),
8861
+ get: (key) => storeHttp.request("GET", path`/app/storage/${key}`, appStorageEntrySchema),
8862
+ set: (key, value) => storeHttp.request("PUT", path`/app/storage/${key}`, appStorageEntrySchema, { body: { value } }),
8863
+ delete: (key) => storeHttp.requestVoid("DELETE", path`/app/storage/${key}`)
8864
+ }
8865
+ },
8554
8866
  webhooks: {
8555
8867
  list: () => storeHttp.request("GET", "/webhooks", z.array(webhookSchema)),
8556
8868
  /** 서명 시크릿 평문은 이 응답에서만 노출된다 */
@@ -9256,4 +9568,4 @@ function createStoreSession(options) {
9256
9568
  };
9257
9569
  }
9258
9570
  //#endregion
9259
- export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, APP_CAPABILITIES, APP_DEPLOY_KEY_PATTERN, APP_DEPLOY_KEY_PREFIX, APP_EVENTS_MAX, APP_EVENT_SCOPES, APP_EVENT_TYPES, APP_HANDLE_PATTERN, APP_ICON_CONTENT_TYPES, APP_ICON_MAX_BYTES, APP_ICON_MIN_PX, APP_LIFECYCLE_EVENT_TYPES, APP_NETWORK_DENIED_SUFFIXES, APP_NETWORK_HOSTS_MAX, APP_README_MAX_BYTES, APP_RESERVED_HANDLES, APP_SECRETS_MAX, APP_SECRET_NAME_PATTERN, APP_SECRET_PATTERNS, APP_SERVER_BUNDLE_MAX_GZIP_BYTES, APP_SETTINGS_MAX_FIELDS, APP_SETTING_FIELD_TYPES, APP_SETTING_KEY_PATTERN, APP_UI_MAX_BYTES, APP_UI_MAX_FILES, ApiError, ApprovalPendingError, BRAND_BRIEF_MAX_REFERENCES, BUSINESS_INFO_MAX_LENGTH, BUSINESS_NUMBER_PATTERN, CASH_RECEIPT_STATUS_VALUES, COLLECTION_BEST_SELLING_DAYS, COLLECTION_PREVIEW_SIZE, COLLECTION_PRODUCT_SORTS, COLLECTION_SALES_SORT_DEFAULT_DAYS, COLLECTION_SLUG_PATTERN, COLLECTION_TYPES, COUPON_CODE_PATTERN, COUPON_CONDITIONS_DEFAULTS, COUPON_TARGET_ALL, COUPON_TARGET_LIST_MAX, CUSTOM_INPUT_FORBIDDEN_WORDS, CUSTOM_INPUT_TYPES, FULFILLMENT_METHODS, FULFILLMENT_METHODS_BY_TYPE, FULFILLMENT_METHOD_RULES, FULFILLMENT_RULES, INSTALLABLE_SCOPES, KNOWN_WEBHOOK_EVENT_TYPES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_CALENDAR_DAYS, MAX_COLLECTIONS, MAX_COLLECTION_BEST_SELLING_TOP, MAX_COLLECTION_CREATED_WITHIN_DAYS, MAX_COLLECTION_DESCRIPTION, MAX_COLLECTION_PRODUCTS, MAX_COLLECTION_PRODUCTS_PER_ADD, MAX_COLLECTION_RULES, MAX_COLLECTION_RULE_CATEGORIES, MAX_COLLECTION_TITLE, MAX_CUSTOM_INPUTS, MAX_CUSTOM_INPUT_LENGTH, MAX_OPTION_GROUPS, MAX_PICKUP_LOCATIONS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_STAY_NIGHTS, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NON_INSTALLABLE_SCOPES, NO_COUPON_SETTLEMENT, NO_SHIPPING_BUNDLE_KEY, PAYMENT_ROUTING_EXCLUSION_CODES, POINT_ADJUSTMENT_MAX, POINT_EARN_RATE_BP_MAX, POINT_ENTRY_TYPES, POINT_EXPIRY_DAYS_MAX, POINT_EXPIRY_DAYS_MIN, POINT_LOT_SOURCES, POINT_POLICY_DEFAULTS, POINT_REVIEW_REWARD_MAX, POINT_USE_UNITS, 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, SCOPE_DESCRIPTIONS, SHIPPING_POLICY_DEFAULTS, STARTER_SELLER_TASKS, STARTER_STAGES, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_CLOSED_SITE_HOLD_DAYS, 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_SHOWCASE_SLUG_PREFIX, 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, TEMPLATE_STORE_LOCKED_BUSINESS_FIELDS, 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, apiLogErrorSchema, apiLogListQuerySchema, apiLogPageSchema, apiLogPrincipalSchema, apiLogPrincipalTypeSchema, apiLogSchema, apiLogStatusFilterSchema, apiLogSummarySchema, appArtifactUploadSchema, appBuildSchema, appBuildStageSchema, appCapabilitiesOf, appDeployKeyCreateSchema, appDeployKeyCreatedSchema, appDeployKeySchema, appDevTokenSchema, appDistributionSchema, appEventTypeSchema, appHandleSchema, appIconProblem, appInstallRequestSchema, appInstallationActivitySchema, appInstallationAppSchema, appInstallationRunSchema, appInstallationSchema, appInstallationSelfSchema, appInstallationSettingsSchema, appInstallationSettingsUpdateSchema, appInstallationStatusSchema, appInvocationSchema, appListingSchema, appManifestProblems, appManifestSchema, appManifestWidens, appNetworkHostProblem, appNetworkHostSchema, appReleaseResultSchema, appRuntimeSchema, appScopeSchema, appSecretSummarySchema, appSessionSchema, appSettingFieldSchema, appStatusSchema, appVersionSchema, appVersionStatusSchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, bestSellingRuleOf, brandBriefProductSourceSchema, brandBriefReferenceSchema, brandBriefSchema, brandBriefViewSchema, buildAuthorizeUrl, buildQuery, bulkResultSchema, businessInfoPatchShape, businessInfoResponseShape, businessNumberSchema, calendarDateSchema, calendarDaySchema, calendarQuerySchema, 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, collectionCreateRequestSchema, collectionListQuerySchema, collectionPageSchema, collectionPatchRequestSchema, collectionPreviewRequestSchema, collectionPreviewSchema, collectionProductListQuerySchema, collectionProductSchema, collectionProductSortRequestSchema, collectionProductsAddRequestSchema, collectionProductsReplaceRequestSchema, collectionRuleCategoryIds, collectionRuleSchema, collectionRuleViewSchema, collectionRulesPredicate, collectionRulesSchema, collectionSchema, collectionStateCountsSchema, collectionStateOf, collectionStateSchema, commerceFlowCheckSchema, commerceFlowSchema, commerceFlowSummarySchema, commerceFlowVersionViewSchema, commerceNumberField, compareBySales, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createCommerceFlowRequestSchema, createCouponRequestSchema, createPkcePair, createStoreClient, createStoreSession, createStorefrontEditPreviewLinkRequestSchema, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, createStorefrontVersionRequestSchema, customInputLabelForbiddenWord, customInputRequestSchema, customInputSchema, customInputValueSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDelegationRequestSchema, customerDelegationSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerPointsSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, defaultFulfillmentMethodOf, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, descendantCategoryIdsOf, describeScope, devStoreSchema, developerAppCreateSchema, developerAppSchema, developerInstallationSchema, developerOrgSchema, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, flowActionRequestSchema, flowActionResultSchema, flowActionSchema, flowFieldValueSchema, flowInputFieldSchema, flowNodeTypesSchema, flowNotificationWebhookEventDataSchema, flowNotificationWebhookEventSchema, flowPresetDetailSchema, flowPresetSummarySchema, flowRunSchema, flowRunStepSchema, flowSecretNameSchema, flowSecretSchema, flowStateChangedWebhookEventDataSchema, flowStateChangedWebhookEventSchema, flowStateSchema, formatOrderNo, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentMethodOf, fulfillmentMethodSchema, fulfillmentMethodsOf, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, inventoryModeSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isEditableStorefrontPath, isInstallableScope, isReservedStoreCode, isReservedStorefrontSlug, isShowcaseStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, matchesCollectionRules, mcpRuleResultSchema, mcpToolEventSchema, migrateFlowVersionRequestSchema, migrateFlowVersionResultSchema, moveFlowStateRequestSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, nightsOf, normalizeBusinessNumber, normalizeCouponCode, normalizeStorefrontHostname, normalizeStorefrontPath, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFlowActionResultSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFlowSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, parseOrderNo, parseWebhookEvent, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentFailureWarningSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderSchema, pgVerificationResultSchema, pickupLocationRequestSchema, pickupLocationSchema, pickupLocationSnapshotSchema, planCodeSchema, planEntitlementsSchema, planErrorDetailsSchema, pointAdjustmentRequestSchema, pointAdjustmentResultSchema, pointEarnOf, pointEarnRateBpSchema, pointEarningEnabled, pointEntrySchema, pointExpiresAtOf, pointHistoryQuerySchema, pointLotSchema, pointPolicyNoticeSchema, pointPolicySchema, pointRestoreExpiresAtOf, pointUseOf, pointUsePolicySchema, 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, proratedPointRefund, proratedRefundBase, publicPlanSchema, publicPlansSchema, publishStorefrontVersionRequestSchema, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, purchaseEarnPolicySchema, purchaseEarnRateOf, putBrandBriefRequestSchema, quoteDelivery, quotePricing, rankBestSelling, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, replaceStorefrontSourceRequestSchema, replayFlowRequestSchema, replayFlowResultSchema, requiresCollection, requiresShipping, resolvePointPolicy, resolveRefundPolicy, resolveShippingPolicy, resolvedFlowSchema, responsePlanCodeSchema, responsePointEntryTypeSchema, reviewListQuerySchema, reviewReportResultSchema, reviewRewardPointOf, reviewRewardPolicySchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveFlowDraftRequestSchema, saveFlowSecretRequestSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, scopesCoverEvent, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCancelPreviewSchema, sellerCustomerInquirySchema, setCalendarRequestSchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, simulateFlowRequestSchema, simulateFlowResultSchema, simulationStepSchema, splitRefund, starterSellerTaskSchema, starterStageSchema, starterStatusSchema, starterStoreInfoFieldSchema, stayRangeSchema, staySnapshotSchema, storeAppDetailSchema, storeAppSchema, storeCodeSchema, storeIndustrySchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storePointPolicySchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeSubscriptionSchema, storeTemplateSchema, 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, storefrontSiteSnapshotSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceArchivePartSchema, storefrontSourceArchiveQuerySchema, storefrontSourceBlobsResultSchema, storefrontSourceModeSchema, storefrontSourceRefSchema, storefrontSourceReplacedSchema, storefrontSourceSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, subscriptionLimitsSchema, subscriptionStatusSchema, subscriptionUsageSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, unknownWebhookEventSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updatePointPolicyRequestSchema, updateStoreRequestSchema, updateStoreTemplateRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadStorefrontSourceBlobsRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, 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 };
9571
+ export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, APP_CAPABILITIES, APP_DEPLOY_KEY_PATTERN, APP_DEPLOY_KEY_PREFIX, APP_EVENTS_MAX, APP_EVENT_SCOPES, APP_EVENT_TYPES, APP_FLOW_EVENT_PATTERN, APP_FLOW_ITEMS_MAX, APP_FLOW_NOTIFICATION_PATTERN, APP_HANDLE_PATTERN, APP_HTTP_KEY_PATTERN, APP_ICON_CONTENT_TYPES, APP_ICON_MAX_BYTES, APP_ICON_MIN_PX, APP_LIFECYCLE_EVENT_TYPES, APP_NETWORK_DENIED_SUFFIXES, APP_NETWORK_HOSTS_MAX, APP_PUBLIC_HTTP_MAX, APP_README_MAX_BYTES, APP_RESERVED_HANDLES, APP_SCHEDULES_MAX, APP_SCHEDULE_INTERVALS, APP_SCHEDULE_NAME_PATTERN, APP_SECRETS_MAX, APP_SECRET_NAME_PATTERN, APP_SECRET_PATTERNS, APP_SERVER_BUNDLE_MAX_GZIP_BYTES, APP_SETTINGS_MAX_FIELDS, APP_SETTING_FIELD_TYPES, APP_SETTING_KEY_PATTERN, APP_STORAGE_KEY_PATTERN, APP_STORAGE_MAX_BYTES, APP_STORAGE_MAX_KEYS, APP_TOOL_NAME_PATTERN, APP_UI_MAX_BYTES, APP_UI_MAX_FILES, ApiError, ApprovalPendingError, BRAND_BRIEF_MAX_REFERENCES, BUSINESS_INFO_MAX_LENGTH, BUSINESS_NUMBER_PATTERN, CASH_RECEIPT_STATUS_VALUES, COLLECTION_BEST_SELLING_DAYS, COLLECTION_PREVIEW_SIZE, COLLECTION_PRODUCT_SORTS, COLLECTION_SALES_SORT_DEFAULT_DAYS, COLLECTION_SLUG_PATTERN, COLLECTION_TYPES, COUPON_CODE_PATTERN, COUPON_CONDITIONS_DEFAULTS, COUPON_TARGET_ALL, COUPON_TARGET_LIST_MAX, CUSTOM_INPUT_FORBIDDEN_WORDS, CUSTOM_INPUT_TYPES, FULFILLMENT_METHODS, FULFILLMENT_METHODS_BY_TYPE, FULFILLMENT_METHOD_RULES, FULFILLMENT_RULES, INSTALLABLE_SCOPES, KNOWN_WEBHOOK_EVENT_TYPES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_CALENDAR_DAYS, MAX_COLLECTIONS, MAX_COLLECTION_BEST_SELLING_TOP, MAX_COLLECTION_CREATED_WITHIN_DAYS, MAX_COLLECTION_DESCRIPTION, MAX_COLLECTION_PRODUCTS, MAX_COLLECTION_PRODUCTS_PER_ADD, MAX_COLLECTION_RULES, MAX_COLLECTION_RULE_CATEGORIES, MAX_COLLECTION_TITLE, MAX_CUSTOM_INPUTS, MAX_CUSTOM_INPUT_LENGTH, MAX_OPTION_GROUPS, MAX_PICKUP_LOCATIONS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_STAY_NIGHTS, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NON_INSTALLABLE_SCOPES, NO_COUPON_SETTLEMENT, NO_SHIPPING_BUNDLE_KEY, PAYMENT_ROUTING_EXCLUSION_CODES, POINT_ADJUSTMENT_MAX, POINT_EARN_RATE_BP_MAX, POINT_ENTRY_TYPES, POINT_EXPIRY_DAYS_MAX, POINT_EXPIRY_DAYS_MIN, POINT_LOT_SOURCES, POINT_POLICY_DEFAULTS, POINT_REVIEW_REWARD_MAX, POINT_USE_UNITS, 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, SCOPE_DESCRIPTIONS, SHIPPING_POLICY_DEFAULTS, STARTER_SELLER_TASKS, STARTER_STAGES, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_CLOSED_SITE_HOLD_DAYS, 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_SHOWCASE_SLUG_PREFIX, 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, TEMPLATE_STORE_LOCKED_BUSINESS_FIELDS, 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, apiLogErrorSchema, apiLogListQuerySchema, apiLogPageSchema, apiLogPrincipalSchema, apiLogPrincipalTypeSchema, apiLogSchema, apiLogStatusFilterSchema, apiLogSummarySchema, appArtifactUploadSchema, appBuildSchema, appBuildStageSchema, appCapabilitiesOf, appDeployKeyCreateSchema, appDeployKeyCreatedSchema, appDeployKeySchema, appDevTokenSchema, appDistributionSchema, appEventTypeSchema, appFlowEventSchema, appFlowEventSummarySchema, appFlowNotificationSchema, appFlowNotificationSummarySchema, appFlowParamSchema, appFlowSummaryOf, appHandleSchema, appHttpKeyMatches, appIconProblem, appInstallRequestSchema, appInstallationActivitySchema, appInstallationAppSchema, appInstallationRunSchema, appInstallationSchema, appInstallationSelfSchema, appInstallationSettingsSchema, appInstallationSettingsUpdateSchema, appInstallationStatusSchema, appInvocationSchema, appListingReviewSchema, appListingReviewStatusSchema, appListingSchema, appManifestProblems, appManifestSchema, appManifestWidens, appNetworkHostProblem, appNetworkHostSchema, appReleaseResultSchema, appRuntimeSchema, appScheduleIntervalLabel, appScheduleListOf, appScheduleSummarySchema, appScopeSchema, appSecretSummarySchema, appSessionSchema, appSettingFieldSchema, appStatusSchema, appStorageEntrySchema, appStorageKeysSchema, appStorageListQuerySchema, appStoragePutSchema, appToolCallSchema, appToolInputSchema, appToolListOf, appToolResultSchema, appToolSchema, appToolSummarySchema, appVersionSchema, appVersionStatusSchema, appVisibilitySchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, bestSellingRuleOf, brandBriefProductSourceSchema, brandBriefReferenceSchema, brandBriefSchema, brandBriefViewSchema, buildAuthorizeUrl, buildQuery, bulkResultSchema, businessInfoPatchShape, businessInfoResponseShape, businessNumberSchema, calendarDateSchema, calendarDaySchema, calendarQuerySchema, 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, collectionCreateRequestSchema, collectionListQuerySchema, collectionPageSchema, collectionPatchRequestSchema, collectionPreviewRequestSchema, collectionPreviewSchema, collectionProductListQuerySchema, collectionProductSchema, collectionProductSortRequestSchema, collectionProductsAddRequestSchema, collectionProductsReplaceRequestSchema, collectionRuleCategoryIds, collectionRuleSchema, collectionRuleViewSchema, collectionRulesPredicate, collectionRulesSchema, collectionSchema, collectionStateCountsSchema, collectionStateOf, collectionStateSchema, commerceFlowCheckSchema, commerceFlowSchema, commerceFlowSummarySchema, commerceFlowVersionViewSchema, commerceNumberField, compareBySales, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createCommerceFlowRequestSchema, createCouponRequestSchema, createPkcePair, createStoreClient, createStoreSession, createStorefrontEditPreviewLinkRequestSchema, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, createStorefrontVersionRequestSchema, customInputLabelForbiddenWord, customInputRequestSchema, customInputSchema, customInputValueSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDelegationRequestSchema, customerDelegationSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerPointsSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, defaultFulfillmentMethodOf, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, descendantCategoryIdsOf, describeScope, devStoreSchema, developerAppCreateSchema, developerAppSchema, developerInstallationSchema, developerOrgSchema, developerStoreSchema, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, flowActionRequestSchema, flowActionResultSchema, flowActionSchema, flowFieldValueSchema, flowInputFieldSchema, flowNodeTypesSchema, flowNotificationWebhookEventDataSchema, flowNotificationWebhookEventSchema, flowPresetDetailSchema, flowPresetSummarySchema, flowRunSchema, flowRunStepSchema, flowSecretNameSchema, flowSecretSchema, flowStateChangedWebhookEventDataSchema, flowStateChangedWebhookEventSchema, flowStateSchema, formatOrderNo, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentMethodOf, fulfillmentMethodSchema, fulfillmentMethodsOf, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, inventoryModeSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isEditableStorefrontPath, isInstallableScope, isReservedStoreCode, isReservedStorefrontSlug, isShowcaseStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, matchesCollectionRules, mcpRuleResultSchema, mcpToolEventSchema, migrateFlowVersionRequestSchema, migrateFlowVersionResultSchema, moveFlowStateRequestSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, nightsOf, normalizeBusinessNumber, normalizeCouponCode, normalizeStorefrontHostname, normalizeStorefrontPath, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFlowActionResultSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFlowSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, parseOrderNo, parseWebhookEvent, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentFailureWarningSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderSchema, pgVerificationResultSchema, pickupLocationRequestSchema, pickupLocationSchema, pickupLocationSnapshotSchema, planCodeSchema, planEntitlementsSchema, planErrorDetailsSchema, pointAdjustmentRequestSchema, pointAdjustmentResultSchema, pointEarnOf, pointEarnRateBpSchema, pointEarningEnabled, pointEntrySchema, pointExpiresAtOf, pointHistoryQuerySchema, pointLotSchema, pointPolicyNoticeSchema, pointPolicySchema, pointRestoreExpiresAtOf, pointUseOf, pointUsePolicySchema, 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, proratedPointRefund, proratedRefundBase, publicPlanSchema, publicPlansSchema, publishStorefrontVersionRequestSchema, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, purchaseEarnPolicySchema, purchaseEarnRateOf, putBrandBriefRequestSchema, quoteDelivery, quotePricing, rankBestSelling, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, replaceStorefrontSourceRequestSchema, replayFlowRequestSchema, replayFlowResultSchema, requiresCollection, requiresShipping, resolvePointPolicy, resolveRefundPolicy, resolveShippingPolicy, resolvedFlowSchema, responsePlanCodeSchema, responsePointEntryTypeSchema, reviewListQuerySchema, reviewReportResultSchema, reviewRewardPointOf, reviewRewardPolicySchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveFlowDraftRequestSchema, saveFlowSecretRequestSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, scopesCoverEvent, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCancelPreviewSchema, sellerCustomerInquirySchema, setCalendarRequestSchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, simulateFlowRequestSchema, simulateFlowResultSchema, simulationStepSchema, splitRefund, starterSellerTaskSchema, starterStageSchema, starterStatusSchema, starterStoreInfoFieldSchema, stayRangeSchema, staySnapshotSchema, storeAppDetailSchema, storeAppSchema, storeCodeSchema, storeIndustrySchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storePointPolicySchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeSubscriptionSchema, storeTemplateSchema, 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, storefrontSiteSnapshotSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceArchivePartSchema, storefrontSourceArchiveQuerySchema, storefrontSourceBlobsResultSchema, storefrontSourceModeSchema, storefrontSourceRefSchema, storefrontSourceReplacedSchema, storefrontSourceSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, subscriptionLimitsSchema, subscriptionStatusSchema, subscriptionUsageSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, unknownWebhookEventSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updatePointPolicyRequestSchema, updateStoreRequestSchema, updateStoreTemplateRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadStorefrontSourceBlobsRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, writeDryRunResultSchema, writePreviewSchema, writeStorefrontFilesRequestSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayren/store-sdk",
3
- "version": "0.30.11",
3
+ "version": "0.30.13",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
package/src/client.ts CHANGED
@@ -29,6 +29,10 @@ import {
29
29
  appInstallationSettingsUpdateSchema,
30
30
  appInstallRequestSchema,
31
31
  appSessionSchema,
32
+ appStorageEntrySchema,
33
+ appStorageKeysSchema,
34
+ appToolResultSchema,
35
+ appToolSummarySchema,
32
36
  storeAppDetailSchema,
33
37
  storeAppSchema,
34
38
  } from "./schemas/apps";
@@ -856,11 +860,12 @@ export function createStoreClient(options: StoreClientOptions) {
856
860
  ),
857
861
  /**
858
862
  * `POST /order-items/{id}/events/{key}` — 현장 단말·연동의 상점 사건(`custom.<이름>`)을 플로우에 넣는다(#115).
859
- * 에러: 400 `FLOW_EVENT_KEY_INVALID`, 409 `FLOW_EVENT_NOT_ACCEPTED`
863
+ * 앱 사건(`app.<handle>.<이름>`, #22)은 그 앱의 설치 토큰으로만 보낸다(`ctx.api`).
864
+ * 에러: 400 `FLOW_EVENT_KEY_INVALID`, 403 `FLOW_EVENT_APP_FORBIDDEN`, 409 `FLOW_EVENT_NOT_ACCEPTED`
860
865
  */
861
866
  emitEvent: (
862
867
  orderItemId: string,
863
- key: `custom.${string}`,
868
+ key: `custom.${string}` | `app.${string}`,
864
869
  input: Record<string, unknown> = {},
865
870
  idempotencyKey?: string,
866
871
  ) =>
@@ -1434,6 +1439,17 @@ export function createStoreClient(options: StoreClientOptions) {
1434
1439
  },
1435
1440
 
1436
1441
  /** 설치 앱(#22, 매뉴얼 「앱 설치와 관리 › 관리 API」) — 설치·설정·제거·세션은 상점 플랫폼 OWNER·ADMIN만 */
1442
+ /** 에이전트 도구(#22 「에이전트 도구」) — 설치된 앱이 제공하는 도구 목록·실행. 실행은 OWNER·ADMIN */
1443
+ appTools: {
1444
+ list: () => storeHttp.request("GET", "/apps/tools", z.array(appToolSummarySchema)),
1445
+ call: (installationId: string, name: string, input: Record<string, unknown> = {}) =>
1446
+ storeHttp.request(
1447
+ "POST",
1448
+ path`/apps/installations/${installationId}/tools/${name}`,
1449
+ appToolResultSchema,
1450
+ { body: { input } },
1451
+ ),
1452
+ },
1437
1453
  apps: {
1438
1454
  /** 이 상점에 설치할 수 있는 앱 — 앱 목록·상세(아이콘·README·Scope·Hook·설정 필드) */
1439
1455
  catalog: {
@@ -1496,6 +1512,20 @@ export function createStoreClient(options: StoreClientOptions) {
1496
1512
  /** 앱 설치 토큰 전용 — 자기 설치 */
1497
1513
  app: {
1498
1514
  installation: () => storeHttp.request("GET", "/app/installation", appInstallationSelfSchema),
1515
+ /** 설치 저장소(`ctx.storage`) — 없는 키는 404 `APP_STORAGE_KEY_NOT_FOUND`, 한도 초과는 409 `APP_STORAGE_LIMIT` */
1516
+ storage: {
1517
+ list: (params: { prefix?: string } = {}) =>
1518
+ storeHttp.request("GET", "/app/storage", appStorageKeysSchema, {
1519
+ query: params as unknown as Query,
1520
+ }),
1521
+ get: (key: string) =>
1522
+ storeHttp.request("GET", path`/app/storage/${key}`, appStorageEntrySchema),
1523
+ set: (key: string, value: unknown) =>
1524
+ storeHttp.request("PUT", path`/app/storage/${key}`, appStorageEntrySchema, {
1525
+ body: { value },
1526
+ }),
1527
+ delete: (key: string) => storeHttp.requestVoid("DELETE", path`/app/storage/${key}`),
1528
+ },
1499
1529
  },
1500
1530
 
1501
1531
  webhooks: {