@pithy-sh/core 0.1.1 → 0.1.3

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 (393) hide show
  1. package/dist/address/address.d.ts +57 -0
  2. package/dist/address/address.d.ts.map +1 -0
  3. package/dist/address/address.js +71 -0
  4. package/dist/audit/auditEvent.d.ts +89 -0
  5. package/dist/audit/auditEvent.d.ts.map +1 -0
  6. package/dist/audit/auditEvent.js +69 -0
  7. package/dist/audit/recorder.d.ts +18 -0
  8. package/dist/audit/recorder.d.ts.map +1 -0
  9. package/dist/audit/recorder.js +8 -0
  10. package/dist/capability/bindings.d.ts +62 -0
  11. package/dist/capability/bindings.d.ts.map +1 -0
  12. package/dist/capability/bindings.js +97 -0
  13. package/dist/capability/capability.d.ts +501 -0
  14. package/dist/capability/capability.d.ts.map +1 -0
  15. package/dist/capability/capability.js +16 -0
  16. package/dist/capability/client.d.ts +70 -0
  17. package/dist/capability/client.d.ts.map +1 -0
  18. package/dist/capability/client.js +86 -0
  19. package/dist/capability/compose.d.ts +25 -0
  20. package/dist/capability/compose.d.ts.map +1 -0
  21. package/dist/capability/compose.js +54 -0
  22. package/dist/capability/composition.d.ts +26 -0
  23. package/dist/capability/composition.d.ts.map +1 -0
  24. package/dist/capability/composition.js +84 -0
  25. package/dist/capability/config.d.ts +7 -0
  26. package/dist/capability/config.d.ts.map +1 -0
  27. package/dist/capability/config.js +14 -0
  28. package/dist/capability/devSecret.d.ts +32 -0
  29. package/dist/capability/devSecret.d.ts.map +1 -0
  30. package/dist/capability/devSecret.js +28 -0
  31. package/dist/capability/manifest.d.ts +298 -0
  32. package/dist/capability/manifest.d.ts.map +1 -0
  33. package/dist/capability/manifest.js +356 -0
  34. package/dist/capability/secretOrigin.d.ts +121 -0
  35. package/dist/capability/secretOrigin.d.ts.map +1 -0
  36. package/dist/capability/secretOrigin.js +134 -0
  37. package/dist/capability/settings.d.ts +119 -0
  38. package/dist/capability/settings.d.ts.map +1 -0
  39. package/dist/capability/settings.js +66 -0
  40. package/dist/capability/validateBindings.d.ts +4 -0
  41. package/dist/capability/validateBindings.d.ts.map +1 -0
  42. package/dist/capability/validateBindings.js +34 -0
  43. package/dist/capability/vanishingKey.d.ts +31 -0
  44. package/dist/capability/vanishingKey.d.ts.map +1 -0
  45. package/dist/capability/vanishingKey.js +79 -0
  46. package/dist/controlPlane/audit/actions.d.ts +70 -0
  47. package/dist/controlPlane/audit/actions.d.ts.map +1 -0
  48. package/dist/controlPlane/audit/actions.js +76 -0
  49. package/dist/controlPlane/capability.d.ts +47 -0
  50. package/dist/controlPlane/capability.d.ts.map +1 -0
  51. package/dist/controlPlane/capability.js +138 -0
  52. package/dist/controlPlane/config/config.d.ts +19 -0
  53. package/dist/controlPlane/config/config.d.ts.map +1 -0
  54. package/dist/controlPlane/config/config.js +85 -0
  55. package/dist/controlPlane/context.d.ts +27 -0
  56. package/dist/controlPlane/context.d.ts.map +1 -0
  57. package/dist/controlPlane/context.js +29 -0
  58. package/dist/controlPlane/data/connection.d.ts +79 -0
  59. package/dist/controlPlane/data/connection.d.ts.map +1 -0
  60. package/dist/controlPlane/data/connection.js +55 -0
  61. package/dist/controlPlane/data/keyLifecycle.d.ts +62 -0
  62. package/dist/controlPlane/data/keyLifecycle.d.ts.map +1 -0
  63. package/dist/controlPlane/data/keyLifecycle.js +126 -0
  64. package/dist/controlPlane/data/replay.d.ts +18 -0
  65. package/dist/controlPlane/data/replay.d.ts.map +1 -0
  66. package/dist/controlPlane/data/replay.js +20 -0
  67. package/dist/controlPlane/data/tables.d.ts +34 -0
  68. package/dist/controlPlane/data/tables.d.ts.map +1 -0
  69. package/dist/controlPlane/data/tables.js +37 -0
  70. package/dist/controlPlane/discovery/adminRoute.d.ts +313 -0
  71. package/dist/controlPlane/discovery/adminRoute.d.ts.map +1 -0
  72. package/dist/controlPlane/discovery/adminRoute.js +136 -0
  73. package/dist/controlPlane/discovery/configuration.d.ts +108 -0
  74. package/dist/controlPlane/discovery/configuration.d.ts.map +1 -0
  75. package/dist/controlPlane/discovery/configuration.js +187 -0
  76. package/dist/controlPlane/discovery/drift.d.ts +64 -0
  77. package/dist/controlPlane/discovery/drift.d.ts.map +1 -0
  78. package/dist/controlPlane/discovery/drift.js +58 -0
  79. package/dist/controlPlane/discovery/health.d.ts +99 -0
  80. package/dist/controlPlane/discovery/health.d.ts.map +1 -0
  81. package/dist/controlPlane/discovery/health.js +151 -0
  82. package/dist/controlPlane/discovery/healthSummary.d.ts +236 -0
  83. package/dist/controlPlane/discovery/healthSummary.d.ts.map +1 -0
  84. package/dist/controlPlane/discovery/healthSummary.js +278 -0
  85. package/dist/controlPlane/error/errors.d.ts +67 -0
  86. package/dist/controlPlane/error/errors.d.ts.map +1 -0
  87. package/dist/controlPlane/error/errors.js +79 -0
  88. package/dist/controlPlane/http/cors.d.ts +112 -0
  89. package/dist/controlPlane/http/cors.d.ts.map +1 -0
  90. package/dist/controlPlane/http/cors.js +192 -0
  91. package/dist/controlPlane/http/guard.d.ts +77 -0
  92. package/dist/controlPlane/http/guard.d.ts.map +1 -0
  93. package/dist/controlPlane/http/guard.js +142 -0
  94. package/dist/controlPlane/http/handlers.d.ts +179 -0
  95. package/dist/controlPlane/http/handlers.d.ts.map +1 -0
  96. package/dist/controlPlane/http/handlers.js +245 -0
  97. package/dist/controlPlane/http/responses.d.ts +99 -0
  98. package/dist/controlPlane/http/responses.d.ts.map +1 -0
  99. package/dist/controlPlane/http/responses.js +63 -0
  100. package/dist/controlPlane/http/routes.d.ts +40 -0
  101. package/dist/controlPlane/http/routes.d.ts.map +1 -0
  102. package/dist/controlPlane/http/routes.js +83 -0
  103. package/dist/controlPlane/http/schemas.d.ts +39 -0
  104. package/dist/controlPlane/http/schemas.d.ts.map +1 -0
  105. package/dist/controlPlane/http/schemas.js +31 -0
  106. package/dist/controlPlane/http/verify.d.ts +84 -0
  107. package/dist/controlPlane/http/verify.d.ts.map +1 -0
  108. package/dist/controlPlane/http/verify.js +65 -0
  109. package/dist/controlPlane/migrations/0001_init.d.ts +51 -0
  110. package/dist/controlPlane/migrations/0001_init.d.ts.map +1 -0
  111. package/dist/controlPlane/migrations/0001_init.js +65 -0
  112. package/dist/controlPlane/replay/d1Guard.d.ts +29 -0
  113. package/dist/controlPlane/replay/d1Guard.d.ts.map +1 -0
  114. package/dist/controlPlane/replay/d1Guard.js +39 -0
  115. package/dist/controlPlane/replay/guard.d.ts +52 -0
  116. package/dist/controlPlane/replay/guard.d.ts.map +1 -0
  117. package/dist/controlPlane/replay/guard.js +0 -0
  118. package/dist/controlPlane/replay/kvGuard.d.ts +99 -0
  119. package/dist/controlPlane/replay/kvGuard.d.ts.map +1 -0
  120. package/dist/controlPlane/replay/kvGuard.js +101 -0
  121. package/dist/controlPlane/scope/scope.d.ts +68 -0
  122. package/dist/controlPlane/scope/scope.d.ts.map +1 -0
  123. package/dist/controlPlane/scope/scope.js +63 -0
  124. package/dist/controlPlane/token/base64url.d.ts +10 -0
  125. package/dist/controlPlane/token/base64url.d.ts.map +1 -0
  126. package/dist/controlPlane/token/base64url.js +48 -0
  127. package/dist/controlPlane/token/claims.d.ts +83 -0
  128. package/dist/controlPlane/token/claims.d.ts.map +1 -0
  129. package/dist/controlPlane/token/claims.js +86 -0
  130. package/dist/controlPlane/token/digest.d.ts +44 -0
  131. package/dist/controlPlane/token/digest.d.ts.map +1 -0
  132. package/dist/controlPlane/token/digest.js +56 -0
  133. package/dist/controlPlane/token/jws.d.ts +52 -0
  134. package/dist/controlPlane/token/jws.d.ts.map +1 -0
  135. package/dist/controlPlane/token/jws.js +65 -0
  136. package/dist/controlPlane/token/mint.d.ts +56 -0
  137. package/dist/controlPlane/token/mint.d.ts.map +1 -0
  138. package/dist/controlPlane/token/mint.js +55 -0
  139. package/dist/controlPlane/wire.d.ts +122 -0
  140. package/dist/controlPlane/wire.d.ts.map +1 -0
  141. package/dist/controlPlane/wire.js +123 -0
  142. package/dist/createBackend.d.ts +58 -0
  143. package/dist/createBackend.d.ts.map +1 -0
  144. package/dist/createBackend.js +170 -0
  145. package/dist/createEntrypoint.d.ts +53 -0
  146. package/dist/createEntrypoint.d.ts.map +1 -0
  147. package/dist/createEntrypoint.js +52 -0
  148. package/dist/data/boundParameters.d.ts +83 -0
  149. package/dist/data/boundParameters.d.ts.map +1 -0
  150. package/dist/data/boundParameters.js +162 -0
  151. package/dist/data/codecs.d.ts +34 -0
  152. package/dist/data/codecs.d.ts.map +1 -0
  153. package/dist/data/codecs.js +135 -0
  154. package/dist/data/cursor.d.ts +81 -0
  155. package/dist/data/cursor.d.ts.map +1 -0
  156. package/dist/data/cursor.js +104 -0
  157. package/dist/data/databases.d.ts +55 -0
  158. package/dist/data/databases.d.ts.map +1 -0
  159. package/dist/data/databases.js +32 -0
  160. package/dist/data/db.d.ts +42 -0
  161. package/dist/data/db.d.ts.map +1 -0
  162. package/dist/data/db.js +24 -0
  163. package/dist/data/withD1Retry.d.ts +91 -0
  164. package/dist/data/withD1Retry.d.ts.map +1 -0
  165. package/dist/data/withD1Retry.js +152 -0
  166. package/dist/entitlement/entitlement.d.ts +118 -0
  167. package/dist/entitlement/entitlement.d.ts.map +1 -0
  168. package/dist/entitlement/entitlement.js +59 -0
  169. package/dist/entitlement/gateScan.d.ts +26 -0
  170. package/dist/entitlement/gateScan.d.ts.map +1 -0
  171. package/dist/entitlement/gateScan.js +96 -0
  172. package/dist/entitlement/require.d.ts +12 -0
  173. package/dist/entitlement/require.d.ts.map +1 -0
  174. package/dist/entitlement/require.js +123 -0
  175. package/dist/env/ambient.d.ts +52 -0
  176. package/dist/env/ambient.d.ts.map +1 -0
  177. package/dist/env/ambient.js +35 -0
  178. package/dist/env/ci.d.ts +36 -0
  179. package/dist/env/ci.d.ts.map +1 -0
  180. package/dist/env/ci.js +40 -0
  181. package/dist/env/stem.d.ts +23 -0
  182. package/dist/env/stem.d.ts.map +1 -0
  183. package/dist/env/stem.js +29 -0
  184. package/dist/error/cause.d.ts +143 -0
  185. package/dist/error/cause.d.ts.map +1 -0
  186. package/dist/error/cause.js +192 -0
  187. package/dist/error/client.d.ts +35 -0
  188. package/dist/error/client.d.ts.map +1 -0
  189. package/dist/error/client.js +38 -0
  190. package/dist/error/extend.d.ts +101 -0
  191. package/dist/error/extend.d.ts.map +1 -0
  192. package/dist/error/extend.js +76 -0
  193. package/dist/error/http.d.ts +1516 -0
  194. package/dist/error/http.d.ts.map +1 -0
  195. package/dist/error/http.js +72 -0
  196. package/dist/error/payload.d.ts +3034 -0
  197. package/dist/error/payload.d.ts.map +1 -0
  198. package/dist/error/payload.js +1110 -0
  199. package/dist/error/pithyError.d.ts +154 -0
  200. package/dist/error/pithyError.d.ts.map +1 -0
  201. package/dist/error/pithyError.js +197 -0
  202. package/dist/error/terminal.d.ts +28 -0
  203. package/dist/error/terminal.d.ts.map +1 -0
  204. package/dist/error/terminal.js +33 -0
  205. package/dist/http/authContext.d.ts +21 -0
  206. package/dist/http/authContext.d.ts.map +1 -0
  207. package/dist/http/authContext.js +23 -0
  208. package/dist/http/routeContract.d.ts +39 -0
  209. package/dist/http/routeContract.d.ts.map +1 -0
  210. package/dist/http/routeContract.js +82 -0
  211. package/dist/http/sameOrigin.d.ts +47 -0
  212. package/dist/http/sameOrigin.d.ts.map +1 -0
  213. package/dist/http/sameOrigin.js +24 -0
  214. package/dist/http/signedWebhook.d.ts +225 -0
  215. package/dist/http/signedWebhook.d.ts.map +1 -0
  216. package/dist/http/signedWebhook.js +247 -0
  217. package/dist/http/validation.d.ts +37 -0
  218. package/dist/http/validation.d.ts.map +1 -0
  219. package/dist/http/validation.js +14 -0
  220. package/dist/http/verification.d.ts +10 -0
  221. package/dist/http/verification.d.ts.map +1 -0
  222. package/dist/http/verification.js +17 -0
  223. package/dist/i18n/acceptLanguage.d.ts +22 -0
  224. package/dist/i18n/acceptLanguage.d.ts.map +1 -0
  225. package/dist/i18n/acceptLanguage.js +55 -0
  226. package/dist/i18n/catalog.d.ts +39 -0
  227. package/dist/i18n/catalog.d.ts.map +1 -0
  228. package/dist/i18n/catalog.js +57 -0
  229. package/dist/i18n/locale.d.ts +74 -0
  230. package/dist/i18n/locale.d.ts.map +1 -0
  231. package/dist/i18n/locale.js +109 -0
  232. package/dist/i18n/localeMarker.d.ts +29 -0
  233. package/dist/i18n/localeMarker.d.ts.map +1 -0
  234. package/dist/i18n/localeMarker.js +112 -0
  235. package/dist/i18n/match.d.ts +26 -0
  236. package/dist/i18n/match.d.ts.map +1 -0
  237. package/dist/i18n/match.js +88 -0
  238. package/dist/i18n/registry.d.ts +25 -0
  239. package/dist/i18n/registry.d.ts.map +1 -0
  240. package/dist/i18n/registry.js +51 -0
  241. package/dist/i18n/translator.d.ts +107 -0
  242. package/dist/i18n/translator.d.ts.map +1 -0
  243. package/dist/i18n/translator.js +80 -0
  244. package/dist/index.d.ts +32 -0
  245. package/dist/index.d.ts.map +1 -0
  246. package/dist/index.js +17 -0
  247. package/dist/kv/kv.d.ts +166 -0
  248. package/dist/kv/kv.d.ts.map +1 -0
  249. package/dist/kv/kv.js +261 -0
  250. package/dist/kv/namespaces.d.ts +58 -0
  251. package/dist/kv/namespaces.d.ts.map +1 -0
  252. package/dist/kv/namespaces.js +40 -0
  253. package/dist/logger/local.d.ts +41 -0
  254. package/dist/logger/local.d.ts.map +1 -0
  255. package/dist/logger/local.js +45 -0
  256. package/dist/logger/logger.d.ts +56 -0
  257. package/dist/logger/logger.d.ts.map +1 -0
  258. package/dist/logger/logger.js +83 -0
  259. package/dist/logger/record.d.ts +919 -0
  260. package/dist/logger/record.d.ts.map +1 -0
  261. package/dist/logger/record.js +79 -0
  262. package/dist/logger/worker.d.ts +74 -0
  263. package/dist/logger/worker.d.ts.map +1 -0
  264. package/dist/logger/worker.js +54 -0
  265. package/dist/migrations/batch.d.ts +10 -0
  266. package/dist/migrations/batch.d.ts.map +1 -0
  267. package/dist/migrations/batch.js +193 -0
  268. package/dist/migrations/bookkeeping.d.ts +24 -0
  269. package/dist/migrations/bookkeeping.d.ts.map +1 -0
  270. package/dist/migrations/bookkeeping.js +57 -0
  271. package/dist/migrations/owner.d.ts +41 -0
  272. package/dist/migrations/owner.d.ts.map +1 -0
  273. package/dist/migrations/owner.js +105 -0
  274. package/dist/migrations/registry.d.ts +36 -0
  275. package/dist/migrations/registry.d.ts.map +1 -0
  276. package/dist/migrations/registry.js +70 -0
  277. package/dist/migrations/runner.d.ts +67 -0
  278. package/dist/migrations/runner.d.ts.map +1 -0
  279. package/dist/migrations/runner.js +218 -0
  280. package/dist/naming/domains.d.ts +108 -0
  281. package/dist/naming/domains.d.ts.map +1 -0
  282. package/dist/naming/domains.js +156 -0
  283. package/dist/naming/environment.d.ts +118 -0
  284. package/dist/naming/environment.d.ts.map +1 -0
  285. package/dist/naming/environment.js +190 -0
  286. package/dist/naming/feature.d.ts +68 -0
  287. package/dist/naming/feature.d.ts.map +1 -0
  288. package/dist/naming/feature.js +106 -0
  289. package/dist/naming/limits.d.ts +229 -0
  290. package/dist/naming/limits.d.ts.map +1 -0
  291. package/dist/naming/limits.js +187 -0
  292. package/dist/naming/provisionScope.d.ts +91 -0
  293. package/dist/naming/provisionScope.d.ts.map +1 -0
  294. package/dist/naming/provisionScope.js +65 -0
  295. package/dist/naming/resource.d.ts +169 -0
  296. package/dist/naming/resource.d.ts.map +1 -0
  297. package/dist/naming/resource.js +220 -0
  298. package/dist/naming/resourceNames.d.ts +83 -0
  299. package/dist/naming/resourceNames.d.ts.map +1 -0
  300. package/dist/naming/resourceNames.js +102 -0
  301. package/dist/naming/segment.d.ts +29 -0
  302. package/dist/naming/segment.d.ts.map +1 -0
  303. package/dist/naming/segment.js +31 -0
  304. package/dist/projection/asRead.d.ts +72 -0
  305. package/dist/projection/asRead.d.ts.map +1 -0
  306. package/dist/projection/asRead.js +169 -0
  307. package/dist/projection/published.d.ts +95 -0
  308. package/dist/projection/published.d.ts.map +1 -0
  309. package/dist/projection/published.js +114 -0
  310. package/dist/schema/describedness.d.ts +55 -0
  311. package/dist/schema/describedness.d.ts.map +1 -0
  312. package/dist/schema/describedness.js +180 -0
  313. package/dist/seed/compose.d.ts +41 -0
  314. package/dist/seed/compose.d.ts.map +1 -0
  315. package/dist/seed/compose.js +51 -0
  316. package/dist/seed/devLogin.d.ts +50 -0
  317. package/dist/seed/devLogin.d.ts.map +1 -0
  318. package/dist/seed/devLogin.js +52 -0
  319. package/dist/seed/exampleIdentities.d.ts +58 -0
  320. package/dist/seed/exampleIdentities.d.ts.map +1 -0
  321. package/dist/seed/exampleIdentities.js +26 -0
  322. package/dist/seed/metadata.d.ts +20 -0
  323. package/dist/seed/metadata.d.ts.map +1 -0
  324. package/dist/seed/metadata.js +27 -0
  325. package/dist/seed/seed.d.ts +264 -0
  326. package/dist/seed/seed.d.ts.map +1 -0
  327. package/dist/seed/seed.js +37 -0
  328. package/dist/seed/seededRows.d.ts +26 -0
  329. package/dist/seed/seededRows.d.ts.map +1 -0
  330. package/dist/seed/seededRows.js +20 -0
  331. package/dist/seed/writeD1.d.ts +43 -0
  332. package/dist/seed/writeD1.d.ts.map +1 -0
  333. package/dist/seed/writeD1.js +73 -0
  334. package/dist/seed/writeKv.d.ts +29 -0
  335. package/dist/seed/writeKv.d.ts.map +1 -0
  336. package/dist/seed/writeKv.js +63 -0
  337. package/dist/semver/semver.d.ts +62 -0
  338. package/dist/semver/semver.d.ts.map +1 -0
  339. package/dist/semver/semver.js +137 -0
  340. package/dist/text/comments.d.ts +62 -0
  341. package/dist/text/comments.d.ts.map +1 -0
  342. package/dist/text/comments.js +161 -0
  343. package/dist/version.generated.d.ts +5 -0
  344. package/dist/version.generated.d.ts.map +1 -0
  345. package/dist/version.generated.js +7 -0
  346. package/dist/worker/health.d.ts +39 -0
  347. package/dist/worker/health.d.ts.map +1 -0
  348. package/dist/worker/health.js +41 -0
  349. package/dist/worker/identity.d.ts +191 -0
  350. package/dist/worker/identity.d.ts.map +1 -0
  351. package/dist/worker/identity.js +162 -0
  352. package/dist/workflow/bindings.d.ts +41 -0
  353. package/dist/workflow/bindings.d.ts.map +1 -0
  354. package/dist/workflow/bindings.js +53 -0
  355. package/dist/workflow/dispatch.d.ts +98 -0
  356. package/dist/workflow/dispatch.d.ts.map +1 -0
  357. package/dist/workflow/dispatch.js +148 -0
  358. package/dist/workflow/dispatchRoute.d.ts +80 -0
  359. package/dist/workflow/dispatchRoute.d.ts.map +1 -0
  360. package/dist/workflow/dispatchRoute.js +134 -0
  361. package/dist/workflow/faults.d.ts +97 -0
  362. package/dist/workflow/faults.d.ts.map +1 -0
  363. package/dist/workflow/faults.js +111 -0
  364. package/dist/workflow/host.d.ts +176 -0
  365. package/dist/workflow/host.d.ts.map +1 -0
  366. package/dist/workflow/host.js +116 -0
  367. package/dist/workflow/hostEntry.d.ts +50 -0
  368. package/dist/workflow/hostEntry.d.ts.map +1 -0
  369. package/dist/workflow/hostEntry.js +24 -0
  370. package/dist/workflow/hostEnv.d.ts +143 -0
  371. package/dist/workflow/hostEnv.d.ts.map +1 -0
  372. package/dist/workflow/hostEnv.js +170 -0
  373. package/dist/workflow/loopback.d.ts +52 -0
  374. package/dist/workflow/loopback.d.ts.map +1 -0
  375. package/dist/workflow/loopback.js +76 -0
  376. package/dist/workflow/naming.d.ts +79 -0
  377. package/dist/workflow/naming.d.ts.map +1 -0
  378. package/dist/workflow/naming.js +138 -0
  379. package/dist/workflow/register.d.ts +19 -0
  380. package/dist/workflow/register.d.ts.map +1 -0
  381. package/dist/workflow/register.js +40 -0
  382. package/dist/workflow/schemas.d.ts +44 -0
  383. package/dist/workflow/schemas.d.ts.map +1 -0
  384. package/dist/workflow/schemas.js +43 -0
  385. package/dist/workflow/spec.d.ts +81 -0
  386. package/dist/workflow/spec.d.ts.map +1 -0
  387. package/dist/workflow/spec.js +0 -0
  388. package/dist/workflow/stepMessage.d.ts +122 -0
  389. package/dist/workflow/stepMessage.d.ts.map +1 -0
  390. package/dist/workflow/stepMessage.js +152 -0
  391. package/package.json +20 -9
  392. package/src/capability/manifest.ts +21 -0
  393. package/src/version.generated.ts +1 -1
