@goodz-core/sdk 0.1.0 → 0.3.0
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 +350 -0
- 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-7O6UN2D2.js +102 -0
- package/dist/chunk-7O6UN2D2.js.map +1 -0
- package/dist/chunk-JAVMQXJM.js +27 -0
- package/dist/chunk-JAVMQXJM.js.map +1 -0
- package/dist/chunk-K6IFJWLB.js +924 -0
- package/dist/chunk-K6IFJWLB.js.map +1 -0
- package/dist/chunk-MUZDYQ67.js +56 -0
- package/dist/chunk-MUZDYQ67.js.map +1 -0
- package/dist/chunk-OUKZ2PRD.js +37 -0
- package/dist/chunk-OUKZ2PRD.js.map +1 -0
- package/dist/commerce/index.d.ts +407 -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 +34 -4
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/transport-BOlScYEv.d.ts +377 -0
- package/dist/ui/index.d.ts +56 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/index.js.map +1 -0
- package/package.json +43 -3
- package/dist/chunk-G7NKU6PT.js +0 -183
- package/dist/chunk-G7NKU6PT.js.map +0 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -1,394 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Input types: {Namespace}{Method}Input
|
|
10
|
-
* Output types: {Namespace}{Method}Output
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
*/
|
|
14
|
-
type SaleType = "direct" | "wholesale" | "retail_resale" | "gacha" | "trade";
|
|
15
|
-
type TransferReason = "purchase" | "gift" | "trade" | "admin_transfer";
|
|
16
|
-
type PurchaseChannel = "web" | "ios" | "android";
|
|
17
|
-
type ZcoinTxType = "DEPOSIT" | "PURCHASE" | "APP_PAYMENT" | "DIRECT_PURCHASE" | "REFUND" | "ADJUSTMENT" | "EXPIRY";
|
|
18
|
-
interface ZcoinGetMyBalanceOutput {
|
|
19
|
-
balance: number;
|
|
20
|
-
totalDeposited: number;
|
|
21
|
-
totalSpent: number;
|
|
22
|
-
version: number;
|
|
23
|
-
}
|
|
24
|
-
interface ZcoinGetMyHistoryInput {
|
|
25
|
-
limit?: number;
|
|
26
|
-
offset?: number;
|
|
27
|
-
txType?: ZcoinTxType;
|
|
28
|
-
}
|
|
29
|
-
interface ZcoinCommercialTransferInput {
|
|
30
|
-
/** ID of the card_instance to transfer */
|
|
31
|
-
instanceId: number;
|
|
32
|
-
/** Buyer's userId — will be debited Z-coin */
|
|
33
|
-
buyerUserId: number;
|
|
34
|
-
/** Seller's userId — must be current owner of the instance */
|
|
35
|
-
sellerUserId: number;
|
|
36
|
-
/** Transaction price in Z-coin hundredths (e.g. 1050 = 10.50 Z-coin) */
|
|
37
|
-
priceZcoin: number;
|
|
38
|
-
/** Type of sale — determines fee rules */
|
|
39
|
-
saleType: SaleType;
|
|
40
|
-
/** Idempotency key (e.g., Commerce order ID, Exchange trade ID) */
|
|
41
|
-
referenceId: string;
|
|
42
|
-
/** OAuth APP client ID of the calling application */
|
|
43
|
-
appClientId: string;
|
|
44
|
-
/** Human-readable description of the transaction */
|
|
45
|
-
description?: string;
|
|
46
|
-
/** Optional listing ID (for Exchange trades) */
|
|
47
|
-
listingId?: number;
|
|
48
|
-
}
|
|
49
|
-
interface ZcoinCommercialTransferOutput {
|
|
50
|
-
success: true;
|
|
51
|
-
tradeId: number;
|
|
52
|
-
zcoinTxId: number;
|
|
53
|
-
ownershipEventId: number;
|
|
54
|
-
platformFee: number;
|
|
55
|
-
sellerProceeds: number;
|
|
56
|
-
primarySaleFeeApplied: boolean;
|
|
57
|
-
primarySaleFeeMarked: boolean;
|
|
58
|
-
}
|
|
59
|
-
interface ZcoinMintAndChargeInput {
|
|
60
|
-
/** The card to mint (probability result from Commerce) */
|
|
61
|
-
cardId: number;
|
|
62
|
-
/** The buyer's user ID (will be debited Z-coin and receive the new instance) */
|
|
63
|
-
buyerUserId: number;
|
|
64
|
-
/** Price per unit in Z-coin hundredths (e.g. 1050 = 10.50 Z-coin) */
|
|
65
|
-
priceZcoin: number;
|
|
66
|
-
/** Type of sale */
|
|
67
|
-
saleType?: "gacha" | "direct";
|
|
68
|
-
/** Idempotency key (e.g., Commerce order ID) */
|
|
69
|
-
referenceId: string;
|
|
70
|
-
/** OAuth APP client ID of the calling application */
|
|
71
|
-
appClientId: string;
|
|
72
|
-
/** Human-readable description */
|
|
73
|
-
description?: string;
|
|
74
|
-
/** Number of instances to mint (default 1, max 10 for batch gacha) */
|
|
75
|
-
quantity?: number;
|
|
76
|
-
}
|
|
77
|
-
interface ZcoinMintAndChargeOutput {
|
|
78
|
-
success: boolean;
|
|
79
|
-
tradeId: number;
|
|
80
|
-
zcoinTxId: number;
|
|
81
|
-
platformFee: number;
|
|
82
|
-
sellerProceeds: number;
|
|
83
|
-
authorizationId: number;
|
|
84
|
-
remainingMints: number | null;
|
|
85
|
-
instances: Array<{
|
|
86
|
-
id: number;
|
|
87
|
-
instanceCode: string;
|
|
88
|
-
shortCode: string;
|
|
89
|
-
}>;
|
|
90
|
-
}
|
|
91
|
-
interface ZcoinChargeUserInput {
|
|
92
|
-
/** Z-coin amount to charge (in hundredths, e.g. 1050 = 10.50 Z-coin) */
|
|
93
|
-
amount: number;
|
|
94
|
-
/** OAuth app client ID making the charge */
|
|
95
|
-
appClientId: string;
|
|
96
|
-
/** Unique order/reference ID from the APP (for idempotency) */
|
|
97
|
-
appOrderId: string;
|
|
98
|
-
/** Human-readable description of what the user is paying for */
|
|
99
|
-
description: string;
|
|
100
|
-
}
|
|
101
|
-
interface ZcoinChargeUserOutput {
|
|
102
|
-
success: boolean;
|
|
103
|
-
transactionId: number;
|
|
104
|
-
amountCharged: number;
|
|
105
|
-
platformFee: number;
|
|
106
|
-
developerProceeds: number;
|
|
107
|
-
balanceAfter: number;
|
|
108
|
-
referenceId: string;
|
|
109
|
-
}
|
|
110
|
-
interface ZcoinCreateDirectPurchaseOrderInput {
|
|
111
|
-
/** The card instance to purchase */
|
|
112
|
-
instanceId: number;
|
|
113
|
-
/** The seller's user ID */
|
|
114
|
-
sellerUserId: number;
|
|
115
|
-
/** Price in Z-coin hundredths (e.g. 5000 = 50.00 Z-coin) */
|
|
116
|
-
priceZcoin: number;
|
|
117
|
-
/** Type of sale */
|
|
118
|
-
saleType: SaleType;
|
|
119
|
-
/** OAuth APP client ID */
|
|
120
|
-
appClientId: string;
|
|
121
|
-
/** Idempotency key from the calling APP */
|
|
122
|
-
referenceId: string;
|
|
123
|
-
/** Human-readable description */
|
|
124
|
-
description?: string;
|
|
125
|
-
/** Purchase channel */
|
|
126
|
-
channel?: PurchaseChannel;
|
|
127
|
-
/** Frontend origin for redirect URLs */
|
|
128
|
-
origin: string;
|
|
129
|
-
/** Optional listing ID (for Exchange trades) */
|
|
130
|
-
listingId?: number;
|
|
131
|
-
}
|
|
132
|
-
interface ZcoinCreateDirectPurchaseOrderOutput {
|
|
133
|
-
sessionId: string;
|
|
134
|
-
checkoutUrl: string;
|
|
135
|
-
priceZcoin: number;
|
|
136
|
-
fiatAmountCents: number;
|
|
137
|
-
groupId: string;
|
|
138
|
-
channel: PurchaseChannel;
|
|
139
|
-
status: "pending_payment";
|
|
140
|
-
}
|
|
141
|
-
interface ZcoinGetDepositPackagesInput {
|
|
142
|
-
channel?: PurchaseChannel;
|
|
143
|
-
}
|
|
144
|
-
interface ZcoinDepositPackage {
|
|
145
|
-
id: string;
|
|
146
|
-
zcoinAmount: number;
|
|
147
|
-
zcoinHundredths: number;
|
|
148
|
-
label: string;
|
|
149
|
-
basePriceCents: number;
|
|
150
|
-
totalPriceCents: number;
|
|
151
|
-
channel: PurchaseChannel;
|
|
152
|
-
featured: boolean;
|
|
153
|
-
}
|
|
154
|
-
interface ZcoinCreateDepositOrderInput {
|
|
155
|
-
/** Z-coin amount to purchase (display units, e.g. 100 or 100.50) */
|
|
156
|
-
amount: number;
|
|
157
|
-
/** Purchase channel */
|
|
158
|
-
channel?: PurchaseChannel;
|
|
159
|
-
/** Frontend origin for redirect URLs */
|
|
160
|
-
origin: string;
|
|
161
|
-
}
|
|
162
|
-
interface ZcoinCreateDepositOrderOutput {
|
|
163
|
-
sessionId: string;
|
|
164
|
-
checkoutUrl: string;
|
|
165
|
-
zcoinAmount: number;
|
|
166
|
-
fiatAmountCents: number;
|
|
167
|
-
channel: PurchaseChannel;
|
|
168
|
-
status: "pending_payment";
|
|
169
|
-
}
|
|
170
|
-
interface ZcoinGetDepositStatusInput {
|
|
171
|
-
sessionId: string;
|
|
172
|
-
}
|
|
173
|
-
interface ZcoinGetDepositStatusOutput {
|
|
174
|
-
sessionId: string;
|
|
175
|
-
paymentStatus: string;
|
|
176
|
-
status: string;
|
|
177
|
-
zcoinAmount: number;
|
|
178
|
-
amountTotal: number | null;
|
|
179
|
-
currency: string | null;
|
|
180
|
-
}
|
|
181
|
-
interface InventoryGetUserInventoryInput {
|
|
182
|
-
userId?: number;
|
|
183
|
-
openId?: string;
|
|
184
|
-
seriesId?: number;
|
|
185
|
-
limit?: number;
|
|
186
|
-
offset?: number;
|
|
187
|
-
}
|
|
188
|
-
interface InventoryConfirmOwnershipInput {
|
|
189
|
-
userId: number;
|
|
190
|
-
cardId: number;
|
|
191
|
-
}
|
|
192
|
-
interface InventoryConfirmOwnershipOutput {
|
|
193
|
-
owns: boolean;
|
|
194
|
-
count: number;
|
|
195
|
-
}
|
|
196
|
-
interface InventoryMintInput {
|
|
197
|
-
cardId: number;
|
|
198
|
-
toUserId: number;
|
|
199
|
-
quantity?: number;
|
|
200
|
-
referenceId?: string;
|
|
201
|
-
}
|
|
202
|
-
interface InventoryMintOutput {
|
|
203
|
-
success: boolean;
|
|
204
|
-
cardId: number;
|
|
205
|
-
toUserId: number;
|
|
206
|
-
quantity: number;
|
|
207
|
-
instances: Array<{
|
|
208
|
-
id: number;
|
|
209
|
-
instanceCode: string;
|
|
210
|
-
shortCode: string;
|
|
211
|
-
}>;
|
|
212
|
-
}
|
|
213
|
-
interface InventoryTransferInput {
|
|
214
|
-
instanceId: number;
|
|
215
|
-
toUserId: number;
|
|
216
|
-
reason?: TransferReason;
|
|
217
|
-
referenceId?: string;
|
|
218
|
-
expectedVersion?: number;
|
|
219
|
-
}
|
|
220
|
-
interface InventoryTransferOutput {
|
|
221
|
-
success: true;
|
|
222
|
-
idempotent: boolean;
|
|
223
|
-
instanceId: number;
|
|
224
|
-
fromUserId: number | null;
|
|
225
|
-
toUserId: number;
|
|
226
|
-
reason: string;
|
|
227
|
-
eventId?: number;
|
|
228
|
-
_deprecation_warning?: string;
|
|
229
|
-
}
|
|
230
|
-
interface InventoryTransferByCardInput {
|
|
231
|
-
cardId: number;
|
|
232
|
-
toUserId: number;
|
|
233
|
-
quantity?: number;
|
|
234
|
-
reason?: TransferReason;
|
|
235
|
-
referenceId?: string;
|
|
236
|
-
}
|
|
237
|
-
interface InventoryTransferByCardOutput {
|
|
238
|
-
success: true;
|
|
239
|
-
idempotent: boolean;
|
|
240
|
-
cardId: number;
|
|
241
|
-
fromUserId: number | null;
|
|
242
|
-
toUserId: number;
|
|
243
|
-
quantity: number;
|
|
244
|
-
reason: string;
|
|
245
|
-
_deprecation_warning?: string;
|
|
246
|
-
}
|
|
247
|
-
interface InventoryGrantMintAuthInput {
|
|
248
|
-
cardId: number;
|
|
249
|
-
granteeUserId: number;
|
|
250
|
-
granteeAppClientId?: string;
|
|
251
|
-
maxMintCount?: number;
|
|
252
|
-
validUntilMs?: number;
|
|
253
|
-
}
|
|
254
|
-
interface InventoryTransferHistoryInput {
|
|
255
|
-
instanceId?: number;
|
|
256
|
-
cardId?: number;
|
|
257
|
-
userId?: number;
|
|
258
|
-
limit?: number;
|
|
259
|
-
offset?: number;
|
|
260
|
-
}
|
|
261
|
-
interface CollectibleGetInstanceByIdInput {
|
|
262
|
-
instanceId: number;
|
|
263
|
-
claimToken?: string;
|
|
264
|
-
}
|
|
265
|
-
interface CollectibleGetPublicInstanceInput {
|
|
266
|
-
instanceCode: string;
|
|
267
|
-
}
|
|
268
|
-
interface CollectibleGetPublicInstancesBatchInput {
|
|
269
|
-
instanceIds: number[];
|
|
270
|
-
}
|
|
271
|
-
interface CollectibleGetCardProfileInput {
|
|
272
|
-
cardId: number;
|
|
273
|
-
}
|
|
274
|
-
interface CollectibleGetShellImageUrlInput {
|
|
275
|
-
cardId: number;
|
|
276
|
-
}
|
|
277
|
-
interface UserGetPublicProfileInput {
|
|
278
|
-
openId: string;
|
|
279
|
-
}
|
|
280
|
-
interface UserPublicProfile {
|
|
281
|
-
openId: string;
|
|
282
|
-
name: string;
|
|
283
|
-
avatarUrl: string | null;
|
|
284
|
-
joinedAt: Date;
|
|
285
|
-
stats: {
|
|
286
|
-
totalOwned: number;
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
interface UserGetPublicProfileByIdInput {
|
|
290
|
-
userId: number;
|
|
291
|
-
}
|
|
292
|
-
interface AuthGetOAuthAppInfoInput {
|
|
293
|
-
clientId: string;
|
|
294
|
-
}
|
|
295
|
-
interface AuthOAuthAppInfo {
|
|
296
|
-
appName: string;
|
|
297
|
-
iconUrl: string | null;
|
|
298
|
-
websiteUrl: string | null;
|
|
299
|
-
}
|
|
300
|
-
interface AuthUser {
|
|
301
|
-
id: number;
|
|
302
|
-
openId: string;
|
|
303
|
-
name: string;
|
|
304
|
-
email: string | null;
|
|
305
|
-
avatarUrl: string | null;
|
|
306
|
-
role: "admin" | "user";
|
|
307
|
-
}
|
|
308
|
-
interface FranchiseGetInput {
|
|
309
|
-
id?: number;
|
|
310
|
-
slug?: string;
|
|
311
|
-
}
|
|
312
|
-
interface SeriesGetInput {
|
|
313
|
-
id?: number;
|
|
314
|
-
slug?: string;
|
|
315
|
-
}
|
|
316
|
-
interface SeriesListByFranchiseInput {
|
|
317
|
-
franchiseId: number;
|
|
318
|
-
}
|
|
319
|
-
interface CardGetInput {
|
|
320
|
-
id: number;
|
|
321
|
-
}
|
|
322
|
-
interface CardListBySeriesInput {
|
|
323
|
-
seriesId: number;
|
|
324
|
-
}
|
|
325
|
-
interface GoodZApiFieldError {
|
|
326
|
-
path: (string | number)[];
|
|
327
|
-
message: string;
|
|
328
|
-
code: string;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Structured error from GoodZ.Core API.
|
|
332
|
-
* Includes tRPC error code, HTTP status, and optional Zod validation details.
|
|
333
|
-
*/
|
|
334
|
-
interface GoodZErrorV2 {
|
|
335
|
-
type: string;
|
|
336
|
-
code: string;
|
|
337
|
-
message: string;
|
|
338
|
-
httpStatus: number;
|
|
339
|
-
}
|
|
1
|
+
import { CommerceNamespace } from '../commerce/index.js';
|
|
2
|
+
export { AuthorizationMode, CampaignStatus, CommerceActivateCampaignInput, CommerceBatch, CommerceBatchTier, CommerceBrowseWholesaleInput, CommerceCampaign, CommerceCampaignItem, CommerceCreateBatchInput, CommerceCreateGachaPoolInput, CommerceCreateShopInput, CommerceDeleteWebhookInput, CommerceDrawResult, CommerceEndCampaignInput, CommerceExecutePurchaseInput, CommerceGachaItem, CommerceGachaPool, CommerceGetAuthUrlInput, CommerceGetCampaignInfoInput, CommerceGetCampaignItemsInput, CommerceGetMyOrdersInput, CommerceGetSettlementReportInput, CommerceGetShopDashboardInput, CommerceGetShopsByBlueprintInput, CommerceLaunchCampaignInput, CommerceListMyAppsInput, CommerceManageInventoryInput, CommerceMintToInventoryInput, CommerceOrder, CommercePauseCampaignInput, CommercePityConfig, CommerceProcureBatchInput, CommercePublishToWholesaleInput, CommerceRedeemPhysicalInput, CommerceRegisterAppInput, CommerceRegisterInstancesInput, CommerceRegisterWebhookInput, CommerceSearchMarketplaceInput, CommerceShop, CommerceShopDashboard, CommerceTestWebhookInput, CommerceUpdateAppInput, CommerceUpdateCampaignInput, CommerceWebhook, CommerceWholesaleListing, IntegrationMode, SaleMode } from '../commerce/index.js';
|
|
3
|
+
import { ExchangeNamespace } from '../exchange/index.js';
|
|
4
|
+
export { CompensationDirection, ExchangeAddToWatchlistInput, ExchangeBid, ExchangeBrowseMarketplaceInput, ExchangeBuyListingInput, ExchangeBuyListingOutput, ExchangeCancelListingInput, ExchangeCancelWtbInput, ExchangeCreateListingInput, ExchangeCreateListingOutput, ExchangeCreateWtbInput, ExchangeFulfillWtbInput, ExchangeFulfillWtbOutput, ExchangeGetBidsInput, ExchangeGetListingDetailInput, ExchangeGetMarketDataInput, ExchangeListing, ExchangeMarketData, ExchangePlaceBidInput, ExchangePlaceBidOutput, ExchangePricePoint, ExchangeProposeTradeInput, ExchangeRemoveFromWatchlistInput, ExchangeRespondToTradeInput, ExchangeRespondToTradeOutput, ExchangeTradeItem, ExchangeTradeProposal, ExchangeWatchlistItem, ExchangeWtb, ListingCondition, ListingType } from '../exchange/index.js';
|
|
5
|
+
import { AliveNamespace } from '../alive/index.js';
|
|
6
|
+
export { AliveBuildContextInput, AliveChatResponse, AliveClassifiedIntent, AliveClassifyIntentInput, AliveContext, AliveForgetMemoryInput, AliveGetIntimacyInput, AliveIntimacy, AliveMemory, AliveRecallMemoriesInput, AliveSendMessageInput, AliveStoreMemoryInput, AliveUpdateIntimacyInput, IntentCategory, MemoryType, MoodState } from '../alive/index.js';
|
|
7
|
+
import { b as AuthUser, A as AuthGetOAuthAppInfoInput, a as AuthOAuthAppInfo, e as CollectibleGetInstanceByIdInput, f as CollectibleGetPublicInstanceInput, g as CollectibleGetPublicInstancesBatchInput, d as CollectibleGetCardProfileInput, h as CollectibleGetShellImageUrlInput, O as ZcoinGetMyBalanceOutput, Q as ZcoinGetMyHistoryInput, L as ZcoinGetDepositPackagesInput, K as ZcoinDepositPackage, D as ZcoinCreateDepositOrderInput, E as ZcoinCreateDepositOrderOutput, M as ZcoinGetDepositStatusInput, N as ZcoinGetDepositStatusOutput, z as ZcoinCommercialTransferInput, B as ZcoinCommercialTransferOutput, R as ZcoinMintAndChargeInput, V as ZcoinMintAndChargeOutput, Z as ZcoinChargeUserInput, y as ZcoinChargeUserOutput, H as ZcoinCreateDirectPurchaseOrderInput, J as ZcoinCreateDirectPurchaseOrderOutput, l as InventoryGetUserInventoryInput, I as InventoryConfirmOwnershipInput, k as InventoryConfirmOwnershipOutput, n as InventoryMintInput, o as InventoryMintOutput, s as InventoryTransferInput, t as InventoryTransferOutput, p as InventoryTransferByCardInput, q as InventoryTransferByCardOutput, m as InventoryGrantMintAuthInput, r as InventoryTransferHistoryInput, w as UserGetPublicProfileInput, x as UserPublicProfile, U as UserGetPublicProfileByIdInput, F as FranchiseGetInput, u as SeriesGetInput, v as SeriesListByFranchiseInput, C as CardGetInput, c as CardListBySeriesInput } from '../transport-BOlScYEv.js';
|
|
8
|
+
export { G as GoodZApiError, i as GoodZApiFieldError, j as GoodZErrorV2, P as PurchaseChannel, S as SaleType, T as TransferReason, W as ZcoinTxType } from '../transport-BOlScYEv.js';
|
|
340
9
|
|
|
341
10
|
/**
|
|
342
|
-
* @goodz-core/sdk —
|
|
11
|
+
* @goodz-core/sdk/core — Unified GoodZ API Client
|
|
343
12
|
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
13
|
+
* One client, all services. Stripe-style namespace architecture:
|
|
14
|
+
* goodz.zcoin.* → Core settlement & Z-coin
|
|
15
|
+
* goodz.inventory.* → Core instance management
|
|
16
|
+
* goodz.collectible.* → Core card queries
|
|
17
|
+
* goodz.user.* → Core user profiles
|
|
18
|
+
* goodz.auth.* → Core auth
|
|
19
|
+
* goodz.ip.* → Core IP (franchise/series/card)
|
|
20
|
+
* goodz.commerce.* → Commerce/Shops (MCP)
|
|
21
|
+
* goodz.exchange.* → Exchange marketplace (MCP)
|
|
22
|
+
* goodz.alive.* → Alive companions (MCP)
|
|
346
23
|
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* - Mutations: POST /api/trpc/{procedure} body: {superjson-encoded}
|
|
350
|
-
* - Batch: GET /api/trpc/{p1},{p2}?input={0: ..., 1: ...}
|
|
351
|
-
*
|
|
352
|
-
* @internal
|
|
353
|
-
*/
|
|
354
|
-
|
|
355
|
-
declare class GoodZApiError extends Error {
|
|
356
|
-
readonly code: string;
|
|
357
|
-
readonly httpStatus: number;
|
|
358
|
-
readonly path: string;
|
|
359
|
-
readonly zodErrors?: GoodZApiFieldError[];
|
|
360
|
-
readonly data?: unknown;
|
|
361
|
-
constructor(opts: {
|
|
362
|
-
message: string;
|
|
363
|
-
code: string;
|
|
364
|
-
httpStatus: number;
|
|
365
|
-
path: string;
|
|
366
|
-
zodErrors?: GoodZApiFieldError[];
|
|
367
|
-
data?: unknown;
|
|
368
|
-
});
|
|
369
|
-
/** Human-readable summary including field errors if present. */
|
|
370
|
-
toDetailedString(): string;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* @goodz-core/sdk/core — Type-safe API client for GoodZ.Core
|
|
375
|
-
*
|
|
376
|
-
* Zero tRPC dependency — speaks the tRPC HTTP wire protocol directly
|
|
377
|
-
* using fetch + superjson. All types are hand-crafted and self-contained.
|
|
24
|
+
* Core uses tRPC HTTP wire protocol; sub-sites use MCP JSON-RPC 2.0.
|
|
25
|
+
* The client handles routing transparently.
|
|
378
26
|
*
|
|
379
27
|
* @example
|
|
380
28
|
* ```ts
|
|
381
|
-
* import { createGoodZClient } from "@goodz-core/sdk
|
|
29
|
+
* import { createGoodZClient } from "@goodz-core/sdk";
|
|
382
30
|
*
|
|
383
31
|
* const goodz = createGoodZClient({
|
|
384
|
-
* coreUrl: "https://goodzcore.manus.space",
|
|
385
32
|
* accessToken: "your-jwt-token",
|
|
386
33
|
* });
|
|
387
34
|
*
|
|
388
|
-
* //
|
|
35
|
+
* // Core APIs
|
|
389
36
|
* const balance = await goodz.zcoin.getMyBalance();
|
|
390
37
|
* const result = await goodz.zcoin.commercialTransfer({ ... });
|
|
391
|
-
*
|
|
38
|
+
*
|
|
39
|
+
* // Commerce APIs
|
|
40
|
+
* const shop = await goodz.commerce.createShop({ name: "My Shop" });
|
|
41
|
+
* const order = await goodz.commerce.executePurchase({ campaignId: 1, quantity: 1 });
|
|
42
|
+
*
|
|
43
|
+
* // Exchange APIs
|
|
44
|
+
* const listing = await goodz.exchange.createListing({ ... });
|
|
45
|
+
* const data = await goodz.exchange.getMarketData({ coreGoodzId: 42 });
|
|
46
|
+
*
|
|
47
|
+
* // Alive APIs
|
|
48
|
+
* const chat = await goodz.alive.sendMessage({ instanceId: 1, userId: 1, message: "Hello!" });
|
|
49
|
+
* const memories = await goodz.alive.recallMemories({ instanceId: 1, userId: 1, query: "birthday" });
|
|
392
50
|
* ```
|
|
393
51
|
*
|
|
394
52
|
* @module
|
|
@@ -400,6 +58,21 @@ interface GoodZClientConfig {
|
|
|
400
58
|
* @default "https://goodzcore.manus.space"
|
|
401
59
|
*/
|
|
402
60
|
coreUrl?: string;
|
|
61
|
+
/**
|
|
62
|
+
* GoodZ.Commerce (Shops) base URL.
|
|
63
|
+
* @default "https://goodzcommerce.manus.space"
|
|
64
|
+
*/
|
|
65
|
+
commerceUrl?: string;
|
|
66
|
+
/**
|
|
67
|
+
* GoodZ.Exchange base URL.
|
|
68
|
+
* @default "https://goodzexchange.manus.space"
|
|
69
|
+
*/
|
|
70
|
+
exchangeUrl?: string;
|
|
71
|
+
/**
|
|
72
|
+
* GoodZ.Alive base URL.
|
|
73
|
+
* @default "https://goodzalive.manus.space"
|
|
74
|
+
*/
|
|
75
|
+
aliveUrl?: string;
|
|
403
76
|
/**
|
|
404
77
|
* Static access token (JWT) for authentication.
|
|
405
78
|
* For server-to-server calls, obtain this via OAuth client_credentials flow.
|
|
@@ -542,25 +215,40 @@ interface GoodZClient {
|
|
|
542
215
|
readonly user: UserNamespace;
|
|
543
216
|
readonly auth: AuthNamespace;
|
|
544
217
|
readonly ip: IpNamespace;
|
|
218
|
+
readonly commerce: CommerceNamespace;
|
|
219
|
+
readonly exchange: ExchangeNamespace;
|
|
220
|
+
readonly alive: AliveNamespace;
|
|
545
221
|
/**
|
|
546
|
-
* Make a raw tRPC query call. Use this for routes not yet covered
|
|
222
|
+
* Make a raw tRPC query call to Core. Use this for routes not yet covered
|
|
547
223
|
* by the typed namespaces.
|
|
548
224
|
*/
|
|
549
225
|
rawQuery<T = any>(path: string, input?: any): Promise<T>;
|
|
550
226
|
/**
|
|
551
|
-
* Make a raw tRPC mutation call. Use this for routes not yet covered
|
|
227
|
+
* Make a raw tRPC mutation call to Core. Use this for routes not yet covered
|
|
552
228
|
* by the typed namespaces.
|
|
553
229
|
*/
|
|
554
230
|
rawMutation<T = any>(path: string, input?: any): Promise<T>;
|
|
555
231
|
}
|
|
556
232
|
/**
|
|
557
|
-
* Create a
|
|
233
|
+
* Create a unified GoodZ API client — one client for all services.
|
|
558
234
|
*
|
|
559
235
|
* @example Server-to-server with static token
|
|
560
236
|
* ```ts
|
|
561
237
|
* const goodz = createGoodZClient({
|
|
562
238
|
* accessToken: process.env.CORE_ACCESS_TOKEN,
|
|
563
239
|
* });
|
|
240
|
+
*
|
|
241
|
+
* // Core
|
|
242
|
+
* const balance = await goodz.zcoin.getMyBalance();
|
|
243
|
+
*
|
|
244
|
+
* // Commerce
|
|
245
|
+
* const shop = await goodz.commerce.createShop({ name: "My Shop" });
|
|
246
|
+
*
|
|
247
|
+
* // Exchange
|
|
248
|
+
* const listings = await goodz.exchange.browseMarketplace();
|
|
249
|
+
*
|
|
250
|
+
* // Alive
|
|
251
|
+
* const chat = await goodz.alive.sendMessage({ instanceId: 1, userId: 1, message: "Hi!" });
|
|
564
252
|
* ```
|
|
565
253
|
*
|
|
566
254
|
* @example With dynamic token provider (auto-refresh)
|
|
@@ -573,12 +261,15 @@ interface GoodZClient {
|
|
|
573
261
|
* });
|
|
574
262
|
* ```
|
|
575
263
|
*
|
|
576
|
-
* @example
|
|
264
|
+
* @example Custom sub-site URLs (e.g., staging environment)
|
|
577
265
|
* ```ts
|
|
578
|
-
* const
|
|
579
|
-
* accessToken:
|
|
266
|
+
* const goodz = createGoodZClient({
|
|
267
|
+
* accessToken: "...",
|
|
268
|
+
* coreUrl: "https://staging-core.goodz.dev",
|
|
269
|
+
* commerceUrl: "https://staging-commerce.goodz.dev",
|
|
270
|
+
* exchangeUrl: "https://staging-exchange.goodz.dev",
|
|
271
|
+
* aliveUrl: "https://staging-alive.goodz.dev",
|
|
580
272
|
* });
|
|
581
|
-
* const balance = await userGoodz.zcoin.getMyBalance();
|
|
582
273
|
* ```
|
|
583
274
|
*/
|
|
584
275
|
declare function createGoodZClient(config?: GoodZClientConfig): GoodZClient;
|
|
@@ -588,4 +279,4 @@ declare function createGoodZClient(config?: GoodZClientConfig): GoodZClient;
|
|
|
588
279
|
*/
|
|
589
280
|
declare const createUserClient: typeof createGoodZClient;
|
|
590
281
|
|
|
591
|
-
export {
|
|
282
|
+
export { AliveNamespace, AuthGetOAuthAppInfoInput, type AuthNamespace, AuthOAuthAppInfo, AuthUser, CardGetInput, CardListBySeriesInput, CollectibleGetCardProfileInput, CollectibleGetInstanceByIdInput, CollectibleGetPublicInstanceInput, CollectibleGetPublicInstancesBatchInput, CollectibleGetShellImageUrlInput, type CollectibleNamespace, CommerceNamespace, ExchangeNamespace, FranchiseGetInput, type GoodZClient, type GoodZClientConfig, InventoryConfirmOwnershipInput, InventoryConfirmOwnershipOutput, InventoryGetUserInventoryInput, InventoryGrantMintAuthInput, InventoryMintInput, InventoryMintOutput, type InventoryNamespace, InventoryTransferByCardInput, InventoryTransferByCardOutput, InventoryTransferHistoryInput, InventoryTransferInput, InventoryTransferOutput, type IpNamespace, SeriesGetInput, SeriesListByFranchiseInput, UserGetPublicProfileByIdInput, UserGetPublicProfileInput, type UserNamespace, UserPublicProfile, ZcoinChargeUserInput, ZcoinChargeUserOutput, ZcoinCommercialTransferInput, ZcoinCommercialTransferOutput, ZcoinCreateDepositOrderInput, ZcoinCreateDepositOrderOutput, ZcoinCreateDirectPurchaseOrderInput, ZcoinCreateDirectPurchaseOrderOutput, ZcoinDepositPackage, ZcoinGetDepositPackagesInput, ZcoinGetDepositStatusInput, ZcoinGetDepositStatusOutput, ZcoinGetMyBalanceOutput, ZcoinGetMyHistoryInput, ZcoinMintAndChargeInput, ZcoinMintAndChargeOutput, type ZcoinNamespace, createGoodZClient, createUserClient };
|
package/dist/core/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createGoodZClient, createUserClient } from '../chunk-7O6UN2D2.js';
|
|
2
|
+
import '../chunk-MUZDYQ67.js';
|
|
3
|
+
import '../chunk-OUKZ2PRD.js';
|
|
4
|
+
import '../chunk-JAVMQXJM.js';
|
|
5
|
+
export { GoodZApiError } from '../chunk-4SU7SU7K.js';
|
|
2
6
|
//# sourceMappingURL=index.js.map
|
|
3
7
|
//# sourceMappingURL=index.js.map
|