palbase 0.23.2 → 0.25.0

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.
Files changed (53) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/backend/engine.js +2 -2
  3. package/dist/backend/env.js +1 -1
  4. package/dist/backend/index.js +3 -3
  5. package/dist/backend/stack.js +1 -1
  6. package/dist/backend/test.js +2 -2
  7. package/dist/chunks/{FN6YSHEH.js → 2MYJV4YR.js} +2 -2
  8. package/dist/chunks/{2243L7FH.js → 4GJ2ZPTN.js} +2 -2
  9. package/dist/chunks/{Z6GSSELT.js → 4YCXKEZV.js} +1 -1
  10. package/dist/chunks/{465GAZ3I.js → 5BIBYYM4.js} +1 -1
  11. package/dist/chunks/{LEL23GGZ.js → B773R25P.js} +2 -2
  12. package/dist/chunks/{LPIIPAL7.js → C7SBJV6T.js} +1 -1
  13. package/dist/chunks/{XZF67QTC.js → DUMTTL2J.js} +2 -2
  14. package/dist/chunks/{GJLB5E6X.js → EVUBM4NK.js} +2 -2
  15. package/dist/chunks/{P7I67ZXV.js → GFYILAJU.js} +2 -2
  16. package/dist/chunks/{3B2LXO7V.js → HFKZ7GWV.js} +2 -2
  17. package/dist/chunks/{4UCTKDVC.js → J3KELWNZ.js} +1 -1
  18. package/dist/chunks/{RKVNNZKK.js → MQK4YZM7.js} +1 -1
  19. package/dist/chunks/{6FQTH7CU.js → NANJIH3L.js} +2 -2
  20. package/dist/chunks/{32K2WSMI.js → NLPK3G5Q.js} +2 -2
  21. package/dist/chunks/{5BNDQNJE.js → OFLYZJK7.js} +1 -1
  22. package/dist/chunks/{CHQC4TAI.js → Q45P37LH.js} +1 -1
  23. package/dist/chunks/{RLYVZSYC.js → S4GD7FCI.js} +2 -2
  24. package/dist/chunks/{DBHBPJXF.js → UN5JMFWV.js} +2 -2
  25. package/dist/chunks/{RIU2G5NL.js → VF4FX3QH.js} +2 -2
  26. package/dist/chunks/{UGWQ7AK7.js → WS7DI7CS.js} +2 -2
  27. package/dist/chunks/{LI5A2ZUO.js → Y5PIIC4Y.js} +2 -2
  28. package/dist/chunks/YAVAXQGR.js +2 -0
  29. package/dist/chunks/{E6O2BDH6.js → Z347DQJS.js} +2 -2
  30. package/dist/cli.js +138 -138
  31. package/dist/cloud/index.js +2 -2
  32. package/dist/refuse/ai.js +1 -1
  33. package/dist/refuse/backend.js +1 -1
  34. package/dist/refuse/cloud.js +1 -1
  35. package/dist/refuse/server.js +1 -1
  36. package/dist/server/index.js +2 -2
  37. package/dist/server/testing.js +2 -2
  38. package/dist/web/index.js +2 -2
  39. package/dist/web/message.js +2 -2
  40. package/dist/web/palbe.js +2 -2
  41. package/dist/web/paywall.js +2 -2
  42. package/dist/web/push-sw.js +1 -1
  43. package/dist/web/ssr.js +2 -2
  44. package/dist/web/vite.js +2 -2
  45. package/package.json +2 -2
  46. package/types/ai/src/chats.d.ts +2 -1
  47. package/types/cloud/src/generated/project.d.ts +3 -3
  48. package/types/internal/src/modules/auth.d.ts +84 -13
  49. package/types/internal/src/modules/machines.d.ts +616 -0
  50. package/types/internal/src/modules/notify.d.ts +68 -1
  51. package/types/internal/src/modules/storage.d.ts +4 -4
  52. package/types/internal/src/modules/stores.d.ts +4 -0
  53. package/dist/chunks/THGKKTVR.js +0 -2
