@spawnco/sdk-types 0.0.50 → 0.0.52
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.d.mts +35 -1
- package/dist/index.d.ts +35 -1
- package/package.json +1 -1
- package/src/v1.ts +43 -0
package/dist/index.d.mts
CHANGED
|
@@ -266,6 +266,21 @@ interface SpawnServerSDK__V1<TConfig = any> {
|
|
|
266
266
|
version(): Promise<string>;
|
|
267
267
|
effectiveVersion(): Promise<string>;
|
|
268
268
|
};
|
|
269
|
+
dew: {
|
|
270
|
+
/** Get today's plant claims for a user in this variant */
|
|
271
|
+
getClaimsToday(userId: string): Promise<{
|
|
272
|
+
claimedIds: ('A' | 'B' | 'C')[];
|
|
273
|
+
}>;
|
|
274
|
+
/** Claim a dew plant for a user. Returns random 10-20 dew amount. */
|
|
275
|
+
claim(userId: string, plantId: 'A' | 'B' | 'C'): Promise<{
|
|
276
|
+
success: boolean;
|
|
277
|
+
amount?: number;
|
|
278
|
+
new_balance?: number;
|
|
279
|
+
duplicate?: boolean;
|
|
280
|
+
claim_id?: string;
|
|
281
|
+
error?: string;
|
|
282
|
+
}>;
|
|
283
|
+
};
|
|
269
284
|
economy: {
|
|
270
285
|
redeemPurchase<T extends Record<string, any>>(token: string): Promise<{
|
|
271
286
|
success: boolean;
|
|
@@ -445,7 +460,26 @@ interface LeaderboardEntry {
|
|
|
445
460
|
isMe?: boolean;
|
|
446
461
|
timestamp: number;
|
|
447
462
|
}
|
|
463
|
+
interface JobDewEnv {
|
|
464
|
+
/** Get today's plant claims for a user in this variant */
|
|
465
|
+
getClaimsToday(userId: string): Promise<{
|
|
466
|
+
claimedIds: ('A' | 'B' | 'C')[];
|
|
467
|
+
}>;
|
|
468
|
+
/** Claim a dew plant for a user. Returns random 10-20 dew amount. */
|
|
469
|
+
claim(userId: string, plantId: 'A' | 'B' | 'C'): Promise<{
|
|
470
|
+
success: boolean;
|
|
471
|
+
amount?: number;
|
|
472
|
+
new_balance?: number;
|
|
473
|
+
duplicate?: boolean;
|
|
474
|
+
claim_id?: string;
|
|
475
|
+
error?: string;
|
|
476
|
+
}>;
|
|
477
|
+
}
|
|
478
|
+
interface JobFnEnv {
|
|
479
|
+
/** Dew economy API for claiming plants */
|
|
480
|
+
dew: JobDewEnv;
|
|
481
|
+
}
|
|
448
482
|
type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
|
|
449
483
|
type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room' | 'llm'>;
|
|
450
484
|
|
|
451
|
-
export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, LeaderboardEntry, LlmApi, LlmChatOptions, LlmChatResponse, LlmModel, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
|
|
485
|
+
export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, JobDewEnv, JobFnEnv, LeaderboardEntry, LlmApi, LlmChatOptions, LlmChatResponse, LlmModel, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
|
package/dist/index.d.ts
CHANGED
|
@@ -266,6 +266,21 @@ interface SpawnServerSDK__V1<TConfig = any> {
|
|
|
266
266
|
version(): Promise<string>;
|
|
267
267
|
effectiveVersion(): Promise<string>;
|
|
268
268
|
};
|
|
269
|
+
dew: {
|
|
270
|
+
/** Get today's plant claims for a user in this variant */
|
|
271
|
+
getClaimsToday(userId: string): Promise<{
|
|
272
|
+
claimedIds: ('A' | 'B' | 'C')[];
|
|
273
|
+
}>;
|
|
274
|
+
/** Claim a dew plant for a user. Returns random 10-20 dew amount. */
|
|
275
|
+
claim(userId: string, plantId: 'A' | 'B' | 'C'): Promise<{
|
|
276
|
+
success: boolean;
|
|
277
|
+
amount?: number;
|
|
278
|
+
new_balance?: number;
|
|
279
|
+
duplicate?: boolean;
|
|
280
|
+
claim_id?: string;
|
|
281
|
+
error?: string;
|
|
282
|
+
}>;
|
|
283
|
+
};
|
|
269
284
|
economy: {
|
|
270
285
|
redeemPurchase<T extends Record<string, any>>(token: string): Promise<{
|
|
271
286
|
success: boolean;
|
|
@@ -445,7 +460,26 @@ interface LeaderboardEntry {
|
|
|
445
460
|
isMe?: boolean;
|
|
446
461
|
timestamp: number;
|
|
447
462
|
}
|
|
463
|
+
interface JobDewEnv {
|
|
464
|
+
/** Get today's plant claims for a user in this variant */
|
|
465
|
+
getClaimsToday(userId: string): Promise<{
|
|
466
|
+
claimedIds: ('A' | 'B' | 'C')[];
|
|
467
|
+
}>;
|
|
468
|
+
/** Claim a dew plant for a user. Returns random 10-20 dew amount. */
|
|
469
|
+
claim(userId: string, plantId: 'A' | 'B' | 'C'): Promise<{
|
|
470
|
+
success: boolean;
|
|
471
|
+
amount?: number;
|
|
472
|
+
new_balance?: number;
|
|
473
|
+
duplicate?: boolean;
|
|
474
|
+
claim_id?: string;
|
|
475
|
+
error?: string;
|
|
476
|
+
}>;
|
|
477
|
+
}
|
|
478
|
+
interface JobFnEnv {
|
|
479
|
+
/** Dew economy API for claiming plants */
|
|
480
|
+
dew: JobDewEnv;
|
|
481
|
+
}
|
|
448
482
|
type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
|
|
449
483
|
type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room' | 'llm'>;
|
|
450
484
|
|
|
451
|
-
export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, LeaderboardEntry, LlmApi, LlmChatOptions, LlmChatResponse, LlmModel, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
|
|
485
|
+
export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, JobDewEnv, JobFnEnv, LeaderboardEntry, LlmApi, LlmChatOptions, LlmChatResponse, LlmModel, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
|
package/package.json
CHANGED
package/src/v1.ts
CHANGED
|
@@ -297,6 +297,24 @@ export interface SpawnServerSDK__V1<TConfig = any> {
|
|
|
297
297
|
effectiveVersion(): Promise<string>;
|
|
298
298
|
};
|
|
299
299
|
|
|
300
|
+
dew: {
|
|
301
|
+
/** Get today's plant claims for a user in this variant */
|
|
302
|
+
getClaimsToday(userId: string): Promise<{ claimedIds: ('A' | 'B' | 'C')[] }>;
|
|
303
|
+
|
|
304
|
+
/** Claim a dew plant for a user. Returns random 10-20 dew amount. */
|
|
305
|
+
claim(
|
|
306
|
+
userId: string,
|
|
307
|
+
plantId: 'A' | 'B' | 'C'
|
|
308
|
+
): Promise<{
|
|
309
|
+
success: boolean;
|
|
310
|
+
amount?: number;
|
|
311
|
+
new_balance?: number;
|
|
312
|
+
duplicate?: boolean;
|
|
313
|
+
claim_id?: string;
|
|
314
|
+
error?: string;
|
|
315
|
+
}>;
|
|
316
|
+
};
|
|
317
|
+
|
|
300
318
|
economy: {
|
|
301
319
|
// Redeem a purchase token from client
|
|
302
320
|
redeemPurchase<T extends Record<string, any>>(
|
|
@@ -527,5 +545,30 @@ export interface LeaderboardEntry {
|
|
|
527
545
|
|
|
528
546
|
// v0 sdk types for testing
|
|
529
547
|
|
|
548
|
+
// Job environment types for worker jobs
|
|
549
|
+
export interface JobDewEnv {
|
|
550
|
+
/** Get today's plant claims for a user in this variant */
|
|
551
|
+
getClaimsToday(userId: string): Promise<{ claimedIds: ('A' | 'B' | 'C')[] }>;
|
|
552
|
+
|
|
553
|
+
/** Claim a dew plant for a user. Returns random 10-20 dew amount. */
|
|
554
|
+
claim(
|
|
555
|
+
userId: string,
|
|
556
|
+
plantId: 'A' | 'B' | 'C'
|
|
557
|
+
): Promise<{
|
|
558
|
+
success: boolean;
|
|
559
|
+
amount?: number;
|
|
560
|
+
new_balance?: number;
|
|
561
|
+
duplicate?: boolean;
|
|
562
|
+
claim_id?: string;
|
|
563
|
+
error?: string;
|
|
564
|
+
}>;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export interface JobFnEnv {
|
|
568
|
+
/** Dew economy API for claiming plants */
|
|
569
|
+
dew: JobDewEnv;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// v0 sdk types for testing
|
|
530
573
|
export type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
|
|
531
574
|
export type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room' | 'llm'>;
|