-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
163 lines (163 loc) · 4.91 KB
/
Copy pathopenapi.yaml
File metadata and controls
163 lines (163 loc) · 4.91 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
openapi: 3.1.0
info:
title: Codex Artifacts publishing API
version: 0.1.0
description: Owner automation API for one self-hosted Codex Artifacts deployment.
license:
name: MIT
identifier: MIT
servers:
- url: https://codex-artifacts.your-account.workers.dev
paths:
/api/status:
get:
operationId: getStatus
summary: Check service liveness
responses:
"200":
description: Service process is responding.
content:
application/json:
schema:
$ref: "#/components/schemas/Status"
/api/artifacts:
post:
operationId: publishArtifact
summary: Create an artifact or replace the artifact with a requested slug
description: |
The bearer token is deployment-wide owner automation authority. If `slug`
identifies an existing artifact, its HTML and title are replaced. Omitted
`sharedWith`, `sharedDomains`, and `isPublic` values preserve existing
settings during updates.
Omitted `expiresInSeconds` values start or reset the three-day expiration
timer. Set it to `null` for an artifact that never expires.
Deployment-configured workspace viewers retain read access independently
of `sharedWith`.
security:
- publishToken: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PublishRequest"
responses:
"200":
description: Existing artifact updated.
content:
application/json:
schema:
$ref: "#/components/schemas/PublishResponse"
"201":
description: Artifact created.
content:
application/json:
schema:
$ref: "#/components/schemas/PublishResponse"
"400":
description: Invalid artifact input or exhausted workspace capacity.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"401":
description: Missing or invalid publishing token.
content:
text/plain:
schema:
type: string
"503":
description: Publishing automation is not configured.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
securitySchemes:
publishToken:
type: http
scheme: bearer
schemas:
Status:
type: object
additionalProperties: false
required: [ok, service]
properties:
ok:
type: boolean
const: true
service:
type: string
const: codex-artifacts
PublishRequest:
type: object
additionalProperties: false
required: [title, html]
properties:
title:
type: string
minLength: 1
maxLength: 120
slug:
type: string
description: Optional stable slug. Non-alphanumeric runs normalize to hyphens.
maxLength: 80
html:
type: string
description: Self-contained UTF-8 HTML, limited to 512 KiB by the server.
sharedWith:
type: array
maxItems: 50
description: |
Additional artifact-specific exact-email recipients. Replaces only
this list when updating; workspace viewers retain access.
items:
type: string
format: email
sharedDomains:
type: array
maxItems: 20
description: |
Additional artifact-specific email domains. Replaces only this
list when updating; workspace viewers retain access.
items:
type: string
format: hostname
isPublic:
type: boolean
expiresInSeconds:
description: |
Relative lifetime in whole seconds, from 60 seconds through one year.
Omit for the three-day default or set to null to never expire. The
lifetime starts again whenever the artifact is published or replaced.
oneOf:
- type: integer
minimum: 60
maximum: 31536000
- type: "null"
PublishResponse:
type: object
additionalProperties: false
required: [id, slug, updated, isPublic, expiresAt]
properties:
id:
type: string
slug:
type: string
updated:
type: boolean
isPublic:
type: boolean
expiresAt:
description: Absolute expiration time, or null when expiration is disabled.
oneOf:
- type: string
format: date-time
- type: "null"
Error:
type: object
additionalProperties: false
required: [error]
properties:
error:
type: string