@@ -0,0 +1,180 @@
1
+ import { InternalError } from "../error/pithyError.js";
2
+ import { z } from "zod";
3
+ //#region src/schema/describedness.ts
4
+ /** The kind tag Zod puts on a schema's definition. */
5
+ function kindOf(schema) {
6
+ return schema.def.type;
7
+ }
8
+ /**
9
+ * Kinds with no schema inside them. **Listed, so that anything not listed is a hole rather than a
10
+ * leaf** — that is the whole difference between a walk that can report and one that quietly cannot.
11
+ */
12
+ const LEAVES = /* @__PURE__ */ new Set([
13
+ "string",
14
+ "number",
15
+ "int",
16
+ "bigint",
17
+ "boolean",
18
+ "date",
19
+ "symbol",
20
+ "undefined",
21
+ "null",
22
+ "void",
23
+ "any",
24
+ "unknown",
25
+ "never",
26
+ "nan",
27
+ "literal",
28
+ "enum",
29
+ "file",
30
+ "template_literal",
31
+ "custom",
32
+ "transform",
33
+ "function",
34
+ "promise",
35
+ "lazy"
36
+ ]);
37
+ /**
38
+ * Wrappers that describe **the same documented thing** as what they wrap.
39
+ *
40
+ * `TenantFilter.optional().describe("…")` and `TenantFilter.describe("…").optional()` are one described
41
+ * field written two ways, and Zod's `.description` sits on whichever came last. A walk that demanded a
42
+ * description at both depths would report a field that is documented, which is how a gate gets deleted
43
+ * rather than obeyed — so a description is carried *inward* by {@link collectMissing} and looked for
44
+ * *outward* by {@link describedInChain}, and both directions are asserted.
45
+ *
46
+ * An `array` is deliberately not on this list: describing a list says nothing about the shape of its
47
+ * elements, and an undescribed object inside an array is the gap this walk was deepened to find.
48
+ */
49
+ const TRANSPARENT = /* @__PURE__ */ new Set([
50
+ "optional",
51
+ "nullable",
52
+ "default",
53
+ "prefault",
54
+ "readonly",
55
+ "catch",
56
+ "nonoptional"
57
+ ]);
58
+ /**
59
+ * The children of one schema, by kind. **Throws for a kind this walk has never been taught** — a
60
+ * walker whose unknown case is silently empty cannot report the thing it exists to report.
61
+ *
62
+ * A `pipe` is stepped through; a **codec** is not. This gate reads the schema tree, so wrapping an
63
+ * object in a guard — `refusesVanishingKey`, and anything else that pipes into a schema — would turn
64
+ * an export it checks into an export it silently skips, and losing coverage as a side effect of adding
65
+ * a guard is the wrong direction. A codec is the §Zod exemption spelled as a type rather than as an
66
+ * accident: `z.codec` builds a `ZodCodec`, so the exemption names codec helpers and nothing else.
67
+ * Measured in #326 — stepping through codecs too reports seven fields whose union sides carry no
68
+ * description, every one of them a `SQLiteDate` or a `sqliteJson`.
69
+ */
70
+ function childSchemas(schema, path) {
71
+ const def = schema.def;
72
+ switch (def.type) {
73
+ case "object": return Object.values(schema.shape);
74
+ case "array": return [def.element];
75
+ case "optional":
76
+ case "nullable":
77
+ case "default":
78
+ case "prefault":
79
+ case "readonly":
80
+ case "catch":
81
+ case "nonoptional":
82
+ case "success": return [def.innerType];
83
+ case "union": return def.options ?? [];
84
+ case "intersection": return [def.left, def.right];
85
+ case "tuple": return [...def.items ?? [], ...def.rest ? [def.rest] : []];
86
+ case "record":
87
+ case "map": return [def.keyType, def.valueType].filter(Boolean);
88
+ case "set": return [def.valueType];
89
+ case "pipe":
90
+ if (schema instanceof z.ZodCodec) return [];
91
+ return [schema.in, schema.out];
92
+ default:
93
+ if (LEAVES.has(def.type)) return [];
94
+ throw new InternalError({
95
+ message: "A schema kind this walk has never been taught was reached.",
96
+ action: `Add "${def.type}" to the switch in @pithy-sh/core/src/schema/describedness, or to its LEAVES.`,
97
+ detail: `${path}: unknown Zod kind "${def.type}". A kind silently treated as a leaf is a schema nothing is holding to CLAUDE.md §Zod.`
98
+ });
99
+ }
100
+ }
101
+ /**
102
+ * Whether a description sits anywhere in a field's transparent-wrapper chain.
103
+ *
104
+ * `.describe("…").optional()` puts it on the inner type and `.optional().describe("…")` puts it on the
105
+ * wrapper. Both are one described field. Only {@link TRANSPARENT} wrappers are followed — an `array`
106
+ * or a `pipe` describes something other than what it holds.
107
+ */
108
+ function describedInChain(schema) {
109
+ let current = schema;
110
+ const seen = /* @__PURE__ */ new Set();
111
+ while (current && !seen.has(current)) {
112
+ if (current.description) return true;
113
+ if (!TRANSPARENT.has(kindOf(current))) return false;
114
+ seen.add(current);
115
+ current = current.def?.innerType;
116
+ }
117
+ return false;
118
+ }
119
+ /**
120
+ * Record any object/enum/union missing a `.describe()` — on the schema itself or on any of its
121
+ * fields — following every container Zod has. Codec-helper primitives are exempt (CLAUDE.md §Zod) and
122
+ * are not objects/enums/unions, so they are skipped.
123
+ *
124
+ * `described` carries a transparent wrapper's own description inward; see {@link TRANSPARENT}.
125
+ */
126
+ function collectMissing(schema, path, walk, seen, described = false) {
127
+ if (seen.has(schema)) return;
128
+ seen.add(schema);
129
+ const kind = kindOf(schema);
130
+ const documented = described || describedInChain(schema);
131
+ if (kind === "object") {
132
+ if (!documented) walk.missing.push(`${path} — object has no .describe()`);
133
+ for (const [key, field] of Object.entries(schema.shape)) {
134
+ const fieldSchema = field;
135
+ walk.fields += 1;
136
+ if (!describedInChain(fieldSchema)) walk.missing.push(`${path}.${key} — field has no .describe()`);
137
+ collectMissing(fieldSchema, `${path}.${key}`, walk, seen);
138
+ }
139
+ return;
140
+ }
141
+ if ((kind === "union" || kind === "enum") && !documented) walk.missing.push(`${path} — enum/union has no .describe()`);
142
+ const inherited = TRANSPARENT.has(kind) && documented;
143
+ for (const [index, child] of childSchemas(schema, path).entries()) collectMissing(child, `${path}[${kind}:${index}]`, walk, seen, inherited);
144
+ }
145
+ /** One schema, walked. The entry point a unit test reaches for. */
146
+ function undescribed(schema, path = "schema") {
147
+ const walk = {
148
+ missing: [],
149
+ fields: 0
150
+ };
151
+ collectMissing(schema, path, walk, /* @__PURE__ */ new Set());
152
+ return walk;
153
+ }
154
+ /**
155
+ * Every exported Zod schema in a package, walked.
156
+ *
157
+ * Takes the result of `import.meta.glob([...], { eager: true })`. The counts come back with the
158
+ * findings **because a sweep that found nothing and a sweep that looked at nothing are the same green
159
+ * run otherwise** — the caller pins all three against literals of its own.
160
+ */
161
+ function undescribedExports(modules) {
162
+ const walk = {
163
+ missing: [],
164
+ fields: 0
165
+ };
166
+ const seen = /* @__PURE__ */ new Set();
167
+ let schemas = 0;
168
+ for (const [file, mod] of Object.entries(modules)) for (const [name, value] of Object.entries(mod)) {
169
+ if (!(value instanceof z.ZodType)) continue;
170
+ schemas += 1;
171
+ collectMissing(value, `${file}:${name}`, walk, seen);
172
+ }
173
+ return {
174
+ ...walk,
175
+ modules: Object.keys(modules).length,
176
+ schemas
177
+ };
178
+ }
179
+ //#endregion
180
+ export { childSchemas, collectMissing, describedInChain, undescribed, undescribedExports };
@@ -0,0 +1,41 @@
1
+ import type { Capability } from "../capability/capability";
2
+ import type { SeedSet } from "./seed";
3
+ /** Maximum per-set `order`, derived from the prefix width so the two never drift. */
4
+ export declare const MAX_SEED_ORDER: number;
5
+ /** Options controlling how `composeSeeds` filters and resolves the registry. */
6
+ export interface ComposeSeedsOptions {
7
+ /** The environment being seeded. A set is included only if its `environments` lists this value. */
8
+ env: string;
9
+ /** Whether `example` sets are composed in (the project's `seed.includeExamples`; default off). */
10
+ includeExamples: boolean;
11
+ }
12
+ /** One capability's seed set, resolved into a stably-keyed, ready-to-run entry. */
13
+ export interface ResolvedSeedSet {
14
+ /** The namespaced, order-prefixed key: `NNNN_<capability>_<name>` — the stable sort/identity key. */
15
+ key: string;
16
+ /** The capability that contributed this set (the namespace). */
17
+ capability: string;
18
+ /** The original set. */
19
+ set: SeedSet;
20
+ }
21
+ /** The result of composing every capability's seed sets for one environment. */
22
+ export interface ComposedSeeds {
23
+ /** The runnable sets, ordered library-before-app (`order`, then the namespaced key). */
24
+ sets: ResolvedSeedSet[];
25
+ /**
26
+ * The namespaced keys of sets present in the registry but not allowed in the requested env (their
27
+ * `environments` did not list it). Surfaced so the CLI can refuse a set explicitly targeted for a
28
+ * disallowed env, rather than silently doing nothing.
29
+ */
30
+ skippedByEnv: string[];
31
+ }
32
+ /**
33
+ * Merge every capability's `seeds` into one ordered registry for `env`, mirroring the migration
34
+ * composer. Each set's key is `NNNN_<capability>_<name>` (NNNN = zero-padded `order`), so the sort
35
+ * is dependency-correct (libraries before app) and stable across releases. `example` sets are
36
+ * dropped unless `includeExamples`; sets whose `environments` does not list `env` are dropped from
37
+ * the runnable list but reported in `skippedByEnv` (the env-allowlist safety layer). A set name used
38
+ * twice within one capability throws an `InternalError` attributed to that capability.
39
+ */
40
+ export declare function composeSeeds(capabilities: readonly Capability[], options: ComposeSeedsOptions): ComposedSeeds;
41
+ //# sourceMappingURL=compose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/seed/compose.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKtC,qFAAqF;AACrF,eAAO,MAAM,cAAc,QAAyB,CAAC;AAErD,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,mGAAmG;IACnG,GAAG,EAAE,MAAM,CAAC;IACZ,kGAAkG;IAClG,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC9B,qGAAqG;IACrG,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,wBAAwB;IACxB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC5B,wFAAwF;IACxF,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB;;;;OAIG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAWD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,SAAS,UAAU,EAAE,EAAE,OAAO,EAAE,mBAAmB,GAAG,aAAa,CAiC7G"}
@@ -0,0 +1,51 @@
1
+ import { InternalError } from "../error/pithyError.js";
2
+ //#region src/seed/compose.ts
3
+ /** Width of the zero-padded `order` prefix in a composed key — the stable sort anchor. */
4
+ const ORDER_DIGITS = 4;
5
+ /** Maximum per-set `order`, derived from the prefix width so the two never drift. */
6
+ const MAX_SEED_ORDER = 10 ** ORDER_DIGITS - 1;
7
+ /** A bad `order` is a capability-author mistake — surfaced at compose (build), so the value rides along. */
8
+ function assertValidOrder(order, capability, name) {
9
+ if (!Number.isInteger(order) || order < 0 || order > 9999) throw new InternalError({ message: `seed order ${order} (set "${name}" in capability "${capability}") must be an integer in 0..${MAX_SEED_ORDER}.` });
10
+ }
11
+ /**
12
+ * Merge every capability's `seeds` into one ordered registry for `env`, mirroring the migration
13
+ * composer. Each set's key is `NNNN_<capability>_<name>` (NNNN = zero-padded `order`), so the sort
14
+ * is dependency-correct (libraries before app) and stable across releases. `example` sets are
15
+ * dropped unless `includeExamples`; sets whose `environments` does not list `env` are dropped from
16
+ * the runnable list but reported in `skippedByEnv` (the env-allowlist safety layer). A set name used
17
+ * twice within one capability throws an `InternalError` attributed to that capability.
18
+ */
19
+ function composeSeeds(capabilities, options) {
20
+ const sets = [];
21
+ const skippedByEnv = [];
22
+ for (const cap of capabilities) {
23
+ const seen = /* @__PURE__ */ new Set();
24
+ for (const set of cap.seeds ?? []) {
25
+ if (seen.has(set.name)) throw new InternalError({
26
+ message: `Duplicate seed set "${set.name}" in capability "${cap.name}".`,
27
+ action: "Give every seed set within a capability a unique name."
28
+ });
29
+ seen.add(set.name);
30
+ assertValidOrder(set.order, cap.name, set.name);
31
+ if (set.example && !options.includeExamples) continue;
32
+ const key = `${String(set.order).padStart(ORDER_DIGITS, "0")}_${cap.name}_${set.name}`;
33
+ if (!set.environments.includes(options.env)) {
34
+ skippedByEnv.push(key);
35
+ continue;
36
+ }
37
+ sets.push({
38
+ key,
39
+ capability: cap.name,
40
+ set
41
+ });
42
+ }
43
+ }
44
+ sets.sort((a, b) => a.set.order - b.set.order || a.key.localeCompare(b.key));
45
+ return {
46
+ sets,
47
+ skippedByEnv
48
+ };
49
+ }
50
+ //#endregion
51
+ export { MAX_SEED_ORDER, composeSeeds };
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The dev-login artifact: the one file a seed run writes so `pithy dev` can say how to sign in.
4
+ *
5
+ * It lives in core because it has two ends in two packages that must not depend on each other — the
6
+ * auth capability mints it inside its seed set, and the CLI reads it to print the ready banner. Core is
7
+ * the seam they already share, so the shape is stated once instead of being duplicated (and drifting) at
8
+ * both ends.
9
+ *
10
+ * **The file holds a live credential.** A signed session cookie for a local database is a way in for
11
+ * anyone who can read it, which is why it is written under `logs/` — gitignored by the starter template,
12
+ * so it can never be committed — and why nothing here is ever put in a `PithyError` (the payload reaches
13
+ * logs verbatim).
14
+ */
15
+ /** The directory seed artifacts are written to, relative to the project root. Gitignored, so transient. */
16
+ export declare const SEED_ARTIFACT_DIR = "logs";
17
+ /** The dev-login file's name within {@link SEED_ARTIFACT_DIR}. The `pithy dev` banner reads it by this name. */
18
+ export declare const DEV_LOGIN_FILE = "dev-login.json";
19
+ /** The dev-login file's path relative to the project root — what the banner and the docs both name. */
20
+ export declare const DEV_LOGIN_PATH = "logs/dev-login.json";
21
+ /**
22
+ * The dev-login **route**: where a `dev` composition serves the seeded session as a `Set-Cookie` and a
23
+ * redirect, so signing in is a URL rather than a value pasted into a browser console.
24
+ *
25
+ * It is stated here, beside the file, because the two ends are the same two packages the file already
26
+ * had to reconcile — the auth capability registers it, and `pithy dev` opens it — and neither may
27
+ * import the other. A second spelling in one of them is a `l` that opens a 404.
28
+ *
29
+ * **`__pithy/` is the namespace, and the reservation is the point.** An adopter's own routes are theirs;
30
+ * anything the kit serves that is not part of a capability's public surface lives under this prefix, so
31
+ * a route added here can never collide with an application path someone already shipped.
32
+ *
33
+ * Registered **only** in a `dev` composition, and never under CI. It mints an authenticated session with
34
+ * no credential presented, which is the whole risk of the feature and the reason its gates live at
35
+ * registration rather than inside the handler.
36
+ */
37
+ export declare const DEV_LOGIN_ROUTE = "/__pithy/dev-login";
38
+ /**
39
+ * A seeded dev login — everything a browser needs to be signed in as a seeded user, and nothing else.
40
+ * `z.input` is the JSON on disk (dates as ISO-8601 strings); `z.output` is the app shape.
41
+ */
42
+ export declare const DevLogin: z.ZodObject<{
43
+ email: z.ZodString;
44
+ userId: z.ZodString;
45
+ cookieName: z.ZodString;
46
+ cookieValue: z.ZodString;
47
+ expiresAt: z.ZodCodec<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>, z.ZodDate>;
48
+ }, z.core.$strip>;
49
+ export type DevLogin = z.output<typeof DevLogin>;
50
+ //# sourceMappingURL=devLogin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devLogin.d.ts","sourceRoot":"","sources":["../../src/seed/devLogin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;GAYG;AAEH,2GAA2G;AAC3G,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC,gHAAgH;AAChH,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,uGAAuG;AACvG,eAAO,MAAM,cAAc,wBAA2C,CAAC;AAEvE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;iBAc8F,CAAC;AACpH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { JsonDate } from "../data/codecs.js";
2
+ import { z } from "zod";
3
+ //#region src/seed/devLogin.ts
4
+ /**
5
+ * The dev-login artifact: the one file a seed run writes so `pithy dev` can say how to sign in.
6
+ *
7
+ * It lives in core because it has two ends in two packages that must not depend on each other — the
8
+ * auth capability mints it inside its seed set, and the CLI reads it to print the ready banner. Core is
9
+ * the seam they already share, so the shape is stated once instead of being duplicated (and drifting) at
10
+ * both ends.
11
+ *
12
+ * **The file holds a live credential.** A signed session cookie for a local database is a way in for
13
+ * anyone who can read it, which is why it is written under `logs/` — gitignored by the starter template,
14
+ * so it can never be committed — and why nothing here is ever put in a `PithyError` (the payload reaches
15
+ * logs verbatim).
16
+ */
17
+ /** The directory seed artifacts are written to, relative to the project root. Gitignored, so transient. */
18
+ const SEED_ARTIFACT_DIR = "logs";
19
+ /** The dev-login file's name within {@link SEED_ARTIFACT_DIR}. The `pithy dev` banner reads it by this name. */
20
+ const DEV_LOGIN_FILE = "dev-login.json";
21
+ /** The dev-login file's path relative to the project root — what the banner and the docs both name. */
22
+ const DEV_LOGIN_PATH = `${SEED_ARTIFACT_DIR}/${DEV_LOGIN_FILE}`;
23
+ /**
24
+ * The dev-login **route**: where a `dev` composition serves the seeded session as a `Set-Cookie` and a
25
+ * redirect, so signing in is a URL rather than a value pasted into a browser console.
26
+ *
27
+ * It is stated here, beside the file, because the two ends are the same two packages the file already
28
+ * had to reconcile — the auth capability registers it, and `pithy dev` opens it — and neither may
29
+ * import the other. A second spelling in one of them is a `l` that opens a 404.
30
+ *
31
+ * **`__pithy/` is the namespace, and the reservation is the point.** An adopter's own routes are theirs;
32
+ * anything the kit serves that is not part of a capability's public surface lives under this prefix, so
33
+ * a route added here can never collide with an application path someone already shipped.
34
+ *
35
+ * Registered **only** in a `dev` composition, and never under CI. It mints an authenticated session with
36
+ * no credential presented, which is the whole risk of the feature and the reason its gates live at
37
+ * registration rather than inside the handler.
38
+ */
39
+ const DEV_LOGIN_ROUTE = "/__pithy/dev-login";
40
+ /**
41
+ * A seeded dev login — everything a browser needs to be signed in as a seeded user, and nothing else.
42
+ * `z.input` is the JSON on disk (dates as ISO-8601 strings); `z.output` is the app shape.
43
+ */
44
+ const DevLogin = z.object({
45
+ email: z.string().describe("The seeded user this cookie signs in as. Shown on the `pithy dev` ready banner."),
46
+ userId: z.string().describe("The seeded user's id, so a tool can correlate the cookie with the seeded rows."),
47
+ cookieName: z.string().describe("The cookie name the auth capability's session is read from, e.g. `better-auth.session_token`."),
48
+ cookieValue: z.string().describe("The signed, URI-encoded cookie value. A live credential for the local database — never logged, never committed, never in an error payload."),
49
+ expiresAt: JsonDate.describe("When the seeded session expires. ISO-8601 text on disk; a `Date` in app code.")
50
+ }).describe("A seeded dev login: the signed session cookie for one seeded user, written to `logs/dev-login.json`.");
51
+ //#endregion
52
+ export { DEV_LOGIN_FILE, DEV_LOGIN_PATH, DEV_LOGIN_ROUTE, DevLogin, SEED_ARTIFACT_DIR };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The canonical example identities — a small, fixed cast of demo users that every capability's
3
+ * example seed set references. It is what makes `pithy seed` (with `seed.includeExamples`) fill a
4
+ * fresh backend with *connected* data instead of isolated rows: the same three users own the seeded
5
+ * auth records, leaderboard scores, ledger balances, and multiplayer results, so a new project can
6
+ * see the whole stack working together in `dev` without authoring a fixture first.
7
+ *
8
+ * This is the shared vocabulary that lets each capability seed user-linked rows without depending on
9
+ * `@pithy-sh/auth` — or on each other. Every module reads these ids from `@pithy-sh/core`, the one
10
+ * seam they all share (capabilities depend on core seams, never each other's internals). It is a
11
+ * seeding *convention*, the peer of the standard asset-metadata block: a handful of stable
12
+ * constants, never a data set.
13
+ *
14
+ * The ids are stable and human-legible (`example-<name>`) so seeded rows are obvious in a dev
15
+ * database. Emails use the reserved `example.com` domain (RFC 2606) so a seeded user can never
16
+ * collide with, or be mistaken for, a real address.
17
+ */
18
+ /** One canonical demo user — the shared identity a capability's example seed hangs its rows off. */
19
+ export interface ExampleIdentity {
20
+ /** The stable demo user id — used as the `userId`/owner across every capability's example seed. */
21
+ id: string;
22
+ /** The user's display name. */
23
+ name: string;
24
+ /** The user's unique email, on the reserved `example.com` domain. */
25
+ email: string;
26
+ }
27
+ /**
28
+ * The canonical demo cast, in a stable order. Referenced by every capability's example seed set so
29
+ * the seeded data is connected across tables. Keep it tiny — this is a demonstration, not a dataset.
30
+ */
31
+ export declare const EXAMPLE_IDENTITIES: readonly [{
32
+ readonly id: "example-ada";
33
+ readonly name: "Ada Lovelace";
34
+ readonly email: "ada@example.com";
35
+ }, {
36
+ readonly id: "example-grace";
37
+ readonly name: "Grace Hopper";
38
+ readonly email: "grace@example.com";
39
+ }, {
40
+ readonly id: "example-alan";
41
+ readonly name: "Alan Turing";
42
+ readonly email: "alan@example.com";
43
+ }];
44
+ /** The three canonical identities by name, for readable references in fixtures (`EXAMPLE_ADA.id`). */
45
+ export declare const EXAMPLE_ADA: {
46
+ readonly id: "example-ada";
47
+ readonly name: "Ada Lovelace";
48
+ readonly email: "ada@example.com";
49
+ }, EXAMPLE_GRACE: {
50
+ readonly id: "example-grace";
51
+ readonly name: "Grace Hopper";
52
+ readonly email: "grace@example.com";
53
+ }, EXAMPLE_ALAN: {
54
+ readonly id: "example-alan";
55
+ readonly name: "Alan Turing";
56
+ readonly email: "alan@example.com";
57
+ };
58
+ //# sourceMappingURL=exampleIdentities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exampleIdentities.d.ts","sourceRoot":"","sources":["../../src/seed/exampleIdentities.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AAEH,oGAAoG;AACpG,MAAM,WAAW,eAAe;IAC9B,mGAAmG;IACnG,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB;iBACvB,aAAa;mBAAQ,cAAc;oBAAS,iBAAiB;;iBAC7D,eAAe;mBAAQ,cAAc;oBAAS,mBAAmB;;iBACjE,cAAc;mBAAQ,aAAa;oBAAS,kBAAkB;EACvB,CAAC;AAEhD,sGAAsG;AACtG,eAAO,MAAO,WAAW;iBANjB,aAAa;mBAAQ,cAAc;oBAAS,iBAAiB;GAM1C,aAAa;iBALhC,eAAe;mBAAQ,cAAc;oBAAS,mBAAmB;GAK/B,YAAY;iBAJ9C,cAAc;mBAAQ,aAAa;oBAAS,kBAAkB;CAIM,CAAC"}
@@ -0,0 +1,26 @@
1
+ //#region src/seed/exampleIdentities.ts
2
+ /**
3
+ * The canonical demo cast, in a stable order. Referenced by every capability's example seed set so
4
+ * the seeded data is connected across tables. Keep it tiny — this is a demonstration, not a dataset.
5
+ */
6
+ const EXAMPLE_IDENTITIES = [
7
+ {
8
+ id: "example-ada",
9
+ name: "Ada Lovelace",
10
+ email: "ada@example.com"
11
+ },
12
+ {
13
+ id: "example-grace",
14
+ name: "Grace Hopper",
15
+ email: "grace@example.com"
16
+ },
17
+ {
18
+ id: "example-alan",
19
+ name: "Alan Turing",
20
+ email: "alan@example.com"
21
+ }
22
+ ];
23
+ /** The three canonical identities by name, for readable references in fixtures (`EXAMPLE_ADA.id`). */
24
+ const [EXAMPLE_ADA, EXAMPLE_GRACE, EXAMPLE_ALAN] = EXAMPLE_IDENTITIES;
25
+ //#endregion
26
+ export { EXAMPLE_ADA, EXAMPLE_ALAN, EXAMPLE_GRACE, EXAMPLE_IDENTITIES };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The standard Cloudflare-asset metadata convention.
3
+ *
4
+ * Every write to a shared Images/Stream store (seeded assets are the first consumer, but the
5
+ * convention is account-wide) stamps a small, stable metadata block so an asset can be attributed
6
+ * and scoped without a separate lookup — most importantly to the environment that created it, so a
7
+ * staging teardown never touches a production asset. App-defined fields (e.g. `userId`) merge on
8
+ * top; the standard keys always win, so a caller's `extra` can never overwrite `pithyEnv`.
9
+ */
10
+ /** The metadata key carrying the environment an asset was created in — the scoping anchor. */
11
+ export declare const PITHY_ENV_METADATA_KEY = "pithyEnv";
12
+ /** The metadata keys Pithy sets on every shared-asset write. Kept stable and documented. */
13
+ export declare const STANDARD_ASSET_METADATA_KEYS: readonly string[];
14
+ /**
15
+ * Build the metadata block for a shared-asset upload: the standard keys (at minimum
16
+ * `{ pithyEnv: env }`) merged over any app-defined `extra`. The standard keys are applied last, so
17
+ * they always win — `extra` can add fields but never override the scoping anchor.
18
+ */
19
+ export declare function buildAssetMetadata(env: string, extra?: Record<string, string>): Record<string, string>;
20
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/seed/metadata.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,8FAA8F;AAC9F,eAAO,MAAM,sBAAsB,aAAa,CAAC;AAEjD,4FAA4F;AAC5F,eAAO,MAAM,4BAA4B,EAAE,SAAS,MAAM,EAA6B,CAAC;AAExF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEtG"}
@@ -0,0 +1,27 @@
1
+ //#region src/seed/metadata.ts
2
+ /**
3
+ * The standard Cloudflare-asset metadata convention.
4
+ *
5
+ * Every write to a shared Images/Stream store (seeded assets are the first consumer, but the
6
+ * convention is account-wide) stamps a small, stable metadata block so an asset can be attributed
7
+ * and scoped without a separate lookup — most importantly to the environment that created it, so a
8
+ * staging teardown never touches a production asset. App-defined fields (e.g. `userId`) merge on
9
+ * top; the standard keys always win, so a caller's `extra` can never overwrite `pithyEnv`.
10
+ */
11
+ /** The metadata key carrying the environment an asset was created in — the scoping anchor. */
12
+ const PITHY_ENV_METADATA_KEY = "pithyEnv";
13
+ /** The metadata keys Pithy sets on every shared-asset write. Kept stable and documented. */
14
+ const STANDARD_ASSET_METADATA_KEYS = [PITHY_ENV_METADATA_KEY];
15
+ /**
16
+ * Build the metadata block for a shared-asset upload: the standard keys (at minimum
17
+ * `{ pithyEnv: env }`) merged over any app-defined `extra`. The standard keys are applied last, so
18
+ * they always win — `extra` can add fields but never override the scoping anchor.
19
+ */
20
+ function buildAssetMetadata(env, extra) {
21
+ return {
22
+ ...extra,
23
+ [PITHY_ENV_METADATA_KEY]: env
24
+ };
25
+ }
26
+ //#endregion
27
+ export { PITHY_ENV_METADATA_KEY, STANDARD_ASSET_METADATA_KEYS, buildAssetMetadata };