-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfreestyle-web-api-openapi.yml
More file actions
915 lines (901 loc) · 26.4 KB
/
Copy pathfreestyle-web-api-openapi.yml
File metadata and controls
915 lines (901 loc) · 26.4 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
openapi: 3.1.0
info:
title: Freestyle Web Deployments API
version: 0.1.0
description: "Deploy and manage hosted Node.js / static websites \u2014 push code, list and inspect deployments, fetch and\
\ update deployment files (HTTP-style fetch verbs)."
contact:
name: Ben
email: ben@freestyle.sh
license:
name: Closed Source
servers:
- url: https://api.freestyle.sh
description: Production
tags:
- name: Web
description: APIs for deploying websites. We handle node modules caching, scaling, certificates and the whole end to end
process. Send the code using the [deploy](#tag/web/POST/web/v1/deploy) endpoint, and you'll get a full hosted website
back. Works with any TypeScript or JavaScript codebase.
paths:
/web/v1/deployment:
post:
tags:
- Web
summary: Deploy a Website
description: Deploy a website. Files is a map of file paths to file contents. Configuration is optional and contains
additional information about the deployment.
operationId: handle_deploy_web_v2
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FreestyleDeployWebPayloadV2'
required: true
responses:
'200':
description: successfully deployed
content:
application/json:
schema:
$ref: '#/components/schemas/FreestyleDeployWebSuccessResponseV2'
'400':
description: 'Possible errors: WebDeploymentBadRequest, InvalidDomains, EntrypointNotFound, NoEntrypointFound'
content:
application/json:
schema:
type: object
required:
- error
- message
properties:
error:
type: string
description: Error code in SCREAMING_SNAKE_CASE
message:
type: string
description: Human-readable error message
'403':
description: 'Possible errors: DeploymentLimitExceeded, TimeoutLimitExceeded, Forbidden, NoDomainOwnership'
content:
application/json:
schema:
type: object
required:
- error
- message
properties:
error:
type: string
description: Error code in SCREAMING_SNAKE_CASE
message:
type: string
description: Human-readable error message
'404':
description: 'Error: DeploymentNotFound'
content:
application/json:
schema:
type: object
required:
- error
- message
properties:
error:
type: string
description: Error code in SCREAMING_SNAKE_CASE
message:
type: string
description: Human-readable error message
'500':
description: 'Possible errors: Internal, DomainMappingError, UploadError, LockfileError'
content:
application/json:
schema:
type: object
required:
- error
- message
properties:
error:
type: string
description: Error code in SCREAMING_SNAKE_CASE
message:
type: string
description: Human-readable error message
'502':
description: 'Possible errors: CertificateProvisioningError, ServerDeploymentFailed'
content:
application/json:
schema:
type: object
required:
- error
- message
properties:
error:
type: string
description: Error code in SCREAMING_SNAKE_CASE
message:
type: string
description: Human-readable error message
/web/v1/deployments:
get:
tags:
- Web
summary: List Web Deploys
description: List web deploys.
operationId: handle_list_web_deploys
parameters:
- name: limit
in: query
description: Maximum number of deployments to return
required: true
schema:
type: integer
format: int64
minimum: 0
- name: offset
in: query
description: Offset for pagination
required: true
schema:
type: integer
format: int64
minimum: 0
- name: search
in: query
description: Search by deployment ID or domain
required: true
schema:
type: string
responses:
'200':
description: List of deployments
content:
application/json:
schema:
$ref: '#/components/schemas/ListDeploymentsResponse'
'500':
description: 'Error: Internal'
content:
application/json:
schema:
type: object
required:
- error
- message
properties:
error:
type: string
description: Error code in SCREAMING_SNAKE_CASE
message:
type: string
description: Human-readable error message
/web/v1/deployments/{deployment_id}:
get:
tags:
- Web
summary: Get Information on Web Deploy
description: Get information about a web deploy by its ID.
operationId: handle_get_web_deploy_details
responses: {}
/web/v1/deployments/{deployment_id}/fetch:
get:
tags:
- Web
summary: Fetch Content From a Deployment
description: Fetch content from a deployment by making a request to nginx-web with the deployment ID header. Supports
any HTTP method.
operationId: handle_fetch_deployment
parameters:
- name: deployment_id
in: path
description: Deployment ID
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Successful response from deployment
'403':
description: Forbidden
'404':
description: Deployment not found
'500':
description: Internal server error
put:
tags:
- Web
summary: Fetch Content From a Deployment
description: Fetch content from a deployment by making a request to nginx-web with the deployment ID header. Supports
any HTTP method.
operationId: handle_fetch_deployment
parameters:
- name: deployment_id
in: path
description: Deployment ID
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Successful response from deployment
'403':
description: Forbidden
'404':
description: Deployment not found
'500':
description: Internal server error
post:
tags:
- Web
summary: Fetch Content From a Deployment
description: Fetch content from a deployment by making a request to nginx-web with the deployment ID header. Supports
any HTTP method.
operationId: handle_fetch_deployment
parameters:
- name: deployment_id
in: path
description: Deployment ID
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Successful response from deployment
'403':
description: Forbidden
'404':
description: Deployment not found
'500':
description: Internal server error
delete:
tags:
- Web
summary: Fetch Content From a Deployment
description: Fetch content from a deployment by making a request to nginx-web with the deployment ID header. Supports
any HTTP method.
operationId: handle_fetch_deployment
parameters:
- name: deployment_id
in: path
description: Deployment ID
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Successful response from deployment
'403':
description: Forbidden
'404':
description: Deployment not found
'500':
description: Internal server error
options:
tags:
- Web
summary: Fetch Content From a Deployment
description: Fetch content from a deployment by making a request to nginx-web with the deployment ID header. Supports
any HTTP method.
operationId: handle_fetch_deployment
parameters:
- name: deployment_id
in: path
description: Deployment ID
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Successful response from deployment
'403':
description: Forbidden
'404':
description: Deployment not found
'500':
description: Internal server error
head:
tags:
- Web
summary: Fetch Content From a Deployment
description: Fetch content from a deployment by making a request to nginx-web with the deployment ID header. Supports
any HTTP method.
operationId: handle_fetch_deployment
parameters:
- name: deployment_id
in: path
description: Deployment ID
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Successful response from deployment
'403':
description: Forbidden
'404':
description: Deployment not found
'500':
description: Internal server error
patch:
tags:
- Web
summary: Fetch Content From a Deployment
description: Fetch content from a deployment by making a request to nginx-web with the deployment ID header. Supports
any HTTP method.
operationId: handle_fetch_deployment
parameters:
- name: deployment_id
in: path
description: Deployment ID
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Successful response from deployment
'403':
description: Forbidden
'404':
description: Deployment not found
'500':
description: Internal server error
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
schemas:
FreestyleDeployWebSuccessResponseV2:
oneOf:
- type: object
required:
- deploymentId
- projectId
properties:
deploymentId:
$ref: '#/components/schemas/DeploymentId'
projectId:
$ref: '#/components/schemas/DeploymentId'
domains:
type:
- array
- 'null'
items:
type: string
entrypoint:
type:
- string
- 'null'
description: 'The entrypoint file for the website. If not specified we try to automatically detect it.
For static-only deployments (static: true), this will be None.'
- type: object
required:
- deploymentId
properties:
deploymentId:
$ref: '#/components/schemas/DeploymentId'
Behavior:
type: string
default: exact
enum:
- regex
- exact
RedirectConfig:
type: object
description: Redirect configuration for permanent or temporary redirects (Vercel-compatible)
required:
- source
- destination
properties:
source:
type: string
description: Source pattern (can be exact path or regex)
destination:
type: string
description: Destination path or URL
statusCode:
type:
- integer
- 'null'
format: int32
description: 'HTTP status code for redirect (301, 302, 307, 308). Takes precedence over `permanent`.
If neither `status_code` nor `permanent` is provided, defaults to 308.'
minimum: 0
permanent:
type:
- boolean
- 'null'
description: 'If true, uses 308 (permanent redirect). If false, uses 307 (temporary redirect).
Ignored if `status_code` is explicitly set. Vercel-compatible alternative to `status_code`.'
DeploymentState:
type: string
enum:
- provisioning
- deployed
- failed
NetworkPermissionData:
type: object
required:
- query
properties:
query:
type: string
behavior:
$ref: '#/components/schemas/Behavior'
EgressIpConfig:
type: object
properties:
transform:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/EgressTransform'
description: Transformations to apply to requests to this IP
HeaderKeyValue:
type: object
description: Key-value pair for headers
required:
- key
- value
properties:
key:
type: string
description: Header name
value:
type: string
description: Header value
EgressConfig:
type: object
properties:
allow:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/EgressAllowRules'
description: Allow rules for egress traffic
deny:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/EgressDenyRules'
description: Deny rules for egress traffic (evaluated after allow)
FreestyleNetworkPermission:
oneOf:
- allOf:
- $ref: '#/components/schemas/NetworkPermissionData'
- type: object
required:
- action
properties:
action:
type: string
enum:
- allow
- allOf:
- $ref: '#/components/schemas/NetworkPermissionData'
- type: object
required:
- action
properties:
action:
type: string
enum:
- deny
FreestyleDeployWebConfiguration:
type: object
properties:
name:
type:
- string
- 'null'
domains:
type:
- array
- 'null'
items:
type: string
entrypoint:
type:
- string
- 'null'
envVars:
type:
- object
- 'null'
additionalProperties:
type: string
propertyNames:
type: string
nodeModules:
type:
- object
- 'null'
additionalProperties:
type: string
propertyNames:
type: string
timeout:
type:
- integer
- 'null'
format: int64
description: The amount of milliseconds after with no traffic we kill your server. For rate limiting purposes we
count any started server as active for the 5 seconds after the last request.
minimum: 0
serverStartCheck:
type:
- boolean
- 'null'
networkPermissions:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/FreestyleNetworkPermission'
egress:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/EgressConfig'
description: Egress control configuration for outbound requests (domains, IPs, transformations)
build:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/DeploymentBuildOptions'
await:
type:
- boolean
- 'null'
staticDir:
type:
- string
- 'null'
description: 'Directory containing static files to be served directly (e.g., ".next/static", "_next/static").
Files are served at the URL path specified by static_path_prefix (defaults to root "/").'
example: .next/static
staticPathPrefix:
type:
- string
- 'null'
description: 'URL path prefix where static files are served (e.g., "/_next/static"). Defaults to "/" (root).
When set, only requests matching this prefix will be served from static_dir.'
example: /_next/static
publicDir:
type:
- string
- 'null'
description: 'Directory containing public files to be served at the root of the domain (e.g., "public").
These files are served without any path prefix - a file at public/favicon.ico is served at /favicon.ico.'
example: public
prerenderDir:
type:
- string
- 'null'
description: 'Directory containing prerendered HTML files (e.g., ".next/standalone/.next/server/app" for Next.js).
Files are served as: ${prerender_dir}/${path}.html or ${prerender_dir}/index.html for root.'
example: .next/standalone/.next/server/app
staticOnly:
type: boolean
description: Set to true for static-only deployments (no dynamic server/entrypoint required)
redirects:
type: array
items:
$ref: '#/components/schemas/RedirectConfig'
description: Redirects (permanent or temporary)
rewrites:
type: array
items:
$ref: '#/components/schemas/RewriteConfig'
description: Rewrites (internal URL rewrites with capture groups)
dynamic:
type: array
items:
$ref: '#/components/schemas/DynamicConfig'
description: Dynamic routes that should be handled by the worker
headers:
type: array
items:
$ref: '#/components/schemas/HeaderConfig'
description: Custom headers for matching paths
cleanUrls:
type: boolean
description: 'When true, all HTML files will have their extension removed. Visiting a path with .html will redirect
to extensionless path (308).
For example, a static file named about.html will be served when visiting /about. Visiting /about.html will redirect
to /about.'
trailingSlash:
type:
- boolean
- 'null'
description: 'When false, visiting a path with a trailing slash will redirect (308) to path without trailing slash.
When true, opposite behavior occurs. When None (default), no automatic redirects based on trailing slash.'
experimental:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/FreestyleDeployWebExperimentalConfiguration'
description: Experimental feature flags. Avoid relying on these for long-term API stability.
DynamicConfig:
type: object
description: Dynamic route configuration for paths that should be handled by the worker
required:
- source
properties:
source:
type: string
description: Source pattern (regex or glob pattern like "/api/.*" or "/api/**")
methods:
type:
- array
- 'null'
items:
type: string
description: HTTP methods this route applies to (if None, applies to all methods)
DeploymentBuildOptions:
oneOf:
- type: boolean
- $ref: '#/components/schemas/CustomBuildOptions'
RewriteConfig:
type: object
description: Rewrite configuration for URL rewrites (internal, not visible to client)
required:
- source
- destination
properties:
source:
type: string
description: Source pattern (regex pattern)
destination:
type: string
description: Destination path with optional capture group substitution ($1, $2, etc.)
FreestyleDeployWebExperimentalConfiguration:
type: object
properties:
nextjsOptimization:
type: boolean
EgressDomainConfig:
type: object
properties:
transform:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/EgressTransform'
description: Transformations to apply to requests to this domain
DeploymentSource:
oneOf:
- type: object
title: Files
required:
- files
- kind
properties:
files:
type: object
additionalProperties:
$ref: '#/components/schemas/FreestyleFile'
propertyNames:
type: string
kind:
type: string
enum:
- files
- type: object
title: Tar
required:
- url
- kind
properties:
url:
type: string
kind:
type: string
enum:
- tar
- type: object
title: Git
description: '`dir` is the Directory to deploy from. If not provided, the root of the repository will be used.'
required:
- url
- kind
properties:
url:
type: string
branch:
type:
- string
- 'null'
example: main
dir:
type:
- string
- 'null'
example: dist
kind:
type: string
enum:
- git
EgressDenyRules:
type: object
properties:
ips:
type:
- object
- 'null'
description: 'Blacklist of IPs. These override allow rules.
CIDR notation supported.'
additionalProperties:
type: array
items:
$ref: '#/components/schemas/EgressIpConfig'
propertyNames:
type: string
DeploymentLogEntry:
type: object
required:
- deploymentId
- accountId
- provisionedAt
- timeout
- state
- domains
- envVars
properties:
deploymentId:
$ref: '#/components/schemas/DeploymentId'
accountId:
type: string
format: uuid
provisionedAt:
type: string
format: date-time
timeout:
type: string
state:
$ref: '#/components/schemas/DeploymentState'
deployedAt:
type:
- string
- 'null'
format: date-time
domains:
type: array
items:
type: string
envVars:
type: object
additionalProperties:
type: string
propertyNames:
type: string
HeaderConfig:
type: object
description: Header configuration for setting custom headers on matching paths
required:
- source
- headers
properties:
source:
type: string
description: Source pattern (regex pattern)
headers:
type: array
items:
$ref: '#/components/schemas/HeaderKeyValue'
description: Headers to set (array of key-value pairs)
ListDeploymentsResponse:
type: object
required:
- entries
- total
- offset
properties:
entries:
type: array
items:
$ref: '#/components/schemas/DeploymentLogEntry'
total:
type: integer
format: int64
minimum: 0
offset:
type: integer
format: int64
minimum: 0
CustomBuildOptions:
type: object
required:
- command
properties:
command:
type: string
outDir:
type:
- string
- 'null'
envVars:
type:
- object
- 'null'
additionalProperties:
type: string
propertyNames:
type: string
EgressTransform:
type: object
properties:
headers:
type:
- object
- 'null'
description: Headers to set on outgoing requests
additionalProperties:
type: string
propertyNames:
type: string
EgressAllowRules:
type: object
properties:
domains:
type:
- object
- 'null'
description: 'Whitelist of domains. Empty object means no domains allowed.
"*" means allow all domains.
Domain name maps to a list of transformations (currently just headers).'
additionalProperties:
type: array
items:
$ref: '#/components/schemas/EgressDomainConfig'
propertyNames:
type: string
ips:
type:
- object
- 'null'
description: 'Whitelist of IPs. Empty object means no IPs allowed.
CIDR notation supported (e.g., "173.194.0.0/16").
IPs are allowed on any port/protocol.'
additionalProperties:
type: array
items:
$ref: '#/components/schemas/EgressIpConfig'
propertyNames:
type: string
DeploymentId:
type: string
format: uuid
FreestyleFile:
type: object
required:
- content
properties:
content:
type: string
description: The content of the file
encoding:
type: string
description: The encoding of the file. Either **utf-8** or **base64**
executable:
type: boolean
description: Whether the file should be marked executable after being written
FreestyleDeployWebPayloadV2:
type: object
required:
- source
- config
properties:
source:
$ref: '#/components/schemas/DeploymentSource'
config:
$ref: '#/components/schemas/FreestyleDeployWebConfiguration'
security:
- bearerAuth: []