@sayren/store-sdk 0.30.9 → 0.30.10

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,37 @@ 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
+ /** 앱 목록에 보이는 아이콘·README(#22 앱 목록 시안) — 앱 폴더의 파일을 `sayren app deploy`가 버전과 함께 올린다 */
2646
+ const APP_ICON_MAX_BYTES = 262144;
2647
+ const APP_ICON_MIN_PX = 512;
2648
+ const APP_README_MAX_BYTES = 65536;
2649
+ const APP_ICON_CONTENT_TYPES = ["image/png", "image/svg+xml"];
2650
+ const APP_FOLDER_FILE = /^(?!\/)(?!.*\.\.)[A-Za-z0-9._/-]+$/;
2651
+ /** 아이콘 파일 검사 — 문제가 없으면 null. CLI `app verify`·`deploy`와 api 빌드 `VERIFY`가 같은 규칙을 쓴다 */
2652
+ function appIconProblem(bytes, contentType) {
2653
+ if (bytes.byteLength === 0) return "아이콘 파일이 비어 있습니다";
2654
+ if (bytes.byteLength > 262144) return `아이콘이 ${Math.ceil(bytes.byteLength / 1024)}KB입니다. 상한은 ${APP_ICON_MAX_BYTES / 1024}KB입니다`;
2655
+ if (contentType === "image/svg+xml") {
2656
+ const head = new TextDecoder().decode(bytes.subarray(0, 1024));
2657
+ return /<svg[\s>]/i.test(head) ? null : "SVG 파일이 아닙니다";
2658
+ }
2659
+ if (bytes.byteLength < 24 || [
2660
+ 137,
2661
+ 80,
2662
+ 78,
2663
+ 71,
2664
+ 13,
2665
+ 10,
2666
+ 26,
2667
+ 10
2668
+ ].some((b, i) => bytes[i] !== b)) return "PNG 파일이 아닙니다";
2669
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
2670
+ const width = view.getUint32(16);
2671
+ const height = view.getUint32(20);
2672
+ if (width !== height) return `아이콘은 정사각형이어야 합니다(지금 ${width}×${height})`;
2673
+ if (width < 512) return `아이콘은 512×512 이상이어야 합니다(지금 ${width}×${height})`;
2674
+ return null;
2675
+ }
2645
2676
  const appManifestSchema = z.strictObject({
2646
2677
  handle: appHandleSchema,
2647
2678
  name: z.string().trim().min(1).max(60),
@@ -2649,6 +2680,10 @@ const appManifestSchema = z.strictObject({
2649
2680
  /** https 이미지 주소. 동의 화면·상점 플랫폼 목록에 보인다 */
2650
2681
  iconUrl: z.url().startsWith("https://").optional(),
2651
2682
  supportEmail: z.email().optional(),
2683
+ /** 앱 폴더의 아이콘 파일(PNG·SVG, 정사각형, PNG는 512px 이상, 256KB 이하). 있으면 `iconUrl`보다 먼저 보인다 */
2684
+ icon: z.string().regex(APP_FOLDER_FILE).refine((path) => /\.(png|svg)$/i.test(path), { message: "아이콘은 .png 또는 .svg 파일입니다" }).optional(),
2685
+ /** 앱 상세에 보일 README(마크다운, 64KB 이하). 적지 않으면 앱 폴더의 README.md를 쓴다 */
2686
+ readme: z.string().regex(APP_FOLDER_FILE).refine((path) => /\.md$/i.test(path), { message: "README는 .md 파일입니다" }).optional(),
2652
2687
  /** 실행 위치 — A1은 코드 업로드 앱만. 외부 런타임(`external`)은 A3에서 연다 */
2653
2688
  runtime: z.literal("code").default("code"),
2654
2689
  /** 설치 때 전체 동의하는 스코프 */
@@ -2844,8 +2879,42 @@ const appInstallationSchema = z.object({
2844
2879
  uninstalledAt: z.string().nullable(),
2845
2880
  updatedAt: z.string()
2846
2881
  });
2847
- /** `POST /v1/apps/installations` — accounts 설치 동의 결과(1회용 JWT)를 낸다(상점 플랫폼 전용) */
2848
- const appInstallRequestSchema = z.object({ result: z.string().min(1).describe("accounts가 발급한 설치 결과 JWT(`typ: sayren-install+jwt`)") });
2882
+ /**
2883
+ * `POST /v1/apps/installations`(상점 플랫폼 전용) — 둘 중 하나다.
2884
+ * - `{ result }`: accounts 설치 동의 결과(1회용 JWT). 개발자 포털 [내 상점에 설치]가 이 길로 온다
2885
+ * - `{ appId, settings }`: 상점 플랫폼 앱 목록 › 설치 화면에서 동의하고 설정까지 채워 바로 설치한다
2886
+ */
2887
+ const appInstallRequestSchema = z.union([z.object({ result: z.string().min(1).describe("accounts가 발급한 설치 결과 JWT(`typ: sayren-install+jwt`)") }), z.object({
2888
+ appId: z.string().min(1),
2889
+ settings: z.record(z.string(), settingsValueSchema).default({}).describe("설치와 함께 저장할 설정. 비밀 필드도 여기서 넣는다")
2890
+ })]);
2891
+ /** 앱 목록 정보 — 현재 버전이 올린 아이콘·README(없으면 매니페스트 `iconUrl`) */
2892
+ const appListingSchema = z.object({
2893
+ description: z.string().nullable(),
2894
+ iconUrl: z.string().nullable().describe("아이콘 주소. 앱 폴더에서 올린 아이콘은 data URI, 매니페스트 `iconUrl`은 https 주소"),
2895
+ readme: z.string().nullable().describe("README 마크다운 원문")
2896
+ });
2897
+ /** `GET /v1/apps/catalog` — 이 상점에 설치할 수 있는 앱(A1: 내가 속한 개발자 조직의 앱) */
2898
+ const storeAppSchema = z.object({
2899
+ appId: z.string(),
2900
+ handle: z.string(),
2901
+ name: z.string(),
2902
+ description: z.string().nullable(),
2903
+ iconUrl: z.string().nullable(),
2904
+ developerName: z.string(),
2905
+ versionNumber: z.number().int().describe("현재 버전"),
2906
+ installationId: z.string().nullable().describe("이 상점에 설치돼 있으면 설치 id")
2907
+ });
2908
+ /** `GET /v1/apps/catalog/{appId}` — 앱 상세·설치 화면 */
2909
+ const storeAppDetailSchema = storeAppSchema.extend({
2910
+ readme: z.string().nullable(),
2911
+ supportEmail: z.string().nullable(),
2912
+ scopes: z.array(z.string()).describe("설치 때 동의하는 스코프(Scope)"),
2913
+ events: z.array(appEventTypeSchema).describe("받는 이벤트(Hook)"),
2914
+ networkHosts: z.array(z.string()).describe("앱이 데이터를 보내는 외부 호스트"),
2915
+ settings: z.record(z.string(), appSettingFieldSchema).describe("설치 때 채우는 설정 필드"),
2916
+ updatedAt: z.string().nullable().describe("현재 버전을 release한 시각")
2917
+ });
2849
2918
  /** `POST /v1/apps/installations/{id}/session` — 앱 화면 iframe이 쓸 세션 토큰(5분) */
2850
2919
  const appSessionSchema = z.object({
2851
2920
  token: z.string(),
@@ -2923,6 +2992,7 @@ const appVersionSchema = z.object({
2923
2992
  secretSettings: z.array(z.string())
2924
2993
  }),
2925
2994
  build: appBuildSchema.nullable(),
2995
+ listing: appListingSchema.nullable().optional().default(null).describe("이 버전이 올린 아이콘·설명·README"),
2926
2996
  releasedAt: z.string().nullable(),
2927
2997
  revokedAt: z.string().nullable(),
2928
2998
  createdAt: z.string()
@@ -2963,7 +3033,18 @@ const appArtifactUploadSchema = z.object({
2963
3033
  path: z.string().min(1).max(512),
2964
3034
  content: z.string()
2965
3035
  })).max(2e3).default([]),
2966
- message: z.string().trim().max(200).optional()
3036
+ message: z.string().trim().max(200).optional(),
3037
+ /** 앱 폴더의 아이콘·README — 매니페스트 `icon`·`readme`(없으면 README.md)를 CLI가 싣는다 */
3038
+ listing: z.object({
3039
+ icon: z.object({
3040
+ contentType: z.enum(APP_ICON_CONTENT_TYPES),
3041
+ content: z.string().min(1)
3042
+ }).nullable().default(null),
3043
+ readme: z.string().max(APP_README_MAX_BYTES).nullable().default(null)
3044
+ }).default({
3045
+ icon: null,
3046
+ readme: null
3047
+ })
2967
3048
  });
2968
3049
  const appReleaseResultSchema = z.object({
2969
3050
  version: appVersionSchema,
@@ -8422,17 +8503,26 @@ get: (params) => storeHttp.request("GET", "/sales-report", salesReportSchema, {
8422
8503
  verify: (provider, body) => storeHttp.request("POST", path`/store/payment-providers/${pgProviderSchema.parse(provider)}/verify`, paymentProviderVerificationSchema, { body: verifyPaymentProviderRequestSchema.parse(body ?? {}) })
8423
8504
  },
8424
8505
  /** 설치 앱(#22, 매뉴얼 「앱 설치와 관리 › 관리 API」) — 설치·설정·제거·세션은 상점 플랫폼 OWNER·ADMIN만 */
8425
- apps: { installations: {
8426
- /** 설치 결과(accounts 동의 화면의 1회용 JWT)를 내 설치를 만든다 */
8427
- install: (result) => storeHttp.request("POST", "/apps/installations", appInstallationSchema, { body: appInstallRequestSchema.parse({ result }) }),
8428
- list: () => storeHttp.request("GET", "/apps/installations", z.array(appInstallationSchema)),
8429
- get: (installationId) => storeHttp.request("GET", path`/apps/installations/${installationId}`, appInstallationSchema),
8430
- /** 비밀 필드를 생략하면 현재 값을 유지한다. null은 비운다 */
8431
- updateSettings: (installationId, body) => storeHttp.request("PUT", path`/apps/installations/${installationId}/settings`, appInstallationSchema, { body: appInstallationSettingsUpdateSchema.parse(body) }),
8432
- remove: (installationId) => storeHttp.requestVoid("DELETE", path`/apps/installations/${installationId}`),
8433
- /** 앱 화면 iframe에 넘길 세션 토큰(5분) */
8434
- session: (installationId) => storeHttp.request("POST", path`/apps/installations/${installationId}/session`, appSessionSchema)
8435
- } },
8506
+ apps: {
8507
+ /** 이 상점에 설치할 수 있는 앱 — 앱 목록·상세(아이콘·README·Scope·Hook·설정 필드) */
8508
+ catalog: {
8509
+ list: () => storeHttp.request("GET", "/apps/catalog", z.array(storeAppSchema)),
8510
+ get: (appId) => storeHttp.request("GET", path`/apps/catalog/${appId}`, storeAppDetailSchema)
8511
+ },
8512
+ installations: {
8513
+ /**
8514
+ * 설치 — 문자열이면 accounts 동의 화면의 설치 결과(1회용 JWT), 객체면 상점 플랫폼 설치 화면에서 동의한 앱과 설정이다
8515
+ */
8516
+ install: (input) => storeHttp.request("POST", "/apps/installations", appInstallationSchema, { body: appInstallRequestSchema.parse(typeof input === "string" ? { result: input } : input) }),
8517
+ list: () => storeHttp.request("GET", "/apps/installations", z.array(appInstallationSchema)),
8518
+ get: (installationId) => storeHttp.request("GET", path`/apps/installations/${installationId}`, appInstallationSchema),
8519
+ /** 비밀 필드를 생략하면 현재 값을 유지한다. null은 비운다 */
8520
+ updateSettings: (installationId, body) => storeHttp.request("PUT", path`/apps/installations/${installationId}/settings`, appInstallationSchema, { body: appInstallationSettingsUpdateSchema.parse(body) }),
8521
+ remove: (installationId) => storeHttp.requestVoid("DELETE", path`/apps/installations/${installationId}`),
8522
+ /** 앱 화면 iframe에 넘길 세션 토큰(5분) */
8523
+ session: (installationId) => storeHttp.request("POST", path`/apps/installations/${installationId}/session`, appSessionSchema)
8524
+ }
8525
+ },
8436
8526
  /** 앱 설치 토큰 전용 — 자기 설치 */
8437
8527
  app: { installation: () => storeHttp.request("GET", "/app/installation", appInstallationSelfSchema) },
8438
8528
  webhooks: {
@@ -9140,4 +9230,4 @@ function createStoreSession(options) {
9140
9230
  };
9141
9231
  }
9142
9232
  //#endregion
9143
- 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_LIFECYCLE_EVENT_TYPES, APP_NETWORK_DENIED_SUFFIXES, APP_NETWORK_HOSTS_MAX, 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, appInstallRequestSchema, appInstallationAppSchema, appInstallationSchema, appInstallationSelfSchema, appInstallationSettingsSchema, appInstallationSettingsUpdateSchema, appInstallationStatusSchema, appInvocationSchema, 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, 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 };
9233
+ 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, appInstallationAppSchema, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayren/store-sdk",
3
- "version": "0.30.9",
3
+ "version": "0.30.10",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
package/src/client.ts CHANGED
@@ -28,6 +28,8 @@ import {
28
28
  appInstallationSettingsUpdateSchema,
29
29
  appInstallRequestSchema,
30
30
  appSessionSchema,
31
+ storeAppDetailSchema,
32
+ storeAppSchema,
31
33
  } from "./schemas/apps";
32
34
  import {
33
35
  type ApprovalDecisionRequest,
@@ -1432,11 +1434,23 @@ export function createStoreClient(options: StoreClientOptions) {
1432
1434
 
1433
1435
  /** 설치 앱(#22, 매뉴얼 「앱 설치와 관리 › 관리 API」) — 설치·설정·제거·세션은 상점 플랫폼 OWNER·ADMIN만 */
1434
1436
  apps: {
1437
+ /** 이 상점에 설치할 수 있는 앱 — 앱 목록·상세(아이콘·README·Scope·Hook·설정 필드) */
1438
+ catalog: {
1439
+ list: () => storeHttp.request("GET", "/apps/catalog", z.array(storeAppSchema)),
1440
+ get: (appId: string) =>
1441
+ storeHttp.request("GET", path`/apps/catalog/${appId}`, storeAppDetailSchema),
1442
+ },
1435
1443
  installations: {
1436
- /** 설치 결과(accounts 동의 화면의 1회용 JWT)를 내 설치를 만든다 */
1437
- install: (result: string) =>
1444
+ /**
1445
+ * 설치 — 문자열이면 accounts 동의 화면의 설치 결과(1회용 JWT), 객체면 상점 플랫폼 설치 화면에서 동의한 앱과 설정이다
1446
+ */
1447
+ install: (
1448
+ input: string | { appId: string; settings?: AppInstallationSettingsUpdate["values"] },
1449
+ ) =>
1438
1450
  storeHttp.request("POST", "/apps/installations", appInstallationSchema, {
1439
- body: appInstallRequestSchema.parse({ result }),
1451
+ body: appInstallRequestSchema.parse(
1452
+ typeof input === "string" ? { result: input } : input,
1453
+ ),
1440
1454
  }),
1441
1455
  list: () => storeHttp.request("GET", "/apps/installations", z.array(appInstallationSchema)),
1442
1456
  get: (installationId: string) =>
@@ -1,7 +1,11 @@
1
1
  import { z } from "zod";
2
2
  import { isStoreScope, STORE_SCOPE_RESOURCES, type StoreScopeResource } from "./scope";
3
3
  import { describeScope } from "./scope-descriptions";
4
- import { KNOWN_WEBHOOK_EVENT_TYPES, type WebhookEventType } from "./webhook-event";
4
+ import {
5
+ KNOWN_WEBHOOK_EVENT_TYPES,
6
+ type WebhookEventOf,
7
+ type WebhookEventType,
8
+ } from "./webhook-event";
5
9
 
6
10
  /**
7
11
  * 서드파티 앱 매니페스트 `sayren.app.json` (이슈 #22) — CLI(`sayren app`)·api(빌드 `VERIFY`·버전 판정·동의 화면 자료)·런타임이
@@ -84,6 +88,36 @@ export const APP_LIFECYCLE_EVENT_TYPES = [
84
88
  export type AppLifecycleEventType = (typeof APP_LIFECYCLE_EVENT_TYPES)[number];
85
89
  export type AppEventType = WebhookEventType | AppLifecycleEventType;
86
90
 
91
+ /**
92
+ * 생명주기 이벤트의 `data`(매뉴얼 「앱 이벤트」 표). api가 보내는 값과 `@sayren/app`의 핸들러 타입이 이 한 곳을 쓴다.
93
+ * 키를 바꾸면 앱 코드가 깨진다 — 더하기만 한다
94
+ */
95
+ export interface AppLifecycleEventDataMap {
96
+ "APP.INSTALLED": {
97
+ installationId: string;
98
+ storeId: string;
99
+ versionNumber: number;
100
+ grantedScopes: string[];
101
+ };
102
+ "APP.SETTINGS_UPDATED": { installationId: string; storeId: string; changedKeys: string[] };
103
+ "APP.SCOPES_UPDATED": {
104
+ installationId: string;
105
+ storeId: string;
106
+ versionNumber: number;
107
+ grantedScopes: string[];
108
+ };
109
+ "APP.UNINSTALLED": { installationId: string; storeId: string };
110
+ "APP.STORE_REDACT": { installationId: string; storeId: string };
111
+ "APP.CUSTOMER_REDACT": { storeId: string; memberId: string };
112
+ }
113
+
114
+ /** 이벤트 타입 하나의 `data` — 웹훅 이벤트는 `WebhookEventOf<T>["data"]`, 생명주기 이벤트는 위 표다 */
115
+ export type AppEventDataOf<T extends AppEventType> = T extends AppLifecycleEventType
116
+ ? AppLifecycleEventDataMap[T]
117
+ : T extends WebhookEventType
118
+ ? WebhookEventOf<T>["data"]
119
+ : never;
120
+
87
121
  /**
88
122
  * 이벤트를 받는 데 필요한 스코프 — 동의 스코프가 이것을 덮지 못하면 분배하지 않고, 매니페스트 `scopes`가 덮지 못하면 빌드가 실패한다.
89
123
  * 생명주기 이벤트는 스코프가 없다(null). 새 웹훅 이벤트를 더하면 이 표도 더해야 테스트가 통과한다
@@ -200,6 +234,37 @@ export const APP_SECRETS_MAX = 20;
200
234
  export const APP_EVENTS_MAX = 50;
201
235
  export const APP_NETWORK_HOSTS_MAX = 20;
202
236
 
237
+ /** 앱 목록에 보이는 아이콘·README(#22 앱 목록 시안) — 앱 폴더의 파일을 `sayren app deploy`가 버전과 함께 올린다 */
238
+ export const APP_ICON_MAX_BYTES = 256 * 1024;
239
+ export const APP_ICON_MIN_PX = 512;
240
+ export const APP_README_MAX_BYTES = 64 * 1024;
241
+ export const APP_ICON_CONTENT_TYPES = ["image/png", "image/svg+xml"] as const;
242
+ export type AppIconContentType = (typeof APP_ICON_CONTENT_TYPES)[number];
243
+ const APP_FOLDER_FILE = /^(?!\/)(?!.*\.\.)[A-Za-z0-9._/-]+$/;
244
+
245
+ /** 아이콘 파일 검사 — 문제가 없으면 null. CLI `app verify`·`deploy`와 api 빌드 `VERIFY`가 같은 규칙을 쓴다 */
246
+ export function appIconProblem(bytes: Uint8Array, contentType: AppIconContentType): string | null {
247
+ if (bytes.byteLength === 0) return "아이콘 파일이 비어 있습니다";
248
+ if (bytes.byteLength > APP_ICON_MAX_BYTES) {
249
+ return `아이콘이 ${Math.ceil(bytes.byteLength / 1024)}KB입니다. 상한은 ${APP_ICON_MAX_BYTES / 1024}KB입니다`;
250
+ }
251
+ if (contentType === "image/svg+xml") {
252
+ const head = new TextDecoder().decode(bytes.subarray(0, 1024));
253
+ return /<svg[\s>]/i.test(head) ? null : "SVG 파일이 아닙니다";
254
+ }
255
+ const signature = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];
256
+ if (bytes.byteLength < 24 || signature.some((b, i) => bytes[i] !== b))
257
+ return "PNG 파일이 아닙니다";
258
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
259
+ const width = view.getUint32(16);
260
+ const height = view.getUint32(20);
261
+ if (width !== height) return `아이콘은 정사각형이어야 합니다(지금 ${width}×${height})`;
262
+ if (width < APP_ICON_MIN_PX) {
263
+ return `아이콘은 ${APP_ICON_MIN_PX}×${APP_ICON_MIN_PX} 이상이어야 합니다(지금 ${width}×${height})`;
264
+ }
265
+ return null;
266
+ }
267
+
203
268
  export const appManifestSchema = z.strictObject({
204
269
  handle: appHandleSchema,
205
270
  name: z.string().trim().min(1).max(60),
@@ -207,6 +272,18 @@ export const appManifestSchema = z.strictObject({
207
272
  /** https 이미지 주소. 동의 화면·상점 플랫폼 목록에 보인다 */
208
273
  iconUrl: z.url().startsWith("https://").optional(),
209
274
  supportEmail: z.email().optional(),
275
+ /** 앱 폴더의 아이콘 파일(PNG·SVG, 정사각형, PNG는 512px 이상, 256KB 이하). 있으면 `iconUrl`보다 먼저 보인다 */
276
+ icon: z
277
+ .string()
278
+ .regex(APP_FOLDER_FILE)
279
+ .refine((path) => /\.(png|svg)$/i.test(path), { message: "아이콘은 .png 또는 .svg 파일입니다" })
280
+ .optional(),
281
+ /** 앱 상세에 보일 README(마크다운, 64KB 이하). 적지 않으면 앱 폴더의 README.md를 쓴다 */
282
+ readme: z
283
+ .string()
284
+ .regex(APP_FOLDER_FILE)
285
+ .refine((path) => /\.md$/i.test(path), { message: "README는 .md 파일입니다" })
286
+ .optional(),
210
287
  /** 실행 위치 — A1은 코드 업로드 앱만. 외부 런타임(`external`)은 A3에서 연다 */
211
288
  runtime: z.literal("code").default("code"),
212
289
  /** 설치 때 전체 동의하는 스코프 */
@@ -1,5 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import {
3
+ APP_ICON_CONTENT_TYPES,
4
+ APP_README_MAX_BYTES,
3
5
  type AppCapabilities,
4
6
  appEventTypeSchema,
5
7
  appHandleSchema,
@@ -82,12 +84,64 @@ export const appInstallationSchema = z.object({
82
84
  });
83
85
  export type AppInstallation = z.infer<typeof appInstallationSchema>;
84
86
 
85
- /** `POST /v1/apps/installations` — accounts 설치 동의 결과(1회용 JWT)를 낸다(상점 플랫폼 전용) */
86
- export const appInstallRequestSchema = z.object({
87
- result: z.string().min(1).describe("accounts가 발급한 설치 결과 JWT(`typ: sayren-install+jwt`)"),
88
- });
87
+ /**
88
+ * `POST /v1/apps/installations`(상점 플랫폼 전용) — 둘 중 하나다.
89
+ * - `{ result }`: accounts 설치 동의 결과(1회용 JWT). 개발자 포털 [내 상점에 설치]가 이 길로 온다
90
+ * - `{ appId, settings }`: 상점 플랫폼 앱 목록 › 설치 화면에서 동의하고 설정까지 채워 바로 설치한다
91
+ */
92
+ export const appInstallRequestSchema = z.union([
93
+ z.object({
94
+ result: z
95
+ .string()
96
+ .min(1)
97
+ .describe("accounts가 발급한 설치 결과 JWT(`typ: sayren-install+jwt`)"),
98
+ }),
99
+ z.object({
100
+ appId: z.string().min(1),
101
+ settings: z
102
+ .record(z.string(), settingsValueSchema)
103
+ .default({})
104
+ .describe("설치와 함께 저장할 설정. 비밀 필드도 여기서 넣는다"),
105
+ }),
106
+ ]);
89
107
  export type AppInstallRequest = z.infer<typeof appInstallRequestSchema>;
90
108
 
109
+ /** 앱 목록 정보 — 현재 버전이 올린 아이콘·README(없으면 매니페스트 `iconUrl`) */
110
+ export const appListingSchema = z.object({
111
+ description: z.string().nullable(),
112
+ iconUrl: z
113
+ .string()
114
+ .nullable()
115
+ .describe("아이콘 주소. 앱 폴더에서 올린 아이콘은 data URI, 매니페스트 `iconUrl`은 https 주소"),
116
+ readme: z.string().nullable().describe("README 마크다운 원문"),
117
+ });
118
+ export type AppListing = z.infer<typeof appListingSchema>;
119
+
120
+ /** `GET /v1/apps/catalog` — 이 상점에 설치할 수 있는 앱(A1: 내가 속한 개발자 조직의 앱) */
121
+ export const storeAppSchema = z.object({
122
+ appId: z.string(),
123
+ handle: z.string(),
124
+ name: z.string(),
125
+ description: z.string().nullable(),
126
+ iconUrl: z.string().nullable(),
127
+ developerName: z.string(),
128
+ versionNumber: z.number().int().describe("현재 버전"),
129
+ installationId: z.string().nullable().describe("이 상점에 설치돼 있으면 설치 id"),
130
+ });
131
+ export type StoreApp = z.infer<typeof storeAppSchema>;
132
+
133
+ /** `GET /v1/apps/catalog/{appId}` — 앱 상세·설치 화면 */
134
+ export const storeAppDetailSchema = storeAppSchema.extend({
135
+ readme: z.string().nullable(),
136
+ supportEmail: z.string().nullable(),
137
+ scopes: z.array(z.string()).describe("설치 때 동의하는 스코프(Scope)"),
138
+ events: z.array(appEventTypeSchema).describe("받는 이벤트(Hook)"),
139
+ networkHosts: z.array(z.string()).describe("앱이 데이터를 보내는 외부 호스트"),
140
+ settings: z.record(z.string(), appSettingFieldSchema).describe("설치 때 채우는 설정 필드"),
141
+ updatedAt: z.string().nullable().describe("현재 버전을 release한 시각"),
142
+ });
143
+ export type StoreAppDetail = z.infer<typeof storeAppDetailSchema>;
144
+
91
145
  /** `POST /v1/apps/installations/{id}/session` — 앱 화면 iframe이 쓸 세션 토큰(5분) */
92
146
  export const appSessionSchema = z.object({
93
147
  token: z.string(),
@@ -168,6 +222,11 @@ export const appVersionSchema = z.object({
168
222
  secretSettings: z.array(z.string()),
169
223
  }),
170
224
  build: appBuildSchema.nullable(),
225
+ listing: appListingSchema
226
+ .nullable()
227
+ .optional()
228
+ .default(null)
229
+ .describe("이 버전이 올린 아이콘·설명·README"),
171
230
  releasedAt: z.string().nullable(),
172
231
  revokedAt: z.string().nullable(),
173
232
  createdAt: z.string(),
@@ -218,6 +277,16 @@ export const appArtifactUploadSchema = z.object({
218
277
  .max(2_000)
219
278
  .default([]),
220
279
  message: z.string().trim().max(200).optional(),
280
+ /** 앱 폴더의 아이콘·README — 매니페스트 `icon`·`readme`(없으면 README.md)를 CLI가 싣는다 */
281
+ listing: z
282
+ .object({
283
+ icon: z
284
+ .object({ contentType: z.enum(APP_ICON_CONTENT_TYPES), content: z.string().min(1) })
285
+ .nullable()
286
+ .default(null),
287
+ readme: z.string().max(APP_README_MAX_BYTES).nullable().default(null),
288
+ })
289
+ .default({ icon: null, readme: null }),
221
290
  });
222
291
  export type AppArtifactUpload = z.infer<typeof appArtifactUploadSchema>;
223
292