@edge-base/server 0.2.9 → 0.3.2

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 (89) hide show
  1. package/admin-build/_app/immutable/chunks/BENT96gS.js +1 -0
  2. package/admin-build/_app/immutable/chunks/{BfhqI0W8.js → BR-X1vqg.js} +1 -1
  3. package/admin-build/_app/immutable/chunks/{DncT8xH5.js → BYTXdmFz.js} +1 -1
  4. package/admin-build/_app/immutable/chunks/{YGUb3X-Q.js → C-_7bS5w.js} +1 -1
  5. package/admin-build/_app/immutable/chunks/{DUhE3Ynq.js → CCB6XzFZ.js} +1 -1
  6. package/admin-build/_app/immutable/chunks/{39YMyjjq.js → CWTeyOdB.js} +1 -1
  7. package/admin-build/_app/immutable/chunks/{DllVADtt.js → CX5CmbTG.js} +1 -1
  8. package/admin-build/_app/immutable/chunks/{0M5txo3l.js → CdgSuiqt.js} +3 -3
  9. package/admin-build/_app/immutable/chunks/{BN-pHKcH.js → Cuny2nPU.js} +1 -1
  10. package/admin-build/_app/immutable/chunks/{CPLcjNR9.js → D15DP4DQ.js} +1 -1
  11. package/admin-build/_app/immutable/chunks/{DBkor_jM.js → DAzRCtch.js} +1 -1
  12. package/admin-build/_app/immutable/chunks/DYF4byEY.js +1 -0
  13. package/admin-build/_app/immutable/chunks/{DBniE7GN.js → Dcey5WNo.js} +1 -1
  14. package/admin-build/_app/immutable/chunks/{C5nMidnK.js → HK54RDdv.js} +1 -1
  15. package/admin-build/_app/immutable/chunks/{CI1lKBjB.js → gUtOgqgM.js} +1 -1
  16. package/admin-build/_app/immutable/chunks/{_xa30BOD.js → pnqPwnFK.js} +1 -1
  17. package/admin-build/_app/immutable/entry/{app.BW-Ac3jY.js → app.DwslmBQo.js} +2 -2
  18. package/admin-build/_app/immutable/entry/start.Bi51W3Uj.js +1 -0
  19. package/admin-build/_app/immutable/nodes/{0.CRSQPtos.js → 0.SSaZIC3t.js} +1 -1
  20. package/admin-build/_app/immutable/nodes/{1.HmStNbZP.js → 1.CqSv9lq5.js} +1 -1
  21. package/admin-build/_app/immutable/nodes/{10.BVlz13nr.js → 10.BoQz_717.js} +1 -1
  22. package/admin-build/_app/immutable/nodes/{11.VwQdbWwH.js → 11.B-yS_gft.js} +1 -1
  23. package/admin-build/_app/immutable/nodes/{12.BFAAgi1f.js → 12.WsVtLoVx.js} +1 -1
  24. package/admin-build/_app/immutable/nodes/{13.DDdauC84.js → 13.TbqRQJKh.js} +1 -1
  25. package/admin-build/_app/immutable/nodes/{14.D_rXaafJ.js → 14.cldePwj3.js} +1 -1
  26. package/admin-build/_app/immutable/nodes/{15.rfFjjiZc.js → 15.Bec037-f.js} +1 -1
  27. package/admin-build/_app/immutable/nodes/{16.DDEpGJ4Z.js → 16.Dd0yTYhN.js} +1 -1
  28. package/admin-build/_app/immutable/nodes/{17.ChQWNtRN.js → 17.CoiqH0lF.js} +1 -1
  29. package/admin-build/_app/immutable/nodes/{18.Rir_JwlF.js → 18.BDXxM1Qi.js} +1 -1
  30. package/admin-build/_app/immutable/nodes/{19.CF76nxk1.js → 19.lo9mTPiR.js} +1 -1
  31. package/admin-build/_app/immutable/nodes/{20.JQer3KPM.js → 20.B7kbGqh_.js} +1 -1
  32. package/admin-build/_app/immutable/nodes/21.BGm1TcfO.js +1 -0
  33. package/admin-build/_app/immutable/nodes/{22.DUw7X6z_.js → 22.VOtCuTkf.js} +1 -1
  34. package/admin-build/_app/immutable/nodes/{23.DS3svA-a.js → 23.C2Uxx-kO.js} +1 -1
  35. package/admin-build/_app/immutable/nodes/{24.BYOsQM6B.js → 24.BxdEwsS3.js} +1 -1
  36. package/admin-build/_app/immutable/nodes/{25.n0pyDBRv.js → 25.CVu2qoCv.js} +1 -1
  37. package/admin-build/_app/immutable/nodes/{26.C-Oo8sYK.js → 26.DqYlpX7Z.js} +1 -1
  38. package/admin-build/_app/immutable/nodes/{27.BfxbFNkk.js → 27.emgbpP8y.js} +1 -1
  39. package/admin-build/_app/immutable/nodes/{28.DyHSN1q7.js → 28.BVPSPK68.js} +1 -1
  40. package/admin-build/_app/immutable/nodes/{29.CUAmZbCc.js → 29.BsDQQ16z.js} +1 -1
  41. package/admin-build/_app/immutable/nodes/{3.KQm4VJJg.js → 3.uc8joqGb.js} +1 -1
  42. package/admin-build/_app/immutable/nodes/{30.CQdPre5F.js → 30.D4CYqQrE.js} +1 -1
  43. package/admin-build/_app/immutable/nodes/{31.BP6raetq.js → 31.DvUuXrVU.js} +1 -1
  44. package/admin-build/_app/immutable/nodes/{4.Glf2jJHB.js → 4.BqTZ0Uoq.js} +1 -1
  45. package/admin-build/_app/immutable/nodes/{5.BdFtj_-X.js → 5.DAO3--6W.js} +1 -1
  46. package/admin-build/_app/immutable/nodes/{6.JfnwWq8s.js → 6.CBbGl_Wo.js} +1 -1
  47. package/admin-build/_app/immutable/nodes/{7.C-rw9qDh.js → 7.s-I8cKAh.js} +1 -1
  48. package/admin-build/_app/immutable/nodes/{8.CA7r1Sjs.js → 8.Ct6B-y3f.js} +1 -1
  49. package/admin-build/_app/immutable/nodes/{9.B2jgJDkH.js → 9.Dok_ZoeZ.js} +1 -1
  50. package/admin-build/_app/version.json +1 -1
  51. package/admin-build/index.html +7 -7
  52. package/openapi.json +498 -3
  53. package/package.json +3 -3
  54. package/src/__tests__/auth-token.test.ts +142 -0
  55. package/src/__tests__/email-provider.test.ts +82 -0
  56. package/src/__tests__/error-format.test.ts +21 -0
  57. package/src/__tests__/functions-context.test.ts +87 -0
  58. package/src/__tests__/functions-d1-proxy.test.ts +70 -0
  59. package/src/__tests__/functions-route.test.ts +15 -0
  60. package/src/__tests__/postgres-api-consistency.test.ts +240 -0
  61. package/src/__tests__/postgres-batch-compat.test.ts +33 -27
  62. package/src/__tests__/postgres-batch.test.ts +394 -0
  63. package/src/__tests__/postgres-field-ops-compat.test.ts +2 -1
  64. package/src/__tests__/postgres-transact.test.ts +148 -0
  65. package/src/__tests__/room-access-policy.test.ts +26 -0
  66. package/src/__tests__/room-handler-context.test.ts +2 -0
  67. package/src/__tests__/smoke-skip-report.test.ts +1 -1
  68. package/src/durable-objects/database-do.ts +455 -15
  69. package/src/durable-objects/room-runtime-base.ts +16 -5
  70. package/src/durable-objects/rooms-do.ts +4 -1
  71. package/src/lib/auth-d1-service.ts +37 -7
  72. package/src/lib/auth-token.ts +66 -0
  73. package/src/lib/d1-handler.ts +416 -50
  74. package/src/lib/email-provider.ts +115 -5
  75. package/src/lib/errors.ts +8 -4
  76. package/src/lib/functions.ts +91 -1
  77. package/src/lib/internal-transport.ts +25 -1
  78. package/src/lib/jwt.ts +2 -0
  79. package/src/lib/postgres-handler.ts +562 -84
  80. package/src/routes/admin.ts +8 -1
  81. package/src/routes/auth.ts +169 -65
  82. package/src/routes/room.ts +36 -2
  83. package/src/routes/storage.ts +446 -62
  84. package/src/routes/tables.ts +140 -0
  85. package/src/types.ts +10 -0
  86. package/admin-build/_app/immutable/chunks/B0zJ5_Wk.js +0 -1
  87. package/admin-build/_app/immutable/chunks/DZo4s3wn.js +0 -1
  88. package/admin-build/_app/immutable/entry/start.Bcf0SjPV.js +0 -1
  89. package/admin-build/_app/immutable/nodes/21.CzGYxjpu.js +0 -1
