@businessdash/sdk 0.9.80 → 0.9.90

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 (264) hide show
  1. package/README.md +133 -949
  2. package/assets/{biab-sw.js → bd-sw.js} +2 -2
  3. package/dist/account-core/index.d.ts +1 -1
  4. package/dist/account-core/index.d.ts.map +1 -1
  5. package/dist/adapters-revalidate.d.ts +2 -2
  6. package/dist/adapters-revalidate.js +2 -2
  7. package/dist/adapters-revalidate.js.map +1 -1
  8. package/dist/analytics-core.d.ts +6 -6
  9. package/dist/analytics-core.d.ts.map +1 -1
  10. package/dist/analytics-core.js +4 -4
  11. package/dist/analytics-core.js.map +1 -1
  12. package/dist/analytics-server.d.ts +6 -6
  13. package/dist/analytics-server.d.ts.map +1 -1
  14. package/dist/analytics-server.js +5 -5
  15. package/dist/auth-handler.d.ts +14 -14
  16. package/dist/auth-handler.d.ts.map +1 -1
  17. package/dist/auth-handler.js +16 -16
  18. package/dist/auth-handler.js.map +1 -1
  19. package/dist/auth-links.d.ts +2 -2
  20. package/dist/auth-links.d.ts.map +1 -1
  21. package/dist/auth-links.js +2 -2
  22. package/dist/auth-links.js.map +1 -1
  23. package/dist/{biab-forms.css → bd-forms.css} +158 -158
  24. package/dist/cli.d.ts +4 -4
  25. package/dist/cli.js +78 -78
  26. package/dist/cli.js.map +1 -1
  27. package/dist/client.d.ts +158 -147
  28. package/dist/client.d.ts.map +1 -1
  29. package/dist/client.js +156 -137
  30. package/dist/client.js.map +1 -1
  31. package/dist/consent-core/index.cjs +2 -2
  32. package/dist/consent-core/index.d.ts +2 -2
  33. package/dist/consent-core/index.d.ts.map +1 -1
  34. package/dist/consent-core/index.js +10 -8
  35. package/dist/consent-core/index.js.map +1 -1
  36. package/dist/contracts.d.ts +411 -52
  37. package/dist/contracts.d.ts.map +1 -1
  38. package/dist/contracts.js +89 -15
  39. package/dist/contracts.js.map +1 -1
  40. package/dist/data-model-schema.d.ts +15 -15
  41. package/dist/data-model-schema.d.ts.map +1 -1
  42. package/dist/data-model-schema.js +19 -17
  43. package/dist/data-model-schema.js.map +1 -1
  44. package/dist/distribution.d.ts +5 -5
  45. package/dist/distribution.d.ts.map +1 -1
  46. package/dist/distribution.js +4 -4
  47. package/dist/element.d.ts +36 -36
  48. package/dist/element.d.ts.map +1 -1
  49. package/dist/element.js +43 -43
  50. package/dist/element.js.map +1 -1
  51. package/dist/embed-protocol.d.ts +11 -11
  52. package/dist/embed-protocol.d.ts.map +1 -1
  53. package/dist/embed-protocol.js +1 -1
  54. package/dist/embed-protocol.js.map +1 -1
  55. package/dist/errors.d.ts +15 -15
  56. package/dist/errors.d.ts.map +1 -1
  57. package/dist/errors.js +18 -18
  58. package/dist/errors.js.map +1 -1
  59. package/dist/forms-core/autocomplete.d.ts +3 -3
  60. package/dist/forms-core/autocomplete.d.ts.map +1 -1
  61. package/dist/forms-core/autocomplete.js +2 -2
  62. package/dist/forms-core/controller.d.ts +10 -10
  63. package/dist/forms-core/controller.d.ts.map +1 -1
  64. package/dist/forms-core/controller.js +4 -4
  65. package/dist/forms-core/controller.js.map +1 -1
  66. package/dist/forms-core/elements.d.ts +4 -4
  67. package/dist/forms-core/elements.d.ts.map +1 -1
  68. package/dist/forms-core/elements.js +7 -7
  69. package/dist/forms-core/elements.js.map +1 -1
  70. package/dist/forms-core/formula.d.ts +1 -1
  71. package/dist/forms-core/formula.js +1 -1
  72. package/dist/forms-core/index.d.ts +6 -6
  73. package/dist/forms-core/index.d.ts.map +1 -1
  74. package/dist/forms-core/index.js +5 -5
  75. package/dist/forms-core/index.js.map +1 -1
  76. package/dist/forms-core/units.d.ts +1 -1
  77. package/dist/forms-core/units.js +1 -1
  78. package/dist/forms-core/us-states.d.ts +1 -1
  79. package/dist/forms-core/us-states.js +1 -1
  80. package/dist/forms-core/validation.d.ts +12 -3
  81. package/dist/forms-core/validation.d.ts.map +1 -1
  82. package/dist/forms-core/validation.js +152 -17
  83. package/dist/forms-core/validation.js.map +1 -1
  84. package/dist/forms.d.ts +2 -2
  85. package/dist/forms.d.ts.map +1 -1
  86. package/dist/forms.js +2 -2
  87. package/dist/forms.js.map +1 -1
  88. package/dist/framework-support.js +1 -1
  89. package/dist/framework-support.js.map +1 -1
  90. package/dist/gallery-types.d.ts +1 -1
  91. package/dist/graphql.d.ts +3 -3
  92. package/dist/graphql.d.ts.map +1 -1
  93. package/dist/graphql.js +3 -3
  94. package/dist/graphql.js.map +1 -1
  95. package/dist/index.cjs +351 -272
  96. package/dist/index.d.cts +5 -5
  97. package/dist/index.d.mts +5 -5
  98. package/dist/index.d.ts +5 -5
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +5 -5
  101. package/dist/index.js.map +1 -1
  102. package/dist/legal-core/index.cjs +8 -8
  103. package/dist/legal-core/index.d.ts +3 -3
  104. package/dist/legal-core/index.d.ts.map +1 -1
  105. package/dist/legal-core/index.js +11 -11
  106. package/dist/legal-core/index.js.map +1 -1
  107. package/dist/marketing-core/index.d.ts +51 -1
  108. package/dist/marketing-core/index.d.ts.map +1 -1
  109. package/dist/marketing-core/index.js +35 -0
  110. package/dist/marketing-core/index.js.map +1 -1
  111. package/dist/marketing-schema.d.ts +9 -9
  112. package/dist/marketing-schema.d.ts.map +1 -1
  113. package/dist/marketing-schema.js +1 -1
  114. package/dist/mcp.d.ts +4 -4
  115. package/dist/mcp.js +4 -4
  116. package/dist/native.d.ts +6 -6
  117. package/dist/native.d.ts.map +1 -1
  118. package/dist/native.js +4 -4
  119. package/dist/native.js.map +1 -1
  120. package/dist/next-revalidate.d.ts +8 -8
  121. package/dist/next-revalidate.d.ts.map +1 -1
  122. package/dist/next-revalidate.js +7 -7
  123. package/dist/next-revalidate.js.map +1 -1
  124. package/dist/notifications-core/index.d.ts +1 -1
  125. package/dist/notifications-core/index.js +1 -1
  126. package/dist/parallel-pages.d.ts +4 -4
  127. package/dist/parallel-pages.d.ts.map +1 -1
  128. package/dist/parallel-pages.js +5 -5
  129. package/dist/parallel-pages.js.map +1 -1
  130. package/dist/portal-core/index.d.ts +1 -1
  131. package/dist/portal-core/index.js +1 -1
  132. package/dist/proxy.d.ts +18 -18
  133. package/dist/proxy.d.ts.map +1 -1
  134. package/dist/proxy.js +10 -10
  135. package/dist/proxy.js.map +1 -1
  136. package/dist/push-core/index.cjs +6 -2
  137. package/dist/push-core/index.d.ts +1 -1
  138. package/dist/push-core/index.d.ts.map +1 -1
  139. package/dist/push-core/index.js +6 -2
  140. package/dist/push-core/index.js.map +1 -1
  141. package/dist/react-analytics.d.ts +14 -14
  142. package/dist/react-analytics.d.ts.map +1 -1
  143. package/dist/react-analytics.js +15 -15
  144. package/dist/react-analytics.js.map +1 -1
  145. package/dist/react-attribution.d.ts +2 -2
  146. package/dist/react-attribution.d.ts.map +1 -1
  147. package/dist/react-attribution.js +1 -1
  148. package/dist/react-marketing.js +5 -5
  149. package/dist/react-marketing.js.map +1 -1
  150. package/dist/react.d.ts +38 -61
  151. package/dist/react.d.ts.map +1 -1
  152. package/dist/react.js +247 -261
  153. package/dist/react.js.map +1 -1
  154. package/dist/reserved-paths.d.ts +2 -2
  155. package/dist/reserved-paths.js +3 -3
  156. package/dist/reserved-paths.js.map +1 -1
  157. package/dist/revalidate-verify.d.ts +3 -3
  158. package/dist/revalidate-verify.d.ts.map +1 -1
  159. package/dist/revalidate-verify.js +1 -1
  160. package/dist/revalidate-verify.js.map +1 -1
  161. package/dist/sdk.d.ts +51 -45
  162. package/dist/sdk.d.ts.map +1 -1
  163. package/dist/sdk.js +48 -50
  164. package/dist/sdk.js.map +1 -1
  165. package/dist/seed-core/index.js +8 -8
  166. package/dist/seed-core/index.js.map +1 -1
  167. package/dist/seo-core/blog.d.ts +1 -1
  168. package/dist/seo-core/blog.js +1 -1
  169. package/dist/seo-core/blog.js.map +1 -1
  170. package/dist/seo-core/index.cjs +2 -2
  171. package/dist/seo-core/index.js +1 -1
  172. package/dist/seo-core/index.js.map +1 -1
  173. package/dist/seo.d.ts +1 -1
  174. package/dist/seo.d.ts.map +1 -1
  175. package/dist/seo.js +1 -1
  176. package/dist/seo.js.map +1 -1
  177. package/dist/sitemap-core/index.cjs +5 -5
  178. package/dist/sitemap-core/index.d.ts +13 -5
  179. package/dist/sitemap-core/index.d.ts.map +1 -1
  180. package/dist/sitemap-core/index.js +4 -4
  181. package/dist/sitemap-core/index.js.map +1 -1
  182. package/dist/socials.d.ts +6 -6
  183. package/dist/socials.d.ts.map +1 -1
  184. package/dist/socials.js +5 -5
  185. package/dist/socials.js.map +1 -1
  186. package/dist/solid-compat.d.ts +1 -1
  187. package/dist/solid-compat.js +4 -4
  188. package/dist/solid-compat.js.map +1 -1
  189. package/dist/store-core/index.d.ts +1 -1
  190. package/dist/vanilla.d.ts +12 -12
  191. package/dist/vanilla.d.ts.map +1 -1
  192. package/dist/vanilla.js +192 -145
  193. package/dist/vanilla.js.map +1 -1
  194. package/openapi.json +264 -1
  195. package/package.json +8 -8
  196. package/src/account-core/index.ts +1 -1
  197. package/src/adapters-revalidate.ts +3 -3
  198. package/src/analytics-core.ts +8 -8
  199. package/src/analytics-server.ts +6 -6
  200. package/src/angular/{biab-form.component.ts → bd-form.component.ts} +269 -161
  201. package/src/angular/headless.ts +12 -12
  202. package/src/angular/index.ts +9 -9
  203. package/src/auth-handler.ts +22 -22
  204. package/src/auth-links.ts +2 -2
  205. package/src/cli.ts +81 -81
  206. package/src/client.ts +218 -193
  207. package/src/consent-core/index.ts +10 -8
  208. package/src/contracts.ts +99 -15
  209. package/src/data-model-schema.ts +29 -26
  210. package/src/distribution.ts +5 -5
  211. package/src/element.ts +54 -54
  212. package/src/embed-protocol.ts +14 -14
  213. package/src/errors.ts +27 -27
  214. package/src/forms-core/autocomplete.ts +3 -3
  215. package/src/forms-core/controller.ts +12 -12
  216. package/src/forms-core/elements.ts +7 -7
  217. package/src/forms-core/formula.ts +1 -1
  218. package/src/forms-core/index.ts +8 -8
  219. package/src/forms-core/units.ts +1 -1
  220. package/src/forms-core/us-states.ts +1 -1
  221. package/src/forms-core/validation.ts +158 -14
  222. package/src/forms.ts +2 -2
  223. package/src/framework-support.ts +1 -1
  224. package/src/gallery-types.ts +1 -1
  225. package/src/graphql.ts +4 -4
  226. package/src/index.ts +38 -38
  227. package/src/legal-core/index.ts +12 -12
  228. package/src/marketing-core/index.ts +62 -0
  229. package/src/marketing-schema.ts +9 -9
  230. package/src/mcp.ts +4 -4
  231. package/src/native.ts +14 -14
  232. package/src/next-revalidate.ts +10 -10
  233. package/src/notifications-core/index.ts +1 -1
  234. package/src/parallel-pages.ts +6 -6
  235. package/src/portal-core/index.ts +1 -1
  236. package/src/proxy.ts +28 -28
  237. package/src/push-core/index.ts +11 -5
  238. package/src/qwik.tsx +262 -166
  239. package/src/react-analytics.tsx +17 -17
  240. package/src/react-attribution.tsx +2 -2
  241. package/src/react-marketing.tsx +5 -5
  242. package/src/react.tsx +541 -500
  243. package/src/reserved-paths.ts +3 -3
  244. package/src/revalidate-verify.ts +5 -5
  245. package/src/sdk.ts +131 -101
  246. package/src/seed-core/index.ts +8 -8
  247. package/src/seo-core/blog.ts +2 -2
  248. package/src/seo-core/index.ts +1 -1
  249. package/src/seo.ts +1 -1
  250. package/src/sitemap-core/index.ts +17 -9
  251. package/src/socials.ts +6 -6
  252. package/src/solid-compat.tsx +5 -5
  253. package/src/solid-surfaces.tsx +28 -28
  254. package/src/solid.tsx +264 -175
  255. package/src/store-core/index.ts +1 -1
  256. package/src/styles/{biab-forms.css → bd-forms.css} +158 -158
  257. package/src/svelte/{BiabForm.svelte → BdForm.svelte} +240 -173
  258. package/src/svelte/context.ts +16 -16
  259. package/src/svelte/headless.ts +10 -10
  260. package/src/svelte/index.ts +16 -16
  261. package/src/vanilla.ts +250 -169
  262. package/src/vue/{BiabForm.vue → BdForm.vue} +270 -157
  263. package/src/vue/headless.ts +11 -11
  264. package/src/vue/index.ts +26 -26
