@mdfriday/foundry 26.3.13 → 26.3.15

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 CHANGED
@@ -1945,7 +1945,7 @@ var init_license = __esm({
1945
1945
  * 检查是否是试用 License
1946
1946
  */
1947
1947
  isTrial() {
1948
- return this.plan === "trial";
1948
+ return this.plan === "free";
1949
1949
  }
1950
1950
  // ============================================================================
1951
1951
  // Comparison
@@ -2479,6 +2479,7 @@ var init_user = __esm({
2479
2479
  tokenExpired: this.isTokenExpired(),
2480
2480
  hasToken: this.token !== null,
2481
2481
  hasLicense: this.license !== null,
2482
+ license: this.license?.getKey(),
2482
2483
  licenseValid: this.hasValidLicense(),
2483
2484
  isTrial: this.isTrialAccount(),
2484
2485
  licensePlan: this.license?.getPlan(),
@@ -2796,7 +2797,7 @@ var init_user_factory = __esm({
2796
2797
  }
2797
2798
  const tempLicense = License.create(
2798
2799
  licenseKey,
2799
- "trial",
2800
+ "free",
2800
2801
  // 临时值,会在激活后更新
2801
2802
  Date.now() + 864e5,
2802
2803
  // 临时过期时间
@@ -3998,9 +3999,10 @@ var init_workspace_factory = __esm({
3998
3999
  async saveUserData(data) {
3999
4000
  const userDataPath = import_path3.default.join(workspacePath, ".mdfriday", "user-data.json");
4000
4001
  await fsRepo.createDirectory(import_path3.default.dirname(userDataPath), true);
4001
- const jsonData = {
4002
- serverConfig: data.serverConfig.toJSON()
4003
- };
4002
+ const jsonData = {};
4003
+ if (data.serverConfig) {
4004
+ jsonData.serverConfig = data.serverConfig.toJSON();
4005
+ }
4004
4006
  if (data.token) {
4005
4007
  jsonData.token = data.token.toJSON();
4006
4008
  authentication.markAuthExists();
@@ -4008,6 +4010,9 @@ var init_workspace_factory = __esm({
4008
4010
  if (data.license) {
4009
4011
  jsonData.license = data.license.toJSON();
4010
4012
  }
4013
+ if (data.syncConfig) {
4014
+ jsonData.syncConfig = data.syncConfig.toJSON();
4015
+ }
4011
4016
  if (data.email) {
4012
4017
  jsonData.email = data.email;
4013
4018
  }
@@ -4018,7 +4023,7 @@ var init_workspace_factory = __esm({
4018
4023
  try {
4019
4024
  const content = await fsRepo.readFile(userDataPath, "utf-8");
4020
4025
  const data = JSON.parse(content);
4021
- const { Token: Token3, ServerConfig: ServerConfig2, License: License2 } = await Promise.resolve().then(() => (init_identity(), identity_exports));
4026
+ const { Token: Token3, ServerConfig: ServerConfig2, License: License2, SyncConfig: SyncConfig2 } = await Promise.resolve().then(() => (init_identity(), identity_exports));
4022
4027
  const result = {};
4023
4028
  if (data.serverConfig) {
4024
4029
  result.serverConfig = ServerConfig2.create(data.serverConfig.apiUrl, data.serverConfig.websiteUrl);
@@ -4032,9 +4037,14 @@ var init_workspace_factory = __esm({
4032
4037
  data.license.plan,
4033
4038
  data.license.expiresAt,
4034
4039
  data.license.features,
4035
- data.license.activatedAt
4040
+ data.license.activatedAt,
4041
+ data.license.activated,
4042
+ data.license.firstTime
4036
4043
  );
4037
4044
  }
4045
+ if (data.syncConfig) {
4046
+ result.syncConfig = SyncConfig2.fromJSON(data.syncConfig);
4047
+ }
4038
4048
  if (data.email) {
4039
4049
  result.email = data.email;
4040
4050
  }
@@ -4637,6 +4647,7 @@ var init_identity2 = __esm({
4637
4647
  return {
4638
4648
  isAuthenticated: false,
4639
4649
  email: void 0,
4650
+ license: "",
4640
4651
  serverUrl: ServerConfig.createDefault().getApiUrl(),
4641
4652
  tokenExpired: true,
4642
4653
  hasToken: false
@@ -55105,7 +55116,7 @@ For more information, visit: https://help.mdfriday.com
55105
55116
  * Show version
55106
55117
  */
55107
55118
  showVersion() {
55108
- const version = "26.3.13";
55119
+ const version = "26.3.15";
55109
55120
  return {
55110
55121
  success: true,
55111
55122
  message: `MDFriday CLI v${version}`