@websimai/core-api-types 0.0.1 → 0.0.3

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.
@@ -0,0 +1,204 @@
1
+ //#region src/types/user.d.ts
2
+ type User = {
3
+ readonly _type: "user";
4
+ id: string;
5
+ created_at: string;
6
+ username: string;
7
+ discord_id: string | null;
8
+ discord_username: string | null;
9
+ avatar_url: `https://${string}/${string}` | null;
10
+ is_admin: boolean;
11
+ };
12
+ //#endregion
13
+ //#region src/types/project.d.ts
14
+ type Project = {
15
+ readonly _type: "project";
16
+ id: string;
17
+ created_at: string;
18
+ updated_at: string;
19
+ title: string | null;
20
+ visibility: "public";
21
+ slug: string | null;
22
+ created_by: User | null;
23
+ current_version: number | null;
24
+ last_posted_version: number | null;
25
+ parent_id: string | null;
26
+ parent_version: number | null;
27
+ deleted_at: null;
28
+ posted: boolean;
29
+ stats: {
30
+ views: number;
31
+ likes: number;
32
+ comments: number;
33
+ };
34
+ auto_set_current: boolean;
35
+ description: string | null;
36
+ generated_description: string | null;
37
+ comments_mode: "open" | "closed";
38
+ enable_chat: boolean;
39
+ from_template: boolean | null;
40
+ domains: [{
41
+ name: string;
42
+ }] | {
43
+ name: string;
44
+ }[];
45
+ thumbnail: {
46
+ moderation_state: "ok" | "bad";
47
+ url: `https://${string}/${string}` | null;
48
+ } | null;
49
+ video: {
50
+ url: `https://${string}/${string}`;
51
+ } | null;
52
+ };
53
+ //#endregion
54
+ //#region src/utils/index.d.ts
55
+ type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
56
+ //#endregion
57
+ //#region src/types/project-asset.d.ts
58
+ declare namespace ProjectAssetMeta {
59
+ type text = {
60
+ meta: {
61
+ version: "1";
62
+ in_generation: true;
63
+ };
64
+ content_type: "text/javascript" | "text/css" | "text/html";
65
+ };
66
+ type image = {
67
+ meta: {
68
+ version: "1";
69
+ description: string;
70
+ title: string;
71
+ transparent?: boolean;
72
+ aspect?: "square";
73
+ in_generation?: false;
74
+ in_generation_asset?: true;
75
+ };
76
+ content_type: "image/png";
77
+ };
78
+ type audio = {
79
+ meta: {
80
+ version: "1";
81
+ duration: number;
82
+ };
83
+ content_type: "audio/mpeg";
84
+ };
85
+ }
86
+ type ProjectAssetMetaByContentType = ProjectAssetMeta.text | ProjectAssetMeta.image | ProjectAssetMeta.audio;
87
+ type ProjectAsset = Expand<{
88
+ readonly _type: "project_asset";
89
+ id: string;
90
+ project_id: string;
91
+ path: string;
92
+ state: "done";
93
+ created_at: string;
94
+ created_by: User;
95
+ updated_at: string;
96
+ bucket_key: string;
97
+ project_version: number;
98
+ size: number;
99
+ is_liked: boolean;
100
+ } & ProjectAssetMetaByContentType>;
101
+ //#endregion
102
+ //#region src/types/project-revision.d.ts
103
+ type ProjectRevision = {
104
+ readonly _type: "project_revision";
105
+ id: string;
106
+ version: number;
107
+ created_at: string;
108
+ visited_at: null;
109
+ parent_id: string | null;
110
+ parent_revision_version: number | null;
111
+ parent_revision_project_id: string | null;
112
+ created_by: User;
113
+ meta: {
114
+ version: string;
115
+ };
116
+ project_id: string;
117
+ updated_at: string;
118
+ deleted_at: null;
119
+ stats: {
120
+ multiplayer_count: number;
121
+ };
122
+ draft: boolean;
123
+ site_id: string;
124
+ chat_session_id: null;
125
+ chat_session_run_index: null;
126
+ current_screenshot_url: `https://${string}/${string}` | null;
127
+ };
128
+ //#endregion
129
+ //#region src/types/screenshot.d.ts
130
+ type Screenshot = {
131
+ readonly _type: "screenshot";
132
+ id: string;
133
+ project_id: string;
134
+ project_version: number;
135
+ created_at: string;
136
+ state: "done";
137
+ height: number;
138
+ width: number;
139
+ content_type: "image/webp";
140
+ moderation_state: "ok";
141
+ source: "user" | "server";
142
+ url: `https://${string}/${string}`;
143
+ };
144
+ //#endregion
145
+ //#region src/types/site.d.ts
146
+ type WebsimPromptType = {
147
+ type: "plaintext";
148
+ text: string;
149
+ } | {
150
+ type: "manual-edit";
151
+ text: "";
152
+ } | {
153
+ type: "refactor";
154
+ text: string;
155
+ } | {
156
+ type: "fix";
157
+ text: string;
158
+ } | {
159
+ type: "get";
160
+ text: string;
161
+ } | {
162
+ type: "tweak-edit";
163
+ text: "";
164
+ data: null;
165
+ };
166
+ type SiteLoreAttachment = {
167
+ id: string;
168
+ mediaType: string;
169
+ filename: string;
170
+ description: string;
171
+ useVision: boolean;
172
+ };
173
+ type SiteLore = {
174
+ readonly version: 1;
175
+ attachments: SiteLoreAttachment[];
176
+ enableApi?: boolean;
177
+ enableMobilePrompt?: boolean;
178
+ enableDB?: boolean;
179
+ enableMultiplayer_v2?: boolean;
180
+ enableDB_v2_1?: boolean;
181
+ enableLLM2?: boolean;
182
+ enableTweaks?: boolean;
183
+ enableComments?: boolean;
184
+ enableVideo: false;
185
+ };
186
+ type Site = {
187
+ readonly _type: "site";
188
+ id: string;
189
+ parent_id: string | null;
190
+ created_at: string;
191
+ state: "initial" | "generating" | "done" | "failed";
192
+ model: string;
193
+ lore: SiteLore | null;
194
+ title: string | null;
195
+ url: string | null;
196
+ prompt: WebsimPromptType;
197
+ owner: User;
198
+ link_url: `/p/${string}`;
199
+ versioned_link_url: `/p/${string}/${number}`;
200
+ deleted_at: string | null;
201
+ yapping: string | null;
202
+ };
203
+ //#endregion
204
+ export { Project, ProjectAsset, ProjectRevision, Screenshot, Site, SiteLore, SiteLoreAttachment, User, WebsimPromptType };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
package/package.json CHANGED
@@ -1,30 +1,40 @@
1
1
  {
2
2
  "name": "@websimai/core-api-types",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Core Websim API type declarations",
5
+ "type": "module",
5
6
  "author": "GameRoMan",
6
7
  "license": "MIT",
7
- "scripts": {
8
- "npm:publish": "bun publish --access public"
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/websimnpm/websim.git",
14
+ "directory": "packages/core-api-types"
9
15
  },
10
- "files": [
11
- "src/**/*",
12
- "README.md",
13
- "LICENSE"
14
- ],
15
16
  "keywords": [
16
17
  "websim",
17
18
  "types",
18
19
  "typescript"
19
20
  ],
20
- "peerDependencies": {
21
- "typescript": "^5.9.3"
21
+ "scripts": {
22
+ "build": "bunx --bun tsdown",
23
+ "npm:publish": "bun run build && bun publish"
22
24
  },
23
- "main": "./src/index.ts",
24
- "module": "./src/index.ts",
25
- "types": "./src/index.ts",
25
+ "files": [
26
+ "dist/**/*",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "main": "./dist/index.mjs",
31
+ "module": "./dist/index.mjs",
32
+ "types": "./dist/index.d.mts",
26
33
  "exports": {
27
- ".": "./src/index.ts",
34
+ ".": "./dist/index.mjs",
28
35
  "./package.json": "./package.json"
36
+ },
37
+ "devDependencies": {
38
+ "tsdown": "catalog:"
29
39
  }
30
40
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Roman A
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./types";
@@ -1,6 +0,0 @@
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";
@@ -1,42 +0,0 @@
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
- >;
@@ -1,23 +0,0 @@
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
- };
@@ -1,30 +0,0 @@
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
- };
@@ -1,14 +0,0 @@
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
- };
package/src/types/site.ts DELETED
@@ -1,48 +0,0 @@
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
- };
package/src/types/user.ts DELETED
@@ -1,10 +0,0 @@
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
- };
@@ -1 +0,0 @@
1
- export type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;