@websimai/core-api-types 0.0.0 → 0.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websimai/core-api-types",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "Core Websim API type declarations",
5
5
  "author": "GameRoMan",
6
6
  "license": "MIT",
@@ -0,0 +1,6 @@
1
+ export * from "./project-asset";
2
+ export * from "./project-revision";
3
+ export * from "./project";
4
+ export * from "./screenshot";
5
+ export * from "./site";
6
+ export * from "./user";
@@ -0,0 +1,42 @@
1
+ import type { Expand } from "../utils";
2
+
3
+ import type { User } from "./user";
4
+
5
+ type ProjectAssetMetaByContentType =
6
+ | {
7
+ meta: { version: "1"; in_generation: true };
8
+ content_type: "text/javascript" | "text/css" | "text/html";
9
+ }
10
+ | {
11
+ meta: {
12
+ version: "1";
13
+ description: string;
14
+ title: string;
15
+ transparent?: boolean;
16
+ aspect?: "square";
17
+ in_generation?: false;
18
+ in_generation_asset?: true;
19
+ };
20
+ content_type: "image/png";
21
+ }
22
+ | {
23
+ meta: { version: "1"; duration: number };
24
+ content_type: "audio/mpeg";
25
+ };
26
+
27
+ export type ProjectAsset = Expand<
28
+ {
29
+ _type: "project_asset";
30
+ id: string;
31
+ project_id: string;
32
+ path: string;
33
+ state: "done";
34
+ created_at: string;
35
+ created_by: User;
36
+ updated_at: string;
37
+ bucket_key: string;
38
+ project_version: number;
39
+ size: number;
40
+ is_liked: boolean;
41
+ } & ProjectAssetMetaByContentType
42
+ >;
@@ -0,0 +1,23 @@
1
+ import type { User } from "./user";
2
+
3
+ export type ProjectRevision = {
4
+ _type: "project_revision";
5
+ id: string;
6
+ version: number;
7
+ created_at: string;
8
+ visited_at: null;
9
+ parent_id: string | null;
10
+ parent_revision_version: number | null;
11
+ parent_revision_project_id: string | null;
12
+ created_by: User;
13
+ meta: { version: string };
14
+ project_id: string;
15
+ updated_at: string;
16
+ deleted_at: null;
17
+ stats: { multiplayer_count: number };
18
+ draft: boolean;
19
+ site_id: string;
20
+ chat_session_id: null;
21
+ chat_session_run_index: null;
22
+ current_screenshot_url: `https://${string}/${string}` | null;
23
+ };
@@ -0,0 +1,30 @@
1
+ import type { User } from "./user";
2
+
3
+ export type Project = {
4
+ _type: "project";
5
+ id: string;
6
+ created_at: string;
7
+ updated_at: string;
8
+ title: string | null;
9
+ visibility: "public";
10
+ slug: string | null;
11
+ created_by: User | null;
12
+ current_version: number | null;
13
+ last_posted_version: number | null;
14
+ parent_id: string | null;
15
+ parent_version: number | null;
16
+ deleted_at: null;
17
+ posted: boolean;
18
+ stats: { views: number; likes: number; comments: number };
19
+ auto_set_current: boolean;
20
+ description: string | null;
21
+ comments_mode: "open" | "closed";
22
+ enable_chat: boolean;
23
+ from_template: boolean | null;
24
+ domains: [{ name: string }] | { name: string }[];
25
+ thumbnail: {
26
+ moderation_state: "ok" | "bad";
27
+ url: `https://${string}/${string}` | null;
28
+ } | null;
29
+ video: { url: `https://${string}/${string}` } | null;
30
+ };
@@ -0,0 +1,14 @@
1
+ export type Screenshot = {
2
+ _type: "screenshot";
3
+ id: string;
4
+ project_id: string;
5
+ project_version: number;
6
+ created_at: string;
7
+ state: "done";
8
+ height: number;
9
+ width: number;
10
+ content_type: "image/webp";
11
+ moderation_state: "ok";
12
+ source: "user" | "server";
13
+ url: `https://${string}/${string}`;
14
+ };
@@ -0,0 +1,48 @@
1
+ import type { User } from "./user";
2
+
3
+ export type WebsimPromptType =
4
+ | { type: "plaintext"; text: string }
5
+ | { type: "manual-edit"; text: "" }
6
+ | { type: "refactor"; text: string }
7
+ | { type: "fix"; text: string }
8
+ | { type: "get"; text: string }
9
+ | { type: "tweak-edit"; text: ""; data: null };
10
+
11
+ export type SiteLoreAttachment = {
12
+ id: string;
13
+ mediaType: string;
14
+ filename: string;
15
+ description: string;
16
+ useVision: boolean;
17
+ };
18
+
19
+ export type SiteLore = {
20
+ version: 1;
21
+ attachments: SiteLoreAttachment[];
22
+ enableApi?: boolean;
23
+ enableMobilePrompt?: boolean;
24
+ enableDB?: boolean;
25
+ enableMultiplayer_v2?: boolean;
26
+ enableDB_v2_1?: boolean;
27
+ enableLLM2?: boolean;
28
+ enableTweaks?: boolean;
29
+ enableComments?: boolean;
30
+ };
31
+
32
+ export type Site = {
33
+ _type: "site";
34
+ id: string;
35
+ parent_id: string | null;
36
+ created_at: string;
37
+ state: "initial" | "generating" | "done" | "failed";
38
+ model: string;
39
+ lore: SiteLore | null;
40
+ title: string | null;
41
+ url: string | null;
42
+ prompt: WebsimPromptType;
43
+ owner: User;
44
+ link_url: `/p/${string}`;
45
+ versioned_link_url: `/p/${string}/${number}`;
46
+ deleted_at: string | null;
47
+ yapping: string | null;
48
+ };
@@ -0,0 +1,10 @@
1
+ export type User = {
2
+ _type: "user";
3
+ id: string;
4
+ created_at: string;
5
+ username: string;
6
+ discord_id: string | null;
7
+ discord_username: string | null;
8
+ avatar_url: `https://${string}/${string}` | null;
9
+ is_admin: boolean;
10
+ };