@@ -1 +1 @@
1
- import"../chunks/CWj6FrbW.js";import{o as U}from"../chunks/Bn2NtlTj.js";import{p as j,a as z,f as G,c as b,g as t,s as m,r as g,u as n,b as y,d as D,t as J}from"../chunks/BdTBlfLy.js";import{d as K,s as N,a as O}from"../chunks/DtZk82gG.js";import{a as Q,t as V,e as W,i as X}from"../chunks/DncT8xH5.js";import{a as F,f as I}from"../chunks/DEELgv7K.js";import{d as Y,s as Z}from"../chunks/CjcrXziO.js";import{P as tt}from"../chunks/BkZCgsc3.js";import{a as et}from"../chunks/Q2nPFxS6.js";import{M as _,T as at}from"../chunks/YGUb3X-Q.js";import{D as rt,T as nt}from"../chunks/DBkor_jM.js";var st=I("<button> </button>"),ot=I('<div class="range-selector"></div>'),lt=I('<div class="analytics-grid"><!> <!> <!> <!></div> <div class="analytics-chart"><!></div> <div class="analytics-bottom"><!> <!></div>',1);function yt(w,A){j(A,!0);let s=D(!0),o=D(null),p=D("24h");const M=[{value:"1h",label:"1H"},{value:"6h",label:"6H"},{value:"24h",label:"24H"},{value:"7d",label:"7D"},{value:"30d",label:"30D"}],T=n(()=>()=>{switch(t(p)){case"1h":return"minute";case"6h":case"24h":return"hour";default:return"day"}});async function $(){try{const e=await Q.fetch(`data/analytics?range=${t(p)}&category=function&metric=overview&groupBy=${t(T)()}`);y(o,e,!0)}catch(e){V(Y(e,"Failed to load functions analytics."))}finally{y(s,!1)}}function k(e){y(p,e,!0),y(s,!0),$()}U(()=>{$();const e=setInterval($,3e4);return()=>clearInterval(e)});const H=n(()=>()=>{var c;if(!((c=t(o))!=null&&c.summary))return 0;const{totalRequests:e,totalErrors:a}=t(o).summary;return e>0?a/e*100:0}),B=n(()=>()=>{var e;return(((e=t(o))==null?void 0:e.timeSeries)||[]).map(a=>({timestamp:a.timestamp,value:a.requests??a.value??0}))}),C=n(()=>()=>{var e;return(((e=t(o))==null?void 0:e.breakdown)||[]).map(a=>({label:a.label||"other",value:a.count}))}),E=n(()=>()=>{var e;return(((e=t(o))==null?void 0:e.topItems)||[]).map(a=>({label:a.label,count:a.count,secondary:`${Math.round(a.avgLatency)}ms · ${a.errorRate.toFixed(1)}% 5xx`}))});tt(w,{title:"Functions Analytics",description:"Serverless function execution and performance metrics",get docsHref(){return et},actions:a=>{var c=ot();W(c,21,()=>M,X,(f,d)=>{var l=st();let v;var h=b(l,!0);g(l),J(()=>{v=Z(l,1,"range-btn",null,v,{"range-btn--active":t(p)===t(d).value}),N(h,t(d).label)}),O("click",l,()=>k(t(d).value)),F(f,l)}),g(c),F(a,c)},children:(a,c)=>{var f=lt(),d=G(f),l=b(d);{let r=n(()=>{var i,u;return((u=(i=t(o))==null?void 0:i.summary)==null?void 0:u.totalRequests)??0});_(l,{label:"Invocations",get value(){return t(r)},get loading(){return t(s)}})}var v=m(l,2);{let r=n(()=>{var i,u;return((u=(i=t(o))==null?void 0:i.summary)==null?void 0:u.uniqueUsers)??0});_(v,{label:"Unique Users",get value(){return t(r)},get loading(){return t(s)}})}var h=m(v,2);{let r=n(()=>t(H)().toFixed(1));_(h,{label:"5xx Rate",get value(){return t(r)},unit:"%",get loading(){return t(s)}})}var L=m(h,2);{let r=n(()=>{var i,u;return Math.round(((u=(i=t(o))==null?void 0:i.summary)==null?void 0:u.avgLatency)??0)});_(L,{label:"Avg Duration",get value(){return t(r)},unit:"ms",get loading(){return t(s)}})}g(d);var x=m(d,2),P=b(x);{let r=n(()=>t(B)());at(P,{get data(){return t(r)},type:"bar",height:240,label:"Function invocations over time",get loading(){return t(s)},color:"#dc2626"})}g(x);var R=m(x,2),q=b(R);{let r=n(()=>t(C)());rt(q,{get items(){return t(r)},title:"Functions by invocation count",get loading(){return t(s)}})}var S=m(q,2);{let r=n(()=>t(E)());nt(S,{get items(){return t(r)},title:"Top Functions",get loading(){return t(s)}})}g(R),F(a,f)}}),z()}K(["click"]);export{yt as component};
1
+ import"../chunks/CWj6FrbW.js";import{o as U}from"../chunks/Bn2NtlTj.js";import{p as j,a as z,f as G,c as b,g as t,s as m,r as g,u as n,b as y,d as D,t as J}from"../chunks/BdTBlfLy.js";import{d as K,s as N,a as O}from"../chunks/DtZk82gG.js";import{a as Q,t as V,e as W,i as X}from"../chunks/BYTXdmFz.js";import{a as F,f as I}from"../chunks/DEELgv7K.js";import{d as Y,s as Z}from"../chunks/CjcrXziO.js";import{P as tt}from"../chunks/BkZCgsc3.js";import{a as et}from"../chunks/Q2nPFxS6.js";import{M as _,T as at}from"../chunks/C-_7bS5w.js";import{D as rt,T as nt}from"../chunks/DAzRCtch.js";var st=I("<button> </button>"),ot=I('<div class="range-selector"></div>'),lt=I('<div class="analytics-grid"><!> <!> <!> <!></div> <div class="analytics-chart"><!></div> <div class="analytics-bottom"><!> <!></div>',1);function yt(w,A){j(A,!0);let s=D(!0),o=D(null),p=D("24h");const M=[{value:"1h",label:"1H"},{value:"6h",label:"6H"},{value:"24h",label:"24H"},{value:"7d",label:"7D"},{value:"30d",label:"30D"}],T=n(()=>()=>{switch(t(p)){case"1h":return"minute";case"6h":case"24h":return"hour";default:return"day"}});async function $(){try{const e=await Q.fetch(`data/analytics?range=${t(p)}&category=function&metric=overview&groupBy=${t(T)()}`);y(o,e,!0)}catch(e){V(Y(e,"Failed to load functions analytics."))}finally{y(s,!1)}}function k(e){y(p,e,!0),y(s,!0),$()}U(()=>{$();const e=setInterval($,3e4);return()=>clearInterval(e)});const H=n(()=>()=>{var c;if(!((c=t(o))!=null&&c.summary))return 0;const{totalRequests:e,totalErrors:a}=t(o).summary;return e>0?a/e*100:0}),B=n(()=>()=>{var e;return(((e=t(o))==null?void 0:e.timeSeries)||[]).map(a=>({timestamp:a.timestamp,value:a.requests??a.value??0}))}),C=n(()=>()=>{var e;return(((e=t(o))==null?void 0:e.breakdown)||[]).map(a=>({label:a.label||"other",value:a.count}))}),E=n(()=>()=>{var e;return(((e=t(o))==null?void 0:e.topItems)||[]).map(a=>({label:a.label,count:a.count,secondary:`${Math.round(a.avgLatency)}ms · ${a.errorRate.toFixed(1)}% 5xx`}))});tt(w,{title:"Functions Analytics",description:"Serverless function execution and performance metrics",get docsHref(){return et},actions:a=>{var c=ot();W(c,21,()=>M,X,(f,d)=>{var l=st();let v;var h=b(l,!0);g(l),J(()=>{v=Z(l,1,"range-btn",null,v,{"range-btn--active":t(p)===t(d).value}),N(h,t(d).label)}),O("click",l,()=>k(t(d).value)),F(f,l)}),g(c),F(a,c)},children:(a,c)=>{var f=lt(),d=G(f),l=b(d);{let r=n(()=>{var i,u;return((u=(i=t(o))==null?void 0:i.summary)==null?void 0:u.totalRequests)??0});_(l,{label:"Invocations",get value(){return t(r)},get loading(){return t(s)}})}var v=m(l,2);{let r=n(()=>{var i,u;return((u=(i=t(o))==null?void 0:i.summary)==null?void 0:u.uniqueUsers)??0});_(v,{label:"Unique Users",get value(){return t(r)},get loading(){return t(s)}})}var h=m(v,2);{let r=n(()=>t(H)().toFixed(1));_(h,{label:"5xx Rate",get value(){return t(r)},unit:"%",get loading(){return t(s)}})}var L=m(h,2);{let r=n(()=>{var i,u;return Math.round(((u=(i=t(o))==null?void 0:i.summary)==null?void 0:u.avgLatency)??0)});_(L,{label:"Avg Duration",get value(){return t(r)},unit:"ms",get loading(){return t(s)}})}g(d);var x=m(d,2),P=b(x);{let r=n(()=>t(B)());at(P,{get data(){return t(r)},type:"bar",height:240,label:"Function invocations over time",get loading(){return t(s)},color:"#dc2626"})}g(x);var R=m(x,2),q=b(R);{let r=n(()=>t(C)());rt(q,{get items(){return t(r)},title:"Functions by invocation count",get loading(){return t(s)}})}var S=m(q,2);{let r=n(()=>t(E)());nt(S,{get items(){return t(r)},title:"Top Functions",get loading(){return t(s)}})}g(R),F(a,f)}}),z()}K(["click"]);export{yt as component};
@@ -1 +1 @@
1
- {"version":"1775689125712"}
1
+ {"version":"1783465800407"}
@@ -5,12 +5,12 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>EdgeBase Admin</title>
7
7
  <link rel="icon" href="/admin/favicon.svg" type="image/svg+xml" />
