palbase 0.31.0 → 0.32.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 (50) 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/{RU3S5TA2.js → 3CS6VXYP.js} +1 -1
  8. package/dist/chunks/{RZR2OTEP.js → 3NIRNAKX.js} +2 -2
  9. package/dist/chunks/{7ZJXPGTW.js → AD6BJ63E.js} +1 -1
  10. package/dist/chunks/{FMIHOHLT.js → DRCWV56K.js} +1 -1
  11. package/dist/chunks/{3N3PAQ6I.js → EVQIB54O.js} +2 -2
  12. package/dist/chunks/{II3T2SUS.js → GAAU3U67.js} +1 -1
  13. package/dist/chunks/{I37FMNMJ.js → IDM7ARVQ.js} +2 -2
  14. package/dist/chunks/{ZPHQTAU2.js → KH7PPBKZ.js} +2 -2
  15. package/dist/chunks/RUA3JVMI.js +2 -0
  16. package/dist/chunks/{M4QDYWZD.js → S6YHWYG6.js} +2 -2
  17. package/dist/chunks/{2Q7GJQ6Q.js → SGG2NIVV.js} +2 -2
  18. package/dist/chunks/{D5KT3Y7I.js → UKIDPVMT.js} +1 -1
  19. package/dist/chunks/{V4IE2JUY.js → VLU75M7B.js} +2 -2
  20. package/dist/chunks/{ZCJW4USW.js → VXZQNE2S.js} +2 -2
  21. package/dist/chunks/{R2MQ64AL.js → WEX24LUH.js} +2 -2
  22. package/dist/chunks/{Y6DSZS4O.js → WQIMQXJP.js} +2 -2
  23. package/dist/chunks/{KVBUSRIV.js → X7QBDTU7.js} +1 -1
  24. package/dist/chunks/{IPUAZNBO.js → XBVNY6FK.js} +2 -2
  25. package/dist/chunks/{NLTKUCTU.js → YCLTZO5T.js} +2 -2
  26. package/dist/chunks/{ZGELVBLC.js → YNQPTVKR.js} +2 -2
  27. package/dist/chunks/{PYZFFIAR.js → YTTXILO7.js} +2 -2
  28. package/dist/chunks/{W33FF6LK.js → ZQHO7RWS.js} +1 -1
  29. package/dist/chunks/{PNZBIPJK.js → ZW2DFP7N.js} +2 -2
  30. package/dist/cli.js +82 -82
  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/calls-ui.js +2 -2
  39. package/dist/web/index.js +2 -2
  40. package/dist/web/message.js +2 -2
  41. package/dist/web/palbe.js +2 -2
  42. package/dist/web/paywall.js +2 -2
  43. package/dist/web/push-sw.js +1 -1
  44. package/dist/web/ssr.js +2 -2
  45. package/dist/web/vite.js +2 -2
  46. package/package.json +2 -2
  47. package/types/cloud/src/generated/project.d.ts +1 -1
  48. package/types/cloud/src/generated/studio.d.ts +3 -3
  49. package/types/internal/src/modules/machines.d.ts +44 -2
  50. package/dist/chunks/DIMP746R.js +0 -2
@@ -307,7 +307,7 @@ export type MachineCreate = {
307
307
  */
308
308
  always_on?: boolean;
309
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).
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 a platform's tokens (source.access token) previews what its platform puts (PUT /machines/{name}/previews/{pull_request}), no comment written.
311
311
  */
312
312
  previews?: boolean;
313
313
  /**
@@ -1857,6 +1857,23 @@ export type PreviewOpened = {
1857
1857
  */
1858
1858
  commit: string;
1859
1859
  };
