@spawnco/sdk-types 0.0.40 → 0.0.42
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 +47 -1
- package/dist/index.d.ts +47 -1
- package/package.json +1 -1
- package/src/v1.ts +52 -0
package/dist/index.d.mts
CHANGED
|
@@ -11,6 +11,46 @@ interface MagicCdnMediaToken {
|
|
|
11
11
|
interface MagicCdnApi {
|
|
12
12
|
getMediaToken(): Promise<MagicCdnMediaToken>;
|
|
13
13
|
}
|
|
14
|
+
type ClipFormat = 'gif' | 'webm';
|
|
15
|
+
type ClipKind = 'world' | (string & {});
|
|
16
|
+
type ClipStatus = 'ready' | 'processing' | 'hidden';
|
|
17
|
+
interface ClipDescriptor {
|
|
18
|
+
clipId: string;
|
|
19
|
+
kind: ClipKind;
|
|
20
|
+
variantId: string;
|
|
21
|
+
format: ClipFormat;
|
|
22
|
+
status: ClipStatus;
|
|
23
|
+
creatorUserId?: string;
|
|
24
|
+
assetUrl?: string;
|
|
25
|
+
contentType: string;
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
durationMs?: number;
|
|
29
|
+
fileSizeBytes?: number;
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
31
|
+
createdAtMs: number;
|
|
32
|
+
updatedAtMs: number;
|
|
33
|
+
}
|
|
34
|
+
interface ClipLookupOptions {
|
|
35
|
+
clipId: string;
|
|
36
|
+
kind?: ClipKind;
|
|
37
|
+
}
|
|
38
|
+
interface ClipListOptions {
|
|
39
|
+
kind?: ClipKind;
|
|
40
|
+
creatorScoped?: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface UploadClipOptions {
|
|
43
|
+
clipId: string;
|
|
44
|
+
blob: Blob;
|
|
45
|
+
format?: ClipFormat;
|
|
46
|
+
kind?: ClipKind;
|
|
47
|
+
contentType?: string;
|
|
48
|
+
durationMs?: number;
|
|
49
|
+
width?: number;
|
|
50
|
+
height?: number;
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}
|
|
14
54
|
interface SpawnClientSDK__V1<TConfig = any> {
|
|
15
55
|
ready(): Promise<void>;
|
|
16
56
|
user: {
|
|
@@ -70,6 +110,12 @@ interface SpawnClientSDK__V1<TConfig = any> {
|
|
|
70
110
|
analytics: {
|
|
71
111
|
track(event: string, data: Record<string, any>): Promise<void>;
|
|
72
112
|
};
|
|
113
|
+
clips: {
|
|
114
|
+
worldHasClip(options: ClipLookupOptions): Promise<ClipDescriptor | null>;
|
|
115
|
+
list(options?: ClipListOptions): Promise<ClipDescriptor[]>;
|
|
116
|
+
uploadClip(options: UploadClipOptions): Promise<ClipDescriptor>;
|
|
117
|
+
delete(options: ClipLookupOptions): Promise<void>;
|
|
118
|
+
};
|
|
73
119
|
leaderboard: {
|
|
74
120
|
submit(leaderboardId: string, score: number): Promise<{
|
|
75
121
|
rank: number;
|
|
@@ -268,4 +314,4 @@ interface LeaderboardEntry {
|
|
|
268
314
|
type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
|
|
269
315
|
type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room'>;
|
|
270
316
|
|
|
271
|
-
export type { InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, User };
|
|
317
|
+
export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,46 @@ interface MagicCdnMediaToken {
|
|
|
11
11
|
interface MagicCdnApi {
|
|
12
12
|
getMediaToken(): Promise<MagicCdnMediaToken>;
|
|
13
13
|
}
|
|
14
|
+
type ClipFormat = 'gif' | 'webm';
|
|
15
|
+
type ClipKind = 'world' | (string & {});
|
|
16
|
+
type ClipStatus = 'ready' | 'processing' | 'hidden';
|
|
17
|
+
interface ClipDescriptor {
|
|
18
|
+
clipId: string;
|
|
19
|
+
kind: ClipKind;
|
|
20
|
+
variantId: string;
|
|
21
|
+
format: ClipFormat;
|
|
22
|
+
status: ClipStatus;
|
|
23
|
+
creatorUserId?: string;
|
|
24
|
+
assetUrl?: string;
|
|
25
|
+
contentType: string;
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
durationMs?: number;
|
|
29
|
+
fileSizeBytes?: number;
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
31
|
+
createdAtMs: number;
|
|
32
|
+
updatedAtMs: number;
|
|
33
|
+
}
|
|
34
|
+
interface ClipLookupOptions {
|
|
35
|
+
clipId: string;
|
|
36
|
+
kind?: ClipKind;
|
|
37
|
+
}
|
|
38
|
+
interface ClipListOptions {
|
|
39
|
+
kind?: ClipKind;
|
|
40
|
+
creatorScoped?: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface UploadClipOptions {
|
|
43
|
+
clipId: string;
|
|
44
|
+
blob: Blob;
|
|
45
|
+
format?: ClipFormat;
|
|
46
|
+
kind?: ClipKind;
|
|
47
|
+
contentType?: string;
|
|
48
|
+
durationMs?: number;
|
|
49
|
+
width?: number;
|
|
50
|
+
height?: number;
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}
|
|
14
54
|
interface SpawnClientSDK__V1<TConfig = any> {
|
|
15
55
|
ready(): Promise<void>;
|
|
16
56
|
user: {
|
|
@@ -70,6 +110,12 @@ interface SpawnClientSDK__V1<TConfig = any> {
|
|
|
70
110
|
analytics: {
|
|
71
111
|
track(event: string, data: Record<string, any>): Promise<void>;
|
|
72
112
|
};
|
|
113
|
+
clips: {
|
|
114
|
+
worldHasClip(options: ClipLookupOptions): Promise<ClipDescriptor | null>;
|
|
115
|
+
list(options?: ClipListOptions): Promise<ClipDescriptor[]>;
|
|
116
|
+
uploadClip(options: UploadClipOptions): Promise<ClipDescriptor>;
|
|
117
|
+
delete(options: ClipLookupOptions): Promise<void>;
|
|
118
|
+
};
|
|
73
119
|
leaderboard: {
|
|
74
120
|
submit(leaderboardId: string, score: number): Promise<{
|
|
75
121
|
rank: number;
|
|
@@ -268,4 +314,4 @@ interface LeaderboardEntry {
|
|
|
268
314
|
type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
|
|
269
315
|
type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room'>;
|
|
270
316
|
|
|
271
|
-
export type { InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, User };
|
|
317
|
+
export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
|
package/package.json
CHANGED
package/src/v1.ts
CHANGED
|
@@ -14,6 +14,51 @@ interface MagicCdnApi {
|
|
|
14
14
|
getMediaToken(): Promise<MagicCdnMediaToken>;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
export type ClipFormat = 'gif' | 'webm';
|
|
18
|
+
export type ClipKind = 'world' | (string & {});
|
|
19
|
+
export type ClipStatus = 'ready' | 'processing' | 'hidden';
|
|
20
|
+
|
|
21
|
+
export interface ClipDescriptor {
|
|
22
|
+
clipId: string;
|
|
23
|
+
kind: ClipKind;
|
|
24
|
+
variantId: string;
|
|
25
|
+
format: ClipFormat;
|
|
26
|
+
status: ClipStatus;
|
|
27
|
+
creatorUserId?: string;
|
|
28
|
+
assetUrl?: string;
|
|
29
|
+
contentType: string;
|
|
30
|
+
width?: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
durationMs?: number;
|
|
33
|
+
fileSizeBytes?: number;
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
createdAtMs: number;
|
|
36
|
+
updatedAtMs: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ClipLookupOptions {
|
|
40
|
+
clipId: string;
|
|
41
|
+
kind?: ClipKind;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ClipListOptions {
|
|
45
|
+
kind?: ClipKind;
|
|
46
|
+
creatorScoped?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface UploadClipOptions {
|
|
50
|
+
clipId: string;
|
|
51
|
+
blob: Blob;
|
|
52
|
+
format?: ClipFormat;
|
|
53
|
+
kind?: ClipKind;
|
|
54
|
+
contentType?: string;
|
|
55
|
+
durationMs?: number;
|
|
56
|
+
width?: number;
|
|
57
|
+
height?: number;
|
|
58
|
+
metadata?: Record<string, unknown>;
|
|
59
|
+
signal?: AbortSignal;
|
|
60
|
+
}
|
|
61
|
+
|
|
17
62
|
// Client SDK - available in browser
|
|
18
63
|
export interface SpawnClientSDK__V1<TConfig = any> {
|
|
19
64
|
ready(): Promise<void>;
|
|
@@ -85,6 +130,13 @@ export interface SpawnClientSDK__V1<TConfig = any> {
|
|
|
85
130
|
track(event: string, data: Record<string, any>): Promise<void>;
|
|
86
131
|
};
|
|
87
132
|
|
|
133
|
+
clips: {
|
|
134
|
+
worldHasClip(options: ClipLookupOptions): Promise<ClipDescriptor | null>;
|
|
135
|
+
list(options?: ClipListOptions): Promise<ClipDescriptor[]>;
|
|
136
|
+
uploadClip(options: UploadClipOptions): Promise<ClipDescriptor>;
|
|
137
|
+
delete(options: ClipLookupOptions): Promise<void>;
|
|
138
|
+
};
|
|
139
|
+
|
|
88
140
|
leaderboard: {
|
|
89
141
|
submit(
|
|
90
142
|
leaderboardId: string,
|