8
- <link href="/admin/_app/immutable/entry/start.Bcf0SjPV.js" rel="modulepreload">
9
- <link href="/admin/_app/immutable/chunks/B0zJ5_Wk.js" rel="modulepreload">
8
+ <link href="/admin/_app/immutable/entry/start.Bi51W3Uj.js" rel="modulepreload">
9
+ <link href="/admin/_app/immutable/chunks/DYF4byEY.js" rel="modulepreload">
10
10
  <link href="/admin/_app/immutable/chunks/BdTBlfLy.js" rel="modulepreload">
11
11
  <link href="/admin/_app/immutable/chunks/Bn2NtlTj.js" rel="modulepreload">
12
- <link href="/admin/_app/immutable/chunks/DZo4s3wn.js" rel="modulepreload">
13
- <link href="/admin/_app/immutable/entry/app.BW-Ac3jY.js" rel="modulepreload">
12
+ <link href="/admin/_app/immutable/chunks/BENT96gS.js" rel="modulepreload">
13
+ <link href="/admin/_app/immutable/entry/app.DwslmBQo.js" rel="modulepreload">
14
14
  <link href="/admin/_app/immutable/chunks/B2bEC_Hm.js" rel="modulepreload">
15
15
  <link href="/admin/_app/immutable/chunks/Bb0e0sAP.js" rel="modulepreload">
