@mdfriday/foundry 26.3.19 → 26.3.21
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 +24 -15
- package/dist/index.js +1 -1
- package/dist/internal/application/identity.d.ts +1 -1
- package/dist/internal/domain/publish/type.d.ts +1 -1
- package/dist/internal/interfaces/obsidian/license.d.ts +7 -1
- package/dist/internal/interfaces/obsidian/project.d.ts +1 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4723,13 +4723,14 @@ var init_identity2 = __esm({
|
|
|
4723
4723
|
// License Management
|
|
4724
4724
|
// ============================================================================
|
|
4725
4725
|
/**
|
|
4726
|
-
* 申请试用 License
|
|
4726
|
+
* 申请试用 License(只申请,不激活)
|
|
4727
4727
|
*
|
|
4728
4728
|
* @param email - 用户邮箱
|
|
4729
|
-
* @returns 试用 License
|
|
4729
|
+
* @returns 试用 License 信息和凭证
|
|
4730
4730
|
*/
|
|
4731
|
-
async
|
|
4732
|
-
|
|
4731
|
+
async requestTrial(email) {
|
|
4732
|
+
const savedConfig = await this.userFactory.loadServerConfig();
|
|
4733
|
+
return this.userFactory.requestTrialLicense(email, savedConfig || void 0);
|
|
4733
4734
|
}
|
|
4734
4735
|
/**
|
|
4735
4736
|
* 使用 License Key 登录
|
|
@@ -8659,7 +8660,7 @@ var init_mdfriday_publisher = __esm({
|
|
|
8659
8660
|
try {
|
|
8660
8661
|
log12.info(`Starting MDFriday deployment from: ${sourceDir}`);
|
|
8661
8662
|
log12.info(`Deployment type: ${this.config.deploymentType}`);
|
|
8662
|
-
if (!this.config.accessToken) {
|
|
8663
|
+
if (this.config.deploymentType !== "free" && !this.config.accessToken) {
|
|
8663
8664
|
throw new Error(
|
|
8664
8665
|
"MDFriday access token not found.\nPlease login first:\n mdf auth login"
|
|
8665
8666
|
);
|
|
@@ -8754,7 +8755,7 @@ var init_mdfriday_publisher = __esm({
|
|
|
8754
8755
|
*/
|
|
8755
8756
|
async testConnection() {
|
|
8756
8757
|
try {
|
|
8757
|
-
if (!this.config.accessToken) {
|
|
8758
|
+
if (this.config.deploymentType !== "free" && !this.config.accessToken) {
|
|
8758
8759
|
return {
|
|
8759
8760
|
success: false,
|
|
8760
8761
|
error: "Access token not found. Please login first: mdf auth login"
|
|
@@ -8824,12 +8825,16 @@ var init_mdfriday_publisher = __esm({
|
|
|
8824
8825
|
this.config.path || "",
|
|
8825
8826
|
this.config.deploymentType
|
|
8826
8827
|
);
|
|
8828
|
+
const isFreeDeployment = this.config.deploymentType === "free";
|
|
8829
|
+
const uploadUrl = isFreeDeployment ? `${this.getApiUrl()}/api/mdf/preview/friday?type=MDFPreview` : `${this.getApiUrl()}/api/mdf/preview?type=MDFPreview`;
|
|
8830
|
+
const headers = {};
|
|
8831
|
+
if (!isFreeDeployment && this.config.accessToken) {
|
|
8832
|
+
headers["Authorization"] = `Bearer ${this.config.accessToken}`;
|
|
8833
|
+
}
|
|
8827
8834
|
const response = await this.httpClient.postMultipart(
|
|
8828
|
-
|
|
8835
|
+
uploadUrl,
|
|
8829
8836
|
formData,
|
|
8830
|
-
|
|
8831
|
-
"Authorization": `Bearer ${this.config.accessToken}`
|
|
8832
|
-
}
|
|
8837
|
+
headers
|
|
8833
8838
|
);
|
|
8834
8839
|
clearInterval(progressInterval);
|
|
8835
8840
|
progressCallback?.(100);
|
|
@@ -8862,12 +8867,16 @@ var init_mdfriday_publisher = __esm({
|
|
|
8862
8867
|
host_name: "MDFriday Preview",
|
|
8863
8868
|
license_key: this.config.licenseKey || ""
|
|
8864
8869
|
};
|
|
8870
|
+
const isFreeDeployment = this.config.deploymentType === "free";
|
|
8871
|
+
const deployApiUrl = isFreeDeployment ? `${this.getApiUrl()}/api/mdf/preview/friday/deploy?type=MDFPreview&id=${previewId}` : `${this.getApiUrl()}/api/mdf/preview/deploy?type=MDFPreview&id=${previewId}`;
|
|
8872
|
+
const headers = {};
|
|
8873
|
+
if (!isFreeDeployment && this.config.accessToken) {
|
|
8874
|
+
headers["Authorization"] = `Bearer ${this.config.accessToken}`;
|
|
8875
|
+
}
|
|
8865
8876
|
const response = await this.httpClient.postMultipart(
|
|
8866
|
-
|
|
8877
|
+
deployApiUrl,
|
|
8867
8878
|
formData,
|
|
8868
|
-
|
|
8869
|
-
"Authorization": `Bearer ${this.config.accessToken}`
|
|
8870
|
-
}
|
|
8879
|
+
headers
|
|
8871
8880
|
);
|
|
8872
8881
|
if (!response.ok) {
|
|
8873
8882
|
const errorText = await response.text();
|
|
@@ -55162,7 +55171,7 @@ For more information, visit: https://help.mdfriday.com
|
|
|
55162
55171
|
* Show version
|
|
55163
55172
|
*/
|
|
55164
55173
|
showVersion() {
|
|
55165
|
-
const version = "26.3.
|
|
55174
|
+
const version = "26.3.21";
|
|
55166
55175
|
return {
|
|
55167
55176
|
success: true,
|
|
55168
55177
|
message: `MDFriday CLI v${version}`
|