zitejs 0.10.0-start.3 → 0.10.0-start.30

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 (414) 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 +123 -5
  14. package/dist/cjs/backend/index.js +13 -13
  15. package/dist/cjs/backend/index.test.js +144 -86
  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 +44 -1
  20. package/dist/cjs/check/index.js +188 -113
  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 +14 -0
  37. package/dist/cjs/integrations/rules.js +67 -33
  38. package/dist/cjs/integrations/rules.test.js +60 -53
  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} +13 -4
  58. package/dist/cjs/start/{entries.js → build/entries.js} +49 -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/{esm/start → cjs/start/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.d.ts +1 -0
  78. package/dist/cjs/steps/index.test.js +635 -0
  79. package/dist/cjs/sync/index.d.ts +1 -1
  80. package/dist/cjs/sync/index.js +28 -27
  81. package/dist/cjs/sync/lib.d.ts +15 -8
  82. package/dist/cjs/sync/lib.js +660 -663
  83. package/dist/cjs/sync/lib.test.js +177 -46
  84. package/dist/cjs/sync/sdkNames.d.ts +67 -9
  85. package/dist/cjs/sync/sdkNames.js +97 -31
  86. package/dist/cjs/sync/sdkNames.test.js +189 -113
  87. package/dist/cjs/types/fields.d.ts +9 -2
  88. package/dist/cjs/types/fields.js +110 -96
  89. package/dist/cjs/types/index.d.ts +2 -2
  90. package/dist/cjs/types/tables.d.ts +17 -1
  91. package/dist/cjs/upload/index.js +89 -24
  92. package/dist/cjs/upload/index.test.js +104 -1
  93. package/dist/cjs/vite/domTagNames.js +252 -252
  94. package/dist/cjs/vite/index.d.ts +1 -1
  95. package/dist/cjs/vite/index.js +51 -42
  96. package/dist/cjs/vite/index.test.js +10 -2
  97. package/dist/esm/auth/actions.d.ts +28 -0
  98. package/dist/esm/auth/actions.js +55 -0
  99. package/dist/esm/auth/client.d.ts +357 -0
  100. package/dist/esm/auth/client.js +62 -0
  101. package/dist/esm/auth/config.js +9 -3
  102. package/dist/esm/auth/index.d.ts +2 -249
  103. package/dist/esm/auth/index.js +2 -103
  104. package/dist/esm/auth/index.test.js +60 -0
  105. package/dist/esm/auth/previewClaim.d.ts +7 -0
  106. package/dist/esm/auth/previewClaim.js +12 -0
  107. package/dist/esm/auth/profileUpdates.d.ts +9 -0
  108. package/dist/esm/auth/profileUpdates.js +6 -0
  109. package/dist/esm/backend/index.d.ts +123 -5
  110. package/dist/esm/backend/index.js +13 -13
  111. package/dist/esm/backend/index.test.js +148 -90
  112. package/dist/esm/bundle/index.d.ts +8 -0
  113. package/dist/esm/bundle/index.js +37 -24
  114. package/dist/esm/caller/index.js +44 -44
  115. package/dist/esm/check/index.d.ts +44 -1
  116. package/dist/esm/check/index.js +187 -116
  117. package/dist/esm/check/start/routeTree.d.ts +8 -0
  118. package/dist/esm/check/start/routeTree.js +77 -0
  119. package/dist/esm/check/start/tsgo.d.ts +2 -0
  120. package/dist/esm/check/start/tsgo.js +29 -0
  121. package/dist/esm/cli.js +10 -4
  122. package/dist/esm/client/index.d.ts +26 -2
  123. package/dist/esm/client/index.js +25 -25
  124. package/dist/esm/dev/index.js +86 -61
  125. package/dist/esm/dev/signin.d.ts +16 -0
  126. package/dist/esm/dev/signin.js +80 -0
  127. package/dist/esm/index.d.ts +5 -5
  128. package/dist/esm/index.js +3 -3
  129. package/dist/esm/integrations/client.d.ts +3 -3
  130. package/dist/esm/integrations/client.js +6 -5
  131. package/dist/esm/integrations/client.test-d.js +19 -19
  132. package/dist/esm/integrations/index.d.ts +2 -2
  133. package/dist/esm/integrations/index.js +1 -1
  134. package/dist/esm/integrations/rules.d.ts +14 -0
  135. package/dist/esm/integrations/rules.js +67 -33
  136. package/dist/esm/integrations/rules.test.js +62 -55
  137. package/dist/esm/internal/appMode.d.ts +14 -0
  138. package/dist/esm/internal/appMode.js +13 -0
  139. package/dist/esm/internal/env.js +3 -2
  140. package/dist/esm/internal/platformFetch.d.ts +2 -0
  141. package/dist/esm/internal/platformFetch.js +9 -0
  142. package/dist/esm/internal/reservedIds.d.ts +8 -0
  143. package/dist/esm/internal/reservedIds.js +10 -0
  144. package/dist/esm/internal/serviceUrls.d.ts +5 -0
  145. package/dist/esm/internal/serviceUrls.js +10 -0
  146. package/dist/esm/pdf/index.js +2 -1
  147. package/dist/esm/runtime/filterConditionTypes.test-d.js +12 -12
  148. package/dist/esm/runtime/index.d.ts +126 -39
  149. package/dist/esm/runtime/index.js +35 -29
  150. package/dist/esm/runtime/index.test.js +36 -36
  151. package/dist/esm/runtime/sendEmailParamsTypes.test-d.d.ts +1 -0
  152. package/dist/esm/runtime/sendEmailParamsTypes.test-d.js +48 -0
  153. package/dist/esm/runtime/writeResultTypes.test-d.js +9 -9
  154. package/dist/esm/signin/conformance.d.ts +100 -0
  155. package/dist/esm/signin/conformance.js +616 -0
  156. package/dist/esm/signin/cookies.d.ts +28 -0
  157. package/dist/esm/signin/cookies.js +67 -0
  158. package/dist/esm/signin/encoding.d.ts +1 -0
  159. package/dist/esm/signin/encoding.js +12 -0
  160. package/dist/esm/signin/endpoints.d.ts +12 -0
  161. package/dist/esm/signin/endpoints.js +32 -0
  162. package/dist/esm/signin/http.d.ts +25 -0
  163. package/dist/esm/signin/http.js +106 -0
  164. package/dist/esm/signin/index.d.ts +8 -0
  165. package/dist/esm/signin/index.js +9 -0
  166. package/dist/esm/signin/keys.d.ts +35 -0
  167. package/dist/esm/signin/keys.js +230 -0
  168. package/dist/esm/signin/paths.d.ts +2 -0
  169. package/dist/esm/signin/paths.js +5 -0
  170. package/dist/esm/signin/seal.d.ts +19 -0
  171. package/dist/esm/signin/seal.js +47 -0
  172. package/dist/esm/signin/signin.d.ts +60 -0
  173. package/dist/esm/signin/signin.js +447 -0
  174. package/dist/esm/signin/transport.d.ts +112 -0
  175. package/dist/esm/signin/transport.js +1 -0
  176. package/dist/esm/signin/verifier.d.ts +2 -0
  177. package/dist/esm/signin/verifier.js +4 -0
  178. package/dist/esm/signin/verify.d.ts +83 -0
  179. package/dist/esm/signin/verify.js +142 -0
  180. package/dist/esm/sourceRoots.js +17 -17
  181. package/dist/esm/sourceRoots.test.js +34 -32
  182. package/dist/esm/start/access.d.ts +19 -0
  183. package/dist/esm/start/access.js +43 -0
  184. package/dist/esm/start/auth.d.ts +28 -0
  185. package/dist/esm/start/auth.js +33 -0
  186. package/dist/esm/start/automations/quiet.d.ts +2 -0
  187. package/dist/esm/start/automations/quiet.js +36 -0
  188. package/dist/esm/start/automations/registration.d.ts +13 -0
  189. package/dist/esm/start/automations/registration.js +25 -0
  190. package/dist/esm/start/automations/steps.d.ts +29 -0
  191. package/dist/esm/start/automations/steps.js +95 -0
  192. package/dist/esm/start/automations/workflow.d.ts +83 -0
  193. package/dist/esm/start/automations/workflow.js +36 -0
  194. package/dist/esm/start/automations/workflow.test-d.d.ts +1 -0
  195. package/dist/esm/start/automations/workflow.test-d.js +130 -0
  196. package/dist/esm/start/automations/workflowRun.d.ts +130 -0
  197. package/dist/esm/start/automations/workflowRun.js +185 -0
  198. package/dist/esm/start/barrel.test-d.d.ts +10 -0
  199. package/dist/esm/start/barrel.test-d.js +6 -0
  200. package/dist/esm/start/{entries.d.ts → build/entries.d.ts} +13 -4
  201. package/dist/esm/start/build/entries.js +109 -0
  202. package/dist/esm/start/build/placeholders/authHooksModule.d.ts +1 -0
  203. package/dist/esm/start/build/placeholders/authHooksModule.js +3 -0
  204. package/dist/esm/start/build/placeholders/devApp.d.ts +1 -0
  205. package/dist/esm/start/build/placeholders/devApp.js +3 -0
  206. package/dist/esm/start/build/placeholders/devSignIn.d.ts +1 -0
  207. package/dist/esm/start/build/placeholders/devSignIn.js +3 -0
  208. package/dist/esm/start/build/placeholders/siteHead.d.ts +2 -0
  209. package/dist/esm/start/build/placeholders/siteHead.js +3 -0
  210. package/dist/esm/start/{workflowModules.js → build/placeholders/workflowModules.js} +1 -1
  211. package/dist/esm/start/build/placeholders/workspaceSchema.d.ts +2 -0
  212. package/dist/esm/start/build/placeholders/workspaceSchema.js +3 -0
  213. package/dist/esm/start/build/registrationHash.d.ts +11 -0
  214. package/dist/esm/start/build/registrationHash.js +88 -0
  215. package/dist/esm/start/build/sdk/axios.d.ts +76 -0
  216. package/dist/esm/start/build/sdk/axios.js +253 -0
  217. package/dist/esm/start/build/sdk/nodeFetch.d.ts +41 -0
  218. package/dist/esm/start/build/sdk/nodeFetch.js +35 -0
  219. package/dist/esm/start/build/sdk/undici.d.ts +34 -0
  220. package/dist/esm/start/build/sdk/undici.js +18 -0
  221. package/dist/esm/start/build/sdkPatches.d.ts +22 -0
  222. package/dist/esm/start/build/sdkPatches.js +430 -0
  223. package/dist/esm/start/build/siteHead.d.ts +26 -0
  224. package/dist/esm/start/build/siteHead.js +88 -0
  225. package/dist/esm/start/build/vite.d.ts +50 -0
  226. package/dist/esm/start/build/vite.js +487 -0
  227. package/dist/esm/start/classicOnly.d.ts +1 -0
  228. package/dist/esm/start/classicOnly.js +4 -0
  229. package/dist/esm/start/clientErrorMessage.test.d.ts +1 -0
  230. package/dist/esm/start/clientErrorMessage.test.js +105 -0
  231. package/dist/esm/start/describe/describe.d.ts +120 -0
  232. package/dist/esm/start/describe/describe.js +372 -0
  233. package/dist/{cjs/start → esm/start/describe}/describeBuilt.d.ts +2 -0
  234. package/dist/esm/start/describe/describeBuilt.js +102 -0
  235. package/dist/esm/start/{descriptions.js → describe/descriptions.js} +17 -10
  236. package/dist/esm/start/errors.d.ts +62 -0
  237. package/dist/esm/start/errors.js +163 -0
  238. package/dist/esm/start/errors.test.d.ts +1 -0
  239. package/dist/esm/start/errors.test.js +54 -0
  240. package/dist/esm/start/factories.d.ts +14 -0
  241. package/dist/esm/start/factories.js +23 -0
  242. package/dist/esm/start/factories.test-d.d.ts +2 -0
  243. package/dist/esm/start/factories.test-d.js +60 -0
  244. package/dist/esm/start/failures.d.ts +7 -0
  245. package/dist/esm/start/failures.js +62 -0
  246. package/dist/esm/start/fnFactory.d.ts +16 -0
  247. package/dist/esm/start/fnFactory.js +1 -0
  248. package/dist/esm/start/host.d.ts +2 -2
  249. package/dist/esm/start/host.js +3 -3
  250. package/dist/esm/start/index.d.ts +10 -70
  251. package/dist/esm/start/index.js +7 -152
  252. package/dist/esm/start/login.d.ts +5 -0
  253. package/dist/esm/start/login.js +29 -0
  254. package/dist/esm/start/middlewareKind.d.ts +13 -0
  255. package/dist/esm/start/middlewareKind.js +9 -0
  256. package/dist/esm/start/platform/aiUsage.d.ts +29 -0
  257. package/dist/esm/start/platform/aiUsage.js +210 -0
  258. package/dist/esm/start/platform/airtable/arrayFields.d.ts +10 -0
  259. package/dist/esm/start/platform/airtable/arrayFields.js +30 -0
  260. package/dist/esm/start/platform/airtable/built.d.ts +2 -0
  261. package/dist/esm/start/platform/airtable/built.js +3 -0
  262. package/dist/esm/start/platform/airtable/cache.d.ts +17 -0
  263. package/dist/esm/start/platform/airtable/cache.js +89 -0
  264. package/dist/esm/start/platform/airtable/dispatch.d.ts +57 -0
  265. package/dist/esm/start/platform/airtable/dispatch.js +541 -0
  266. package/dist/esm/start/platform/airtable/formulas.d.ts +70 -0
  267. package/dist/esm/start/platform/airtable/formulas.js +261 -0
  268. package/dist/esm/start/platform/airtable/index.d.ts +6 -0
  269. package/dist/esm/start/platform/airtable/index.js +51 -0
  270. package/dist/esm/start/platform/airtable/settings.d.ts +37 -0
  271. package/dist/esm/start/platform/airtable/settings.js +138 -0
  272. package/dist/esm/start/platform/analytics.d.ts +3 -0
  273. package/dist/esm/start/platform/analytics.js +59 -0
  274. package/dist/esm/start/platform/calls.d.ts +5 -0
  275. package/dist/esm/start/platform/calls.js +104 -0
  276. package/dist/esm/start/platform/caps.d.ts +9 -0
  277. package/dist/esm/start/platform/caps.js +35 -0
  278. package/dist/esm/start/platform/connections.d.ts +25 -0
  279. package/dist/esm/start/platform/connections.js +198 -0
  280. package/dist/esm/start/platform/data/baseRunner.d.ts +97 -0
  281. package/dist/esm/start/platform/data/baseRunner.js +117 -0
  282. package/dist/esm/start/platform/data/dispatch.d.ts +17 -0
  283. package/dist/esm/start/platform/data/dispatch.js +216 -0
  284. package/dist/esm/start/platform/data/fetch.d.ts +7 -0
  285. package/dist/esm/start/platform/data/fetch.js +9 -0
  286. package/dist/esm/start/platform/data/index.d.ts +27 -0
  287. package/dist/esm/start/platform/data/index.js +75 -0
  288. package/dist/esm/start/platform/data/names.d.ts +7 -0
  289. package/dist/esm/start/platform/data/names.js +18 -0
  290. package/dist/esm/start/platform/data/sqlNameMappings.d.ts +58 -0
  291. package/dist/esm/start/platform/data/sqlNameMappings.js +92 -0
  292. package/dist/esm/start/platform/data/transformations.d.ts +97 -0
  293. package/dist/esm/start/platform/data/transformations.js +262 -0
  294. package/dist/esm/start/platform/data/types.d.ts +94 -0
  295. package/dist/esm/start/platform/data/types.js +14 -0
  296. package/dist/esm/start/platform/local.d.ts +6 -0
  297. package/dist/esm/start/platform/local.js +18 -0
  298. package/dist/esm/start/platform/meta.d.ts +3 -0
  299. package/dist/esm/start/platform/meta.js +33 -0
  300. package/dist/esm/start/platform/outbound.d.ts +17 -0
  301. package/dist/esm/start/platform/outbound.js +510 -0
  302. package/dist/esm/start/platform/redactSecrets.d.ts +13 -0
  303. package/dist/esm/start/platform/redactSecrets.js +156 -0
  304. package/dist/esm/start/platform/redactSecrets.test.d.ts +1 -0
  305. package/dist/esm/start/platform/redactSecrets.test.js +151 -0
  306. package/dist/esm/start/platform/requestSecrets.d.ts +15 -0
  307. package/dist/esm/start/platform/requestSecrets.js +41 -0
  308. package/dist/esm/start/platform/runLog.d.ts +40 -0
  309. package/dist/esm/start/platform/runLog.js +149 -0
  310. package/dist/esm/start/platform/services.d.ts +7 -0
  311. package/dist/esm/start/platform/services.js +46 -0
  312. package/dist/esm/start/platform/steps.d.ts +9 -0
  313. package/dist/esm/start/platform/steps.js +60 -0
  314. package/dist/esm/start/platform/telemetry.d.ts +13 -0
  315. package/dist/esm/start/platform/telemetry.js +71 -0
  316. package/dist/esm/start/platform/transport.d.ts +28 -0
  317. package/dist/esm/start/platform/transport.js +59 -0
  318. package/dist/esm/start/platformHead.d.ts +23 -0
  319. package/dist/esm/start/platformHead.js +133 -0
  320. package/dist/esm/start/previewClaim.d.ts +6 -0
  321. package/dist/esm/start/previewClaim.js +24 -0
  322. package/dist/esm/start/protocol.d.ts +19 -0
  323. package/dist/esm/start/protocol.js +27 -0
  324. package/dist/esm/start/roles.d.ts +12 -0
  325. package/dist/esm/start/roles.js +27 -0
  326. package/dist/esm/start/router.d.ts +33 -6
  327. package/dist/esm/start/router.js +259 -16
  328. package/dist/esm/start/serve/authHooks.d.ts +7 -0
  329. package/dist/esm/start/serve/authHooks.js +18 -0
  330. package/dist/esm/start/serve/demo.d.ts +9 -0
  331. package/dist/esm/start/serve/demo.js +24 -0
  332. package/dist/esm/start/serve/fetch.d.ts +1 -0
  333. package/dist/esm/start/serve/fetch.js +6 -0
  334. package/dist/esm/start/{instance.d.ts → serve/instance.d.ts} +7 -7
  335. package/dist/esm/start/serve/instance.js +134 -0
  336. package/dist/esm/start/serve/invoke.d.ts +13 -0
  337. package/dist/esm/start/serve/invoke.js +126 -0
  338. package/dist/esm/start/serve/local/load.d.ts +8 -0
  339. package/dist/esm/start/serve/local/load.js +44 -0
  340. package/dist/esm/start/serve/local/provider.d.ts +25 -0
  341. package/dist/esm/start/serve/local/provider.js +188 -0
  342. package/dist/esm/start/serve/local/signIn.d.ts +28 -0
  343. package/dist/esm/start/serve/local/signIn.js +123 -0
  344. package/dist/esm/start/serve/pageHead.d.ts +20 -0
  345. package/dist/esm/start/serve/pageHead.js +34 -0
  346. package/dist/esm/start/serve/provider.d.ts +19 -0
  347. package/dist/esm/start/serve/provider.js +78 -0
  348. package/dist/esm/start/serve/requestEnv.d.ts +2 -0
  349. package/dist/esm/start/serve/requestEnv.js +84 -0
  350. package/dist/esm/start/serve/scope.d.ts +18 -0
  351. package/dist/esm/start/serve/scope.js +67 -0
  352. package/dist/esm/start/serve/server.d.ts +56 -0
  353. package/dist/esm/start/serve/server.js +297 -0
  354. package/dist/esm/start/serve/uploads.d.ts +2 -0
  355. package/dist/esm/start/serve/uploads.js +49 -0
  356. package/dist/esm/start/serve/worker.d.ts +6 -0
  357. package/dist/esm/start/serve/worker.js +12 -0
  358. package/dist/esm/start/types.d.ts +316 -24
  359. package/dist/esm/start/version.d.ts +1 -0
  360. package/dist/esm/start/version.js +2 -0
  361. package/dist/esm/steps/index.d.ts +78 -0
  362. package/dist/esm/steps/index.js +502 -0
  363. package/dist/esm/steps/index.test.d.ts +1 -0
  364. package/dist/esm/steps/index.test.js +633 -0
  365. package/dist/esm/sync/index.d.ts +1 -1
  366. package/dist/esm/sync/index.js +32 -31
  367. package/dist/esm/sync/lib.d.ts +15 -8
  368. package/dist/esm/sync/lib.js +664 -667
  369. package/dist/esm/sync/lib.test.js +177 -46
  370. package/dist/esm/sync/sdkNames.d.ts +67 -9
  371. package/dist/esm/sync/sdkNames.js +94 -30
  372. package/dist/esm/sync/sdkNames.test.js +192 -116
  373. package/dist/esm/types/fields.d.ts +9 -2
  374. package/dist/esm/types/fields.js +110 -96
  375. package/dist/esm/types/index.d.ts +2 -2
  376. package/dist/esm/types/index.js +2 -2
  377. package/dist/esm/types/tables.d.ts +17 -1
  378. package/dist/esm/types/tables.js +2 -2
  379. package/dist/esm/upload/index.js +89 -24
  380. package/dist/esm/upload/index.test.js +104 -1
  381. package/dist/esm/vite/domTagNames.js +252 -252
  382. package/dist/esm/vite/index.d.ts +1 -1
  383. package/dist/esm/vite/index.js +56 -47
  384. package/dist/esm/vite/index.test.js +10 -2
  385. package/package.json +111 -40
  386. package/dist/cjs/auth-server/index.d.ts +0 -369
  387. package/dist/cjs/auth-server/index.js +0 -119
  388. package/dist/cjs/start/problems.d.ts +0 -19
  389. package/dist/cjs/start/problems.js +0 -11
  390. package/dist/esm/auth-server/index.d.ts +0 -369
  391. package/dist/esm/auth-server/index.js +0 -116
  392. package/dist/esm/start/describe.d.ts +0 -56
  393. package/dist/esm/start/describe.js +0 -147
  394. package/dist/esm/start/describeBuilt.js +0 -66
  395. package/dist/esm/start/entries.js +0 -82
  396. package/dist/esm/start/instance.js +0 -73
  397. package/dist/esm/start/problems.d.ts +0 -19
  398. package/dist/esm/start/problems.js +0 -8
  399. package/dist/esm/start/runLog.d.ts +0 -5
  400. package/dist/esm/start/runLog.js +0 -18
  401. package/dist/esm/start/scope.d.ts +0 -15
  402. package/dist/esm/start/scope.js +0 -58
  403. package/dist/esm/start/server.d.ts +0 -37
  404. package/dist/esm/start/server.js +0 -159
  405. package/dist/esm/start/vite.d.ts +0 -9
  406. package/dist/esm/start/vite.js +0 -143
  407. package/dist/esm/start/workflow.d.ts +0 -36
  408. package/dist/esm/start/workflow.js +0 -13
  409. package/dist/esm/start/workflow.test-d.js +0 -24
  410. package/dist/esm/start/workflowRun.d.ts +0 -80
  411. package/dist/esm/start/workflowRun.js +0 -107
  412. /package/dist/{esm/start/workflow.test-d.d.ts → cjs/runtime/sendEmailParamsTypes.test-d.d.ts} +0 -0
  413. /package/dist/esm/start/{workflowModules.d.ts → build/placeholders/workflowModules.d.ts} +0 -0
  414. /package/dist/esm/start/{descriptions.d.ts → describe/descriptions.d.ts} +0 -0
@@ -0,0 +1,28 @@
1
+ import { type ProfileChanges } from './profileUpdates.js';
2
+ export declare function loginWithRedirect(opts?: {
3
+ redirectUrl?: string;
4
+ /**
5
+ * @deprecated Ignored. There is one sign-in screen now — the server works out
6
+ * from the email whether it's a sign-in or a sign-up. Still accepted, because
7
+ * app source written before that change would otherwise stop typechecking on
8
+ * its next build, and a typecheck error fails the build outright.
9
+ */
10
+ initialView?: 'login' | 'signup';
11
+ }): void;
12
+ export declare function logout(opts?: {
13
+ returnTo?: string;
14
+ }): void;
15
+ export declare function updateProfile(data: ProfileChanges): Promise<{
16
+ data: {
17
+ status: boolean;
18
+ };
19
+ error: null;
20
+ } | {
21
+ data: null;
22
+ error: {
23
+ code?: string | undefined | undefined;
24
+ message?: string | undefined | undefined;
25
+ status: number;
26
+ statusText: string;
27
+ };
28
+ }>;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.loginWithRedirect = loginWithRedirect;
37
+ exports.logout = logout;
38
+ exports.updateProfile = updateProfile;
39
+ const constants_js_1 = require("./constants.js");
40
+ const previewClaim_js_1 = require("./previewClaim.js");
41
+ const profileUpdates_js_1 = require("./profileUpdates.js");
42
+ function loginWithRedirect(opts) {
43
+ if (window.location.pathname.startsWith('/auth/'))
44
+ return;
45
+ // Default to wherever the user already is, so a deep link survives the round
46
+ // trip through login without every app having to remember to pass it. Pass
47
+ // `redirectUrl` only to send them somewhere else instead.
48
+ //
49
+ // Resolved to an absolute URL either way, on purpose: better-auth
50
+ // character-checks a *relative* callbackURL — an encoded space, a fragment or
51
+ // any non-ASCII in the path fails its regex and the destination is dropped —
52
+ // but never inspects the path of an absolute one. Normalising here means a
53
+ // caller can pass whichever form reads best without having to know that.
54
+ const target = new URL(opts?.redirectUrl ?? window.location.href, window.location.href);
55
+ // Say nothing when there's nothing to say. The sign-in page already returns
56
+ // people to the app root when it isn't told otherwise, so naming the root
57
+ // spells out the default — and puts an encoded copy of the app's own URL in
58
+ // the address bar of every logged-out visitor to the front page, which is the
59
+ // common case. Only pass a destination when it IS one.
60
+ const isRoot = target.pathname === '/' && target.search === '' && target.hash === '';
61
+ const params = new URLSearchParams();
62
+ if (!isRoot)
63
+ params.set('redirectUrl', target.toString());
64
+ // The editor preview rides its usageToken on the app URL; the sign-in page
65
+ // only shows its editor surface ("Preview as" picker) when that token reaches
66
+ // it. Capturing the current URL carries it implicitly — but an explicit
67
+ // `redirectUrl` names a bare path, and would silently drop it. Forward it
68
+ // top-level either way, so how the app phrases its redirect can't decide
69
+ // whether the editor gets a preview. Published visitors never have one.
70
+ const usageToken = new URL(window.location.href).searchParams.get(constants_js_1.USAGE_TOKEN_QUERY_PARAM) ??
71
+ window._ziteUsageToken;
72
+ if (usageToken)
73
+ params.set(constants_js_1.USAGE_TOKEN_QUERY_PARAM, usageToken);
74
+ // A Start app's preview also needs its claim where the editor's frame dropped
75
+ // the cookie, as `loginHref()` sends it. Classic previews never have one.
76
+ const claim = (0, previewClaim_js_1.browserPreviewClaim)();
77
+ if (claim)
78
+ params.set(previewClaim_js_1.PREVIEW_CLAIM_PARAM, claim);
79
+ const query = params.toString();
80
+ window.location.href = query ? `/auth/login?${query}` : '/auth/login';
81
+ }
82
+ function logout(opts) {
83
+ void Promise.resolve().then(() => __importStar(require('./client.js'))).then(({ signOut }) => signOut().then(() => {
84
+ window.location.href = opts?.returnTo || '/';
85
+ }));
86
+ }
87
+ async function updateProfile(data) {
88
+ const { authClient } = await Promise.resolve().then(() => __importStar(require('./client.js')));
89
+ const result = await authClient.updateUser(data);
90
+ if (!result.error)
91
+ (0, profileUpdates_js_1.profileUpdated)(data);
92
+ return result;
93
+ }
@@ -0,0 +1,357 @@
1
+ import { loginWithRedirect, logout } from './actions.js';
2
+ import type { User } from './index.js';
3
+ export declare const authClient: import("better-auth/react").ReactAuthClient<{
4
+ baseURL: string;
5
+ plugins: ({
6
+ id: "magic-link";
7
+ version: string;
8
+ $InferServerPlugin: ReturnType<(options: import("better-auth/plugins/magic-link").MagicLinkOptions) => {
9
+ id: "magic-link";
10
+ version: string;
11
+ endpoints: {
12
+ signInMagicLink: import("better-call").StrictEndpoint<"/sign-in/magic-link", {
13
+ method: "POST";
14
+ requireHeaders: true;
15
+ body: import("zod").ZodObject<{
16
+ email: import("zod").ZodEmail;
17
+ name: import("zod").ZodOptional<import("zod").ZodString>;
18
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
19
+ newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
20
+ errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
21
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
22
+ }, import("zod/v4/core").$strip>;
23
+ metadata: {
24
+ openapi: {
25
+ operationId: string;
26
+ description: string;
27
+ responses: {
28
+ 200: {
29
+ description: string;
30
+ content: {
31
+ "application/json": {
32
+ schema: {
33
+ type: "object";
34
+ properties: {
35
+ status: {
36
+ type: string;
37
+ };
38
+ };
39
+ };
40
+ };
41
+ };
42
+ };
43
+ };
44
+ };
45
+ };
46
+ }, {
47
+ status: boolean;
48
+ }>;
49
+ magicLinkVerify: import("better-call").StrictEndpoint<"/magic-link/verify", {
50
+ method: "GET";
51
+ query: import("zod").ZodObject<{
52
+ token: import("zod").ZodString;
53
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
54
+ errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
55
+ newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
56
+ }, import("zod/v4/core").$strip>;
57
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
58
+ requireHeaders: true;
59
+ metadata: {
60
+ openapi: {
61
+ operationId: string;
62
+ description: string;
63
+ responses: {
64
+ 200: {
65
+ description: string;
66
+ content: {
67
+ "application/json": {
68
+ schema: {
69
+ type: "object";
70
+ properties: {
71
+ session: {
72
+ $ref: string;
73
+ };
74
+ user: {
75
+ $ref: string;
76
+ };
77
+ };
78
+ };
79
+ };
80
+ };
81
+ };
82
+ };
83
+ };
84
+ };
85
+ }, {
86
+ token: string;
87
+ user: {
88
+ id: string;
89
+ createdAt: Date;
90
+ updatedAt: Date;
91
+ email: string;
92
+ emailVerified: boolean;
93
+ name: string;
94
+ image?: string | null | undefined;
95
+ };
96
+ session: {
97
+ id: string;
98
+ createdAt: Date;
99
+ updatedAt: Date;
100
+ userId: string;
101
+ expiresAt: Date;
102
+ token: string;
103
+ ipAddress?: string | null | undefined;
104
+ userAgent?: string | null | undefined;
105
+ };
106
+ }>;
107
+ };
108
+ rateLimit: {
109
+ pathMatcher(path: string): boolean;
110
+ window: number;
111
+ max: number;
112
+ }[];
113
+ options: import("better-auth/plugins/magic-link").MagicLinkOptions;
114
+ }>;
115
+ } | {
116
+ id: "additional-fields-client";
117
+ version: string;
118
+ $InferServerPlugin: {
119
+ id: "additional-fields-client";
120
+ version: string;
121
+ schema: {
122
+ user: {
123
+ fields: {
124
+ firstName: {
125
+ type: "string";
126
+ required: false;
127
+ };
128
+ lastName: {
129
+ type: "string";
130
+ required: false;
131
+ };
132
+ };
133
+ };
134
+ session: {
135
+ fields: {};
136
+ };
137
+ };
138
+ };
139
+ })[];
140
+ }>;
141
+ export declare const useSession: () => {
142
+ data: {
143
+ user: import("better-auth/react").StripEmptyObjects<{
144
+ id: string;
145
+ createdAt: Date;
146
+ updatedAt: Date;
147
+ email: string;
148
+ emailVerified: boolean;
149
+ name: string;
150
+ image?: string | null | undefined;
151
+ } & {} & {
152
+ firstName?: string | null | undefined;
153
+ lastName?: string | null | undefined;
154
+ }>;
155
+ session: import("better-auth/react").StripEmptyObjects<{
156
+ id: string;
157
+ createdAt: Date;
158
+ updatedAt: Date;
159
+ userId: string;
160
+ expiresAt: Date;
161
+ token: string;
162
+ ipAddress?: string | null | undefined;
163
+ userAgent?: string | null | undefined;
164
+ } & {} & {}>;
165
+ } | null;
166
+ isPending: boolean;
167
+ isRefetching: boolean;
168
+ error: import("@better-fetch/fetch").BetterFetchError | null;
169
+ refetch: (queryParams?: {
170
+ query?: import("better-auth/types").SessionQueryParams;
171
+ } | undefined) => Promise<void>;
172
+ };
173
+ /**
174
+ * `loginWithRedirect` and `logout` are returned as well as exported. The
175
+ * pre-monorepo `useAuth()` returned them, so app code that destructures them
176
+ * from the hook is common — and returning them here means the legacy compat
177
+ * shim is the only thing that has to know that, not every migrated app.
178
+ */
179
+ export declare function useAuth(): {
180
+ user: User | null;
181
+ isLoading: boolean;
182
+ loginWithRedirect: typeof loginWithRedirect;
183
+ logout: typeof logout;
184
+ };
185
+ export declare const signIn: {
186
+ magicLink: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
187
+ email: string;
188
+ name?: string | undefined;
189
+ callbackURL?: string | undefined;
190
+ newUserCallbackURL?: string | undefined;
191
+ errorCallbackURL?: string | undefined;
192
+ metadata?: Record<string, any> | undefined;
193
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
194
+ email: string;
195
+ name?: string | undefined;
196
+ callbackURL?: string | undefined;
197
+ newUserCallbackURL?: string | undefined;
198
+ errorCallbackURL?: string | undefined;
199
+ metadata?: Record<string, any> | undefined;
200
+ } & {
201
+ fetchOptions?: FetchOptions | undefined;
202
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
203
+ status: boolean;
204
+ }, {
205
+ code?: string | undefined;
206
+ message?: string | undefined;
207
+ }, FetchOptions["throw"] extends true ? true : false>>;
208
+ } & {
209
+ social: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
210
+ provider: "salesforce" | "slack" | "linear" | "notion" | "linkedin" | "github" | "dropbox" | (string & {}) | "huggingface" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "kick" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
211
+ callbackURL?: string | undefined;
212
+ newUserCallbackURL?: string | undefined;
213
+ errorCallbackURL?: string | undefined;
214
+ disableRedirect?: boolean | undefined;
215
+ idToken?: {
216
+ token: string;
217
+ nonce?: string | undefined;
218
+ accessToken?: string | undefined;
219
+ refreshToken?: string | undefined;
220
+ expiresAt?: number | undefined;
221
+ user?: {
222
+ name?: {
223
+ firstName?: string | undefined;
224
+ lastName?: string | undefined;
225
+ } | undefined;
226
+ email?: string | undefined;
227
+ } | undefined;
228
+ } | undefined;
229
+ scopes?: string[] | undefined;
230
+ requestSignUp?: boolean | undefined;
231
+ loginHint?: string | undefined;
232
+ additionalData?: Record<string, any> | undefined;
233
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
234
+ provider: "salesforce" | "slack" | "linear" | "notion" | "linkedin" | "github" | "dropbox" | (string & {}) | "huggingface" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "kick" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
235
+ callbackURL?: string | undefined;
236
+ newUserCallbackURL?: string | undefined;
237
+ errorCallbackURL?: string | undefined;
238
+ disableRedirect?: boolean | undefined;
239
+ idToken?: {
240
+ token: string;
241
+ nonce?: string | undefined;
242
+ accessToken?: string | undefined;
243
+ refreshToken?: string | undefined;
244
+ expiresAt?: number | undefined;
245
+ user?: {
246
+ name?: {
247
+ firstName?: string | undefined;
248
+ lastName?: string | undefined;
249
+ } | undefined;
250
+ email?: string | undefined;
251
+ } | undefined;
252
+ } | undefined;
253
+ scopes?: string[] | undefined;
254
+ requestSignUp?: boolean | undefined;
255
+ loginHint?: string | undefined;
256
+ additionalData?: Record<string, any> | undefined;
257
+ } & {
258
+ fetchOptions?: FetchOptions | undefined;
259
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
260
+ redirect: boolean;
261
+ url: string;
262
+ } | (Omit<{
263
+ redirect: boolean;
264
+ token: string;
265
+ url: undefined;
266
+ user: {
267
+ id: string;
268
+ createdAt: Date;
269
+ updatedAt: Date;
270
+ email: string;
271
+ emailVerified: boolean;
272
+ name: string;
273
+ image?: string | null | undefined | undefined;
274
+ };
275
+ }, "user"> & {
276
+ user: import("better-auth/react").StripEmptyObjects<{
277
+ id: string;
278
+ createdAt: Date;
279
+ updatedAt: Date;
280
+ email: string;
281
+ emailVerified: boolean;
282
+ name: string;
283
+ image?: string | null | undefined;
284
+ } & {} & {
285
+ firstName?: string | null | undefined;
286
+ lastName?: string | null | undefined;
287
+ }>;
288
+ }), {
289
+ code?: string | undefined;
290
+ message?: string | undefined;
291
+ }, FetchOptions["throw"] extends true ? true : false>>;
292
+ } & {
293
+ email: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
294
+ email: string;
295
+ password: string;
296
+ callbackURL?: string | undefined;
297
+ rememberMe?: boolean | undefined;
298
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
299
+ email: string;
300
+ password: string;
301
+ callbackURL?: string | undefined;
302
+ rememberMe?: boolean | undefined;
303
+ } & {
304
+ fetchOptions?: FetchOptions | undefined;
305
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
306
+ redirect: boolean;
307
+ token: string;
308
+ url?: string | undefined;
309
+ user: {
310
+ id: string;
311
+ createdAt: Date;
312
+ updatedAt: Date;
313
+ email: string;
314
+ emailVerified: boolean;
315
+ name: string;
316
+ image?: string | null | undefined | undefined;
317
+ };
318
+ }, "user"> & {
319
+ user: import("better-auth/react").StripEmptyObjects<{
320
+ id: string;
321
+ createdAt: Date;
322
+ updatedAt: Date;
323
+ email: string;
324
+ emailVerified: boolean;
325
+ name: string;
326
+ image?: string | null | undefined;
327
+ } & {} & {
328
+ firstName?: string | null | undefined;
329
+ lastName?: string | null | undefined;
330
+ }>;
331
+ }, {
332
+ code?: string | undefined;
333
+ message?: string | undefined;
334
+ }, FetchOptions["throw"] extends true ? true : false>>;
335
+ };
336
+ export declare const signOut: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
337
+ query?: Record<string, any> | undefined;
338
+ fetchOptions?: FetchOptions | undefined;
339
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
340
+ success: boolean;
341
+ }, {
342
+ code?: string | undefined;
343
+ message?: string | undefined;
344
+ }, FetchOptions["throw"] extends true ? true : false>>;
345
+ export declare const signUp: {
346
+ email: (data: {
347
+ email: string;
348
+ password: string;
349
+ name: string;
350
+ [key: string]: unknown;
351
+ }) => Promise<{
352
+ error?: {
353
+ message?: string;
354
+ } | null;
355
+ data?: unknown;
356
+ }>;
357
+ };
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.signUp = exports.signOut = exports.signIn = exports.useSession = exports.authClient = void 0;
4
+ exports.useAuth = useAuth;
5
+ const react_1 = require("react");
6
+ const react_2 = require("better-auth/react");
7
+ const plugins_1 = require("better-auth/client/plugins");
8
+ const config_js_1 = require("./config.js");
9
+ const actions_js_1 = require("./actions.js");
10
+ // Apart from the actions, so an app that never reads the session here (a Start
11
+ // app reads its user from the router) never ships better-auth's client.
12
+ exports.authClient = (0, react_2.createAuthClient)({
13
+ baseURL: '',
14
+ plugins: [
15
+ (0, plugins_1.magicLinkClient)(),
16
+ (0, plugins_1.inferAdditionalFields)({
17
+ user: {
18
+ firstName: { type: 'string', required: false },
19
+ lastName: { type: 'string', required: false },
20
+ },
21
+ }),
22
+ ],
23
+ });
24
+ exports.useSession = exports.authClient.useSession;
25
+ /**
26
+ * An internal app has no signed-out state — SSO runs before the bundle — so an
27
+ * empty session means it died underneath the app. Only `internal`: elsewhere a
28
+ * signed-out visitor is legitimate.
29
+ */
30
+ function shouldRedirectSignedOut(isPending, hasUser) {
31
+ if (isPending || hasUser)
32
+ return false;
33
+ if ((0, config_js_1.getAccessMode)() !== 'internal')
34
+ return false;
35
+ if (typeof window === 'undefined')
36
+ return false;
37
+ // `loginWithRedirect` won't navigate from an auth page, so claiming a
38
+ // redirect here would hang `isLoading` forever.
39
+ return !window.location.pathname.startsWith('/auth/');
40
+ }
41
+ /**
42
+ * `loginWithRedirect` and `logout` are returned as well as exported. The
43
+ * pre-monorepo `useAuth()` returned them, so app code that destructures them
44
+ * from the hook is common — and returning them here means the legacy compat
45
+ * shim is the only thing that has to know that, not every migrated app.
46
+ */
47
+ function useAuth() {
48
+ const { data, isPending } = (0, exports.useSession)();
49
+ const user = data?.user ?? null;
50
+ const redirecting = shouldRedirectSignedOut(isPending, user !== null);
51
+ (0, react_1.useEffect)(() => {
52
+ if (redirecting)
53
+ (0, actions_js_1.loginWithRedirect)();
54
+ }, [redirecting]);
55
+ return {
56
+ user,
57
+ // Loading, not signed out: the signed-out branch is the empty screen this
58
+ // exists to prevent.
59
+ isLoading: isPending || redirecting,
60
+ loginWithRedirect: actions_js_1.loginWithRedirect,
61
+ logout: actions_js_1.logout,
62
+ };
63
+ }
64
+ exports.signIn = exports.authClient.signIn;
65
+ exports.signOut = exports.authClient.signOut;
66
+ exports.signUp = exports.authClient.signUp;
@@ -19,7 +19,9 @@ const AUTH_PAGE_ENVIRONMENTS = {
19
19
  function getFlowId() {
20
20
  const id = (0, env_js_1.getEnv)('ZITE_FLOW_ID', 'VITE_ZITE_FLOW_ID') ?? '';
21
21
  if (!id) {
22
- const win = typeof window !== 'undefined' ? window : undefined;
22
+ const win = typeof window !== 'undefined'
23
+ ? window
24
+ : undefined;
23
25
  const config = win?.__ziteConfig;
24
26
  if (config?.id)
25
27
  return config.id;
@@ -28,11 +30,15 @@ function getFlowId() {
28
30
  }
29
31
  function getApiUrl() {
30
32
  const env = (0, env_js_1.getEnv)('ZITE_ENV', 'VITE_ZITE_ENV') ?? 'production';
31
- return (0, env_js_1.getEnv)('ZITE_API_URL', 'VITE_ZITE_API_URL') ?? API_ENVIRONMENTS[env] ?? API_ENVIRONMENTS.production;
33
+ return ((0, env_js_1.getEnv)('ZITE_API_URL', 'VITE_ZITE_API_URL') ??
34
+ API_ENVIRONMENTS[env] ??
35
+ API_ENVIRONMENTS.production);
32
36
  }
33
37
  function getAuthPageUrl() {
34
38
  const env = (0, env_js_1.getEnv)('ZITE_ENV', 'VITE_ZITE_ENV') ?? 'production';
35
- return (0, env_js_1.getEnv)('ZITE_AUTH_PAGE_URL', 'VITE_ZITE_AUTH_PAGE_URL') ?? AUTH_PAGE_ENVIRONMENTS[env] ?? AUTH_PAGE_ENVIRONMENTS.production;
39
+ return ((0, env_js_1.getEnv)('ZITE_AUTH_PAGE_URL', 'VITE_ZITE_AUTH_PAGE_URL') ??
40
+ AUTH_PAGE_ENVIRONMENTS[env] ??
41
+ AUTH_PAGE_ENVIRONMENTS.production);
36
42
  }
37
43
  function getDbToken() {
38
44
  return (0, env_js_1.getEnv)('ZITE_DB_TOKEN', 'VITE_ZITE_DB_TOKEN') ?? '';