16
16
  <link href="/admin/_app/immutable/chunks/DtZk82gG.js" rel="modulepreload">
@@ -26,7 +26,7 @@
26
26
  <div style="display: contents">
27
27
  <script>
28
28
  {
29
- __sveltekit_1iz3xys = {
29
+ __sveltekit_n5o5p0 = {
30
30
  base: "/admin",
31
31
  assets: "/admin"
32
32
  };
@@ -34,8 +34,8 @@
34
34
  const element = document.currentScript.parentElement;
35
35
 
36
36
  Promise.all([
37
- import("/admin/_app/immutable/entry/start.Bcf0SjPV.js"),
38
- import("/admin/_app/immutable/entry/app.BW-Ac3jY.js")
37
+ import("/admin/_app/immutable/entry/start.Bi51W3Uj.js"),
38
+ import("/admin/_app/immutable/entry/app.DwslmBQo.js")
39
39
  ]).then(([kit, app]) => {
40
40
  kit.start(app, element);
41
41
  });
package/openapi.json CHANGED
@@ -1846,6 +1846,100 @@
1846
1846
  }
1847
1847
  }
1848
1848
  },
1849
+ "/api/auth/mfa/recovery-codes": {
1850
+ "post": {
1851
+ "operationId": "authMfaRecoveryCodesRegenerate",
1852
+ "tags": [
1853
+ "client"
1854
+ ],
1855
+ "summary": "Regenerate MFA recovery codes",
1856
+ "requestBody": {
1857
+ "required": false,
1858
+ "content": {
1859
+ "application/json": {
1860
+ "schema": {
1861
+ "type": "object",
1862
+ "properties": {
1863
+ "password": {
1864
+ "type": "string"
1865
+ },
1866
+ "code": {
1867
+ "type": "string"
1868
+ }
1869
+ },
1870
+ "additionalProperties": {}
1871
+ }
1872
+ }
1873
+ }
1874
+ },
1875
+ "responses": {
1876
+ "200": {
1877
+ "description": "Success",
1878
+ "content": {
1879
+ "application/json": {
1880
+ "schema": {
1881
+ "type": "object",
1882
+ "additionalProperties": {},
1883
+ "description": "JSON response"
1884
+ }
1885
+ }
1886
+ }
1887
+ },
1888
+ "400": {
1889
+ "description": "Bad request",
1890
+ "content": {
1891
+ "application/json": {
1892
+ "schema": {
1893
+ "type": "object",
1894
+ "properties": {
1895
+ "code": {
1896
+ "type": "number",
1897
+ "description": "HTTP status code",
1898
+ "example": 400
1899
+ },
1900
+ "message": {
1901
+ "type": "string",
1902
+ "description": "Human-readable message",
1903
+ "example": "Invalid request body"
1904
+ }
1905
+ },
1906
+ "required": [
1907
+ "code",
1908
+ "message"
1909
+ ]
1910
+ }
1911
+ }
1912
+ }
1913
+ },
1914
+ "401": {
1915
+ "description": "Authentication required or verification failed",
1916
+ "content": {
1917
+ "application/json": {
1918
+ "schema": {
1919
+ "type": "object",
1920
+ "properties": {
1921
+ "code": {
1922
+ "type": "number",
1923
+ "description": "HTTP status code",
1924
+ "example": 400
1925
+ },
1926
+ "message": {
1927
+ "type": "string",
1928
+ "description": "Human-readable message",
1929
+ "example": "Invalid request body"
1930
+ }
1931
+ },
1932
+ "required": [
1933
+ "code",
1934
+ "message"
1935
+ ]
1936
+ }
1937
+ }
1938
+ }
1939
+ }
1940
+ }
1941
+ }
1942
+ },
1849
1943
  "/api/auth/mfa/totp": {
1850
1944
  "delete": {
1851
1945
  "operationId": "authMfaTotpDelete",
@@ -5933,6 +6027,17 @@
5933
6027
  "description": "Full-text search query",
5934
6028
  "name": "search",
5935
6029
  "in": "query"
6030
+ },
6031
+ {
6032
+ "schema": {
6033
+ "type": "string",
6034
+ "description": "Set to '0' or 'false' to skip the COUNT query. total is returned as null and hasMore still drives cursor pagination.",
6035
+ "example": "0"
6036
+ },
6037
+ "required": false,
6038
+ "description": "Set to '0' or 'false' to skip the COUNT query. total is returned as null and hasMore still drives cursor pagination.",
6039
+ "name": "includeTotal",
6040
+ "in": "query"
5936
6041
  }
5937
6042
  ],