1860
+ /**
1861
+ * A platform's pull request: its branch — one of the machine's repository's own — the head its machine's preview builds, and the token it is read with.
1862
+ */
1863
+ export type PreviewDeploy = {
1864
+ /**
1865
+ * The pull request's branch, of the machine's repository itself: a fork's pull request is not built with the environment's secrets.
1866
+ */
1867
+ branch: string;
1868
+ /**
1869
+ * The branch's head, its full SHA: a newer push answers 409 commit_not_head. Left out, the branch's head.
1870
+ */
1871
+ commit?: string;
1872
+ /**
1873
+ * A GitHub App installation's token (ghs_…) for the machine's repository alone, read-only: used once, never kept.
1874
+ */
1875
+ git_access_token: string;
1876
+ };
1860
1877
  /** Palbase Machines */
1861
1878
  export declare function client(t: Transport): {
1862
1879
  /**
@@ -2024,6 +2041,31 @@ export declare function client(t: Transport): {
2024
2041
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2025
2042
  signal?: AbortSignal;
2026
2043
  }): Promise<Reply<200, PreviewList>>;
2044
+ /**
2045
+ * Open or update a platform's pull request preview
2046
+ *
2047
+ * For a machine read with a platform's tokens (source.access token: PalCore's, whose repositories have no Palbase App, so no pull request is heard here): opens the preview of the pull request at the head of its branch — one of the machine's repository's own: a fork's is not built — its own machine, <name>-pr<n>, and a database of its own when the machine runs its database's migrations — or builds the open one at it, and opens one that went idle again. The branch is read with git_access_token, a GitHub App installation's token for the machine's repository alone (ghs_…), once; a commit named must be the branch's head (409 commit_not_head). Its address and state are read with GET /machines/{name}/previews; the platform tells its pull request itself. Refused in a production environment (409 previews_in_production), for a machine read with Palbase's GitHub App (409 previews_from_github), with previews off (409 previews_off), and when the environment's limits refuse the preview (409 preview_refused, with why).
2048
+ */
2049
+ putMachinePreview(input: {
2050
+ path: {
2051
+ name: string; /** The pull request's number. */
2052
+ pull_request: number;
2053
+ };
2054
+ body: PreviewDeploy; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2055
+ signal?: AbortSignal;
2056
+ }): Promise<Reply<202, PreviewOpened>>;
2057
+ /**
2058
+ * Close a platform's pull request preview
2059
+ *
2060
+ * For a machine read with a platform's tokens: closes the preview of the pull request, its pull request closed — its machine and its own database are deleted at once. A machine read with Palbase's GitHub App has its previews closed as GitHub tells (409 previews_from_github).
2061
+ */
2062
+ deleteMachinePreview(input: {
2063
+ path: {
2064
+ name: string; /** The pull request's number. */
2065
+ pull_request: number;
2066
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2067
+ signal?: AbortSignal;
2068
+ }): Promise<Reply<204, undefined>>;
2027
2069
  /**
2028
2070
  * List a machine's domains
2029
2071
  *
@@ -2721,7 +2763,7 @@ export declare function client(t: Transport): {
2721
2763
  /**
2722
2764
  * Open a machine's pull request preview again
2723
2765
  *
2724
- * Opens a machine's preview of an open pull request again, at the pull request's head: one closed for want of a push (state idle: no push for 3 days, its machine and its own database taken away) or refused at its last push (state refused) is made anew, with a new, empty database of its own when the machine runs its database's migrations. One open goes on as it is, and its 3 days start again. A fork's preview under fork protection opens only at a head an admin authorized (409 preview_waits_authorization); one the environment's limits refuse again answers 409 preview_refused, with why.
2766
+ * Opens a machine's preview of an open pull request again, at the pull request's head: one closed for want of a push (state idle: no push for 3 days, its machine and its own database taken away) or refused at its last push (state refused) is made anew, with a new, empty database of its own when the machine runs its database's migrations. One open goes on as it is, and its 3 days start again. A fork's preview under fork protection opens only at a head an admin authorized (409 preview_waits_authorization); one the environment's limits refuse again answers 409 preview_refused, with why. A machine read with a platform's tokens has an idle or refused preview opened again by its platform, with a token (PUT /machines/{name}/previews/{pull_request}): 409 preview_needs_token.
2725
2767
  */
2726
2768
  openMachinePreview(input: {
2727
2769
  path: {