@replaystage/cli 0.1.0 → 0.3.0
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.ts +54 -18
- package/dist/index.js +943 -139
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { SupportedPlatform } from '@replaystage/shared';
|
|
3
|
+
|
|
4
|
+
interface ProjectConfig {
|
|
5
|
+
slug?: string;
|
|
6
|
+
manageToken?: string;
|
|
7
|
+
apiUrl?: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
visibility?: "draft" | "unlisted" | "public" | string;
|
|
12
|
+
aspectRatio?: string;
|
|
13
|
+
supportedPlatforms?: string;
|
|
14
|
+
platforms?: string;
|
|
15
|
+
aiModel?: string | null;
|
|
16
|
+
aiTool?: string;
|
|
17
|
+
}
|
|
18
|
+
declare function resolveProjectDirectory(targetPath: string): string | null;
|
|
19
|
+
declare function getProjectConfigPath(targetDir: string): string | null;
|
|
20
|
+
declare function readProjectConfig(targetDir: string): ProjectConfig | null;
|
|
21
|
+
declare function writeProjectConfig(targetDir: string, config: ProjectConfig): void;
|
|
22
|
+
declare function incrementVersion(currentVersion?: string): string;
|
|
23
|
+
declare function promoteDraftVersion(currentVersion?: string): string;
|
|
2
24
|
|
|
3
25
|
interface UserInfo {
|
|
4
26
|
id: string;
|
|
@@ -25,6 +47,16 @@ declare function resolveApiUrl(cliApiUrl?: string): string;
|
|
|
25
47
|
declare function computeFingerprint(input: string | Buffer | Uint8Array): Promise<string>;
|
|
26
48
|
declare function computeFileFingerprint(filePath: string): Promise<string>;
|
|
27
49
|
|
|
50
|
+
declare const COVER_PRECEDENCE_FILES: readonly ["cover.png", "cover.jpg", "cover.jpeg", "cover.webp", "cover.gif"];
|
|
51
|
+
interface DetectedCover {
|
|
52
|
+
source: "bundle" | "sibling";
|
|
53
|
+
fileName: string;
|
|
54
|
+
filePath?: string;
|
|
55
|
+
buffer: Buffer;
|
|
56
|
+
ext: "png" | "jpg" | "webp" | "gif";
|
|
57
|
+
mimeType: string;
|
|
58
|
+
}
|
|
59
|
+
declare function detectSiblingCover(targetPath: string): DetectedCover | null;
|
|
28
60
|
interface PackagedBundle {
|
|
29
61
|
format: "single-html" | "directory" | "zip";
|
|
30
62
|
entryPoint: string;
|
|
@@ -38,12 +70,14 @@ interface PackagedBundle {
|
|
|
38
70
|
extractedTitle?: string;
|
|
39
71
|
extractedTagline?: string;
|
|
40
72
|
extractedAspectRatio?: string;
|
|
73
|
+
extractedModel?: string | null;
|
|
41
74
|
}
|
|
42
75
|
declare function extractHtmlMetadata(html: string): {
|
|
43
76
|
title?: string;
|
|
44
77
|
tagline?: string;
|
|
45
78
|
aspectRatio?: string;
|
|
46
79
|
rawAspectRatio?: string;
|
|
80
|
+
model?: string | null;
|
|
47
81
|
};
|
|
48
82
|
declare function computeSha256(buf: Buffer | Uint8Array): string;
|
|
49
83
|
declare function createZipFromFiles(fileMap: Record<string, Buffer>): Buffer;
|
|
@@ -60,6 +94,10 @@ interface ValidationResult {
|
|
|
60
94
|
fileHash?: string;
|
|
61
95
|
files?: string[];
|
|
62
96
|
aspectRatio?: string;
|
|
97
|
+
aiModel?: string | null;
|
|
98
|
+
supportedPlatforms?: SupportedPlatform;
|
|
99
|
+
platforms?: SupportedPlatform;
|
|
100
|
+
hasPlatformMeta?: boolean;
|
|
63
101
|
errors: string[];
|
|
64
102
|
warnings: string[];
|
|
65
103
|
}
|
|
@@ -86,6 +124,10 @@ interface UploadBundleOptions {
|
|
|
86
124
|
prompt?: string;
|
|
87
125
|
changelog?: string;
|
|
88
126
|
aspectRatio?: string;
|
|
127
|
+
supportedPlatforms?: string;
|
|
128
|
+
aiModel?: string | null;
|
|
129
|
+
coverBuffer?: Buffer;
|
|
130
|
+
coverFileName?: string;
|
|
89
131
|
errorMsgFallback?: string;
|
|
90
132
|
}
|
|
91
133
|
interface UploadResponse {
|
|
@@ -105,6 +147,9 @@ interface UploadResponse {
|
|
|
105
147
|
semver?: string;
|
|
106
148
|
versionNumber?: number;
|
|
107
149
|
promotedToPublic?: boolean;
|
|
150
|
+
supportedPlatforms?: string;
|
|
151
|
+
supported_platforms?: string;
|
|
152
|
+
platforms?: string;
|
|
108
153
|
error?: string;
|
|
109
154
|
message?: string;
|
|
110
155
|
data?: any;
|
|
@@ -119,6 +164,11 @@ interface UpdateBundleOptions {
|
|
|
119
164
|
visibility?: "draft" | "unlisted" | "public" | string;
|
|
120
165
|
changelog?: string;
|
|
121
166
|
aspectRatio?: string;
|
|
167
|
+
supportedPlatforms?: string;
|
|
168
|
+
aiTool?: string;
|
|
169
|
+
aiModel?: string | null;
|
|
170
|
+
coverBuffer?: Buffer;
|
|
171
|
+
coverFileName?: string;
|
|
122
172
|
manageToken?: string;
|
|
123
173
|
token?: string | null;
|
|
124
174
|
errorMsgFallback?: string;
|
|
@@ -132,23 +182,6 @@ declare function updateGameBundle(slug: string, options: UpdateBundleOptions): P
|
|
|
132
182
|
declare const updateGame: typeof updateGameBundle;
|
|
133
183
|
declare function fetchWhoami(apiUrl: string, token: string): Promise<any>;
|
|
134
184
|
|
|
135
|
-
interface ProjectConfig {
|
|
136
|
-
slug: string;
|
|
137
|
-
manageToken?: string;
|
|
138
|
-
apiUrl?: string;
|
|
139
|
-
version: string;
|
|
140
|
-
title?: string;
|
|
141
|
-
updatedAt: string;
|
|
142
|
-
visibility?: "draft" | "unlisted" | "public" | string;
|
|
143
|
-
aspectRatio?: string;
|
|
144
|
-
}
|
|
145
|
-
declare function resolveProjectDirectory(targetPath: string): string | null;
|
|
146
|
-
declare function getProjectConfigPath(targetDir: string): string | null;
|
|
147
|
-
declare function readProjectConfig(targetDir: string): ProjectConfig | null;
|
|
148
|
-
declare function writeProjectConfig(targetDir: string, config: ProjectConfig): void;
|
|
149
|
-
declare function incrementVersion(currentVersion?: string): string;
|
|
150
|
-
declare function promoteDraftVersion(currentVersion?: string): string;
|
|
151
|
-
|
|
152
185
|
declare function printJson(data: any): void;
|
|
153
186
|
declare function printErrorJson(error: string, message: string, code?: number, extra?: Record<string, any>): void;
|
|
154
187
|
declare function logInfo(message: string, isJsonMode?: boolean): void;
|
|
@@ -164,9 +197,12 @@ declare function printPublishSuccess(res: {
|
|
|
164
197
|
claimUrl?: string;
|
|
165
198
|
aiTool?: string;
|
|
166
199
|
fileHash?: string;
|
|
200
|
+
aspectRatio?: string;
|
|
201
|
+
supportedPlatforms?: string;
|
|
202
|
+
platforms?: string;
|
|
167
203
|
}): void;
|
|
168
204
|
|
|
169
205
|
declare function createProgram(): Command;
|
|
170
206
|
declare function runCli(argv?: string[]): Promise<void>;
|
|
171
207
|
|
|
172
|
-
export { type CliConfig, type PackagedBundle, type ProjectConfig, type UpdateBundleOptions, type UpdateResponse, type UpdateResult, type UploadBundleOptions, type UploadResponse, type UploadResult, type UserInfo, type ValidationResult, checkHtmlDependencies, clearConfig, clearToken, computeFileFingerprint, computeFingerprint, computeSha256, createProgram, createZipFromFiles, extractHtmlMetadata, fetchWhoami, getConfigDir, getConfigPath, getProjectConfigPath, getToken, incrementVersion, logError, logInfo, logSuccess, logWarn, packageGame, printErrorJson, printJson, printPublishSuccess, promoteDraftVersion, readConfig, readProjectConfig, resolveApiUrl, resolveProjectDirectory, resolveToken, runCli, setToken, updateGame, updateGameBundle, uploadGame, uploadGameBundle, validateGamePackage, writeConfig, writeProjectConfig };
|
|
208
|
+
export { COVER_PRECEDENCE_FILES, type CliConfig, type DetectedCover, type PackagedBundle, type ProjectConfig, type UpdateBundleOptions, type UpdateResponse, type UpdateResult, type UploadBundleOptions, type UploadResponse, type UploadResult, type UserInfo, type ValidationResult, checkHtmlDependencies, clearConfig, clearToken, computeFileFingerprint, computeFingerprint, computeSha256, createProgram, createZipFromFiles, detectSiblingCover, extractHtmlMetadata, fetchWhoami, getConfigDir, getConfigPath, getProjectConfigPath, getToken, incrementVersion, logError, logInfo, logSuccess, logWarn, packageGame, printErrorJson, printJson, printPublishSuccess, promoteDraftVersion, readConfig, readProjectConfig, resolveApiUrl, resolveProjectDirectory, resolveToken, runCli, writeProjectConfig as saveProjectConfig, setToken, updateGame, updateGameBundle, uploadGame, uploadGameBundle, validateGamePackage, writeConfig, writeProjectConfig };
|