@mdfriday/foundry 26.3.10 → 26.3.12

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
@@ -1747,12 +1747,16 @@ var init_license = __esm({
1747
1747
  expiresAt;
1748
1748
  features;
1749
1749
  activatedAt;
1750
- constructor(key2, plan, expiresAt, features, activatedAt) {
1750
+ activated;
1751
+ firstTime;
1752
+ constructor(key2, plan, expiresAt, features, activatedAt, activated = false, firstTime = false) {
1751
1753
  this.key = key2;
1752
1754
  this.plan = plan;
1753
1755
  this.expiresAt = expiresAt;
1754
1756
  this.features = features;
1755
1757
  this.activatedAt = activatedAt;
1758
+ this.activated = activated;
1759
+ this.firstTime = firstTime;
1756
1760
  }
1757
1761
  // ============================================================================
1758
1762
  // Factory Methods
@@ -1760,7 +1764,7 @@ var init_license = __esm({
1760
1764
  /**
1761
1765
  * 创建 License 实例
1762
1766
  */
1763
- static create(key2, plan, expiresAt, features, activatedAt) {
1767
+ static create(key2, plan, expiresAt, features, activatedAt, activated, firstTime) {
1764
1768
  if (!_License.isValidFormat(key2)) {
1765
1769
  throw new Error(`Invalid license key format: ${key2}`);
1766
1770
  }
@@ -1769,7 +1773,9 @@ var init_license = __esm({
1769
1773
  plan,
1770
1774
  expiresAt,
1771
1775
  features,
1772
- activatedAt || Date.now()
1776
+ activatedAt || Date.now(),
1777
+ activated || false,
1778
+ firstTime || false
1773
1779
  );
1774
1780
  }
1775
1781
  /**
@@ -1781,7 +1787,9 @@ var init_license = __esm({
1781
1787
  data.plan,
1782
1788
  data.expiresAt,
1783
1789
  data.features,
1784
- data.activatedAt
1790
+ data.activatedAt,
1791
+ data.activated,
1792
+ data.firstTime
1785
1793
  );
1786
1794
  }
1787
1795
  // ============================================================================
@@ -1921,6 +1929,18 @@ var init_license = __esm({
1921
1929
  getActivatedAt() {
1922
1930
  return this.activatedAt;
1923
1931
  }
1932
+ /**
1933
+ * 获取激活状态
1934
+ */
1935
+ isActivated() {
1936
+ return this.activated;
1937
+ }
1938
+ /**
1939
+ * 是否首次激活
1940
+ */
1941
+ isFirstTime() {
1942
+ return this.firstTime;
1943
+ }
1924
1944
  /**
1925
1945
  * 检查是否是试用 License
1926
1946
  */
@@ -1948,7 +1968,9 @@ var init_license = __esm({
1948
1968
  plan: this.plan,
1949
1969
  expiresAt: this.expiresAt,
1950
1970
  features: { ...this.features },
1951
- activatedAt: this.activatedAt
1971
+ activatedAt: this.activatedAt,
1972
+ activated: this.activated,
1973
+ firstTime: this.firstTime
1952
1974
  };
1953
1975
  }
1954
1976
  /**
@@ -1962,6 +1984,8 @@ var init_license = __esm({
1962
1984
  expiresAt: this.expiresAt,
1963
1985
  features: { ...this.features },
1964
1986
  activatedAt: this.activatedAt,
1987
+ activated: this.activated,
1988
+ firstTime: this.firstTime,
1965
1989
  isValid: this.isValid(),
1966
1990
  daysRemaining: this.getDaysRemaining()
1967
1991
  };
@@ -1981,12 +2005,14 @@ var init_sync_config = __esm({
1981
2005
  email;
1982
2006
  dbPassword;
1983
2007
  userDir;
2008
+ status;
1984
2009
  constructor(data) {
1985
2010
  this.dbEndpoint = data.dbEndpoint;
1986
2011
  this.dbName = data.dbName;
1987
2012
  this.email = data.email;
1988
2013
  this.dbPassword = data.dbPassword;
1989
2014
  this.userDir = data.userDir;
2015
+ this.status = data.status || "active";
1990
2016
  }
1991
2017
  // ============================================================================
1992
2018
  // Factory Methods
@@ -2039,6 +2065,18 @@ var init_sync_config = __esm({
2039
2065
  getUserDir() {
2040
2066
  return this.userDir;
2041
2067
  }
2068
+ /**
2069
+ * 获取同步账号状态
2070
+ */
2071
+ getStatus() {
2072
+ return this.status;
2073
+ }
2074
+ /**
2075
+ * 检查同步账号是否激活
2076
+ */
2077
+ isActive() {
2078
+ return this.status === "active";
2079
+ }
2042
2080
  /**
2043
2081
  * 获取 CouchDB URI(不包含数据库名)
2044
2082
  * 例如:https://couch.example.com/dbname -> https://couch.example.com
@@ -2058,7 +2096,8 @@ var init_sync_config = __esm({
2058
2096
  dbName: this.dbName,
2059
2097
  email: this.email,
2060
2098
  dbPassword: this.dbPassword,
2061
- userDir: this.userDir
2099
+ userDir: this.userDir,
2100
+ status: this.status
2062
2101
  };
2063
2102
  }
2064
2103
  /**
@@ -2812,7 +2851,9 @@ var init_user_factory = __esm({
2812
2851
  data.plan,
2813
2852
  data.expires_at,
2814
2853
  features,
2815
- Date.now()
2854
+ Date.now(),
2855
+ data.activated,
2856
+ data.first_time
2816
2857
  );
2817
2858
  user.setLicense(license);
2818
2859
  if (data.sync && data.features.sync_enabled) {
@@ -2821,19 +2862,25 @@ var init_user_factory = __esm({
2821
2862
  dbName: data.sync.db_name,
2822
2863
  email: data.sync.email,
2823
2864
  dbPassword: data.sync.db_password,
2824
- userDir: data.user.user_dir
2865
+ userDir: data.user.user_dir,
2866
+ status: data.sync.status
2825
2867
  });
2826
2868
  user.setSyncConfig(syncConfig);
2827
2869
  log4.info("Sync configuration saved", {
2828
2870
  dbName: syncConfig.getDbName(),
2829
2871
  email: syncConfig.getEmail(),
2830
- userDir: syncConfig.getUserDir()
2872
+ userDir: syncConfig.getUserDir(),
2873
+ status: syncConfig.getStatus(),
2874
+ isActive: syncConfig.isActive()
2831
2875
  });
2832
2876
  }
2833
2877
  await this.save(user);
2834
2878
  log4.info("License activated successfully", {
2879
+ licenseKey: data.license_key,
2835
2880
  plan: license.getPlan(),
2836
2881
  expires: license.getFormattedExpiresAt(),
2882
+ activated: data.activated,
2883
+ firstTime: data.first_time,
2837
2884
  syncEnabled: data.features.sync_enabled,
2838
2885
  hasSyncConfig: user.getSyncConfig() !== null
2839
2886
  });
@@ -55040,7 +55087,7 @@ For more information, visit: https://help.mdfriday.com
55040
55087
  * Show version
55041
55088
  */
55042
55089
  showVersion() {
55043
- const version = "26.3.10";
55090
+ const version = "26.3.12";
55044
55091
  return {
55045
55092
  success: true,
55046
55093
  message: `MDFriday CLI v${version}`