5938
6043
  "responses": {
@@ -6454,6 +6559,86 @@
6454
6559
  }
6455
6560
  }
6456
6561
  },
6562
+ "/api/db/{namespace}/transact": {
6563
+ "post": {
6564
+ "operationId": "dbSingleTransact",
6565
+ "tags": [
6566
+ "client"
6567
+ ],
6568
+ "summary": "Apply multi-table write operations atomically in a single-instance database",
6569
+ "parameters": [
6570
+ {
6571
+ "schema": {
6572
+ "type": "string",
6573
+ "description": "Database namespace",
6574
+ "example": "app"
6575
+ },
6576
+ "required": true,
6577
+ "description": "Database namespace",
6578
+ "name": "namespace",
6579
+ "in": "path"
6580
+ }
6581
+ ],
6582
+ "requestBody": {
6583
+ "required": true,
6584
+ "content": {
6585
+ "application/json": {
6586
+ "schema": {
6587
+ "type": "object",
6588
+ "properties": {
6589
+ "operations": {
6590
+ "type": "array",
6591
+ "description": "Ordered operations applied atomically in one transaction. op: insert | update | delete | expect. insert: { table, op, data }. update: { table, op, id, data }. delete: { table, op, id }. expect: { table, op, id?, where?, exists } asserts row state and aborts the transaction with 409 when unmet.",
6592
+ "items": {
6593
+ "type": "object",
6594
+ "additionalProperties": {}
6595
+ }
6596
+ }
6597
+ },
6598
+ "required": [
6599
+ "operations"
6600
+ ],
6601
+ "additionalProperties": false
6602
+ }
6603
+ }
6604
+ }
6605
+ },
6606
+ "responses": {
6607
+ "200": {
6608
+ "description": "Ordered per-operation results",
6609
+ "content": {
6610
+ "application/json": {
6611
+ "schema": {
6612
+ "type": "object",
6613
+ "properties": {
6614
+ "results": {
6615
+ "type": "array",
6616
+ "items": {
6617
+ "type": "object",
6618
+ "additionalProperties": {}
6619
+ }
6620
+ }
6621
+ },
6622
+ "additionalProperties": {}
6623
+ }
6624
+ }
6625
+ }
6626
+ },
6627
+ "400": {
6628
+ "description": "Validation error (unknown table, malformed op, batch limit exceeded)"
6629
+ },
6630
+ "403": {
6631
+ "description": "An access rule rejected one of the operations"
6632
+ },
6633
+ "409": {
6634
+ "description": "An expect operation was not satisfied; transaction rolled back"
6635
+ },
6636
+ "501": {
6637
+ "description": "Provider does not support multi-table transactions (d1/postgres)"
6638
+ }
6639
+ }
6640
+ }
6641
+ },
6457
6642
  "/api/db/{namespace}/{instanceId}/tables/{table}/count": {
6458
6643
  "get": {
6459
6644
  "operationId": "dbCountRecords",
@@ -7490,6 +7675,17 @@
7490
7675
  "description": "Full-text search query",
7491
7676
  "name": "search",
7492
7677
  "in": "query"
7678
+ },
7679
+ {
7680
+ "schema": {
7681
+ "type": "string",
7682
+ "description": "Set to '0' or 'false' to skip the COUNT query. total is returned as null and hasMore still drives cursor pagination.",
7683
+ "example": "0"
7684
+ },
7685
+ "required": false,
7686
+ "description": "Set to '0' or 'false' to skip the COUNT query. total is returned as null and hasMore still drives cursor pagination.",
7687
+ "name": "includeTotal",
7688
+ "in": "query"
7493
7689
  }
7494
7690
  ],
