@odla-ai/chapter 0.25.2 → 0.25.4

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.
@@ -122,7 +122,11 @@ interface AdminShellProps {
122
122
  /** Configuration for the Clerk-gated, brand-scoped Chapter admin console. */
123
123
  interface ChapterAdminProps {
124
124
  chapter?: Chapter;
125
- /** Replace or transform the standard workspace set. */
125
+ /**
126
+ * Replace or transform the standard workspace set. During existing-site
127
+ * adoption, use the transform to preserve a validated host workspace until
128
+ * feature-level parity is proven; matching ids or labels are not parity.
129
+ */
126
130
  workspaces?: AdminWorkspace[] | ((defaults: readonly AdminWorkspace[]) => AdminWorkspace[]);
127
131
  /** @deprecated Use workspaces. */
128
132
  sections?: AdminSection[];
@@ -24,7 +24,7 @@ import {
24
24
  meetingsSection,
25
25
  peopleSection,
26
26
  useAdminResource
27
- } from "../../chunk-AWBRQH7E.js";
27
+ } from "../../chunk-5SWVMJZN.js";
28
28
  import {
29
29
  ChapterCopyProvider,
30
30
  useChapterCopy
package/dist/ui/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  loadJoinResume,
14
14
  timeLabel,
15
15
  tzShort
16
- } from "../chunk-GMGTJIY3.js";
16
+ } from "../chunk-WHA3MUDQ.js";
17
17
  import {
18
18
  AdminNote,
19
19
  AdminPage,
@@ -40,7 +40,7 @@ import {
40
40
  meetingsSection,
41
41
  peopleSection,
42
42
  useAdminResource
43
- } from "../chunk-AWBRQH7E.js";
43
+ } from "../chunk-5SWVMJZN.js";
44
44
  import {
45
45
  BrandStyle,
46
46
  ChapterCopyProvider,
@@ -206,7 +206,8 @@ interface JoinIslandProps {
206
206
  children?: ComponentChildren;
207
207
  };
208
208
  }
209
- /** The signup island. Renders the site's form, then drives payment (when the
209
+ /** The signup island. Renders the site's form, keeps one application
210
+ * `submissionId` across ambiguous retries, then drives payment (when the
210
211
  * chapter charges) and booking (when a calendar is connected) to confirmation. */
211
212
  declare function JoinIsland(props: JoinIslandProps): JSX.Element;
212
213
 
@@ -13,7 +13,7 @@ import {
13
13
  loadJoinResume,
14
14
  timeLabel,
15
15
  tzShort
16
- } from "../../chunk-GMGTJIY3.js";
16
+ } from "../../chunk-WHA3MUDQ.js";
17
17
  import {
18
18
  BrandStyle,
19
19
  ChapterCopyProvider,
@@ -138,6 +138,17 @@ function createWorkerContext(options) {
138
138
  // src/worker-routes.ts
139
139
  var import_crm2 = require("@odla-ai/crm");
140
140
 
141
+ // src/application-id.ts
142
+ var APPLICATION_ID_DOMAIN = "odla-ai/chapter/application/v1:";
143
+ async function applicationIdForSubmission(submissionId) {
144
+ const input = new TextEncoder().encode(`${APPLICATION_ID_DOMAIN}${submissionId}`);
145
+ const bytes = new Uint8Array(await crypto.subtle.digest("SHA-256", input)).slice(0, 16);
146
+ bytes[6] = bytes[6] & 15 | 128;
147
+ bytes[8] = bytes[8] & 63 | 128;
148
+ const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
149
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
150
+ }
151
+
141
152
  // src/member.ts
142
153
  var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
143
154
  function isValidEmail(value) {
@@ -181,7 +192,7 @@ async function submitApplication(db, chapter, fields, opts) {
181
192
  if (app.requireDisclaimerAck && !acked) {
182
193
  return { ok: false, error: "disclaimerAck is required" };
183
194
  }
184
- const id = opts.newId();
195
+ const id = opts.submissionId ? await applicationIdForSubmission(opts.submissionId) : opts.newId();
185
196
  const row = { id, status: chapter.pipeline.initial, createdAt: opts.now };
186
197
  for (const f of [...app.required, ...app.optional]) {
187
198
  if (typeof fields[f] === "string") row[f] = fields[f].trim();