@sayren/store-sdk 0.30.11 → 0.30.12

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,23 @@ 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
+ const APP_SCHEDULE_INTERVAL_KEYS = Object.keys(APP_SCHEDULE_INTERVALS);
2645
2662
  /** 앱 목록에 보이는 아이콘·README(#22 앱 목록 시안) — 앱 폴더의 파일을 `sayren app deploy`가 버전과 함께 올린다 */
2646
2663
  const APP_ICON_MAX_BYTES = 262144;
2647
2664
  const APP_ICON_MIN_PX = 512;
@@ -2694,6 +2711,10 @@ const appManifestSchema = z.strictObject({
2694
2711
  ui: z.strictObject({
2695
2712
  /** 상점 플랫폼 앱 화면(iframe) — 정적 SPA 진입 파일 */
2696
2713
  adminPage: z.strictObject({ entry: z.string().regex(/^ui\/[A-Za-z0-9._/-]+\.html$/) }) }).optional(),
2714
+ /** 공개 HTTP — 여기 적은 핸들러만 `https://{handle}.{앱 도메인}/hooks/{설치 id}/…`로 외부에서 부를 수 있다 */
2715
+ http: z.strictObject({ public: z.array(z.string().regex(APP_HTTP_KEY_PATTERN)).max(20) }).optional(),
2716
+ /** 예약 작업 — 이름마다 실행 간격 */
2717
+ 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({}),
2697
2718
  settings: z.record(z.string().regex(APP_SETTING_KEY_PATTERN), appSettingFieldSchema).refine((fields) => Object.keys(fields).length <= 30, { message: `설정 필드는 30개까지입니다` }).default({}),
2698
2719
  /** 개발자 비밀 값 이름 — 값은 CLI(`sayren app secret put`)로 따로 넣는다 */
2699
2720
  secrets: z.array(z.string().regex(APP_SECRET_NAME_PATTERN)).max(20).default([])
@@ -2727,6 +2748,7 @@ function appManifestProblems(manifest) {
2727
2748
  unique(manifest.events, "events", "이벤트");
2728
2749
  unique(manifest.network.hosts, "network.hosts", "호스트");
2729
2750
  unique(manifest.secrets, "secrets", "비밀 값 이름");
2751
+ unique(manifest.http?.public ?? [], "http.public", "공개 HTTP 핸들러");
2730
2752
  for (const event of manifest.events) if (!scopesCoverEvent(manifest.scopes, event)) problems.push({
2731
2753
  path: `events.${event}`,
2732
2754
  code: "EVENT_SCOPE_MISSING",
@@ -2762,6 +2784,8 @@ function appCapabilitiesOf(manifest) {
2762
2784
  events: sorted(manifest.events),
2763
2785
  networkHosts: sorted(manifest.network.hosts),
2764
2786
  adminPage: Boolean(manifest.ui?.adminPage),
2787
+ publicHttp: sorted(manifest.http?.public ?? []),
2788
+ schedules: Object.fromEntries(Object.entries(manifest.schedules).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([name, schedule]) => [name, schedule.every])),
2765
2789
  requiredSettings: Object.entries(manifest.settings).filter(([, field]) => field.required).map(([key]) => key).sort(),
2766
2790
  secretSettings: Object.entries(manifest.settings).filter(([, field]) => field.secret).map(([key]) => key).sort()
2767
2791
  };
@@ -2799,8 +2823,46 @@ const APP_CAPABILITIES = [
2799
2823
  title: "상점 플랫폼 화면",
2800
2824
  describe: (c) => c.adminPage ? ["상점 플랫폼에 이 앱의 화면을 더합니다"] : [],
2801
2825
  widens: (p, n) => !p.adminPage && n.adminPage
2826
+ },
2827
+ {
2828
+ key: "publicHttp",
2829
+ title: "외부에서 이 앱을 부르는 주소",
2830
+ describe: (c) => c.publicHttp ?? [],
2831
+ widens: (p, n) => grew(p.publicHttp ?? [], n.publicHttp ?? [])
2832
+ },
2833
+ {
2834
+ key: "schedules",
2835
+ title: "주기적으로 실행되는 작업",
2836
+ describe: (c) => Object.entries(c.schedules ?? {}).map(([name, every]) => `${name} · ${appScheduleIntervalLabel(every)}마다`),
2837
+ widens: (p, n) => {
2838
+ const previous = p.schedules ?? {};
2839
+ return Object.entries(n.schedules ?? {}).some(([name, every]) => !previous[name] || APP_SCHEDULE_INTERVALS[every] < APP_SCHEDULE_INTERVALS[previous[name]]);
2840
+ }
2802
2841
  }
2803
2842
  ];
2843
+ /** 요청(메서드·경로)이 HTTP 핸들러 키에 맞는가 — `:이름`은 경로 한 마디에 맞는다(`@sayren/app`의 핸들러 고르기와 같은 규칙) */
2844
+ function appHttpKeyMatches(key, method, path) {
2845
+ const match = APP_HTTP_KEY_PATTERN.exec(key.trim().replace(/\s+/g, " "));
2846
+ if (!match || match[1] !== method.toUpperCase()) return false;
2847
+ const pattern = match[2].split("/");
2848
+ const actual = (path.split("?")[0] ?? path).split("/");
2849
+ if (pattern.length !== actual.length) return false;
2850
+ return pattern.every((part, i) => part.startsWith(":") ? actual[i] !== "" : part === actual[i]);
2851
+ }
2852
+ /** 응답용 예약 작업 목록(이름순) — 옛 버전 행(`schedules` 없음)은 빈 목록 */
2853
+ function appScheduleListOf(capabilities) {
2854
+ return Object.entries(capabilities.schedules ?? {}).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([name, every]) => ({
2855
+ name,
2856
+ every
2857
+ }));
2858
+ }
2859
+ /** 예약 간격의 표시 이름 — 동의 화면·상점 플랫폼이 같이 쓴다 */
2860
+ function appScheduleIntervalLabel(every) {
2861
+ const minutes = APP_SCHEDULE_INTERVALS[every];
2862
+ if (minutes < 60) return `${minutes}분`;
2863
+ if (minutes < 1440) return `${minutes / 60}시간`;
2864
+ return "하루";
2865
+ }
2804
2866
  /** 재동의가 필요한 capability 키 — 비어 있으면 release가 모든 설치에 곧바로 반영된다 */
2805
2867
  function appManifestWidens(previous, next) {
2806
2868
  return APP_CAPABILITIES.filter((c) => c.widens(previous, next)).map((c) => c.key);
@@ -3131,6 +3193,12 @@ const appInstallationStatusSchema = z.enum([
3131
3193
  "SUSPENDED"
3132
3194
  ]);
3133
3195
  /** 설치 앱의 앱 정보 — 상점이 보는 범위만(개발자 비밀 값·소스·빌드는 없다) */
3196
+ /** 상점이 보는 앱 공개 범위 — 개발 중(개발자 조직) · 이 상점 전용 · 공개 */
3197
+ const appVisibilitySchema = z.enum([
3198
+ "DEVELOPMENT",
3199
+ "PRIVATE",
3200
+ "PUBLIC"
3201
+ ]);
3134
3202
  const appInstallationAppSchema = z.object({
3135
3203
  appId: z.string(),
3136
3204
  handle: z.string().describe("앱 handle. 앱 화면 주소의 라벨"),
@@ -3159,6 +3227,21 @@ const appInstallationSettingsSchema = z.object({
3159
3227
  });
3160
3228
  /** 설정 저장 — 비밀 필드를 생략하면 현재 값을 유지한다. null은 비운다 */
3161
3229
  const appInstallationSettingsUpdateSchema = z.object({ values: z.record(z.string(), settingsValueSchema) });
3230
+ /** 예약 작업 한 줄 — 매니페스트 `schedules`의 이름과 간격 */
3231
+ const appScheduleSummarySchema = z.object({
3232
+ name: z.string(),
3233
+ every: z.enum([
3234
+ "15m",
3235
+ "30m",
3236
+ "1h",
3237
+ "3h",
3238
+ "6h",
3239
+ "12h",
3240
+ "1d"
3241
+ ])
3242
+ });
3243
+ const publicHttpField = z.array(z.string()).default([]).describe("외부에서 부를 수 있는 HTTP 핸들러(`GET /track/:id`)");
3244
+ const schedulesField = z.array(appScheduleSummarySchema).default([]).describe("주기적으로 실행되는 작업");
3162
3245
  const appInstallationSchema = z.object({
3163
3246
  installationId: z.string(),
3164
3247
  storeId: z.string(),
@@ -3170,12 +3253,16 @@ const appInstallationSchema = z.object({
3170
3253
  number: z.number().int(),
3171
3254
  scopes: z.array(z.string()),
3172
3255
  networkHosts: z.array(z.string()),
3173
- events: z.array(appEventTypeSchema)
3256
+ events: z.array(appEventTypeSchema),
3257
+ publicHttp: publicHttpField,
3258
+ schedules: schedulesField
3174
3259
  }).nullable().optional().describe("재동의가 필요한 새 버전이 요청하는 권한·외부 호스트·이벤트(전체). 없으면 null"),
3175
3260
  grantedScopes: z.array(z.string()).describe("동의한 스코프"),
3176
3261
  grantedNetworkHosts: z.array(z.string()).describe("동의한 외부 호출 호스트"),
3177
3262
  events: z.array(appEventTypeSchema).describe("이 설치가 받는 이벤트"),
3178
3263
  adminPage: z.boolean().describe("상점 플랫폼 앱 화면이 있는가"),
3264
+ publicHttp: publicHttpField,
3265
+ schedules: schedulesField,
3179
3266
  /** 설치 결과의 캐시가 아니라 실행 버전 매니페스트의 요약 */
3180
3267
  settings: appInstallationSettingsSchema,
3181
3268
  installedBy: z.object({
@@ -3226,7 +3313,8 @@ const storeAppSchema = z.object({
3226
3313
  iconUrl: z.string().nullable(),
3227
3314
  developerName: z.string(),
3228
3315
  versionNumber: z.number().int().describe("현재 버전"),
3229
- installationId: z.string().nullable().describe("이 상점에 설치돼 있으면 설치 id")
3316
+ installationId: z.string().nullable().describe("이 상점에 설치돼 있으면 설치 id"),
3317
+ visibility: appVisibilitySchema.default("DEVELOPMENT").describe("공개 범위 — 개발 중(심사 전) · 이 상점 전용 · 공개(심사 통과)")
3230
3318
  });
3231
3319
  /** `GET /v1/apps/catalog/{appId}` — 앱 상세·설치 화면 */
3232
3320
  const storeAppDetailSchema = storeAppSchema.extend({
@@ -3235,6 +3323,8 @@ const storeAppDetailSchema = storeAppSchema.extend({
3235
3323
  scopes: z.array(z.string()).describe("설치 때 동의하는 스코프(Scope)"),
3236
3324
  events: z.array(appEventTypeSchema).describe("받는 이벤트(Hook)"),
3237
3325
  networkHosts: z.array(z.string()).describe("앱이 데이터를 보내는 외부 호스트"),
3326
+ publicHttp: publicHttpField,
3327
+ schedules: schedulesField,
3238
3328
  settings: z.record(z.string(), appSettingFieldSchema).describe("설치 때 채우는 설정 필드"),
3239
3329
  updatedAt: z.string().nullable().describe("현재 버전을 release한 시각")
3240
3330
  });
@@ -3254,6 +3344,19 @@ const appInstallationSelfSchema = z.object({
3254
3344
  grantedScopes: z.array(z.string()),
3255
3345
  installedAt: z.string()
3256
3346
  });
3347
+ /** 설치 저장소(`ctx.storage`, 매뉴얼 「앱 코드 › 저장소」) — 설치 토큰 전용 */
3348
+ const APP_STORAGE_KEY_PATTERN = /^[A-Za-z0-9._:-]{1,200}$/;
3349
+ const APP_STORAGE_MAX_KEYS = 1e3;
3350
+ /** 설치당 전체 크기(키 + JSON 값, UTF-8 바이트) */
3351
+ const APP_STORAGE_MAX_BYTES = 1048576;
3352
+ const appStorageEntrySchema = z.object({
3353
+ key: z.string(),
3354
+ value: z.unknown().describe("저장한 JSON 값"),
3355
+ updatedAt: z.string()
3356
+ });
3357
+ const appStorageKeysSchema = z.object({ keys: z.array(z.string()).describe("키 목록(이름순)") });
3358
+ const appStoragePutSchema = z.object({ value: z.unknown().refine((value) => value !== void 0, { message: "value가 필요합니다" }) });
3359
+ const appStorageListQuerySchema = z.object({ prefix: z.string().max(200).optional() });
3257
3360
  const developerOrgSchema = z.object({
3258
3361
  orgId: z.string(),
3259
3362
  name: z.string(),
@@ -3311,6 +3414,8 @@ const appVersionSchema = z.object({
3311
3414
  events: z.array(z.string()),
3312
3415
  networkHosts: z.array(z.string()),
3313
3416
  adminPage: z.boolean(),
3417
+ publicHttp: z.array(z.string()).optional(),
3418
+ schedules: z.record(z.string(), z.string()).optional(),
3314
3419
  requiredSettings: z.array(z.string()),
3315
3420
  secretSettings: z.array(z.string())
3316
3421
  }),
@@ -3320,6 +3425,20 @@ const appVersionSchema = z.object({
3320
3425
  revokedAt: z.string().nullable(),
3321
3426
  createdAt: z.string()
3322
3427
  });
3428
+ /** 앱 공개 심사(#22, 매뉴얼 「앱 공개 범위」) — 개발자가 신청하고 운영자가 승인·반려한다 */
3429
+ const appListingReviewStatusSchema = z.enum([
3430
+ "PENDING",
3431
+ "APPROVED",
3432
+ "REJECTED"
3433
+ ]);
3434
+ const appListingReviewSchema = z.object({
3435
+ reviewId: z.string(),
3436
+ status: appListingReviewStatusSchema,
3437
+ versionNumber: z.number().int().describe("신청 때 현재 버전"),
3438
+ reason: z.string().nullable().describe("반려 사유"),
3439
+ requestedAt: z.string(),
3440
+ reviewedAt: z.string().nullable()
3441
+ });
3323
3442
  const developerAppSchema = z.object({
3324
3443
  appId: z.string(),
3325
3444
  orgId: z.string(),
@@ -3333,6 +3452,8 @@ const developerAppSchema = z.object({
3333
3452
  status: appStatusSchema,
3334
3453
  suspendedReason: z.string().nullable(),
3335
3454
  currentVersionNumber: z.number().int().nullable(),
3455
+ privateStoreId: z.string().nullable().default(null).describe("비공개 앱이 묶인 상점. 개발 중·퍼블릭 앱은 null"),
3456
+ listingReview: appListingReviewSchema.nullable().default(null).describe("마지막 공개 신청. 없으면 null"),
3336
3457
  installations: z.object({
3337
3458
  active: z.number().int(),
3338
3459
  pendingReconsent: z.number().int()
@@ -3343,7 +3464,9 @@ const developerAppSchema = z.object({
3343
3464
  const developerAppCreateSchema = z.object({
3344
3465
  handle: appHandleSchema,
3345
3466
  name: z.string().trim().min(1).max(60),
3346
- description: z.string().trim().max(500).optional()
3467
+ description: z.string().trim().max(500).optional(),
3468
+ /** 비공개 앱 — 이 상점 하나에만 설치된다. 만드는 사람이 그 상점의 OWNER·ADMIN이어야 한다 */
3469
+ privateStoreId: z.string().min(1).optional()
3347
3470
  });
3348
3471
  /** `PUT /platform/v1/developer/apps/{appId}/versions` — CLI `app deploy`가 올리는 번들 */
3349
3472
  const appArtifactUploadSchema = z.object({
@@ -3391,6 +3514,13 @@ const devStoreSchema = z.object({
3391
3514
  ]),
3392
3515
  createdAt: z.string()
3393
3516
  });
3517
+ /** `GET /platform/v1/developer/stores` — 비공개 앱을 묶을 수 있는 상점(내가 소유자·관리자, 운영 중) */
3518
+ const developerStoreSchema = z.object({
3519
+ storeId: z.string(),
3520
+ name: z.string(),
3521
+ role: z.enum(["OWNER", "ADMIN"]),
3522
+ development: z.boolean().describe("개발 상점인가")
3523
+ });
3394
3524
  /** 개발자가 보는 설치 한 줄 */
3395
3525
  const developerInstallationSchema = z.object({
3396
3526
  installationId: z.string(),
@@ -8550,7 +8680,16 @@ get: (params) => storeHttp.request("GET", "/sales-report", salesReportSchema, {
8550
8680
  }
8551
8681
  },
8552
8682
  /** 앱 설치 토큰 전용 — 자기 설치 */
8553
- app: { installation: () => storeHttp.request("GET", "/app/installation", appInstallationSelfSchema) },
8683
+ app: {
8684
+ installation: () => storeHttp.request("GET", "/app/installation", appInstallationSelfSchema),
8685
+ /** 설치 저장소(`ctx.storage`) — 없는 키는 404 `APP_STORAGE_KEY_NOT_FOUND`, 한도 초과는 409 `APP_STORAGE_LIMIT` */
8686
+ storage: {
8687
+ list: (params = {}) => storeHttp.request("GET", "/app/storage", appStorageKeysSchema, { query: params }),
8688
+ get: (key) => storeHttp.request("GET", path`/app/storage/${key}`, appStorageEntrySchema),
8689
+ set: (key, value) => storeHttp.request("PUT", path`/app/storage/${key}`, appStorageEntrySchema, { body: { value } }),
8690
+ delete: (key) => storeHttp.requestVoid("DELETE", path`/app/storage/${key}`)
8691
+ }
8692
+ },
8554
8693
  webhooks: {
8555
8694
  list: () => storeHttp.request("GET", "/webhooks", z.array(webhookSchema)),
8556
8695
  /** 서명 시크릿 평문은 이 응답에서만 노출된다 */
@@ -9256,4 +9395,4 @@ function createStoreSession(options) {
9256
9395
  };
9257
9396
  }
9258
9397
  //#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 };
9398
+ 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_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_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, 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, 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.12",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
package/src/client.ts CHANGED
@@ -29,6 +29,8 @@ import {
29
29
  appInstallationSettingsUpdateSchema,
30
30
  appInstallRequestSchema,
31
31
  appSessionSchema,
32
+ appStorageEntrySchema,
33
+ appStorageKeysSchema,
32
34
  storeAppDetailSchema,
33
35
  storeAppSchema,
34
36
  } from "./schemas/apps";
@@ -1496,6 +1498,20 @@ export function createStoreClient(options: StoreClientOptions) {
1496
1498
  /** 앱 설치 토큰 전용 — 자기 설치 */
1497
1499
  app: {
1498
1500
  installation: () => storeHttp.request("GET", "/app/installation", appInstallationSelfSchema),
1501
+ /** 설치 저장소(`ctx.storage`) — 없는 키는 404 `APP_STORAGE_KEY_NOT_FOUND`, 한도 초과는 409 `APP_STORAGE_LIMIT` */
1502
+ storage: {
1503
+ list: (params: { prefix?: string } = {}) =>
1504
+ storeHttp.request("GET", "/app/storage", appStorageKeysSchema, {
1505
+ query: params as unknown as Query,
1506
+ }),
1507
+ get: (key: string) =>
1508
+ storeHttp.request("GET", path`/app/storage/${key}`, appStorageEntrySchema),
1509
+ set: (key: string, value: unknown) =>
1510
+ storeHttp.request("PUT", path`/app/storage/${key}`, appStorageEntrySchema, {
1511
+ body: { value },
1512
+ }),
1513
+ delete: (key: string) => storeHttp.requestVoid("DELETE", path`/app/storage/${key}`),
1514
+ },
1499
1515
  },
1500
1516
 
1501
1517
  webhooks: {
@@ -233,6 +233,28 @@ export const APP_SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
233
233
  export const APP_SECRETS_MAX = 20;
234
234
  export const APP_EVENTS_MAX = 50;
235
235
  export const APP_NETWORK_HOSTS_MAX = 20;
236
+ export const APP_PUBLIC_HTTP_MAX = 20;
237
+ export const APP_SCHEDULES_MAX = 10;
238
+
239
+ /** HTTP 핸들러 키 — `"<메서드> <경로>"`(`@sayren/app` `defineApp({ http })`와 같은 형식) */
240
+ export const APP_HTTP_KEY_PATTERN = /^(GET|POST|PUT|PATCH|DELETE) (\/[A-Za-z0-9._~:/-]*)$/;
241
+ /** 예약 작업 이름 — 설정 키와 같은 형식 */
242
+ export const APP_SCHEDULE_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]{0,39}$/;
243
+ /** 예약 작업 간격 → 분 */
244
+ export const APP_SCHEDULE_INTERVALS = {
245
+ "15m": 15,
246
+ "30m": 30,
247
+ "1h": 60,
248
+ "3h": 180,
249
+ "6h": 360,
250
+ "12h": 720,
251
+ "1d": 1440,
252
+ } as const;
253
+ export type AppScheduleInterval = keyof typeof APP_SCHEDULE_INTERVALS;
254
+ const APP_SCHEDULE_INTERVAL_KEYS = Object.keys(APP_SCHEDULE_INTERVALS) as [
255
+ AppScheduleInterval,
256
+ ...AppScheduleInterval[],
257
+ ];
236
258
 
237
259
  /** 앱 목록에 보이는 아이콘·README(#22 앱 목록 시안) — 앱 폴더의 파일을 `sayren app deploy`가 버전과 함께 올린다 */
238
260
  export const APP_ICON_MAX_BYTES = 256 * 1024;
@@ -299,6 +321,22 @@ export const appManifestSchema = z.strictObject({
299
321
  adminPage: z.strictObject({ entry: z.string().regex(/^ui\/[A-Za-z0-9._/-]+\.html$/) }),
300
322
  })
301
323
  .optional(),
324
+ /** 공개 HTTP — 여기 적은 핸들러만 `https://{handle}.{앱 도메인}/hooks/{설치 id}/…`로 외부에서 부를 수 있다 */
325
+ http: z
326
+ .strictObject({
327
+ public: z.array(z.string().regex(APP_HTTP_KEY_PATTERN)).max(APP_PUBLIC_HTTP_MAX),
328
+ })
329
+ .optional(),
330
+ /** 예약 작업 — 이름마다 실행 간격 */
331
+ schedules: z
332
+ .record(
333
+ z.string().regex(APP_SCHEDULE_NAME_PATTERN),
334
+ z.strictObject({ every: z.enum(APP_SCHEDULE_INTERVAL_KEYS) }),
335
+ )
336
+ .refine((schedules) => Object.keys(schedules).length <= APP_SCHEDULES_MAX, {
337
+ message: `예약 작업은 ${APP_SCHEDULES_MAX}개까지입니다`,
338
+ })
339
+ .default({}),
302
340
  settings: z
303
341
  .record(z.string().regex(APP_SETTING_KEY_PATTERN), appSettingFieldSchema)
304
342
  .refine((fields) => Object.keys(fields).length <= APP_SETTINGS_MAX_FIELDS, {
@@ -351,6 +389,7 @@ export function appManifestProblems(manifest: AppManifest): AppManifestProblem[]
351
389
  unique(manifest.events, "events", "이벤트");
352
390
  unique(manifest.network.hosts, "network.hosts", "호스트");
353
391
  unique(manifest.secrets, "secrets", "비밀 값 이름");
392
+ unique(manifest.http?.public ?? [], "http.public", "공개 HTTP 핸들러");
354
393
  for (const event of manifest.events) {
355
394
  if (!scopesCoverEvent(manifest.scopes, event)) {
356
395
  problems.push({
@@ -399,6 +438,10 @@ export interface AppCapabilities {
399
438
  events: AppEventType[];
400
439
  networkHosts: string[];
401
440
  adminPage: boolean;
441
+ /** 공개 HTTP 핸들러 키(`"GET /track/:id"`). 옛 버전 행에는 없다 — 읽을 때 `?? []` */
442
+ publicHttp?: string[];
443
+ /** 예약 작업 이름 → 간격. 옛 버전 행에는 없다 — 읽을 때 `?? {}` */
444
+ schedules?: Record<string, AppScheduleInterval>;
402
445
  /** 필수 설정 키 — 하나라도 비어 있으면 이벤트 함수를 부르지 않는다 */
403
446
  requiredSettings: string[];
404
447
  secretSettings: string[];
@@ -411,6 +454,12 @@ export function appCapabilitiesOf(manifest: AppManifest): AppCapabilities {
411
454
  events: sorted(manifest.events) as AppEventType[],
412
455
  networkHosts: sorted(manifest.network.hosts),
413
456
  adminPage: Boolean(manifest.ui?.adminPage),
457
+ publicHttp: sorted(manifest.http?.public ?? []),
458
+ schedules: Object.fromEntries(
459
+ Object.entries(manifest.schedules)
460
+ .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
461
+ .map(([name, schedule]) => [name, schedule.every]),
462
+ ),
414
463
  requiredSettings: Object.entries(manifest.settings)
415
464
  .filter(([, field]) => field.required)
416
465
  .map(([key]) => key)
@@ -427,7 +476,7 @@ export function appCapabilitiesOf(manifest: AppManifest): AppCapabilities {
427
476
  * 동의 문단은 accounts 설치 화면·상점 플랫폼 앱 상세·유저 문서가 같은 문장을 쓴다.
428
477
  */
429
478
  export interface AppCapabilityDefinition {
430
- key: "scopes" | "network" | "events" | "ui";
479
+ key: "scopes" | "network" | "events" | "ui" | "publicHttp" | "schedules";
431
480
  /** 동의 화면의 문단 제목 */
432
481
  title: string;
433
482
  /** 동의 화면에 보일 줄 — 없으면 문단을 그리지 않는다 */
@@ -473,8 +522,59 @@ export const APP_CAPABILITIES: readonly AppCapabilityDefinition[] = [
473
522
  describe: (c) => (c.adminPage ? ["상점 플랫폼에 이 앱의 화면을 더합니다"] : []),
474
523
  widens: (p, n) => !p.adminPage && n.adminPage,
475
524
  },
525
+ {
526
+ key: "publicHttp",
527
+ title: "외부에서 이 앱을 부르는 주소",
528
+ describe: (c) => c.publicHttp ?? [],
529
+ widens: (p, n) => grew(p.publicHttp ?? [], n.publicHttp ?? []),
530
+ },
531
+ {
532
+ key: "schedules",
533
+ title: "주기적으로 실행되는 작업",
534
+ describe: (c) =>
535
+ Object.entries(c.schedules ?? {}).map(
536
+ ([name, every]) => `${name} · ${appScheduleIntervalLabel(every)}마다`,
537
+ ),
538
+ widens: (p, n) => {
539
+ const previous = p.schedules ?? {};
540
+ return Object.entries(n.schedules ?? {}).some(
541
+ ([name, every]) =>
542
+ !previous[name] ||
543
+ APP_SCHEDULE_INTERVALS[every] <
544
+ APP_SCHEDULE_INTERVALS[previous[name] as AppScheduleInterval],
545
+ );
546
+ },
547
+ },
476
548
  ];
477
549
 
550
+ /** 요청(메서드·경로)이 HTTP 핸들러 키에 맞는가 — `:이름`은 경로 한 마디에 맞는다(`@sayren/app`의 핸들러 고르기와 같은 규칙) */
551
+ export function appHttpKeyMatches(key: string, method: string, path: string): boolean {
552
+ const match = APP_HTTP_KEY_PATTERN.exec(key.trim().replace(/\s+/g, " "));
553
+ if (!match || match[1] !== method.toUpperCase()) return false;
554
+ const pattern = (match[2] as string).split("/");
555
+ const actual = (path.split("?")[0] ?? path).split("/");
556
+ if (pattern.length !== actual.length) return false;
557
+ return pattern.every((part, i) => (part.startsWith(":") ? actual[i] !== "" : part === actual[i]));
558
+ }
559
+
560
+ /** 응답용 예약 작업 목록(이름순) — 옛 버전 행(`schedules` 없음)은 빈 목록 */
561
+ export function appScheduleListOf(
562
+ capabilities: Pick<AppCapabilities, "schedules">,
563
+ ): Array<{ name: string; every: AppScheduleInterval }> {
564
+ // jsonb는 키를 길이순으로 저장한다 — 이름순으로 맞춘다
565
+ return Object.entries(capabilities.schedules ?? {})
566
+ .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
567
+ .map(([name, every]) => ({ name, every }));
568
+ }
569
+
570
+ /** 예약 간격의 표시 이름 — 동의 화면·상점 플랫폼이 같이 쓴다 */
571
+ export function appScheduleIntervalLabel(every: AppScheduleInterval): string {
572
+ const minutes = APP_SCHEDULE_INTERVALS[every];
573
+ if (minutes < 60) return `${minutes}분`;
574
+ if (minutes < 1440) return `${minutes / 60}시간`;
575
+ return "하루";
576
+ }
577
+
478
578
  /** 재동의가 필요한 capability 키 — 비어 있으면 release가 모든 설치에 곧바로 반영된다 */
479
579
  export function appManifestWidens(
480
580
  previous: AppCapabilities,