@odla-ai/chapter 0.38.0 → 0.38.1
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/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/worker/index.cjs +51 -35
- package/dist/worker/index.cjs.map +1 -1
- package/dist/worker/index.js +51 -35
- package/dist/worker/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3135,10 +3135,10 @@ async function syncApplicationToCrm(deps, opts) {
|
|
|
3135
3135
|
return recordId;
|
|
3136
3136
|
}
|
|
3137
3137
|
async function backfillCrm(deps) {
|
|
3138
|
-
const
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3138
|
+
const data = await deps.db.query({
|
|
3139
|
+
applications: { $: { order: { createdAt: "desc" }, limit: 1e3 } },
|
|
3140
|
+
$users: { $: { limit: 1e3 } }
|
|
3141
|
+
});
|
|
3142
3142
|
const seen = /* @__PURE__ */ new Set();
|
|
3143
3143
|
let synced = 0;
|
|
3144
3144
|
const errors = [];
|
|
@@ -3153,8 +3153,8 @@ async function backfillCrm(deps) {
|
|
|
3153
3153
|
errors.push({ email: key, error: err instanceof Error ? err.message : String(err) });
|
|
3154
3154
|
}
|
|
3155
3155
|
};
|
|
3156
|
-
for (const a of
|
|
3157
|
-
for (const u of
|
|
3156
|
+
for (const a of data.applications ?? []) await run(a, str(a.status));
|
|
3157
|
+
for (const u of data.$users ?? []) {
|
|
3158
3158
|
if (u.deleted === true) continue;
|
|
3159
3159
|
await run({ email: u.email, firstName: str(u.name) });
|
|
3160
3160
|
}
|