@mdfriday/foundry 26.4.13 → 26.4.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
@@ -2569,7 +2569,7 @@ var init_user_factory = __esm({
2569
2569
  async load() {
2570
2570
  try {
2571
2571
  const userData = await this.storageProvider.loadUserData();
2572
- if (!userData || !userData.token) {
2572
+ if (!userData) {
2573
2573
  log4.debug("No user data found in storage");
2574
2574
  return null;
2575
2575
  }
@@ -2646,8 +2646,8 @@ var init_user_factory = __esm({
2646
2646
  */
2647
2647
  async loadServerConfig() {
2648
2648
  try {
2649
- const config = await this.storageProvider.loadServerConfig();
2650
- return config;
2649
+ const userData = await this.storageProvider.loadUserData();
2650
+ return userData?.serverConfig || null;
2651
2651
  } catch (error) {
2652
2652
  log4.debug("No server config found in storage");
2653
2653
  return null;
@@ -2739,7 +2739,7 @@ var init_user_factory = __esm({
2739
2739
  */
2740
2740
  async logout() {
2741
2741
  try {
2742
- await this.storageProvider.clearToken();
2742
+ await this.storageProvider.clearUserData();
2743
2743
  log4.info("Logout successful");
2744
2744
  } catch (error) {
2745
2745
  log4.error("Logout failed", error);
@@ -4084,56 +4084,6 @@ var init_workspace_factory = __esm({
4084
4084
  } catch {
4085
4085
  }
4086
4086
  authentication.markAuthDeleted();
4087
- },
4088
- // 保留旧方法以向后兼容
4089
- async saveToken(token) {
4090
- const authPath = fsRepo.join(workspacePath, ".mdfriday", "auth-token.json");
4091
- await fsRepo.createDirectory(fsRepo.dirname(authPath), true);
4092
- await fsRepo.writeFile(authPath, JSON.stringify(token.toJSON(), null, 2));
4093
- authentication.markAuthExists();
4094
- },
4095
- async loadToken() {
4096
- const userData = await this.loadUserData();
4097
- if (userData?.token) {
4098
- return userData.token;
4099
- }
4100
- const authPath = fsRepo.join(workspacePath, ".mdfriday", "auth-token.json");
4101
- try {
4102
- const content = await fsRepo.readFile(authPath, "utf-8");
4103
- const data = JSON.parse(content);
4104
- const { Token: Token3 } = await Promise.resolve().then(() => (init_identity(), identity_exports));
4105
- return Token3.create(data.token, data.expiresAt);
4106
- } catch {
4107
- return null;
4108
- }
4109
- },
4110
- async clearToken() {
4111
- const authPath = fsRepo.join(workspacePath, ".mdfriday", "auth-token.json");
4112
- try {
4113
- await fsRepo.unlink(authPath);
4114
- } catch {
4115
- }
4116
- authentication.markAuthDeleted();
4117
- },
4118
- async saveServerConfig(config) {
4119
- const configPath = fsRepo.join(workspacePath, ".mdfriday", "auth-config.json");
4120
- await fsRepo.createDirectory(fsRepo.dirname(configPath), true);
4121
- await fsRepo.writeFile(configPath, JSON.stringify(config.toJSON(), null, 2));
4122
- },
4123
- async loadServerConfig() {
4124
- const userData = await this.loadUserData();
4125
- if (userData?.serverConfig) {
4126
- return userData.serverConfig;
4127
- }
4128
- const configPath = fsRepo.join(workspacePath, ".mdfriday", "auth-config.json");
4129
- try {
4130
- const content = await fsRepo.readFile(configPath, "utf-8");
4131
- const data = JSON.parse(content);
4132
- const { ServerConfig: ServerConfig2 } = await Promise.resolve().then(() => (init_identity(), identity_exports));
4133
- return ServerConfig2.create(data.apiUrl, data.websiteUrl);
4134
- } catch {
4135
- return null;
4136
- }
4137
4087
  }
4138
4088
  };
4139
4089
  }
@@ -4640,18 +4590,12 @@ var init_identity2 = __esm({
4640
4590
  */
4641
4591
  async initialize() {
4642
4592
  try {
4643
- [this.currentUser, this.cachedServerConfig] = await Promise.all([
4644
- this.userFactory.load(),
4645
- this.userFactory.loadServerConfig()
4646
- ]);
4593
+ this.currentUser = await this.userFactory.load();
4647
4594
  if (this.currentUser) {
4648
- log7.info("User session restored");
4595
+ this.cachedServerConfig = this.currentUser.getServerConfig();
4649
4596
  } else {
4650
4597
  log7.debug("No existing user session");
4651
4598
  }
4652
- if (this.cachedServerConfig) {
4653
- log7.debug("Server config loaded from storage");
4654
- }
4655
4599
  } catch (error) {
4656
4600
  log7.error("Failed to initialize identity service", error);
4657
4601
  }
@@ -55371,7 +55315,7 @@ For more information, visit: https://help.mdfriday.com
55371
55315
  * Show version
55372
55316
  */
55373
55317
  showVersion() {
55374
- const version = "26.4.13";
55318
+ const version = "26.4.15";
55375
55319
  return {
55376
55320
  success: true,
55377
55321
  message: `MDFriday CLI v${version}`
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { startIncrementalBuild, IncrementalBuildConfig, IncrementalBuildCoordina
4
4
  export { MarkdownRenderer, AutoIDGenerator, ParsingResult, Header, TocFragments, Link, Paragraph } from './internal/domain/markdown';
5
5
  export { PageTask } from './pkg/page-filter';
6
6
  export { createObsidianWorkspaceService, createObsidianAuthService, createObsidianLicenseService, createObsidianGlobalConfigService, createObsidianProjectConfigService, createObsidianProjectService, createObsidianBuildService, createObsidianServeService, createObsidianPublishService, createObsidianDomainService, createWorkspaceAppService, createWorkspaceFactory, createObsidianWorkspaceAppService, createObsidianIdentityService, getIdentityService, } from './internal/interfaces/obsidian/desktop';
7
- export { type ObsidianWorkspaceInitOptions, type ObsidianWorkspaceInfo, type ObsidianWorkspaceResult, type ObsidianAuthStatus, type ObsidianSyncConfig, type ObsidianServerConfig, type ObsidianAuthResult, type ObsidianLicenseInfo, type ObsidianLicenseUsage, type ObsidianLicenseResult, type ObsidianConfigResult, type ConfigGetResult, type ConfigListResult, type ObsidianEnvironmentConfig, type ObsidianFullPersistenceConfig, type ObsidianBasicPersistenceConfig, isFullPersistenceConfig, type WorkspaceRepository, type ProjectRepository, type SnapshotRepository, type FileSystemRepository, type WorkspaceMetadataData, type ProjectMetadataData, type ProjectRegistry, type ProjectEntry, type BuildHistoryEntry, type SnapshotMetadata, type FolderStructure, type FolderScanResult, type ContentFolderInfo, type StaticFolderInfo, type SymlinkResult, type PublishHttpClient, type PublishHttpResponse, type IdentityHttpClient, type IdentityHttpResponse, type AnyPublishConfig, type FTPConfig, type NetlifyConfig, type MDFridayConfig, type SyncConfig, type SyncConfigData, } from './internal/interfaces/obsidian';
7
+ export { type ObsidianWorkspaceInitOptions, type ObsidianWorkspaceInfo, type ObsidianWorkspaceResult, type ObsidianAuthStatus, type ObsidianSyncConfig, type ObsidianServerConfig, type ObsidianAuthResult, type ObsidianLicenseInfo, type ObsidianLicenseUsage, type ObsidianLicenseResult, type ObsidianConfigResult, type ConfigGetResult, type ConfigListResult, type WorkspaceRepository, type ProjectRepository, type SnapshotRepository, type FileSystemRepository, type WorkspaceMetadataData, type ProjectMetadataData, type ProjectRegistry, type ProjectEntry, type BuildHistoryEntry, type SnapshotMetadata, type FolderStructure, type FolderScanResult, type ContentFolderInfo, type StaticFolderInfo, type SymlinkResult, type PublishHttpClient, type PublishHttpResponse, type IdentityHttpClient, type IdentityHttpResponse, type AnyPublishConfig, type FTPConfig, type NetlifyConfig, type MDFridayConfig, type SyncConfig, type SyncConfigData, } from './internal/interfaces/obsidian';
8
8
  export { type ObsidianProjectCreateOptions, type ObsidianProjectInfo, type ObsidianProjectResult, type ObsidianFolderStructureInfo, type ObsidianBuildOptions, type ObsidianBuildResult, type ObsidianServeOptions, type ObsidianServeResult, type ObsidianServeProgress, type ObsidianPublishMethod, type ObsidianPublishOptions, type ObsidianPublishProgress, type ObsidianPublishResult, type ObsidianTestConnectionResult, type ObsidianDomainInfo, type ObsidianSubdomainCheckResult, type ObsidianSubdomainUpdateResult, type ObsidianCustomDomainCheckResult, type ObsidianCustomDomainAddResult, type ObsidianHttpsCertificate, type ObsidianHttpsStatusResult, type ObsidianDomainResult, } from './internal/interfaces/obsidian/types';
9
9
  export { ObsidianProjectService, } from './internal/interfaces/obsidian/services/project.service';
10
10
  export { ObsidianBuildService, } from './internal/interfaces/obsidian/services/build.service';