@wp-playground/blueprints 0.6.2 → 0.6.3

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/index.d.ts CHANGED
@@ -303,7 +303,7 @@ export interface RequestHandler {
303
303
  * headers: {
304
304
  * 'X-foo': 'bar',
305
305
  * },
306
- * formData: {
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
- * Uploaded files
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
- files?: Record<string, File>;
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,9 @@ export interface PHPRunOptions {
647
640
  */
648
641
  headers?: PHPRequestHeaders;
649
642
  /**
650
- * Request body without the files.
651
- */
652
- body?: string;
653
- /**
654
- * Uploaded files.
643
+ * Request body.
655
644
  */
656
- fileInfos?: FileInfo[];
645
+ body?: string | Uint8Array;
657
646
  /**
658
647
  * The code snippet to eval instead of a php file.
659
648
  */
@@ -664,12 +653,6 @@ export interface PHPRunOptions {
664
653
  */
665
654
  throwOnError?: boolean;
666
655
  }
667
- export interface FileInfo {
668
- key: string;
669
- name: string;
670
- type: string;
671
- data: Uint8Array;
672
- }
673
656
  export interface RmDirOptions {
674
657
  /**
675
658
  * If true, recursively removes the directory and all its contents.
@@ -1648,6 +1631,30 @@ export interface EnableMultisiteStep {
1648
1631
  * @param enableMultisite
1649
1632
  */
1650
1633
  export declare const enableMultisite: StepHandler<EnableMultisiteStep>;
1634
+ /**
1635
+ * @inheritDoc wpCLI
1636
+ * @hasRunnableExample
1637
+ * @example
1638
+ *
1639
+ * <code>
1640
+ * {
1641
+ * "step": "wpCLI",
1642
+ * "command": "wp post create --post_title='Test post' --post_excerpt='Some content'"
1643
+ * }
1644
+ * </code>
1645
+ */
1646
+ export interface WPCLIStep {
1647
+ /** The step identifier. */
1648
+ step: "wp-cli";
1649
+ /** The WP CLI command to run. */
1650
+ command: string | string[];
1651
+ /** wp-cli.phar path */
1652
+ wpCliPath?: string;
1653
+ }
1654
+ /**
1655
+ * Runs PHP code.
1656
+ */
1657
+ export declare const wpCLI: StepHandler<WPCLIStep, Promise<PHPResponse>>;
1651
1658
  /**
1652
1659
  * Used by the export step to exclude the Playground-specific files
1653
1660
  * from the zip file. Keep it in sync with the list of files created
@@ -1665,7 +1672,7 @@ export type StepDefinition = Step & {
1665
1672
  * If you add a step here, make sure to also
1666
1673
  * add it to the exports below.
1667
1674
  */
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>;
1675
+ 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
1676
  /**
1670
1677
  * Progress reporting details.
1671
1678
  */