@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.js
CHANGED
|
@@ -2967,10 +2967,10 @@ async function syncApplicationToCrm(deps, opts) {
|
|
|
2967
2967
|
return recordId;
|
|
2968
2968
|
}
|
|
2969
2969
|
async function backfillCrm(deps) {
|
|
2970
|
-
const
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2970
|
+
const data = await deps.db.query({
|
|
2971
|
+
applications: { $: { order: { createdAt: "desc" }, limit: 1e3 } },
|
|
2972
|
+
$users: { $: { limit: 1e3 } }
|
|
2973
|
+
});
|
|
2974
2974
|
const seen = /* @__PURE__ */ new Set();
|
|
2975
2975
|
let synced = 0;
|
|
2976
2976
|
const errors = [];
|
|
@@ -2985,8 +2985,8 @@ async function backfillCrm(deps) {
|
|
|
2985
2985
|
errors.push({ email: key, error: err instanceof Error ? err.message : String(err) });
|
|
2986
2986
|
}
|
|
2987
2987
|
};
|
|
2988
|
-
for (const a of
|
|
2989
|
-
for (const u of
|
|
2988
|
+
for (const a of data.applications ?? []) await run(a, str(a.status));
|
|
2989
|
+
for (const u of data.$users ?? []) {
|
|
2990
2990
|
if (u.deleted === true) continue;
|
|
2991
2991
|
await run({ email: u.email, firstName: str(u.name) });
|
|
2992
2992
|
}
|