blodemd 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/dist/cli.mjs +50 -174
  2. package/dist/cli.mjs.map +1 -1
  3. package/package.json +3 -36
  4. package/dev-server/app/[[...slug]]/page.tsx +0 -140
  5. package/dev-server/app/blodemd-dev/invalidate/route.ts +0 -12
  6. package/dev-server/app/blodemd-dev/static/[...path]/route.ts +0 -32
  7. package/dev-server/app/blodemd-dev/version/route.ts +0 -14
  8. package/dev-server/app/blodemd-internal/proxy/route.ts +0 -86
  9. package/dev-server/app/error.tsx +0 -24
  10. package/dev-server/app/favicon.ico +0 -0
  11. package/dev-server/app/globals.css +0 -4
  12. package/dev-server/app/layout.tsx +0 -38
  13. package/dev-server/app/not-found.tsx +0 -18
  14. package/dev-server/app/search/route.ts +0 -17
  15. package/dev-server/components/dev-reload-script.tsx +0 -86
  16. package/dev-server/components/providers.tsx +0 -15
  17. package/dev-server/lib/dev-state.ts +0 -8
  18. package/dev-server/lib/local-content-source.ts +0 -103
  19. package/dev-server/lib/local-runtime.tsx +0 -555
  20. package/dev-server/next-env.d.ts +0 -5
  21. package/dev-server/next.config.js +0 -54
  22. package/dev-server/package.json +0 -61
  23. package/dev-server/postcss.config.mjs +0 -7
  24. package/dev-server/public/glide-variable.woff2 +0 -0
  25. package/dev-server/tsconfig.json +0 -50
  26. package/docs/app/globals.css +0 -471
  27. package/docs/components/animate-ui/primitives/buttons/button.tsx +0 -14
  28. package/docs/components/api/api-playground.tsx +0 -467
  29. package/docs/components/api/api-reference.tsx +0 -157
  30. package/docs/components/content/collection-index.tsx +0 -114
  31. package/docs/components/docs/contextual-menu.tsx +0 -495
  32. package/docs/components/docs/copy-page-menu.tsx +0 -364
  33. package/docs/components/docs/doc-header.tsx +0 -223
  34. package/docs/components/docs/doc-shell.tsx +0 -355
  35. package/docs/components/docs/doc-sidebar.tsx +0 -256
  36. package/docs/components/docs/doc-toc.tsx +0 -46
  37. package/docs/components/docs/mobile-nav.tsx +0 -195
  38. package/docs/components/docs/sidebar-active-highlight.tsx +0 -34
  39. package/docs/components/docs/sidebar-scroll-area.tsx +0 -63
  40. package/docs/components/git/repo-picker.tsx +0 -529
  41. package/docs/components/icons/doc-icon.tsx +0 -96
  42. package/docs/components/mdx/accordion.tsx +0 -83
  43. package/docs/components/mdx/agent-instructions.tsx +0 -17
  44. package/docs/components/mdx/badge.tsx +0 -79
  45. package/docs/components/mdx/callout.tsx +0 -88
  46. package/docs/components/mdx/card.tsx +0 -110
  47. package/docs/components/mdx/code-block.tsx +0 -80
  48. package/docs/components/mdx/code-group.tsx +0 -203
  49. package/docs/components/mdx/color.tsx +0 -87
  50. package/docs/components/mdx/columns.tsx +0 -25
  51. package/docs/components/mdx/expandable.tsx +0 -45
  52. package/docs/components/mdx/field-layout.tsx +0 -77
  53. package/docs/components/mdx/frame.tsx +0 -23
  54. package/docs/components/mdx/get-text-content.ts +0 -18
  55. package/docs/components/mdx/icon.tsx +0 -12
  56. package/docs/components/mdx/iframe.tsx +0 -62
  57. package/docs/components/mdx/index.tsx +0 -121
  58. package/docs/components/mdx/installer.tsx +0 -20
  59. package/docs/components/mdx/panel.tsx +0 -11
  60. package/docs/components/mdx/param-field.tsx +0 -56
  61. package/docs/components/mdx/preview.tsx +0 -36
  62. package/docs/components/mdx/prompt.tsx +0 -63
  63. package/docs/components/mdx/request-example.tsx +0 -27
  64. package/docs/components/mdx/response-field.tsx +0 -42
  65. package/docs/components/mdx/steps.tsx +0 -92
  66. package/docs/components/mdx/tabs.tsx +0 -193
  67. package/docs/components/mdx/tile.tsx +0 -43
  68. package/docs/components/mdx/tooltip.tsx +0 -71
  69. package/docs/components/mdx/tree.tsx +0 -120
  70. package/docs/components/mdx/type-table.tsx +0 -71
  71. package/docs/components/mdx/update.tsx +0 -44
  72. package/docs/components/mdx/video.tsx +0 -45
  73. package/docs/components/mdx/view.tsx +0 -66
  74. package/docs/components/posthog-provider.tsx +0 -42
  75. package/docs/components/providers.tsx +0 -15
  76. package/docs/components/tenant-analytics.tsx +0 -49
  77. package/docs/components/third-parties.tsx +0 -32
  78. package/docs/components/ui/badge.tsx +0 -61
  79. package/docs/components/ui/breadcrumb.tsx +0 -112
  80. package/docs/components/ui/button-group.tsx +0 -83
  81. package/docs/components/ui/button.tsx +0 -65
  82. package/docs/components/ui/card.tsx +0 -92
  83. package/docs/components/ui/command.tsx +0 -167
  84. package/docs/components/ui/copy-button.tsx +0 -129
  85. package/docs/components/ui/dialog.tsx +0 -146
  86. package/docs/components/ui/field.tsx +0 -237
  87. package/docs/components/ui/input.tsx +0 -23
  88. package/docs/components/ui/kbd.tsx +0 -98
  89. package/docs/components/ui/label.tsx +0 -22
  90. package/docs/components/ui/morph-icon.tsx +0 -79
  91. package/docs/components/ui/popover.tsx +0 -267
  92. package/docs/components/ui/search-dialog.tsx +0 -431
  93. package/docs/components/ui/search.tsx +0 -101
  94. package/docs/components/ui/separator.tsx +0 -26
  95. package/docs/components/ui/sheet.tsx +0 -133
  96. package/docs/components/ui/sidebar.tsx +0 -758
  97. package/docs/components/ui/skeleton.tsx +0 -11
  98. package/docs/components/ui/switch.tsx +0 -32
  99. package/docs/components/ui/tabs.tsx +0 -138
  100. package/docs/components/ui/theme-toggle.tsx +0 -62
  101. package/docs/components/ui/tooltip.tsx +0 -53
  102. package/docs/components/web-mcp.tsx +0 -115
  103. package/docs/lib/agent-skills.ts +0 -48
  104. package/docs/lib/api-client.ts +0 -72
  105. package/docs/lib/config.ts +0 -6
  106. package/docs/lib/content-root.ts +0 -33
  107. package/docs/lib/content-source.ts +0 -70
  108. package/docs/lib/contextual-options.ts +0 -222
  109. package/docs/lib/dashboard-session.ts +0 -167
  110. package/docs/lib/db.ts +0 -13
  111. package/docs/lib/docs-collection.ts +0 -7
  112. package/docs/lib/docs-runtime.tsx +0 -745
  113. package/docs/lib/edge-config.ts +0 -95
  114. package/docs/lib/env.ts +0 -23
  115. package/docs/lib/etag.ts +0 -22
  116. package/docs/lib/github-install.ts +0 -33
  117. package/docs/lib/llms-full.ts +0 -82
  118. package/docs/lib/marketing-markdown.ts +0 -79
  119. package/docs/lib/marketing-site.ts +0 -31
  120. package/docs/lib/mdx.ts +0 -98
  121. package/docs/lib/navigation.ts +0 -288
  122. package/docs/lib/openapi-proxy.ts +0 -88
  123. package/docs/lib/openapi.ts +0 -158
  124. package/docs/lib/platform-config.ts +0 -6
  125. package/docs/lib/project-authz.ts +0 -46
  126. package/docs/lib/routes.ts +0 -103
  127. package/docs/lib/server-cache.ts +0 -83
  128. package/docs/lib/shiki.ts +0 -44
  129. package/docs/lib/supabase.ts +0 -37
  130. package/docs/lib/tenancy.ts +0 -364
  131. package/docs/lib/tenant-headers.ts +0 -43
  132. package/docs/lib/tenant-static.ts +0 -705
  133. package/docs/lib/tenant-utility-context.ts +0 -62
  134. package/docs/lib/tenants.ts +0 -72
  135. package/docs/lib/theme.ts +0 -29
  136. package/docs/lib/time-ago.ts +0 -24
  137. package/docs/lib/toc.ts +0 -2
  138. package/docs/lib/use-mobile.ts +0 -19
  139. package/docs/lib/use-tab-observer.ts +0 -71
  140. package/docs/lib/utils.ts +0 -5
  141. package/packages/@repo/common/dist/index.d.ts +0 -16
  142. package/packages/@repo/common/dist/index.d.ts.map +0 -1
  143. package/packages/@repo/common/dist/index.js +0 -84
  144. package/packages/@repo/common/package.json +0 -34
  145. package/packages/@repo/common/src/index.ts +0 -101
  146. package/packages/@repo/contracts/dist/analytics.d.ts +0 -21
  147. package/packages/@repo/contracts/dist/analytics.d.ts.map +0 -1
  148. package/packages/@repo/contracts/dist/analytics.js +0 -18
  149. package/packages/@repo/contracts/dist/api-key.d.ts +0 -27
  150. package/packages/@repo/contracts/dist/api-key.d.ts.map +0 -1
  151. package/packages/@repo/contracts/dist/api-key.js +0 -20
  152. package/packages/@repo/contracts/dist/dates.d.ts +0 -4
  153. package/packages/@repo/contracts/dist/dates.d.ts.map +0 -1
  154. package/packages/@repo/contracts/dist/dates.js +0 -2
  155. package/packages/@repo/contracts/dist/deployment.d.ts +0 -71
  156. package/packages/@repo/contracts/dist/deployment.d.ts.map +0 -1
  157. package/packages/@repo/contracts/dist/deployment.js +0 -46
  158. package/packages/@repo/contracts/dist/domain.d.ts +0 -94
  159. package/packages/@repo/contracts/dist/domain.d.ts.map +0 -1
  160. package/packages/@repo/contracts/dist/domain.js +0 -36
  161. package/packages/@repo/contracts/dist/git.d.ts +0 -28
  162. package/packages/@repo/contracts/dist/git.d.ts.map +0 -1
  163. package/packages/@repo/contracts/dist/git.js +0 -24
  164. package/packages/@repo/contracts/dist/ids.d.ts +0 -14
  165. package/packages/@repo/contracts/dist/ids.d.ts.map +0 -1
  166. package/packages/@repo/contracts/dist/ids.js +0 -11
  167. package/packages/@repo/contracts/dist/index.d.ts +0 -12
  168. package/packages/@repo/contracts/dist/index.d.ts.map +0 -1
  169. package/packages/@repo/contracts/dist/index.js +0 -13
  170. package/packages/@repo/contracts/dist/pagination.d.ts +0 -23
  171. package/packages/@repo/contracts/dist/pagination.d.ts.map +0 -1
  172. package/packages/@repo/contracts/dist/pagination.js +0 -15
  173. package/packages/@repo/contracts/dist/project.d.ts +0 -42
  174. package/packages/@repo/contracts/dist/project.d.ts.map +0 -1
  175. package/packages/@repo/contracts/dist/project.js +0 -25
  176. package/packages/@repo/contracts/dist/tenant.d.ts +0 -147
  177. package/packages/@repo/contracts/dist/tenant.d.ts.map +0 -1
  178. package/packages/@repo/contracts/dist/tenant.js +0 -58
  179. package/packages/@repo/contracts/dist/user.d.ts +0 -9
  180. package/packages/@repo/contracts/dist/user.d.ts.map +0 -1
  181. package/packages/@repo/contracts/dist/user.js +0 -9
  182. package/packages/@repo/contracts/package.json +0 -37
  183. package/packages/@repo/contracts/src/analytics.ts +0 -33
  184. package/packages/@repo/contracts/src/api-key.ts +0 -27
  185. package/packages/@repo/contracts/src/dates.ts +0 -4
  186. package/packages/@repo/contracts/src/deployment.ts +0 -73
  187. package/packages/@repo/contracts/src/domain.ts +0 -51
  188. package/packages/@repo/contracts/src/git.ts +0 -31
  189. package/packages/@repo/contracts/src/ids.ts +0 -23
  190. package/packages/@repo/contracts/src/index.ts +0 -13
  191. package/packages/@repo/contracts/src/pagination.ts +0 -21
  192. package/packages/@repo/contracts/src/project.ts +0 -32
  193. package/packages/@repo/contracts/src/tenant.ts +0 -94
  194. package/packages/@repo/contracts/src/user.ts +0 -12
  195. package/packages/@repo/models/dist/docs-config.d.ts +0 -961
  196. package/packages/@repo/models/dist/docs-config.d.ts.map +0 -1
  197. package/packages/@repo/models/dist/docs-config.js +0 -531
  198. package/packages/@repo/models/dist/index.d.ts +0 -3
  199. package/packages/@repo/models/dist/index.d.ts.map +0 -1
  200. package/packages/@repo/models/dist/index.js +0 -3
  201. package/packages/@repo/models/dist/tenant.d.ts +0 -37
  202. package/packages/@repo/models/dist/tenant.d.ts.map +0 -1
  203. package/packages/@repo/models/dist/tenant.js +0 -1
  204. package/packages/@repo/models/package.json +0 -37
  205. package/packages/@repo/models/src/docs-config.ts +0 -629
  206. package/packages/@repo/models/src/index.ts +0 -3
  207. package/packages/@repo/models/src/tenant.ts +0 -44
  208. package/packages/@repo/prebuild/dist/index.d.ts +0 -2
  209. package/packages/@repo/prebuild/dist/index.d.ts.map +0 -1
  210. package/packages/@repo/prebuild/dist/index.js +0 -2
  211. package/packages/@repo/prebuild/dist/openapi.d.ts +0 -43
  212. package/packages/@repo/prebuild/dist/openapi.d.ts.map +0 -1
  213. package/packages/@repo/prebuild/dist/openapi.js +0 -86
  214. package/packages/@repo/prebuild/package.json +0 -39
  215. package/packages/@repo/prebuild/src/index.ts +0 -2
  216. package/packages/@repo/prebuild/src/openapi.ts +0 -154
  217. package/packages/@repo/previewing/dist/blob-source.d.ts +0 -16
  218. package/packages/@repo/previewing/dist/blob-source.d.ts.map +0 -1
  219. package/packages/@repo/previewing/dist/blob-source.js +0 -128
  220. package/packages/@repo/previewing/dist/config-loader.d.ts +0 -134
  221. package/packages/@repo/previewing/dist/config-loader.d.ts.map +0 -1
  222. package/packages/@repo/previewing/dist/config-loader.js +0 -231
  223. package/packages/@repo/previewing/dist/constants.d.ts +0 -15
  224. package/packages/@repo/previewing/dist/constants.d.ts.map +0 -1
  225. package/packages/@repo/previewing/dist/constants.js +0 -14
  226. package/packages/@repo/previewing/dist/content-index.d.ts +0 -7
  227. package/packages/@repo/previewing/dist/content-index.d.ts.map +0 -1
  228. package/packages/@repo/previewing/dist/content-index.js +0 -291
  229. package/packages/@repo/previewing/dist/content-source.d.ts +0 -12
  230. package/packages/@repo/previewing/dist/content-source.d.ts.map +0 -1
  231. package/packages/@repo/previewing/dist/content-source.js +0 -1
  232. package/packages/@repo/previewing/dist/fs-source.d.ts +0 -11
  233. package/packages/@repo/previewing/dist/fs-source.d.ts.map +0 -1
  234. package/packages/@repo/previewing/dist/fs-source.js +0 -71
  235. package/packages/@repo/previewing/dist/index.d.ts +0 -16
  236. package/packages/@repo/previewing/dist/index.d.ts.map +0 -1
  237. package/packages/@repo/previewing/dist/index.js +0 -13
  238. package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts +0 -3
  239. package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts.map +0 -1
  240. package/packages/@repo/previewing/dist/markdown/agent-markdown.js +0 -176
  241. package/packages/@repo/previewing/dist/markdown/format.d.ts +0 -8
  242. package/packages/@repo/previewing/dist/markdown/format.d.ts.map +0 -1
  243. package/packages/@repo/previewing/dist/markdown/format.js +0 -43
  244. package/packages/@repo/previewing/dist/markdown/links.d.ts +0 -3
  245. package/packages/@repo/previewing/dist/markdown/links.d.ts.map +0 -1
  246. package/packages/@repo/previewing/dist/markdown/links.js +0 -31
  247. package/packages/@repo/previewing/dist/openapi-pages.d.ts +0 -7
  248. package/packages/@repo/previewing/dist/openapi-pages.d.ts.map +0 -1
  249. package/packages/@repo/previewing/dist/openapi-pages.js +0 -200
  250. package/packages/@repo/previewing/dist/search-index.d.ts +0 -4
  251. package/packages/@repo/previewing/dist/search-index.d.ts.map +0 -1
  252. package/packages/@repo/previewing/dist/search-index.js +0 -23
  253. package/packages/@repo/previewing/dist/serialization.d.ts +0 -13
  254. package/packages/@repo/previewing/dist/serialization.d.ts.map +0 -1
  255. package/packages/@repo/previewing/dist/serialization.js +0 -108
  256. package/packages/@repo/previewing/dist/toc-index.d.ts +0 -5
  257. package/packages/@repo/previewing/dist/toc-index.d.ts.map +0 -1
  258. package/packages/@repo/previewing/dist/toc-index.js +0 -53
  259. package/packages/@repo/previewing/dist/types.d.ts +0 -92
  260. package/packages/@repo/previewing/dist/types.d.ts.map +0 -1
  261. package/packages/@repo/previewing/dist/types.js +0 -1
  262. package/packages/@repo/previewing/dist/utility-index.d.ts +0 -7
  263. package/packages/@repo/previewing/dist/utility-index.d.ts.map +0 -1
  264. package/packages/@repo/previewing/dist/utility-index.js +0 -201
  265. package/packages/@repo/previewing/package.json +0 -41
  266. package/packages/@repo/previewing/src/blob-source.ts +0 -185
  267. package/packages/@repo/previewing/src/config-loader.ts +0 -316
  268. package/packages/@repo/previewing/src/constants.ts +0 -16
  269. package/packages/@repo/previewing/src/content-index.ts +0 -384
  270. package/packages/@repo/previewing/src/content-source.ts +0 -12
  271. package/packages/@repo/previewing/src/fs-source.ts +0 -103
  272. package/packages/@repo/previewing/src/index.ts +0 -71
  273. package/packages/@repo/previewing/src/markdown/agent-markdown.ts +0 -254
  274. package/packages/@repo/previewing/src/markdown/format.ts +0 -63
  275. package/packages/@repo/previewing/src/markdown/links.ts +0 -46
  276. package/packages/@repo/previewing/src/openapi-pages.ts +0 -319
  277. package/packages/@repo/previewing/src/search-index.ts +0 -38
  278. package/packages/@repo/previewing/src/serialization.ts +0 -191
  279. package/packages/@repo/previewing/src/toc-index.ts +0 -72
  280. package/packages/@repo/previewing/src/types.ts +0 -105
  281. package/packages/@repo/previewing/src/utility-index.ts +0 -304
  282. package/packages/@repo/validation/dist/index.d.ts +0 -12
  283. package/packages/@repo/validation/dist/index.d.ts.map +0 -1
  284. package/packages/@repo/validation/dist/index.js +0 -30
  285. package/packages/@repo/validation/package.json +0 -38
  286. package/packages/@repo/validation/src/blodemd-docs-schema.json +0 -3575
  287. package/packages/@repo/validation/src/index.ts +0 -59
  288. package/scripts/prepare-package.mjs +0 -53
  289. package/scripts/repo-packages.mjs +0 -8