7495
7691
  "responses": {
@@ -8044,6 +8240,97 @@
8044
8240
  }
8045
8241
  }
8046
8242
  },
8243
+ "/api/db/{namespace}/{instanceId}/transact": {
8244
+ "post": {
8245
+ "operationId": "dbTransact",
8246
+ "tags": [
8247
+ "client"
8248
+ ],
8249
+ "summary": "Apply multi-table write operations atomically in a dynamic database instance",
8250
+ "parameters": [
8251
+ {
8252
+ "schema": {
8253
+ "type": "string",
8254
+ "description": "Database namespace",
8255
+ "example": "app"
8256
+ },
8257
+ "required": true,
8258
+ "description": "Database namespace",
8259
+ "name": "namespace",
8260
+ "in": "path"
8261
+ },
8262
+ {
8263
+ "schema": {
8264
+ "type": "string",
8265
+ "description": "Database instance ID",
8266
+ "example": "ws-456"
8267
+ },
8268
+ "required": true,
8269
+ "description": "Database instance ID",
8270
+ "name": "instanceId",
8271
+ "in": "path"
8272
+ }
8273
+ ],
8274
+ "requestBody": {
8275
+ "required": true,
8276
+ "content": {
8277
+ "application/json": {
8278
+ "schema": {
8279
+ "type": "object",
8280
+ "properties": {
8281
+ "operations": {
8282
+ "type": "array",
8283
+ "description": "Ordered operations applied atomically in one transaction. op: insert | update | delete | expect. insert: { table, op, data }. update: { table, op, id, data }. delete: { table, op, id }. expect: { table, op, id?, where?, exists } asserts row state and aborts the transaction with 409 when unmet.",
8284
+ "items": {
8285
+ "type": "object",
8286
+ "additionalProperties": {}
8287
+ }
8288
+ }
8289
+ },
8290
+ "required": [
8291
+ "operations"
8292
+ ],
8293
+ "additionalProperties": false
8294
+ }
8295
+ }
8296
+ }
8297
+ },
8298
+ "responses": {
8299
+ "200": {
8300
+ "description": "Ordered per-operation results",
8301
+ "content": {
8302
+ "application/json": {
8303
+ "schema": {
8304
+ "type": "object",
8305
+ "properties": {
8306
+ "results": {
8307
+ "type": "array",
8308
+ "items": {
8309
+ "type": "object",
8310
+ "additionalProperties": {}
8311
+ }
8312
+ }
8313
+ },
8314
+ "additionalProperties": {}
8315
+ }
8316
+ }
8317
+ }
8318
+ },
8319
+ "400": {
8320
+ "description": "Validation error (unknown table, malformed op, batch limit exceeded)"
8321
+ },
8322
+ "403": {
8323
+ "description": "An access rule rejected one of the operations"
8324
+ },
8325
+ "409": {
8326
+ "description": "An expect operation was not satisfied; transaction rolled back"
8327
+ },
8328
+ "501": {
8329
+ "description": "Provider does not support multi-table transactions (d1/postgres)"
8330
+ }
8331
+ }
8332
+ }
8333
+ },
8047
8334
  "/api/db/connect-check": {
8048
8335
  "get": {
8049
8336
  "operationId": "checkDatabaseSubscriptionConnection",
@@ -8576,6 +8863,26 @@
8576
8863
  "required": true,
8577
8864
  "name": "bucket",
8578
8865
  "in": "path"
8866
+ },
8867
+ {
8868
+ "schema": {
8869
+ "type": "string",
8870
+ "description": "Optional signed upload key echoed from a signed upload URL."
8871
+ },
8872
+ "required": false,
8873
+ "description": "Optional signed upload key echoed from a signed upload URL.",
8874
+ "name": "key",
8875
+ "in": "query"
8876
+ },
8877
+ {
8878
+ "schema": {
8879
+ "type": "string",
8880
+ "description": "Optional signed upload token for write-rule-bypassing upload grants."
8881
+ },
8882
+ "required": false,
8883
+ "description": "Optional signed upload token for write-rule-bypassing upload grants.",
8884
+ "name": "token",
8885
+ "in": "query"
8579
8886
  }
8580
8887
  ],
