Skip to content

Commit e69d634

Browse files
committed
Experimental: API v2.2 (unfinished)
1 parent f3cd0c2 commit e69d634

File tree

106 files changed

+1561
-2439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1561
-2439
lines changed

Diff for: RELEASE_CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
## 版本信息
2020

21-
- nyalcf_gui: 0.2.4
22-
- nyalcf_cli: 0.0.3
23-
- nyalcf_env: 1.0.2
24-
- nyalcf_core,nyalcf_inject: 1.2.6
21+
- nyalcf_gui: 1.0.0
22+
- nyalcf_cli: 1.0.0
23+
- nyalcf_env: 2.0.0
24+
- nyalcf_core,nyalcf_inject: 2.0.0
2525

2626
<!-- Some change log here -->

Diff for: nyalcf_cli/lib/commands/config.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import 'package:nyalcf_core/storages/configurations/launcher_configuration_stora
33
import 'package:nyalcf_core/utils/logger.dart';
44

55
// Project imports:
6-
import 'package:nyalcf/templates/command_implement.dart';
6+
import 'package:nyalcf/templates/command.dart';
77
import 'package:nyalcf/utils/state.dart';
88

9-
class Config implements CommandImplement {
9+
class Config implements Command {
1010
final _lcs = LauncherConfigurationStorage();
1111

1212
@override

Diff for: nyalcf_cli/lib/commands/download.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ import 'dart:io';
33

44
// Package imports:
55
import 'package:dio/dio.dart';
6-
import 'package:nyalcf_core/network/dio/frpc/download_frpc.dart';
76
import 'package:nyalcf_core/utils/cpu_arch.dart';
87
import 'package:nyalcf_core/utils/frpc/arch.dart';
98
import 'package:nyalcf_core/utils/frpc/archive.dart';
109
import 'package:nyalcf_core/utils/logger.dart';
1110

1211
// Project imports:
13-
import 'package:nyalcf/templates/command_implement.dart';
12+
import 'package:nyalcf/templates/command.dart';
1413
import 'package:nyalcf/utils/state.dart';
1514

16-
class Download implements CommandImplement {
15+
class Download implements Command {
1716
List<Map<String, String>> arch = [];
1817
late String platform;
1918

@@ -68,7 +67,7 @@ class Download implements CommandImplement {
6867
arch: _selectedArch,
6968
platform: platform,
7069
version: '0.51.3-6',
71-
releaseName: 'LoCyanFrp-0.51.3-6 #2024100301',
70+
name: 'LoCyanFrp-0.51.3-6 #2024100301',
7271
progressCallback: callback,
7372
cancelToken: _cancelToken,
7473
useMirror: false,

Diff for: nyalcf_cli/lib/commands/login.dart

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
// Package imports:
2-
import 'package:nyalcf_core/models/response/response.dart';
32
import 'package:nyalcf_core/models/user_info_model.dart';
4-
import 'package:nyalcf_core/network/dio/auth/auth.dart';
53
import 'package:nyalcf_core/storages/stores/user_info_storage.dart';
64
import 'package:nyalcf_core/utils/logger.dart';
75

86
// Project imports:
9-
import 'package:nyalcf/templates/command_implement.dart';
7+
import 'package:nyalcf/templates/command.dart';
108
import 'package:nyalcf/utils/text_encrypt.dart';
119

12-
class Login implements CommandImplement {
10+
class Login implements Command {
1311
@override
1412
Future<void> main(List<String> args) async {
1513
if (args.length == 2) {
@@ -19,7 +17,7 @@ class Login implements CommandImplement {
1917
final UserInfoModel userInfo = res.userInfo;
2018
Logger.info('Login successfully.');
2119
Logger.info('Info:');
22-
Logger.info('- name: ${userInfo.user}');
20+
Logger.info('- name: ${userInfo.username}');
2321
Logger.info('- email: ${userInfo.email}');
2422
Logger.info('- login token: ${TextEncrypt.obscure(userInfo.token)}');
2523
Logger.info('- frp token: ${TextEncrypt.obscure(userInfo.frpToken)}');

Diff for: nyalcf_cli/lib/commands/logout.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import 'package:nyalcf_core/storages/stores/user_info_storage.dart';
55
import 'package:nyalcf_core/utils/logger.dart';
66

77
// Project imports:
8-
import 'package:nyalcf/templates/command_implement.dart';
8+
import 'package:nyalcf/templates/command.dart';
99

10-
class Logout implements CommandImplement {
10+
class Logout implements Command {
1111
@override
1212
Future<void> main(List<String> args) async {
1313
final userInfo = await UserInfoStorage.read();
14-
final res = await UserInfoStorage.sigo(userInfo?.user, userInfo?.token);
14+
final res = await UserInfoStorage.logout(userInfo?.username, userInfo?.token);
1515

1616
if (res) {
1717
Logger.info('Session data removed.');

Diff for: nyalcf_cli/lib/commands/start.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import 'package:nyalcf_core/storages/stores/frpc_storage.dart';
77
import 'package:nyalcf_core/utils/logger.dart';
88

99
// Project imports:
10-
import 'package:nyalcf/templates/command_implement.dart';
10+
import 'package:nyalcf/templates/command.dart';
1111
import 'package:nyalcf/utils/frpc/process_manager.dart';
1212
import 'package:nyalcf/utils/state.dart';
1313

14-
class Start implements CommandImplement {
14+
class Start implements Command {
1515
static final _fcs = FrpcConfigurationStorage();
1616

1717
@override
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
abstract class CommandImplement {
1+
abstract class Command {
22
/// 入口函数
33
void main(List<String> args);
44
}

Diff for: nyalcf_cli/pubspec.lock

+19-3
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ packages:
142142
url: "https://pub.dev"
143143
source: hosted
144144
version: "2.1.2"
145+
http_methods:
146+
dependency: transitive
147+
description:
148+
name: http_methods
149+
sha256: "6bccce8f1ec7b5d701e7921dca35e202d425b57e317ba1a37f2638590e29e566"
150+
url: "https://pub.dev"
151+
source: hosted
152+
version: "1.1.1"
145153
http_multi_server:
146154
dependency: transitive
147155
description:
@@ -252,21 +260,21 @@ packages:
252260
path: "../nyalcf_core"
253261
relative: true
254262
source: path
255-
version: "1.2.6"
263+
version: "2.0.0"
256264
nyalcf_env:
257265
dependency: "direct main"
258266
description:
259267
path: "../nyalcf_env"
260268
relative: true
261269
source: path
262-
version: "1.0.2"
270+
version: "2.0.0"
263271
nyalcf_inject:
264272
dependency: "direct main"
265273
description:
266274
path: "../nyalcf_inject"
267275
relative: true
268276
source: path
269-
version: "1.2.6"
277+
version: "2.0.0"
270278
package_config:
271279
dependency: transitive
272280
description:
@@ -315,6 +323,14 @@ packages:
315323
url: "https://pub.dev"
316324
source: hosted
317325
version: "3.0.2"
326+
shelf_router:
327+
dependency: transitive
328+
description:
329+
name: shelf_router
330+
sha256: f5e5d492440a7fb165fe1e2e1a623f31f734d3370900070b2b1e0d0428d59864
331+
url: "https://pub.dev"
332+
source: hosted
333+
version: "1.1.4"
318334
shelf_static:
319335
dependency: transitive
320336
description:

Diff for: nyalcf_cli/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nyalcf
22
description: "[CLI]The next generation of LoCyanFrp launcher."
3-
version: 0.0.3+3
3+
version: 0.1.0+1
44
homepage: https://nyalcf.1l1.icu
55
publish_to: none
66
# repository: https://github.com/my_org/my_repo

Diff for: nyalcf_core/lib/models/api_base_model.dart

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
abstract class ApiBaseModel {
2+
ApiBaseModel({
3+
required this.endpoint,
4+
required this.params,
5+
this.validateStatus = const [200],
6+
});
7+
8+
final String endpoint;
9+
final Map<String, dynamic> params;
10+
List<int> validateStatus;
11+
}

Diff for: nyalcf_core/lib/models/frpc_version_model.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/// Frpc版本模型
2-
/// [releaseName] Release 名称
2+
/// [name] Release 名称
33
/// [tagName] Release Tag
44
class FrpcVersionModel {
55
FrpcVersionModel({
6-
required this.releaseName,
6+
required this.name,
77
required this.tagName,
88
});
99

10-
final String releaseName;
10+
final String name;
1111
final String tagName;
1212
}

Diff for: nyalcf_core/lib/models/proxy_info_model.dart

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
11
/// 隧道信息模型
2-
/// [proxyName] 隧道名
2+
/// [name] 隧道名
33
/// [useCompression] 是否使用压缩
44
/// [localIP] 本地 IP
55
/// [node] 节点 ID
66
/// [localPort] 本地端口
77
/// [remotePort] 远程端口
88
/// [domain] 绑定域名
99
/// [icp] 备案状态
10-
/// [sk]
10+
/// [secretKey]
1111
/// [id] 隧道 ID
1212
/// [proxyType] 隧道类型
1313
/// [useEncryption] 是否使用加密
1414
/// [status] 隧道状态
1515
class ProxyInfoModel {
1616
ProxyInfoModel({
17-
required this.proxyName,
18-
required this.useCompression,
19-
required this.localIP,
17+
required this.id,
18+
required this.name,
2019
required this.node,
20+
required this.proxyType,
21+
required this.localIP,
2122
required this.localPort,
2223
required this.remotePort,
2324
required this.domain,
24-
required this.icp,
25-
required this.sk,
26-
required this.id,
27-
required this.proxyType,
25+
required this.secretKey,
26+
required this.useCompression,
2827
required this.useEncryption,
2928
required this.status,
3029
});
3130

32-
final String proxyName;
31+
final String name;
3332
final bool useCompression;
3433
final String localIP;
3534
final int node;
3635
final int localPort;
3736
final int remotePort;
3837
final String? domain;
39-
final String? icp;
40-
final String? sk;
38+
final String? secretKey;
4139
final int id;
4240
final String proxyType;
4341
final bool useEncryption;
4442
final String? status;
4543

4644
@override
4745
String toString() {
48-
return '$proxyType:$proxyName:$id';
46+
return '$proxyType:$name:$id';
4947
}
5048
}

Diff for: nyalcf_core/lib/models/response/auth/login_auth_model.dart

-15
This file was deleted.

Diff for: nyalcf_core/lib/models/response/auth/logout_auth_model.dart

-10
This file was deleted.

Diff for: nyalcf_core/lib/models/response/auth/user_auth_model.dart

-20
This file was deleted.

Diff for: nyalcf_core/lib/models/response/frpc/download_frpc_model.dart

-17
This file was deleted.

Diff for: nyalcf_core/lib/models/response/frpc/version_frpc_model.dart

-27
This file was deleted.

Diff for: nyalcf_core/lib/models/response/launcher/update_launcher_model.dart

-15
This file was deleted.

0 commit comments

Comments
 (0)