package/dist/cli.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * `biab-dev` CLI entry point.
3
+ * `bd` CLI entry point.
4
4
  *
5
5
  * Two independent flows, deliberately sharing nothing but transport
6
6
  * conventions — a website's content shape and an org's database shape are
7
7
  * different artifacts, with different review cadence and blast radius.
8
8
  *
9
- * WEBSITE CONTENT (`biab.config.{ts,mjs,js}`):
9
+ * WEBSITE CONTENT (`bd.config.{ts,mjs,js}`):
10
10
  * - `sync-schema` — resolve the config, compute the canonical SHA-256,
11
11
  * POST to the draft-schema endpoint. Idempotent.
12
12
  * - `sync-content` — walk `<contentSync.rootDir>/<locale>/<page>/
@@ -14,7 +14,7 @@
14
14
  * Per-row failures are reported but don't abort.
15
15
  * - `print-schema` — resolved schema + checksum, no upload.
16
16
  *
17
- * CUSTOM DATABASE (`biab.data-model.config.{ts,mjs,js}`):
17
+ * CUSTOM DATABASE (`bd.data-model.config.{ts,mjs,js}`):
18
18
  * - `view-data-model` — what's LIVE (not what was last pushed — the
19
19
  * dashboard writes this model too). `--diff` for the
20
20
  * migration plan, `--out` to scaffold a config.
@@ -36,7 +36,7 @@
36
36
  * change record contents, so its backup and confirmation guards are
37
37
  * load-bearing.
38
38
  *
39
- * Auth: `BIAB_API_KEY`, `BIAB_SITE_ID`, and `BIAB_PACKAGE_API_BASE_URL` from
39
+ * Auth: `BD_API_KEY`, `BD_SITE_ID`, and `BD_PACKAGE_API_BASE_URL` from
40
40
  * the environment (or a `.env` / `.env.local` in the cwd). Scopes:
41
41
  * `marketing:write_schema` / `marketing:write_content` for the website flow;
42
42
  * `metadata:read_schema` (view/plan), `metadata:write_schema` (push), and
@@ -75,29 +75,29 @@ const SEED_CONFIG_CANDIDATES = [
75
75
  "businessdash.seed.ts",
76
76
  "businessdash.seed.mjs",
77
77
  "businessdash.seed.js",
78
- "biab.seed.ts",
79
- "biab.seed.mjs",
80
- "biab.seed.js",
78
+ "bd.seed.ts",
79
+ "bd.seed.mjs",
80
+ "bd.seed.js",
81
81
  ];
82
82
  /** Config candidates per flow. The marketing and data-model configs are
83
83
  * deliberately different files: different artifacts, different blast radius.
84
- * `businessdash.*` names are preferred going forward; the `biab.*` names
84
+ * `businessdash.*` names are preferred going forward; the `bd.*` names
85
85
  * remain a permanent filesystem contract with every existing consumer. */
86
86
  const MARKETING_CONFIG_CANDIDATES = [
87
87
  "businessdash.config.ts",
88
88
  "businessdash.config.mjs",
89
89
  "businessdash.config.js",
90
- "biab.config.ts",
91
- "biab.config.mjs",
92
- "biab.config.js",
90
+ "bd.config.ts",
91
+ "bd.config.mjs",
92
+ "bd.config.js",
93
93
  ];
94
94
  const DATA_MODEL_CONFIG_CANDIDATES = [
95
95
  "businessdash.data-model.config.ts",
96
96
  "businessdash.data-model.config.mjs",
97
97
  "businessdash.data-model.config.js",
98
- "biab.data-model.config.ts",
99
- "biab.data-model.config.mjs",
100
- "biab.data-model.config.js",
98
+ "bd.data-model.config.ts",
99
+ "bd.data-model.config.mjs",
100
+ "bd.data-model.config.js",
101
101
  ];
102
102
  // V7-styled output: matches the dashboard's status-pill colors so the
103
103
  // CLI feels like the same product (✓ = "done" green-accent, ⚠ =
@@ -112,7 +112,7 @@ const fg = {
112
112
  bold: (s) => (USE_COLOR ? `\x1b[1m${s}\x1b[0m` : s),
113
113
  };
114
114
  function logStep(msg) {
115
- console.log(`[biab-dev] ${msg}`);
115
+ console.log(`[bd] ${msg}`);
116
116
  }
117
117
  /**
118
118
  * A single progress line for long, batched work.
@@ -145,7 +145,7 @@ function makeProgress(total) {
145
145
  };
146
146
  }
147
147
  function logError(msg) {
148
- console.error(`[biab-dev] ${msg}`);
148
+ console.error(`[bd] ${msg}`);
149
149
  }
150
150
  function parseEnvFile(path) {
151
151
  if (!existsSync(path))
@@ -196,7 +196,7 @@ function findDataModelConfigPath(cwd, override) {
196
196
  return findConfigPath(cwd, override, DATA_MODEL_CONFIG_CANDIDATES, "Create one with `defineDataModel({...})` exported as default.");
197
197
  }
198
198
  /**
199
- * Load the consumer's `biab.config.*`. Supports .ts (via the
199
+ * Load the consumer's `bd.config.*`. Supports .ts (via the
200
200
  * consumer's tsx / ts-node setup — we only invoke if `--require tsx`
201
201
  * or `tsx`/`ts-node` registered the loader), .mjs (native ESM), and
202
202
  * .js (CJS or ESM depending on package.json).
@@ -226,7 +226,7 @@ async function loadConfig(configPath) {
226
226
  function normalizeBaseUrl(input) {
227
227
  let next = input.trim();
228
228
  if (!/^https?:\/\//i.test(next)) {
229
- throw new Error(`BIAB_PACKAGE_API_BASE_URL must start with http(s):// — got "${input}".`);
229
+ throw new Error(`BD_PACKAGE_API_BASE_URL must start with http(s):// — got "${input}".`);
230
230
  }
231
231
  if (!next.endsWith("/api/package/v1") && !next.endsWith("/api/package/v1/")) {
232
232
  // Accept either the bare host or the full prefix; canonicalize to
@@ -246,7 +246,7 @@ async function cmdSyncSchema(opts) {
246
246
  const schema = await loadConfig(opts.configPath);
247
247
  const artifact = schema.toJSONSchema();
248
248
  const checksum = await schema.checksum();
249
- // Reject any `contentSync.pages[].pageKey` that collides with a BIAB
249
+ // Reject any `contentSync.pages[].pageKey` that collides with a BD
250
250
  // platform-reserved route. Catches the misconfiguration before any
251
251
  // upload happens.
252
252
  const declaredPages = schema.contentSync?.pages ?? [];
@@ -263,16 +263,16 @@ async function cmdSyncSchema(opts) {
263
263
  logStep("--dry-run was set, skipping upload.");
264
264
  return;
265
265
  }
266
- const apiKey = opts.env["BIAB_API_KEY"];
267
- const siteId = opts.env["BIAB_SITE_ID"];
268
- const rawBase = opts.env["BIAB_PACKAGE_API_BASE_URL"] ??
269
- opts.env["NEXT_PUBLIC_BIAB_PACKAGE_API_BASE_URL"];
266
+ const apiKey = opts.env["BD_API_KEY"];
267
+ const siteId = opts.env["BD_SITE_ID"];
268
+ const rawBase = opts.env["BD_PACKAGE_API_BASE_URL"] ??
269
+ opts.env["NEXT_PUBLIC_BD_PACKAGE_API_BASE_URL"];
270
270
  if (!apiKey)
271
- throw new Error("Missing BIAB_API_KEY in env or .env.local.");
271
+ throw new Error("Missing BD_API_KEY in env or .env.local.");
272
272
  if (!siteId)
273
- throw new Error("Missing BIAB_SITE_ID in env or .env.local.");
273
+ throw new Error("Missing BD_SITE_ID in env or .env.local.");
274
274
  if (!rawBase) {
275
- throw new Error("Missing BIAB_PACKAGE_API_BASE_URL in env or .env.local (e.g. https://your-host.tld/api/package/v1).");
275
+ throw new Error("Missing BD_PACKAGE_API_BASE_URL in env or .env.local (e.g. https://your-host.tld/api/package/v1).");
276
276
  }
277
277
  const baseUrl = normalizeBaseUrl(rawBase);
278
278
  const target = `${baseUrl}/sites/${encodeURIComponent(siteId)}/marketing/draft-schema`;
@@ -349,16 +349,16 @@ async function loadDataModelConfig(configPath) {
349
349
  };
350
350
  }
351
351
  function resolveApiTarget(env) {
352
- const apiKey = env["BIAB_API_KEY"];
353
- const siteId = env["BIAB_SITE_ID"];
354
- const rawBase = env["BIAB_PACKAGE_API_BASE_URL"] ??
355
- env["NEXT_PUBLIC_BIAB_PACKAGE_API_BASE_URL"];
352
+ const apiKey = env["BD_API_KEY"];
353
+ const siteId = env["BD_SITE_ID"];
354
+ const rawBase = env["BD_PACKAGE_API_BASE_URL"] ??
355
+ env["NEXT_PUBLIC_BD_PACKAGE_API_BASE_URL"];
356
356
  if (!apiKey)
357
- throw new Error("Missing BIAB_API_KEY in env or .env.local.");
357
+ throw new Error("Missing BD_API_KEY in env or .env.local.");
358
358
  if (!siteId)
359
- throw new Error("Missing BIAB_SITE_ID in env or .env.local.");
359
+ throw new Error("Missing BD_SITE_ID in env or .env.local.");
360
360
  if (!rawBase) {
361
- throw new Error("Missing BIAB_PACKAGE_API_BASE_URL in env or .env.local (e.g. https://your-host.tld/api/package/v1).");
361
+ throw new Error("Missing BD_PACKAGE_API_BASE_URL in env or .env.local (e.g. https://your-host.tld/api/package/v1).");
362
362
  }
363
363
  return { baseUrl: normalizeBaseUrl(rawBase), apiKey, siteId };
364
364
  }
@@ -489,7 +489,7 @@ async function cmdViewDataModel(opts) {
489
489
  * Commit the file next to your code and it becomes a Drizzle/Convex-style
490
490
  * snapshot: deterministic ordering means successive exports git-diff cleanly,
491
491
  * so an AI agent (or a human) can read the collection's state and how it
492
- * changed over time without querying BIAB live. It also re-seeds a fresh org —
492
+ * changed over time without querying BD live. It also re-seeds a fresh org —
493
493
  * the `schema` half is the same shape `sync-data-model` pushes, the `records`
494
494
  * half is the same shape `sync-records` ingests.
495
495
  */
@@ -505,7 +505,7 @@ async function cmdExportDataModel(opts) {
505
505
  ? isAbsolute(opts.out)
506
506
  ? opts.out
507
507
  : resolve(opts.cwd, opts.out)
508
- : resolve(opts.cwd, "biab.data-model.snapshot.json");
508
+ : resolve(opts.cwd, "bd.data-model.snapshot.json");
509
509
  writeFileSync(outPath, `${JSON.stringify(seed, null, 2)}\n`, "utf8");
510
510
  const c = seed.counts;
511
511
  logStep(`${fg.green("✓")} Wrote ${outPath}`);
@@ -546,7 +546,7 @@ async function cmdExportGraphqlSchema(opts) {
546
546
  ? isAbsolute(opts.out)
547
547
  ? opts.out
548
548
  : resolve(opts.cwd, opts.out)
549
- : resolve(opts.cwd, "biab.data-model.graphql");
549
+ : resolve(opts.cwd, "bd.data-model.graphql");
550
550
  writeFileSync(outPath, sdl, "utf8");
551
551
  const typeCount = (sdl.match(/^type \w/gm) ?? []).length;
552
552
  logStep(`${fg.green("✓")} Wrote ${outPath}`);
@@ -559,9 +559,9 @@ async function cmdExportGraphqlSchema(opts) {
559
559
  */
560
560
  function renderConfigModule(objects) {
561
561
  const lines = [
562
- "// Generated by `biab-dev view-data-model --out`.",
562
+ "// Generated by `bd view-data-model --out`.",
563
563
  "// This is your org's live data model, as code. Edit it, push it with",
564
- "// `biab-dev sync-data-model`, then promote in the dashboard.",
564
+ "// `bd sync-data-model`, then promote in the dashboard.",
565
565
  "",
566
566
  'import { createSchema, defineCollection, defineField } from "@businessdash/sdk";',
567
567
  "",
@@ -1292,7 +1292,7 @@ async function cmdWipeDatabase(opts) {
1292
1292
  }
1293
1293
  }
1294
1294
  else if (keep.length === 0) {
1295
- logStep(fg.dim("Schema draft unchanged — all collections were removed from the config. Remove or edit biab.data-model.config.ts to rebuild."));
1295
+ logStep(fg.dim("Schema draft unchanged — all collections were removed from the config. Remove or edit bd.data-model.config.ts to rebuild."));
1296
1296
  }
1297
1297
  console.log("");
1298
1298
  logStep(`${fg.green("✓")} Data wiped for ${removed.map((o) => String(o["nameSingular"] ?? "?")).join(", ")}.`);
@@ -1433,7 +1433,7 @@ async function postSectionBatch(input) {
1433
1433
  catch {
1434
1434
  const looksHtml = /^\s*<(?:!doctype|html|head|body)/i.test(bodyText);
1435
1435
  if (looksHtml) {
1436
- message = `${message} (server returned an HTML page, not JSON — the bulk-upsert route may not exist on this host yet. Make sure BIAB is deployed with the marketing/sections endpoint, and that BIAB_PACKAGE_API_BASE_URL points at the right host.)`;
1436
+ message = `${message} (server returned an HTML page, not JSON — the bulk-upsert route may not exist on this host yet. Make sure BD is deployed with the marketing/sections endpoint, and that BD_PACKAGE_API_BASE_URL points at the right host.)`;
1437
1437
  }
1438
1438
  else if (bodyText.trim()) {
1439
1439
  message = `${message} — ${bodyText.slice(0, 240).trim()}`;
@@ -1480,7 +1480,7 @@ async function cmdSyncContent(opts) {
1480
1480
  for (const w of warnings) {
1481
1481
  console.log(` ${fg.amber("⚠")} ${fg.dim(w.message)}`);
1482
1482
  }
1483
- // Reject content syncs that target a BIAB-reserved pageKey. We dedupe
1483
+ // Reject content syncs that target a BD-reserved pageKey. We dedupe
1484
1484
  // so we report each offending key once rather than per-file.
1485
1485
  const reservedKeys = Array.from(new Set(items
1486
1486
  .filter((it) => isReservedPagePath(it.pageKey))
@@ -1502,16 +1502,16 @@ async function cmdSyncContent(opts) {
1502
1502
  }
1503
1503
  return;
1504
1504
  }
1505
- const apiKey = opts.env["BIAB_API_KEY"];
1506
- const siteId = opts.env["BIAB_SITE_ID"];
1507
- const rawBase = opts.env["BIAB_PACKAGE_API_BASE_URL"] ??
1508
- opts.env["NEXT_PUBLIC_BIAB_PACKAGE_API_BASE_URL"];
1505
+ const apiKey = opts.env["BD_API_KEY"];
1506
+ const siteId = opts.env["BD_SITE_ID"];
1507
+ const rawBase = opts.env["BD_PACKAGE_API_BASE_URL"] ??
1508
+ opts.env["NEXT_PUBLIC_BD_PACKAGE_API_BASE_URL"];
1509
1509
  if (!apiKey)
1510
- throw new Error("Missing BIAB_API_KEY in env or .env.local.");
1510
+ throw new Error("Missing BD_API_KEY in env or .env.local.");
1511
1511
  if (!siteId)
1512
- throw new Error("Missing BIAB_SITE_ID in env or .env.local.");
1512
+ throw new Error("Missing BD_SITE_ID in env or .env.local.");
1513
1513
  if (!rawBase) {
1514
- throw new Error("Missing BIAB_PACKAGE_API_BASE_URL in env or .env.local (e.g. https://your-host.tld/api/package/v1).");
1514
+ throw new Error("Missing BD_PACKAGE_API_BASE_URL in env or .env.local (e.g. https://your-host.tld/api/package/v1).");
1515
1515
  }
1516
1516
  const baseUrl = normalizeBaseUrl(rawBase);
1517
1517
  const BATCH_SIZE = 64; // well under the server's 256 cap; smaller = faster failure feedback
@@ -1573,27 +1573,27 @@ async function cmdSyncContent(opts) {
1573
1573
  }
1574
1574
  }
1575
1575
  function printHelp() {
1576
- console.log(`biab-dev — Business In A Box developer CLI
1576
+ console.log(`bd — Business In A Box developer CLI
1577
1577
 
1578
- Run via your package runner — biab-dev is a package bin, not a global:
1579
- npx biab-dev <command> (or: pnpm exec biab-dev <command>)
1578
+ Run via your package runner — bd is a package bin, not a global:
1579
+ npx bd <command> (or: pnpm exec bd <command>)
1580
1580
 
1581
- WEBSITE CONTENT (biab.config.ts)
1582
- npx biab-dev sync-schema [--config path] [--dry-run]
1583
- npx biab-dev sync-content [--config path] [--dry-run] [--lax] [--note "first import"]
1584
- npx biab-dev print-schema [--config path]
1581
+ WEBSITE CONTENT (bd.config.ts)
1582
+ npx bd sync-schema [--config path] [--dry-run]
1583
+ npx bd sync-content [--config path] [--dry-run] [--lax] [--note "first import"]
1584
+ npx bd print-schema [--config path]
1585
1585
 
1586
- CUSTOM DATABASE (biab.data-model.config.ts)
1587
- npx biab-dev view-data-model [--json] [--diff] [--out path] [--prune]
1588
- npx biab-dev print-data-model [--config path]
1589
- npx biab-dev export-data-model [--out path] [--schema-only]
1590
- npx biab-dev export-graphql-schema [--out path] [--include-standard]
1591
- npx biab-dev sync-data-model [--config path] [--dry-run] [--prune] [--forms [slugs]] [--no-forms] [--note "..."]
1592
- npx biab-dev sync-records [--records-dir path] [--dry-run]
1593
- npx biab-dev seed [--config path] [--dry-run] [--yes]
1594
- npx biab-dev wipe-collections --collections name-a,name-b [--dry-run]
1595
- npx biab-dev wipe-database --collections name-a,name-b [--config path] [--dry-run] [--yes]
1596
- npx biab-dev wipe-database --all [--config path] [--dry-run] [--yes]
1586
+ CUSTOM DATABASE (bd.data-model.config.ts)
1587
+ npx bd view-data-model [--json] [--diff] [--out path] [--prune]
1588
+ npx bd print-data-model [--config path]
1589
+ npx bd export-data-model [--out path] [--schema-only]
1590
+ npx bd export-graphql-schema [--out path] [--include-standard]
1591
+ npx bd sync-data-model [--config path] [--dry-run] [--prune] [--forms [slugs]] [--no-forms] [--note "..."]
1592
+ npx bd sync-records [--records-dir path] [--dry-run]
1593
+ npx bd seed [--config path] [--dry-run] [--yes]
1594
+ npx bd wipe-collections --collections name-a,name-b [--dry-run]
1595
+ npx bd wipe-database --collections name-a,name-b [--config path] [--dry-run] [--yes]
1596
+ npx bd wipe-database --all [--config path] [--dry-run] [--yes]
1597
1597
 
1598
1598
  seed run businessdash.seed.ts — schema, records, static collections,
1599
1599
  products, blog posts and coupons, in dependency order. Products and
@@ -1601,18 +1601,18 @@ CUSTOM DATABASE (biab.data-model.config.ts)
1601
1601
  promote in the dashboard. A destructive schema plan refuses unless
1602
1602
  you pass --yes. Same code path as runSeed() from @businessdash/sdk/seed.
1603
1603
 
1604
- view what's LIVE in BIAB right now (the dashboard can change it too, so
1604
+ view what's LIVE in BD right now (the dashboard can change it too, so
1605
1605
  this is not just "what I last pushed")
1606
1606
  print what your local config resolves to — no network
1607
1607
  export pull the WHOLE custom database — schema + records + relations — into
1608
- one portable snapshot (default: ./biab.data-model.snapshot.json).
1608
+ one portable snapshot (default: ./bd.data-model.snapshot.json).
1609
1609
  Deterministic order, so committing it gives a git-diffable history an
1610
- AI agent can read without querying BIAB. Re-seeds a fresh org via
1610
+ AI agent can read without querying BD. Re-seeds a fresh org via
1611
1611
  sync-data-model (schema) + sync-records (rows). --schema-only skips
1612
1612
  the row scan. Needs metadata:read_schema + metadata:read_records.
1613
1613
  export-graphql-schema
1614
1614
  render a GraphQL SDL schema of your custom collections (default:
1615
- ./biab.data-model.graphql) — every object a type, relations as lists,
1615
+ ./bd.data-model.graphql) — every object a type, relations as lists,
1616
1616
  SELECTs as enums where valid. Feed it to GraphQL codegen or commit it
1617
1617
  as a typed contract. Schema only; this does not run a GraphQL server.
1618
1618
  --include-standard also emits standard CRM types. Needs
@@ -1620,7 +1620,7 @@ CUSTOM DATABASE (biab.data-model.config.ts)
1620
1620
  sync push your config to the draft slot. Prints the migration plan first;
1621
1621
  nothing changes until you promote in the dashboard.
1622
1622
 
1623
- seed upsert rows from JSON (default dir: ./biab-records). Each file is an
1623
+ seed upsert rows from JSON (default dir: ./bd-records). Each file is an
1624
1624
  array of { object, universalIdentifier, values, relations? }; identity
1625
1625
  is what makes re-running converge instead of duplicating. relations
1626
1626
  links rows by the TARGET row's universalIdentifier, e.g.
@@ -1650,16 +1650,16 @@ CUSTOM DATABASE (biab.data-model.config.ts)
1650
1650
  --no-forms push only collections. Generated forms are created inactive on
1651
1651
  promotion and must be activated separately in the dashboard.
1652
1652
 
1653
- npx biab-dev help
1653
+ npx bd help
1654
1654
 
1655
1655
  Environment (read from process.env, .env, or .env.local in the cwd):
1656
- BIAB_API_KEY API key. Website flow needs marketing:write_schema
1656
+ BD_API_KEY API key. Website flow needs marketing:write_schema
1657
1657
  / marketing:write_content. Data-model flow needs
1658
1658
  metadata:read_schema (view/plan) and
1659
1659
  metadata:write_schema (push) or
1660
1660
  metadata:write_records (seed/wipe).
1661
- BIAB_SITE_ID UUID of the site to publish to
1662
- BIAB_PACKAGE_API_BASE_URL Host URL (any path; the CLI canonicalises
1661
+ BD_SITE_ID UUID of the site to publish to
1662
+ BD_PACKAGE_API_BASE_URL Host URL (any path; the CLI canonicalises
1663
1663
  to "<origin>/api/package/v1" automatically).
1664
1664
  Use the APEX host — e.g. https://biab.app, NOT
1665
1665
  https://www.biab.app. A www→apex redirect makes
@@ -1675,8 +1675,8 @@ two interactive confirmations. wipe-database combines a data wipe with a
1675
1675
  pruned schema push for developer convenience.
1676
1676
 
1677
1677
  Config files (override either with --config path):
1678
- biab.config.ts → defineSiteMarketingSchema (website content)
1679
- biab.data-model.config.ts → createFormSchemaOrchestrator / createSchema
1678
+ bd.config.ts → defineSiteMarketingSchema (website content)
1679
+ bd.data-model.config.ts → createFormSchemaOrchestrator / createSchema
1680
1680
 
1681
1681
  sync-content also reads the optional \`contentSync\` field on your
1682
1682
  defineSiteMarketingSchema({...}) call. Minimal form (default layout
@@ -1719,7 +1719,7 @@ function parseArgs(argv) {
1719
1719
  diff: false,
1720
1720
  out: null,
1721
1721
  prune: false,
1722
- recordsDir: "biab-records",
1722
+ recordsDir: "bd-records",
1723
1723
  forms: "prompt",
1724
1724
  collections: [],
1725
1725
  yes: false,