@yoonion/mimi-seed-mcp 0.3.7 → 0.3.9

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.
Files changed (2) hide show
  1. package/dist/index.js +89 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { z } from 'zod';
5
5
  import { getAuthenticatedClient, getStoredTokens, startAuth } from './auth/google-auth.js';
6
6
  import { getServiceAccountClient, getServiceAccountJson } from './auth/playstore-auth.js';
7
7
  import { getAppStoreCredentials } from './appstore/auth.js';
8
- import { createGoogleOneTimePurchase, createGoogleSubscription, createAppleOneTimePurchase, createAppleSubscription } from '@onesub/providers';
8
+ import { createGoogleOneTimePurchase, createGoogleSubscription, updateGoogleProduct, deleteGoogleProduct, listGoogleProducts, createAppleOneTimePurchase, createAppleSubscription, updateAppleProduct, deleteAppleProduct, listAppleProducts, } from '@onesub/providers';
9
9
  import { MIMI_SEED_CLIENT_ID, MIMI_SEED_CLIENT_SECRET } from './auth/constants.js';
10
10
  import * as firebase from './firebase/tools.js';
11
11
  import * as admob from './admob/tools.js';
@@ -954,6 +954,94 @@ server.tool('appstore_create_subscription', [
954
954
  }],
955
955
  };
956
956
  });