@@ -209,6 +209,26 @@ export type Machine = {
209
209
  * How many copies of the machine run while it is awake, each on a node of its own: a request is sent to one of them, a copy or a node that goes leaves the others serving, and the cluster takes one of them away at a time at most. Every copy is of the machine's size and counts as such against the project's limits and its machine time (a minute in which the number changed is counted at the most it was). What a copy keeps in its own memory or on its own disk the others do not see — a session, a counter, a cache, a timer: a machine with more than one keeps those where every copy reaches them. The machine finds the number in PALBASE_REPLICAS. A long-lived connection (a WebSocket) stays with the copy that took it.
210
210
  */
211
211
  replicas: number;
212
+ /**
213
+ * Kept awake: a machine of a size that sleeps is never put to sleep when idle, and is started again at once when it is asleep — while its environment has paid rights (Pay as you go with a balance), which pays its every hour. Without them it sleeps as any; a dedicated size never sleeps.
214
+ */
215
+ always_on: boolean;
216
+ /**
217
+ * Whether a pull request opened against its branch is previewed: its head built into a machine of its own, <name>-pr<n>, in this environment, with this environment's settings and secrets, answering at <name>-pr<n>-<ref> until the pull request closes; the pull request is told where in a comment. Turn it on in an environment kept for previews, not production's: the pull request's code runs with the environment's secrets.
218
+ */
219
+ previews: boolean;
220
+ /**
221
+ * Whether a pull request from a fork — another repository, which anyone may open — is previewed too. Off by default: its code would run with the environment's secrets.
222
+ */
223
+ preview_forks: boolean;
224
+ /**
225
+ * For a pull request's preview: the name of the machine it previews. It is deleted as its pull request closes, and with that machine.
226
+ */
227
+ preview_of?: string;
228
+ /**
229
+ * For a pull request's preview: the pull request's number.
230
+ */
231
+ pull_request?: number;
212
232
  database?: MachineDatabase;
213
233
  /**
214
234
  * Whether a push waits for its commit's checks before it is built; absent when it does not. A push is built only once its commit's checks on GitHub have passed, as Render's "After CI Checks Pass": those `deploy_checks` names, or else every check run reported on the commit for the machine's branch (GitHub Actions' jobs, and any other app's checks; Palbase's own left out) has ended in success, neutral or skipped, and every GitHub Actions workflow run of it has ended — taken as ended 30 s after the last ended, and no sooner than 30 s after the push's build was made. Until then the build waits (`waiting_checks`, its `reason` naming what it waits for), and the machine runs what it ran; a newer push waits beside it, for its own. The machine moves to the newest commit whose checks passed, never back: the first to pass is built and leaves the older builds behind, waiting or under way, so an older commit whose checks pass after it is not built. A check that ended otherwise (failure, cancelled, timed_out, action_required, stale), no check reported in 10 minutes, or checks not ended in 3 hours (6 hours for named ones), and the build is `skipped` (`reason`); a check run again that passes later does not build it — the next push to the branch is built then, whatever it changed. Commit statuses are not read.
@@ -282,6 +302,18 @@ export type MachineCreate = {
282
302
  * How many copies of the machine run while it is awake, each on a node of its own: a request is sent to one of them, a copy or a node that goes leaves the others serving, and the cluster takes one of them away at a time at most. Every copy is of the machine's size and counts as such against the project's limits and its machine time (a minute in which the number changed is counted at the most it was). What a copy keeps in its own memory or on its own disk the others do not see — a session, a counter, a cache, a timer: a machine with more than one keeps those where every copy reaches them. The machine finds the number in PALBASE_REPLICAS. A long-lived connection (a WebSocket) stays with the copy that took it. One when left out.
283
303
  */
284
304
  replicas?: number;
305
+ /**
306
+ * Keeps it awake (Machine.always_on): open to an environment on Pay as you go with a balance, refused `always_on_not_available` otherwise.
307
+ */
308
+ always_on?: boolean;
309
+ /**
310
+ * Whether a pull request opened against its branch is previewed: its head built into a machine of its own, <name>-pr<n>, in this environment, with this environment's settings and secrets, answering at <name>-pr<n>-<ref> until the pull request closes; the pull request is told where in a comment. Turn it on in an environment kept for previews, not production's: the pull request's code runs with the environment's secrets. A machine read with Palbase's GitHub App alone (source.access app).
311
+ */
312
+ previews?: boolean;
313
+ /**
314
+ * Whether a pull request from a fork — another repository, which anyone may open — is previewed too. Off by default: its code would run with the environment's secrets.
315
+ */
316
+ preview_forks?: boolean;
285
317
  database?: MachineDatabase;
286
318
  /**
287
319
  * A push is built only once its commit's checks on GitHub have passed, as Render's "After CI Checks Pass": those `deploy_checks` names, or else every check run reported on the commit for the machine's branch (GitHub Actions' jobs, and any other app's checks; Palbase's own left out) has ended in success, neutral or skipped, and every GitHub Actions workflow run of it has ended — taken as ended 30 s after the last ended, and no sooner than 30 s after the push's build was made. Until then the build waits (`waiting_checks`, its `reason` naming what it waits for), and the machine runs what it ran; a newer push waits beside it, for its own. The machine moves to the newest commit whose checks passed, never back: the first to pass is built and leaves the older builds behind, waiting or under way, so an older commit whose checks pass after it is not built. A check that ended otherwise (failure, cancelled, timed_out, action_required, stale), no check reported in 10 minutes, or checks not ended in 3 hours (6 hours for named ones), and the build is `skipped` (`reason`); a check run again that passes later does not build it — the next push to the branch is built then, whatever it changed. Commit statuses are not read. False: every push is built at once.
@@ -363,6 +395,18 @@ export type MachineUpdate = {
363
395
  * How many copies of the machine run from now on: the machine rolls out as a new version with that many, beside what serves.
364
396
  */
365
397
  replicas?: number;
398
+ /**
399
+ * Whether it is kept awake from now on (Machine.always_on): no version changes. Turning it on is open to an environment on Pay as you go with a balance, refused `always_on_not_available` otherwise.
400
+ */
401
+ always_on?: boolean;
402
+ /**
403
+ * Whether its pull requests are previewed from now on (Machine.previews): the previews open stay until their pull requests close. A preview takes none.
404
+ */
405
+ previews?: boolean;
406
+ /**
407
+ * Whether a fork's pull requests are previewed from now on (Machine.preview_forks).
408
+ */
409
+ preview_forks?: boolean;
366
410
  database?: MachineDatabase;
367
411
  /**
368
412
  * Whether a push waits for its commit's checks from now on; no version is rolled out for it. The newest build waiting for its checks when it is turned off is built at once, and the older ones are left behind. A push is built only once its commit's checks on GitHub have passed, as Render's "After CI Checks Pass": those `deploy_checks` names, or else every check run reported on the commit for the machine's branch (GitHub Actions' jobs, and any other app's checks; Palbase's own left out) has ended in success, neutral or skipped, and every GitHub Actions workflow run of it has ended — taken as ended 30 s after the last ended, and no sooner than 30 s after the push's build was made. Until then the build waits (`waiting_checks`, its `reason` naming what it waits for), and the machine runs what it ran; a newer push waits beside it, for its own. The machine moves to the newest commit whose checks passed, never back: the first to pass is built and leaves the older builds behind, waiting or under way, so an older commit whose checks pass after it is not built. A check that ended otherwise (failure, cancelled, timed_out, action_required, stale), no check reported in 10 minutes, or checks not ended in 3 hours (6 hours for named ones), and the build is `skipped` (`reason`); a check run again that passes later does not build it — the next push to the branch is built then, whatever it changed. Commit statuses are not read.
@@ -1405,6 +1449,339 @@ export type MachineDeploy = {
1405
1449
  */
1406
1450
  git_access_token?: string;
1407
1451
  };
