@mdfriday/foundry 26.3.20 → 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 +19 -11
- package/dist/index.js +1 -1
- package/dist/internal/domain/publish/type.d.ts +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -8660,7 +8660,7 @@ var init_mdfriday_publisher = __esm({
|
|
|
8660
8660
|
try {
|
|
8661
8661
|
log12.info(`Starting MDFriday deployment from: ${sourceDir}`);
|
|
8662
8662
|
log12.info(`Deployment type: ${this.config.deploymentType}`);
|
|
8663
|
-
if (!this.config.accessToken) {
|
|
8663
|
+
if (this.config.deploymentType !== "free" && !this.config.accessToken) {
|
|
8664
8664
|
throw new Error(
|
|
8665
8665
|
"MDFriday access token not found.\nPlease login first:\n mdf auth login"
|
|
8666
8666
|
);
|
|
@@ -8755,7 +8755,7 @@ var init_mdfriday_publisher = __esm({
|
|
|
8755
8755
|
*/
|
|
8756
8756
|
async testConnection() {
|
|
8757
8757
|
try {
|
|
8758
|
-
if (!this.config.accessToken) {
|
|
8758
|
+
if (this.config.deploymentType !== "free" && !this.config.accessToken) {
|
|
8759
8759
|
return {
|
|
8760
8760
|
success: false,
|
|
8761
8761
|
error: "Access token not found. Please login first: mdf auth login"
|
|
@@ -8825,12 +8825,16 @@ var init_mdfriday_publisher = __esm({
|
|
|
8825
8825
|
this.config.path || "",
|
|
8826
8826
|
this.config.deploymentType
|
|
8827
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
|
+
}
|
|
8828
8834
|
const response = await this.httpClient.postMultipart(
|
|
8829
|
-
|
|
8835
|
+
uploadUrl,
|
|
8830
8836
|
formData,
|
|
8831
|
-
|
|
8832
|
-
"Authorization": `Bearer ${this.config.accessToken}`
|
|
8833
|
-
}
|
|
8837
|
+
headers
|
|
8834
8838
|
);
|
|
8835
8839
|
clearInterval(progressInterval);
|
|
8836
8840
|
progressCallback?.(100);
|
|
@@ -8863,12 +8867,16 @@ var init_mdfriday_publisher = __esm({
|
|
|
8863
8867
|
host_name: "MDFriday Preview",
|
|
8864
8868
|
license_key: this.config.licenseKey || ""
|
|
8865
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
|
+
}
|
|
8866
8876
|
const response = await this.httpClient.postMultipart(
|
|
8867
|
-
|
|
8877
|
+
deployApiUrl,
|
|
8868
8878
|
formData,
|
|
8869
|
-
|
|
8870
|
-
"Authorization": `Bearer ${this.config.accessToken}`
|
|
8871
|
-
}
|
|
8879
|
+
headers
|
|
8872
8880
|
);
|
|
8873
8881
|
if (!response.ok) {
|
|
8874
8882
|
const errorText = await response.text();
|
|
@@ -55163,7 +55171,7 @@ For more information, visit: https://help.mdfriday.com
|
|
|
55163
55171
|
* Show version
|
|
55164
55172
|
*/
|
|
55165
55173
|
showVersion() {
|
|
55166
|
-
const version = "26.3.
|
|
55174
|
+
const version = "26.3.21";
|
|
55167
55175
|
return {
|
|
55168
55176
|
success: true,
|
|
55169
55177
|
message: `MDFriday CLI v${version}`
|