@odla-ai/chapter 0.25.2 → 0.25.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.
- package/README.md +7 -6
- package/dist/{chunk-GMGTJIY3.js → chunk-WHA3MUDQ.js} +4 -3
- package/dist/chunk-WHA3MUDQ.js.map +1 -0
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui/member/index.d.ts +2 -1
- package/dist/ui/member/index.js +1 -1
- package/dist/worker/index.cjs +12 -1
- package/dist/worker/index.cjs.map +1 -1
- package/dist/worker/index.js +12 -1
- package/dist/worker/index.js.map +1 -1
- package/package.json +1 -1
- package/runbooks/adopt-existing.md +3 -3
- package/runbooks/greenfield.md +6 -6
- package/dist/chunk-GMGTJIY3.js.map +0 -1
package/dist/worker/index.js
CHANGED
|
@@ -111,6 +111,17 @@ function createWorkerContext(options) {
|
|
|
111
111
|
// src/worker-routes.ts
|
|
112
112
|
import { createCrmRoutes } from "@odla-ai/crm";
|
|
113
113
|
|
|
114
|
+
// src/application-id.ts
|
|
115
|
+
var APPLICATION_ID_DOMAIN = "odla-ai/chapter/application/v1:";
|
|
116
|
+
async function applicationIdForSubmission(submissionId) {
|
|
117
|
+
const input = new TextEncoder().encode(`${APPLICATION_ID_DOMAIN}${submissionId}`);
|
|
118
|
+
const bytes = new Uint8Array(await crypto.subtle.digest("SHA-256", input)).slice(0, 16);
|
|
119
|
+
bytes[6] = bytes[6] & 15 | 128;
|
|
120
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
121
|
+
const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
122
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
123
|
+
}
|
|
124
|
+
|
|
114
125
|
// src/member.ts
|
|
115
126
|
var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
116
127
|
function isValidEmail(value) {
|
|
@@ -154,7 +165,7 @@ async function submitApplication(db, chapter, fields, opts) {
|
|
|
154
165
|
if (app.requireDisclaimerAck && !acked) {
|
|
155
166
|
return { ok: false, error: "disclaimerAck is required" };
|
|
156
167
|
}
|
|
157
|
-
const id = opts.newId();
|
|
168
|
+
const id = opts.submissionId ? await applicationIdForSubmission(opts.submissionId) : opts.newId();
|
|
158
169
|
const row = { id, status: chapter.pipeline.initial, createdAt: opts.now };
|
|
159
170
|
for (const f of [...app.required, ...app.optional]) {
|
|
160
171
|
if (typeof fields[f] === "string") row[f] = fields[f].trim();
|