1452
+ /**
1453
+ * A project's static web site.
1454
+ */
1455
+ export type Site = {
1456
+ /**
1457
+ * The site's name in the project.
1458
+ */
1459
+ name: string;
1460
+ /**
1461
+ * Where it answers: <name>-<ref> on the hosting domain, the ref alone for the site named web.
1462
+ */
1463
+ url: string;
1464
+ /**
1465
+ * Every address it answers at, url first.
1466
+ */
1467
+ urls: string[];
1468
+ /**
1469
+ * A path no file answers is answered with /index.html (a single-page app's routes), not 404.
1470
+ */
1471
+ spa: boolean;
1472
+ release: SiteReleaseRef;
1473
+ taken_down: SiteTakenDown;
1474
+ created_at: string;
1475
+ updated_at: string;
1476
+ source: SiteSourceView;
1477
+ build: SiteBuildSettings;
1478
+ /**
1479
+ * Whether a pull request opened against its source's branch is previewed: its head built, with this environment's build settings, into a release of its own that answers at <name>-pr<n>-<ref> until the pull request closes — never what the site serves, none of its releases; the pull request is told where in a comment. Turn it on in an environment kept for previews, not production's.
1480
+ */
1481
+ previews: boolean;
1482
+ /**
1483
+ * Whether a pull request from a fork — another repository, which anyone may open — is previewed too. Off by default: its build would run with the environment's build settings.
1484
+ */
1485
+ preview_forks: boolean;
1486
+ };
1487
+ /**
1488
+ * The release a site serves; none before its first.
1489
+ */
1490
+ export type SiteReleaseRef = ({
1491
+ id: string;
1492
+ /**
1493
+ * The site's releases counted: #1, #2, …
1494
+ */
1495
+ number: number;
1496
+ }) | null;
1497
+ /**
1498
+ * The platform's operator took the site down (abuse): nothing of it is served until it is restored. None, it was not.
1499
+ */
1500
+ export type SiteTakenDown = ({
1501
+ at: string;
1502
+ reason: string;
1503
+ }) | null;
1504
+ /**
1505
+ * The project's sites, by name.
1506
+ */
1507
+ export type SiteList = {
1508
+ sites: Site[];
1509
+ };
1510
+ /**
1511
+ * A site to open.
1512
+ */
1513
+ export type SiteCreate = {
1514
+ /**
1515
+ * The site's name; `web` when left out, which answers at the project's ref.
1516
+ */
1517
+ name?: string;
1518
+ /**
1519
+ * A single-page app: a path no file answers is answered with /index.html.
1520
+ */
1521
+ spa?: boolean;
1522
+ source?: SiteSource;
1523
+ build?: SiteBuildSettings;
1524
+ /**
1525
+ * Whether a pull request opened against its source's branch is previewed: its head built, with this environment's build settings, into a release of its own that answers at <name>-pr<n>-<ref> until the pull request closes — never what the site serves, none of its releases; the pull request is told where in a comment. Turn it on in an environment kept for previews, not production's.
1526
+ */
1527
+ previews?: boolean;
1528
+ /**
1529
+ * Whether a fork's pull requests are previewed (Site.preview_forks).
1530
+ */
1531
+ preview_forks?: boolean;
1532
+ };
1533
+ /**
1534
+ * What to change of a site; a field left out is unchanged.
1535
+ */
1536
+ export type SiteUpdate = {
1537
+ spa?: boolean;
1538
+ source?: SiteSource;
1539
+ build?: SiteBuildSettings;
1540
+ /**
1541
+ * Whether its pull requests are previewed from now on (Site.previews): the previews open stay until their pull requests close.
1542
+ */
1543
+ previews?: boolean;
1544
+ /**
1545
+ * Whether a fork's pull requests are previewed (Site.preview_forks).
1546
+ */
1547
+ preview_forks?: boolean;
1548
+ };
1549
+ /**
1550
+ * One upload of a site's files.
1551
+ */
1552
+ export type SiteRelease = {
1553
+ id: string;
1554
+ number: number;
1555
+ /**
1556
+ * uploading: its files are being sent; ready: kept, and the site may serve it. One never finished is let go of after a day.
1557
+ */
1558
+ state: "uploading" | "ready";
1559
+ /**
1560
+ * Sent from the CLI (upload), or built from a commit (build).
1561
+ */
1562
+ origin: "upload" | "build";
1563
+ /**
1564
+ * The commit it was built from; none for an upload.
1565
+ */
1566
+ commit: string | null;
1567
+ files: number;
1568
+ /**
1569
+ * What its files weigh together, once it is finished.
1570
+ */
1571
+ bytes: number;
1572
+ /**
1573
+ * The site serves it.
1574
+ */
1575
+ serving: boolean;
1576
+ /**
1577
+ * While it uploads (as it is started): the SHA-256 of each file it lists that the project does not keep yet.
1578
+ */
1579
+ missing?: string[];
1580
+ created_at: string;
1581
+ ready_at: string | null;
1582
+ };
1583
+ /**
1584
+ * A site's releases, newest first.
1585
+ */
1586
+ export type SiteReleaseList = {
1587
+ releases: SiteRelease[];
1588
+ };
1589
+ /**
1590
+ * The files of a release.
1591
+ */
1592
+ export type SiteReleaseCreate = {
1593
+ /**
1594
+ * Path → the SHA-256 (hex) of its file. A path starts with /, names a file (no trailing /), holds no . or .. part, no // and no ?, # or \\.
1595
+ */
1596
+ files: {
1597
+ [key: string]: string;
1598
+ };
1599
+ };
1600
+ /**
1601
+ * The release to serve; none is the one before the release the site serves.
1602
+ */
1603
+ export type SiteRollback = {
1604
+ release?: string;
1605
+ };
1606
+ /**
1607
+ * A file's bytes, as they are.
1608
+ */
1609
+ export type SiteFileBytes = Blob;
1610
+ /**
1611
+ * A release finished with files missing: the error envelope, and what to send.
1612
+ */
1613
+ export type SiteFilesMissing = {
1614
+ error: string;
1615
+ error_description: string;
1616
+ status: number;
1617
+ request_id: string;
1618
+ retry_after?: number;
1619
+ missing: string[];
1620
+ };
1621
+ /**
1622
+ * Where the site is built from: a push to its branch builds it, and the release its build wrote is served. None for a site deployed from a folder alone.
1623
+ */
1624
+ export type SiteSourceView = ({
1625
+ repository: string;
1626
+ branch: string;
1627
+ /**
1628
+ * The site's directory in the repository; "" for its root.
1629
+ */
1630
+ path: string;
1631
+ }) | null;
1632
+ /**
1633
+ * A GitHub repository's branch and the site's directory in it: one of the environment's installations reaches the repository (machines/github). In a change, a repository of "" takes the site's source away.
1634
+ */
1635
+ export type SiteSource = {
1636
+ /**
1637
+ * owner/name
1638
+ */
1639
+ repository: string;
1640
+ branch?: string;
1641
+ /**
1642
+ * The site's directory; none for the repository's root.
1643
+ */
1644
+ path?: string;
1645
+ };
1646
+ /**
1647
+ * What a site's build runs; each left empty is found in its source: its lockfile (pnpm, yarn, npm, bun), its package.json's build script, the folder its builder writes (dist, build, out, …). A folder with no package.json is served as it is.
1648
+ */
1649
+ export type SiteBuildSettings = {
1650
+ install_command?: string;
1651
+ command?: string;
1652
+ /**
1653
+ * The folder the build writes, from the site's directory.
1654
+ */
1655
+ output_dir?: string;
1656
+ /**
1657
+ * What the build runs with — what its pages are sent (VITE_*, NEXT_PUBLIC_*), never a secret: 100 at most.
1658
+ */
1659
+ env?: {
1660
+ [key: string]: string;
1661
+ };
1662
+ };
1663
+ /**
1664
+ * One build of a site: one commit of its branch.
1665
+ */
1666
+ export type SiteBuild = {
1667
+ id: string;
1668
+ commit: string;
1669
+ /**
1670
+ * The commit's message, its first line.
1671
+ */
1672
+ message: string;
1673
+ state: "queued" | "building" | "succeeded" | "failed";
1674
+ /**
1675
+ * Why it failed.
1676
+ */
1677
+ reason?: string;
1678
+ /**
1679
+ * The release it wrote, once it succeeded.
1680
+ */
1681
+ release: string | null;
1682
+ /**
1683
+ * Its run's log (read alone: GET …/builds/{build}).
1684
+ */
1685
+ log?: string;
1686
+ created_at: string;
1687
+ started_at: string | null;
1688
+ finished_at: string | null;
1689
+ };
1690
+ /**
1691
+ * A site's twenty newest builds, newest first.
1692
+ */
1693
+ export type SiteBuildList = {
1694
+ builds: SiteBuild[];
1695
+ };
1696
+ /**
1697
+ * A pull request's preview of a site or a machine.
1698
+ */
1699
+ export type Preview = {
1700
+ /**
1701
+ * The pull request's number.
1702
+ */
1703
+ pull_request: number;
1704
+ /**
1705
+ * The pull request's head it is built at: the newest heard.
1706
+ */
1707
+ commit: string;
1708
+ /**
1709
+ * The pull request is from another repository.
1710
+ */
1711
+ fork: boolean;
1712
+ /**
1713
+ * Where it answers once built.
1714
+ */
1715
+ url: string;
1716
+ /**
1717
+ * building, ready, failed — or closed: its pull request closed, and its address answers no more.
1718
+ */
1719
+ state: "building" | "ready" | "failed" | "closed";
1720
+ /**
1721
+ * A machine's preview: its own machine, by name.
1722
+ */
1723
+ machine?: string;
1724
+ created_at: string;
1725
+ updated_at: string;
1726
+ closed_at?: string;
1727
+ };
1728
+ /**
1729
+ * A site's or a machine's previews, the fifty newest first.
1730
+ */
1731
+ export type PreviewList = {
1732
+ previews: Preview[];
1733
+ };
1734
+ /**
1735
+ * One record of a domain's DNS.
1736
+ */
1737
+ export type DNSRecord = {
1738
+ type: "CNAME" | "TXT";
1739
+ name: string;
1740
+ value: string;
1741
+ };
1742
+ /**
1743
+ * A domain of the customer's own a site or a machine answers at too. Its owner adds its records to its DNS: the CNAME points it at the platform (at the apex, where DNS takes no CNAME: an ALIAS, ANAME or flattened CNAME to the same target), the TXT shows it is this environment's. It answers once Cloudflare has its certificate and the TXT record is there. A domain is one environment's, platform-wide, until it is deleted there.
1744
+ */
1745
+ export type Domain = {
1746
+ /**
1747
+ * The domain: www.example.com, or example.com.
1748
+ */
1749
+ host: string;
1750
+ /**
1751
+ * pending until it answers, then active.
1752
+ */
1753
+ state: "pending" | "active";
1754
+ /**
1755
+ * A domain of its own, not a subdomain: most DNS hosts take no CNAME there.
1756
+ */
1757
+ apex: boolean;
1758
+ /**
1759
+ * What its owner adds to its DNS.
1760
+ */
1761
+ records: DNSRecord[];
1762
+ /**
1763
+ * What stands in its way, as last checked.
1764
+ */
1765
+ problems: string[];
1766
+ checked_at?: string;
1767
+ active_at?: string;
1768
+ created_at: string;
1769
+ };
1770
+ /**
1771
+ * A site's or a machine's domains, by host.
1772
+ */
1773
+ export type DomainList = {
1774
+ domains: Domain[];
1775
+ };
1776
+ /**
1777
+ * A domain to add.
1778
+ */
1779
+ export type DomainCreate = {
1780
+ /**
1781
+ * The domain: www.example.com, or example.com — none of the platform's own.
1782
+ */
1783
+ host: string;
1784
+ };
1408
1785
  /** Palbase Machines */
