@frontmatter/extensibility
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -9,2 +9,19 @@ import { MediaArguments } from "../models/ScriptArguments.js"; | ||
static getArguments(): MediaArguments | undefined; | ||
/** | ||
* Copies the metadata from the source file to the destination file. | ||
* @param sourcePath - The path of the source file. | ||
* @param destinationPath - The path of the destination file. | ||
*/ | ||
static copyMetadata(sourcePath: string, destinationPath: string): void; | ||
/** | ||
* Copies the metadata from the source file to the destination file and deletes the source file. | ||
* @param sourcePath - The path of the source file. | ||
* @param destinationPath - The path of the destination file. | ||
*/ | ||
static copyMetadataAndDelete(sourcePath: string, destinationPath: string): void; | ||
/** | ||
* Deletes a media file. | ||
* @param filePath - The path of the file to be deleted. | ||
*/ | ||
static delete(filePath: string): void; | ||
} |
@@ -31,3 +31,37 @@ import { CustomScript } from "./CustomScript.js"; | ||
} | ||
/** | ||
* Copies the metadata from the source file to the destination file. | ||
* @param sourcePath - The path of the source file. | ||
* @param destinationPath - The path of the destination file. | ||
*/ | ||
static copyMetadata(sourcePath, destinationPath) { | ||
console.log(JSON.stringify({ | ||
fmAction: "copyMediaMetadata", | ||
fmSourcePath: sourcePath, | ||
fmDestinationPath: destinationPath, | ||
})); | ||
} | ||
/** | ||
* Copies the metadata from the source file to the destination file and deletes the source file. | ||
* @param sourcePath - The path of the source file. | ||
* @param destinationPath - The path of the destination file. | ||
*/ | ||
static copyMetadataAndDelete(sourcePath, destinationPath) { | ||
console.log(JSON.stringify({ | ||
fmAction: "copyMediaMetadataAndDelete", | ||
fmSourcePath: sourcePath, | ||
fmDestinationPath: destinationPath, | ||
})); | ||
} | ||
/** | ||
* Deletes a media file. | ||
* @param filePath - The path of the file to be deleted. | ||
*/ | ||
static delete(filePath) { | ||
console.log(JSON.stringify({ | ||
fmAction: "deleteMedia", | ||
fmPath: filePath, | ||
})); | ||
} | ||
} | ||
//# sourceMappingURL=MediaScript.js.map |
{ | ||
"name": "@frontmatter/extensibility", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "Front Matter CMS extensibility library", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -106,2 +106,8 @@ <p align="center"> | ||
Additionally, they provide the following methods: | ||
- `MediaScript.copyMetadata(source, destination)`: This method will copy the metadata from the source file to the destination file. | ||
- `MediaScript.copyMetadataAndDelete(source, destination)`; This method will copy the metadata from the source file to the destination file and delete the source file. | ||
- `MediaScript.delete(source)`: This method will delete the source file. | ||
### Placeholder scripts | ||
@@ -108,0 +114,0 @@ |
@@ -37,2 +37,51 @@ import { MediaArguments } from "../models/ScriptArguments.js"; | ||
} | ||
/** | ||
* Copies the metadata from the source file to the destination file. | ||
* @param sourcePath - The path of the source file. | ||
* @param destinationPath - The path of the destination file. | ||
*/ | ||
public static copyMetadata( | ||
sourcePath: string, | ||
destinationPath: string | ||
): void { | ||
console.log( | ||
JSON.stringify({ | ||
fmAction: "copyMediaMetadata", | ||
fmSourcePath: sourcePath, | ||
fmDestinationPath: destinationPath, | ||
}) | ||
); | ||
} | ||
/** | ||
* Copies the metadata from the source file to the destination file and deletes the source file. | ||
* @param sourcePath - The path of the source file. | ||
* @param destinationPath - The path of the destination file. | ||
*/ | ||
public static copyMetadataAndDelete( | ||
sourcePath: string, | ||
destinationPath: string | ||
): void { | ||
console.log( | ||
JSON.stringify({ | ||
fmAction: "copyMediaMetadataAndDelete", | ||
fmSourcePath: sourcePath, | ||
fmDestinationPath: destinationPath, | ||
}) | ||
); | ||
} | ||
/** | ||
* Deletes a media file. | ||
* @param filePath - The path of the file to be deleted. | ||
*/ | ||
public static delete(filePath: string): void { | ||
console.log( | ||
JSON.stringify({ | ||
fmAction: "deleteMedia", | ||
fmPath: filePath, | ||
}) | ||
); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44634
853
358