@@ -1,58 +0,0 @@
1
- import { z } from "zod";
2
- import { ProjectAnalyticsSchema } from "./analytics.js";
3
- import { HostnameSchema, IdSchema, PathSchema, SlugSchema, UrlSchema, } from "./ids.js";
4
- export const TenantStatusSchema = z.enum(["active", "disabled"]);
5
- export const TenantSchema = z.object({
6
- activeDeploymentId: IdSchema.optional(),
7
- activeDeploymentManifestUrl: UrlSchema.optional(),
8
- analytics: ProjectAnalyticsSchema.optional(),
9
- customDomains: z.array(HostnameSchema),
10
- description: z.string().optional(),
11
- id: IdSchema,
12
- name: z.string().min(1),
13
- pathPrefix: PathSchema.optional(),
14
- primaryDomain: HostnameSchema,
15
- slug: SlugSchema,
16
- status: TenantStatusSchema,
17
- subdomain: SlugSchema,
18
- });
19
- export const TenantResolutionSchema = z.object({
20
- basePath: z.string(),
21
- host: HostnameSchema,
22
- rewrittenPath: z.string(),
23
- strategy: z.enum(["preview", "custom-domain", "subdomain", "path"]),
24
- tenant: TenantSchema,
25
- });
26
- const TenantEdgeRecordVersionSchema = z.literal(1);
27
- export const TenantEdgeHostRecordSchema = z.object({
28
- host: HostnameSchema,
29
- pathPrefix: PathSchema.optional(),
30
- strategy: z.enum(["custom-domain", "subdomain"]),
31
- tenant: TenantSchema,
32
- version: TenantEdgeRecordVersionSchema,
33
- });
34
- export const TenantEdgeSlugRecordSchema = z.object({
35
- slug: SlugSchema,
36
- tenant: TenantSchema,
37
- version: TenantEdgeRecordVersionSchema,
38
- });
39
- export const TENANT_EDGE_HOST_KEY_PREFIX = "th_";
40
- export const TENANT_EDGE_SLUG_KEY_PREFIX = "ts_";
41
- export const LEGACY_TENANT_EDGE_HOST_KEY_PREFIX = "tenant:host:";
42
- export const LEGACY_TENANT_EDGE_SLUG_KEY_PREFIX = "tenant:slug:";
43
- export const normalizeTenantEdgeHost = (host) => host.trim().toLowerCase().replace(/:\d+$/, "");
44
- export const normalizeTenantEdgeSlug = (slug) => slug.trim().toLowerCase();
45
- const encodeTenantEdgeHost = (host) => normalizeTenantEdgeHost(host).replaceAll(".", "_");
46
- const encodeTenantEdgeSlug = (slug) => normalizeTenantEdgeSlug(slug);
47
- export const getTenantEdgeHostKey = (host) => `${TENANT_EDGE_HOST_KEY_PREFIX}${encodeTenantEdgeHost(host)}`;
48
- export const getTenantEdgeSlugKey = (slug) => `${TENANT_EDGE_SLUG_KEY_PREFIX}${encodeTenantEdgeSlug(slug)}`;
49
- export const getLegacyTenantEdgeHostKey = (host) => `${LEGACY_TENANT_EDGE_HOST_KEY_PREFIX}${normalizeTenantEdgeHost(host)}`;
50
- export const getLegacyTenantEdgeSlugKey = (slug) => `${LEGACY_TENANT_EDGE_SLUG_KEY_PREFIX}${normalizeTenantEdgeSlug(slug)}`;
51
- export const getTenantEdgeHostKeys = (host) => [
52
- getTenantEdgeHostKey(host),
53
- getLegacyTenantEdgeHostKey(host),
54
- ];
55
- export const getTenantEdgeSlugKeys = (slug) => [
56
- getTenantEdgeSlugKey(slug),
57
- getLegacyTenantEdgeSlugKey(slug),
58
- ];
@@ -1,9 +0,0 @@
1
- import { z } from "zod";
2
- export declare const UserSchema: z.ZodObject<{
3
- createdAt: z.ZodString;
4
- email: z.ZodString;
5
- id: z.ZodString;
6
- name: z.ZodNullable<z.ZodString>;
7
- }, z.core.$strip>;
8
- export type User = z.infer<typeof UserSchema>;
9
- //# sourceMappingURL=user.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../src/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,UAAU;;;;;iBAKrB,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import { z } from "zod";
2
- import { IsoDateSchema } from "./dates.js";
3
- import { EmailSchema, IdSchema } from "./ids.js";
4
- export const UserSchema = z.object({
5
- createdAt: IsoDateSchema,
6
- email: EmailSchema,
7
- id: IdSchema,
8
- name: z.string().nullable(),
9
- });
@@ -1,37 +0,0 @@
1
- {
2
- "name": "@repo/contracts",
3
- "version": "0.0.0",
4
- "private": true,
5
- "type": "module",
6
- "exports": {
7
- ".": {
8
- "types": "./dist/index.d.ts",
9
- "import": "./dist/index.js",
10
- "default": "./dist/index.js"
11
- },
12
- "./*": {
13
- "types": "./dist/*.d.ts",
14
- "import": "./dist/*.js",
15
- "default": "./dist/*.js"
16
- }
17
- },
18
- "scripts": {
19
- "build": "rm -rf dist && tsc",
20
- "check-types": "tsc --noEmit",
21
- "lint": "oxlint .",
22
- "lint:fix": "oxlint --fix .",
23
- "format": "oxfmt --write .",
24
- "format:check": "oxfmt ."
25
- },
26
- "dependencies": {
27
- "zod": "^4.3.6"
28
- },
29
- "devDependencies": {
30
- "@repo/typescript-config": "*",
31
- "@types/node": "^24.12.2",
32
- "oxfmt": "^0.42.0",
33
- "oxlint": "^1.57.0",
34
- "typescript": "6.0.2",
35
- "ultracite": "^7.3.2"
36
- }
37
- }
@@ -1,33 +0,0 @@
1
- import { z } from "zod";
2
-
3
- const GA4_MEASUREMENT_ID_REGEX = /^G-[A-Z0-9]{4,20}$/;
4
- const POSTHOG_PROJECT_KEY_REGEX = /^phc_[A-Za-z0-9]{20,}$/;
5
-
6
- export const ProjectAnalyticsGa4Schema = z.object({
7
- measurementId: z
8
- .string()
9
- .regex(
10
- GA4_MEASUREMENT_ID_REGEX,
11
- "GA4 measurement IDs look like G-XXXXXXXXXX."
12
- ),
13
- });
14
- export type ProjectAnalyticsGa4 = z.infer<typeof ProjectAnalyticsGa4Schema>;
15
-
16
- export const ProjectAnalyticsPosthogSchema = z.object({
17
- host: z.string().url().optional(),
18
- projectKey: z
19
- .string()
20
- .regex(
21
- POSTHOG_PROJECT_KEY_REGEX,
22
- "PostHog project keys start with phc_. Personal API keys (phx_) are not supported."
23
- ),
24
- });
25
- export type ProjectAnalyticsPosthog = z.infer<
26
- typeof ProjectAnalyticsPosthogSchema
27
- >;
28
-
29
- export const ProjectAnalyticsSchema = z.object({
30
- ga4: ProjectAnalyticsGa4Schema.optional(),
31
- posthog: ProjectAnalyticsPosthogSchema.optional(),
32
- });
33
- export type ProjectAnalytics = z.infer<typeof ProjectAnalyticsSchema>;
@@ -1,27 +0,0 @@
1
- import { z } from "zod";
2
-
3
- import { IsoDateSchema } from "./dates.js";
4
- import { IdSchema } from "./ids.js";
5
-
6
- export const ApiKeySchema = z.object({
7
- createdAt: IsoDateSchema,
8
- id: IdSchema,
9
- keyPrefix: z.string().min(1),
10
- lastUsedAt: IsoDateSchema.optional(),
11
- name: z.string().min(1),
12
- projectId: IdSchema,
13
- });
14
- export type ApiKey = z.infer<typeof ApiKeySchema>;
15
-
16
- export const ApiKeyCreateSchema = z.object({
17
- name: z.string().min(1).max(100).optional(),
18
- });
19
- export type ApiKeyCreateInput = z.infer<typeof ApiKeyCreateSchema>;
20
-
21
- // Returned exactly once, at creation time — the only moment the plaintext key
22
- // is available. Callers must store `key`; the server keeps only its hash.
23
- export const ApiKeyCreatedSchema = z.object({
24
- apiKey: ApiKeySchema,
25
- key: z.string().min(1),
26
- });
27
- export type ApiKeyCreated = z.infer<typeof ApiKeyCreatedSchema>;
@@ -1,4 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const IsoDateSchema = z.string().datetime();
4
- export type IsoDate = z.infer<typeof IsoDateSchema>;
@@ -1,73 +0,0 @@
1
- import { z } from "zod";
2
-
3
- import { IsoDateSchema } from "./dates.js";
4
- import { IdSchema, UrlSchema } from "./ids.js";
5
-
6
- export const DeploymentStatusSchema = z.enum([
7
- "Queued",
8
- "Building",
9
- "Successful",
10
- "Failed",
11
- ]);
12
- export type DeploymentStatus = z.infer<typeof DeploymentStatusSchema>;
13
-
14
- export const DeploymentEnvironmentSchema = z.enum(["production", "preview"]);
15
- export type DeploymentEnvironment = z.infer<typeof DeploymentEnvironmentSchema>;
16
-
17
- export const DeploymentSchema = z.object({
18
- branch: z.string().min(1),
19
- changes: z.string().min(1).optional(),
20
- commitMessage: z.string().min(1).optional(),
21
- createdAt: IsoDateSchema,
22
- environment: DeploymentEnvironmentSchema,
23
- fileCount: z.number().int().nonnegative().optional(),
24
- id: IdSchema,
25
- manifestUrl: UrlSchema.optional(),
26
- previewUrl: UrlSchema.optional(),
27
- projectId: IdSchema,
28
- promotedAt: IsoDateSchema.optional(),
29
- status: DeploymentStatusSchema,
30
- updatedAt: IsoDateSchema,
31
- });
32
- export type Deployment = z.infer<typeof DeploymentSchema>;
33
-
34
- export const PublishDeploymentCreateSchema = z.object({
35
- branch: z.string().min(1).optional(),
36
- changes: z.string().min(1).optional(),
37
- commitMessage: z.string().min(1).optional(),
38
- environment: DeploymentEnvironmentSchema.optional(),
39
- });
40
- export type PublishDeploymentCreateInput = z.infer<
41
- typeof PublishDeploymentCreateSchema
42
- >;
43
-
44
- export const PublishDeploymentFileSchema = z.object({
45
- contentBase64: z.string().base64(),
46
- contentType: z.string().min(1).optional(),
47
- path: z.string().min(1),
48
- });
49
- export type PublishDeploymentFileInput = z.infer<
50
- typeof PublishDeploymentFileSchema
51
- >;
52
-
53
- export const PublishDeploymentFileResponseSchema = z.object({
54
- path: z.string().min(1),
55
- url: UrlSchema,
56
- });
57
- export type PublishDeploymentFileResponse = z.infer<
58
- typeof PublishDeploymentFileResponseSchema
59
- >;
60
-
61
- export const PublishDeploymentFilesBatchSchema = z.object({
62
- files: z.array(PublishDeploymentFileSchema).min(1),
63
- });
64
- export type PublishDeploymentFilesBatchInput = z.infer<
65
- typeof PublishDeploymentFilesBatchSchema
66
- >;
67
-
68
- export const PublishDeploymentFinalizeSchema = z.object({
69
- promote: z.boolean().optional(),
70
- });
71
- export type PublishDeploymentFinalizeInput = z.infer<
72
- typeof PublishDeploymentFinalizeSchema
73
- >;
@@ -1,51 +0,0 @@
1
- import { z } from "zod";
2
-
3
- import { IsoDateSchema } from "./dates.js";
4
- import { HostnameSchema, IdSchema, PathSchema } from "./ids.js";
5
-
6
- export const DomainStatusSchema = z.enum([
7
- "Valid Configuration",
8
- "Pending Verification",
9
- "Invalid Configuration",
10
- ]);
11
- export type DomainStatus = z.infer<typeof DomainStatusSchema>;
12
-
13
- export const DomainSchema = z.object({
14
- createdAt: IsoDateSchema,
15
- hostname: HostnameSchema,
16
- id: IdSchema,
17
- pathPrefix: PathSchema.optional(),
18
- projectId: IdSchema,
19
- status: DomainStatusSchema,
20
- verifiedAt: IsoDateSchema.optional(),
21
- });
22
- export type Domain = z.infer<typeof DomainSchema>;
23
-
24
- export const DomainVerificationRecordSchema = z.object({
25
- name: z.string().min(1),
26
- ttl: z.string().optional(),
27
- type: z.enum(["A", "AAAA", "CNAME", "TXT", "MX", "NS", "CAA"]),
28
- value: z.string().min(1),
29
- });
30
- export type DomainVerificationRecord = z.infer<
31
- typeof DomainVerificationRecordSchema
32
- >;
33
-
34
- export const DomainVerificationSchema = z.object({
35
- records: z.array(DomainVerificationRecordSchema),
36
- verified: z.boolean(),
37
- });
38
- export type DomainVerification = z.infer<typeof DomainVerificationSchema>;
39
-
40
- export const DomainCreateSchema = z.object({
41
- hostname: HostnameSchema,
42
- pathPrefix: PathSchema.optional(),
43
- projectId: IdSchema,
44
- });
45
- export type DomainCreateInput = z.infer<typeof DomainCreateSchema>;
46
-
47
- export const DomainCreateResponseSchema = z.object({
48
- domain: DomainSchema,
49
- verification: DomainVerificationSchema.optional(),
50
- });
51
- export type DomainCreateResponse = z.infer<typeof DomainCreateResponseSchema>;
@@ -1,31 +0,0 @@
1
- import { z } from "zod";
2
-
3
- import { IsoDateSchema } from "./dates.js";
4
- import { IdSchema } from "./ids.js";
5
-
6
- export const GitProviderSchema = z.enum(["github"]);
7
- export type GitProvider = z.infer<typeof GitProviderSchema>;
8
-
9
- export const GitConnectionSchema = z.object({
10
- accountLogin: z.string().min(1),
11
- branch: z.string().min(1),
12
- createdAt: IsoDateSchema,
13
- docsPath: z.string().min(1),
14
- id: IdSchema,
15
- installationId: z.number().int().positive().safe(),
16
- projectId: IdSchema,
17
- provider: GitProviderSchema,
18
- repository: z.string().min(1),
19
- updatedAt: IsoDateSchema,
20
- });
21
- export type GitConnection = z.infer<typeof GitConnectionSchema>;
22
-
23
- export const GitConnectionBindSchema = z.object({
24
- branch: z.string().min(1).default("main"),
25
- docsPath: z.string().min(1).default("docs"),
26
- installationId: z.number().int().positive().safe(),
27
- repository: z.string().regex(/^[\w.-]+\/[\w.-]+$/, {
28
- message: "Repository must be in the format owner/repo.",
29
- }),
30
- });
31
- export type GitConnectionBindInput = z.infer<typeof GitConnectionBindSchema>;
@@ -1,23 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const IdSchema = z.string().uuid();
4
- export type Id = z.infer<typeof IdSchema>;
5
-
6
- export const SlugSchema = z
7
- .string()
8
- .min(1)
9
- .max(63)
10
- .regex(/^(?!-)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/);
11
- export type Slug = z.infer<typeof SlugSchema>;
12
-
13
- export const EmailSchema = z.string().email();
14
- export type Email = z.infer<typeof EmailSchema>;
15
-
16
- export const UrlSchema = z.string().url();
17
- export type Url = z.infer<typeof UrlSchema>;
18
-
19
- export const HostnameSchema = z.string().min(1);
20
- export type Hostname = z.infer<typeof HostnameSchema>;
21
-
22
- export const PathSchema = z.string().min(1);
23
- export type Path = z.infer<typeof PathSchema>;
@@ -1,13 +0,0 @@
1
- // biome-ignore lint/performance/noBarrelFile: This is the main entry point for the package
2
- // eslint-disable-next-line no-barrel-file
3
- export * from "./analytics.js";
4
- export * from "./api-key.js";
5
- export * from "./dates.js";
6
- export * from "./deployment.js";
7
- export * from "./domain.js";
8
- export * from "./git.js";
9
- export * from "./ids.js";
10
- export * from "./pagination.js";
11
- export * from "./project.js";
12
- export * from "./tenant.js";
13
- export * from "./user.js";
@@ -1,21 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const PaginationSchema = z.object({
4
- page: z.number().int().min(1),
5
- pageSize: z.number().int().min(1).max(100),
6
- });
7
- export type Pagination = z.infer<typeof PaginationSchema>;
8
-
9
- export const PageInfoSchema = z.object({
10
- page: z.number().int().min(1),
11
- pageSize: z.number().int().min(1),
12
- total: z.number().int().min(0),
13
- totalPages: z.number().int().min(0),
14
- });
15
- export type PageInfo = z.infer<typeof PageInfoSchema>;
16
-
17
- export const createListResponseSchema = <T extends z.ZodTypeAny>(item: T) =>
18
- z.object({
19
- data: z.array(item),
20
- pageInfo: PageInfoSchema.optional(),
21
- });
@@ -1,32 +0,0 @@
1
- import { z } from "zod";
2
-
3
- import { ProjectAnalyticsSchema } from "./analytics.js";
4
- import { IsoDateSchema } from "./dates.js";
5
- import { IdSchema, SlugSchema } from "./ids.js";
6
-
7
- export const ProjectSchema = z.object({
8
- analytics: ProjectAnalyticsSchema.nullable().optional(),
9
- createdAt: IsoDateSchema,
10
- deploymentName: z.string().min(1),
11
- description: z.string().optional(),
12
- id: IdSchema,
13
- name: z.string().min(1),
14
- slug: SlugSchema,
15
- updatedAt: IsoDateSchema,
16
- });
17
- export type Project = z.infer<typeof ProjectSchema>;
18
-
19
- export const ProjectCreateSchema = z.object({
20
- description: z.string().optional(),
21
- name: z.string().min(1),
22
- slug: SlugSchema,
23
- });
24
- export type ProjectCreateInput = z.infer<typeof ProjectCreateSchema>;
25
-
26
- export const ProjectUpdateSchema = z.object({
27
- analytics: ProjectAnalyticsSchema.nullable().optional(),
28
- deploymentName: z.string().min(1).optional(),
29
- description: z.string().nullable().optional(),
30
- name: z.string().min(1).optional(),
31
- });
32
- export type ProjectUpdateInput = z.infer<typeof ProjectUpdateSchema>;
@@ -1,94 +0,0 @@
1
- import { z } from "zod";
2
-
3
- import { ProjectAnalyticsSchema } from "./analytics.js";
4
- import {
5
- HostnameSchema,
6
- IdSchema,
7
- PathSchema,
8
- SlugSchema,
9
- UrlSchema,
10
- } from "./ids.js";
11
-
12
- export const TenantStatusSchema = z.enum(["active", "disabled"]);
13
- export type TenantStatus = z.infer<typeof TenantStatusSchema>;
14
-
15
- export const TenantSchema = z.object({
16
- activeDeploymentId: IdSchema.optional(),
17
- activeDeploymentManifestUrl: UrlSchema.optional(),
18
- analytics: ProjectAnalyticsSchema.optional(),
19
- customDomains: z.array(HostnameSchema),
20
- description: z.string().optional(),
21
- id: IdSchema,
22
- name: z.string().min(1),
23
- pathPrefix: PathSchema.optional(),
24
- primaryDomain: HostnameSchema,
25
- slug: SlugSchema,
26
- status: TenantStatusSchema,
27
- subdomain: SlugSchema,
28
- });
29
- export type Tenant = z.infer<typeof TenantSchema>;
30
-
31
- export const TenantResolutionSchema = z.object({
32
- basePath: z.string(),
33
- host: HostnameSchema,
34
- rewrittenPath: z.string(),
35
- strategy: z.enum(["preview", "custom-domain", "subdomain", "path"]),
36
- tenant: TenantSchema,
37
- });
38
- export type TenantResolution = z.infer<typeof TenantResolutionSchema>;
39
-
40
- const TenantEdgeRecordVersionSchema = z.literal(1);
41
-
42
- export const TenantEdgeHostRecordSchema = z.object({
43
- host: HostnameSchema,
44
- pathPrefix: PathSchema.optional(),
45
- strategy: z.enum(["custom-domain", "subdomain"]),
46
- tenant: TenantSchema,
47
- version: TenantEdgeRecordVersionSchema,
48
- });
49
- export type TenantEdgeHostRecord = z.infer<typeof TenantEdgeHostRecordSchema>;
50
-
51
- export const TenantEdgeSlugRecordSchema = z.object({
52
- slug: SlugSchema,
53
- tenant: TenantSchema,
54
- version: TenantEdgeRecordVersionSchema,
55
- });
56
- export type TenantEdgeSlugRecord = z.infer<typeof TenantEdgeSlugRecordSchema>;
57
-
58
- export const TENANT_EDGE_HOST_KEY_PREFIX = "th_";
59
- export const TENANT_EDGE_SLUG_KEY_PREFIX = "ts_";
60
- export const LEGACY_TENANT_EDGE_HOST_KEY_PREFIX = "tenant:host:";
61
- export const LEGACY_TENANT_EDGE_SLUG_KEY_PREFIX = "tenant:slug:";
62
-
63
- export const normalizeTenantEdgeHost = (host: string) =>
64
- host.trim().toLowerCase().replace(/:\d+$/, "");
65
-
66
- export const normalizeTenantEdgeSlug = (slug: string) =>
67
- slug.trim().toLowerCase();
68
-
69
- const encodeTenantEdgeHost = (host: string) =>
70
- normalizeTenantEdgeHost(host).replaceAll(".", "_");
71
-
72
- const encodeTenantEdgeSlug = (slug: string) => normalizeTenantEdgeSlug(slug);
73
-
74
- export const getTenantEdgeHostKey = (host: string) =>
75
- `${TENANT_EDGE_HOST_KEY_PREFIX}${encodeTenantEdgeHost(host)}`;
76
-
77
- export const getTenantEdgeSlugKey = (slug: string) =>
78
- `${TENANT_EDGE_SLUG_KEY_PREFIX}${encodeTenantEdgeSlug(slug)}`;
79
-
80
- export const getLegacyTenantEdgeHostKey = (host: string) =>
81
- `${LEGACY_TENANT_EDGE_HOST_KEY_PREFIX}${normalizeTenantEdgeHost(host)}`;
82
-
83
- export const getLegacyTenantEdgeSlugKey = (slug: string) =>
84
- `${LEGACY_TENANT_EDGE_SLUG_KEY_PREFIX}${normalizeTenantEdgeSlug(slug)}`;
85
-
86
- export const getTenantEdgeHostKeys = (host: string) => [
87
- getTenantEdgeHostKey(host),
88
- getLegacyTenantEdgeHostKey(host),
89
- ];
90
-
91
- export const getTenantEdgeSlugKeys = (slug: string) => [
92
- getTenantEdgeSlugKey(slug),
93
- getLegacyTenantEdgeSlugKey(slug),
94
- ];
@@ -1,12 +0,0 @@
1
- import { z } from "zod";
2
-
3
- import { IsoDateSchema } from "./dates.js";
4
- import { EmailSchema, IdSchema } from "./ids.js";
5
-
6
- export const UserSchema = z.object({
7
- createdAt: IsoDateSchema,
8
- email: EmailSchema,
9
- id: IdSchema,
10
- name: z.string().nullable(),
11
- });
12
- export type User = z.infer<typeof UserSchema>;