react-native-update-cli 2.10.1 → 2.10.2
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/README.md +47 -497
- package/README.zh-CN.md +52 -500
- package/cli.json +2 -16
- package/lib/api.js +1 -1
- package/lib/exports.d.ts +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.js +14 -62
- package/lib/locales/en.d.ts +1 -0
- package/lib/locales/en.js +1 -0
- package/lib/locales/zh.d.ts +1 -0
- package/lib/locales/zh.js +1 -0
- package/lib/module-manager.d.ts +1 -5
- package/lib/module-manager.js +2 -30
- package/lib/modules/app-module.js +1 -249
- package/lib/modules/bundle-module.js +1 -173
- package/lib/modules/package-module.js +1 -2
- package/lib/modules/user-module.js +1 -399
- package/lib/modules/version-module.js +1 -2
- package/lib/package.d.ts +1 -2
- package/lib/package.js +6 -6
- package/lib/provider.d.ts +1 -4
- package/lib/provider.js +2 -21
- package/lib/types.d.ts +0 -20
- package/lib/user.d.ts +1 -1
- package/lib/user.js +1 -1
- package/lib/utils/app-info-parser/aab.js +1 -1
- package/lib/utils/app-info-parser/resource-finder.js +5 -5
- package/lib/utils/app-info-parser/utils.js +3 -2
- package/lib/utils/check-lockfile.js +1 -1
- package/lib/utils/dep-versions.js +2 -2
- package/lib/utils/http-helper.js +2 -2
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/versions.d.ts +1 -0
- package/lib/versions.js +19 -14
- package/package.json +1 -1
- package/src/api.ts +1 -1
- package/src/exports.ts +0 -2
- package/src/index.ts +16 -81
- package/src/locales/en.ts +1 -0
- package/src/locales/zh.ts +1 -0
- package/src/module-manager.ts +1 -41
- package/src/modules/app-module.ts +1 -271
- package/src/modules/bundle-module.ts +1 -206
- package/src/modules/package-module.ts +0 -3
- package/src/modules/user-module.ts +1 -459
- package/src/modules/version-module.ts +0 -1
- package/src/package.ts +5 -7
- package/src/provider.ts +4 -25
- package/src/types.ts +0 -32
- package/src/user.ts +1 -1
- package/src/utils/app-info-parser/aab.ts +1 -1
- package/src/utils/app-info-parser/resource-finder.ts +5 -5
- package/src/utils/app-info-parser/utils.ts +2 -2
- package/src/utils/check-lockfile.ts +1 -1
- package/src/utils/dep-versions.ts +2 -2
- package/src/utils/http-helper.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/versions.ts +24 -14
- package/lib/workflow-runner.d.ts +0 -2
- package/lib/workflow-runner.js +0 -25
- package/src/workflow-runner.ts +0 -24
|
@@ -8,180 +8,8 @@ Object.defineProperty(exports, "bundleModule", {
|
|
|
8
8
|
return bundleModule;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _bundle = require("../bundle");
|
|
12
11
|
const bundleModule = {
|
|
13
12
|
name: 'bundle',
|
|
14
13
|
version: '1.0.0',
|
|
15
|
-
commands: []
|
|
16
|
-
workflows: [
|
|
17
|
-
{
|
|
18
|
-
name: 'incremental-build',
|
|
19
|
-
description: 'Incremental build workflow - generate diff packages',
|
|
20
|
-
steps: [
|
|
21
|
-
{
|
|
22
|
-
name: 'detect-base-version',
|
|
23
|
-
description: 'Detect base version',
|
|
24
|
-
execute: async (context)=>{
|
|
25
|
-
console.log('🔍 Detecting base version...');
|
|
26
|
-
const { baseVersion } = context.options;
|
|
27
|
-
if (baseVersion) {
|
|
28
|
-
console.log(`✅ Using specified base version: ${baseVersion}`);
|
|
29
|
-
return {
|
|
30
|
-
baseVersion,
|
|
31
|
-
specified: true
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const autoDetectedVersion = 'latest';
|
|
35
|
-
console.log(`✅ Auto detected base version: ${autoDetectedVersion}`);
|
|
36
|
-
return {
|
|
37
|
-
baseVersion: autoDetectedVersion,
|
|
38
|
-
specified: false
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'build-current-version',
|
|
44
|
-
description: 'Build current version',
|
|
45
|
-
execute: async (context, previousResult)=>{
|
|
46
|
-
console.log('🏗️ Building current version...');
|
|
47
|
-
const state = previousResult && typeof previousResult === 'object' ? previousResult : {};
|
|
48
|
-
const { platform, dev = false, sourcemap = false, bundleName = 'index.bundlejs', entryFile = 'index.js', intermediaDir, taro = false, expo = false, rncli = false, hermes = false, output } = context.options;
|
|
49
|
-
console.log(`Building ${platform} platform...`);
|
|
50
|
-
console.log(` Entry file: ${entryFile}`);
|
|
51
|
-
console.log(` Bundle name: ${bundleName}`);
|
|
52
|
-
console.log(` Development mode: ${dev}`);
|
|
53
|
-
console.log(` Source maps: ${sourcemap}`);
|
|
54
|
-
try {
|
|
55
|
-
const buildOptions = {
|
|
56
|
-
platform,
|
|
57
|
-
dev,
|
|
58
|
-
sourcemap,
|
|
59
|
-
bundleName,
|
|
60
|
-
entryFile,
|
|
61
|
-
taro,
|
|
62
|
-
expo,
|
|
63
|
-
rncli,
|
|
64
|
-
hermes,
|
|
65
|
-
intermediaDir: '${tempDir}/intermedia/${platform}',
|
|
66
|
-
output: '${tempDir}/output/${platform}.${time}.ppk'
|
|
67
|
-
};
|
|
68
|
-
if (intermediaDir) {
|
|
69
|
-
buildOptions.intermediaDir = intermediaDir;
|
|
70
|
-
}
|
|
71
|
-
await _bundle.bundleCommands.bundle({
|
|
72
|
-
args: [],
|
|
73
|
-
options: buildOptions
|
|
74
|
-
});
|
|
75
|
-
const bundlePath = typeof output === 'string' ? output : '${tempDir}/output/${platform}.${time}.ppk';
|
|
76
|
-
const currentBuild = {
|
|
77
|
-
version: typeof state.baseVersion === 'string' ? state.baseVersion : 'current',
|
|
78
|
-
platform,
|
|
79
|
-
bundlePath,
|
|
80
|
-
buildTime: Date.now()
|
|
81
|
-
};
|
|
82
|
-
console.log(`✅ Current version build completed: ${currentBuild.version}`);
|
|
83
|
-
return {
|
|
84
|
-
...state,
|
|
85
|
-
currentBuild
|
|
86
|
-
};
|
|
87
|
-
} catch (error) {
|
|
88
|
-
console.error('❌ Current version build failed:', error);
|
|
89
|
-
throw error;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
validate: (context)=>{
|
|
95
|
-
if (!context.options.platform) {
|
|
96
|
-
console.error('❌ Incremental build requires platform specification');
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
return true;
|
|
100
|
-
},
|
|
101
|
-
options: {
|
|
102
|
-
platform: {
|
|
103
|
-
hasValue: true,
|
|
104
|
-
description: 'Target platform (required)'
|
|
105
|
-
},
|
|
106
|
-
baseVersion: {
|
|
107
|
-
hasValue: true,
|
|
108
|
-
description: 'Base version (auto detect if not specified)'
|
|
109
|
-
},
|
|
110
|
-
skipValidation: {
|
|
111
|
-
hasValue: false,
|
|
112
|
-
default: false,
|
|
113
|
-
description: 'Skip diff package validation'
|
|
114
|
-
},
|
|
115
|
-
dev: {
|
|
116
|
-
hasValue: false,
|
|
117
|
-
default: false,
|
|
118
|
-
description: 'Development mode build'
|
|
119
|
-
},
|
|
120
|
-
bundleName: {
|
|
121
|
-
hasValue: true,
|
|
122
|
-
default: 'index.bundlejs',
|
|
123
|
-
description: 'Bundle file name'
|
|
124
|
-
},
|
|
125
|
-
entryFile: {
|
|
126
|
-
hasValue: true,
|
|
127
|
-
default: 'index.js',
|
|
128
|
-
description: 'Entry file'
|
|
129
|
-
},
|
|
130
|
-
sourcemap: {
|
|
131
|
-
hasValue: false,
|
|
132
|
-
default: false,
|
|
133
|
-
description: 'Generate source maps'
|
|
134
|
-
},
|
|
135
|
-
output: {
|
|
136
|
-
hasValue: true,
|
|
137
|
-
description: 'Custom output path for diff package'
|
|
138
|
-
},
|
|
139
|
-
intermediaDir: {
|
|
140
|
-
hasValue: true,
|
|
141
|
-
description: 'Intermediate directory'
|
|
142
|
-
},
|
|
143
|
-
taro: {
|
|
144
|
-
hasValue: false,
|
|
145
|
-
default: false,
|
|
146
|
-
description: 'Use Taro CLI'
|
|
147
|
-
},
|
|
148
|
-
expo: {
|
|
149
|
-
hasValue: false,
|
|
150
|
-
default: false,
|
|
151
|
-
description: 'Use Expo CLI'
|
|
152
|
-
},
|
|
153
|
-
rncli: {
|
|
154
|
-
hasValue: false,
|
|
155
|
-
default: false,
|
|
156
|
-
description: 'Use React Native CLI'
|
|
157
|
-
},
|
|
158
|
-
hermes: {
|
|
159
|
-
hasValue: false,
|
|
160
|
-
default: false,
|
|
161
|
-
description: 'Force enable Hermes'
|
|
162
|
-
},
|
|
163
|
-
name: {
|
|
164
|
-
hasValue: true,
|
|
165
|
-
description: 'Version name for publishing'
|
|
166
|
-
},
|
|
167
|
-
description: {
|
|
168
|
-
hasValue: true,
|
|
169
|
-
description: 'Version description for publishing'
|
|
170
|
-
},
|
|
171
|
-
metaInfo: {
|
|
172
|
-
hasValue: true,
|
|
173
|
-
description: 'Meta information for publishing'
|
|
174
|
-
},
|
|
175
|
-
rollout: {
|
|
176
|
-
hasValue: true,
|
|
177
|
-
description: 'Rollout percentage'
|
|
178
|
-
},
|
|
179
|
-
dryRun: {
|
|
180
|
-
hasValue: false,
|
|
181
|
-
default: false,
|
|
182
|
-
description: 'Dry run mode'
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
]
|
|
14
|
+
commands: []
|
|
187
15
|
};
|
|
@@ -8,406 +8,8 @@ Object.defineProperty(exports, "userModule", {
|
|
|
8
8
|
return userModule;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _api = require("../api");
|
|
12
|
-
const _user = require("../user");
|
|
13
|
-
const _options = require("../utils/options");
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
15
|
-
if (typeof WeakMap !== "function") return null;
|
|
16
|
-
var cacheBabelInterop = new WeakMap();
|
|
17
|
-
var cacheNodeInterop = new WeakMap();
|
|
18
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
19
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
20
|
-
})(nodeInterop);
|
|
21
|
-
}
|
|
22
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
23
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
24
|
-
return obj;
|
|
25
|
-
}
|
|
26
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
27
|
-
return {
|
|
28
|
-
default: obj
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
32
|
-
if (cache && cache.has(obj)) {
|
|
33
|
-
return cache.get(obj);
|
|
34
|
-
}
|
|
35
|
-
var newObj = {
|
|
36
|
-
__proto__: null
|
|
37
|
-
};
|
|
38
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
-
for(var key in obj){
|
|
40
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
41
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
42
|
-
if (desc && (desc.get || desc.set)) {
|
|
43
|
-
Object.defineProperty(newObj, key, desc);
|
|
44
|
-
} else {
|
|
45
|
-
newObj[key] = obj[key];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
newObj.default = obj;
|
|
50
|
-
if (cache) {
|
|
51
|
-
cache.set(obj, newObj);
|
|
52
|
-
}
|
|
53
|
-
return newObj;
|
|
54
|
-
}
|
|
55
11
|
const userModule = {
|
|
56
12
|
name: 'user',
|
|
57
13
|
version: '1.0.0',
|
|
58
|
-
commands: []
|
|
59
|
-
workflows: [
|
|
60
|
-
{
|
|
61
|
-
name: 'auth-check',
|
|
62
|
-
description: 'Check authentication status and user information',
|
|
63
|
-
options: {
|
|
64
|
-
autoLogin: {
|
|
65
|
-
default: false,
|
|
66
|
-
description: 'Automatically login if not authenticated'
|
|
67
|
-
},
|
|
68
|
-
showDetails: {
|
|
69
|
-
default: true,
|
|
70
|
-
description: 'Show detailed user information'
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
steps: [
|
|
74
|
-
{
|
|
75
|
-
name: 'load-session',
|
|
76
|
-
description: 'Load existing session from local storage',
|
|
77
|
-
execute: async (context)=>{
|
|
78
|
-
console.log('Loading session from local storage...');
|
|
79
|
-
try {
|
|
80
|
-
await (0, _api.loadSession)();
|
|
81
|
-
const session = (0, _api.getSession)();
|
|
82
|
-
if (session == null ? void 0 : session.token) {
|
|
83
|
-
console.log('✓ Session found in local storage');
|
|
84
|
-
return {
|
|
85
|
-
sessionLoaded: true,
|
|
86
|
-
hasToken: true,
|
|
87
|
-
session
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
console.log('✗ No valid session found in local storage');
|
|
91
|
-
return {
|
|
92
|
-
sessionLoaded: true,
|
|
93
|
-
hasToken: false,
|
|
94
|
-
session: null
|
|
95
|
-
};
|
|
96
|
-
} catch (error) {
|
|
97
|
-
console.log('✗ Failed to load session:', error instanceof Error ? error.message : 'Unknown error');
|
|
98
|
-
return {
|
|
99
|
-
sessionLoaded: false,
|
|
100
|
-
hasToken: false,
|
|
101
|
-
session: null,
|
|
102
|
-
error: error instanceof Error ? error.message : 'Unknown error'
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: 'validate-session',
|
|
109
|
-
description: 'Validate session by calling API',
|
|
110
|
-
execute: async (context, previousResult)=>{
|
|
111
|
-
const state = (0, _options.toObjectState)(previousResult, {});
|
|
112
|
-
if (!state.hasToken) {
|
|
113
|
-
console.log('No token available, skipping validation');
|
|
114
|
-
return {
|
|
115
|
-
...state,
|
|
116
|
-
validated: false,
|
|
117
|
-
reason: 'No token available'
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
console.log('Validating session with server...');
|
|
121
|
-
try {
|
|
122
|
-
await _user.userCommands.me();
|
|
123
|
-
console.log('✓ Session is valid');
|
|
124
|
-
return {
|
|
125
|
-
...state,
|
|
126
|
-
validated: true,
|
|
127
|
-
reason: 'Session validated successfully'
|
|
128
|
-
};
|
|
129
|
-
} catch (error) {
|
|
130
|
-
console.log('✗ Session validation failed:', error instanceof Error ? error.message : 'Unknown error');
|
|
131
|
-
return {
|
|
132
|
-
...state,
|
|
133
|
-
validated: false,
|
|
134
|
-
reason: error instanceof Error ? error.message : 'Unknown error'
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: 'get-user-info',
|
|
141
|
-
description: 'Get current user information',
|
|
142
|
-
execute: async (context, previousResult)=>{
|
|
143
|
-
const state = (0, _options.toObjectState)(previousResult, {});
|
|
144
|
-
if (!state.validated) {
|
|
145
|
-
console.log('Session not valid, cannot get user info');
|
|
146
|
-
return {
|
|
147
|
-
...state,
|
|
148
|
-
userInfo: null,
|
|
149
|
-
reason: 'Session not valid'
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
console.log('Getting user information...');
|
|
153
|
-
try {
|
|
154
|
-
const { get } = await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("../api")));
|
|
155
|
-
const userInfo = await get('/user/me');
|
|
156
|
-
console.log('✓ User information retrieved successfully');
|
|
157
|
-
const showDetails = (0, _options.getBooleanOption)(context.options, 'showDetails', true);
|
|
158
|
-
if (showDetails) {
|
|
159
|
-
console.log('\n=== User Information ===');
|
|
160
|
-
for (const [key, value] of Object.entries(userInfo)){
|
|
161
|
-
if (key !== 'ok') {
|
|
162
|
-
console.log(`${key}: ${value}`);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
console.log('========================\n');
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
...state,
|
|
169
|
-
userInfo,
|
|
170
|
-
reason: 'User info retrieved successfully'
|
|
171
|
-
};
|
|
172
|
-
} catch (error) {
|
|
173
|
-
console.log('✗ Failed to get user info:', error instanceof Error ? error.message : 'Unknown error');
|
|
174
|
-
return {
|
|
175
|
-
...state,
|
|
176
|
-
userInfo: null,
|
|
177
|
-
reason: error instanceof Error ? error.message : 'Unknown error'
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
name: 'handle-auth-failure',
|
|
184
|
-
description: 'Handle authentication failure',
|
|
185
|
-
execute: async (context, previousResult)=>{
|
|
186
|
-
const state = (0, _options.toObjectState)(previousResult, {});
|
|
187
|
-
if (state.validated) {
|
|
188
|
-
console.log('✓ Authentication check completed successfully');
|
|
189
|
-
return {
|
|
190
|
-
...state,
|
|
191
|
-
authCheckComplete: true,
|
|
192
|
-
status: 'authenticated'
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
console.log('✗ Authentication check failed');
|
|
196
|
-
const autoLogin = (0, _options.getBooleanOption)(context.options, 'autoLogin', false);
|
|
197
|
-
if (autoLogin) {
|
|
198
|
-
console.log('Attempting automatic login...');
|
|
199
|
-
try {
|
|
200
|
-
await _user.userCommands.login({
|
|
201
|
-
args: []
|
|
202
|
-
});
|
|
203
|
-
console.log('✓ Automatic login successful');
|
|
204
|
-
return {
|
|
205
|
-
...state,
|
|
206
|
-
authCheckComplete: true,
|
|
207
|
-
status: 'auto-logged-in',
|
|
208
|
-
autoLoginSuccess: true
|
|
209
|
-
};
|
|
210
|
-
} catch (error) {
|
|
211
|
-
console.log('✗ Automatic login failed:', error instanceof Error ? error.message : 'Unknown error');
|
|
212
|
-
return {
|
|
213
|
-
...state,
|
|
214
|
-
authCheckComplete: true,
|
|
215
|
-
status: 'failed',
|
|
216
|
-
autoLoginSuccess: false,
|
|
217
|
-
autoLoginError: error instanceof Error ? error.message : 'Unknown error'
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
} else {
|
|
221
|
-
console.log('Please run login command to authenticate');
|
|
222
|
-
return {
|
|
223
|
-
...state,
|
|
224
|
-
authCheckComplete: true,
|
|
225
|
-
status: 'unauthenticated',
|
|
226
|
-
suggestion: 'Run login command to authenticate'
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
]
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
name: 'login-flow',
|
|
235
|
-
description: 'Complete login flow with validation',
|
|
236
|
-
options: {
|
|
237
|
-
email: {
|
|
238
|
-
hasValue: true,
|
|
239
|
-
description: 'User email'
|
|
240
|
-
},
|
|
241
|
-
password: {
|
|
242
|
-
hasValue: true,
|
|
243
|
-
description: 'User password'
|
|
244
|
-
},
|
|
245
|
-
validateAfterLogin: {
|
|
246
|
-
default: true,
|
|
247
|
-
description: 'Validate session after login'
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
steps: [
|
|
251
|
-
{
|
|
252
|
-
name: 'check-existing-session',
|
|
253
|
-
description: 'Check if user is already logged in',
|
|
254
|
-
execute: async (context)=>{
|
|
255
|
-
console.log('Checking existing session...');
|
|
256
|
-
try {
|
|
257
|
-
await (0, _api.loadSession)();
|
|
258
|
-
const session = (0, _api.getSession)();
|
|
259
|
-
if (session == null ? void 0 : session.token) {
|
|
260
|
-
try {
|
|
261
|
-
await _user.userCommands.me();
|
|
262
|
-
console.log('✓ User is already logged in');
|
|
263
|
-
return {
|
|
264
|
-
alreadyLoggedIn: true,
|
|
265
|
-
session: session,
|
|
266
|
-
status: 'authenticated'
|
|
267
|
-
};
|
|
268
|
-
} catch (error) {
|
|
269
|
-
console.log('✗ Existing session is invalid, proceeding with login');
|
|
270
|
-
return {
|
|
271
|
-
alreadyLoggedIn: false,
|
|
272
|
-
session: null,
|
|
273
|
-
status: 'session-expired'
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
} else {
|
|
277
|
-
console.log('No existing session found');
|
|
278
|
-
return {
|
|
279
|
-
alreadyLoggedIn: false,
|
|
280
|
-
session: null,
|
|
281
|
-
status: 'no-session'
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
} catch (error) {
|
|
285
|
-
console.log('Error checking existing session:', error instanceof Error ? error.message : 'Unknown error');
|
|
286
|
-
return {
|
|
287
|
-
alreadyLoggedIn: false,
|
|
288
|
-
session: null,
|
|
289
|
-
status: 'error',
|
|
290
|
-
error: error instanceof Error ? error.message : 'Unknown error'
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
name: 'perform-login',
|
|
297
|
-
description: 'Perform user login',
|
|
298
|
-
execute: async (context, previousResult)=>{
|
|
299
|
-
const state = (0, _options.toObjectState)(previousResult, {});
|
|
300
|
-
if (state.alreadyLoggedIn) {
|
|
301
|
-
console.log('Skipping login - user already authenticated');
|
|
302
|
-
return {
|
|
303
|
-
...state,
|
|
304
|
-
loginPerformed: false,
|
|
305
|
-
loginSuccess: true
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
console.log('Performing login...');
|
|
309
|
-
try {
|
|
310
|
-
const loginArgs = [];
|
|
311
|
-
const email = (0, _options.getOptionalStringOption)(context.options, 'email');
|
|
312
|
-
if (email) {
|
|
313
|
-
loginArgs.push(email);
|
|
314
|
-
}
|
|
315
|
-
const password = (0, _options.getOptionalStringOption)(context.options, 'password');
|
|
316
|
-
if (password) {
|
|
317
|
-
loginArgs.push(password);
|
|
318
|
-
}
|
|
319
|
-
await _user.userCommands.login({
|
|
320
|
-
args: loginArgs
|
|
321
|
-
});
|
|
322
|
-
console.log('✓ Login successful');
|
|
323
|
-
return {
|
|
324
|
-
...state,
|
|
325
|
-
loginPerformed: true,
|
|
326
|
-
loginSuccess: true
|
|
327
|
-
};
|
|
328
|
-
} catch (error) {
|
|
329
|
-
console.log('✗ Login failed:', error instanceof Error ? error.message : 'Unknown error');
|
|
330
|
-
return {
|
|
331
|
-
...state,
|
|
332
|
-
loginPerformed: true,
|
|
333
|
-
loginSuccess: false,
|
|
334
|
-
loginError: error instanceof Error ? error.message : 'Unknown error'
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
name: 'validate-login',
|
|
341
|
-
description: 'Validate login by getting user info',
|
|
342
|
-
execute: async (context, previousResult)=>{
|
|
343
|
-
const state = (0, _options.toObjectState)(previousResult, {});
|
|
344
|
-
if (!state.loginSuccess && !state.alreadyLoggedIn) {
|
|
345
|
-
console.log('Login failed, skipping validation');
|
|
346
|
-
return {
|
|
347
|
-
...state,
|
|
348
|
-
validationPerformed: false,
|
|
349
|
-
validationSuccess: false
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
const validateAfterLogin = (0, _options.getBooleanOption)(context.options, 'validateAfterLogin', true);
|
|
353
|
-
if (!validateAfterLogin) {
|
|
354
|
-
console.log('Skipping validation as requested');
|
|
355
|
-
return {
|
|
356
|
-
...state,
|
|
357
|
-
validationPerformed: false,
|
|
358
|
-
validationSuccess: true
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
console.log('Validating login by getting user information...');
|
|
362
|
-
try {
|
|
363
|
-
const userInfo = await _user.userCommands.me();
|
|
364
|
-
console.log('✓ Login validation successful');
|
|
365
|
-
return {
|
|
366
|
-
...state,
|
|
367
|
-
validationPerformed: true,
|
|
368
|
-
validationSuccess: true,
|
|
369
|
-
userInfo
|
|
370
|
-
};
|
|
371
|
-
} catch (error) {
|
|
372
|
-
console.log('✗ Login validation failed:', error instanceof Error ? error.message : 'Unknown error');
|
|
373
|
-
return {
|
|
374
|
-
...state,
|
|
375
|
-
validationPerformed: true,
|
|
376
|
-
validationSuccess: false,
|
|
377
|
-
validationError: error instanceof Error ? error.message : 'Unknown error'
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
name: 'login-summary',
|
|
384
|
-
description: 'Provide login flow summary',
|
|
385
|
-
execute: async (context, previousResult)=>{
|
|
386
|
-
const state = (0, _options.toObjectState)(previousResult, {});
|
|
387
|
-
console.log('\n=== Login Flow Summary ===');
|
|
388
|
-
if (state.alreadyLoggedIn) {
|
|
389
|
-
console.log('Status: Already logged in');
|
|
390
|
-
console.log('Session: Valid');
|
|
391
|
-
} else if (state.loginSuccess) {
|
|
392
|
-
console.log('Status: Login successful');
|
|
393
|
-
if (state.validationSuccess) {
|
|
394
|
-
console.log('Validation: Passed');
|
|
395
|
-
} else {
|
|
396
|
-
console.log('Validation: Failed');
|
|
397
|
-
}
|
|
398
|
-
} else {
|
|
399
|
-
console.log('Status: Login failed');
|
|
400
|
-
console.log('Error:', state.loginError || 'Unknown error');
|
|
401
|
-
}
|
|
402
|
-
console.log('==========================\n');
|
|
403
|
-
return {
|
|
404
|
-
...state,
|
|
405
|
-
flowComplete: true,
|
|
406
|
-
finalStatus: state.alreadyLoggedIn || state.loginSuccess ? 'success' : 'failed'
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
]
|
|
411
|
-
}
|
|
412
|
-
]
|
|
14
|
+
commands: []
|
|
413
15
|
};
|
package/lib/package.d.ts
CHANGED
package/lib/package.js
CHANGED
|
@@ -42,7 +42,7 @@ function normalizeUploadBuildTime(value) {
|
|
|
42
42
|
return String(value);
|
|
43
43
|
}
|
|
44
44
|
function ensureFileByExt(filePath, extension, usageKey) {
|
|
45
|
-
if (!filePath
|
|
45
|
+
if (!(filePath == null ? void 0 : filePath.endsWith(extension))) {
|
|
46
46
|
throw new Error((0, _i18n.t)(usageKey));
|
|
47
47
|
}
|
|
48
48
|
return filePath;
|
|
@@ -223,28 +223,28 @@ const packageCommands = {
|
|
|
223
223
|
},
|
|
224
224
|
parseApp: async ({ args })=>{
|
|
225
225
|
const fn = args[0];
|
|
226
|
-
if (!fn
|
|
226
|
+
if (!(fn == null ? void 0 : fn.endsWith('.app'))) {
|
|
227
227
|
throw new Error((0, _i18n.t)('usageParseApp'));
|
|
228
228
|
}
|
|
229
229
|
console.log(await (0, _utils.getAppInfo)(fn));
|
|
230
230
|
},
|
|
231
231
|
parseIpa: async ({ args })=>{
|
|
232
232
|
const fn = args[0];
|
|
233
|
-
if (!fn
|
|
233
|
+
if (!(fn == null ? void 0 : fn.endsWith('.ipa'))) {
|
|
234
234
|
throw new Error((0, _i18n.t)('usageParseIpa'));
|
|
235
235
|
}
|
|
236
236
|
console.log(await (0, _utils.getIpaInfo)(fn));
|
|
237
237
|
},
|
|
238
238
|
parseApk: async ({ args })=>{
|
|
239
239
|
const fn = args[0];
|
|
240
|
-
if (!fn
|
|
240
|
+
if (!(fn == null ? void 0 : fn.endsWith('.apk'))) {
|
|
241
241
|
throw new Error((0, _i18n.t)('usageParseApk'));
|
|
242
242
|
}
|
|
243
243
|
console.log(await (0, _utils.getApkInfo)(fn));
|
|
244
244
|
},
|
|
245
245
|
parseAab: async ({ args })=>{
|
|
246
246
|
const fn = args[0];
|
|
247
|
-
if (!fn
|
|
247
|
+
if (!(fn == null ? void 0 : fn.endsWith('.aab'))) {
|
|
248
248
|
throw new Error((0, _i18n.t)('usageParseAab'));
|
|
249
249
|
}
|
|
250
250
|
console.log(await (0, _utils.getAabInfo)(fn));
|
|
@@ -268,7 +268,7 @@ const packageCommands = {
|
|
|
268
268
|
const { appId } = await (0, _app.getSelectedApp)(platform);
|
|
269
269
|
await listPackage(String(appId));
|
|
270
270
|
},
|
|
271
|
-
deletePackage: async ({
|
|
271
|
+
deletePackage: async ({ options })=>{
|
|
272
272
|
let { appId, packageId, packageVersion } = options;
|
|
273
273
|
if (!appId) {
|
|
274
274
|
const platform = await (0, _app.getPlatform)(options.platform);
|