8581
8888
  "requestBody": {
@@ -8654,6 +8961,32 @@
8654
8961
  }
8655
8962
  }
8656
8963
  }
8964
+ },
8965
+ "413": {
8966
+ "description": "Payload too large",
8967
+ "content": {
8968
+ "application/json": {
8969
+ "schema": {
8970
+ "type": "object",
8971
+ "properties": {
8972
+ "code": {
8973
+ "type": "number",
8974
+ "description": "HTTP status code",
8975
+ "example": 400
8976
+ },
8977
+ "message": {
8978
+ "type": "string",
8979
+ "description": "Human-readable message",
8980
+ "example": "Invalid request body"
8981
+ }
8982
+ },
8983
+ "required": [
8984
+ "code",
8985
+ "message"
8986
+ ]
8987
+ }
8988
+ }
8989
+ }
8657
8990
  }
8658
8991
  }
8659
8992
  }
@@ -9026,6 +9359,9 @@
9026
9359
  "200": {
9027
9360
  "description": "File content"
9028
9361
  },
9362
+ "206": {
9363
+ "description": "Partial file content"
9364
+ },
9029
9365
  "403": {
9030
9366
  "description": "Forbidden",
9031
9367
  "content": {
@@ -9077,6 +9413,9 @@
9077
9413
  }
9078
9414
  }
9079
9415
  }
9416
+ },
9417
+ "416": {
9418
+ "description": "Range not satisfiable"
9080
9419
  }
9081
9420
  }
9082
9421
  },
@@ -9203,6 +9542,16 @@
9203
9542
  "required": true,
9204
9543
  "name": "key",
9205
9544
  "in": "query"
9545
+ },
9546
+ {
9547
+ "schema": {
9548
+ "type": "string",
9549
+ "description": "Optional signed upload token for write-rule-bypassing upload grants."
9550
+ },
9551
+ "required": false,
9552
+ "description": "Optional signed upload token for write-rule-bypassing upload grants.",
9553
+ "name": "token",
9554
+ "in": "query"
9206
9555
  }
9207
9556
  ],
9208
9557
  "responses": {
@@ -9803,6 +10152,26 @@
9803
10152
  "required": true,
9804
10153
  "name": "bucket",
9805
10154
  "in": "path"
10155
+ },
10156
+ {
10157
+ "schema": {
10158
+ "type": "string",
10159
+ "description": "Optional signed upload key echoed from a signed upload URL."
10160
+ },
10161
+ "required": false,
10162
+ "description": "Optional signed upload key echoed from a signed upload URL.",
10163
+ "name": "key",
10164
+ "in": "query"
10165
+ },
10166
+ {
10167
+ "schema": {
10168
+ "type": "string",
10169
+ "description": "Optional signed upload token for write-rule-bypassing upload grants."
10170
+ },
10171
+ "required": false,
10172
+ "description": "Optional signed upload token for write-rule-bypassing upload grants.",
10173
+ "name": "token",
10174
+ "in": "query"
9806
10175
  }
9807
10176
  ],