1409
1786
  export declare function client(t: Transport): {
1410
1787
  /**
@@ -1561,6 +1938,52 @@ export declare function client(t: Transport): {
1561
1938
  body?: MachineDeploy; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
1562
1939
  signal?: AbortSignal;
1563
1940
  }): Promise<Reply<202, Machine>>;
1941
+ /**
1942
+ * List a machine's previews
1943
+ *
1944
+ * Lists the previews of a machine's pull requests, the newest first: each one's pull request, head, address, and state — its preview machine's.
1945
+ */
1946
+ listMachinePreviews(input: {
1947
+ path: {
1948
+ name: string;
1949
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
1950
+ signal?: AbortSignal;
1951
+ }): Promise<Reply<200, PreviewList>>;
1952
+ /**
1953
+ * List a machine's domains
1954
+ *
1955
+ * Lists the machine's own domains, by host: each one's state, the records its owner adds to its DNS, and what stands in its way.
1956
+ */
1957
+ listMachineDomains(input: {
1958
+ path: {
1959
+ name: string;
1960
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
1961
+ signal?: AbortSignal;
1962
+ }): Promise<Reply<200, DomainList>>;
1963
+ /**
1964
+ * Add a domain to a machine
1965
+ *
1966
+ * Adds a domain of the customer's own the machine answers at too, once its owner has added the records the answer names to its DNS. Refused when another environment has it (domain_taken), when it is one of the platform's, or past the environment's twenty.
1967
+ */
1968
+ addMachineDomain(input: {
1969
+ path: {
1970
+ name: string;
1971
+ };
1972
+ body: DomainCreate; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
1973
+ signal?: AbortSignal;
1974
+ }): Promise<Reply<201, Domain>>;
1975
+ /**
1976
+ * Delete a machine's domain
1977
+ *
1978
+ * Takes a domain away: it answers no more at once, and another environment may add it.
1979
+ */
1980
+ deleteMachineDomain(input: {
1981
+ path: {
1982
+ name: string; /** The domain. */
1983
+ host: string;
1984
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
1985
+ signal?: AbortSignal;
1986
+ }): Promise<Reply<204, undefined>>;
1564
1987
  /**
1565
1988
  * Read a build
1566
1989
  *
@@ -1975,5 +2398,198 @@ export declare function client(t: Transport): {
1975
2398
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
1976
2399
  signal?: AbortSignal;
1977
2400
  }): Promise<Reply<204, undefined>>;
2401
+ /**
2402
+ * List sites
2403
+ *
2404
+ * Lists the project's sites, by name: a project has 10 at most.
2405
+ */
2406
+ listSites(input?: {
2407
+ signal?: AbortSignal;
2408
+ }): Promise<Reply<200, SiteList>>;
2409
+ /**
2410
+ * Open a site
2411
+ *
2412
+ * Opens a static web site (hosting). It answers at its label on the hosting domain — the project's ref for the site named `web` (the default), `<name>-<ref>` for any other. It serves nothing before its first release: a folder deployed (releases), or a build of its source, which a push to its branch makes.
2413
+ */
2414
+ createSite(input: {
2415
+ body: SiteCreate; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2416
+ signal?: AbortSignal;
2417
+ }): Promise<Reply<201, Site>>;
2418
+ /**
2419
+ * Get a site
2420
+ *
2421
+ * Reads a site: where it answers, the release it serves, whether the platform took it down.
2422
+ */
2423
+ getSite(input: {
2424
+ path: {
2425
+ name: string;
2426
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2427
+ signal?: AbortSignal;
2428
+ }): Promise<Reply<200, Site>>;
2429
+ /**
2430
+ * Delete a site
2431
+ *
2432
+ * Deletes a site: its address serves nothing from now on, and its name is free in the project at once; its releases and files are let go of shortly after.
2433
+ */
2434
+ deleteSite(input: {
2435
+ path: {
2436
+ name: string;
2437
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2438
+ signal?: AbortSignal;
2439
+ }): Promise<Reply<204, undefined>>;
2440
+ /**
2441
+ * Change a site
2442
+ *
2443
+ * Changes what a site was asked to be: whether a path no file answers is its /index.html (a single-page app), where it is built from (its branch's head is built at once; a repository of "" takes the source away) and what its build runs.
2444
+ */
2445
+ updateSite(input: {
2446
+ path: {
2447
+ name: string;
2448
+ };
2449
+ body: SiteUpdate; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2450
+ signal?: AbortSignal;
2451
+ }): Promise<Reply<200, Site>>;
2452
+ /**
2453
+ * List a site's releases
2454
+ *
2455
+ * Lists a site's releases, newest first: the ten newest finished ones are kept to return to, with the one it serves and any still uploading.
2456
+ */
2457
+ listSiteReleases(input: {
2458
+ path: {
2459
+ name: string;
2460
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2461
+ signal?: AbortSignal;
2462
+ }): Promise<Reply<200, SiteReleaseList>>;
2463
+ /**
2464
+ * Start a release
2465
+ *
2466
+ * Starts a release of a site: it lists every path the site will answer and the SHA-256 of the file each one is (20,000 files at most, 25 MiB each, 1 GiB together). The answer names, in `missing`, the files the project does not keep yet: each is sent (`PUT …/files/{digest}`), then the release is finished. A file the project keeps from any release is not sent again.
2467
+ */
2468
+ createSiteRelease(input: {
2469
+ path: {
2470
+ name: string;
2471
+ };
2472
+ body: SiteReleaseCreate; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2473
+ signal?: AbortSignal;
2474
+ }): Promise<Reply<201, SiteRelease>>;
2475
+ /**
2476
+ * Send a release's file
2477
+ *
2478
+ * Sends one file a release lists, as it is: its bytes must be the SHA-256 the path names, or nothing is kept. A file the project keeps already is not read again.
2479
+ */
2480
+ uploadSiteFile(input: {
2481
+ path: {
2482
+ name: string; /** The release's id. */
2483
+ release: string; /** The file's SHA-256: 64 lowercase hex digits. */
2484
+ digest: string;
2485
+ };
2486
+ body: BodyInit;
2487
+ contentType?: string; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2488
+ signal?: AbortSignal;
2489
+ }): Promise<Reply<204, undefined>>;
2490
+ /**
2491
+ * Finish a release
2492
+ *
2493
+ * Finishes a release whose files are all kept — refused, naming them, while one is missing — and the site serves it at once. Finishing one finished before has the site serve it again.
2494
+ */
2495
+ finishSiteRelease(input: {
2496
+ path: {
2497
+ name: string; /** The release's id. */
2498
+ release: string;
2499
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2500
+ signal?: AbortSignal;
2501
+ }): Promise<Reply<200, SiteRelease>>;
2502
+ /**
2503
+ * Return to a release
2504
+ *
2505
+ * Has the site serve one of the releases it keeps: the one named, or the one before the release it serves. Served at once.
2506
+ */
2507
+ rollbackSite(input: {
2508
+ path: {
2509
+ name: string;
2510
+ };
2511
+ body: SiteRollback; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2512
+ signal?: AbortSignal;
2513
+ }): Promise<Reply<200, Site>>;
2514
+ /**
2515
+ * List a site's builds
2516
+ *
2517
+ * Lists a site's twenty newest builds, newest first.
2518
+ */
2519
+ listSiteBuilds(input: {
2520
+ path: {
2521
+ name: string;
2522
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2523
+ signal?: AbortSignal;
2524
+ }): Promise<Reply<200, SiteBuildList>>;
2525
+ /**
2526
+ * Build a site now
2527
+ *
2528
+ * Asks for a build of the head of the site's branch now — what a push does: the release it writes is served once it succeeded.
2529
+ */
2530
+ deploySite(input: {
2531
+ path: {
2532
+ name: string;
2533
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2534
+ signal?: AbortSignal;
2535
+ }): Promise<Reply<202, Site>>;
2536
+ /**
2537
+ * List a site's previews
2538
+ *
2539
+ * Lists the previews of a site's pull requests, the newest first: each one's pull request, head, address, and state — its newest build's of that head.
2540
+ */
2541
+ listSitePreviews(input: {
2542
+ path: {
2543
+ name: string;
2544
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2545
+ signal?: AbortSignal;
2546
+ }): Promise<Reply<200, PreviewList>>;
2547
+ /**
2548
+ * List a site's domains
2549
+ *
2550
+ * Lists the site's own domains, by host: each one's state, the records its owner adds to its DNS, and what stands in its way.
2551
+ */
2552
+ listSiteDomains(input: {
2553
+ path: {
2554
+ name: string;
2555
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2556
+ signal?: AbortSignal;
2557
+ }): Promise<Reply<200, DomainList>>;
2558
+ /**
2559
+ * Add a domain to a site
2560
+ *
2561
+ * Adds a domain of the customer's own the site answers at too, once its owner has added the records the answer names to its DNS. Refused when another environment has it (domain_taken), when it is one of the platform's, or past the environment's twenty.
2562
+ */
2563
+ addSiteDomain(input: {
2564
+ path: {
2565
+ name: string;
2566
+ };
2567
+ body: DomainCreate; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2568
+ signal?: AbortSignal;
2569
+ }): Promise<Reply<201, Domain>>;
2570
+ /**
2571
+ * Delete a site's domain
2572
+ *
2573
+ * Takes a domain away: it answers no more at once, and another environment may add it.
2574
+ */
2575
+ deleteSiteDomain(input: {
2576
+ path: {
2577
+ name: string; /** The domain. */
2578
+ host: string;
2579
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2580
+ signal?: AbortSignal;
2581
+ }): Promise<Reply<204, undefined>>;
2582
+ /**
2583
+ * Get a site's build
2584
+ *
2585
+ * Reads one build of a site, with its log.
2586
+ */
2587
+ getSiteBuild(input: {
2588
+ path: {
2589
+ name: string; /** The build's id. */
2590
+ build: string;
2591
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2592
+ signal?: AbortSignal;
2593
+ }): Promise<Reply<200, SiteBuild>>;
1978
2594
  };
1979
2595
  export type Client = ReturnType<typeof client>;