@@ -23,6 +23,7 @@ npm install @yepcode/run
23
23
```
24
24
25
25
** Requirements:**
26
+
26
27
- Node.js >= 18.x
27
28
- TypeScript support included (types are bundled with the package)
28
29
@@ -207,8 +208,10 @@ constructor(options?: {
207
208
Executes code in YepCode's runtime environment.
208
209
209
210
** Parameters:**
211
+
210
212
- ` code ` : Source code to execute (string)
211
213
- ` options ` : Execution options (optional)
214
+
212
215
``` typescript
213
216
interface RunOpts {
214
217
language? : ' javascript' | ' python' ; // Auto-detected if not specified
@@ -235,6 +238,7 @@ Executes code in YepCode's runtime environment.
235
238
Retrieves an existing execution by ID.
236
239
237
240
** Parameters:**
241
+
238
242
- ` executionId ` : Unique identifier for the execution
239
243
240
244
** Returns:** Promise<Execution >
@@ -244,6 +248,7 @@ Retrieves an existing execution by ID.
244
248
Represents a code execution instance.
245
249
246
250
** Properties:**
251
+
247
252
``` typescript
248
253
interface Execution {
249
254
id: string ; // Unique identifier
@@ -274,16 +279,20 @@ interface TimelineEvent {
274
279
275
280
** Methods:**
276
281
277
- ###### ` isDone(): Promise<boolean> `
282
+ ##### ` isDone(): Promise<boolean> `
283
+
278
284
Returns whether the execution has completed.
279
285
280
286
** Returns:** Promise<boolean >
281
287
282
- ###### ` waitForDone(options?: { timeout?: number }): Promise<void> `
288
+ ##### ` waitForDone(options?: { timeout?: number }): Promise<void> `
289
+
283
290
Waits for the execution to complete.
284
291
285
292
** Parameters:**
293
+
286
294
- ` options ` : Optional timeout configuration
295
+
287
296
``` typescript
288
297
interface WaitOptions {
289
298
timeout? : number ; // Timeout in milliseconds
@@ -292,12 +301,14 @@ Waits for the execution to complete.
292
301
293
302
** Returns:** Promise<void >
294
303
295
- ###### ` kill(): Promise<void> `
304
+ ##### ` kill(): Promise<void> `
305
+
296
306
Terminates the execution.
297
307
298
308
** Returns:** Promise<void >
299
309
300
- ###### ` rerun(): Promise<Execution> `
310
+ ##### ` rerun(): Promise<Execution> `
311
+
301
312
Creates a new execution with the same configuration.
302
313
303
314
** Returns:** Promise<Execution >
@@ -317,9 +328,11 @@ constructor(options?: {
317
328
#### Methods
318
329
319
330
##### ` getEnvVars(): Promise<EnvVar[]> `
331
+
320
332
Returns all environment variables.
321
333
322
334
** Returns:** Promise<EnvVar[ ] >
335
+
323
336
``` typescript
324
337
interface EnvVar {
325
338
key: string ;
@@ -329,19 +342,23 @@ interface EnvVar {
329
342
```
330
343
331
344
##### ` setEnvVar(key: string, value: string, isSensitive?: boolean): Promise<void> `
345
+
332
346
Sets an environment variable.
333
347
334
348
** Parameters:**
349
+
335
350
- ` key ` : Variable name
336
351
- ` value ` : Variable value
337
352
- ` isSensitive ` : Whether the variable contains sensitive data (defaults to true)
338
353
339
354
** Returns:** Promise<void >
340
355
341
356
##### ` delEnvVar(key: string): Promise<void> `
357
+
342
358
Deletes an environment variable.
343
359
344
360
** Parameters:**
361
+
345
362
- ` key ` : Variable name to delete
346
363
347
364
** Returns:** Promise<void >
@@ -361,9 +378,11 @@ constructor(options?: {
361
378
#### Methods
362
379
363
380
##### ` getProcesses(): Promise<Process[]> `
381
+
364
382
Returns all available processes.
365
383
366
384
** Returns:** Promise<Process[ ] >
385
+
367
386
``` typescript
368
387
interface Process {
369
388
id: string ;
@@ -388,30 +407,35 @@ constructor(options?: {
388
407
#### Methods
389
408
390
409
##### ` upload(filename: string, file: File | Blob | Readable): Promise<StorageObject> `
410
+
391
411
Uploads a file to YepCode storage.
392
412
393
413
- ` filename ` : Name to assign to the uploaded file
394
414
- ` file ` : The file to upload (can be a File, Blob, or Node.js Readable stream)
395
415
- ** Returns:** Promise<StorageObject >
396
416
397
417
##### ` list(): Promise<StorageObject[]> `
418
+
398
419
Lists all files in YepCode storage.
399
420
400
421
- ** Returns:** Promise<StorageObject[ ] >
401
422
402
423
##### ` download(filename: string): Promise<Readable> `
424
+
403
425
Downloads a file from YepCode storage as a Node.js Readable stream.
404
426
405
427
- ` filename ` : Name of the file to download
406
428
- ** Returns:** Promise<Readable >
407
429
408
430
##### ` delete(filename: string): Promise<void> `
431
+
409
432
Deletes a file from YepCode storage.
410
433
411
434
- ` filename ` : Name of the file to delete
412
435
- ** Returns:** Promise<void >
413
436
414
437
##### ` StorageObject `
438
+
415
439
``` typescript
416
440
interface StorageObject {
417
441
name: string ;
0 commit comments