@fleox-agent-crm/agentcrm 0.3.0 → 0.3.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/README.md +16 -16
- package/changelog.json +19 -0
- package/dist/admin/admin-files.json +8 -8
- package/dist/admin/assets/{chartsImpl-CE2akJat.js → chartsImpl-B45AAqnr.js} +30 -30
- package/dist/admin/assets/{firebase-BHSUggRo.js → firebase-C1x_l9P9.js} +2 -2
- package/dist/admin/assets/{gitJson-BulGh2KV.js → gitJson-CAUSxl8d.js} +1 -1
- package/dist/admin/assets/{index-DidVVK7L.js → index-ChFauO8y.js} +265 -265
- package/dist/admin/assets/{index-hMXwHSvN.css → index-TcjySLVg.css} +1 -1
- package/dist/admin/assets/{lucide-react.min-DEDlHCPj.js → lucide-react.min--rznIkmQ.js} +1 -1
- package/dist/admin/assets/{sdk-CnrLnlRo.js → sdk-DgzLACmL.js} +1 -1
- package/dist/admin/index.html +2 -2
- package/dist/agent/agentcrm.mjs +267 -142
- package/dist/agent/chunks/{api-B6OqNVWp.mjs → api-Cz0Ubj-B.mjs} +4 -3
- package/dist/agent/chunks/{appearance-BaShelzt.mjs → appearance-BloHbiLA.mjs} +1 -1
- package/dist/agent/chunks/{automations-BWrvLqP6.mjs → automations-DwWruxmu.mjs} +3 -3
- package/dist/agent/chunks/{backup-ClSmxmFZ.mjs → backup-W3CjgkAJ.mjs} +16 -3
- package/dist/agent/chunks/{compact-CsFPaAAq.mjs → compact-BGHI92tm.mjs} +2 -2
- package/dist/agent/chunks/{exportCsv-B5hRvkNm.mjs → exportCsv-C6e6XEmB.mjs} +38 -3
- package/dist/agent/chunks/{extCheck--7lmVvl7.mjs → extCheck-GgHG1dYB.mjs} +16 -9
- package/dist/agent/chunks/{extPackage-BGl5Oqs8.mjs → extPackage-DuZ6GZhp.mjs} +2 -2
- package/dist/agent/chunks/{extScaffold-DqxI7R1e.mjs → extScaffold-Aqyjf1nr.mjs} +3 -3
- package/dist/agent/chunks/{extensions-BP1k60md.mjs → extensions-Bp72uZ9a.mjs} +19 -6
- package/dist/agent/chunks/{featureRegistry-C9nbVShp.mjs → featureRegistry-DSsZbhrh.mjs} +3 -3
- package/dist/agent/chunks/{files-q8Xu5bft.mjs → files-D1daDgY0.mjs} +1 -1
- package/dist/agent/chunks/{forms-BKU5F9WF.mjs → forms-BfuWaQjA.mjs} +1 -1
- package/dist/agent/chunks/{importCsv-DmE_sBch.mjs → importCsv-LVmMTaWU.mjs} +2 -2
- package/dist/agent/chunks/{install-CpHoUFtL.mjs → install-CbpD_7gd.mjs} +3 -3
- package/dist/agent/chunks/{loader-C9nm3iwx.mjs → loader-MPD9iAvh.mjs} +20 -20
- package/dist/agent/chunks/{modules-CqdVQVJb.mjs → modules-clWdE-K2.mjs} +27 -2
- package/dist/agent/chunks/{nodeImport-BPCt5uMu.mjs → nodeImport-ylfRDvqt.mjs} +2 -2
- package/dist/agent/chunks/{package-DWbn3t2R.mjs → package-B7mI6HGi.mjs} +1 -1
- package/dist/agent/chunks/{papaparse-DjBYnQM2.mjs → papaparse-Df7i1dHr.mjs} +31 -7
- package/dist/agent/chunks/{pipelines-DCdRBNBV.mjs → pipelines-BAKpPk1w.mjs} +1 -1
- package/dist/agent/chunks/{plan-C0TBrU92.mjs → plan-BmTat6-T.mjs} +1 -1
- package/dist/agent/chunks/{records-DoqiT9xR.mjs → records-DcHFelq5.mjs} +5 -1
- package/dist/agent/chunks/{registry-Ceexawxl.mjs → registry-COfJrSmg.mjs} +18 -18
- package/dist/agent/chunks/{reports-BB59N6ke.mjs → reports-BACHGccj.mjs} +3 -3
- package/dist/agent/chunks/{runtime-DHo7ZEEO.mjs → runtime-C0Xf0Axi.mjs} +53 -32
- package/dist/agent/chunks/{schema-DlHt2PxI.mjs → schema-C4lSslXv.mjs} +10 -4
- package/dist/agent/chunks/{schema-7-4-qtSS.mjs → schema-DnLj8dUO.mjs} +10 -0
- package/dist/agent/chunks/{seed-CugPGYZL.mjs → seed-6MRmQQBR.mjs} +26 -8
- package/dist/agent/chunks/{server-ISwlDRCN.mjs → server-DC3t8r30.mjs} +5 -5
- package/dist/agent/chunks/{settings-BtvR_jdm.mjs → settings-Di8nzNEL.mjs} +35 -0
- package/dist/agent/chunks/{stats-CfeJssSS.mjs → stats-BfuLWhVV.mjs} +2 -2
- package/dist/agent/chunks/{tools-Bew8lxKx.mjs → tools-iSH-yMpl.mjs} +59 -19
- package/dist/agent/chunks/{views-fO_BM5U_.mjs → views-DH1n9Lrt.mjs} +1 -1
- package/dist/version.json +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/agentcrm-admin/SKILL.md +67 -67
- package/plugin/skills/agentcrm-admin/references/appearance.md +1 -1
- package/plugin/skills/agentcrm-admin/references/records.md +5 -5
- package/plugin/skills/agentcrm-admin/references/schema.md +20 -20
- package/plugin/skills/agentcrm-extensions/SKILL.md +9 -9
- package/plugin/skills/agentcrm-extensions/references/module-recipes.md +2 -2
- package/plugin/skills/agentcrm-extensions/references/testing.md +16 -14
- package/plugin/skills/agentcrm-extensions/references/theme-recipes.md +3 -3
- package/plugin/skills/agentcrm-install/SKILL.md +13 -13
- package/plugin/skills/agentcrm-install/references/firebase.md +1 -1
- package/plugin/skills/agentcrm-install/references/github.md +1 -1
- package/plugin/skills/agentcrm-install/references/mcp.md +3 -3
- package/plugin/skills/agentcrm-install/references/plans.md +1 -1
- package/plugin/skills/agentcrm-install/references/s3.md +1 -1
- package/plugin/skills/agentcrm-manage/SKILL.md +15 -15
- package/plugin/skills/agentcrm-sales/SKILL.md +18 -18
|
@@ -89,9 +89,10 @@ export {
|
|
|
89
89
|
disabledFromDoc as d,
|
|
90
90
|
builtinModule as e,
|
|
91
91
|
MODULE_CATEGORIES as f,
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
compareVersions as g,
|
|
93
|
+
RUNTIME_MODULES as h,
|
|
94
94
|
isCompatibleApiVersion as i,
|
|
95
|
-
|
|
95
|
+
RUNTIME_DIR as j,
|
|
96
|
+
RUNTIME_GLOBAL as k,
|
|
96
97
|
modules as m
|
|
97
98
|
};
|
|
@@ -4,7 +4,7 @@ import { dirname as __acrmDirname } from "node:path";
|
|
|
4
4
|
const require2 = __acrmRequire(import.meta.url);
|
|
5
5
|
const __filename = __acrmPath(import.meta.url);
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
|
-
import { m as mixHex, D as DEFAULT_ACCENT, r as resolveAppearance, A as APPEARANCE_DOC_ID, a as DEFAULT_APPEARANCE, v as validateAppearancePatch, b as validateImageDataUrl, c as APPEARANCE_KEYS } from "./schema-
|
|
7
|
+
import { m as mixHex, D as DEFAULT_ACCENT, r as resolveAppearance, A as APPEARANCE_DOC_ID, a as DEFAULT_APPEARANCE, v as validateAppearancePatch, b as validateImageDataUrl, c as APPEARANCE_KEYS } from "./schema-DnLj8dUO.mjs";
|
|
8
8
|
import { getExternalTheme } from "./themes-DPZFv3yc.mjs";
|
|
9
9
|
import { assertCan, OpsError } from "./context-CxFfqS4D.mjs";
|
|
10
10
|
import { extensionDocOf, extensionDocsOf } from "./store-5gqRSKXg.mjs";
|
|
@@ -8,13 +8,13 @@ import { toIsoDate, recordLabel, formatFieldValue, normalizeEmail } from "./fiel
|
|
|
8
8
|
import { n as newId } from "./ids-CvnmrMJX.mjs";
|
|
9
9
|
import { plugins } from "./pluginRegistry-DyHtlkcr.mjs";
|
|
10
10
|
import { r as resolveField, m as matchesFilter } from "./query-C5nJB_3C.mjs";
|
|
11
|
-
import { queryContext, setRecordOwner, updateRecord } from "./records-
|
|
12
|
-
import { getSettings } from "./settings-
|
|
11
|
+
import { queryContext, setRecordOwner, updateRecord } from "./records-DcHFelq5.mjs";
|
|
12
|
+
import { getSettings } from "./settings-Di8nzNEL.mjs";
|
|
13
13
|
import { userOf, automationRunsOf, asDoc, requireRecord, requireObject, automationsOf, objectOf, recordsOf, thaw, recordOf, usersOf } from "./store-5gqRSKXg.mjs";
|
|
14
14
|
import { F as FILTER_OPS } from "../agentcrm.mjs";
|
|
15
15
|
import { lastActivityAt, addNote, createTask } from "./activities-Cj_SIOay.mjs";
|
|
16
16
|
import { OpsError, assertCan } from "./context-CxFfqS4D.mjs";
|
|
17
|
-
import { pipelineOfRecord } from "./pipelines-
|
|
17
|
+
import { pipelineOfRecord } from "./pipelines-BAKpPk1w.mjs";
|
|
18
18
|
import { getAutomationAction, listAutomationActions } from "./extensionActions-D2HtpQz4.mjs";
|
|
19
19
|
import { registerAutomationAction, subscribeAutomationActions } from "./extensionActions-D2HtpQz4.mjs";
|
|
20
20
|
import "./standardObjects-CheqfDqa.mjs";
|
|
@@ -7,7 +7,7 @@ const __dirname = __acrmDirname(__filename);
|
|
|
7
7
|
import { J as JSZip } from "./index-w03ReRs4.mjs";
|
|
8
8
|
import { F as FILE_ID_RE } from "./ids-u-noYcy5.mjs";
|
|
9
9
|
import { assertCan, OpsError } from "./context-CxFfqS4D.mjs";
|
|
10
|
-
import { exportJson, importJson } from "./exportCsv-
|
|
10
|
+
import { exportJson, importJson, planImportJson } from "./exportCsv-C6e6XEmB.mjs";
|
|
11
11
|
import { filesOf } from "./store-5gqRSKXg.mjs";
|
|
12
12
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
13
13
|
import "stream";
|
|
@@ -15,11 +15,11 @@ import "events";
|
|
|
15
15
|
import "buffer";
|
|
16
16
|
import "util";
|
|
17
17
|
import "./pluginRegistry-DyHtlkcr.mjs";
|
|
18
|
-
import "./papaparse-
|
|
18
|
+
import "./papaparse-Df7i1dHr.mjs";
|
|
19
19
|
import "./fields-B0bitgmr.mjs";
|
|
20
20
|
import "./query-C5nJB_3C.mjs";
|
|
21
21
|
import "./types-BOy9PUl7.mjs";
|
|
22
|
-
import "./records-
|
|
22
|
+
import "./records-DcHFelq5.mjs";
|
|
23
23
|
import "./ids-CvnmrMJX.mjs";
|
|
24
24
|
import "./standardObjects-CheqfDqa.mjs";
|
|
25
25
|
import "./relations-B9TynBmA.mjs";
|
|
@@ -94,10 +94,23 @@ async function readBackupZipInfo(input) {
|
|
|
94
94
|
const files = Object.keys(zip.files).filter((p) => p.startsWith(BACKUP_FILES_DIR) && metaIds.has(p.slice(BACKUP_FILES_DIR.length, -".bin".length))).length;
|
|
95
95
|
return { data, files };
|
|
96
96
|
}
|
|
97
|
+
async function planBackupZip(ctx, input, opts = {}) {
|
|
98
|
+
assertCan(ctx, "settings.write");
|
|
99
|
+
let info;
|
|
100
|
+
try {
|
|
101
|
+
info = await readBackupZipInfo(input);
|
|
102
|
+
} catch (err) {
|
|
103
|
+
if (err instanceof SyntaxError) throw new OpsError("validation", `${BACKUP_DATA_FILE} is not valid JSON.`);
|
|
104
|
+
throw err;
|
|
105
|
+
}
|
|
106
|
+
if (info.files && !ctx.store.files) throw new OpsError("invalid", `The "${ctx.store.kind}" backend can't store files: restore the data JSON only.`);
|
|
107
|
+
return { ...planImportJson(ctx, info.data, opts), files: info.files, ...info.data.exportedAt ? { exportedAt: info.data.exportedAt } : {} };
|
|
108
|
+
}
|
|
97
109
|
export {
|
|
98
110
|
BACKUP_DATA_FILE,
|
|
99
111
|
BACKUP_FILES_DIR,
|
|
100
112
|
exportBackupZip,
|
|
101
113
|
importBackupZip,
|
|
114
|
+
planBackupZip,
|
|
102
115
|
readBackupZipInfo
|
|
103
116
|
};
|
|
@@ -6,8 +6,8 @@ const __filename = __acrmPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
7
|
import { assertCan } from "./context-CxFfqS4D.mjs";
|
|
8
8
|
import { b as fileCleanupMutations } from "./relations-B9TynBmA.mjs";
|
|
9
|
-
import { purgeFiles } from "./files-
|
|
10
|
-
import { hardDeleteMutations } from "./records-
|
|
9
|
+
import { purgeFiles } from "./files-D1daDgY0.mjs";
|
|
10
|
+
import { hardDeleteMutations } from "./records-DcHFelq5.mjs";
|
|
11
11
|
import { recordsOf, activitiesOf, automationRunsOf } from "./store-5gqRSKXg.mjs";
|
|
12
12
|
import "./pluginRegistry-DyHtlkcr.mjs";
|
|
13
13
|
import "./fields-B0bitgmr.mjs";
|
|
@@ -4,12 +4,12 @@ import { dirname as __acrmDirname } from "node:path";
|
|
|
4
4
|
const require2 = __acrmRequire(import.meta.url);
|
|
5
5
|
const __filename = __acrmPath(import.meta.url);
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
|
-
import { P as Papa } from "./papaparse-
|
|
7
|
+
import { P as Papa } from "./papaparse-Df7i1dHr.mjs";
|
|
8
8
|
import { formatAddress, formatFieldValue } from "./fields-B0bitgmr.mjs";
|
|
9
9
|
import { a as applySorts, b as applyFilters, r as resolveField, g as getRecordValue } from "./query-C5nJB_3C.mjs";
|
|
10
10
|
import { COLLECTIONS } from "./types-BOy9PUl7.mjs";
|
|
11
11
|
import { assertCan, OpsError } from "./context-CxFfqS4D.mjs";
|
|
12
|
-
import { queryContext } from "./records-
|
|
12
|
+
import { queryContext } from "./records-DcHFelq5.mjs";
|
|
13
13
|
import { requireObject, recordsOf, userOf } from "./store-5gqRSKXg.mjs";
|
|
14
14
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
15
15
|
import "stream";
|
|
@@ -62,6 +62,40 @@ function exportJson(ctx, opts = {}) {
|
|
|
62
62
|
collections: Object.fromEntries(wanted.map((c) => [c, ctx.store.list(c)]))
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
+
function planImportJson(ctx, data, opts = {}) {
|
|
66
|
+
assertCan(ctx, "settings.write");
|
|
67
|
+
if (data?.format !== "agentcrm-export") throw new OpsError("validation", "Not an AgentCRM JSON export.");
|
|
68
|
+
const mode = opts.mode ?? "merge";
|
|
69
|
+
const plan = { mode, collections: {}, added: 0, overwritten: 0, deleted: 0, warnings: [] };
|
|
70
|
+
for (const c of COLLECTIONS) {
|
|
71
|
+
const docs = data.collections[c];
|
|
72
|
+
if (!docs) continue;
|
|
73
|
+
const ids = new Set(docs.filter((d) => d && typeof d.id === "string").map((d) => d.id));
|
|
74
|
+
let added = 0;
|
|
75
|
+
let overwritten = 0;
|
|
76
|
+
for (const id of ids) ctx.store.get(c, id) ? overwritten++ : added++;
|
|
77
|
+
const deleted = mode === "replace" ? ctx.store.list(c).filter((d) => !ids.has(d.id)).length : 0;
|
|
78
|
+
plan.collections[c] = { added, overwritten, deleted };
|
|
79
|
+
plan.added += added;
|
|
80
|
+
plan.overwritten += overwritten;
|
|
81
|
+
plan.deleted += deleted;
|
|
82
|
+
}
|
|
83
|
+
const here = ctx.store.get("settings", "general");
|
|
84
|
+
const there = (data.collections.settings ?? []).find((d) => d.id === "general");
|
|
85
|
+
if (here?.name && there?.name && here.name !== there.name) {
|
|
86
|
+
plan.sourceName = there.name;
|
|
87
|
+
plan.warnings.push(`This backup comes from another CRM ("${there.name}"): its settings, users and schema replace the ones with the same ids here (this CRM becomes "${there.name}").`);
|
|
88
|
+
}
|
|
89
|
+
const users = data.collections.users ?? [];
|
|
90
|
+
const replacedUsers = users.filter((u) => {
|
|
91
|
+
const cur = ctx.store.get("users", u.id);
|
|
92
|
+
return cur?.email && u.email && cur.email.toLowerCase() !== u.email.toLowerCase();
|
|
93
|
+
});
|
|
94
|
+
if (replacedUsers.length) {
|
|
95
|
+
plan.warnings.push(`${replacedUsers.length} user(s) of this CRM are replaced by different people with the same id: ${replacedUsers.map((u) => `${String(ctx.store.get("users", u.id).email)} → ${String(u.email)}`).join(", ")}.`);
|
|
96
|
+
}
|
|
97
|
+
return plan;
|
|
98
|
+
}
|
|
65
99
|
async function importJson(ctx, data, opts = {}) {
|
|
66
100
|
assertCan(ctx, "settings.write");
|
|
67
101
|
if (data?.format !== "agentcrm-export") throw new OpsError("validation", "Not an AgentCRM JSON export.");
|
|
@@ -91,5 +125,6 @@ async function importJson(ctx, data, opts = {}) {
|
|
|
91
125
|
export {
|
|
92
126
|
exportCsv,
|
|
93
127
|
exportJson,
|
|
94
|
-
importJson
|
|
128
|
+
importJson,
|
|
129
|
+
planImportJson
|
|
95
130
|
};
|
|
@@ -4,8 +4,8 @@ import { dirname as __acrmDirname } from "node:path";
|
|
|
4
4
|
const require2 = __acrmRequire(import.meta.url);
|
|
5
5
|
const __filename = __acrmPath(import.meta.url);
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
|
-
import { b as EXTENSION_MIN_API_VERSION, E as EXTENSION_API_VERSION, a as EXTENSION_LIMITS, R as RUNTIME_SPECIFIERS } from "./api-
|
|
8
|
-
import { bundleImports, validateManifest, ExtensionPackageError } from "./package-
|
|
7
|
+
import { b as EXTENSION_MIN_API_VERSION, E as EXTENSION_API_VERSION, a as EXTENSION_LIMITS, R as RUNTIME_SPECIFIERS } from "./api-Cz0Ubj-B.mjs";
|
|
8
|
+
import { bundleImports, validateManifest, ExtensionPackageError } from "./package-B7mI6HGi.mjs";
|
|
9
9
|
import { n as nodeImportBundle } from "../agentcrm.mjs";
|
|
10
10
|
import "./index-w03ReRs4.mjs";
|
|
11
11
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
@@ -77,26 +77,31 @@ async function checkExtension(raw, opts = {}) {
|
|
|
77
77
|
}
|
|
78
78
|
if (manifest?.style && style === void 0) errors.push({ code: "missingStyle", message: 'manifest.json declares "style": "style.css" but there is no style.css.', hint: "Add src/style.css (projects) or style.css next to bundle.js." });
|
|
79
79
|
if (style !== void 0 && bytes(style) > EXTENSION_LIMITS.style) errors.push({ code: "tooLarge", message: `style.css is larger than ${EXTENSION_LIMITS.style / 1024} KB.` });
|
|
80
|
+
if (style !== void 0) cssWarnings(style, "style.css", warnings);
|
|
80
81
|
for (const f of raw.ignored) warnings.push({ code: "ignored", message: `${f} is not part of the package (only manifest.json, bundle.js and style.css are).${/style\.css$/.test(f) ? ' Declare "style": "style.css" in manifest.json to ship it.' : ""}` });
|
|
81
82
|
if (!errors.length && manifest && bundle) await loadInSandbox(report, manifest, { "bundle.js": bundle, ...style ? { "style.css": style } : {} }, opts);
|
|
82
83
|
report.valid = errors.length === 0;
|
|
83
84
|
return report;
|
|
84
85
|
}
|
|
86
|
+
function cssWarnings(css, label, warnings) {
|
|
87
|
+
if (/@import\s+(?:url\(\s*)?["']?\s*(?:https?:)?\/\//i.test(css)) warnings.push({ code: "css", message: `${label} @imports a remote stylesheet: every user's browser would fetch it.`, hint: `Inline the CSS; for fonts set the theme's "font" (the CRM loads Google Fonts itself).` });
|
|
88
|
+
if (/<\/?(?:style|script)/i.test(css)) warnings.push({ code: "css", message: `${label} contains <style> / <script> tags: it must be plain CSS.` });
|
|
89
|
+
}
|
|
85
90
|
async function loadInSandbox(report, manifest, files, opts) {
|
|
86
91
|
const importBundle = await nodeImportBundle();
|
|
87
92
|
const [{ createMemoryStore }, { createOpsContext }, { createPluginRegistry, plugins }, { seedCrm }, { usersOf }, loader, registry, aiTools, actions, features, themes, schema] = await Promise.all([
|
|
88
93
|
import("./memory-WNR3VHUJ.mjs"),
|
|
89
94
|
import("./context-CxFfqS4D.mjs"),
|
|
90
95
|
import("./pluginRegistry-DyHtlkcr.mjs"),
|
|
91
|
-
import("./seed-
|
|
96
|
+
import("./seed-6MRmQQBR.mjs"),
|
|
92
97
|
import("./store-5gqRSKXg.mjs"),
|
|
93
|
-
import("./loader-
|
|
94
|
-
import("./registry-
|
|
95
|
-
import("./tools-
|
|
98
|
+
import("./loader-MPD9iAvh.mjs"),
|
|
99
|
+
import("./registry-COfJrSmg.mjs"),
|
|
100
|
+
import("./tools-iSH-yMpl.mjs"),
|
|
96
101
|
import("./extensionActions-D2HtpQz4.mjs"),
|
|
97
|
-
import("./featureRegistry-
|
|
102
|
+
import("./featureRegistry-DSsZbhrh.mjs"),
|
|
98
103
|
import("./themes-DPZFv3yc.mjs"),
|
|
99
|
-
import("./schema-
|
|
104
|
+
import("./schema-DnLj8dUO.mjs").then((n) => n.s)
|
|
100
105
|
]);
|
|
101
106
|
const store = createMemoryStore();
|
|
102
107
|
await store.ready();
|
|
@@ -107,7 +112,7 @@ async function loadInSandbox(report, manifest, files, opts) {
|
|
|
107
112
|
const now = Date.now();
|
|
108
113
|
const doc = { id: manifest.id, kind: manifest.kind, manifest, enabled: true, files, installedAt: now, updatedAt: now };
|
|
109
114
|
await store.write([{ op: "set", collection: "extensions", doc }]);
|
|
110
|
-
const { BUILTIN_MODULES } = await import("./api-
|
|
115
|
+
const { BUILTIN_MODULES } = await import("./api-Cz0Ubj-B.mjs").then((n) => n.m);
|
|
111
116
|
const missingDeps = (manifest.dependsOn ?? []).filter((d) => !BUILTIN_MODULES.some((b) => b.id === d));
|
|
112
117
|
for (const d of missingDeps) report.warnings.push({ code: "dependency", message: `Depends on "${d}", which is not a built-in module: install that extension first on the real CRM.` });
|
|
113
118
|
const toolsBefore = new Set(aiTools.listAiTools().map((t) => t.name));
|
|
@@ -131,6 +136,8 @@ async function loadInSandbox(report, manifest, files, opts) {
|
|
|
131
136
|
const { errors } = schema.validateAppearancePatch(theme.appearance);
|
|
132
137
|
for (const e of errors) report.errors.push({ code: "appearance", message: `Theme appearance: ${e}` });
|
|
133
138
|
for (const k of ["logo", "favicon", "themeId", "preset"]) if (k in (theme.appearance ?? {})) report.warnings.push({ code: "appearance", message: `Theme appearance sets "${k}" — themes should leave it to the workspace.` });
|
|
139
|
+
const ownCss = (theme.css ?? "").replace(files["style.css"] ?? "", "");
|
|
140
|
+
if (ownCss.trim()) cssWarnings(ownCss, "The theme's css", report.warnings);
|
|
134
141
|
report.theme = { name: theme.name, appearance: { ...theme.appearance }, css: bytes(theme.css) };
|
|
135
142
|
return;
|
|
136
143
|
}
|
|
@@ -6,8 +6,8 @@ const __filename = __acrmPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
7
|
import { existsSync, statSync, readFileSync } from "node:fs";
|
|
8
8
|
import { resolve, join } from "node:path";
|
|
9
|
-
import { a as EXTENSION_LIMITS } from "./api-
|
|
10
|
-
import { validatePackage, ExtensionPackageError } from "./package-
|
|
9
|
+
import { a as EXTENSION_LIMITS } from "./api-Cz0Ubj-B.mjs";
|
|
10
|
+
import { validatePackage, ExtensionPackageError } from "./package-B7mI6HGi.mjs";
|
|
11
11
|
import { C as CliError } from "../agentcrm.mjs";
|
|
12
12
|
import "./index-w03ReRs4.mjs";
|
|
13
13
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
@@ -6,8 +6,8 @@ const __filename = __acrmPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
7
|
import { existsSync, mkdirSync, writeFileSync, copyFileSync } from "node:fs";
|
|
8
8
|
import { join, dirname } from "node:path";
|
|
9
|
-
import { E as EXTENSION_API_VERSION, R as RUNTIME_SPECIFIERS } from "./api-
|
|
10
|
-
import { EXTENSION_ID_RE, RESERVED_EXTENSION_IDS } from "./package-
|
|
9
|
+
import { E as EXTENSION_API_VERSION, R as RUNTIME_SPECIFIERS } from "./api-Cz0Ubj-B.mjs";
|
|
10
|
+
import { EXTENSION_ID_RE, RESERVED_EXTENSION_IDS } from "./package-B7mI6HGi.mjs";
|
|
11
11
|
import { C as CliError, r as readVersionInfo, p as packageRoot, o as ownPackageRoot, P as PACKAGE_NAME } from "../agentcrm.mjs";
|
|
12
12
|
import "./index-w03ReRs4.mjs";
|
|
13
13
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
@@ -243,7 +243,7 @@ Or upload the ZIP in the admin: Settings → Modules → Installed extensions.
|
|
|
243
243
|
- \`types/agentcrm-runtime.d.ts\` — the runtime API typings (copied from the CLI; refresh with \`${cli} ext new ${kind} ${id} --dir /tmp/x\` and copy the file).
|
|
244
244
|
- \`vite.config.ts\` — keeps react, react-i18next, lucide-react and @agent-crm/runtime external (the admin provides them).
|
|
245
245
|
|
|
246
|
-
Docs: https://github.com/fleox/agentcrm/blob/
|
|
246
|
+
Docs: https://github.com/fleox/agentcrm/blob/master/docs/${kind === "module" ? "creating-a-module.md" : "creating-a-theme.md"}
|
|
247
247
|
`;
|
|
248
248
|
}
|
|
249
249
|
function scaffoldExtension(opts) {
|
|
@@ -4,10 +4,10 @@ import { dirname as __acrmDirname } from "node:path";
|
|
|
4
4
|
const require2 = __acrmRequire(import.meta.url);
|
|
5
5
|
const __filename = __acrmPath(import.meta.url);
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
|
-
import { a as EXTENSION_LIMITS, i as isCompatibleApiVersion } from "./api-
|
|
8
|
-
import { validatePackage, ExtensionPackageError } from "./package-
|
|
7
|
+
import { a as EXTENSION_LIMITS, g as compareVersions, i as isCompatibleApiVersion } from "./api-Cz0Ubj-B.mjs";
|
|
8
|
+
import { validatePackage, ExtensionPackageError } from "./package-B7mI6HGi.mjs";
|
|
9
9
|
import { assertCan, OpsError } from "./context-CxFfqS4D.mjs";
|
|
10
|
-
import { moduleStates, setModuleEnabled } from "./modules-
|
|
10
|
+
import { moduleStates, setModuleEnabled } from "./modules-clWdE-K2.mjs";
|
|
11
11
|
import { extensionDocOf, asDoc, extensionDocsOf } from "./store-5gqRSKXg.mjs";
|
|
12
12
|
import "./index-w03ReRs4.mjs";
|
|
13
13
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
@@ -16,7 +16,7 @@ import "events";
|
|
|
16
16
|
import "buffer";
|
|
17
17
|
import "util";
|
|
18
18
|
import "./pluginRegistry-DyHtlkcr.mjs";
|
|
19
|
-
import "./settings-
|
|
19
|
+
import "./settings-Di8nzNEL.mjs";
|
|
20
20
|
import "./runtimeConfig-CCOFg1RM.mjs";
|
|
21
21
|
const bytes = (s) => s ? new TextEncoder().encode(s).length : 0;
|
|
22
22
|
function summarizeExtension(doc) {
|
|
@@ -90,6 +90,11 @@ async function installExtension(ctx, pkg, opts = {}) {
|
|
|
90
90
|
warnings.push(`Installed disabled: it needs ${missing.join(", ")} (${missing.map((d) => states.has(d) ? "disabled" : "not installed").join(", ")}).`);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
if (existing) {
|
|
94
|
+
const cmp = compareVersions(manifest.version, existing.manifest.version);
|
|
95
|
+
if (cmp < 0) warnings.push(`Downgrade: ${existing.manifest.version} → ${manifest.version}.`);
|
|
96
|
+
else if (cmp === 0) warnings.push(`Version ${manifest.version} is already installed: its files are replaced (bump "version" for a new release).`);
|
|
97
|
+
}
|
|
93
98
|
const now = ctx.now();
|
|
94
99
|
const doc = {
|
|
95
100
|
id: manifest.id,
|
|
@@ -122,11 +127,19 @@ async function setExtensionEnabled(ctx, id, enabled, opts = {}) {
|
|
|
122
127
|
await setModuleEnabled(ctx, id, enabled, opts);
|
|
123
128
|
} else if (doc.enabled !== enabled) {
|
|
124
129
|
const mutations = [{ op: "patch", collection: "extensions", id, fields: { enabled, updatedAt: ctx.now() } }];
|
|
125
|
-
if (!enabled
|
|
130
|
+
if (!enabled) mutations.push(...clearThemeSelection(ctx, id));
|
|
126
131
|
await ctx.store.write(mutations, { message: `${enabled ? "Enable" : "Disable"} theme ${id}` });
|
|
127
132
|
}
|
|
128
133
|
return summarizeExtension(requireExtension(ctx, id));
|
|
129
134
|
}
|
|
135
|
+
function clearThemeSelection(ctx, id) {
|
|
136
|
+
const appearance = ctx.store.get("config", "appearance");
|
|
137
|
+
if (!appearance) return [];
|
|
138
|
+
const fields = {};
|
|
139
|
+
if (appearance.themeId === id) fields.themeId = void 0;
|
|
140
|
+
if (appearance.preset === id) fields.preset = void 0;
|
|
141
|
+
return Object.keys(fields).length ? [{ op: "patch", collection: "config", id: "appearance", fields }] : [];
|
|
142
|
+
}
|
|
130
143
|
async function uninstallExtension(ctx, id, opts = {}) {
|
|
131
144
|
assertCan(ctx, "extensions.write");
|
|
132
145
|
const doc = requireExtension(ctx, id);
|
|
@@ -135,7 +148,7 @@ async function uninstallExtension(ctx, id, opts = {}) {
|
|
|
135
148
|
if (dependents.length) throw new OpsError("conflict", `${dependents.map((d) => `"${d.name}"`).join(", ")} depend${dependents.length > 1 ? "" : "s"} on "${doc.manifest.name}". Disable or uninstall ${dependents.length > 1 ? "them" : "it"} first.`, { dependents: dependents.map((d) => d.id) });
|
|
136
149
|
}
|
|
137
150
|
const mutations = [{ op: "delete", collection: "extensions", id }];
|
|
138
|
-
|
|
151
|
+
mutations.push(...clearThemeSelection(ctx, id));
|
|
139
152
|
await ctx.store.write(mutations, { message: `Uninstall extension ${id}` });
|
|
140
153
|
ctx.log?.(`extension ${id} uninstalled`);
|
|
141
154
|
return { id, removed: true };
|
|
@@ -6,12 +6,12 @@ const __filename = __acrmPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
7
|
import { r as reactExports } from "./index-Bnmav-Oh.mjs";
|
|
8
8
|
import { r as registerI18nNamespace } from "./index-BM8qeGOb.mjs";
|
|
9
|
-
import { moduleStates } from "./modules-
|
|
9
|
+
import { moduleStates } from "./modules-clWdE-K2.mjs";
|
|
10
10
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
11
|
-
import "./api-
|
|
11
|
+
import "./api-Cz0Ubj-B.mjs";
|
|
12
12
|
import "./context-CxFfqS4D.mjs";
|
|
13
13
|
import "./pluginRegistry-DyHtlkcr.mjs";
|
|
14
|
-
import "./settings-
|
|
14
|
+
import "./settings-Di8nzNEL.mjs";
|
|
15
15
|
import "./store-5gqRSKXg.mjs";
|
|
16
16
|
import "./runtimeConfig-CCOFg1RM.mjs";
|
|
17
17
|
let builtins = [];
|
|
@@ -11,7 +11,7 @@ import { m as mapLimit } from "./http-Bk9ICb7I.mjs";
|
|
|
11
11
|
import { assertCan, OpsError, actorId } from "./context-CxFfqS4D.mjs";
|
|
12
12
|
import { s as sameTarget, e as fileFieldIds, g as fileIdsIn, f as fileTargetPatch, h as referencedFileIds } from "./relations-B9TynBmA.mjs";
|
|
13
13
|
import { timelineScope } from "./activities-Cj_SIOay.mjs";
|
|
14
|
-
import { updateRecord } from "./records-
|
|
14
|
+
import { updateRecord } from "./records-DcHFelq5.mjs";
|
|
15
15
|
import { fileOf, requireFile, filesOf, recordOf, activitiesOf, settingsDoc, asDoc, requireRecord, objectOf, requireObject, recordsOf } from "./store-5gqRSKXg.mjs";
|
|
16
16
|
import "./index-BM8qeGOb.mjs";
|
|
17
17
|
import "./pluginRegistry-DyHtlkcr.mjs";
|
|
@@ -8,7 +8,7 @@ import { normalizeEmail, isEmptyFieldValue, normalizeDomain, formatFieldValue, r
|
|
|
8
8
|
import { n as newId } from "./ids-CvnmrMJX.mjs";
|
|
9
9
|
import { addActivity } from "./activities-Cj_SIOay.mjs";
|
|
10
10
|
import { assertCan, OpsError } from "./context-CxFfqS4D.mjs";
|
|
11
|
-
import { createRecord, updateRecord, queryContext } from "./records-
|
|
11
|
+
import { createRecord, updateRecord, queryContext } from "./records-DcHFelq5.mjs";
|
|
12
12
|
import { formsOf, requireObject, asDoc, objectOf, thaw, userOf, recordsOf, activitiesOf } from "./store-5gqRSKXg.mjs";
|
|
13
13
|
import "./query-C5nJB_3C.mjs";
|
|
14
14
|
import "../agentcrm.mjs";
|
|
@@ -4,12 +4,12 @@ import { dirname as __acrmDirname } from "node:path";
|
|
|
4
4
|
const require2 = __acrmRequire(import.meta.url);
|
|
5
5
|
const __filename = __acrmPath(import.meta.url);
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
|
-
import { P as Papa } from "./papaparse-
|
|
7
|
+
import { P as Papa } from "./papaparse-Df7i1dHr.mjs";
|
|
8
8
|
import { findOption, normalizeEmail, coerceFieldValue, recordLabel, normalizeDomain } from "./fields-B0bitgmr.mjs";
|
|
9
9
|
import { n as newId } from "./ids-CvnmrMJX.mjs";
|
|
10
10
|
import { c as camelId } from "./utils-DmI8FtXP.mjs";
|
|
11
11
|
import { assertCan, OpsError, actorId, emit } from "./context-CxFfqS4D.mjs";
|
|
12
|
-
import { prepareRecordFields, recordPatchMutation } from "./records-
|
|
12
|
+
import { prepareRecordFields, recordPatchMutation } from "./records-DcHFelq5.mjs";
|
|
13
13
|
import { requireObject, thaw, recordsOf, usersOf, asDoc, objectOf } from "./store-5gqRSKXg.mjs";
|
|
14
14
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
15
15
|
import "stream";
|
|
@@ -124,7 +124,7 @@ async function checkPlan(plan) {
|
|
|
124
124
|
}
|
|
125
125
|
} catch (err) {
|
|
126
126
|
const e = err;
|
|
127
|
-
data = { ok: false, detail: e.name === "PassphraseError" ? `wrong passphrase in ${plan.passphraseAccount}` : e.message, existing:
|
|
127
|
+
data = { ok: false, detail: e.name === "PassphraseError" ? `wrong passphrase in ${plan.passphraseAccount}` : e.message, existing: e.name === "PassphraseError" };
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
} else if (plan.runtime.backend === "git-json") {
|
|
@@ -153,8 +153,8 @@ async function runInstall(plan, onStep) {
|
|
|
153
153
|
await store.ready();
|
|
154
154
|
const { createOpsContext } = await import("./context-CxFfqS4D.mjs");
|
|
155
155
|
const { createPluginRegistry } = await import("./pluginRegistry-DyHtlkcr.mjs");
|
|
156
|
-
const { seedCrm } = await import("./seed-
|
|
157
|
-
const { setConfigDoc } = await import("./settings-
|
|
156
|
+
const { seedCrm } = await import("./seed-6MRmQQBR.mjs");
|
|
157
|
+
const { setConfigDoc } = await import("./settings-Di8nzNEL.mjs");
|
|
158
158
|
const system = createOpsContext(store, null, { plugins: createPluginRegistry() });
|
|
159
159
|
onStep(`Seeding the CRM${plan.demo ? " (with demo data)" : ""}`);
|
|
160
160
|
const identity = plan.backend === "journal" ? null : await store.identity().catch(() => null);
|
|
@@ -4,25 +4,25 @@ import { dirname as __acrmDirname } from "node:path";
|
|
|
4
4
|
const require2 = __acrmRequire(import.meta.url);
|
|
5
5
|
const __filename = __acrmPath(import.meta.url);
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
|
-
import {
|
|
8
|
-
import { rewriteRuntimeImports, fingerprint, bundleImports } from "./package-
|
|
9
|
-
import { listLoadedExtensions, deactivateExtension, getLoadedExtension, setExtensionStatus, activateExtension } from "./registry-
|
|
7
|
+
import { j as RUNTIME_DIR, h as RUNTIME_MODULES, i as isCompatibleApiVersion, k as RUNTIME_GLOBAL } from "./api-Cz0Ubj-B.mjs";
|
|
8
|
+
import { rewriteRuntimeImports, fingerprint, bundleImports } from "./package-B7mI6HGi.mjs";
|
|
9
|
+
import { listLoadedExtensions, deactivateExtension, getLoadedExtension, setExtensionStatus, activateExtension } from "./registry-COfJrSmg.mjs";
|
|
10
10
|
import "./index-w03ReRs4.mjs";
|
|
11
11
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
12
12
|
import "stream";
|
|
13
13
|
import "events";
|
|
14
14
|
import "buffer";
|
|
15
15
|
import "util";
|
|
16
|
-
import "./featureRegistry-
|
|
16
|
+
import "./featureRegistry-DSsZbhrh.mjs";
|
|
17
17
|
import "./index-Bnmav-Oh.mjs";
|
|
18
18
|
import "./index-BM8qeGOb.mjs";
|
|
19
|
-
import "./modules-
|
|
19
|
+
import "./modules-clWdE-K2.mjs";
|
|
20
20
|
import "./context-CxFfqS4D.mjs";
|
|
21
21
|
import "./pluginRegistry-DyHtlkcr.mjs";
|
|
22
|
-
import "./settings-
|
|
22
|
+
import "./settings-Di8nzNEL.mjs";
|
|
23
23
|
import "./store-5gqRSKXg.mjs";
|
|
24
24
|
import "./runtimeConfig-CCOFg1RM.mjs";
|
|
25
|
-
import "./tools-
|
|
25
|
+
import "./tools-iSH-yMpl.mjs";
|
|
26
26
|
import "./fields-B0bitgmr.mjs";
|
|
27
27
|
import "./query-C5nJB_3C.mjs";
|
|
28
28
|
import "../agentcrm.mjs";
|
|
@@ -38,23 +38,23 @@ import "./activities-Cj_SIOay.mjs";
|
|
|
38
38
|
import "./ids-CvnmrMJX.mjs";
|
|
39
39
|
import "./relations-B9TynBmA.mjs";
|
|
40
40
|
import "./dedupe-BepmsaHv.mjs";
|
|
41
|
-
import "./importCsv-
|
|
42
|
-
import "./papaparse-
|
|
41
|
+
import "./importCsv-LVmMTaWU.mjs";
|
|
42
|
+
import "./papaparse-Df7i1dHr.mjs";
|
|
43
43
|
import "./utils-DmI8FtXP.mjs";
|
|
44
|
-
import "./records-
|
|
44
|
+
import "./records-DcHFelq5.mjs";
|
|
45
45
|
import "./standardObjects-CheqfDqa.mjs";
|
|
46
|
-
import "./pipelines-
|
|
47
|
-
import "./reports-
|
|
48
|
-
import "./schema-
|
|
49
|
-
import "./automations-
|
|
46
|
+
import "./pipelines-BAKpPk1w.mjs";
|
|
47
|
+
import "./reports-BACHGccj.mjs";
|
|
48
|
+
import "./schema-C4lSslXv.mjs";
|
|
49
|
+
import "./automations-DwWruxmu.mjs";
|
|
50
50
|
import "./extensionActions-D2HtpQz4.mjs";
|
|
51
|
-
import "./forms-
|
|
52
|
-
import "./schema-
|
|
53
|
-
import "./appearance-
|
|
51
|
+
import "./forms-BfuWaQjA.mjs";
|
|
52
|
+
import "./schema-DnLj8dUO.mjs";
|
|
53
|
+
import "./appearance-BloHbiLA.mjs";
|
|
54
54
|
import "./themes-DPZFv3yc.mjs";
|
|
55
|
-
import "./extensions-
|
|
55
|
+
import "./extensions-Bp72uZ9a.mjs";
|
|
56
56
|
import "./files-CjsPJSR6.mjs";
|
|
57
|
-
import "./files-
|
|
57
|
+
import "./files-D1daDgY0.mjs";
|
|
58
58
|
import "./index-RCmo-uld.mjs";
|
|
59
59
|
import "./http-Bk9ICb7I.mjs";
|
|
60
60
|
async function prepareRuntime(specifiers) {
|
|
@@ -147,7 +147,7 @@ function syncExtensions(store, opts = {}) {
|
|
|
147
147
|
report.loaded.push(doc.id);
|
|
148
148
|
} catch (err) {
|
|
149
149
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
150
|
-
console.error(`[extensions] ${doc.id} failed to load:`, error);
|
|
150
|
+
if (!opts.onError) console.error(`[extensions] ${doc.id} failed to load:`, error);
|
|
151
151
|
setExtensionStatus(doc, "error", error.message);
|
|
152
152
|
const st = getLoadedExtension(doc.id);
|
|
153
153
|
if (st) st.fingerprint = fp;
|
|
@@ -4,9 +4,9 @@ import { dirname as __acrmDirname } from "node:path";
|
|
|
4
4
|
const require2 = __acrmRequire(import.meta.url);
|
|
5
5
|
const __filename = __acrmPath(import.meta.url);
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
|
-
import { c as REQUIRED_MODULES, d as disabledFromDoc, B as BUILTIN_MODULES, M as MODULES_CONFIG_ID, i as isCompatibleApiVersion, e as builtinModule } from "./api-
|
|
7
|
+
import { c as REQUIRED_MODULES, d as disabledFromDoc, B as BUILTIN_MODULES, M as MODULES_CONFIG_ID, i as isCompatibleApiVersion, e as builtinModule } from "./api-Cz0Ubj-B.mjs";
|
|
8
8
|
import { assertCan, OpsError } from "./context-CxFfqS4D.mjs";
|
|
9
|
-
import { assertNoSecrets } from "./settings-
|
|
9
|
+
import { assertNoSecrets } from "./settings-Di8nzNEL.mjs";
|
|
10
10
|
import { extensionDocsOf, extensionDocOf } from "./store-5gqRSKXg.mjs";
|
|
11
11
|
import "./pluginRegistry-DyHtlkcr.mjs";
|
|
12
12
|
import "./runtimeConfig-CCOFg1RM.mjs";
|
|
@@ -142,6 +142,30 @@ function getModuleConfig(ctx, id) {
|
|
|
142
142
|
return configDoc(ctx.store)?.config?.[id];
|
|
143
143
|
}
|
|
144
144
|
const MAX_MODULE_CONFIG = 256 * 1024;
|
|
145
|
+
const MODULE_SECRET_KEYS = /* @__PURE__ */ new Set([
|
|
146
|
+
"apikey",
|
|
147
|
+
"apisecret",
|
|
148
|
+
"secret",
|
|
149
|
+
"secretkey",
|
|
150
|
+
"clientsecret",
|
|
151
|
+
"privatekey",
|
|
152
|
+
"accesstoken",
|
|
153
|
+
"authtoken",
|
|
154
|
+
"bearertoken",
|
|
155
|
+
"refreshtoken",
|
|
156
|
+
"password",
|
|
157
|
+
"token",
|
|
158
|
+
"webhooksecret"
|
|
159
|
+
]);
|
|
160
|
+
function assertNoModuleSecrets(value, path = "") {
|
|
161
|
+
if (!value || typeof value !== "object") return;
|
|
162
|
+
for (const [k, v] of Object.entries(value)) {
|
|
163
|
+
if (MODULE_SECRET_KEYS.has(k.toLowerCase().replace(/[_-]/g, "")) && v !== "" && v != null) {
|
|
164
|
+
throw new OpsError("validation", `Refusing to store the secret "${path}${k}" in the module configuration: every CRM user can read it. Keep secrets out of the CRM data.`);
|
|
165
|
+
}
|
|
166
|
+
assertNoModuleSecrets(v, `${path}${k}.`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
145
169
|
async function setModuleConfig(ctx, id, value) {
|
|
146
170
|
assertCan(ctx, "modules.write");
|
|
147
171
|
assertKnownModule(ctx.store, id);
|
|
@@ -155,6 +179,7 @@ async function setModuleConfig(ctx, id, value) {
|
|
|
155
179
|
if (json === void 0) throw new OpsError("validation", "Module configuration must be JSON-serialisable.");
|
|
156
180
|
if (json.length > MAX_MODULE_CONFIG) throw new OpsError("validation", `Module configuration is larger than ${MAX_MODULE_CONFIG / 1024} KB.`);
|
|
157
181
|
assertNoSecrets(value);
|
|
182
|
+
assertNoModuleSecrets(value);
|
|
158
183
|
}
|
|
159
184
|
const current = configDoc(ctx.store);
|
|
160
185
|
const next = value === null || value === void 0 ? void 0 : JSON.parse(JSON.stringify(value));
|
|
@@ -8,8 +8,8 @@ import { mkdtemp, writeFile, rm } from "node:fs/promises";
|
|
|
8
8
|
import { tmpdir } from "node:os";
|
|
9
9
|
import { resolve, join } from "node:path";
|
|
10
10
|
import { pathToFileURL } from "node:url";
|
|
11
|
-
import {
|
|
12
|
-
import { rewriteRuntimeImports } from "./package-
|
|
11
|
+
import { h as RUNTIME_MODULES } from "./api-Cz0Ubj-B.mjs";
|
|
12
|
+
import { rewriteRuntimeImports } from "./package-B7mI6HGi.mjs";
|
|
13
13
|
import "./index-w03ReRs4.mjs";
|
|
14
14
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
15
15
|
import "stream";
|
|
@@ -5,7 +5,7 @@ const require2 = __acrmRequire(import.meta.url);
|
|
|
5
5
|
const __filename = __acrmPath(import.meta.url);
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
7
|
import { J as JSZip } from "./index-w03ReRs4.mjs";
|
|
8
|
-
import { a as EXTENSION_LIMITS, R as RUNTIME_SPECIFIERS, i as isCompatibleApiVersion, b as EXTENSION_MIN_API_VERSION, E as EXTENSION_API_VERSION, B as BUILTIN_MODULES, f as MODULE_CATEGORIES } from "./api-
|
|
8
|
+
import { a as EXTENSION_LIMITS, R as RUNTIME_SPECIFIERS, i as isCompatibleApiVersion, b as EXTENSION_MIN_API_VERSION, E as EXTENSION_API_VERSION, B as BUILTIN_MODULES, f as MODULE_CATEGORIES } from "./api-Cz0Ubj-B.mjs";
|
|
9
9
|
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
10
10
|
import "stream";
|
|
11
11
|
import "events";
|
|
@@ -6,24 +6,43 @@ const __filename = __acrmPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __acrmDirname(__filename);
|
|
7
7
|
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-ClciMIcB.mjs";
|
|
8
8
|
import require$$0 from "stream";
|
|
9
|
-
|
|
9
|
+
function _mergeNamespaces(n, m) {
|
|
10
|
+
for (var i = 0; i < m.length; i++) {
|
|
11
|
+
const e = m[i];
|
|
12
|
+
if (typeof e !== "string" && !Array.isArray(e)) {
|
|
13
|
+
for (const k in e) {
|
|
14
|
+
if (k !== "default" && !(k in n)) {
|
|
15
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
if (d) {
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: () => e[k]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
|
|
27
|
+
}
|
|
28
|
+
var papaparse$2 = { exports: {} };
|
|
10
29
|
/* @license
|
|
11
30
|
Papa Parse
|
|
12
31
|
v5.7.0
|
|
13
32
|
https://github.com/mholt/PapaParse
|
|
14
33
|
License: MIT
|
|
15
34
|
*/
|
|
16
|
-
var papaparse = papaparse$
|
|
35
|
+
var papaparse$1 = papaparse$2.exports;
|
|
17
36
|
var hasRequiredPapaparse;
|
|
18
37
|
function requirePapaparse() {
|
|
19
|
-
if (hasRequiredPapaparse) return papaparse$
|
|
38
|
+
if (hasRequiredPapaparse) return papaparse$2.exports;
|
|
20
39
|
hasRequiredPapaparse = 1;
|
|
21
40
|
(function(module, exports) {
|
|
22
41
|
(function(root, factory) {
|
|
23
42
|
{
|
|
24
43
|
module.exports = factory();
|
|
25
44
|
}
|
|
26
|
-
})(papaparse, function moduleFactory() {
|
|
45
|
+
})(papaparse$1, function moduleFactory() {
|
|
27
46
|
var global = (function() {
|
|
28
47
|
if (typeof self !== "undefined") {
|
|
29
48
|
return self;
|
|
@@ -1275,11 +1294,16 @@ function requirePapaparse() {
|
|
|
1275
1294
|
}
|
|
1276
1295
|
return Papa2;
|
|
1277
1296
|
});
|
|
1278
|
-
})(papaparse$
|
|
1279
|
-
return papaparse$
|
|
1297
|
+
})(papaparse$2);
|
|
1298
|
+
return papaparse$2.exports;
|
|
1280
1299
|
}
|
|
1281
1300
|
var papaparseExports = requirePapaparse();
|
|
1282
1301
|
const Papa = /* @__PURE__ */ getDefaultExportFromCjs(papaparseExports);
|
|
1302
|
+
const papaparse = /* @__PURE__ */ _mergeNamespaces({
|
|
1303
|
+
__proto__: null,
|
|
1304
|
+
default: Papa
|
|
1305
|
+
}, [papaparseExports]);
|
|
1283
1306
|
export {
|
|
1284
|
-
Papa as P
|
|
1307
|
+
Papa as P,
|
|
1308
|
+
papaparse as p
|
|
1285
1309
|
};
|