@wp-playground/blueprints 0.2.0 → 0.3.1
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 +17 -0
- package/index.cjs +352 -34
- package/index.d.ts +5 -1
- package/index.js +2471 -2063
- package/lib/blueprint.d.ts +5 -1
- package/lib/compile.d.ts +4 -5
- package/lib/resources.d.ts +0 -1
- package/lib/steps/activate-plugin.d.ts +9 -0
- package/lib/steps/activate-theme.d.ts +9 -0
- package/lib/steps/apply-wordpress-patches/index.d.ts +33 -0
- package/lib/steps/cp.d.ts +26 -0
- package/lib/steps/handlers.d.ts +10 -1
- package/lib/steps/import-export.d.ts +25 -0
- package/lib/steps/index.d.ts +10 -1
- package/lib/steps/mkdir.d.ts +22 -0
- package/lib/steps/mv.d.ts +26 -0
- package/lib/steps/request.d.ts +33 -0
- package/lib/steps/rm.d.ts +23 -0
- package/lib/steps/rmdir.d.ts +23 -0
- package/lib/steps/run-php-with-options.d.ts +30 -0
- package/lib/steps/run-php.d.ts +23 -0
- package/lib/steps/set-php-ini-entry.d.ts +25 -0
- package/lib/steps/write-file.d.ts +26 -0
- package/package.json +2 -2
- package/lib/steps/client-methods.d.ts +0 -247
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { PHPRunOptions, PHPRequest } from '@php-wasm/universal';
|
|
2
|
-
import { StepHandler } from '.';
|
|
3
|
-
/**
|
|
4
|
-
* @inheritDoc runPHP
|
|
5
|
-
* @hasRunnableExample
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* <code>
|
|
9
|
-
* {
|
|
10
|
-
* "step": "runPHP",
|
|
11
|
-
* "code": "<?php echo 'Hello World'; ?>"
|
|
12
|
-
* }
|
|
13
|
-
* </code>
|
|
14
|
-
*/
|
|
15
|
-
export interface RunPHPStep {
|
|
16
|
-
/** The step identifier. */
|
|
17
|
-
step: 'runPHP';
|
|
18
|
-
/** The PHP code to run. */
|
|
19
|
-
code: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Runs PHP code.
|
|
23
|
-
*/
|
|
24
|
-
export declare const runPHP: StepHandler<RunPHPStep>;
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc runPHP
|
|
27
|
-
* @hasRunnableExample
|
|
28
|
-
* @example
|
|
29
|
-
*
|
|
30
|
-
* <code>
|
|
31
|
-
* {
|
|
32
|
-
* "step": "runPHP",
|
|
33
|
-
* "options": {
|
|
34
|
-
* "code": "<?php echo $_SERVER['CONTENT_TYPE']; ?>",
|
|
35
|
-
* "headers": {
|
|
36
|
-
* "Content-type": "text/plain"
|
|
37
|
-
* }
|
|
38
|
-
* }
|
|
39
|
-
* }
|
|
40
|
-
* </code>
|
|
41
|
-
*/
|
|
42
|
-
export interface RunPHPWithOptionsStep {
|
|
43
|
-
step: 'runPHPWithOptions';
|
|
44
|
-
/**
|
|
45
|
-
* Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions)
|
|
46
|
-
*/
|
|
47
|
-
options: PHPRunOptions;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Runs PHP code with the given options.
|
|
51
|
-
*/
|
|
52
|
-
export declare const runPHPWithOptions: StepHandler<RunPHPWithOptionsStep>;
|
|
53
|
-
/**
|
|
54
|
-
* @inheritDoc setPhpIniEntry
|
|
55
|
-
* @hasRunnableExample
|
|
56
|
-
* @example
|
|
57
|
-
*
|
|
58
|
-
* <code>
|
|
59
|
-
* {
|
|
60
|
-
* "step": "setPhpIniEntry",
|
|
61
|
-
* "key": "display_errors",
|
|
62
|
-
* "value": "1"
|
|
63
|
-
* }
|
|
64
|
-
* </code>
|
|
65
|
-
*/
|
|
66
|
-
export interface SetPhpIniEntryStep {
|
|
67
|
-
step: 'setPhpIniEntry';
|
|
68
|
-
/** Entry name e.g. "display_errors" */
|
|
69
|
-
key: string;
|
|
70
|
-
/** Entry value as a string e.g. "1" */
|
|
71
|
-
value: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Sets a PHP ini entry.
|
|
75
|
-
*/
|
|
76
|
-
export declare const setPhpIniEntry: StepHandler<SetPhpIniEntryStep>;
|
|
77
|
-
/**
|
|
78
|
-
* @inheritDoc request
|
|
79
|
-
* @needsLogin
|
|
80
|
-
* @hasRunnableExample
|
|
81
|
-
* @example
|
|
82
|
-
*
|
|
83
|
-
* <code>
|
|
84
|
-
* {
|
|
85
|
-
* "step": "request",
|
|
86
|
-
* "request": {
|
|
87
|
-
* "method": "POST",
|
|
88
|
-
* "url": "/wp-admin/admin-ajax.php",
|
|
89
|
-
* "formData": {
|
|
90
|
-
* "action": "my_action",
|
|
91
|
-
* "foo": "bar"
|
|
92
|
-
* }
|
|
93
|
-
* }
|
|
94
|
-
* }
|
|
95
|
-
* </code>
|
|
96
|
-
*/
|
|
97
|
-
export interface RequestStep {
|
|
98
|
-
step: 'request';
|
|
99
|
-
/**
|
|
100
|
-
* Request details (See /wordpress-playground/api/universal/interface/PHPRequest)
|
|
101
|
-
*/
|
|
102
|
-
request: PHPRequest;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Sends a HTTP request to the Playground.
|
|
106
|
-
*/
|
|
107
|
-
export declare const request: StepHandler<RequestStep>;
|
|
108
|
-
/**
|
|
109
|
-
* @inheritDoc cp
|
|
110
|
-
* @hasRunnableExample
|
|
111
|
-
* @landingPage /index2.php
|
|
112
|
-
* @example
|
|
113
|
-
*
|
|
114
|
-
* <code>
|
|
115
|
-
* {
|
|
116
|
-
* "step": "cp",
|
|
117
|
-
* "fromPath": "/wordpress/index.php",
|
|
118
|
-
* "toPath": "/wordpress/index2.php"
|
|
119
|
-
* }
|
|
120
|
-
* </code>
|
|
121
|
-
*/
|
|
122
|
-
export interface CpStep {
|
|
123
|
-
step: 'cp';
|
|
124
|
-
/** Source path */
|
|
125
|
-
fromPath: string;
|
|
126
|
-
/** Target path */
|
|
127
|
-
toPath: string;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Copies a file from one path to another.
|
|
131
|
-
*/
|
|
132
|
-
export declare const cp: StepHandler<CpStep>;
|
|
133
|
-
/**
|
|
134
|
-
* @inheritDoc mv
|
|
135
|
-
* @hasRunnableExample
|
|
136
|
-
* @landingPage /index2.php
|
|
137
|
-
* @example
|
|
138
|
-
*
|
|
139
|
-
* <code>
|
|
140
|
-
* {
|
|
141
|
-
* "step": "mv",
|
|
142
|
-
* "fromPath": "/wordpress/index.php",
|
|
143
|
-
* "toPath": "/wordpress/index2.php"
|
|
144
|
-
* }
|
|
145
|
-
* </code>
|
|
146
|
-
*/
|
|
147
|
-
export interface MvStep {
|
|
148
|
-
step: 'mv';
|
|
149
|
-
/** Source path */
|
|
150
|
-
fromPath: string;
|
|
151
|
-
/** Target path */
|
|
152
|
-
toPath: string;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Moves a file or directory from one path to another.
|
|
156
|
-
*/
|
|
157
|
-
export declare const mv: StepHandler<MvStep>;
|
|
158
|
-
/**
|
|
159
|
-
* @inheritDoc mkdir
|
|
160
|
-
* @hasRunnableExample
|
|
161
|
-
* @example
|
|
162
|
-
*
|
|
163
|
-
* <code>
|
|
164
|
-
* {
|
|
165
|
-
* "step": "mkdir",
|
|
166
|
-
* "path": "/wordpress/my-new-folder"
|
|
167
|
-
* }
|
|
168
|
-
* </code>
|
|
169
|
-
*/
|
|
170
|
-
export interface MkdirStep {
|
|
171
|
-
step: 'mkdir';
|
|
172
|
-
/** The path of the directory you want to create */
|
|
173
|
-
path: string;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Creates a directory at the specified path.
|
|
177
|
-
*/
|
|
178
|
-
export declare const mkdir: StepHandler<MkdirStep>;
|
|
179
|
-
/**
|
|
180
|
-
* @inheritDoc rm
|
|
181
|
-
* @hasRunnableExample
|
|
182
|
-
* @landingPage /index.php
|
|
183
|
-
* @example
|
|
184
|
-
*
|
|
185
|
-
* <code>
|
|
186
|
-
* {
|
|
187
|
-
* "step": "rm",
|
|
188
|
-
* "path": "/wordpress/index.php"
|
|
189
|
-
* }
|
|
190
|
-
* </code>
|
|
191
|
-
*/
|
|
192
|
-
export interface RmStep {
|
|
193
|
-
step: 'rm';
|
|
194
|
-
/** The path to remove */
|
|
195
|
-
path: string;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Removes a file at the specified path.
|
|
199
|
-
*/
|
|
200
|
-
export declare const rm: StepHandler<RmStep>;
|
|
201
|
-
/**
|
|
202
|
-
* @inheritDoc rmdir
|
|
203
|
-
* @hasRunnableExample
|
|
204
|
-
* @landingPage /wp-admin/
|
|
205
|
-
* @example
|
|
206
|
-
*
|
|
207
|
-
* <code>
|
|
208
|
-
* {
|
|
209
|
-
* "step": "rm",
|
|
210
|
-
* "path": "/wordpress/wp-admin"
|
|
211
|
-
* }
|
|
212
|
-
* </code>
|
|
213
|
-
*/
|
|
214
|
-
export interface RmdirStep {
|
|
215
|
-
step: 'rmdir';
|
|
216
|
-
/** The path to remove */
|
|
217
|
-
path: string;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Removes a directory at the specified path.
|
|
221
|
-
*/
|
|
222
|
-
export declare const rmdir: StepHandler<RmdirStep>;
|
|
223
|
-
/**
|
|
224
|
-
* @inheritDoc writeFile
|
|
225
|
-
* @hasRunnableExample
|
|
226
|
-
* @landingPage /test.php
|
|
227
|
-
* @example
|
|
228
|
-
*
|
|
229
|
-
* <code>
|
|
230
|
-
* {
|
|
231
|
-
* "step": "writeFile",
|
|
232
|
-
* "path": "/wordpress/test.php",
|
|
233
|
-
* "data": "<?php echo 'Hello World!'; ?>"
|
|
234
|
-
* }
|
|
235
|
-
* </code>
|
|
236
|
-
*/
|
|
237
|
-
export interface WriteFileStep<ResourceType> {
|
|
238
|
-
step: 'writeFile';
|
|
239
|
-
/** The path of the file to write to */
|
|
240
|
-
path: string;
|
|
241
|
-
/** The data to write */
|
|
242
|
-
data: ResourceType | string | Uint8Array;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Writes data to a file at the specified path.
|
|
246
|
-
*/
|
|
247
|
-
export declare const writeFile: StepHandler<WriteFileStep<File>>;
|