@wp-playground/blueprints 0.6.2 → 0.6.4
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/blueprint-schema.json +42 -0
- package/index.cjs +53 -27
- package/index.d.ts +34 -23
- package/index.js +1825 -1683
- package/lib/steps/handlers.d.ts +1 -0
- package/lib/steps/index.d.ts +3 -2
- package/lib/steps/wp-cli.d.ts +36 -0
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -303,7 +303,7 @@ export interface RequestHandler {
|
|
|
303
303
|
* headers: {
|
|
304
304
|
* 'X-foo': 'bar',
|
|
305
305
|
* },
|
|
306
|
-
*
|
|
306
|
+
* body: {
|
|
307
307
|
* foo: 'bar',
|
|
308
308
|
* },
|
|
309
309
|
* });
|
|
@@ -612,18 +612,11 @@ export interface PHPRequest {
|
|
|
612
612
|
*/
|
|
613
613
|
headers?: PHPRequestHeaders;
|
|
614
614
|
/**
|
|
615
|
-
*
|
|
615
|
+
* Request body.
|
|
616
|
+
* If an object is given, the request will be encoded as multipart
|
|
617
|
+
* and sent with a `multipart/form-data` header.
|
|
616
618
|
*/
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* Request body without the files.
|
|
620
|
-
*/
|
|
621
|
-
body?: string;
|
|
622
|
-
/**
|
|
623
|
-
* Form data. If set, the request body will be ignored and
|
|
624
|
-
* the content-type header will be set to `application/x-www-form-urlencoded`.
|
|
625
|
-
*/
|
|
626
|
-
formData?: Record<string, unknown>;
|
|
619
|
+
body?: string | Uint8Array | Record<string, string | Uint8Array | File>;
|
|
627
620
|
}
|
|
628
621
|
export interface PHPRunOptions {
|
|
629
622
|
/**
|
|
@@ -647,13 +640,13 @@ export interface PHPRunOptions {
|
|
|
647
640
|
*/
|
|
648
641
|
headers?: PHPRequestHeaders;
|
|
649
642
|
/**
|
|
650
|
-
* Request body
|
|
643
|
+
* Request body.
|
|
651
644
|
*/
|
|
652
|
-
body?: string;
|
|
645
|
+
body?: string | Uint8Array;
|
|
653
646
|
/**
|
|
654
|
-
*
|
|
647
|
+
* Environment variables to set for this run.
|
|
655
648
|
*/
|
|
656
|
-
|
|
649
|
+
env?: Record<string, string>;
|
|
657
650
|
/**
|
|
658
651
|
* The code snippet to eval instead of a php file.
|
|
659
652
|
*/
|
|
@@ -664,12 +657,6 @@ export interface PHPRunOptions {
|
|
|
664
657
|
*/
|
|
665
658
|
throwOnError?: boolean;
|
|
666
659
|
}
|
|
667
|
-
export interface FileInfo {
|
|
668
|
-
key: string;
|
|
669
|
-
name: string;
|
|
670
|
-
type: string;
|
|
671
|
-
data: Uint8Array;
|
|
672
|
-
}
|
|
673
660
|
export interface RmDirOptions {
|
|
674
661
|
/**
|
|
675
662
|
* If true, recursively removes the directory and all its contents.
|
|
@@ -1648,6 +1635,30 @@ export interface EnableMultisiteStep {
|
|
|
1648
1635
|
* @param enableMultisite
|
|
1649
1636
|
*/
|
|
1650
1637
|
export declare const enableMultisite: StepHandler<EnableMultisiteStep>;
|
|
1638
|
+
/**
|
|
1639
|
+
* @inheritDoc wpCLI
|
|
1640
|
+
* @hasRunnableExample
|
|
1641
|
+
* @example
|
|
1642
|
+
*
|
|
1643
|
+
* <code>
|
|
1644
|
+
* {
|
|
1645
|
+
* "step": "wpCLI",
|
|
1646
|
+
* "command": "wp post create --post_title='Test post' --post_excerpt='Some content'"
|
|
1647
|
+
* }
|
|
1648
|
+
* </code>
|
|
1649
|
+
*/
|
|
1650
|
+
export interface WPCLIStep {
|
|
1651
|
+
/** The step identifier. */
|
|
1652
|
+
step: "wp-cli";
|
|
1653
|
+
/** The WP CLI command to run. */
|
|
1654
|
+
command: string | string[];
|
|
1655
|
+
/** wp-cli.phar path */
|
|
1656
|
+
wpCliPath?: string;
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Runs PHP code.
|
|
1660
|
+
*/
|
|
1661
|
+
export declare const wpCLI: StepHandler<WPCLIStep, Promise<PHPResponse>>;
|
|
1651
1662
|
/**
|
|
1652
1663
|
* Used by the export step to exclude the Playground-specific files
|
|
1653
1664
|
* from the zip file. Keep it in sync with the list of files created
|
|
@@ -1665,7 +1676,7 @@ export type StepDefinition = Step & {
|
|
|
1665
1676
|
* If you add a step here, make sure to also
|
|
1666
1677
|
* add it to the exports below.
|
|
1667
1678
|
*/
|
|
1668
|
-
export type GenericStep<Resource> = ActivatePluginStep | ActivateThemeStep | CpStep | DefineWpConfigConstsStep | DefineSiteUrlStep | EnableMultisiteStep | ImportFileStep<Resource> | ImportWordPressFilesStep<Resource> | InstallPluginStep<Resource> | InstallThemeStep<Resource> | LoginStep | MkdirStep | MvStep | RequestStep | RmStep | RmdirStep | RunPHPStep | RunPHPWithOptionsStep | RunWpInstallationWizardStep | RunSqlStep<Resource> | SetPhpIniEntryStep | SetSiteOptionsStep | UnzipStep<Resource> | UpdateUserMetaStep | WriteFileStep<Resource
|
|
1679
|
+
export type GenericStep<Resource> = ActivatePluginStep | ActivateThemeStep | CpStep | DefineWpConfigConstsStep | DefineSiteUrlStep | EnableMultisiteStep | ImportFileStep<Resource> | ImportWordPressFilesStep<Resource> | InstallPluginStep<Resource> | InstallThemeStep<Resource> | LoginStep | MkdirStep | MvStep | RequestStep | RmStep | RmdirStep | RunPHPStep | RunPHPWithOptionsStep | RunWpInstallationWizardStep | RunSqlStep<Resource> | SetPhpIniEntryStep | SetSiteOptionsStep | UnzipStep<Resource> | UpdateUserMetaStep | WriteFileStep<Resource> | WPCLIStep;
|
|
1669
1680
|
/**
|
|
1670
1681
|
* Progress reporting details.
|
|
1671
1682
|
*/
|