-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
106 lines (106 loc) · 4.14 KB
/
openapi.yaml
File metadata and controls
106 lines (106 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
openapi: 3.0.0
info:
version: 1.0.0
title: Scriptable API
servers:
- url: https://api.scriptable.run/v1
tags:
- name: core
description: Core Functionality
paths:
/execute:
post:
summary: Execute Code Snippet
description: ""
operationId: execute
tags:
- core
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- source
properties:
source:
type: string
description: Source code to be executed.
example: "console.log('Hello World!')"
globals:
type: object
description: Object with key value pairs that will be made available as properties on `globalThis` within the script context.
timeout:
type: integer
description: Timeout in milliseconds after which execution is terminated and an error is returned.
example: 2000
layers:
type: array
description: Additional scripts to be evaluated before the main source code runs. Can be used to customize the environment.
items:
type: object
required:
- name
- source
properties:
name:
type: string
description: Human readable name of the layer, can be used for debugging purposes. Will be included in stack traces.
source:
type: string
description: Source code to be executed.
fetchCredentials:
type: array
description: Credentials to be used in outbound `fetch` requests made to other domains.
items:
type: object
required:
- domain
properties:
domain:
type: string
description: Domain for the credentials. Only if an outbound `fetch` request matches this domain are the specified credentials attached.
example: example.com
httpsOnly:
type: boolean
description: If true, attaches the credentials only to HTTPS requests made over a secured channel.
default: true
headerName:
type: string
description: Name of the header to attach to the `fetch` request.
headerValue:
type: string
description: Value of the header to attach to the `fetch` request.
responses:
"200":
description: Successful Execution
content:
application/json:
schema:
type: object
properties:
status:
type: string
enum: ["ok", "failed"]
value:
type: string
description: Value returned from the executed source code. Only present if `status` is `"ok"`.
exception:
type: object
description: Exception thrown during execution. Only present if `status` is `"failed"`.
properties:
message:
type: string
stack:
type: array
items:
type: string
duration:
type: integer
description: Duration (real time) of the execution (including layers) measured in milliseconds.
logs:
type: array
description: Log lines produced by the script or other layers via `console.log`.
items:
type: string