@replaystage/cli 0.2.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 +42 -20
- package/dist/index.js +622 -146
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { SupportedPlatform } from '@replaystage/shared';
|
|
3
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;
|
|
24
|
+
|
|
4
25
|
interface UserInfo {
|
|
5
26
|
id: string;
|
|
6
27
|
name?: string;
|
|
@@ -26,6 +47,16 @@ declare function resolveApiUrl(cliApiUrl?: string): string;
|
|
|
26
47
|
declare function computeFingerprint(input: string | Buffer | Uint8Array): Promise<string>;
|
|
27
48
|
declare function computeFileFingerprint(filePath: string): Promise<string>;
|
|
28
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;
|
|
29
60
|
interface PackagedBundle {
|
|
30
61
|
format: "single-html" | "directory" | "zip";
|
|
31
62
|
entryPoint: string;
|
|
@@ -39,12 +70,14 @@ interface PackagedBundle {
|
|
|
39
70
|
extractedTitle?: string;
|
|
40
71
|
extractedTagline?: string;
|
|
41
72
|
extractedAspectRatio?: string;
|
|
73
|
+
extractedModel?: string | null;
|
|
42
74
|
}
|
|
43
75
|
declare function extractHtmlMetadata(html: string): {
|
|
44
76
|
title?: string;
|
|
45
77
|
tagline?: string;
|
|
46
78
|
aspectRatio?: string;
|
|
47
79
|
rawAspectRatio?: string;
|
|
80
|
+
model?: string | null;
|
|
48
81
|
};
|
|
49
82
|
declare function computeSha256(buf: Buffer | Uint8Array): string;
|
|
50
83
|
declare function createZipFromFiles(fileMap: Record<string, Buffer>): Buffer;
|
|
@@ -61,6 +94,7 @@ interface ValidationResult {
|
|
|
61
94
|
fileHash?: string;
|
|
62
95
|
files?: string[];
|
|
63
96
|
aspectRatio?: string;
|
|
97
|
+
aiModel?: string | null;
|
|
64
98
|
supportedPlatforms?: SupportedPlatform;
|
|
65
99
|
platforms?: SupportedPlatform;
|
|
66
100
|
hasPlatformMeta?: boolean;
|
|
@@ -91,6 +125,9 @@ interface UploadBundleOptions {
|
|
|
91
125
|
changelog?: string;
|
|
92
126
|
aspectRatio?: string;
|
|
93
127
|
supportedPlatforms?: string;
|
|
128
|
+
aiModel?: string | null;
|
|
129
|
+
coverBuffer?: Buffer;
|
|
130
|
+
coverFileName?: string;
|
|
94
131
|
errorMsgFallback?: string;
|
|
95
132
|
}
|
|
96
133
|
interface UploadResponse {
|
|
@@ -128,6 +165,10 @@ interface UpdateBundleOptions {
|
|
|
128
165
|
changelog?: string;
|
|
129
166
|
aspectRatio?: string;
|
|
130
167
|
supportedPlatforms?: string;
|
|
168
|
+
aiTool?: string;
|
|
169
|
+
aiModel?: string | null;
|
|
170
|
+
coverBuffer?: Buffer;
|
|
171
|
+
coverFileName?: string;
|
|
131
172
|
manageToken?: string;
|
|
132
173
|
token?: string | null;
|
|
133
174
|
errorMsgFallback?: string;
|
|
@@ -141,25 +182,6 @@ declare function updateGameBundle(slug: string, options: UpdateBundleOptions): P
|
|
|
141
182
|
declare const updateGame: typeof updateGameBundle;
|
|
142
183
|
declare function fetchWhoami(apiUrl: string, token: string): Promise<any>;
|
|
143
184
|
|
|
144
|
-
interface ProjectConfig {
|
|
145
|
-
slug?: string;
|
|
146
|
-
manageToken?: string;
|
|
147
|
-
apiUrl?: string;
|
|
148
|
-
version?: string;
|
|
149
|
-
title?: string;
|
|
150
|
-
updatedAt?: string;
|
|
151
|
-
visibility?: "draft" | "unlisted" | "public" | string;
|
|
152
|
-
aspectRatio?: string;
|
|
153
|
-
supportedPlatforms?: string;
|
|
154
|
-
platforms?: string;
|
|
155
|
-
}
|
|
156
|
-
declare function resolveProjectDirectory(targetPath: string): string | null;
|
|
157
|
-
declare function getProjectConfigPath(targetDir: string): string | null;
|
|
158
|
-
declare function readProjectConfig(targetDir: string): ProjectConfig | null;
|
|
159
|
-
declare function writeProjectConfig(targetDir: string, config: ProjectConfig): void;
|
|
160
|
-
declare function incrementVersion(currentVersion?: string): string;
|
|
161
|
-
declare function promoteDraftVersion(currentVersion?: string): string;
|
|
162
|
-
|
|
163
185
|
declare function printJson(data: any): void;
|
|
164
186
|
declare function printErrorJson(error: string, message: string, code?: number, extra?: Record<string, any>): void;
|
|
165
187
|
declare function logInfo(message: string, isJsonMode?: boolean): void;
|
|
@@ -183,4 +205,4 @@ declare function printPublishSuccess(res: {
|
|
|
183
205
|
declare function createProgram(): Command;
|
|
184
206
|
declare function runCli(argv?: string[]): Promise<void>;
|
|
185
207
|
|
|
186
|
-
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 };
|