zitejs 0.10.0-start.9 → 0.10.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 (428) hide show
  1. package/dist/cjs/auth/actions.d.ts +28 -0
  2. package/dist/cjs/auth/actions.js +93 -0
  3. package/dist/cjs/auth/client.d.ts +357 -0
  4. package/dist/cjs/auth/client.js +66 -0
  5. package/dist/cjs/auth/config.js +9 -3
  6. package/dist/cjs/auth/index.d.ts +2 -249
  7. package/dist/cjs/auth/index.js +11 -108
  8. package/dist/cjs/auth/index.test.js +60 -0
  9. package/dist/cjs/auth/previewClaim.d.ts +7 -0
  10. package/dist/cjs/auth/previewClaim.js +16 -0
  11. package/dist/cjs/auth/profileUpdates.d.ts +9 -0
  12. package/dist/cjs/auth/profileUpdates.js +11 -0
  13. package/dist/cjs/backend/index.d.ts +15 -9
  14. package/dist/cjs/backend/index.js +13 -13
  15. package/dist/cjs/backend/index.test.js +102 -102
  16. package/dist/cjs/bundle/index.d.ts +8 -0
  17. package/dist/cjs/bundle/index.js +38 -24
  18. package/dist/cjs/caller/index.js +43 -43
  19. package/dist/cjs/check/index.d.ts +20 -9
  20. package/dist/cjs/check/index.js +113 -88
  21. package/dist/cjs/check/start/routeTree.d.ts +8 -0
  22. package/dist/cjs/check/start/routeTree.js +118 -0
  23. package/dist/cjs/check/start/tsgo.d.ts +2 -0
  24. package/dist/cjs/check/start/tsgo.js +35 -0
  25. package/dist/cjs/cli.js +10 -4
  26. package/dist/cjs/client/index.d.ts +26 -2
  27. package/dist/cjs/client/index.js +25 -25
  28. package/dist/cjs/dev/index.js +79 -54
  29. package/dist/cjs/dev/signin.d.ts +16 -0
  30. package/dist/cjs/dev/signin.js +84 -0
  31. package/dist/cjs/index.d.ts +5 -5
  32. package/dist/cjs/integrations/client.d.ts +3 -3
  33. package/dist/cjs/integrations/client.js +5 -4
  34. package/dist/cjs/integrations/client.test-d.js +15 -15
  35. package/dist/cjs/integrations/index.d.ts +2 -2
  36. package/dist/cjs/integrations/rules.d.ts +1 -0
  37. package/dist/cjs/integrations/rules.js +48 -43
  38. package/dist/cjs/integrations/rules.test.js +60 -54
  39. package/dist/cjs/internal/appMode.d.ts +14 -0
  40. package/dist/cjs/internal/appMode.js +19 -0
  41. package/dist/cjs/internal/env.js +3 -2
  42. package/dist/cjs/internal/platformFetch.d.ts +2 -0
  43. package/dist/cjs/internal/platformFetch.js +14 -0
  44. package/dist/cjs/internal/reservedIds.d.ts +8 -0
  45. package/dist/cjs/internal/reservedIds.js +14 -0
  46. package/dist/cjs/internal/serviceUrls.d.ts +5 -0
  47. package/dist/cjs/internal/serviceUrls.js +14 -0
  48. package/dist/cjs/pdf/index.js +2 -1
  49. package/dist/cjs/runtime/filterConditionTypes.test-d.js +11 -11
  50. package/dist/cjs/runtime/index.d.ts +126 -39
  51. package/dist/cjs/runtime/index.js +32 -26
  52. package/dist/cjs/runtime/index.test.js +34 -34
  53. package/dist/cjs/runtime/sendEmailParamsTypes.test-d.js +50 -0
  54. package/dist/cjs/runtime/writeResultTypes.test-d.js +8 -8
  55. package/dist/cjs/sourceRoots.js +15 -15
  56. package/dist/cjs/sourceRoots.test.js +29 -27
  57. package/dist/cjs/start/{entries.d.ts → build/entries.d.ts} +9 -4
  58. package/dist/cjs/start/{entries.js → build/entries.js} +38 -21
  59. package/dist/cjs/start/build/placeholders/devApp.d.ts +1 -0
  60. package/dist/cjs/start/build/placeholders/devApp.js +6 -0
  61. package/dist/cjs/start/{describeBuilt.d.ts → describe/describeBuilt.d.ts} +2 -0
  62. package/dist/cjs/start/{describeBuilt.js → describe/describeBuilt.js} +55 -17
  63. package/dist/cjs/start/platform/aiUsage.d.ts +29 -0
  64. package/dist/cjs/start/platform/aiUsage.js +215 -0
  65. package/dist/cjs/start/platform/airtable/cache.d.ts +17 -0
  66. package/dist/cjs/start/platform/airtable/cache.js +93 -0
  67. package/dist/cjs/start/protocol.d.ts +19 -0
  68. package/dist/cjs/start/protocol.js +33 -0
  69. package/dist/cjs/start/serve/local/provider.d.ts +25 -0
  70. package/dist/cjs/start/serve/local/provider.js +196 -0
  71. package/dist/cjs/start/serve/provider.d.ts +19 -0
  72. package/dist/cjs/start/serve/provider.js +86 -0
  73. package/dist/cjs/start/types.d.ts +373 -0
  74. package/dist/cjs/start/types.js +2 -0
  75. package/dist/cjs/steps/index.d.ts +78 -0
  76. package/dist/cjs/steps/index.js +507 -0
  77. package/dist/cjs/steps/index.test.js +635 -0
  78. package/dist/cjs/sync/index.d.ts +1 -1
  79. package/dist/cjs/sync/index.js +28 -27
  80. package/dist/cjs/sync/lib.d.ts +15 -8
  81. package/dist/cjs/sync/lib.js +655 -655
  82. package/dist/cjs/sync/lib.test.js +177 -46
  83. package/dist/cjs/sync/sdkNames.d.ts +67 -9
  84. package/dist/cjs/sync/sdkNames.js +97 -31
  85. package/dist/cjs/sync/sdkNames.test.js +189 -113
  86. package/dist/cjs/types/fields.d.ts +9 -2
  87. package/dist/cjs/types/fields.js +110 -96
  88. package/dist/cjs/types/index.d.ts +2 -2
  89. package/dist/cjs/types/tables.d.ts +17 -1
  90. package/dist/cjs/upload/index.js +89 -24
  91. package/dist/cjs/upload/index.test.js +104 -1
  92. package/dist/cjs/vite/domTagNames.js +252 -252
  93. package/dist/cjs/vite/index.d.ts +1 -1
  94. package/dist/cjs/vite/index.js +46 -42
  95. package/dist/esm/auth/actions.d.ts +28 -0
  96. package/dist/esm/auth/actions.js +55 -0
  97. package/dist/esm/auth/client.d.ts +357 -0
  98. package/dist/esm/auth/client.js +62 -0
  99. package/dist/esm/auth/config.js +9 -3
  100. package/dist/esm/auth/index.d.ts +2 -249
  101. package/dist/esm/auth/index.js +2 -103
  102. package/dist/esm/auth/index.test.js +60 -0
  103. package/dist/esm/auth/previewClaim.d.ts +7 -0
  104. package/dist/esm/auth/previewClaim.js +12 -0
  105. package/dist/esm/auth/profileUpdates.d.ts +9 -0
  106. package/dist/esm/auth/profileUpdates.js +6 -0
  107. package/dist/esm/backend/index.d.ts +15 -9
  108. package/dist/esm/backend/index.js +13 -13
  109. package/dist/esm/backend/index.test.js +106 -106
  110. package/dist/esm/bundle/index.d.ts +8 -0
  111. package/dist/esm/bundle/index.js +37 -24
  112. package/dist/esm/caller/index.js +44 -44
  113. package/dist/esm/check/index.d.ts +20 -9
  114. package/dist/esm/check/index.js +117 -93
  115. package/dist/esm/check/start/routeTree.d.ts +8 -0
  116. package/dist/esm/check/start/routeTree.js +77 -0
  117. package/dist/esm/check/start/tsgo.d.ts +2 -0
  118. package/dist/esm/check/start/tsgo.js +29 -0
  119. package/dist/esm/cli.js +10 -4
  120. package/dist/esm/client/index.d.ts +26 -2
  121. package/dist/esm/client/index.js +25 -25
  122. package/dist/esm/dev/index.js +86 -61
  123. package/dist/esm/dev/signin.d.ts +16 -0
  124. package/dist/esm/dev/signin.js +80 -0
  125. package/dist/esm/index.d.ts +5 -5
  126. package/dist/esm/index.js +3 -3
  127. package/dist/esm/integrations/client.d.ts +3 -3
  128. package/dist/esm/integrations/client.js +6 -5
  129. package/dist/esm/integrations/client.test-d.js +19 -19
  130. package/dist/esm/integrations/index.d.ts +2 -2
  131. package/dist/esm/integrations/index.js +1 -1
  132. package/dist/esm/integrations/rules.d.ts +1 -0
  133. package/dist/esm/integrations/rules.js +48 -43
  134. package/dist/esm/integrations/rules.test.js +62 -56
  135. package/dist/esm/internal/appMode.d.ts +14 -0
  136. package/dist/esm/internal/appMode.js +13 -0
  137. package/dist/esm/internal/env.js +3 -2
  138. package/dist/esm/internal/platformFetch.d.ts +2 -0
  139. package/dist/esm/internal/platformFetch.js +9 -0
  140. package/dist/esm/internal/reservedIds.d.ts +8 -0
  141. package/dist/esm/internal/reservedIds.js +10 -0
  142. package/dist/esm/internal/serviceUrls.d.ts +5 -0
  143. package/dist/esm/internal/serviceUrls.js +10 -0
  144. package/dist/esm/pdf/index.js +2 -1
  145. package/dist/esm/runtime/filterConditionTypes.test-d.js +12 -12
  146. package/dist/esm/runtime/index.d.ts +126 -39
  147. package/dist/esm/runtime/index.js +35 -29
  148. package/dist/esm/runtime/index.test.js +36 -36
  149. package/dist/esm/runtime/sendEmailParamsTypes.test-d.d.ts +1 -0
  150. package/dist/esm/runtime/sendEmailParamsTypes.test-d.js +48 -0
  151. package/dist/esm/runtime/writeResultTypes.test-d.js +9 -9
  152. package/dist/esm/signin/conformance.d.ts +100 -0
  153. package/dist/esm/signin/conformance.js +616 -0
  154. package/dist/esm/signin/cookies.d.ts +28 -0
  155. package/dist/esm/signin/cookies.js +67 -0
  156. package/dist/esm/signin/encoding.d.ts +1 -0
  157. package/dist/esm/signin/encoding.js +12 -0
  158. package/dist/esm/signin/endpoints.d.ts +12 -0
  159. package/dist/esm/signin/endpoints.js +32 -0
  160. package/dist/esm/signin/http.d.ts +25 -0
  161. package/dist/esm/signin/http.js +106 -0
  162. package/dist/esm/signin/index.d.ts +8 -0
  163. package/dist/esm/signin/index.js +9 -0
  164. package/dist/esm/signin/keys.d.ts +35 -0
  165. package/dist/esm/signin/keys.js +230 -0
  166. package/dist/esm/signin/paths.d.ts +2 -0
  167. package/dist/esm/signin/paths.js +5 -0
  168. package/dist/esm/signin/seal.d.ts +19 -0
  169. package/dist/esm/signin/seal.js +47 -0
  170. package/dist/esm/signin/signin.d.ts +60 -0
  171. package/dist/esm/signin/signin.js +447 -0
  172. package/dist/esm/signin/transport.d.ts +112 -0
  173. package/dist/esm/signin/transport.js +1 -0
  174. package/dist/esm/signin/verifier.d.ts +2 -0
  175. package/dist/esm/signin/verifier.js +4 -0
  176. package/dist/esm/signin/verify.d.ts +83 -0
  177. package/dist/esm/signin/verify.js +142 -0
  178. package/dist/esm/sourceRoots.js +17 -17
  179. package/dist/esm/sourceRoots.test.js +34 -32
  180. package/dist/esm/start/access.d.ts +19 -0
  181. package/dist/esm/start/access.js +43 -0
  182. package/dist/esm/start/auth.d.ts +28 -0
  183. package/dist/esm/start/auth.js +33 -0
  184. package/dist/esm/start/automations/quiet.d.ts +2 -0
  185. package/dist/esm/start/automations/quiet.js +36 -0
  186. package/dist/esm/start/{registration.d.ts → automations/registration.d.ts} +1 -1
  187. package/dist/esm/start/{registration.js → automations/registration.js} +11 -7
  188. package/dist/esm/start/automations/steps.d.ts +29 -0
  189. package/dist/esm/start/automations/steps.js +95 -0
  190. package/dist/esm/start/automations/workflow.d.ts +83 -0
  191. package/dist/esm/start/automations/workflow.js +36 -0
  192. package/dist/esm/start/automations/workflow.test-d.d.ts +1 -0
  193. package/dist/esm/start/automations/workflow.test-d.js +130 -0
  194. package/dist/esm/start/automations/workflowRun.d.ts +130 -0
  195. package/dist/esm/start/automations/workflowRun.js +185 -0
  196. package/dist/esm/start/barrel.test-d.d.ts +10 -0
  197. package/dist/esm/start/barrel.test-d.js +6 -0
  198. package/dist/esm/start/{entries.d.ts → build/entries.d.ts} +9 -4
  199. package/dist/esm/start/{entries.js → build/entries.js} +38 -22
  200. package/dist/esm/start/build/placeholders/devApp.d.ts +1 -0
  201. package/dist/esm/start/build/placeholders/devApp.js +3 -0
  202. package/dist/esm/start/build/placeholders/devSignIn.d.ts +1 -0
  203. package/dist/esm/start/build/placeholders/devSignIn.js +3 -0
  204. package/dist/esm/start/build/placeholders/siteHead.d.ts +2 -0
  205. package/dist/esm/start/build/placeholders/siteHead.js +3 -0
  206. package/dist/esm/start/{workflowModules.js → build/placeholders/workflowModules.js} +1 -1
  207. package/dist/esm/start/build/placeholders/workspaceSchema.d.ts +2 -0
  208. package/dist/esm/start/build/placeholders/workspaceSchema.js +3 -0
  209. package/dist/esm/start/build/registrationHash.d.ts +11 -0
  210. package/dist/esm/start/build/registrationHash.js +88 -0
  211. package/dist/esm/start/build/sdk/axios.d.ts +76 -0
  212. package/dist/esm/start/build/sdk/axios.js +253 -0
  213. package/dist/esm/start/build/sdk/nodeFetch.d.ts +41 -0
  214. package/dist/esm/start/build/sdk/nodeFetch.js +35 -0
  215. package/dist/esm/start/build/sdk/undici.d.ts +34 -0
  216. package/dist/esm/start/build/sdk/undici.js +18 -0
  217. package/dist/esm/start/build/sdkPatches.d.ts +22 -0
  218. package/dist/esm/start/build/sdkPatches.js +430 -0
  219. package/dist/esm/start/build/siteHead.d.ts +26 -0
  220. package/dist/esm/start/build/siteHead.js +88 -0
  221. package/dist/esm/start/build/vite.d.ts +50 -0
  222. package/dist/esm/start/build/vite.js +487 -0
  223. package/dist/esm/start/classicOnly.d.ts +1 -0
  224. package/dist/esm/start/classicOnly.js +4 -0
  225. package/dist/esm/start/{describe.d.ts → describe/describe.d.ts} +44 -9
  226. package/dist/esm/start/describe/describe.js +372 -0
  227. package/dist/esm/start/{describeBuilt.d.ts → describe/describeBuilt.d.ts} +2 -0
  228. package/dist/esm/start/describe/describeBuilt.js +102 -0
  229. package/dist/esm/start/{descriptions.js → describe/descriptions.js} +17 -10
  230. package/dist/esm/start/errors.d.ts +15 -4
  231. package/dist/esm/start/errors.js +87 -28
  232. package/dist/esm/start/errors.test.js +47 -16
  233. package/dist/esm/start/factories.d.ts +14 -0
  234. package/dist/esm/start/factories.js +23 -0
  235. package/dist/esm/start/factories.test-d.d.ts +2 -1
  236. package/dist/esm/start/factories.test-d.js +52 -12
  237. package/dist/esm/start/failures.d.ts +7 -0
  238. package/dist/esm/start/failures.js +62 -0
  239. package/dist/esm/start/fnFactory.d.ts +16 -0
  240. package/dist/esm/start/fnFactory.js +1 -0
  241. package/dist/esm/start/host.d.ts +2 -2
  242. package/dist/esm/start/host.js +3 -3
  243. package/dist/esm/start/index.d.ts +10 -66
  244. package/dist/esm/start/index.js +7 -146
  245. package/dist/esm/start/login.d.ts +5 -0
  246. package/dist/esm/start/login.js +29 -0
  247. package/dist/esm/start/middlewareKind.d.ts +13 -0
  248. package/dist/esm/start/middlewareKind.js +9 -0
  249. package/dist/esm/start/platform/aiUsage.d.ts +29 -0
  250. package/dist/esm/start/platform/aiUsage.js +210 -0
  251. package/dist/esm/start/platform/airtable/built.d.ts +2 -0
  252. package/dist/esm/start/platform/airtable/built.js +3 -0
  253. package/dist/esm/start/platform/airtable/cache.d.ts +17 -0
  254. package/dist/esm/start/platform/airtable/cache.js +89 -0
  255. package/dist/esm/start/{airtable → platform/airtable}/dispatch.d.ts +5 -2
  256. package/dist/esm/start/{airtable → platform/airtable}/dispatch.js +195 -119
  257. package/dist/esm/start/{airtable → platform/airtable}/formulas.d.ts +2 -1
  258. package/dist/esm/start/{airtable → platform/airtable}/formulas.js +51 -25
  259. package/dist/esm/start/platform/airtable/index.d.ts +6 -0
  260. package/dist/esm/start/platform/airtable/index.js +51 -0
  261. package/dist/esm/start/platform/airtable/settings.d.ts +37 -0
  262. package/dist/esm/start/platform/airtable/settings.js +138 -0
  263. package/dist/esm/start/platform/analytics.d.ts +3 -0
  264. package/dist/esm/start/platform/analytics.js +59 -0
  265. package/dist/esm/start/platform/calls.d.ts +5 -0
  266. package/dist/esm/start/platform/calls.js +104 -0
  267. package/dist/esm/start/platform/caps.d.ts +9 -0
  268. package/dist/esm/start/platform/caps.js +35 -0
  269. package/dist/esm/start/platform/connections.d.ts +25 -0
  270. package/dist/esm/start/platform/connections.js +198 -0
  271. package/dist/esm/start/{data → platform/data}/baseRunner.d.ts +11 -6
  272. package/dist/esm/start/platform/data/baseRunner.js +117 -0
  273. package/dist/esm/start/{data → platform/data}/dispatch.d.ts +3 -2
  274. package/dist/esm/start/{data → platform/data}/dispatch.js +69 -51
  275. package/dist/esm/start/platform/data/fetch.d.ts +7 -0
  276. package/dist/esm/start/platform/data/fetch.js +9 -0
  277. package/dist/esm/start/platform/data/index.d.ts +27 -0
  278. package/dist/esm/start/platform/data/index.js +75 -0
  279. package/dist/esm/start/platform/data/names.d.ts +7 -0
  280. package/dist/esm/start/platform/data/names.js +18 -0
  281. package/dist/esm/start/{data → platform/data}/transformations.d.ts +0 -31
  282. package/dist/esm/start/{data → platform/data}/transformations.js +0 -56
  283. package/dist/esm/start/{data → platform/data}/types.d.ts +4 -1
  284. package/dist/esm/start/{data → platform/data}/types.js +2 -2
  285. package/dist/esm/start/platform/local.d.ts +6 -0
  286. package/dist/esm/start/platform/local.js +18 -0
  287. package/dist/esm/start/platform/meta.d.ts +3 -0
  288. package/dist/esm/start/platform/meta.js +33 -0
  289. package/dist/esm/start/platform/outbound.d.ts +17 -0
  290. package/dist/esm/start/platform/outbound.js +510 -0
  291. package/dist/esm/start/platform/redactSecrets.d.ts +13 -0
  292. package/dist/esm/start/{redactSecrets.js → platform/redactSecrets.js} +32 -7
  293. package/dist/esm/start/platform/redactSecrets.test.d.ts +1 -0
  294. package/dist/esm/start/platform/requestSecrets.d.ts +15 -0
  295. package/dist/esm/start/platform/requestSecrets.js +41 -0
  296. package/dist/esm/start/platform/runLog.d.ts +40 -0
  297. package/dist/esm/start/platform/runLog.js +149 -0
  298. package/dist/esm/start/platform/services.d.ts +7 -0
  299. package/dist/esm/start/platform/services.js +46 -0
  300. package/dist/esm/start/platform/steps.d.ts +9 -0
  301. package/dist/esm/start/platform/steps.js +60 -0
  302. package/dist/esm/start/platform/telemetry.d.ts +13 -0
  303. package/dist/esm/start/platform/telemetry.js +71 -0
  304. package/dist/esm/start/platform/transport.d.ts +28 -0
  305. package/dist/esm/start/platform/transport.js +59 -0
  306. package/dist/esm/start/platformHead.d.ts +23 -0
  307. package/dist/esm/start/platformHead.js +133 -0
  308. package/dist/esm/start/previewClaim.d.ts +3 -7
  309. package/dist/esm/start/previewClaim.js +9 -17
  310. package/dist/esm/start/protocol.d.ts +19 -0
  311. package/dist/esm/start/protocol.js +27 -0
  312. package/dist/esm/start/roles.d.ts +12 -0
  313. package/dist/esm/start/roles.js +27 -0
  314. package/dist/esm/start/router.d.ts +27 -4
  315. package/dist/esm/start/router.js +221 -22
  316. package/dist/esm/start/serve/authHooks.js +18 -0
  317. package/dist/esm/start/serve/demo.d.ts +9 -0
  318. package/dist/esm/start/serve/demo.js +24 -0
  319. package/dist/esm/start/serve/fetch.d.ts +1 -0
  320. package/dist/esm/start/serve/fetch.js +6 -0
  321. package/dist/esm/start/{instance.d.ts → serve/instance.d.ts} +6 -5
  322. package/dist/esm/start/serve/instance.js +134 -0
  323. package/dist/esm/start/serve/invoke.d.ts +13 -0
  324. package/dist/esm/start/serve/invoke.js +126 -0
  325. package/dist/esm/start/serve/local/load.d.ts +8 -0
  326. package/dist/esm/start/serve/local/load.js +44 -0
  327. package/dist/esm/start/serve/local/provider.d.ts +25 -0
  328. package/dist/esm/start/serve/local/provider.js +188 -0
  329. package/dist/esm/start/serve/local/signIn.d.ts +28 -0
  330. package/dist/esm/start/serve/local/signIn.js +123 -0
  331. package/dist/esm/start/serve/pageHead.d.ts +20 -0
  332. package/dist/esm/start/serve/pageHead.js +34 -0
  333. package/dist/esm/start/serve/provider.d.ts +19 -0
  334. package/dist/esm/start/serve/provider.js +78 -0
  335. package/dist/esm/start/serve/requestEnv.d.ts +2 -0
  336. package/dist/esm/start/serve/requestEnv.js +84 -0
  337. package/dist/esm/start/serve/scope.d.ts +18 -0
  338. package/dist/esm/start/serve/scope.js +67 -0
  339. package/dist/esm/start/serve/server.d.ts +56 -0
  340. package/dist/esm/start/serve/server.js +297 -0
  341. package/dist/esm/start/serve/uploads.d.ts +2 -0
  342. package/dist/esm/start/serve/uploads.js +49 -0
  343. package/dist/esm/start/serve/worker.d.ts +6 -0
  344. package/dist/esm/start/serve/worker.js +12 -0
  345. package/dist/esm/start/types.d.ts +270 -56
  346. package/dist/esm/start/version.d.ts +1 -1
  347. package/dist/esm/start/version.js +1 -1
  348. package/dist/esm/steps/index.d.ts +78 -0
  349. package/dist/esm/steps/index.js +502 -0
  350. package/dist/esm/steps/index.test.d.ts +1 -0
  351. package/dist/esm/steps/index.test.js +633 -0
  352. package/dist/esm/sync/index.d.ts +1 -1
  353. package/dist/esm/sync/index.js +32 -31
  354. package/dist/esm/sync/lib.d.ts +15 -8
  355. package/dist/esm/sync/lib.js +659 -659
  356. package/dist/esm/sync/lib.test.js +177 -46
  357. package/dist/esm/sync/sdkNames.d.ts +67 -9
  358. package/dist/esm/sync/sdkNames.js +94 -30
  359. package/dist/esm/sync/sdkNames.test.js +192 -116
  360. package/dist/esm/types/fields.d.ts +9 -2
  361. package/dist/esm/types/fields.js +110 -96
  362. package/dist/esm/types/index.d.ts +2 -2
  363. package/dist/esm/types/index.js +2 -2
  364. package/dist/esm/types/tables.d.ts +17 -1
  365. package/dist/esm/types/tables.js +2 -2
  366. package/dist/esm/upload/index.js +89 -24
  367. package/dist/esm/upload/index.test.js +104 -1
  368. package/dist/esm/vite/domTagNames.js +252 -252
  369. package/dist/esm/vite/index.d.ts +1 -1
  370. package/dist/esm/vite/index.js +51 -47
  371. package/package.json +95 -37
  372. package/dist/cjs/auth-server/index.d.ts +0 -369
  373. package/dist/cjs/auth-server/index.js +0 -119
  374. package/dist/cjs/check/start/describeRules.d.ts +0 -35
  375. package/dist/cjs/check/start/describeRules.js +0 -89
  376. package/dist/cjs/check/start/problem.d.ts +0 -11
  377. package/dist/cjs/check/start/problem.js +0 -5
  378. package/dist/cjs/check/start/sourceRules.d.ts +0 -3
  379. package/dist/cjs/check/start/sourceRules.js +0 -441
  380. package/dist/cjs/start/problems.d.ts +0 -19
  381. package/dist/cjs/start/problems.js +0 -11
  382. package/dist/esm/auth-server/index.d.ts +0 -369
  383. package/dist/esm/auth-server/index.js +0 -116
  384. package/dist/esm/check/start/describeRules.d.ts +0 -35
  385. package/dist/esm/check/start/describeRules.js +0 -86
  386. package/dist/esm/check/start/problem.d.ts +0 -11
  387. package/dist/esm/check/start/problem.js +0 -1
  388. package/dist/esm/check/start/sourceRules.d.ts +0 -3
  389. package/dist/esm/check/start/sourceRules.js +0 -438
  390. package/dist/esm/start/airtable/index.d.ts +0 -11
  391. package/dist/esm/start/airtable/index.js +0 -70
  392. package/dist/esm/start/authHooks.js +0 -10
  393. package/dist/esm/start/data/baseRunner.js +0 -83
  394. package/dist/esm/start/data/index.d.ts +0 -18
  395. package/dist/esm/start/data/index.js +0 -76
  396. package/dist/esm/start/describe.js +0 -204
  397. package/dist/esm/start/describeBuilt.js +0 -66
  398. package/dist/esm/start/instance.js +0 -80
  399. package/dist/esm/start/problems.d.ts +0 -19
  400. package/dist/esm/start/problems.js +0 -8
  401. package/dist/esm/start/redactSecrets.d.ts +0 -7
  402. package/dist/esm/start/runLog.d.ts +0 -8
  403. package/dist/esm/start/runLog.js +0 -76
  404. package/dist/esm/start/scope.d.ts +0 -15
  405. package/dist/esm/start/scope.js +0 -58
  406. package/dist/esm/start/server.d.ts +0 -55
  407. package/dist/esm/start/server.js +0 -317
  408. package/dist/esm/start/vite.d.ts +0 -9
  409. package/dist/esm/start/vite.js +0 -173
  410. package/dist/esm/start/worker.d.ts +0 -11
  411. package/dist/esm/start/worker.js +0 -20
  412. package/dist/esm/start/workflow.d.ts +0 -53
  413. package/dist/esm/start/workflow.js +0 -13
  414. package/dist/esm/start/workflow.test-d.js +0 -44
  415. package/dist/esm/start/workflowRun.d.ts +0 -80
  416. package/dist/esm/start/workflowRun.js +0 -108
  417. /package/dist/{esm/start/redactSecrets.test.d.ts → cjs/runtime/sendEmailParamsTypes.test-d.d.ts} +0 -0
  418. /package/dist/{esm/start/workflow.test-d.d.ts → cjs/steps/index.test.d.ts} +0 -0
  419. /package/dist/esm/start/{authHooksModule.d.ts → build/placeholders/authHooksModule.d.ts} +0 -0
  420. /package/dist/esm/start/{authHooksModule.js → build/placeholders/authHooksModule.js} +0 -0
  421. /package/dist/esm/start/{workflowModules.d.ts → build/placeholders/workflowModules.d.ts} +0 -0
  422. /package/dist/esm/start/{descriptions.d.ts → describe/descriptions.d.ts} +0 -0
  423. /package/dist/esm/start/{airtable → platform/airtable}/arrayFields.d.ts +0 -0
  424. /package/dist/esm/start/{airtable → platform/airtable}/arrayFields.js +0 -0
  425. /package/dist/esm/start/{data → platform/data}/sqlNameMappings.d.ts +0 -0
  426. /package/dist/esm/start/{data → platform/data}/sqlNameMappings.js +0 -0
  427. /package/dist/esm/start/{redactSecrets.test.js → platform/redactSecrets.test.js} +0 -0
  428. /package/dist/esm/start/{authHooks.d.ts → serve/authHooks.d.ts} +0 -0
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.localPlatform = exports.describeDevToken = exports.mintDevToken = exports.resetDevToken = exports.localUrls = exports.LOCAL_ENV = void 0;
4
+ // `local`: a developer's machine, with a dev token the backend minted, which the backend also describes.
5
+ const platformFetch_js_1 = require("../../../internal/platformFetch.js");
6
+ const devApp_js_1 = require("../../build/placeholders/devApp.js");
7
+ const provider_js_1 = require("../provider.js");
8
+ /** What `local` reads, documented in `zitejs`'s help. */
9
+ exports.LOCAL_ENV = {
10
+ token: 'ZITE_DEV_TOKEN',
11
+ apiKey: 'ZITE_DEV_API_KEY',
12
+ urls: 'ZITE_URLS',
13
+ user: 'ZITE_DEV_USER',
14
+ };
15
+ const processEnv = () => globalThis.process?.env;
16
+ // `local` may leave out the gateway (a call on Zite's AI key is then refused), `runs` (a preview sends no analytics,
17
+ // and `local` keeps no run detail) and each service's own URL.
18
+ const OPTIONAL_URLS = new Set([
19
+ 'gateway',
20
+ 'runs',
21
+ 'email',
22
+ 'pdf',
23
+ 'uploads',
24
+ 'steps',
25
+ 'schedules',
26
+ ]);
27
+ // Where the backend `ZITE_URLS` names answers a service it doesn't name. A dev token runs no workflow, so no steps.
28
+ const BACKEND_SERVICE_ROUTES = {
29
+ email: '/v1/start/app/email',
30
+ pdf: '/v1/start/app/pdf',
31
+ uploads: '/v1/start/app/uploads/session',
32
+ schedules: '/v1/start/app/schedules',
33
+ };
34
+ /** `ZITE_URLS`, or a throw saying what it must name. */
35
+ const localUrls = (raw) => {
36
+ let parsed;
37
+ try {
38
+ parsed = JSON.parse(raw ?? '');
39
+ }
40
+ catch {
41
+ parsed = undefined;
42
+ }
43
+ const given = (parsed ?? {});
44
+ const isUrl = (value) => typeof value === 'string' && /^https?:\/\//.test(value);
45
+ if (provider_js_1.URL_NAMES.some(name => given[name] === undefined
46
+ ? !OPTIONAL_URLS.has(name)
47
+ : !isUrl(given[name]))) {
48
+ throw new Error(`${exports.LOCAL_ENV.urls} must be JSON naming the baseRunner and backend URLs, and may name gateway, runs, email, pdf, uploads, steps and schedules`);
49
+ }
50
+ const urls = (0, provider_js_1.trimmed)(given);
51
+ const defaults = Object.fromEntries(Object.entries(BACKEND_SERVICE_ROUTES).map(([name, route]) => [
52
+ name,
53
+ `${urls.backend}${route}`,
54
+ ]));
55
+ return { ...defaults, ...urls };
56
+ };
57
+ exports.localUrls = localUrls;
58
+ const localUser = (raw) => {
59
+ if (!raw)
60
+ return null;
61
+ let given;
62
+ try {
63
+ given = JSON.parse(raw);
64
+ }
65
+ catch {
66
+ given = undefined;
67
+ }
68
+ if (typeof given?.id !== 'string' || typeof given.email !== 'string') {
69
+ throw new Error(`${exports.LOCAL_ENV.user} must be JSON with the stand-in user's id and email`);
70
+ }
71
+ const roles = Array.isArray(given.roles) ? given.roles : [];
72
+ return {
73
+ id: given.id,
74
+ email: given.email,
75
+ name: typeof given.name === 'string' ? given.name : given.email,
76
+ roles: roles.map((role) => typeof role === 'string' ? { id: role, name: role } : role),
77
+ isInternal: given.isInternal === true,
78
+ };
79
+ };
80
+ // The backend mints them for 15 minutes.
81
+ const RENEW_DEV_TOKEN_WITHIN_MS = 60_000;
82
+ const BACKEND_TIMEOUT_MS = 10_000;
83
+ // Per isolate, only answers, never a pending call: Workers ties a request's I/O to that request.
84
+ let held;
85
+ let described;
86
+ /** For tests: forget the minted dev token and what the backend said of it. */
87
+ const resetDevToken = () => {
88
+ held = undefined;
89
+ described = undefined;
90
+ };
91
+ exports.resetDevToken = resetDevToken;
92
+ const reasonOf = (response, answer) => {
93
+ const why = [answer?.message, answer?.error].find(text => typeof text === 'string');
94
+ return `${response.status}${why ? ` ${why}` : ''}`;
95
+ };
96
+ const mintDevToken = async (backend, appId, apiKey) => {
97
+ const response = await (0, platformFetch_js_1.platformFetch)(new Request(`${backend}/v1/start/apps/${encodeURIComponent(appId)}/dev-token`, {
98
+ method: 'POST',
99
+ headers: { authorization: `Bearer ${apiKey}` },
100
+ signal: AbortSignal.timeout(BACKEND_TIMEOUT_MS),
101
+ }));
102
+ const answer = (await response.json().catch(() => null));
103
+ if (response.ok && (0, provider_js_1.isExpiringToken)(answer))
104
+ return { token: answer.token, expiresAt: answer.expiresAt };
105
+ throw new Error(`The backend didn't mint a dev token for app ${appId} with ${exports.LOCAL_ENV.apiKey}: ${reasonOf(response, answer)}`);
106
+ };
107
+ exports.mintDevToken = mintDevToken;
108
+ const MODES = new Set([
109
+ 'live',
110
+ 'preview',
111
+ 'demo',
112
+ ]);
113
+ const isWhole = (value) => Number.isSafeInteger(value) && value >= 0;
114
+ const isText = (value) => typeof value === 'string' && value !== '';
115
+ const isTextOrNull = (value) => value === null || isText(value);
116
+ /** The backend's `/context` answer, or undefined when it isn't one. */
117
+ const appContextOf = (answer) => {
118
+ const given = answer;
119
+ if (!given ||
120
+ !isText(given.appId) ||
121
+ !isWhole(given.buildId) ||
122
+ !isTextOrNull(given.baseId) ||
123
+ !MODES.has(given.mode) ||
124
+ !(given.orgSettingsVersion === null || isWhole(given.orgSettingsVersion)) ||
125
+ typeof given.showZiteBadge !== 'boolean' ||
126
+ !isTextOrNull(given.appUrl)) {
127
+ return undefined;
128
+ }
129
+ return (0, provider_js_1.contextOf)(given);
130
+ };
131
+ /**
132
+ * What the backend says of a dev token, from the claims it verified, as OAuth's token introspection answers: asked
133
+ * once per token, whose claims never change. Throws, saying why, when it won't say.
134
+ */
135
+ const describeDevToken = async (backend, token) => {
136
+ const key = `${backend} ${token}`;
137
+ if (described?.key === key)
138
+ return described.context;
139
+ const response = await (0, platformFetch_js_1.platformFetch)(new Request(`${backend}/v1/start/app/context`, {
140
+ headers: { authorization: `Bearer ${token}` },
141
+ signal: AbortSignal.timeout(BACKEND_TIMEOUT_MS),
142
+ }));
143
+ const answer = await response.json().catch(() => null);
144
+ const context = response.ok ? appContextOf(answer) : undefined;
145
+ if (!context)
146
+ throw new Error(`The backend didn't say which app the dev token is for: ${reasonOf(response, answer)}`);
147
+ described = { key, context };
148
+ return context;
149
+ };
150
+ exports.describeDevToken = describeDevToken;
151
+ /** The app's dev token, minted with the developer's key, and minted again when the mint's expiry is near. */
152
+ const mintedDevToken = (backend, appId, apiKey) => {
153
+ const key = `${backend} ${appId} ${apiKey}`;
154
+ const token = (0, provider_js_1.renewedToken)({
155
+ held: () => (held?.key === key ? held.minted : undefined),
156
+ keep: minted => (held = { key, minted }),
157
+ renew: () => (0, exports.mintDevToken)(backend, appId, apiKey),
158
+ withinMs: RENEW_DEV_TOKEN_WITHIN_MS,
159
+ });
160
+ return async () => {
161
+ const minted = await token();
162
+ if (!minted)
163
+ throw new Error(`The backend didn't mint a dev token for app ${appId}`);
164
+ return minted;
165
+ };
166
+ };
167
+ // A given dev token is used as it is. A key mints them only under `vite dev`, which knows the app's id.
168
+ const localToken = (env, appId) => {
169
+ const given = env[exports.LOCAL_ENV.token];
170
+ if (given)
171
+ return () => async () => given;
172
+ const apiKey = env[exports.LOCAL_ENV.apiKey];
173
+ return apiKey && appId
174
+ ? backend => mintedDevToken(backend, appId, apiKey)
175
+ : undefined;
176
+ };
177
+ /**
178
+ * `local` when the developer set a dev token, or a key to mint them with, else undefined. Throws on env it can't read,
179
+ * so a typo fails loudly rather than signing nobody in.
180
+ */
181
+ const localPlatform = (env = processEnv() ?? {}, appId = devApp_js_1.devAppId) => {
182
+ const token = localToken(env, appId);
183
+ if (!token)
184
+ return undefined;
185
+ const urls = (0, exports.localUrls)(env[exports.LOCAL_ENV.urls]);
186
+ const user = localUser(env[exports.LOCAL_ENV.user]);
187
+ const tokenOf = token(urls.backend);
188
+ return {
189
+ kind: 'local',
190
+ urls,
191
+ user: () => user,
192
+ token: tokenOf,
193
+ context: async () => (0, exports.describeDevToken)(urls.backend, await tokenOf()),
194
+ };
195
+ };
196
+ exports.localPlatform = localPlatform;
@@ -0,0 +1,19 @@
1
+ import type { AppContext, ExpiringToken, HostProps, PlatformProvider, PlatformUrls } from '../types.js';
2
+ export declare const isExpiringToken: (value: unknown) => value is ExpiringToken;
3
+ /**
4
+ * The token to send: the one held until its expiry is near, then a renewed one. Callers at once share one renewal,
5
+ * and one that fails keeps the held token while it still serves.
6
+ */
7
+ export declare const renewedToken: ({ held, keep, renew, withinMs, }: {
8
+ held: () => {
9
+ token: string;
10
+ expiresAt?: number;
11
+ } | undefined;
12
+ keep: (fresh: ExpiringToken) => void;
13
+ renew: () => Promise<ExpiringToken | null>;
14
+ withinMs: number;
15
+ }) => (() => Promise<string | undefined>);
16
+ export declare const contextOf: ({ appId, buildId, baseId, mode, orgSettingsVersion, showZiteBadge, appUrl, }: AppContext) => AppContext;
17
+ export declare const URL_NAMES: readonly ["baseRunner", "backend", "gateway", "runs", "email", "pdf", "uploads", "steps", "schedules"];
18
+ export declare const trimmed: (urls: PlatformUrls) => PlatformUrls;
19
+ export declare const ziteProvider: (props: HostProps) => PlatformProvider;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ziteProvider = exports.trimmed = exports.URL_NAMES = exports.contextOf = exports.renewedToken = exports.isExpiringToken = void 0;
4
+ // A streamed answer can outlive the request's deadline, which the token's expiry follows.
5
+ const RENEW_WITHIN_MS = 30_000;
6
+ const expiresWithin = (expiresAt, ms) => expiresAt !== undefined && expiresAt - Date.now() < ms;
7
+ const isExpiringToken = (value) => {
8
+ const given = value;
9
+ return (typeof given?.token === 'string' &&
10
+ given.token !== '' &&
11
+ typeof given.expiresAt === 'number' &&
12
+ Number.isFinite(given.expiresAt));
13
+ };
14
+ exports.isExpiringToken = isExpiringToken;
15
+ /**
16
+ * The token to send: the one held until its expiry is near, then a renewed one. Callers at once share one renewal,
17
+ * and one that fails keeps the held token while it still serves.
18
+ */
19
+ const renewedToken = ({ held, keep, renew, withinMs, }) => {
20
+ let renewing;
21
+ return async () => {
22
+ const current = held();
23
+ if (current && !expiresWithin(current.expiresAt, withinMs))
24
+ return current.token;
25
+ renewing ??= renew()
26
+ .then(fresh => {
27
+ if (fresh)
28
+ keep(fresh);
29
+ }, (error) => {
30
+ if (!current || expiresWithin(current.expiresAt, 0))
31
+ throw error;
32
+ console.error("[zite] couldn't renew the token; using the one held until it expires", error);
33
+ })
34
+ .finally(() => (renewing = undefined));
35
+ await renewing;
36
+ return held()?.token;
37
+ };
38
+ };
39
+ exports.renewedToken = renewedToken;
40
+ const contextOf = ({ appId, buildId, baseId, mode, orgSettingsVersion, showZiteBadge, appUrl, }) => ({
41
+ appId,
42
+ buildId,
43
+ baseId,
44
+ mode,
45
+ orgSettingsVersion,
46
+ showZiteBadge,
47
+ appUrl,
48
+ });
49
+ exports.contextOf = contextOf;
50
+ exports.URL_NAMES = [
51
+ 'baseRunner',
52
+ 'backend',
53
+ 'gateway',
54
+ 'runs',
55
+ 'email',
56
+ 'pdf',
57
+ 'uploads',
58
+ 'steps',
59
+ 'schedules',
60
+ ];
61
+ const trimmed = (urls) => Object.fromEntries(exports.URL_NAMES.flatMap(name => urls[name] ? [[name, urls[name].replace(/\/+$/, '')]] : []));
62
+ exports.trimmed = trimmed;
63
+ const ziteProvider = (props) => {
64
+ let current = props.appToken
65
+ ? { token: props.appToken, expiresAt: props.appTokenExpiresAt }
66
+ : undefined;
67
+ const renewed = (0, exports.renewedToken)({
68
+ held: () => current,
69
+ keep: fresh => (current = fresh),
70
+ renew: async () => {
71
+ const fresh = await props.platform.appToken();
72
+ return (0, exports.isExpiringToken)(fresh) ? fresh : null;
73
+ },
74
+ withinMs: RENEW_WITHIN_MS,
75
+ });
76
+ const context = (0, exports.contextOf)(props);
77
+ return {
78
+ kind: 'zite',
79
+ urls: props.urls && (0, exports.trimmed)(props.urls),
80
+ user: () => props.user,
81
+ context: async () => context,
82
+ // A dispatch with no token has nothing to renew.
83
+ token: async () => (current ? renewed() : undefined),
84
+ };
85
+ };
86
+ exports.ziteProvider = ziteProvider;
@@ -0,0 +1,373 @@
1
+ import type { StepEventStatus, StepSuspension } from '../steps/index.js';
2
+ import type { AiUsageRecord } from './platform/aiUsage.js';
3
+ import type { AirtableCache } from './platform/airtable/cache.js';
4
+ import type { InvokeKind } from './protocol.js';
5
+ export type Role = {
6
+ id: string;
7
+ name: string;
8
+ };
9
+ /** As classic's `context.user`, plus `name`. */
10
+ export type User = {
11
+ id: string;
12
+ email: string;
13
+ /** First and last name, or the email when neither is set. */
14
+ name: string;
15
+ firstName?: string;
16
+ lastName?: string;
17
+ /** The built-in roles, then the ones assigned on the Members tab. */
18
+ roles: ReadonlyArray<Role>;
19
+ /** A member of the workspace's team, not an external user. */
20
+ isInternal: boolean;
21
+ };
22
+ /** One server function call, as the platform's run log shows it. Input and output are truncated JSON. */
23
+ export type RunRecord = {
24
+ fn: string;
25
+ name?: string;
26
+ nested: boolean;
27
+ startedAt: number;
28
+ durationMs: number;
29
+ input?: string;
30
+ output?: string;
31
+ error?: {
32
+ code: string;
33
+ message: string;
34
+ stack?: string;
35
+ };
36
+ /** A workflow's steps, as they ran, replayed or failed. */
37
+ steps?: StepRecord[];
38
+ /** The step a failed workflow stopped in, where a resume picks up. */
39
+ failedStep?: string;
40
+ /** A durable call that stopped short of the end, which the run's next call carries on from. */
41
+ suspended?: StepSuspension;
42
+ };
43
+ /** One step of a workflow call, as zitejs/steps reports it. `failed` marks a replayed final failure. */
44
+ export type StepRecord = {
45
+ name: string;
46
+ status: StepEventStatus;
47
+ durationMs?: number;
48
+ at: number;
49
+ failed?: true;
50
+ wakeAt?: string;
51
+ };
52
+ /**
53
+ * A workflow call the host's run loop calls again, as classic's durable automation calls are: a step that throws with
54
+ * tries left stops the call for a later one instead of reaching the code, and past its budget the call starts no new
55
+ * step. The host sends it on a call it will carry on; without it a run is one call.
56
+ */
57
+ export type DurableCall = {
58
+ /** 1, the default, for the run's first call. A later call throws a step's saved final failure again rather than run it. */
59
+ invocation?: number;
60
+ /** Which try each step that failed in an earlier call is on, from that call's `retry.attempts`; others are on their first. */
61
+ attempts?: Record<string, number>;
62
+ /** How long the call starts new steps for; 60 seconds by default. */
63
+ budgetMs?: number;
64
+ };
65
+ export type AccessKind = 'signedIn' | 'anyone' | 'webhook' | 'workflow';
66
+ /** The access decision a call runs under, and who it was made for. */
67
+ export type AccessScope = {
68
+ kind: AccessKind;
69
+ user: User | null;
70
+ };
71
+ /** One data, integration or email call. Who is calling is the platform's to know, never the app's to say. */
72
+ export type PlatformCallInput = {
73
+ integrationId: string;
74
+ className: string;
75
+ methodName: string;
76
+ params: unknown;
77
+ /** The access decision the call ran under; the platform may narrow on it but never widens. */
78
+ access: AccessKind;
79
+ };
80
+ /** A call's answer. Errors come back as values, so the one the app sees keeps its code. */
81
+ export type PlatformCallResult = {
82
+ value: unknown;
83
+ } | {
84
+ error: {
85
+ code: string;
86
+ message: string;
87
+ userFacingMessage?: string;
88
+ };
89
+ };
90
+ /** One data call the app's own dispatch made, for its run's detail. */
91
+ export type CallRecord = {
92
+ integrationId: string;
93
+ className: string;
94
+ methodName: string;
95
+ at: number;
96
+ durationMs: number;
97
+ inputs?: string;
98
+ outputs?: string;
99
+ error?: {
100
+ code: string;
101
+ message: string;
102
+ };
103
+ };
104
+ /** An outbound fetch, by host and path (never its query), with the connection whose token it carried. */
105
+ export type FetchRecord = {
106
+ at: number;
107
+ method: string;
108
+ /** Whole, with every secret the request knows redacted. */
109
+ url: string;
110
+ /** As classic's run log shows it: cut short, secrets redacted. */
111
+ requestBody?: string;
112
+ status?: number;
113
+ durationMs: number;
114
+ error?: string;
115
+ connection?: string;
116
+ /** Sent again with a refreshed token after a 401. */
117
+ retried?: true;
118
+ /** On Zite's own AI key, which the platform meters itself. */
119
+ ziteAi?: true;
120
+ /** What a call on the org's own AI key used, for analytics. */
121
+ ai?: AiUsageRecord;
122
+ };
123
+ /**
124
+ * Where the platform's services answer this app: `gateway` takes calls on a key Zite pays for, `runs` a live page's
125
+ * analytics and each request's run detail. `email`, `pdf`, `uploads` (the upload session), `steps` (a workflow run's
126
+ * saved steps) and `schedules` are each that service's own endpoint, which the platform picks per workspace and the
127
+ * host names on every dispatch: a call to one it doesn't name fails.
128
+ */
129
+ export type PlatformUrls = {
130
+ baseRunner: string;
131
+ backend: string;
132
+ gateway?: string;
133
+ runs?: string;
134
+ email?: string;
135
+ pdf?: string;
136
+ uploads?: string;
137
+ steps?: string;
138
+ schedules?: string;
139
+ };
140
+ /**
141
+ * Where the platform is for one request, and what reaches it: Zite's dispatcher through props, or a developer's
142
+ * machine through env. The only zitejs code that knows which.
143
+ */
144
+ export type PlatformProvider = {
145
+ kind: 'zite' | 'local';
146
+ /** The request's app token, renewed when it's about to expire; undefined when the host sent none. */
147
+ token(): Promise<string | undefined>;
148
+ /** What the platform says of the request's app and build: the host's props, or `local`'s backend on the dev token. */
149
+ context(): Promise<AppContext>;
150
+ user(): User | null;
151
+ urls: PlatformUrls | undefined;
152
+ };
153
+ /** An app token with its expiry, which travels beside it: zitejs never reads the token itself. */
154
+ export type ExpiringToken = {
155
+ token: string;
156
+ /** Milliseconds since the epoch. */
157
+ expiresAt: number;
158
+ };
159
+ /**
160
+ * What the host hands each request beside its app token: the token's renewal, for an answer that outlives the one it
161
+ * was dispatched with. Its presence in props is what marks a request the host dispatched.
162
+ */
163
+ export type PlatformBinding = {
164
+ /** The request's app token, signed again when it's about to expire; null once it can't be. */
165
+ appToken(): Promise<ExpiringToken | null>;
166
+ };
167
+ /** A demo is the published build serving a read-only visitor: as live, but every write is refused. */
168
+ export type HostMode = 'live' | 'preview' | 'demo' | 'validate';
169
+ /**
170
+ * What the platform's records say of the request's app and build. The platform signs the same into the app token,
171
+ * which zitejs only sends: it learns these from the host's props, or under `vite dev` from the backend.
172
+ */
173
+ export type AppContext = {
174
+ /** The app's public identifier. */
175
+ appId: string;
176
+ /** The build's snapshot id; a dev token's is the app's newest. */
177
+ buildId: number;
178
+ /** The app's database: `process.env.ZITE_BASE_ID`. Null when the app has none. */
179
+ baseId: string | null;
180
+ /** Never `validate`, which no platform serves in. */
181
+ mode: Exclude<HostMode, 'validate'>;
182
+ /** The org settings version the request was served under; null when it couldn't be read. */
183
+ orgSettingsVersion: number | null;
184
+ /** Whether the org's plan shows Zite's badge. */
185
+ showZiteBadge: boolean;
186
+ /** The app's URL, a demo's its own as on classic: `process.env.ZITE_APP_URL`. Null when the platform has none to give. */
187
+ appUrl: string | null;
188
+ };
189
+ /** A web app manifest, as `/manifest.webmanifest` serves an installable app's. */
190
+ export type WebManifest = {
191
+ name: string;
192
+ short_name: string;
193
+ start_url: string;
194
+ scope?: string;
195
+ display: 'standalone';
196
+ background_color: string;
197
+ theme_color: string;
198
+ icons: Array<{
199
+ src: string;
200
+ sizes: string;
201
+ type: 'image/png';
202
+ purpose?: 'any';
203
+ }>;
204
+ };
205
+ /**
206
+ * What the app's Settings put in its pages' heads. On Zite the host sends them with each request, with the platform's
207
+ * fallbacks (the app's name, its screenshot, the brand kit's icon), so a Branding save needs no rebuild; off Zite
208
+ * `zite()` bakes them from zite.config.json.
209
+ */
210
+ export type SiteHead = {
211
+ title?: string;
212
+ description?: string;
213
+ /** The share image. */
214
+ image?: string;
215
+ /** The favicon, which stands for the app over any a page sets. */
216
+ icon?: string;
217
+ /** An installable app's; the favicon stands in otherwise. */
218
+ appleTouchIcon?: string;
219
+ /** An installable app's, served at `/manifest.webmanifest`. */
220
+ manifest?: WebManifest;
221
+ };
222
+ /** `ZiteMeta.getWorkspace()`'s answer: where the app and its workspace are in Zite. */
223
+ export type ZiteWorkspace = {
224
+ workspaceHomeUrl: string;
225
+ editorUrl: string;
226
+ appPublicIdentifier: string;
227
+ projectPublicIdentifier: string;
228
+ };
229
+ /** A marketplace demo's listing, which the platform's runtime shows the visitor. */
230
+ export type DemoListing = {
231
+ listingSlug: string;
232
+ listingUrl: string;
233
+ };
234
+ /** What the host sends with each request for its pages: the app's Settings, and the platform's runtime and demo listing. */
235
+ export type HostPage = SiteHead & {
236
+ /** The platform's runtime script, which the editor's preview and the badge run on. */
237
+ runtimeUrl?: string;
238
+ demo?: DemoListing;
239
+ };
240
+ /** A request's head, as its pages render it and carry it to the browser: the Settings, and the platform's part where it serves the app. */
241
+ export type PlatformHead = {
242
+ site: SiteHead;
243
+ platform?: {
244
+ runtimeUrl?: string;
245
+ demo?: DemoListing;
246
+ /** Zite's badge, as the org's plan says. */
247
+ branding: boolean;
248
+ analytics: {
249
+ appId: string;
250
+ enabled: boolean;
251
+ endpointUrl: string;
252
+ };
253
+ };
254
+ };
255
+ export type HostInvoke = {
256
+ kind: InvokeKind;
257
+ name: string;
258
+ };
259
+ /** One of `integrations.get`'s answers, as the platform resolved the connection for the request. */
260
+ export type HostConnection = {
261
+ status: 'connected';
262
+ accessToken: string;
263
+ [extra: string]: string | undefined;
264
+ } | {
265
+ status: 'missing' | 'expired';
266
+ connectUrl: string;
267
+ } | {
268
+ status: 'unavailable';
269
+ message: string;
270
+ userFacingMessage?: string;
271
+ connectUrl?: string;
272
+ serviceId?: number;
273
+ };
274
+ /** The per-request props the host dispatches with. Only the host can set them. */
275
+ export type HostProps = AppContext & {
276
+ platform: PlatformBinding;
277
+ requestId: string;
278
+ user: User | null;
279
+ /** A warm-up or a describe goes without props. */
280
+ invoke: {
281
+ kind: Exclude<HostInvoke['kind'], 'warm' | 'describe'>;
282
+ name: string;
283
+ } | null;
284
+ /** An editor preview's access, which zitejs keeps on the app's links and calls. */
285
+ previewClaim?: string;
286
+ /** `process.env` as classic sets it: connections' vars, then the user's own secrets. */
287
+ env?: Record<string, string>;
288
+ /** Which connection each token var in `env` holds. */
289
+ envConnections?: Record<string, string>;
290
+ /** Each connection's service, which the calls made with its token are counted under. */
291
+ connectionServices?: Record<string, string>;
292
+ /** A resumed run's first attempt, whose saved steps it replays. */
293
+ runRoot?: string;
294
+ /** A workflow call the host's run loop carries on; absent, the run is this one call. */
295
+ durable?: DurableCall;
296
+ /** This request's app token, sent only to `urls`. */
297
+ appToken?: string;
298
+ /** When `appToken` expires, in milliseconds since the epoch; absent without one. */
299
+ appTokenExpiresAt?: number;
300
+ urls?: PlatformUrls;
301
+ /** The head's values and the app's manifest, sent with every request that can open a page or ask for the manifest. */
302
+ page?: HostPage;
303
+ /** The app's access mode, from the platform's records: an internal app serves no page or call to nobody. */
304
+ accessMode: 'internal' | 'external';
305
+ /** `ZiteMeta.getWorkspace()`'s answer, from the build's config. */
306
+ workspace?: ZiteWorkspace;
307
+ /**
308
+ * `integrations.get`'s answers, by connection name, real as classic's, when the host already loaded them for the
309
+ * request: a registration's one connection, and none for a demo. Without them the app asks the backend on its token.
310
+ */
311
+ connections?: Record<string, HostConnection>;
312
+ };
313
+ /** What the host resolved for this request. Set by the generated server entry, never by the browser. */
314
+ export type HostRequestState = {
315
+ requestId: string;
316
+ url: string;
317
+ user: User | null;
318
+ mode: HostMode;
319
+ invoke: HostInvoke | null;
320
+ appUrl?: string;
321
+ baseId?: string;
322
+ previewClaim?: string;
323
+ /** Classic's connection env vars the host sent, which the request's `process.env` holds. */
324
+ env?: Record<string, string>;
325
+ /** What the request's `process.env` holds over the isolate's: the vars the host sent, then what its code set or deleted. */
326
+ processEnv?: Map<string, string | undefined>;
327
+ /** A platform call this demo made was refused. */
328
+ demoRefused?: boolean;
329
+ envConnections?: Record<string, string>;
330
+ connectionServices?: Record<string, string>;
331
+ /** A resumed run's first attempt, whose saved steps it replays. */
332
+ runRoot?: string;
333
+ durable?: DurableCall;
334
+ /** The connection each token this request was handed belongs to. */
335
+ connectionTokens?: Map<string, string>;
336
+ /** `integrations.get`'s answers this request, by name. */
337
+ connectionAnswers?: Map<string, unknown>;
338
+ /** One refresh per connection per request, however many calls got a 401. */
339
+ refreshing?: Map<string, Promise<string | undefined>>;
340
+ /** The outbound fetches, flushed with its runs. */
341
+ fetches?: FetchRecord[];
342
+ /** The secrets its fetch log redacts, longest first; cleared when a connection is learned. */
343
+ secretValues?: string[];
344
+ /** The isolate's refresh count `secretValues` was read at. */
345
+ secretsAt?: number;
346
+ /** How much of its fetch log is bodies so far. */
347
+ fetchLogChars?: number;
348
+ /** Filled by run capture, flushed to the platform once the response ends. */
349
+ runs: RunRecord[];
350
+ /** The data calls this request made, flushed with its runs. */
351
+ calls?: CallRecord[];
352
+ /** This request's Airtable reads, so the same one twice goes out once. */
353
+ airtableReads?: Map<string, Promise<unknown>>;
354
+ /** This request's view of the Airtable read cache, by connection token. */
355
+ airtableCaches?: Map<string, Promise<AirtableCache | undefined>>;
356
+ /** Records still reading a copy of a body; the flush waits for them. */
357
+ pending?: Promise<void>[];
358
+ provider?: PlatformProvider;
359
+ /** The request context's, which keeps a send going after the response. */
360
+ waitUntil?: (promise: Promise<unknown>) => void;
361
+ /** A test run of a server function, which the router answers at the invoke path inside TanStack's own request. */
362
+ functionRun?: () => Promise<Response>;
363
+ /** This request's router, so a page's status can follow the error it rendered. */
364
+ router?: unknown;
365
+ /** Its pages' head: the Settings, from the host or the build, and the platform's part where it serves the app. */
366
+ head?: PlatformHead;
367
+ workspace?: ZiteWorkspace;
368
+ connections?: Record<string, Record<string, unknown>>;
369
+ /** The backend's connections, asked once this request when the host didn't hand them over. */
370
+ connectionsLoad?: Promise<{
371
+ connections: Record<string, Record<string, unknown>>;
372
+ }>;
373
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });