@spawnco/sdk-types 0.0.51 → 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 +20 -1
- package/dist/index.d.ts +20 -1
- package/package.json +1 -1
- package/src/v1.ts +25 -0
package/dist/index.d.mts
CHANGED
|
@@ -460,7 +460,26 @@ interface LeaderboardEntry {
|
|
|
460
460
|
isMe?: boolean;
|
|
461
461
|
timestamp: number;
|
|
462
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
|
+
}
|
|
463
482
|
type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
|
|
464
483
|
type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room' | 'llm'>;
|
|
465
484
|
|
|
466
|
-
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
|
@@ -460,7 +460,26 @@ interface LeaderboardEntry {
|
|
|
460
460
|
isMe?: boolean;
|
|
461
461
|
timestamp: number;
|
|
462
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
|
+
}
|
|
463
482
|
type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
|
|
464
483
|
type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room' | 'llm'>;
|
|
465
484
|
|
|
466
|
-
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
|
@@ -545,5 +545,30 @@ export interface LeaderboardEntry {
|
|
|
545
545
|
|
|
546
546
|
// v0 sdk types for testing
|
|
547
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
|
|
548
573
|
export type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
|
|
549
574
|
export type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room' | 'llm'>;
|