9808
10177
  "requestBody": {
@@ -9915,15 +10284,49 @@
9915
10284
  "required": true,
9916
10285
  "name": "bucket",
9917
10286
  "in": "path"
10287
+ },
10288
+ {
10289
+ "schema": {
10290
+ "type": "string"
10291
+ },
10292
+ "required": true,
10293
+ "name": "uploadId",
10294
+ "in": "query"
10295
+ },
10296
+ {
10297
+ "schema": {
10298
+ "type": "string"
10299
+ },
10300
+ "required": true,
10301
+ "name": "partNumber",
10302
+ "in": "query"
10303
+ },
10304
+ {
10305
+ "schema": {
10306
+ "type": "string"
10307
+ },
10308
+ "required": true,
10309
+ "name": "key",
10310
+ "in": "query"
10311
+ },
10312
+ {
10313
+ "schema": {
10314
+ "type": "string",
10315
+ "description": "Optional signed upload token for write-rule-bypassing upload grants."
10316
+ },
10317
+ "required": false,
10318
+ "description": "Optional signed upload token for write-rule-bypassing upload grants.",
10319
+ "name": "token",
10320
+ "in": "query"
9918
10321
  }
9919
10322
  ],
9920
10323
  "requestBody": {
9921
10324
  "required": true,
9922
10325
  "content": {
9923
- "application/json": {
10326
+ "application/octet-stream": {
9924
10327
  "schema": {
9925
- "type": "object",
9926
- "additionalProperties": {}
10328
+ "type": "string",
10329
+ "format": "binary"
9927
10330
  }
9928
10331
  }
9929
10332
  }
@@ -9992,6 +10395,32 @@
9992
10395
  }
9993
10396
  }
9994
10397
  }
10398
+ },
10399
+ "413": {
10400
+ "description": "Payload too large",
10401
+ "content": {
10402
+ "application/json": {
10403
+ "schema": {
10404
+ "type": "object",
10405
+ "properties": {
10406
+ "code": {
10407
+ "type": "number",
10408
+ "description": "HTTP status code",
10409
+ "example": 400
10410
+ },
10411
+ "message": {
10412
+ "type": "string",
10413
+ "description": "Human-readable message",
10414
+ "example": "Invalid request body"
10415
+ }
10416
+ },
10417
+ "required": [
10418
+ "code",
10419
+ "message"
10420
+ ]
10421
+ }
10422
+ }
10423
+ }
9995
10424
  }
9996
10425
  }
9997
10426
  }
@@ -10011,6 +10440,26 @@
10011
10440
  "required": true,
10012
10441
  "name": "bucket",
10013
10442
  "in": "path"
10443
+ },
10444
+ {
10445
+ "schema": {
10446
+ "type": "string",
10447
+ "description": "Optional signed upload key echoed from a signed upload URL."
10448
+ },
10449
+ "required": false,
10450
+ "description": "Optional signed upload key echoed from a signed upload URL.",
10451
+ "name": "key",
10452
+ "in": "query"
10453
+ },
10454
+ {
10455
+ "schema": {
10456
+ "type": "string",
10457
+ "description": "Optional signed upload token for write-rule-bypassing upload grants."
10458
+ },
10459
+ "required": false,
10460
+ "description": "Optional signed upload token for write-rule-bypassing upload grants.",
10461
+ "name": "token",
10462
+ "in": "query"
10014
10463
  }
10015
10464
  ],
10016
10465
  "requestBody": {
@@ -10118,6 +10567,32 @@
10118
10567
  }
10119
10568
  }
10120
10569
  }
10570
+ },
10571
+ "413": {
10572
+ "description": "Payload too large",
10573
+ "content": {
10574
+ "application/json": {
10575
+ "schema": {
10576
+ "type": "object",
10577
+ "properties": {
10578
+ "code": {
10579
+ "type": "number",
10580
+ "description": "HTTP status code",
10581
+ "example": 400
10582
+ },
10583
+ "message": {
10584
+ "type": "string",
10585
+ "description": "Human-readable message",
10586
+ "example": "Invalid request body"
10587
+ }
10588
+ },
10589
+ "required": [
10590
+ "code",
10591
+ "message"
10592
+ ]
10593
+ }
10594
+ }
10595
+ }
10121
10596
  }
10122
10597
  }
10123
10598
  }
@@ -10137,6 +10612,26 @@
10137
10612
  "required": true,
10138
10613
  "name": "bucket",
10139
10614
  "in": "path"
10615
+ },
10616
+ {
10617
+ "schema": {
10618
+ "type": "string",
10619
+ "description": "Optional signed upload key echoed from a signed upload URL."
10620
+ },
10621
+ "required": false,
10622
+ "description": "Optional signed upload key echoed from a signed upload URL.",
10623
+ "name": "key",
10624
+ "in": "query"
10625
+ },
10626
+ {
10627
+ "schema": {
10628
+ "type": "string",
10629
+ "description": "Optional signed upload token for write-rule-bypassing upload grants."
10630
+ },
10631
+ "required": false,
10632
+ "description": "Optional signed upload token for write-rule-bypassing upload grants.",
10633
+ "name": "token",
10634
+ "in": "query"
10140
10635
  }
10141
10636
  ],
10142
10637
  "requestBody": {