tt-minigame-ide-cli 2.0.7 → 2.0.8
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/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/miniprogram-utils/src/constants/index.d.ts +9 -0
- package/dist/miniprogram-utils/src/data/app.d.ts +1 -0
- package/dist/miniprogram-utils/src/data/project.d.ts +17 -2
- package/dist/miniprogram-utils/src/electron-monitor/common/share.d.ts +126 -0
- package/dist/miniprogram-utils/src/electron-monitor/common/tea-sdk.d.ts +15 -1
- package/dist/miniprogram-utils/src/network/axios.d.ts +2 -1
- package/dist/tt-ide-cli/src/features/audit.d.ts +1 -0
- package/dist/tt-ide-cli/src/features/microgame/cloud-compile.d.ts +10 -1
- package/dist/tt-ide-cli/src/features/microgame/index.d.ts +1 -0
- package/dist/tt-ide-cli/src/features/microgame/meta.d.ts +1 -0
- package/dist/tt-ide-cli/src/features/microgame/unity.d.ts +99 -0
- package/dist/tt-ide-cli/src/features/microgame/utils/package.d.ts +10 -0
- package/dist/tt-ide-cli/src/features/packages.d.ts +2 -5
- package/dist/tt-ide-cli/src/features/preview.d.ts +3 -0
- package/dist/tt-ide-cli/src/types.d.ts +1 -0
- package/dist/tt-ide-cli/src/utils/cookie.d.ts +6 -9
- package/dist/tt-ide-cli/src/utils/logger.d.ts +1 -1
- package/dist/tt-ide-cli/src/utils/util.d.ts +1 -0
- package/package.json +1 -1
- package/dist/tt-ide-cli/src/features/microgame/utils/settings.d.ts +0 -48
@@ -130,6 +130,7 @@ export declare const SLARDAR_EVENT: {
|
|
130
130
|
readonly IDE_MODULE_AUTH_FORCE_LOGOUT: "IDE_MODULE_AUTH_FORCE_LOGOUT";
|
131
131
|
readonly IDE_CANVAS_WEBGL_CONTEXT_ENABLE: "IDE_CANVAS_WEBGL_CONTEXT_ENABLE";
|
132
132
|
readonly IDE_LOGIN_DATA_FORMAT: "IDE_LOGIN_DATA_FORMAT";
|
133
|
+
readonly IDE_IS_ENCRYPTION_AVAILABLE: "IDE_IS_ENCRYPTION_AVAILABLE";
|
133
134
|
readonly IDE_ADD_COMPILE_MODE: "IDE_ADD_COMPILE_MODE";
|
134
135
|
readonly IDE_DECODE_QRCODE: "IDE_DECODE_QRCODE";
|
135
136
|
readonly IDE_DECODE_URL: "IDE_DECODE_URL";
|
@@ -161,6 +162,14 @@ export declare const SLARDAR_EVENT: {
|
|
161
162
|
readonly IDE_POWER_EVENT: "IDE_POWER_EVENT";
|
162
163
|
readonly IDE_TASK_PERFORMANCE: "IDE_TASK_PERFORMANCE";
|
163
164
|
readonly IDE_EXCEPTION_RECORD: "IDE_EXCEPTION_RECORD";
|
165
|
+
readonly IDE_PROXY_ERROR_TRACE: "IDE_PROXY_ERROR_TRACE";
|
166
|
+
readonly IDE_EDITOR_RESOLVE_SNIPPET: "IDE_EDITOR_RESOLVE_SNIPPET";
|
167
|
+
readonly IDE_EDITOR_SNIPPET_CREATION: "IDE_EDITOR_SNIPPET_CREATION";
|
168
|
+
readonly IDE_EDITOR_REFERENCE: "IDE_EDITOR_REFERENCE";
|
169
|
+
readonly IDE_EDITOR_COMPLETION_SHOW: "IDE_EDITOR_COMPLETION_SHOW";
|
170
|
+
readonly IDE_MAIN_HELPER_FORK: "IDE_MAIN_HELPER_FORK";
|
171
|
+
readonly IDE_MAIN_HELPER_SPAWN: "IDE_MAIN_HELPER_SPAWN";
|
172
|
+
readonly IDE_MAIN_HELPER_READY: "IDE_MAIN_HELPER_READY";
|
164
173
|
readonly IDE_LOADER_IO_ERROR: string;
|
165
174
|
readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
|
166
175
|
readonly IDE_LOADER_START_FROM_ENTRY: string;
|
@@ -57,6 +57,21 @@ export interface IProjectConfig extends IProject {
|
|
57
57
|
game?: ConditionData;
|
58
58
|
};
|
59
59
|
douyinProjectType?: string;
|
60
|
+
unity?: {
|
61
|
+
build: {
|
62
|
+
webgl: string;
|
63
|
+
native: {
|
64
|
+
il2cpp: string;
|
65
|
+
apk: string;
|
66
|
+
};
|
67
|
+
instantGame: string;
|
68
|
+
};
|
69
|
+
publishType: '0' | '1' | '2' | '3' | '4' | '5';
|
70
|
+
starkSdkVersion: string;
|
71
|
+
unityToolsVersion: string;
|
72
|
+
unityEngineVersion: string;
|
73
|
+
arch: string;
|
74
|
+
};
|
60
75
|
}
|
61
76
|
/**
|
62
77
|
* 此处的技术类型与 ide 的技术类型有区别
|
@@ -66,8 +81,8 @@ export interface IProjectConfig extends IProject {
|
|
66
81
|
* microapp 属于 app 类型
|
67
82
|
* microgame、toybox 属于 game 类型
|
68
83
|
*/
|
69
|
-
declare type TechType = 'app' | 'game' | 'toybox';
|
70
|
-
declare type IDEAppTechType = 'microapp' | 'toybox' | 'microgame' | 'microapp-minicode' | 'toybox-minicode' | 'microgame-minicode' | '';
|
84
|
+
declare type TechType = 'app' | 'game' | 'toybox' | 'unity';
|
85
|
+
declare type IDEAppTechType = 'microapp' | 'toybox' | 'microgame' | 'microapp-minicode' | 'toybox-minicode' | 'microgame-minicode' | 'unity' | '';
|
71
86
|
export declare const PROJECT_TYPE_MAP: Record<string, TechType>;
|
72
87
|
export declare function setIDEAppTechType(type: IDEAppTechType): void;
|
73
88
|
export declare function getIDEAppTechType(): IDEAppTechType;
|
@@ -0,0 +1,126 @@
|
|
1
|
+
import { ElectronCommandClient } from '@slardar/electron';
|
2
|
+
import { BrowserCommandClient } from '@slardar/web';
|
3
|
+
export declare function getCPUModel(): string;
|
4
|
+
export declare function getSystemMemory(): string;
|
5
|
+
export declare type SlardarClient = ElectronCommandClient | BrowserCommandClient;
|
6
|
+
export declare const BID = "electron_12345";
|
7
|
+
export interface ICommonParams {
|
8
|
+
userId?: string;
|
9
|
+
username?: string;
|
10
|
+
ideVersion: string;
|
11
|
+
deviceId: string;
|
12
|
+
osPlatform: string;
|
13
|
+
osVersion: string;
|
14
|
+
techType?: string;
|
15
|
+
ideVersionNumber?: number;
|
16
|
+
env?: string;
|
17
|
+
branch?: string;
|
18
|
+
buildId?: string;
|
19
|
+
cliName?: string;
|
20
|
+
isSandbox?: string;
|
21
|
+
frameworkType?: string;
|
22
|
+
workbenchMode?: string;
|
23
|
+
}
|
24
|
+
export declare function commonParams2Context(commonParams: ICommonParams, globalDevAppId?: string, globalTechType?: string, globalExtAppId?: string): {
|
25
|
+
user_id: string;
|
26
|
+
name: string;
|
27
|
+
device_id: string;
|
28
|
+
ide_version: string;
|
29
|
+
os_version: string;
|
30
|
+
os_platform: string;
|
31
|
+
dev_app_id: string;
|
32
|
+
ext_app_id: string;
|
33
|
+
tech_type: string;
|
34
|
+
ide_version_number: string;
|
35
|
+
ide_env: string;
|
36
|
+
branch: string;
|
37
|
+
build_id: string;
|
38
|
+
buildId: string;
|
39
|
+
arch: NodeJS.Architecture;
|
40
|
+
ide_version_int: number;
|
41
|
+
is_sandbox: string;
|
42
|
+
frameworkType: string;
|
43
|
+
workbench_mode: string;
|
44
|
+
e2e_scene: string;
|
45
|
+
cpu_model: string;
|
46
|
+
system_memory: string;
|
47
|
+
};
|
48
|
+
export declare function getHref(): string;
|
49
|
+
/**
|
50
|
+
* 去除差异性安装路径,保持 dist 之后的内容
|
51
|
+
*/
|
52
|
+
export declare function getPathname(): string;
|
53
|
+
/**
|
54
|
+
* 存放打点需要在内存中缓存的数据及操作方法
|
55
|
+
*/
|
56
|
+
export interface IModuleUseInfo {
|
57
|
+
count: number;
|
58
|
+
triggerNum: number;
|
59
|
+
startTime?: number;
|
60
|
+
endTime?: number;
|
61
|
+
}
|
62
|
+
export interface IModuleCacheMap {
|
63
|
+
click: {
|
64
|
+
[key: string]: IModuleUseInfo;
|
65
|
+
};
|
66
|
+
call: {
|
67
|
+
[key: string]: IModuleUseInfo;
|
68
|
+
};
|
69
|
+
}
|
70
|
+
export interface ITimelinelog {
|
71
|
+
name: string;
|
72
|
+
step: number;
|
73
|
+
timestamp: number;
|
74
|
+
}
|
75
|
+
export interface ITimeline {
|
76
|
+
moduleName: string;
|
77
|
+
logs: ITimelinelog[];
|
78
|
+
startTime: number;
|
79
|
+
currentStep: number;
|
80
|
+
endTime?: number;
|
81
|
+
}
|
82
|
+
export declare type PointEventType = 'click' | 'call';
|
83
|
+
export declare const moduleEventCacheMap: IModuleCacheMap;
|
84
|
+
export declare const timelineMap: Map<string, ITimeline>;
|
85
|
+
export declare function setModuleUseCache(eventType: PointEventType, moduleName: string, value: IModuleUseInfo): void;
|
86
|
+
export declare function getModuleUseCache(eventType: PointEventType, moduleName: string): IModuleUseInfo;
|
87
|
+
export declare function compareCacheTriggerCount(eventType: PointEventType, moduleName: string, triggerCount: number, triggerDuration?: number, nowTime?: number): boolean;
|
88
|
+
export declare const PROCESS_TYPE: {
|
89
|
+
readonly main: "main";
|
90
|
+
readonly renderer: "renderer";
|
91
|
+
};
|
92
|
+
export declare type ProcessType = keyof typeof PROCESS_TYPE;
|
93
|
+
export declare const startTime: number;
|
94
|
+
export declare const skipReport: boolean;
|
95
|
+
export declare type TechType = 'microapp' | 'microgame' | 'toybox' | 'microapp-minicode' | 'microgame-minicode' | 'toybox-minicode';
|
96
|
+
export interface PerfConfigSettings {
|
97
|
+
disabled: boolean;
|
98
|
+
fps: {
|
99
|
+
below: number;
|
100
|
+
belowCount: number;
|
101
|
+
maxReporterCount: number;
|
102
|
+
};
|
103
|
+
interval: {
|
104
|
+
duration: number;
|
105
|
+
blockFactor: number;
|
106
|
+
reportThreshold: number;
|
107
|
+
longTaskDuration: number;
|
108
|
+
longTaskDurationMain: number;
|
109
|
+
maxReporterCount: number;
|
110
|
+
preventLongTaskReportEVDuration?: number;
|
111
|
+
preventLongTaskReportEvents?: string[];
|
112
|
+
};
|
113
|
+
memory: {
|
114
|
+
freePercent: number;
|
115
|
+
free: number;
|
116
|
+
duration: number;
|
117
|
+
maxReporterCount: number;
|
118
|
+
winUsePowershell: boolean;
|
119
|
+
};
|
120
|
+
disabledHref: string[];
|
121
|
+
disabledMain: boolean;
|
122
|
+
ideUsageCollectInterval: number;
|
123
|
+
disabledJsonWorker: boolean;
|
124
|
+
largeJsonLimit?: number;
|
125
|
+
}
|
126
|
+
export declare const defaultPerfConfigSettings: PerfConfigSettings;
|
@@ -1,3 +1,10 @@
|
|
1
|
+
export declare function registerDevLogger(logger: CallableFunction): void;
|
2
|
+
export declare type TeaEvent = {
|
3
|
+
event: string;
|
4
|
+
params: string;
|
5
|
+
time?: number;
|
6
|
+
};
|
7
|
+
export declare function makeEvent(event: string, params: unknown, timestamp?: number): TeaEvent;
|
1
8
|
export interface ICommonParams {
|
2
9
|
userId?: string;
|
3
10
|
username?: string;
|
@@ -14,4 +21,11 @@ export interface ICommonParams {
|
|
14
21
|
}
|
15
22
|
export declare function reportTea(event: string, commonParams: ICommonParams, params?: {
|
16
23
|
[k: string]: string | number | boolean;
|
17
|
-
}): void;
|
24
|
+
}, timestamp?: number): void;
|
25
|
+
export declare function clearTeaEvents(): void;
|
26
|
+
export declare function reportTeaImmediately(commonParams: ICommonParams, eventsSets: Array<{
|
27
|
+
event: string;
|
28
|
+
params: {
|
29
|
+
[k: string]: string | number | boolean;
|
30
|
+
};
|
31
|
+
}>): void;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { AxiosInstance as AxiosInstanceType } from 'axios';
|
2
|
+
declare function setBoeMap(k: RegExp, v: string): void;
|
2
3
|
interface ISlardarInstance {
|
3
4
|
reportRequestError: (options: {
|
4
5
|
url: string;
|
@@ -25,4 +26,4 @@ declare const AxiosInstance: AxiosInstanceType;
|
|
25
26
|
declare function setEnvFunction(fn: GetEnvFunction): void;
|
26
27
|
declare function setSlardarInstance(obj: ISlardarInstance): void;
|
27
28
|
declare function setJestMock<T extends keyof AxiosInstanceType>(mockInstance: object): void;
|
28
|
-
export { AxiosInstance, defaultEnv, IEnvConfig, GetEnvFunction, setEnvFunction, setSlardarInstance, setJestMock };
|
29
|
+
export { AxiosInstance, defaultEnv, IEnvConfig, GetEnvFunction, setEnvFunction, setSlardarInstance, setJestMock, setBoeMap };
|
@@ -29,10 +29,11 @@ export declare type PreviewOption = Pick<ProjectToQRCodeOption, 'project' | 'pag
|
|
29
29
|
* @returns
|
30
30
|
*/
|
31
31
|
export declare function preview(options: PreviewOption): Promise<ProjectQRCode>;
|
32
|
-
export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrcode' | 'copyToClipboard' | 'extraInfoJson' | 'localCompileVersion' | 'ideConfig'> & {
|
32
|
+
export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrcode' | 'copyToClipboard' | 'extraInfoJson' | 'localCompileVersion' | 'ideConfig' | 'updateStatus' | 'setCheckResult' | 'isNewPlatform'> & {
|
33
33
|
version: string;
|
34
34
|
changeLog: string;
|
35
35
|
needUploadSourcemap?: boolean;
|
36
|
+
extraCheckInfoJson?: string;
|
36
37
|
};
|
37
38
|
/**
|
38
39
|
* 发布上传(功能入口)
|
@@ -56,6 +57,7 @@ export declare type ProjectToQRCodeOption = {
|
|
56
57
|
version: string;
|
57
58
|
changeLog: string;
|
58
59
|
needUploadSourcemap: boolean;
|
60
|
+
extraCheckInfoJson?: string;
|
59
61
|
};
|
60
62
|
extraInfoJson?: string;
|
61
63
|
localCompileVersion?: string;
|
@@ -70,6 +72,13 @@ export declare type ProjectToQRCodeOption = {
|
|
70
72
|
uploadCache?: boolean;
|
71
73
|
supportSourcemap?: boolean;
|
72
74
|
enableHotRestartCache?: boolean;
|
75
|
+
updateStatus?: (status: {
|
76
|
+
upload: number;
|
77
|
+
check: number;
|
78
|
+
compile: number;
|
79
|
+
}) => any;
|
80
|
+
setCheckResult?: (result: any) => any;
|
81
|
+
isNewPlatform?: (value: boolean) => void;
|
73
82
|
};
|
74
83
|
export declare function projectToQRCode(options: ProjectToQRCodeOption): Promise<ProjectQRCode>;
|
75
84
|
export {};
|
@@ -0,0 +1,99 @@
|
|
1
|
+
declare type UnityConfigType = {
|
2
|
+
appid: string;
|
3
|
+
build: {
|
4
|
+
webgl: string;
|
5
|
+
native: {
|
6
|
+
il2cpp: string;
|
7
|
+
apk: string;
|
8
|
+
};
|
9
|
+
instantGame: string;
|
10
|
+
};
|
11
|
+
publishType: '0' | '1' | '2' | '3' | '4' | '5';
|
12
|
+
starkSdkVersion: string;
|
13
|
+
unityToolsVersion: string;
|
14
|
+
unityEngineVersion: string;
|
15
|
+
arch: string;
|
16
|
+
};
|
17
|
+
declare type UnityGameJson = {
|
18
|
+
deviceOrientation: 'portrait' | 'landscape';
|
19
|
+
menuButtonStyle: 'light' | 'dark';
|
20
|
+
};
|
21
|
+
declare type UploadProps = {
|
22
|
+
projectPath: string;
|
23
|
+
version: string;
|
24
|
+
publishDesc?: string;
|
25
|
+
ideUid?: number;
|
26
|
+
};
|
27
|
+
declare type QueryProgressProps = Pick<UploadProps, 'projectPath' | 'version' | 'ideUid'> & {
|
28
|
+
updateStatus?: (status: number | string) => void;
|
29
|
+
};
|
30
|
+
export declare const unityCli: {
|
31
|
+
getVersions: ({ projectPath, ideUid }: {
|
32
|
+
projectPath: string;
|
33
|
+
ideUid?: number;
|
34
|
+
}) => Promise<{
|
35
|
+
latest: {
|
36
|
+
ctime: string;
|
37
|
+
version: string;
|
38
|
+
};
|
39
|
+
current: {
|
40
|
+
ctime: string;
|
41
|
+
version: string;
|
42
|
+
};
|
43
|
+
}>;
|
44
|
+
getLatestVersion: ({ projectPath, ideUid }: {
|
45
|
+
projectPath: string;
|
46
|
+
ideUid?: number;
|
47
|
+
}) => Promise<{
|
48
|
+
ctime: string;
|
49
|
+
version: string;
|
50
|
+
}>;
|
51
|
+
preview: ({ projectPath, ideUid }: {
|
52
|
+
projectPath: string;
|
53
|
+
ideUid?: number;
|
54
|
+
}) => Promise<string>;
|
55
|
+
upload: ({ projectPath, version, publishDesc, ideUid }: UploadProps) => Promise<{
|
56
|
+
code: number;
|
57
|
+
message: string;
|
58
|
+
}>;
|
59
|
+
queryProgress: ({ projectPath, version, updateStatus, ideUid }: QueryProgressProps) => Promise<void>;
|
60
|
+
uploadAndQueryProgress: ({ projectPath, version, publishDesc, updateStatus, ideUid }: UploadProps & QueryProgressProps) => Promise<void>;
|
61
|
+
validateFiles: (unityConfig: UnityConfigType) => Promise<void>;
|
62
|
+
validateAppId: (appid: string) => Promise<boolean>;
|
63
|
+
validateVersion: (latestVersion: string, version: string) => boolean;
|
64
|
+
PROGRESS: {
|
65
|
+
0: string;
|
66
|
+
1: string;
|
67
|
+
2: string;
|
68
|
+
3: string;
|
69
|
+
4: string;
|
70
|
+
5: string;
|
71
|
+
6: string;
|
72
|
+
7: string;
|
73
|
+
8: string;
|
74
|
+
9: string;
|
75
|
+
99: string;
|
76
|
+
100: string;
|
77
|
+
'-1': string;
|
78
|
+
'-2': string;
|
79
|
+
'-4': string;
|
80
|
+
'-5': string;
|
81
|
+
'-6': string;
|
82
|
+
'-7': string;
|
83
|
+
'-8': string;
|
84
|
+
'-9': string;
|
85
|
+
'-99': string;
|
86
|
+
'-100': string;
|
87
|
+
uploadError: string;
|
88
|
+
uploadFailed: string;
|
89
|
+
defaultText: string;
|
90
|
+
};
|
91
|
+
isUnity: (projectPath: string) => Promise<boolean>;
|
92
|
+
unityUpload: (options: UploadProps & Pick<UploadProps, "projectPath" | "version" | "ideUid"> & {
|
93
|
+
updateStatus?: (status: number | string) => void;
|
94
|
+
} & {
|
95
|
+
publishType?: UnityConfigType['publishType'];
|
96
|
+
deviceOrientation?: UnityGameJson['deviceOrientation'];
|
97
|
+
}) => Promise<void>;
|
98
|
+
};
|
99
|
+
export {};
|
@@ -5,6 +5,16 @@
|
|
5
5
|
export declare const PKG_SIZE_IGNORE_GLOBS: string[];
|
6
6
|
/** 计算包哈希时不参与计算的文件匹配规则 */
|
7
7
|
export declare const PKG_HASH_IGNORE_LIST: string[];
|
8
|
+
/**
|
9
|
+
* 获取上传预览 Settings 配置,支持白名单处理,兜底默认
|
10
|
+
*/
|
11
|
+
export declare const getSizeLimitConfig: (appId: string) => Promise<{
|
12
|
+
normalTotal: number;
|
13
|
+
subMain: number;
|
14
|
+
subPkg: number;
|
15
|
+
subTotal: number;
|
16
|
+
openData: number;
|
17
|
+
}>;
|
8
18
|
/**
|
9
19
|
* 校验包体大小,支持白名单逻辑,具体限制以 Settings 下发为准
|
10
20
|
* 默认:普通包最大 8MB,开放数据域 & 分包主包最大 4MB,子包不限制,总包 20MB
|
@@ -5,7 +5,6 @@ import type { ProjectConfig } from '@byted/miniprogram-utils/dist/data/project';
|
|
5
5
|
import { ProjectSize } from '@byted/miniprogram-utils/typings/project';
|
6
6
|
import archiver from 'archiver';
|
7
7
|
import fg from 'fast-glob';
|
8
|
-
import { IApp } from '@byted/miniprogram-utils/dist/data/app';
|
9
8
|
/**
|
10
9
|
* 计算给定文件夹下面的文件体积总值
|
11
10
|
* @param folderPath directory path
|
@@ -17,12 +16,10 @@ export declare function getFolderSize(folderPath: string, useTypeScript: boolean
|
|
17
16
|
/**
|
18
17
|
* 以文件夹为单位的包体积统计,不适用于依赖分析
|
19
18
|
*
|
20
|
-
* @param projectConfig
|
21
|
-
* @param appJson
|
22
19
|
* @param projectPath
|
23
20
|
* @param isGame
|
24
21
|
*/
|
25
|
-
export declare function getProjectSize(
|
22
|
+
export declare function getProjectSize(projectPath: string, isGame?: boolean): Promise<ProjectSize>;
|
26
23
|
/**
|
27
24
|
* 校验当前项目的分包体积是否符合要求
|
28
25
|
* 若有错误,会抛出 promise 异常
|
@@ -39,7 +36,7 @@ declare type FolderToZipStreamOption = {
|
|
39
36
|
*
|
40
37
|
* @param dir path to folder
|
41
38
|
*/
|
42
|
-
export declare function folderToZipStream(dir: string, { whiteList, useTypeScript }: FolderToZipStreamOption, isGame: boolean): Promise<archiver.Archiver>;
|
39
|
+
export declare function folderToZipStream(dir: string, { whiteList, useTypeScript }: FolderToZipStreamOption, isGame: boolean, highWaterMark?: number): Promise<archiver.Archiver>;
|
43
40
|
/**
|
44
41
|
* For cli only
|
45
42
|
* @param input
|
@@ -11,6 +11,7 @@ export declare type ProjectQRCode = {
|
|
11
11
|
qrcodeFilePath?: string;
|
12
12
|
useCache: boolean;
|
13
13
|
} & Pick<CompileProgressResult, 'metrics' | 'passJson'>;
|
14
|
+
export declare function checkChannel(appid: string, channel: string): Promise<void>;
|
14
15
|
declare type CompileProgressResult = {
|
15
16
|
success: boolean;
|
16
17
|
/** error code */
|
@@ -37,6 +38,7 @@ export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrco
|
|
37
38
|
needUploadSourcemap?: boolean;
|
38
39
|
needUploadCheck?: boolean;
|
39
40
|
extraCheckInfoJson?: string;
|
41
|
+
channel?: string;
|
40
42
|
};
|
41
43
|
/**
|
42
44
|
* 发布上传(功能入口)
|
@@ -62,6 +64,7 @@ export declare type ProjectToQRCodeOption = {
|
|
62
64
|
needUploadSourcemap: boolean;
|
63
65
|
needUploadCheck: boolean;
|
64
66
|
extraCheckInfoJson?: string;
|
67
|
+
channel?: string;
|
65
68
|
};
|
66
69
|
extraInfoJson?: string;
|
67
70
|
localCompileVersion?: string;
|
@@ -4,13 +4,10 @@ export declare const getUserId: () => string;
|
|
4
4
|
export declare function saveUserCookies(cookies: string[], userId: string): void;
|
5
5
|
export declare function removeUserCookies(): void;
|
6
6
|
export declare function setCookieFn(fn: GetCookieFunction): void;
|
7
|
-
|
8
|
-
'x-cli-token'
|
9
|
-
'x-cli-appid'
|
10
|
-
Cookie
|
11
|
-
}
|
12
|
-
|
13
|
-
'x-cli-token'?: undefined;
|
14
|
-
'x-cli-appid'?: undefined;
|
15
|
-
}>;
|
7
|
+
declare type LogInfoHeaders = {
|
8
|
+
'x-cli-token'?: any;
|
9
|
+
'x-cli-appid'?: string;
|
10
|
+
Cookie?: any;
|
11
|
+
};
|
12
|
+
export declare const getLogInfoHeaders: (appId: string) => Promise<LogInfoHeaders>;
|
16
13
|
export {};
|
@@ -56,3 +56,4 @@ export declare function getMD5Stream(source: archiver.Archiver): Promise<Transfo
|
|
56
56
|
export declare const getNextVersion: (version: string) => string;
|
57
57
|
export declare const isGameFileValid: (pattern: string) => boolean;
|
58
58
|
export declare const isObject: (value: any) => boolean;
|
59
|
+
export declare function sleep(timer: number): Promise<unknown>;
|
package/package.json
CHANGED
@@ -1,48 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* AppSettings 相关逻辑封装
|
3
|
-
* https://site.bytedance.net/docs/428/3356/request_params/
|
4
|
-
*/
|
5
|
-
import { SizeLimitConfig, TmgSdkInfo } from './source.type';
|
6
|
-
/**
|
7
|
-
* 网络请求相关相关的 typings 声明
|
8
|
-
*/
|
9
|
-
declare type BaseResponse<T = any> = {
|
10
|
-
data: T;
|
11
|
-
message: string;
|
12
|
-
};
|
13
|
-
declare type Dict<T = any> = {
|
14
|
-
[key: string]: T;
|
15
|
-
};
|
16
|
-
export declare type SettingsResponse = BaseResponse<{
|
17
|
-
settings: {
|
18
|
-
compile_config?: {
|
19
|
-
limit: SizeLimitConfig;
|
20
|
-
};
|
21
|
-
tt_tma_sdk_config?: TmgSdkInfo[];
|
22
|
-
};
|
23
|
-
settings_time: number;
|
24
|
-
}>;
|
25
|
-
export declare const SETTINGS_URL = "https://is.snssdk.com/service/settings/v3/";
|
26
|
-
export declare const genDefault: (params: Dict) => {
|
27
|
-
caller_name: string;
|
28
|
-
channel: string;
|
29
|
-
device_platform: string;
|
30
|
-
device_id: any;
|
31
|
-
device_id_str: any;
|
32
|
-
version_code: any;
|
33
|
-
user_id: any;
|
34
|
-
};
|
35
|
-
/**
|
36
|
-
* 获取小游戏 IDE AppSettings 配置
|
37
|
-
* https://cloud.bytedance.net/appSettings-v2/detail/product/608/config/list
|
38
|
-
*/
|
39
|
-
export declare const getIdeSettings: (params?: Dict) => Promise<{
|
40
|
-
settings: {
|
41
|
-
compile_config?: {
|
42
|
-
limit: SizeLimitConfig;
|
43
|
-
};
|
44
|
-
tt_tma_sdk_config?: TmgSdkInfo[];
|
45
|
-
};
|
46
|
-
settings_time: number;
|
47
|
-
}>;
|
48
|
-
export {};
|