957
+ // --- SKU 운영 (조회/수정/삭제) — onesub 위임 ---
958
+ server.tool('playstore_list_products', 'Google Play의 모든 IAP 상품(구독 + 일회성) 통합 조회. productId / name / status / type / price / currency 반환.', {
959
+ packageName: z.string().describe('패키지명'),
960
+ }, async ({ packageName }) => {
961
+ const json = requireServiceAccountJson();
962
+ const products = await listGoogleProducts({ packageName, serviceAccountKey: json });
963
+ return { content: [{ type: 'text', text: JSON.stringify(products, null, 2) }] };
964
+ });
965
+ server.tool('playstore_update_product', 'Google Play IAP 상품의 표시 이름 변경 (현재 name 필드만 수정 가능). productId / type / 가격은 변경 불가.', {
966
+ packageName: z.string().describe('패키지명'),
967
+ productId: z.string().describe('상품 ID'),
968
+ productType: z.enum(['subscription', 'consumable', 'non_consumable']).describe('상품 유형'),
969
+ name: z.string().describe('새 표시 이름'),
970
+ }, async ({ packageName, productId, productType, name }) => {
971
+ const json = requireServiceAccountJson();
972
+ const result = await updateGoogleProduct({
973
+ packageName, productId, productType, name, serviceAccountKey: json,
974
+ });
975
+ if (!result.success) {
976
+ return { content: [{ type: 'text', text: `❌ 수정 실패: ${result.error}` }] };
977
+ }
978
+ return { content: [{ type: 'text', text: `✓ 수정 완료 (변경 필드: ${result.updated.join(', ') || 'none'})` }] };
979
+ });
980
+ server.tool('playstore_delete_product', '⚠️ 비가역. Google Play IAP 상품 삭제. 활성 baseplan + 구독자 있는 구독은 삭제 불가.', {
981
+ packageName: z.string().describe('패키지명'),
982
+ productId: z.string().describe('상품 ID'),
983
+ productType: z.enum(['subscription', 'consumable', 'non_consumable']).describe('상품 유형'),
984
+ }, async ({ packageName, productId, productType }) => {
985
+ const json = requireServiceAccountJson();
986
+ const result = await deleteGoogleProduct({
987
+ packageName, productId, productType, serviceAccountKey: json,
988
+ });
989
+ if (!result.success) {
990
+ return { content: [{ type: 'text', text: `❌ 삭제 실패: ${result.error}` }] };
991
+ }
992
+ return { content: [{ type: 'text', text: `✓ ${productId} 삭제 완료` }] };
993
+ });
994
+ server.tool('appstore_list_products', 'App Store의 모든 IAP 상품(구독 + 일회성) 통합 조회. productId / internalId / name / status / type 반환.', {
995
+ appId: z.string().describe('App Store 앱 ID (숫자형, appstore_list_apps 결과)'),
996
+ }, async ({ appId }) => {
997
+ const creds = requireAppStoreCreds();
998
+ const products = await listAppleProducts({
999
+ appId, keyId: creds.keyId, issuerId: creds.issuerId, privateKey: creds.privateKey,
1000
+ });
1001
+ return { content: [{ type: 'text', text: JSON.stringify(products, null, 2) }] };
1002
+ });
1003
+ server.tool('appstore_update_product', 'App Store IAP 상품의 reference name 변경. productId / 유형은 변경 불가.', {
1004
+ appId: z.string().optional().describe('App Store 앱 ID'),
1005
+ bundleId: z.string().optional().describe('번들 ID (appId 대신 사용 가능)'),
1006
+ productId: z.string().describe('상품 ID'),
1007
+ productType: z.enum(['subscription', 'consumable', 'non_consumable']).describe('상품 유형'),
1008
+ name: z.string().describe('새 reference name'),
1009
+ }, async ({ appId, bundleId, productId, productType, name }) => {
1010
+ if (!appId && !bundleId) {
1011
+ throw new Error('appId 또는 bundleId 중 하나는 반드시 제공해야 합니다.');
1012
+ }
1013
+ const creds = requireAppStoreCreds();
1014
+ const result = await updateAppleProduct({
1015
+ appId, bundleId, productId, productType, name,
1016
+ keyId: creds.keyId, issuerId: creds.issuerId, privateKey: creds.privateKey,
1017
+ });
1018
+ if (!result.success) {
1019
+ return { content: [{ type: 'text', text: `❌ 수정 실패: ${result.error}` }] };
1020
+ }
1021
+ return { content: [{ type: 'text', text: `✓ 수정 완료 (변경 필드: ${result.updated.join(', ') || 'none'})` }] };
1022
+ });
1023
+ server.tool('appstore_delete_product', '⚠️ 비가역. App Store IAP 상품 삭제. MISSING_METADATA / WAITING_FOR_REVIEW 상태만 가능 — 이미 승인(READY_FOR_SALE)된 상품은 Console에서 "Remove from sale" 해야 함.', {
1024
+ appId: z.string().optional().describe('App Store 앱 ID'),
1025
+ bundleId: z.string().optional().describe('번들 ID (appId 대신 사용 가능)'),
1026
+ productId: z.string().describe('상품 ID'),
1027
+ productType: z.enum(['subscription', 'consumable', 'non_consumable']).describe('상품 유형'),
1028
+ }, async ({ appId, bundleId, productId, productType }) => {
1029
+ if (!appId && !bundleId) {
1030
+ throw new Error('appId 또는 bundleId 중 하나는 반드시 제공해야 합니다.');
1031
+ }
1032
+ const creds = requireAppStoreCreds();
1033
+ const result = await deleteAppleProduct({
1034
+ appId, bundleId, productId, productType,
1035
+ keyId: creds.keyId, issuerId: creds.issuerId, privateKey: creds.privateKey,
1036
+ });
1037
+ if (!result.success) {
1038
+ const hint = result.errorType === 'CANNOT_DELETE'
1039
+ ? '\n승인된 상품은 API 삭제 불가 — App Store Connect → 상품 → "Remove from sale"'
1040
+ : '';
1041
+ return { content: [{ type: 'text', text: `❌ 삭제 실패: ${result.error}${hint}` }] };
1042
+ }
1043
+ return { content: [{ type: 'text', text: `✓ ${productId} 삭제 완료` }] };
1044
+ });
957
1045
  // --- App Store 심사 제출 (Submit for Review) ---
958
1046
  server.tool('appstore_submit_for_review', [
959
1047
  'App Store 버전을 심사에 제출 — 새 reviewSubmissions API 사용 (옛 /appStoreVersionSubmissions는 2024-01 deprecated).',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoonion/mimi-seed-mcp",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "Mimi Seed MCP server — Firebase + AdMob + Google Play + App Store management for Claude Code / Cursor / any MCP client.",
5
5
  "type": "module",
6
6
  "bin": {