@goodz-core/sdk 0.2.0 → 0.3.1
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/README.md +271 -83
- package/dist/alive/index.d.ts +175 -0
- package/dist/alive/index.js +4 -0
- package/dist/alive/index.js.map +1 -0
- package/dist/chunk-4SU7SU7K.js +227 -0
- package/dist/chunk-4SU7SU7K.js.map +1 -0
- package/dist/chunk-JAVMQXJM.js +27 -0
- package/dist/chunk-JAVMQXJM.js.map +1 -0
- package/dist/chunk-KLMCZG4N.js +102 -0
- package/dist/chunk-KLMCZG4N.js.map +1 -0
- package/dist/chunk-OUKZ2PRD.js +37 -0
- package/dist/chunk-OUKZ2PRD.js.map +1 -0
- package/dist/chunk-V73MMKHI.js +56 -0
- package/dist/chunk-V73MMKHI.js.map +1 -0
- package/dist/commerce/index.d.ts +462 -0
- package/dist/commerce/index.js +4 -0
- package/dist/commerce/index.js.map +1 -0
- package/dist/core/index.d.ts +76 -385
- package/dist/core/index.js +5 -1
- package/dist/exchange/index.d.ts +252 -0
- package/dist/exchange/index.js +4 -0
- package/dist/exchange/index.js.map +1 -0
- package/dist/index.d.ts +31 -4
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/transport-BOlScYEv.d.ts +377 -0
- package/package.json +20 -3
- package/dist/chunk-G7NKU6PT.js +0 -183
- package/dist/chunk-G7NKU6PT.js.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { callMcpTool } from './chunk-4SU7SU7K.js';
|
|
2
|
+
|
|
3
|
+
// src/exchange/index.ts
|
|
4
|
+
function createExchangeNamespace(transport) {
|
|
5
|
+
const tool = (name) => (input) => callMcpTool(transport, name, input);
|
|
6
|
+
return {
|
|
7
|
+
// Marketplace
|
|
8
|
+
browseMarketplace: tool("browse_marketplace"),
|
|
9
|
+
getListingDetail: tool("get_listing_detail"),
|
|
10
|
+
// Listing Management
|
|
11
|
+
createListing: tool("create_listing"),
|
|
12
|
+
cancelListing: tool("cancel_listing"),
|
|
13
|
+
// Purchase & Bidding
|
|
14
|
+
buyListing: tool("buy_listing"),
|
|
15
|
+
placeBid: tool("place_bid"),
|
|
16
|
+
getBids: tool("get_bids"),
|
|
17
|
+
// WTB
|
|
18
|
+
createWtb: tool("create_wtb"),
|
|
19
|
+
fulfillWtb: tool("fulfill_wtb"),
|
|
20
|
+
cancelWtb: tool("cancel_wtb"),
|
|
21
|
+
// P2P Trade
|
|
22
|
+
proposeTrade: tool("propose_trade"),
|
|
23
|
+
respondToTrade: tool("respond_to_trade"),
|
|
24
|
+
// Watchlist
|
|
25
|
+
getWatchlist: tool("get_watchlist"),
|
|
26
|
+
addToWatchlist: tool("add_to_watchlist"),
|
|
27
|
+
removeFromWatchlist: tool("remove_from_watchlist"),
|
|
28
|
+
// Market Data
|
|
29
|
+
getMarketData: tool("get_market_data"),
|
|
30
|
+
// Raw escape hatch
|
|
31
|
+
rawTool: (toolName, args) => callMcpTool(transport, toolName, args)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { createExchangeNamespace };
|
|
36
|
+
//# sourceMappingURL=chunk-OUKZ2PRD.js.map
|
|
37
|
+
//# sourceMappingURL=chunk-OUKZ2PRD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/exchange/index.ts"],"names":[],"mappings":";;;AAqGO,SAAS,wBAAwB,SAAA,EAA+C;AACrF,EAAA,MAAM,IAAA,GAAO,CAAmC,IAAA,KAC9C,CAAC,UAAc,WAAA,CAAkB,SAAA,EAAW,MAAM,KAAU,CAAA;AAE9D,EAAA,OAAO;AAAA;AAAA,IAEL,iBAAA,EAAmB,KAAwD,oBAAoB,CAAA;AAAA,IAC/F,gBAAA,EAAkB,KAAqD,oBAAoB,CAAA;AAAA;AAAA,IAG3F,aAAA,EAAe,KAA8D,gBAAgB,CAAA;AAAA,IAC7F,aAAA,EAAe,KAAsC,gBAAgB,CAAA;AAAA;AAAA,IAGrE,UAAA,EAAY,KAAwD,aAAa,CAAA;AAAA,IACjF,QAAA,EAAU,KAAoD,WAAW,CAAA;AAAA,IACzE,OAAA,EAAS,KAA0C,UAAU,CAAA;AAAA;AAAA,IAG7D,SAAA,EAAW,KAA0C,YAAY,CAAA;AAAA,IACjE,UAAA,EAAY,KAAwD,aAAa,CAAA;AAAA,IACjF,SAAA,EAAW,KAAkC,YAAY,CAAA;AAAA;AAAA,IAGzD,YAAA,EAAc,KAAuD,eAAe,CAAA;AAAA,IACpF,cAAA,EAAgB,KAAgE,kBAAkB,CAAA;AAAA;AAAA,IAGlG,YAAA,EAAc,KAAqD,eAAe,CAAA;AAAA,IAClF,cAAA,EAAgB,KAAyD,kBAAkB,CAAA;AAAA,IAC3F,mBAAA,EAAqB,KAA4C,uBAAuB,CAAA;AAAA;AAAA,IAGxF,aAAA,EAAe,KAAqD,iBAAiB,CAAA;AAAA;AAAA,IAGrF,SAAS,CAAU,QAAA,EAAkB,SACnC,WAAA,CAAoC,SAAA,EAAW,UAAU,IAAI;AAAA,GACjE;AACF","file":"chunk-OUKZ2PRD.js","sourcesContent":["/**\n * @goodz-core/sdk — Exchange Namespace\n *\n * Provides typed access to GoodZ.Exchange MCP tools:\n * marketplace listings, auctions, WTB, P2P trades,\n * watchlist, and market data.\n *\n * All prices are in Z-coin (1 Z-coin = $0.10 USD).\n *\n * @module\n */\n\nimport { callMcpTool } from \"../mcp-transport\";\nimport type { TransportConfig } from \"../mcp-transport\";\nimport type {\n ExchangeBrowseMarketplaceInput,\n ExchangeListing,\n ExchangeGetListingDetailInput,\n ExchangeCreateListingInput,\n ExchangeCreateListingOutput,\n ExchangeCancelListingInput,\n ExchangeBuyListingInput,\n ExchangeBuyListingOutput,\n ExchangePlaceBidInput,\n ExchangePlaceBidOutput,\n ExchangeGetBidsInput,\n ExchangeBid,\n ExchangeCreateWtbInput,\n ExchangeWtb,\n ExchangeFulfillWtbInput,\n ExchangeFulfillWtbOutput,\n ExchangeCancelWtbInput,\n ExchangeProposeTradeInput,\n ExchangeTradeProposal,\n ExchangeRespondToTradeInput,\n ExchangeRespondToTradeOutput,\n ExchangeAddToWatchlistInput,\n ExchangeWatchlistItem,\n ExchangeRemoveFromWatchlistInput,\n ExchangeGetMarketDataInput,\n ExchangeMarketData,\n} from \"../types-exchange\";\n\n// Re-export all Exchange types\nexport type * from \"../types-exchange\";\n\n// ─── Namespace interface ────────────────────────────────────\n\nexport interface ExchangeNamespace {\n // Marketplace\n /** Browse active marketplace listings. */\n browseMarketplace(input?: ExchangeBrowseMarketplaceInput): Promise<ExchangeListing[]>;\n /** Get detailed info about a specific listing. */\n getListingDetail(input: ExchangeGetListingDetailInput): Promise<ExchangeListing>;\n\n // Listing Management\n /** Create a new listing (fixed_price or auction). Core locks the instance atomically. */\n createListing(input: ExchangeCreateListingInput): Promise<ExchangeCreateListingOutput>;\n /** Cancel an active listing. Core unlocks the instance. */\n cancelListing(input: ExchangeCancelListingInput): Promise<any>;\n\n // Purchase & Bidding\n /** Buy a fixed-price listing. Z-coin debit + ownership transfer via Core settlement. */\n buyListing(input: ExchangeBuyListingInput): Promise<ExchangeBuyListingOutput>;\n /** Place a bid on an auction. If bid meets buy-now price, immediate purchase is executed. */\n placeBid(input: ExchangePlaceBidInput): Promise<ExchangePlaceBidOutput>;\n /** Get all bids for an auction listing (highest first). */\n getBids(input: ExchangeGetBidsInput): Promise<ExchangeBid[]>;\n\n // Want-to-Buy\n /** Create a WTB request — announce what you're looking for. */\n createWtb(input: ExchangeCreateWtbInput): Promise<ExchangeWtb>;\n /** Fulfill a WTB request by offering your item. Settlement via Core. */\n fulfillWtb(input: ExchangeFulfillWtbInput): Promise<ExchangeFulfillWtbOutput>;\n /** Cancel your own WTB request. */\n cancelWtb(input: ExchangeCancelWtbInput): Promise<any>;\n\n // P2P Trade\n /** Propose a trade/swap with another user. Optional Z-coin compensation. */\n proposeTrade(input: ExchangeProposeTradeInput): Promise<ExchangeTradeProposal>;\n /** Accept or reject a trade proposal. If accepted, all items transfer via Core. */\n respondToTrade(input: ExchangeRespondToTradeInput): Promise<ExchangeRespondToTradeOutput>;\n\n // Watchlist\n /** Get your watchlist. */\n getWatchlist(): Promise<ExchangeWatchlistItem[]>;\n /** Add a GoodZ or listing to your watchlist. */\n addToWatchlist(input: ExchangeAddToWatchlistInput): Promise<ExchangeWatchlistItem>;\n /** Remove an item from your watchlist. */\n removeFromWatchlist(input: ExchangeRemoveFromWatchlistInput): Promise<any>;\n\n // Market Data\n /** Get market data: price history, floor price, volume, trends. */\n getMarketData(input: ExchangeGetMarketDataInput): Promise<ExchangeMarketData>;\n\n /** Call a raw MCP tool by name. Escape hatch for tools not yet in the typed API. */\n rawTool<T = any>(toolName: string, args?: Record<string, any>): Promise<T>;\n}\n\n// ─── Factory ────────────────────────────────────────────────\n\nexport function createExchangeNamespace(transport: TransportConfig): ExchangeNamespace {\n const tool = <I extends Record<string, any>, O>(name: string) =>\n (input?: I) => callMcpTool<I, O>(transport, name, input as I);\n\n return {\n // Marketplace\n browseMarketplace: tool<ExchangeBrowseMarketplaceInput, ExchangeListing[]>(\"browse_marketplace\"),\n getListingDetail: tool<ExchangeGetListingDetailInput, ExchangeListing>(\"get_listing_detail\"),\n\n // Listing Management\n createListing: tool<ExchangeCreateListingInput, ExchangeCreateListingOutput>(\"create_listing\"),\n cancelListing: tool<ExchangeCancelListingInput, any>(\"cancel_listing\"),\n\n // Purchase & Bidding\n buyListing: tool<ExchangeBuyListingInput, ExchangeBuyListingOutput>(\"buy_listing\"),\n placeBid: tool<ExchangePlaceBidInput, ExchangePlaceBidOutput>(\"place_bid\"),\n getBids: tool<ExchangeGetBidsInput, ExchangeBid[]>(\"get_bids\"),\n\n // WTB\n createWtb: tool<ExchangeCreateWtbInput, ExchangeWtb>(\"create_wtb\"),\n fulfillWtb: tool<ExchangeFulfillWtbInput, ExchangeFulfillWtbOutput>(\"fulfill_wtb\"),\n cancelWtb: tool<ExchangeCancelWtbInput, any>(\"cancel_wtb\"),\n\n // P2P Trade\n proposeTrade: tool<ExchangeProposeTradeInput, ExchangeTradeProposal>(\"propose_trade\"),\n respondToTrade: tool<ExchangeRespondToTradeInput, ExchangeRespondToTradeOutput>(\"respond_to_trade\"),\n\n // Watchlist\n getWatchlist: tool<Record<string, never>, ExchangeWatchlistItem[]>(\"get_watchlist\"),\n addToWatchlist: tool<ExchangeAddToWatchlistInput, ExchangeWatchlistItem>(\"add_to_watchlist\"),\n removeFromWatchlist: tool<ExchangeRemoveFromWatchlistInput, any>(\"remove_from_watchlist\"),\n\n // Market Data\n getMarketData: tool<ExchangeGetMarketDataInput, ExchangeMarketData>(\"get_market_data\"),\n\n // Raw escape hatch\n rawTool: <T = any>(toolName: string, args?: Record<string, any>) =>\n callMcpTool<Record<string, any>, T>(transport, toolName, args),\n };\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { callMcpTool } from './chunk-4SU7SU7K.js';
|
|
2
|
+
|
|
3
|
+
// src/commerce/index.ts
|
|
4
|
+
function createCommerceNamespace(transport) {
|
|
5
|
+
const tool = (name) => (input) => callMcpTool(transport, name, input);
|
|
6
|
+
return {
|
|
7
|
+
// Shop
|
|
8
|
+
createShop: tool("create_shop"),
|
|
9
|
+
getShopDashboard: tool("get_shop_dashboard"),
|
|
10
|
+
// Product Assembly
|
|
11
|
+
createBatch: tool("assemble_batch"),
|
|
12
|
+
createGachaPool: tool("create_gacha_pool"),
|
|
13
|
+
// Campaign Lifecycle
|
|
14
|
+
launchCampaign: tool("launch_sales_campaign"),
|
|
15
|
+
activateCampaign: tool("activate_campaign"),
|
|
16
|
+
pauseCampaign: tool("pause_campaign"),
|
|
17
|
+
endCampaign: tool("end_campaign"),
|
|
18
|
+
updateCampaign: tool("update_campaign"),
|
|
19
|
+
getCampaignInfo: tool("get_campaign_info"),
|
|
20
|
+
getCampaignItems: tool("get_campaign_items"),
|
|
21
|
+
// Purchase
|
|
22
|
+
executePurchase: tool("execute_purchase"),
|
|
23
|
+
getMyOrders: tool("get_my_orders"),
|
|
24
|
+
// Wholesale
|
|
25
|
+
publishToWholesale: tool("publish_to_wholesale"),
|
|
26
|
+
browseWholesale: tool("browse_wholesale_market"),
|
|
27
|
+
procureBatch: tool("procure_batch"),
|
|
28
|
+
// Inventory
|
|
29
|
+
manageInventory: tool("manage_inventory"),
|
|
30
|
+
registerInstances: tool("register_instances"),
|
|
31
|
+
mintToInventory: tool("mint_to_inventory"),
|
|
32
|
+
// Settlement
|
|
33
|
+
getSettlementReport: tool("get_settlement_report"),
|
|
34
|
+
// Discovery
|
|
35
|
+
searchMarketplace: tool("search_marketplace"),
|
|
36
|
+
getShopsByBlueprint: tool("get_shops_by_blueprint"),
|
|
37
|
+
// Physical Redemption
|
|
38
|
+
redeemPhysical: tool("redeem_physical_goodz"),
|
|
39
|
+
// Webhooks
|
|
40
|
+
registerWebhook: tool("register_webhook"),
|
|
41
|
+
listWebhooks: tool("list_webhooks"),
|
|
42
|
+
testWebhook: tool("test_webhook"),
|
|
43
|
+
deleteWebhook: tool("delete_webhook"),
|
|
44
|
+
// OAuth App
|
|
45
|
+
registerApp: tool("register_app"),
|
|
46
|
+
updateApp: tool("update_app"),
|
|
47
|
+
listMyApps: tool("list_my_apps"),
|
|
48
|
+
getAuthUrl: tool("get_auth_url"),
|
|
49
|
+
// Raw escape hatch
|
|
50
|
+
rawTool: (toolName, args) => callMcpTool(transport, toolName, args)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { createCommerceNamespace };
|
|
55
|
+
//# sourceMappingURL=chunk-V73MMKHI.js.map
|
|
56
|
+
//# sourceMappingURL=chunk-V73MMKHI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commerce/index.ts"],"names":[],"mappings":";;;AAuJO,SAAS,wBAAwB,SAAA,EAA+C;AACrF,EAAA,MAAM,IAAA,GAAO,CAAmC,IAAA,KAC9C,CAAC,UAAc,WAAA,CAAkB,SAAA,EAAW,MAAM,KAAU,CAAA;AAE9D,EAAA,OAAO;AAAA;AAAA,IAEL,UAAA,EAAY,KAA4C,aAAa,CAAA;AAAA,IACrE,gBAAA,EAAkB,KAA2D,oBAAoB,CAAA;AAAA;AAAA,IAGjG,WAAA,EAAa,KAA8C,gBAAgB,CAAA;AAAA,IAC3E,eAAA,EAAiB,KAAsD,mBAAmB,CAAA;AAAA;AAAA,IAG1F,cAAA,EAAgB,KAAoD,uBAAuB,CAAA;AAAA,IAC3F,gBAAA,EAAkB,KAAsD,mBAAmB,CAAA;AAAA,IAC3F,aAAA,EAAe,KAAmD,gBAAgB,CAAA;AAAA,IAClF,WAAA,EAAa,KAAiD,cAAc,CAAA;AAAA,IAC5E,cAAA,EAAgB,KAAoD,iBAAiB,CAAA;AAAA,IACrF,eAAA,EAAiB,KAAwC,mBAAmB,CAAA;AAAA,IAC5E,gBAAA,EAAkB,KAA4D,oBAAoB,CAAA;AAAA;AAAA,IAGlG,eAAA,EAAiB,KAAuD,kBAAkB,CAAA;AAAA,IAC1F,WAAA,EAAa,KAAgD,eAAe,CAAA;AAAA;AAAA,IAG5E,kBAAA,EAAoB,KAA2C,sBAAsB,CAAA;AAAA,IACrF,eAAA,EAAiB,KAA+D,yBAAyB,CAAA;AAAA,IACzG,YAAA,EAAc,KAAqC,eAAe,CAAA;AAAA;AAAA,IAGlE,eAAA,EAAiB,KAAwC,kBAAkB,CAAA;AAAA,IAC3E,iBAAA,EAAmB,KAA0C,oBAAoB,CAAA;AAAA,IACjF,eAAA,EAAiB,KAAwC,mBAAmB,CAAA;AAAA;AAAA,IAG5E,mBAAA,EAAqB,KAA4C,uBAAuB,CAAA;AAAA;AAAA,IAGxF,iBAAA,EAAmB,KAA4C,oBAAoB,CAAA;AAAA,IACnF,mBAAA,EAAqB,KAA8C,wBAAwB,CAAA;AAAA;AAAA,IAG3F,cAAA,EAAgB,KAAuC,uBAAuB,CAAA;AAAA;AAAA,IAG9E,eAAA,EAAiB,KAAoD,kBAAkB,CAAA;AAAA,IACvF,YAAA,EAAc,KAA+C,eAAe,CAAA;AAAA,IAC5E,WAAA,EAAa,KAAoC,cAAc,CAAA;AAAA,IAC/D,aAAA,EAAe,KAAsC,gBAAgB,CAAA;AAAA;AAAA,IAGrE,WAAA,EAAa,KAAoC,cAAc,CAAA;AAAA,IAC/D,SAAA,EAAW,KAAkC,YAAY,CAAA;AAAA,IACzD,UAAA,EAAY,KAAqC,cAAc,CAAA;AAAA,IAC/D,UAAA,EAAY,KAA+C,cAAc,CAAA;AAAA;AAAA,IAGzE,SAAS,CAAU,QAAA,EAAkB,SACnC,WAAA,CAAoC,SAAA,EAAW,UAAU,IAAI;AAAA,GACjE;AACF","file":"chunk-V73MMKHI.js","sourcesContent":["/**\n * @goodz-core/sdk — Commerce / Shops Namespace\n *\n * Provides typed access to GoodZ.Commerce MCP tools:\n * shop management, batches, gacha pools, campaigns,\n * wholesale, purchases, settlement, and webhooks.\n *\n * @module\n */\n\nimport { callMcpTool } from \"../mcp-transport\";\nimport type { TransportConfig } from \"../mcp-transport\";\nimport type {\n CommerceCreateShopInput,\n CommerceShop,\n CommerceGetShopDashboardInput,\n CommerceShopDashboard,\n CommerceCreateBatchInput,\n CommerceBatch,\n CommerceCreateGachaPoolInput,\n CommerceGachaPool,\n CommerceLaunchCampaignInput,\n CommerceCampaign,\n CommerceActivateCampaignInput,\n CommercePauseCampaignInput,\n CommerceEndCampaignInput,\n CommerceUpdateCampaignInput,\n CommerceGetCampaignInfoInput,\n CommerceGetCampaignItemsInput,\n CommerceCampaignItem,\n CommerceExecutePurchaseInput,\n CommerceDrawResult,\n CommerceGetMyOrdersInput,\n CommerceOrder,\n CommercePublishToWholesaleInput,\n CommerceBrowseWholesaleInput,\n CommerceWholesaleListing,\n CommerceProcureBatchInput,\n CommerceManageInventoryInput,\n CommerceRegisterInstancesInput,\n CommerceMintToInventoryInput,\n CommerceGetSettlementReportInput,\n CommerceSearchMarketplaceInput,\n CommerceGetShopsByBlueprintInput,\n CommerceRedeemPhysicalInput,\n CommerceRegisterWebhookInput,\n CommerceWebhook,\n CommerceTestWebhookInput,\n CommerceDeleteWebhookInput,\n CommerceRegisterAppInput,\n CommerceUpdateAppInput,\n CommerceListMyAppsInput,\n CommerceGetAuthUrlInput,\n} from \"../types-commerce\";\n\n// Re-export all Commerce types\nexport type * from \"../types-commerce\";\n\n// ─── Namespace interface ────────────────────────────────────\n\nexport interface CommerceNamespace {\n // Shop Management\n /** Create a new shop. */\n createShop(input: CommerceCreateShopInput): Promise<CommerceShop>;\n /** Get shop dashboard with stats, revenue, and recent orders. */\n getShopDashboard(input?: CommerceGetShopDashboardInput): Promise<CommerceShopDashboard>;\n\n // Product Assembly\n /** Create a batch (product assembly with tiers). Supports blind_box, ichiban_kuji, direct_sale. */\n createBatch(input: CommerceCreateBatchInput): Promise<CommerceBatch>;\n /** Create a gacha pool with weighted probabilities and optional pity mechanics. */\n createGachaPool(input: CommerceCreateGachaPoolInput): Promise<CommerceGachaPool>;\n\n // Campaign Lifecycle\n /** Launch a sales campaign in draft status. Connect a Batch or Gacha pool to the storefront. */\n launchCampaign(input: CommerceLaunchCampaignInput): Promise<CommerceCampaign>;\n /** Activate a draft/paused campaign — makes it live and purchasable. */\n activateCampaign(input: CommerceActivateCampaignInput): Promise<CommerceCampaign>;\n /** Pause an active campaign. Existing orders unaffected. */\n pauseCampaign(input: CommercePauseCampaignInput): Promise<CommerceCampaign>;\n /** Permanently end a campaign (terminal state). */\n endCampaign(input: CommerceEndCampaignInput): Promise<CommerceCampaign>;\n /** Update campaign configuration (editable fields depend on status). */\n updateCampaign(input: CommerceUpdateCampaignInput): Promise<CommerceCampaign>;\n /** Get detailed campaign info including batch/gacha config and tiers. */\n getCampaignInfo(input: CommerceGetCampaignInfoInput): Promise<any>;\n /** Get unified campaign items list (works for both batch and gacha campaigns). */\n getCampaignItems(input: CommerceGetCampaignItemsInput): Promise<CommerceCampaignItem[]>;\n\n // Purchase / Draw\n /** Execute a purchase or draw. Handles payment, draw mechanics, settlement, and ownership transfer. */\n executePurchase(input: CommerceExecutePurchaseInput): Promise<CommerceDrawResult>;\n /** Get the authenticated user's order history. */\n getMyOrders(input?: CommerceGetMyOrdersInput): Promise<CommerceOrder[]>;\n\n // Wholesale\n /** Publish a batch to the wholesale market for other shopkeepers to procure. */\n publishToWholesale(input: CommercePublishToWholesaleInput): Promise<any>;\n /** Browse available wholesale listings. */\n browseWholesale(input?: CommerceBrowseWholesaleInput): Promise<CommerceWholesaleListing[]>;\n /** Procure goods from the wholesale market. */\n procureBatch(input: CommerceProcureBatchInput): Promise<any>;\n\n // Inventory\n /** View and manage shop inventory (list or sync from Core). */\n manageInventory(input?: CommerceManageInventoryInput): Promise<any>;\n /** Register existing Core instances into shop inventory. */\n registerInstances(input: CommerceRegisterInstancesInput): Promise<any>;\n /** Mint new instances directly into shop inventory. */\n mintToInventory(input: CommerceMintToInventoryInput): Promise<any>;\n\n // Settlement\n /** Get settlement report with revenue breakdown. */\n getSettlementReport(input?: CommerceGetSettlementReportInput): Promise<any>;\n\n // Discovery\n /** Search the marketplace for campaigns. */\n searchMarketplace(input?: CommerceSearchMarketplaceInput): Promise<any[]>;\n /** Find shops selling a specific GoodZ card. */\n getShopsByBlueprint(input: CommerceGetShopsByBlueprintInput): Promise<any[]>;\n\n // Physical Redemption\n /** Request physical redemption for a purchased item. */\n redeemPhysical(input: CommerceRedeemPhysicalInput): Promise<any>;\n\n // Webhooks\n /** Register a webhook URL to receive shop event notifications. */\n registerWebhook(input: CommerceRegisterWebhookInput): Promise<CommerceWebhook>;\n /** List all registered webhook endpoints. */\n listWebhooks(): Promise<CommerceWebhook[]>;\n /** Send a test ping to a webhook endpoint. */\n testWebhook(input: CommerceTestWebhookInput): Promise<any>;\n /** Delete a webhook endpoint. */\n deleteWebhook(input: CommerceDeleteWebhookInput): Promise<any>;\n\n // OAuth App Management\n /** Register a new OAuth application with Commerce scopes. */\n registerApp(input: CommerceRegisterAppInput): Promise<any>;\n /** Update an existing OAuth application. */\n updateApp(input: CommerceUpdateAppInput): Promise<any>;\n /** List all OAuth applications owned by the user. */\n listMyApps(input?: CommerceListMyAppsInput): Promise<any[]>;\n /** Generate an OAuth authorization URL. */\n getAuthUrl(input?: CommerceGetAuthUrlInput): Promise<{ url: string }>;\n\n /** Call a raw MCP tool by name. Escape hatch for tools not yet in the typed API. */\n rawTool<T = any>(toolName: string, args?: Record<string, any>): Promise<T>;\n}\n\n// ─── Factory ────────────────────────────────────────────────\n\nexport function createCommerceNamespace(transport: TransportConfig): CommerceNamespace {\n const tool = <I extends Record<string, any>, O>(name: string) =>\n (input?: I) => callMcpTool<I, O>(transport, name, input as I);\n\n return {\n // Shop\n createShop: tool<CommerceCreateShopInput, CommerceShop>(\"create_shop\"),\n getShopDashboard: tool<CommerceGetShopDashboardInput, CommerceShopDashboard>(\"get_shop_dashboard\"),\n\n // Product Assembly\n createBatch: tool<CommerceCreateBatchInput, CommerceBatch>(\"assemble_batch\"),\n createGachaPool: tool<CommerceCreateGachaPoolInput, CommerceGachaPool>(\"create_gacha_pool\"),\n\n // Campaign Lifecycle\n launchCampaign: tool<CommerceLaunchCampaignInput, CommerceCampaign>(\"launch_sales_campaign\"),\n activateCampaign: tool<CommerceActivateCampaignInput, CommerceCampaign>(\"activate_campaign\"),\n pauseCampaign: tool<CommercePauseCampaignInput, CommerceCampaign>(\"pause_campaign\"),\n endCampaign: tool<CommerceEndCampaignInput, CommerceCampaign>(\"end_campaign\"),\n updateCampaign: tool<CommerceUpdateCampaignInput, CommerceCampaign>(\"update_campaign\"),\n getCampaignInfo: tool<CommerceGetCampaignInfoInput, any>(\"get_campaign_info\"),\n getCampaignItems: tool<CommerceGetCampaignItemsInput, CommerceCampaignItem[]>(\"get_campaign_items\"),\n\n // Purchase\n executePurchase: tool<CommerceExecutePurchaseInput, CommerceDrawResult>(\"execute_purchase\"),\n getMyOrders: tool<CommerceGetMyOrdersInput, CommerceOrder[]>(\"get_my_orders\"),\n\n // Wholesale\n publishToWholesale: tool<CommercePublishToWholesaleInput, any>(\"publish_to_wholesale\"),\n browseWholesale: tool<CommerceBrowseWholesaleInput, CommerceWholesaleListing[]>(\"browse_wholesale_market\"),\n procureBatch: tool<CommerceProcureBatchInput, any>(\"procure_batch\"),\n\n // Inventory\n manageInventory: tool<CommerceManageInventoryInput, any>(\"manage_inventory\"),\n registerInstances: tool<CommerceRegisterInstancesInput, any>(\"register_instances\"),\n mintToInventory: tool<CommerceMintToInventoryInput, any>(\"mint_to_inventory\"),\n\n // Settlement\n getSettlementReport: tool<CommerceGetSettlementReportInput, any>(\"get_settlement_report\"),\n\n // Discovery\n searchMarketplace: tool<CommerceSearchMarketplaceInput, any[]>(\"search_marketplace\"),\n getShopsByBlueprint: tool<CommerceGetShopsByBlueprintInput, any[]>(\"get_shops_by_blueprint\"),\n\n // Physical Redemption\n redeemPhysical: tool<CommerceRedeemPhysicalInput, any>(\"redeem_physical_goodz\"),\n\n // Webhooks\n registerWebhook: tool<CommerceRegisterWebhookInput, CommerceWebhook>(\"register_webhook\"),\n listWebhooks: tool<Record<string, never>, CommerceWebhook[]>(\"list_webhooks\"),\n testWebhook: tool<CommerceTestWebhookInput, any>(\"test_webhook\"),\n deleteWebhook: tool<CommerceDeleteWebhookInput, any>(\"delete_webhook\"),\n\n // OAuth App\n registerApp: tool<CommerceRegisterAppInput, any>(\"register_app\"),\n updateApp: tool<CommerceUpdateAppInput, any>(\"update_app\"),\n listMyApps: tool<CommerceListMyAppsInput, any[]>(\"list_my_apps\"),\n getAuthUrl: tool<CommerceGetAuthUrlInput, { url: string }>(\"get_auth_url\"),\n\n // Raw escape hatch\n rawTool: <T = any>(toolName: string, args?: Record<string, any>) =>\n callMcpTool<Record<string, any>, T>(transport, toolName, args),\n };\n}\n"]}
|
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import { X as TransportConfig } from '../transport-BOlScYEv.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @goodz-core/sdk — Commerce / Shops API Type Definitions
|
|
5
|
+
*
|
|
6
|
+
* Hand-crafted types mirroring the GoodZ.Commerce MCP tool surface.
|
|
7
|
+
* These cover shop management, batches, gacha pools, campaigns,
|
|
8
|
+
* wholesale, purchases, and settlement.
|
|
9
|
+
*
|
|
10
|
+
* Aligned with Commerce MCP as of 2026-03-20.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
type CampaignStatus = "draft" | "active" | "paused" | "ended" | "sold_out";
|
|
15
|
+
type SaleMode = "blind_box" | "ichiban_kuji" | "direct_sale" | "gacha";
|
|
16
|
+
type AuthorizationMode = "open" | "whitelist" | "approved_only";
|
|
17
|
+
type IntegrationMode = "hosted" | "custom";
|
|
18
|
+
interface CommerceCreateShopInput {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
logoUrl?: string;
|
|
22
|
+
slug?: string;
|
|
23
|
+
userId?: number;
|
|
24
|
+
}
|
|
25
|
+
interface CommerceShop {
|
|
26
|
+
id: number;
|
|
27
|
+
name: string;
|
|
28
|
+
description: string | null;
|
|
29
|
+
logoUrl: string | null;
|
|
30
|
+
slug: string | null;
|
|
31
|
+
ownerId: number;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
}
|
|
34
|
+
interface CommerceGetShopDashboardInput {
|
|
35
|
+
shopId?: number;
|
|
36
|
+
userId?: number;
|
|
37
|
+
}
|
|
38
|
+
interface CommerceShopDashboard {
|
|
39
|
+
shop: CommerceShop;
|
|
40
|
+
stats: {
|
|
41
|
+
totalOrders: number;
|
|
42
|
+
totalRevenue: number;
|
|
43
|
+
platformFees: number;
|
|
44
|
+
creatorShare: number;
|
|
45
|
+
shopShare: number;
|
|
46
|
+
activeCampaigns: number;
|
|
47
|
+
};
|
|
48
|
+
recentOrders: any[];
|
|
49
|
+
}
|
|
50
|
+
interface CommerceBatchTier {
|
|
51
|
+
tierName: string;
|
|
52
|
+
coreCardId: number;
|
|
53
|
+
quantity: number;
|
|
54
|
+
retailPriceCents: number;
|
|
55
|
+
imageUrl?: string;
|
|
56
|
+
}
|
|
57
|
+
interface CommerceCreateBatchInput {
|
|
58
|
+
shopId?: number;
|
|
59
|
+
name: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
imageUrl?: string;
|
|
62
|
+
saleMode: SaleMode;
|
|
63
|
+
tiers: CommerceBatchTier[];
|
|
64
|
+
/** Core goods ID to link the batch to a specific IP/card blueprint */
|
|
65
|
+
coreGoodsId?: number;
|
|
66
|
+
/** Whether this batch has limited supply */
|
|
67
|
+
isLimited?: boolean;
|
|
68
|
+
/** Total supply across all tiers */
|
|
69
|
+
totalSupply?: number;
|
|
70
|
+
/** Retail price in cents (for the entire batch or per unit) */
|
|
71
|
+
retailPriceCents?: number;
|
|
72
|
+
/** Number of units per box (for blind-box sale mode) */
|
|
73
|
+
unitsPerBox?: number;
|
|
74
|
+
/** Number of boxes per batch */
|
|
75
|
+
boxesPerBatch?: number;
|
|
76
|
+
userId?: number;
|
|
77
|
+
}
|
|
78
|
+
interface CommerceBatch {
|
|
79
|
+
id: number;
|
|
80
|
+
name: string;
|
|
81
|
+
description: string | null;
|
|
82
|
+
saleMode: SaleMode;
|
|
83
|
+
status: string;
|
|
84
|
+
tiers: CommerceBatchTier[];
|
|
85
|
+
createdAt: string;
|
|
86
|
+
}
|
|
87
|
+
interface CommerceGachaItem {
|
|
88
|
+
coreCardId: number;
|
|
89
|
+
name?: string;
|
|
90
|
+
imageUrl?: string;
|
|
91
|
+
weight: number;
|
|
92
|
+
rarity?: string;
|
|
93
|
+
quantity?: number;
|
|
94
|
+
}
|
|
95
|
+
interface CommercePityConfig {
|
|
96
|
+
softPityStart?: number;
|
|
97
|
+
hardPityAt?: number;
|
|
98
|
+
stepUpGuarantee?: number;
|
|
99
|
+
guaranteedRarity?: string;
|
|
100
|
+
}
|
|
101
|
+
interface CommerceCreateGachaPoolInput {
|
|
102
|
+
shopId?: number;
|
|
103
|
+
name: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
imageUrl?: string;
|
|
106
|
+
pricePerDrawCents: number;
|
|
107
|
+
isLimited: boolean;
|
|
108
|
+
totalDraws?: number;
|
|
109
|
+
items?: CommerceGachaItem[];
|
|
110
|
+
pityConfig?: CommercePityConfig;
|
|
111
|
+
userId?: number;
|
|
112
|
+
}
|
|
113
|
+
interface CommerceGachaPool {
|
|
114
|
+
id: number;
|
|
115
|
+
name: string;
|
|
116
|
+
description: string | null;
|
|
117
|
+
pricePerDrawCents: number;
|
|
118
|
+
isLimited: boolean;
|
|
119
|
+
totalDraws: number | null;
|
|
120
|
+
remainingDraws: number | null;
|
|
121
|
+
items: CommerceGachaItem[];
|
|
122
|
+
pityConfig: CommercePityConfig | null;
|
|
123
|
+
createdAt: string;
|
|
124
|
+
}
|
|
125
|
+
interface CommerceLaunchCampaignInput {
|
|
126
|
+
shopId?: number;
|
|
127
|
+
name: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
imageUrl?: string;
|
|
130
|
+
batchId?: number;
|
|
131
|
+
gachaPoolId?: number;
|
|
132
|
+
isProcured?: boolean;
|
|
133
|
+
procurementId?: number;
|
|
134
|
+
startsAt?: string;
|
|
135
|
+
endsAt?: string;
|
|
136
|
+
userId?: number;
|
|
137
|
+
}
|
|
138
|
+
interface CommerceCampaign {
|
|
139
|
+
id: number;
|
|
140
|
+
name: string;
|
|
141
|
+
description: string | null;
|
|
142
|
+
imageUrl: string | null;
|
|
143
|
+
status: CampaignStatus;
|
|
144
|
+
batchId: number | null;
|
|
145
|
+
gachaPoolId: number | null;
|
|
146
|
+
startsAt: string | null;
|
|
147
|
+
endsAt: string | null;
|
|
148
|
+
createdAt: string;
|
|
149
|
+
}
|
|
150
|
+
interface CommerceActivateCampaignInput {
|
|
151
|
+
campaignId: number;
|
|
152
|
+
userId?: number;
|
|
153
|
+
}
|
|
154
|
+
interface CommercePauseCampaignInput {
|
|
155
|
+
campaignId: number;
|
|
156
|
+
userId?: number;
|
|
157
|
+
}
|
|
158
|
+
interface CommerceEndCampaignInput {
|
|
159
|
+
campaignId: number;
|
|
160
|
+
userId?: number;
|
|
161
|
+
}
|
|
162
|
+
interface CommerceUpdateCampaignInput {
|
|
163
|
+
campaignId: number;
|
|
164
|
+
name?: string;
|
|
165
|
+
description?: string;
|
|
166
|
+
imageUrl?: string;
|
|
167
|
+
/** Link or update the batch for this campaign */
|
|
168
|
+
batchId?: number;
|
|
169
|
+
/** Link or update the gacha pool for this campaign */
|
|
170
|
+
gachaPoolId?: number;
|
|
171
|
+
startsAt?: string;
|
|
172
|
+
endsAt?: string;
|
|
173
|
+
userId?: number;
|
|
174
|
+
}
|
|
175
|
+
interface CommerceGetCampaignInfoInput {
|
|
176
|
+
campaignId: number;
|
|
177
|
+
}
|
|
178
|
+
interface CommerceGetCampaignItemsInput {
|
|
179
|
+
campaign_id: number;
|
|
180
|
+
enrich_images?: boolean;
|
|
181
|
+
}
|
|
182
|
+
interface CommerceCampaignItem {
|
|
183
|
+
sourceType: "batch" | "gacha";
|
|
184
|
+
coreCardId: number;
|
|
185
|
+
name: string | null;
|
|
186
|
+
imageUrl: string | null;
|
|
187
|
+
quantity: number | null;
|
|
188
|
+
probability: number | null;
|
|
189
|
+
retailPriceCents: number | null;
|
|
190
|
+
rarity: string | null;
|
|
191
|
+
}
|
|
192
|
+
interface CommerceExecutePurchaseInput {
|
|
193
|
+
campaignId: number;
|
|
194
|
+
quantity?: number;
|
|
195
|
+
tierId?: number;
|
|
196
|
+
userId?: number;
|
|
197
|
+
}
|
|
198
|
+
interface CommerceDrawResult {
|
|
199
|
+
orderId: number;
|
|
200
|
+
items: Array<{
|
|
201
|
+
cardId: number;
|
|
202
|
+
cardName: string | null;
|
|
203
|
+
imageUrl: string | null;
|
|
204
|
+
instanceId: number;
|
|
205
|
+
instanceCode: string;
|
|
206
|
+
rarity: string | null;
|
|
207
|
+
tierName: string | null;
|
|
208
|
+
}>;
|
|
209
|
+
totalCharged: number;
|
|
210
|
+
platformFee: number;
|
|
211
|
+
}
|
|
212
|
+
interface CommerceGetMyOrdersInput {
|
|
213
|
+
userId?: number;
|
|
214
|
+
limit?: number;
|
|
215
|
+
}
|
|
216
|
+
interface CommerceOrder {
|
|
217
|
+
id: number;
|
|
218
|
+
campaignId: number;
|
|
219
|
+
campaignName: string;
|
|
220
|
+
quantity: number;
|
|
221
|
+
totalPaid: number;
|
|
222
|
+
status: string;
|
|
223
|
+
createdAt: string;
|
|
224
|
+
items: any[];
|
|
225
|
+
}
|
|
226
|
+
interface CommercePublishToWholesaleInput {
|
|
227
|
+
batchId: number;
|
|
228
|
+
wholesalePriceCents?: number;
|
|
229
|
+
channelMarginBps?: number;
|
|
230
|
+
totalStock?: number;
|
|
231
|
+
authorizationMode?: AuthorizationMode;
|
|
232
|
+
userId?: number;
|
|
233
|
+
}
|
|
234
|
+
interface CommerceBrowseWholesaleInput {
|
|
235
|
+
keyword?: string;
|
|
236
|
+
minPrice?: number;
|
|
237
|
+
maxPrice?: number;
|
|
238
|
+
authorizationMode?: AuthorizationMode;
|
|
239
|
+
creatorId?: string;
|
|
240
|
+
saleMode?: string;
|
|
241
|
+
limit?: number;
|
|
242
|
+
}
|
|
243
|
+
interface CommerceWholesaleListing {
|
|
244
|
+
id: number;
|
|
245
|
+
batchId: number;
|
|
246
|
+
batchName: string;
|
|
247
|
+
wholesalePriceCents: number | null;
|
|
248
|
+
channelMarginBps: number | null;
|
|
249
|
+
totalStock: number | null;
|
|
250
|
+
remainingStock: number | null;
|
|
251
|
+
authorizationMode: AuthorizationMode;
|
|
252
|
+
saleMode: SaleMode;
|
|
253
|
+
creatorId: string;
|
|
254
|
+
}
|
|
255
|
+
interface CommerceProcureBatchInput {
|
|
256
|
+
listingId: number;
|
|
257
|
+
quantity?: number;
|
|
258
|
+
shopId?: number;
|
|
259
|
+
userId?: number;
|
|
260
|
+
}
|
|
261
|
+
interface CommerceManageInventoryInput {
|
|
262
|
+
action?: "list" | "sync";
|
|
263
|
+
shopId?: number;
|
|
264
|
+
userId?: number;
|
|
265
|
+
}
|
|
266
|
+
interface CommerceRegisterInstancesInput {
|
|
267
|
+
shopId?: number;
|
|
268
|
+
/** Array of instance objects or IDs to register */
|
|
269
|
+
instances: Array<{
|
|
270
|
+
instanceId: number;
|
|
271
|
+
[key: string]: any;
|
|
272
|
+
}> | number[];
|
|
273
|
+
/** Source of the instances (e.g. "core_mint", "transfer", "import") */
|
|
274
|
+
source?: string;
|
|
275
|
+
userId?: number;
|
|
276
|
+
}
|
|
277
|
+
interface CommerceMintToInventoryInput {
|
|
278
|
+
shopId?: number;
|
|
279
|
+
coreCardId: number;
|
|
280
|
+
quantity?: number;
|
|
281
|
+
/** Display name for the minted instances */
|
|
282
|
+
name?: string;
|
|
283
|
+
userId?: number;
|
|
284
|
+
}
|
|
285
|
+
interface CommerceGetSettlementReportInput {
|
|
286
|
+
shopId?: number;
|
|
287
|
+
userId?: number;
|
|
288
|
+
/** Number of days to include in the report period */
|
|
289
|
+
periodDays?: number;
|
|
290
|
+
}
|
|
291
|
+
interface CommerceSearchMarketplaceInput {
|
|
292
|
+
/** Search query string */
|
|
293
|
+
query?: string;
|
|
294
|
+
/** Filter by sale mode */
|
|
295
|
+
sale_mode?: SaleMode;
|
|
296
|
+
/** Minimum price in cents */
|
|
297
|
+
min_price_cents?: number;
|
|
298
|
+
/** Maximum price in cents */
|
|
299
|
+
max_price_cents?: number;
|
|
300
|
+
/** Filter by specific shop */
|
|
301
|
+
shop_id?: number;
|
|
302
|
+
/** Sort order (e.g. "newest", "price_asc", "price_desc", "popular") */
|
|
303
|
+
sort?: string;
|
|
304
|
+
/** Filter by status (e.g. "active") */
|
|
305
|
+
status?: string;
|
|
306
|
+
/** Page number (1-based) */
|
|
307
|
+
page?: number;
|
|
308
|
+
/** Items per page */
|
|
309
|
+
page_size?: number;
|
|
310
|
+
}
|
|
311
|
+
interface CommerceGetShopsByBlueprintInput {
|
|
312
|
+
/** Core card ID to find shops selling this blueprint */
|
|
313
|
+
core_card_id: number;
|
|
314
|
+
/** Include ended campaigns */
|
|
315
|
+
include_ended?: boolean;
|
|
316
|
+
/** Page number (1-based) */
|
|
317
|
+
page?: number;
|
|
318
|
+
/** Items per page */
|
|
319
|
+
page_size?: number;
|
|
320
|
+
}
|
|
321
|
+
interface CommerceRedeemPhysicalInput {
|
|
322
|
+
orderItemId: number;
|
|
323
|
+
shippingName: string;
|
|
324
|
+
shippingAddress: string;
|
|
325
|
+
shippingPhone: string;
|
|
326
|
+
coreCardId?: number;
|
|
327
|
+
/** Core inventory item ID for the specific instance to redeem */
|
|
328
|
+
coreInventoryItemId?: number;
|
|
329
|
+
userId?: number;
|
|
330
|
+
}
|
|
331
|
+
interface CommerceRegisterWebhookInput {
|
|
332
|
+
url: string;
|
|
333
|
+
events: string[];
|
|
334
|
+
shop_id?: number;
|
|
335
|
+
}
|
|
336
|
+
interface CommerceWebhook {
|
|
337
|
+
id: number;
|
|
338
|
+
url: string;
|
|
339
|
+
events: string[];
|
|
340
|
+
status: string;
|
|
341
|
+
failureCount: number;
|
|
342
|
+
signingSecret?: string;
|
|
343
|
+
}
|
|
344
|
+
interface CommerceTestWebhookInput {
|
|
345
|
+
webhook_id: number;
|
|
346
|
+
}
|
|
347
|
+
interface CommerceDeleteWebhookInput {
|
|
348
|
+
webhook_id: number;
|
|
349
|
+
}
|
|
350
|
+
interface CommerceRegisterAppInput {
|
|
351
|
+
appName: string;
|
|
352
|
+
/** App description */
|
|
353
|
+
description?: string;
|
|
354
|
+
/** Website URL for the app */
|
|
355
|
+
websiteUrl?: string;
|
|
356
|
+
/** Icon URL for the app */
|
|
357
|
+
iconUrl?: string;
|
|
358
|
+
redirectUris?: string[];
|
|
359
|
+
coreScopes?: string[];
|
|
360
|
+
commerceScopes?: string[];
|
|
361
|
+
userId?: number;
|
|
362
|
+
}
|
|
363
|
+
interface CommerceUpdateAppInput {
|
|
364
|
+
clientId: string;
|
|
365
|
+
appName?: string;
|
|
366
|
+
description?: string;
|
|
367
|
+
websiteUrl?: string;
|
|
368
|
+
iconUrl?: string;
|
|
369
|
+
redirectUris?: string[];
|
|
370
|
+
coreScopes?: string[];
|
|
371
|
+
commerceScopes?: string[];
|
|
372
|
+
integrationMode?: IntegrationMode;
|
|
373
|
+
userId?: number;
|
|
374
|
+
}
|
|
375
|
+
interface CommerceListMyAppsInput {
|
|
376
|
+
userId?: number;
|
|
377
|
+
}
|
|
378
|
+
interface CommerceGetAuthUrlInput {
|
|
379
|
+
callbackUrl?: string;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* @goodz-core/sdk — Commerce / Shops Namespace
|
|
384
|
+
*
|
|
385
|
+
* Provides typed access to GoodZ.Commerce MCP tools:
|
|
386
|
+
* shop management, batches, gacha pools, campaigns,
|
|
387
|
+
* wholesale, purchases, settlement, and webhooks.
|
|
388
|
+
*
|
|
389
|
+
* @module
|
|
390
|
+
*/
|
|
391
|
+
|
|
392
|
+
interface CommerceNamespace {
|
|
393
|
+
/** Create a new shop. */
|
|
394
|
+
createShop(input: CommerceCreateShopInput): Promise<CommerceShop>;
|
|
395
|
+
/** Get shop dashboard with stats, revenue, and recent orders. */
|
|
396
|
+
getShopDashboard(input?: CommerceGetShopDashboardInput): Promise<CommerceShopDashboard>;
|
|
397
|
+
/** Create a batch (product assembly with tiers). Supports blind_box, ichiban_kuji, direct_sale. */
|
|
398
|
+
createBatch(input: CommerceCreateBatchInput): Promise<CommerceBatch>;
|
|
399
|
+
/** Create a gacha pool with weighted probabilities and optional pity mechanics. */
|
|
400
|
+
createGachaPool(input: CommerceCreateGachaPoolInput): Promise<CommerceGachaPool>;
|
|
401
|
+
/** Launch a sales campaign in draft status. Connect a Batch or Gacha pool to the storefront. */
|
|
402
|
+
launchCampaign(input: CommerceLaunchCampaignInput): Promise<CommerceCampaign>;
|
|
403
|
+
/** Activate a draft/paused campaign — makes it live and purchasable. */
|
|
404
|
+
activateCampaign(input: CommerceActivateCampaignInput): Promise<CommerceCampaign>;
|
|
405
|
+
/** Pause an active campaign. Existing orders unaffected. */
|
|
406
|
+
pauseCampaign(input: CommercePauseCampaignInput): Promise<CommerceCampaign>;
|
|
407
|
+
/** Permanently end a campaign (terminal state). */
|
|
408
|
+
endCampaign(input: CommerceEndCampaignInput): Promise<CommerceCampaign>;
|
|
409
|
+
/** Update campaign configuration (editable fields depend on status). */
|
|
410
|
+
updateCampaign(input: CommerceUpdateCampaignInput): Promise<CommerceCampaign>;
|
|
411
|
+
/** Get detailed campaign info including batch/gacha config and tiers. */
|
|
412
|
+
getCampaignInfo(input: CommerceGetCampaignInfoInput): Promise<any>;
|
|
413
|
+
/** Get unified campaign items list (works for both batch and gacha campaigns). */
|
|
414
|
+
getCampaignItems(input: CommerceGetCampaignItemsInput): Promise<CommerceCampaignItem[]>;
|
|
415
|
+
/** Execute a purchase or draw. Handles payment, draw mechanics, settlement, and ownership transfer. */
|
|
416
|
+
executePurchase(input: CommerceExecutePurchaseInput): Promise<CommerceDrawResult>;
|
|
417
|
+
/** Get the authenticated user's order history. */
|
|
418
|
+
getMyOrders(input?: CommerceGetMyOrdersInput): Promise<CommerceOrder[]>;
|
|
419
|
+
/** Publish a batch to the wholesale market for other shopkeepers to procure. */
|
|
420
|
+
publishToWholesale(input: CommercePublishToWholesaleInput): Promise<any>;
|
|
421
|
+
/** Browse available wholesale listings. */
|
|
422
|
+
browseWholesale(input?: CommerceBrowseWholesaleInput): Promise<CommerceWholesaleListing[]>;
|
|
423
|
+
/** Procure goods from the wholesale market. */
|
|
424
|
+
procureBatch(input: CommerceProcureBatchInput): Promise<any>;
|
|
425
|
+
/** View and manage shop inventory (list or sync from Core). */
|
|
426
|
+
manageInventory(input?: CommerceManageInventoryInput): Promise<any>;
|
|
427
|
+
/** Register existing Core instances into shop inventory. */
|
|
428
|
+
registerInstances(input: CommerceRegisterInstancesInput): Promise<any>;
|
|
429
|
+
/** Mint new instances directly into shop inventory. */
|
|
430
|
+
mintToInventory(input: CommerceMintToInventoryInput): Promise<any>;
|
|
431
|
+
/** Get settlement report with revenue breakdown. */
|
|
432
|
+
getSettlementReport(input?: CommerceGetSettlementReportInput): Promise<any>;
|
|
433
|
+
/** Search the marketplace for campaigns. */
|
|
434
|
+
searchMarketplace(input?: CommerceSearchMarketplaceInput): Promise<any[]>;
|
|
435
|
+
/** Find shops selling a specific GoodZ card. */
|
|
436
|
+
getShopsByBlueprint(input: CommerceGetShopsByBlueprintInput): Promise<any[]>;
|
|
437
|
+
/** Request physical redemption for a purchased item. */
|
|
438
|
+
redeemPhysical(input: CommerceRedeemPhysicalInput): Promise<any>;
|
|
439
|
+
/** Register a webhook URL to receive shop event notifications. */
|
|
440
|
+
registerWebhook(input: CommerceRegisterWebhookInput): Promise<CommerceWebhook>;
|
|
441
|
+
/** List all registered webhook endpoints. */
|
|
442
|
+
listWebhooks(): Promise<CommerceWebhook[]>;
|
|
443
|
+
/** Send a test ping to a webhook endpoint. */
|
|
444
|
+
testWebhook(input: CommerceTestWebhookInput): Promise<any>;
|
|
445
|
+
/** Delete a webhook endpoint. */
|
|
446
|
+
deleteWebhook(input: CommerceDeleteWebhookInput): Promise<any>;
|
|
447
|
+
/** Register a new OAuth application with Commerce scopes. */
|
|
448
|
+
registerApp(input: CommerceRegisterAppInput): Promise<any>;
|
|
449
|
+
/** Update an existing OAuth application. */
|
|
450
|
+
updateApp(input: CommerceUpdateAppInput): Promise<any>;
|
|
451
|
+
/** List all OAuth applications owned by the user. */
|
|
452
|
+
listMyApps(input?: CommerceListMyAppsInput): Promise<any[]>;
|
|
453
|
+
/** Generate an OAuth authorization URL. */
|
|
454
|
+
getAuthUrl(input?: CommerceGetAuthUrlInput): Promise<{
|
|
455
|
+
url: string;
|
|
456
|
+
}>;
|
|
457
|
+
/** Call a raw MCP tool by name. Escape hatch for tools not yet in the typed API. */
|
|
458
|
+
rawTool<T = any>(toolName: string, args?: Record<string, any>): Promise<T>;
|
|
459
|
+
}
|
|
460
|
+
declare function createCommerceNamespace(transport: TransportConfig): CommerceNamespace;
|
|
461
|
+
|
|
462
|
+
export { type AuthorizationMode, type CampaignStatus, type CommerceActivateCampaignInput, type CommerceBatch, type CommerceBatchTier, type CommerceBrowseWholesaleInput, type CommerceCampaign, type CommerceCampaignItem, type CommerceCreateBatchInput, type CommerceCreateGachaPoolInput, type CommerceCreateShopInput, type CommerceDeleteWebhookInput, type CommerceDrawResult, type CommerceEndCampaignInput, type CommerceExecutePurchaseInput, type CommerceGachaItem, type CommerceGachaPool, type CommerceGetAuthUrlInput, type CommerceGetCampaignInfoInput, type CommerceGetCampaignItemsInput, type CommerceGetMyOrdersInput, type CommerceGetSettlementReportInput, type CommerceGetShopDashboardInput, type CommerceGetShopsByBlueprintInput, type CommerceLaunchCampaignInput, type CommerceListMyAppsInput, type CommerceManageInventoryInput, type CommerceMintToInventoryInput, type CommerceNamespace, type CommerceOrder, type CommercePauseCampaignInput, type CommercePityConfig, type CommerceProcureBatchInput, type CommercePublishToWholesaleInput, type CommerceRedeemPhysicalInput, type CommerceRegisterAppInput, type CommerceRegisterInstancesInput, type CommerceRegisterWebhookInput, type CommerceSearchMarketplaceInput, type CommerceShop, type CommerceShopDashboard, type CommerceTestWebhookInput, type CommerceUpdateAppInput, type CommerceUpdateCampaignInput, type CommerceWebhook, type CommerceWholesaleListing, type IntegrationMode, type SaleMode, createCommerceNamespace };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|