mongoku 2.1.1 → 2.2.0
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 +19 -11
- package/build/client/_app/immutable/chunks/{CEvYYWlm.js → BdCk1gVw.js} +1 -1
- package/build/client/_app/immutable/chunks/BdCk1gVw.js.br +0 -0
- package/build/client/_app/immutable/chunks/BdCk1gVw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Dx86XS0G.js → Bsz507MG.js} +1 -1
- package/build/client/_app/immutable/chunks/Bsz507MG.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bsz507MG.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{4l_AWZos.js → C1XfxmRC.js} +1 -1
- package/build/client/_app/immutable/chunks/C1XfxmRC.js.br +0 -0
- package/build/client/_app/immutable/chunks/C1XfxmRC.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CKHNRODp.js +1 -0
- package/build/client/_app/immutable/chunks/CKHNRODp.js.br +0 -0
- package/build/client/_app/immutable/chunks/CKHNRODp.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{lkkUcQuO.js → CM2Lsplc.js} +10 -10
- package/build/client/_app/immutable/chunks/CM2Lsplc.js.br +0 -0
- package/build/client/_app/immutable/chunks/CM2Lsplc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{D64wQeYi.js → CRt_PE0j.js} +1 -1
- package/build/client/_app/immutable/chunks/CRt_PE0j.js.br +0 -0
- package/build/client/_app/immutable/chunks/CRt_PE0j.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{nVJvgG3c.js → CnRtsGt8.js} +3 -3
- package/build/client/_app/immutable/chunks/CnRtsGt8.js.br +0 -0
- package/build/client/_app/immutable/chunks/CnRtsGt8.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BjzB4NFq.js → D4QB_3_6.js} +1 -1
- package/build/client/_app/immutable/chunks/D4QB_3_6.js.br +0 -0
- package/build/client/_app/immutable/chunks/D4QB_3_6.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DVJuGan7.js → DKR4gtrs.js} +1 -1
- package/build/client/_app/immutable/chunks/DKR4gtrs.js.br +0 -0
- package/build/client/_app/immutable/chunks/DKR4gtrs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BtCOrwSt.js → lGcxg7CO.js} +1 -1
- package/build/client/_app/immutable/chunks/lGcxg7CO.js.br +0 -0
- package/build/client/_app/immutable/chunks/lGcxg7CO.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.g5qLQ5x2.js → app.-1fKTnAu.js} +2 -2
- package/build/client/_app/immutable/entry/app.-1fKTnAu.js.br +0 -0
- package/build/client/_app/immutable/entry/app.-1fKTnAu.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BJmMjOs5.js +1 -0
- package/build/client/_app/immutable/entry/start.BJmMjOs5.js.br +2 -0
- package/build/client/_app/immutable/entry/start.BJmMjOs5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.CD9yR-49.js → 0.Cd4lrshe.js} +1 -1
- package/build/client/_app/immutable/nodes/0.Cd4lrshe.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.Cd4lrshe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.DztuiMqq.js → 1.B4faIcO5.js} +1 -1
- package/build/client/_app/immutable/nodes/1.B4faIcO5.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.B4faIcO5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.B1nM3dh3.js +2 -0
- package/build/client/_app/immutable/nodes/10.B1nM3dh3.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.B1nM3dh3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{11.-Y7Cu3Uv.js → 11.MJ6Rv19p.js} +1 -1
- package/build/client/_app/immutable/nodes/11.MJ6Rv19p.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.MJ6Rv19p.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{12.wxif1TtN.js → 12.BMSZ742P.js} +1 -1
- package/build/client/_app/immutable/nodes/12.BMSZ742P.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.BMSZ742P.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.C5mOzCii.js +66 -0
- package/build/client/_app/immutable/nodes/13.C5mOzCii.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.C5mOzCii.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.DoT-dNUk.js → 7.BV3eTGHn.js} +1 -1
- package/build/client/_app/immutable/nodes/7.BV3eTGHn.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.BV3eTGHn.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{8.BFPkGTSl.js → 8.Dw_zZKYL.js} +1 -1
- package/build/client/_app/immutable/nodes/8.Dw_zZKYL.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.Dw_zZKYL.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{9.Bk397TaK.js → 9.BA65fyAm.js} +1 -1
- package/build/client/_app/immutable/nodes/9.BA65fyAm.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.BA65fyAm.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/{0-hDOo8HzQ.js → 0-DhPAR6AN.js} +2 -2
- package/build/server/chunks/{0-hDOo8HzQ.js.map → 0-DhPAR6AN.js.map} +1 -1
- package/build/server/chunks/{1-Dsw_dVjH.js → 1-B5Roc8lW.js} +2 -2
- package/build/server/chunks/{1-Dsw_dVjH.js.map → 1-B5Roc8lW.js.map} +1 -1
- package/build/server/chunks/{10-Xy0rxLNm.js → 10-BRaPMv4v.js} +9 -7
- package/build/server/chunks/10-BRaPMv4v.js.map +1 -0
- package/build/server/chunks/{11-DBYsQ3ww.js → 11-D47Grqcs.js} +8 -6
- package/build/server/chunks/{11-DBYsQ3ww.js.map → 11-D47Grqcs.js.map} +1 -1
- package/build/server/chunks/{12-D4aSEhYN.js → 12-DYHC-SIK.js} +8 -6
- package/build/server/chunks/{12-D4aSEhYN.js.map → 12-DYHC-SIK.js.map} +1 -1
- package/build/server/chunks/{13-CNu_Hz8r.js → 13-6jJDktOb.js} +7 -5
- package/build/server/chunks/{13-CNu_Hz8r.js.map → 13-6jJDktOb.js.map} +1 -1
- package/build/server/chunks/{7-CJJMTAtJ.js → 7-CEa921n2.js} +7 -5
- package/build/server/chunks/7-CEa921n2.js.map +1 -0
- package/build/server/chunks/{8-jBgxYwFg.js → 8-BJXi_u8p.js} +6 -4
- package/build/server/chunks/8-BJXi_u8p.js.map +1 -0
- package/build/server/chunks/{9-U8SAVx43.js → 9-DaOfuWT8.js} +7 -5
- package/build/server/chunks/{9-U8SAVx43.js.map → 9-DaOfuWT8.js.map} +1 -1
- package/build/server/chunks/{JsonEncoder-jJ2OBaud.js → JsonEncoder-B8eJRYZ4.js} +12 -2
- package/build/server/chunks/JsonEncoder-B8eJRYZ4.js.map +1 -0
- package/build/server/chunks/{JsonValue-B5gcBFcA.js → JsonValue-ClBHqVOS.js} +59 -50
- package/build/server/chunks/JsonValue-ClBHqVOS.js.map +1 -0
- package/build/server/chunks/{PrettyJson-mXYQacEL.js → PrettyJson-4GQa7qAU.js} +3 -3
- package/build/server/chunks/{PrettyJson-mXYQacEL.js.map → PrettyJson-4GQa7qAU.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-B-dLNs2Q.js → _page.svelte-C-13GpOe.js} +8 -6
- package/build/server/chunks/{_page.svelte-B-dLNs2Q.js.map → _page.svelte-C-13GpOe.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-BBpDrOEz.js → _page.svelte-CCaM2a2k.js} +10 -8
- package/build/server/chunks/{_page.svelte-BBpDrOEz.js.map → _page.svelte-CCaM2a2k.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-C9OCv4Hv.js → _page.svelte-CGvzbG1F.js} +9 -7
- package/build/server/chunks/{_page.svelte-C9OCv4Hv.js.map → _page.svelte-CGvzbG1F.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-CvWJ35oO.js → _page.svelte-CKLhszFj.js} +8 -6
- package/build/server/chunks/{_page.svelte-CvWJ35oO.js.map → _page.svelte-CKLhszFj.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-Ds1-yUh2.js → _page.svelte-CiFj0j1b.js} +8 -6
- package/build/server/chunks/{_page.svelte-Ds1-yUh2.js.map → _page.svelte-CiFj0j1b.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-DYHUokXG.js → _page.svelte-DsOSf3up.js} +11 -9
- package/build/server/chunks/_page.svelte-DsOSf3up.js.map +1 -0
- package/build/server/chunks/hooks.server-DRPXFQlL.js +53 -0
- package/build/server/chunks/hooks.server-DRPXFQlL.js.map +1 -0
- package/build/server/chunks/{jsonParser-CraFXJs8.js → jsonParser-C3QUcODD.js} +10 -2
- package/build/server/chunks/jsonParser-C3QUcODD.js.map +1 -0
- package/build/server/chunks/logger-KF6KpVP6.js +150 -0
- package/build/server/chunks/logger-KF6KpVP6.js.map +1 -0
- package/build/server/chunks/{mongo-BogiTfnG.js → mongo-Db8Vgimy.js} +2 -2
- package/build/server/chunks/{mongo-BogiTfnG.js.map → mongo-Db8Vgimy.js.map} +1 -1
- package/build/server/chunks/remote-xxtqbu-AjxdDZZ_.js +19 -0
- package/build/server/chunks/remote-xxtqbu-AjxdDZZ_.js.map +1 -0
- package/build/server/chunks/{servers.remote-C2HuT43p.js → servers.remote-DrkuAWHP.js} +20 -7
- package/build/server/chunks/servers.remote-DrkuAWHP.js.map +1 -0
- package/build/server/index.js +2 -2
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +11 -11
- package/build/server/manifest.js.map +1 -1
- package/package.json +1 -1
- package/src/api/servers.remote.ts +20 -3
- package/src/app.d.ts +3 -1
- package/src/hooks.server.ts +38 -16
- package/src/lib/components/JsonValue.svelte +8 -0
- package/src/lib/server/JsonEncoder.ts +11 -1
- package/src/lib/server/contextStore.ts +4 -0
- package/src/lib/server/logger.ts +184 -0
- package/src/lib/server/mongo.ts +1 -1
- package/src/lib/utils/jsonParser.ts +11 -1
- package/src/routes/servers/+page.server.ts +1 -1
- package/src/routes/servers/[server]/databases/+page.server.ts +1 -1
- package/src/routes/servers/[server]/databases/[database]/collections/[collection]/documents/+page.server.ts +1 -1
- package/src/routes/servers/[server]/databases/[database]/collections/[collection]/documents/+page.svelte +2 -3
- package/src/routes/servers/[server]/databases/[database]/collections/[collection]/indexes/+page.server.ts +1 -1
- package/src/routes/servers/[server]/databases/[database]/collections/[collection]/mappings/+page.svelte +1 -2
- package/build/client/_app/immutable/chunks/4l_AWZos.js.br +0 -0
- package/build/client/_app/immutable/chunks/4l_AWZos.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BjzB4NFq.js.br +0 -0
- package/build/client/_app/immutable/chunks/BjzB4NFq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BtCOrwSt.js.br +0 -0
- package/build/client/_app/immutable/chunks/BtCOrwSt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CEvYYWlm.js.br +0 -0
- package/build/client/_app/immutable/chunks/CEvYYWlm.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CT5SFbzp.js +0 -1
- package/build/client/_app/immutable/chunks/CT5SFbzp.js.br +0 -0
- package/build/client/_app/immutable/chunks/CT5SFbzp.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CcyPStn-.js +0 -1
- package/build/client/_app/immutable/chunks/CcyPStn-.js.br +0 -0
- package/build/client/_app/immutable/chunks/CcyPStn-.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D64wQeYi.js.br +0 -0
- package/build/client/_app/immutable/chunks/D64wQeYi.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DVJuGan7.js.br +0 -0
- package/build/client/_app/immutable/chunks/DVJuGan7.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dx86XS0G.js.br +0 -4
- package/build/client/_app/immutable/chunks/Dx86XS0G.js.gz +0 -0
- package/build/client/_app/immutable/chunks/lkkUcQuO.js.br +0 -0
- package/build/client/_app/immutable/chunks/lkkUcQuO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/nVJvgG3c.js.br +0 -0
- package/build/client/_app/immutable/chunks/nVJvgG3c.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.g5qLQ5x2.js.br +0 -0
- package/build/client/_app/immutable/entry/app.g5qLQ5x2.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.C1uqw3sp.js +0 -1
- package/build/client/_app/immutable/entry/start.C1uqw3sp.js.br +0 -2
- package/build/client/_app/immutable/entry/start.C1uqw3sp.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.CD9yR-49.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.CD9yR-49.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.DztuiMqq.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DztuiMqq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.CWMFKPcE.js +0 -2
- package/build/client/_app/immutable/nodes/10.CWMFKPcE.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.CWMFKPcE.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.-Y7Cu3Uv.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.-Y7Cu3Uv.js.gz +0 -0
- package/build/client/_app/immutable/nodes/12.wxif1TtN.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.wxif1TtN.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.CpyTaRSN.js +0 -66
- package/build/client/_app/immutable/nodes/13.CpyTaRSN.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.CpyTaRSN.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.DoT-dNUk.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DoT-dNUk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.BFPkGTSl.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.BFPkGTSl.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.Bk397TaK.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.Bk397TaK.js.gz +0 -0
- package/build/server/chunks/10-Xy0rxLNm.js.map +0 -1
- package/build/server/chunks/7-CJJMTAtJ.js.map +0 -1
- package/build/server/chunks/8-jBgxYwFg.js.map +0 -1
- package/build/server/chunks/JsonEncoder-jJ2OBaud.js.map +0 -1
- package/build/server/chunks/JsonValue-B5gcBFcA.js.map +0 -1
- package/build/server/chunks/_page.svelte-DYHUokXG.js.map +0 -1
- package/build/server/chunks/hooks.server-CagAPNr2.js +0 -40
- package/build/server/chunks/hooks.server-CagAPNr2.js.map +0 -1
- package/build/server/chunks/jsonParser-CraFXJs8.js.map +0 -1
- package/build/server/chunks/logger-D71iWOkl.js +0 -36
- package/build/server/chunks/logger-D71iWOkl.js.map +0 -1
- package/build/server/chunks/remote-xxtqbu-BJDSUh3k.js +0 -17
- package/build/server/chunks/remote-xxtqbu-BJDSUh3k.js.map +0 -1
- package/build/server/chunks/servers.remote-C2HuT43p.js.map +0 -1
- package/src/lib/utils/logger.ts +0 -42
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"7-CEa921n2.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/servers/_page.server.ts.js","../../../.svelte-kit/adapter-node/nodes/7.js"],"sourcesContent":["import { l as logger } from \"../../../chunks/logger.js\";\nimport { g as getMongo } from \"../../../chunks/mongo.js\";\nconst load = async () => {\n const mongo = await getMongo();\n const servers = mongo.listClients().map(({ name, _id, client }) => ({\n name,\n _id,\n details: (async () => {\n try {\n const adminDb = client.db(\"test\").admin();\n const results = await adminDb.listDatabases();\n const filteredDatabases = mongo.filterDatabases(results.databases);\n const collectionsCount = await Promise.all(\n filteredDatabases.map(async (d) => {\n const db = client.db(d.name);\n const dbStats = await db.stats().catch(\n () => {\n logger.error(`Error getting stats for database ${d.name} on server ${name}`);\n return {\n collections: 0\n };\n }\n );\n return dbStats.collections;\n })\n );\n return {\n databases: filteredDatabases.map((d, index) => ({\n name: d.name,\n size: d.sizeOnDisk ?? 0,\n collections: collectionsCount[index]\n })),\n size: results.totalSize ?? 0\n };\n } catch (err) {\n logger.error(`Error getting details for server ${name}:`, err);\n return {\n error: {\n code: err instanceof Error && \"code\" in err ? err.code : void 0,\n name: err instanceof Error ? err.name : \"Error\",\n message: err instanceof Error ? err.message : String(err)\n }\n };\n }\n })().catch((err) => {\n logger.error(`Error getting details for server ${name}:`, err);\n return {\n error: {\n code: err instanceof Error && \"code\" in err ? err.code : void 0,\n name: err instanceof Error ? err.name : \"Error\",\n message: err instanceof Error ? err.message : String(err)\n }\n };\n })\n }));\n servers.sort((a, b) => a.name.localeCompare(b.name));\n return {\n servers\n };\n};\nexport {\n load\n};\n","import * as server from '../entries/pages/servers/_page.server.ts.js';\n\nexport const index = 7;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/servers/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/servers/+page.server.ts\";\nexport const imports = [\"_app/immutable/nodes/7.BV3eTGHn.js\",\"_app/immutable/chunks/BBg-V8FE.js\",\"_app/immutable/chunks/C82Rp5eQ.js\",\"_app/immutable/chunks/3iRu_dUj.js\",\"_app/immutable/chunks/BUNgwIS0.js\",\"_app/immutable/chunks/D7E46CWw.js\",\"_app/immutable/chunks/BdCk1gVw.js\",\"_app/immutable/chunks/C1XfxmRC.js\",\"_app/immutable/chunks/Cx2cA4gg.js\",\"_app/immutable/chunks/D4QB_3_6.js\",\"_app/immutable/chunks/CnRtsGt8.js\",\"_app/immutable/chunks/5nAxkTTP.js\",\"_app/immutable/chunks/Bsz507MG.js\",\"_app/immutable/chunks/CRt_PE0j.js\",\"_app/immutable/chunks/DKR4gtrs.js\",\"_app/immutable/chunks/BE8UzJuY.js\",\"_app/immutable/chunks/C0PCwpqt.js\"];\nexport const stylesheets = [\"_app/immutable/assets/Panel.B3aWupye.css\",\"_app/immutable/assets/7.CRKE8WvY.css\"];\nexport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CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACtD,EAAE,OAAO;AACT,IAAI;AACJ,GAAG;AACH,CAAC;;;;;;;ACzDW,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAA0C,CAAC,EAAE;AAExG,MAAC,SAAS,GAAG;AACb,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAChnB,MAAC,WAAW,GAAG,CAAC,0CAA0C,CAAC,sCAAsC;AACjG,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { l as logger } from './logger-KF6KpVP6.js';
|
|
2
|
+
import { g as getMongo, a as getCollectionJson } from './mongo-Db8Vgimy.js';
|
|
3
|
+
import 'async_hooks';
|
|
4
|
+
import 'node:util';
|
|
3
5
|
import 'mongodb';
|
|
4
6
|
import 'url';
|
|
5
7
|
import 'node:fs';
|
|
@@ -58,9 +60,9 @@ const index = 8;
|
|
|
58
60
|
let component_cache;
|
|
59
61
|
const component = async () => component_cache ??= (await import('./_page.svelte-DzPMpozq.js')).default;
|
|
60
62
|
const server_id = "src/routes/servers/[server]/databases/+page.server.ts";
|
|
61
|
-
const imports = ["_app/immutable/nodes/8.
|
|
63
|
+
const imports = ["_app/immutable/nodes/8.Dw_zZKYL.js","_app/immutable/chunks/BBg-V8FE.js","_app/immutable/chunks/C82Rp5eQ.js","_app/immutable/chunks/3iRu_dUj.js","_app/immutable/chunks/BUNgwIS0.js","_app/immutable/chunks/D7E46CWw.js","_app/immutable/chunks/BdCk1gVw.js","_app/immutable/chunks/C1XfxmRC.js","_app/immutable/chunks/Bsz507MG.js","_app/immutable/chunks/CRt_PE0j.js","_app/immutable/chunks/DKR4gtrs.js","_app/immutable/chunks/BE8UzJuY.js"];
|
|
62
64
|
const stylesheets = ["_app/immutable/assets/Panel.B3aWupye.css"];
|
|
63
65
|
const fonts = [];
|
|
64
66
|
|
|
65
67
|
export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
|
|
66
|
-
//# sourceMappingURL=8-
|
|
68
|
+
//# sourceMappingURL=8-BJXi_u8p.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"8-BJXi_u8p.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/servers/_server_/databases/_page.server.ts.js","../../../.svelte-kit/adapter-node/nodes/8.js"],"sourcesContent":["import { l as logger } from \"../../../../../chunks/logger.js\";\nimport { g as getMongo, a as getCollectionJson } from \"../../../../../chunks/mongo.js\";\nconst load = async ({ params }) => {\n const mongo = await getMongo();\n const client = mongo.getClient(params.server);\n const adminDb = client.db(\"test\").admin();\n const results = await adminDb.listDatabases();\n if (!Array.isArray(results.databases)) {\n return {\n databases: []\n };\n }\n const filteredDatabases = mongo.filterDatabases(results.databases);\n const databases = await Promise.all(\n filteredDatabases.map(async (d) => {\n const db = client.db(d.name);\n const dbStats = await db.stats().catch(() => {\n logger.error(`Error getting stats for database ${d.name} on server ${params.server}`);\n return {\n dataSize: 0,\n avgObjSize: 0,\n storageSize: 0,\n indexSize: 0,\n collections: 0\n };\n });\n const collectionsJson = db.listCollections().toArray().then((c) => c.sort((a, b) => a.name.localeCompare(b.name))).then((c) => Promise.all(c.map((c2) => getCollectionJson(db.collection(c2.name), c2.type))));\n return {\n name: db.databaseName,\n size: d.sizeOnDisk ?? 0,\n dataSize: dbStats.dataSize,\n avgObjSize: dbStats.avgObjSize,\n storageSize: dbStats.storageSize,\n totalIndexSize: dbStats.indexSize,\n empty: d.empty ?? true,\n nCollections: dbStats.collections,\n collections: collectionsJson.catch(() => [])\n };\n })\n );\n return {\n databases\n };\n};\nexport {\n load\n};\n","import * as server from '../entries/pages/servers/_server_/databases/_page.server.ts.js';\n\nexport const index = 8;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/servers/_server_/databases/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/servers/[server]/databases/+page.server.ts\";\nexport const imports = [\"_app/immutable/nodes/8.Dw_zZKYL.js\",\"_app/immutable/chunks/BBg-V8FE.js\",\"_app/immutable/chunks/C82Rp5eQ.js\",\"_app/immutable/chunks/3iRu_dUj.js\",\"_app/immutable/chunks/BUNgwIS0.js\",\"_app/immutable/chunks/D7E46CWw.js\",\"_app/immutable/chunks/BdCk1gVw.js\",\"_app/immutable/chunks/C1XfxmRC.js\",\"_app/immutable/chunks/Bsz507MG.js\",\"_app/immutable/chunks/CRt_PE0j.js\",\"_app/immutable/chunks/DKR4gtrs.js\",\"_app/immutable/chunks/BE8UzJuY.js\"];\nexport const stylesheets = [\"_app/immutable/assets/Panel.B3aWupye.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;;;;AAEA,MAAM,IAAI,GAAG,OAAO,EAAE,MAAM,EAAE,KAAK;AACnC,EAAE,MAAM,KAAK,GAAG,MAAM,QAAQ,EAAE;AAChC,EAAE,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AAC/C,EAAE,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE;AAC3C,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,EAAE;AAC/C,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AACzC,I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,CAAC,YAAY;AAC7B,QAAQ,IAAI,EAAE,CAAC,CAAC,UAAU,IAAI,CAAC;AAC/B,QAAQ,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAClC,QAAQ,UAAU,EAAE,OAAO,CAAC,UAAU;AACtC,QAAQ,WAAW,EAAE,OAAO,CAAC,WAAW;AACxC,QAAQ,cAAc,EAAE,OAAO,CAAC,SAAS;AACzC,QAAQ,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI;AAC9B,QAAQ,YAAY,EAAE,OAAO,CAAC,WAAW;AACzC,QAAQ,WAAW,EAAE,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE;AACnD,OAAO;AACP,IAAI,CAAC;AACL,GAAG;AACH,EAAE,OAAO;AACT,IAAI;AACJ,GAAG;AACH,CAAC;;;;;;;ACzCW,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAA6D,CAAC,EAAE;AAE3H,MAAC,SAAS,GAAG;AACb,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAC5b,MAAC,WAAW,GAAG,CAAC,0CAA0C;AAC1D,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { g as getMongo, a as getCollectionJson } from './mongo-
|
|
2
|
-
import './logger-
|
|
1
|
+
import { g as getMongo, a as getCollectionJson } from './mongo-Db8Vgimy.js';
|
|
2
|
+
import './logger-KF6KpVP6.js';
|
|
3
|
+
import 'async_hooks';
|
|
4
|
+
import 'node:util';
|
|
3
5
|
import 'mongodb';
|
|
4
6
|
import 'url';
|
|
5
7
|
import 'node:fs';
|
|
@@ -28,11 +30,11 @@ var _page_server_ts = /*#__PURE__*/Object.freeze({
|
|
|
28
30
|
|
|
29
31
|
const index = 9;
|
|
30
32
|
let component_cache;
|
|
31
|
-
const component = async () => component_cache ??= (await import('./_page.svelte-
|
|
33
|
+
const component = async () => component_cache ??= (await import('./_page.svelte-CiFj0j1b.js')).default;
|
|
32
34
|
const server_id = "src/routes/servers/[server]/databases/[database]/collections/+page.server.ts";
|
|
33
|
-
const imports = ["_app/immutable/nodes/9.
|
|
35
|
+
const imports = ["_app/immutable/nodes/9.BA65fyAm.js","_app/immutable/chunks/BBg-V8FE.js","_app/immutable/chunks/C82Rp5eQ.js","_app/immutable/chunks/3iRu_dUj.js","_app/immutable/chunks/BUNgwIS0.js","_app/immutable/chunks/D7E46CWw.js","_app/immutable/chunks/BdCk1gVw.js","_app/immutable/chunks/C1XfxmRC.js","_app/immutable/chunks/D4QB_3_6.js","_app/immutable/chunks/CnRtsGt8.js","_app/immutable/chunks/5nAxkTTP.js","_app/immutable/chunks/D5ccpaXt.js","_app/immutable/chunks/BE8UzJuY.js","_app/immutable/chunks/Bsz507MG.js","_app/immutable/chunks/CRt_PE0j.js","_app/immutable/chunks/DKR4gtrs.js","_app/immutable/chunks/C0PCwpqt.js"];
|
|
34
36
|
const stylesheets = ["_app/immutable/assets/Modal.DIIFkbGB.css","_app/immutable/assets/Panel.B3aWupye.css"];
|
|
35
37
|
const fonts = [];
|
|
36
38
|
|
|
37
39
|
export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
|
|
38
|
-
//# sourceMappingURL=9-
|
|
40
|
+
//# sourceMappingURL=9-DaOfuWT8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"9-
|
|
1
|
+
{"version":3,"file":"9-DaOfuWT8.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/servers/_server_/databases/_database_/collections/_page.server.ts.js","../../../.svelte-kit/adapter-node/nodes/9.js"],"sourcesContent":["import { g as getMongo, a as getCollectionJson } from \"../../../../../../../chunks/mongo.js\";\nconst load = async ({ params }) => {\n const mongo = await getMongo();\n const client = mongo.getClient(params.server);\n const db = client.db(params.database);\n const collections = (await db.listCollections().toArray()).sort((a, b) => a.name.localeCompare(b.name));\n const collectionsWithDetails = collections.map((c) => ({\n name: c.name,\n type: c.type,\n details: getCollectionJson(db.collection(c.name), c.type).catch(() => null)\n }));\n return {\n collections: collectionsWithDetails\n };\n};\nexport {\n load\n};\n","import * as server from '../entries/pages/servers/_server_/databases/_database_/collections/_page.server.ts.js';\n\nexport const index = 9;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/servers/_server_/databases/_database_/collections/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/servers/[server]/databases/[database]/collections/+page.server.ts\";\nexport const imports = [\"_app/immutable/nodes/9.BA65fyAm.js\",\"_app/immutable/chunks/BBg-V8FE.js\",\"_app/immutable/chunks/C82Rp5eQ.js\",\"_app/immutable/chunks/3iRu_dUj.js\",\"_app/immutable/chunks/BUNgwIS0.js\",\"_app/immutable/chunks/D7E46CWw.js\",\"_app/immutable/chunks/BdCk1gVw.js\",\"_app/immutable/chunks/C1XfxmRC.js\",\"_app/immutable/chunks/D4QB_3_6.js\",\"_app/immutable/chunks/CnRtsGt8.js\",\"_app/immutable/chunks/5nAxkTTP.js\",\"_app/immutable/chunks/D5ccpaXt.js\",\"_app/immutable/chunks/BE8UzJuY.js\",\"_app/immutable/chunks/Bsz507MG.js\",\"_app/immutable/chunks/CRt_PE0j.js\",\"_app/immutable/chunks/DKR4gtrs.js\",\"_app/immutable/chunks/C0PCwpqt.js\"];\nexport const stylesheets = [\"_app/immutable/assets/Modal.DIIFkbGB.css\",\"_app/immutable/assets/Panel.B3aWupye.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;;;;AACA,MAAM,IAAI,GAAG,OAAO,EAAE,MAAM,EAAE,KAAK;AACnC,EAAE,MAAM,KAAK,GAAG,MAAM,QAAQ,EAAE;AAChC,EAAE,MA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AAG;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ObjectId } from 'mongodb';
|
|
1
|
+
import { ObjectId, Binary } from 'mongodb';
|
|
2
2
|
|
|
3
3
|
class JsonEncoder {
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -25,6 +25,13 @@ class JsonEncoder {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
if (obj instanceof Binary) {
|
|
29
|
+
return {
|
|
30
|
+
$type: "Binary",
|
|
31
|
+
$value: Buffer.from(obj.buffer).toString("base64"),
|
|
32
|
+
$subType: obj.sub_type
|
|
33
|
+
};
|
|
34
|
+
}
|
|
28
35
|
if (Array.isArray(obj)) {
|
|
29
36
|
return [...obj.map(JsonEncoder.encode)];
|
|
30
37
|
}
|
|
@@ -46,6 +53,9 @@ class JsonEncoder {
|
|
|
46
53
|
if (obj && obj.$type === "RegExp") {
|
|
47
54
|
return new RegExp(obj.$value.$pattern, obj.$value.$flags);
|
|
48
55
|
}
|
|
56
|
+
if (obj && obj.$type === "Binary") {
|
|
57
|
+
return new Binary(Buffer.from(obj.$value, "base64"), obj.$subType);
|
|
58
|
+
}
|
|
49
59
|
if (Array.isArray(obj)) {
|
|
50
60
|
return [...obj.map(JsonEncoder.decode)];
|
|
51
61
|
}
|
|
@@ -59,4 +69,4 @@ class JsonEncoder {
|
|
|
59
69
|
}
|
|
60
70
|
|
|
61
71
|
export { JsonEncoder as J };
|
|
62
|
-
//# sourceMappingURL=JsonEncoder-
|
|
72
|
+
//# sourceMappingURL=JsonEncoder-B8eJRYZ4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonEncoder-B8eJRYZ4.js","sources":["../../../.svelte-kit/adapter-node/chunks/JsonEncoder.js"],"sourcesContent":["import { ObjectId, Binary } from \"mongodb\";\nclass JsonEncoder {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static encode(obj) {\n if (obj instanceof ObjectId) {\n return {\n $type: \"ObjectId\",\n $value: obj.toHexString(),\n $date: obj.getTimestamp().getTime()\n };\n }\n if (obj instanceof Date) {\n return {\n $type: \"Date\",\n $value: obj.toISOString()\n };\n }\n if (obj instanceof RegExp) {\n return {\n $type: \"RegExp\",\n $value: {\n $pattern: obj.source,\n $flags: obj.flags\n }\n };\n }\n if (obj instanceof Binary) {\n return {\n $type: \"Binary\",\n $value: Buffer.from(obj.buffer).toString(\"base64\"),\n $subType: obj.sub_type\n };\n }\n if (Array.isArray(obj)) {\n return [...obj.map(JsonEncoder.encode)];\n }\n if (obj && typeof obj === \"object\") {\n for (const [key, value] of Object.entries(obj)) {\n obj[key] = JsonEncoder.encode(value);\n }\n }\n return obj;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static decode(obj) {\n if (obj && obj.$type === \"ObjectId\") {\n return ObjectId.createFromHexString(obj.$value);\n }\n if (obj && obj.$type === \"Date\") {\n return new Date(obj.$value);\n }\n if (obj && obj.$type === \"RegExp\") {\n return new RegExp(obj.$value.$pattern, obj.$value.$flags);\n }\n if (obj && obj.$type === \"Binary\") {\n return new Binary(Buffer.from(obj.$value, \"base64\"), obj.$subType);\n }\n if (Array.isArray(obj)) {\n return [...obj.map(JsonEncoder.decode)];\n }\n if (obj && typeof obj === \"object\") {\n for (const [key, value] of Object.entries(obj)) {\n obj[key] = JsonEncoder.decode(value);\n }\n }\n return obj;\n }\n}\nexport {\n JsonEncoder as J\n};\n"],"names":[],"mappings":";;AACA,MAAM,WAAW,CAAC;AAClB;AACA,EAAE,OAAO,MAAM,CAAC,GAAG,EAAE;AACrB,IAAI,IAAI,GAAG,YAAY,QAAQ,EAAE;AACjC,MAAM,OAAO;AACb,QAAQ,KAAK,EAAE,UAAU;AACzB,QAAQ,MAAM,EAAE,GAAG,CAAC,WAAW,EAAE;AACjC,QAAQ,KAAK,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC,OAAO;AACzC,OAAO;AACP,IAAI;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
46
48
|
default:
|
|
47
49
|
return "object";
|
|
48
50
|
}
|
|
@@ -147,77 +149,84 @@ function JsonValue_1($$renderer, $$props) {
|
|
|
147
149
|
$$renderer3.push(`<span class="value regexp svelte-1c374kz">/${escape_html(value.$value.$pattern)}/${escape_html(value.$value.$flags)}</span>`);
|
|
148
150
|
} else {
|
|
149
151
|
$$renderer3.push("<!--[!-->");
|
|
150
|
-
if (valueType === "
|
|
152
|
+
if (valueType === "binary") {
|
|
151
153
|
$$renderer3.push("<!--[-->");
|
|
152
|
-
|
|
153
|
-
$$renderer3.push("<!--[-->");
|
|
154
|
-
$$renderer3.push(`<span class="value array svelte-1c374kz">[]</span>`);
|
|
155
|
-
} else {
|
|
156
|
-
$$renderer3.push("<!--[!-->");
|
|
157
|
-
$$renderer3.push(`<span class="value array svelte-1c374kz">[<span${attr_class("collapsible-content svelte-1c374kz", void 0, { "hidden": collapsed })}><!--[-->`);
|
|
158
|
-
const each_array = ensure_array_like(value);
|
|
159
|
-
for (let i = 0, $$length = each_array.length; i < $$length; i++) {
|
|
160
|
-
let item = each_array[i];
|
|
161
|
-
$$renderer3.push(`<br/>${escape_html(getIndent(depth + 1))}`);
|
|
162
|
-
JsonValue_1($$renderer3, {
|
|
163
|
-
value: item,
|
|
164
|
-
autoCollapse,
|
|
165
|
-
collapsed: false,
|
|
166
|
-
depth: depth + 1,
|
|
167
|
-
keyPath: currentKeyPath,
|
|
168
|
-
isKeyMapped,
|
|
169
|
-
fetchMappedDocument
|
|
170
|
-
});
|
|
171
|
-
$$renderer3.push(`<!---->`);
|
|
172
|
-
}
|
|
173
|
-
$$renderer3.push(`<!--]--> <br/>${escape_html(getIndent(depth))}</span>`);
|
|
174
|
-
if (collapsed) {
|
|
175
|
-
$$renderer3.push("<!--[-->");
|
|
176
|
-
$$renderer3.push(`<span class="collapsed-summary svelte-1c374kz">... ${escape_html(value.length)} item${escape_html(value.length !== 1 ? "s" : "")}</span>`);
|
|
177
|
-
} else {
|
|
178
|
-
$$renderer3.push("<!--[!-->");
|
|
179
|
-
}
|
|
180
|
-
$$renderer3.push(`<!--]-->]</span>`);
|
|
181
|
-
}
|
|
182
|
-
$$renderer3.push(`<!--]-->`);
|
|
154
|
+
$$renderer3.push(`<span class="call function svelte-1c374kz">BinData(<span class="number">${escape_html(value.$subType)}</span>, "<span class="string">${escape_html(value.$value.length > 40 ? value.$value.substring(0, 40) + "..." : value.$value)}</span>")</span>`);
|
|
183
155
|
} else {
|
|
184
156
|
$$renderer3.push("<!--[!-->");
|
|
185
|
-
if (valueType === "
|
|
157
|
+
if (valueType === "array") {
|
|
186
158
|
$$renderer3.push("<!--[-->");
|
|
187
159
|
if (isEmpty) {
|
|
188
160
|
$$renderer3.push("<!--[-->");
|
|
189
|
-
$$renderer3.push(`<span class="value
|
|
161
|
+
$$renderer3.push(`<span class="value array svelte-1c374kz">[]</span>`);
|
|
190
162
|
} else {
|
|
191
163
|
$$renderer3.push("<!--[!-->");
|
|
192
|
-
$$renderer3.push(`<span class="value
|
|
193
|
-
const
|
|
194
|
-
for (let
|
|
195
|
-
let
|
|
164
|
+
$$renderer3.push(`<span class="value array svelte-1c374kz">[<span${attr_class("collapsible-content svelte-1c374kz", void 0, { "hidden": collapsed })}><!--[-->`);
|
|
165
|
+
const each_array = ensure_array_like(value);
|
|
166
|
+
for (let i = 0, $$length = each_array.length; i < $$length; i++) {
|
|
167
|
+
let item = each_array[i];
|
|
168
|
+
$$renderer3.push(`<br/>${escape_html(getIndent(depth + 1))}`);
|
|
196
169
|
JsonValue_1($$renderer3, {
|
|
197
|
-
value:
|
|
198
|
-
key: objKey,
|
|
170
|
+
value: item,
|
|
199
171
|
autoCollapse,
|
|
200
|
-
collapsed:
|
|
201
|
-
depth,
|
|
172
|
+
collapsed: false,
|
|
173
|
+
depth: depth + 1,
|
|
174
|
+
keyPath: currentKeyPath,
|
|
202
175
|
isKeyMapped,
|
|
203
|
-
fetchMappedDocument
|
|
204
|
-
keyPath: currentKeyPath
|
|
176
|
+
fetchMappedDocument
|
|
205
177
|
});
|
|
178
|
+
$$renderer3.push(`<!---->`);
|
|
206
179
|
}
|
|
207
|
-
$$renderer3.push(`<!--]
|
|
180
|
+
$$renderer3.push(`<!--]--> <br/>${escape_html(getIndent(depth))}</span>`);
|
|
208
181
|
if (collapsed) {
|
|
209
182
|
$$renderer3.push("<!--[-->");
|
|
210
|
-
$$renderer3.push(`<span class="collapsed-summary svelte-1c374kz">... ${escape_html(
|
|
183
|
+
$$renderer3.push(`<span class="collapsed-summary svelte-1c374kz">... ${escape_html(value.length)} item${escape_html(value.length !== 1 ? "s" : "")}</span>`);
|
|
211
184
|
} else {
|
|
212
185
|
$$renderer3.push("<!--[!-->");
|
|
213
|
-
$$renderer3.push(`${escape_html(getIndent(depth))}`);
|
|
214
186
|
}
|
|
215
|
-
$$renderer3.push(`<!--]-->
|
|
187
|
+
$$renderer3.push(`<!--]-->]</span>`);
|
|
216
188
|
}
|
|
217
189
|
$$renderer3.push(`<!--]-->`);
|
|
218
190
|
} else {
|
|
219
191
|
$$renderer3.push("<!--[!-->");
|
|
220
|
-
|
|
192
|
+
if (valueType === "object") {
|
|
193
|
+
$$renderer3.push("<!--[-->");
|
|
194
|
+
if (isEmpty) {
|
|
195
|
+
$$renderer3.push("<!--[-->");
|
|
196
|
+
$$renderer3.push(`<span class="value object svelte-1c374kz">{}</span>`);
|
|
197
|
+
} else {
|
|
198
|
+
$$renderer3.push("<!--[!-->");
|
|
199
|
+
$$renderer3.push(`<span class="value object svelte-1c374kz">{<span${attr_class("collapsible-content svelte-1c374kz", void 0, { "hidden": collapsed })}><!--[-->`);
|
|
200
|
+
const each_array_1 = ensure_array_like(Object.keys(value));
|
|
201
|
+
for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
|
|
202
|
+
let objKey = each_array_1[$$index_1];
|
|
203
|
+
JsonValue_1($$renderer3, {
|
|
204
|
+
value: value[objKey],
|
|
205
|
+
key: objKey,
|
|
206
|
+
autoCollapse,
|
|
207
|
+
collapsed: autoCollapse,
|
|
208
|
+
depth,
|
|
209
|
+
isKeyMapped,
|
|
210
|
+
fetchMappedDocument,
|
|
211
|
+
keyPath: currentKeyPath
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
$$renderer3.push(`<!--]--></span>`);
|
|
215
|
+
if (collapsed) {
|
|
216
|
+
$$renderer3.push("<!--[-->");
|
|
217
|
+
$$renderer3.push(`<span class="collapsed-summary svelte-1c374kz">... ${escape_html(Object.keys(value).length)} key${escape_html(Object.keys(value).length !== 1 ? "s" : "")}</span>`);
|
|
218
|
+
} else {
|
|
219
|
+
$$renderer3.push("<!--[!-->");
|
|
220
|
+
$$renderer3.push(`${escape_html(getIndent(depth))}`);
|
|
221
|
+
}
|
|
222
|
+
$$renderer3.push(`<!--]-->}</span>`);
|
|
223
|
+
}
|
|
224
|
+
$$renderer3.push(`<!--]-->`);
|
|
225
|
+
} else {
|
|
226
|
+
$$renderer3.push("<!--[!-->");
|
|
227
|
+
$$renderer3.push(`<span>${escape_html(String(value))}</span>`);
|
|
228
|
+
}
|
|
229
|
+
$$renderer3.push(`<!--]-->`);
|
|
221
230
|
}
|
|
222
231
|
$$renderer3.push(`<!--]-->`);
|
|
223
232
|
}
|
|
@@ -287,4 +296,4 @@ function JsonValue_1($$renderer, $$props) {
|
|
|
287
296
|
}
|
|
288
297
|
|
|
289
298
|
export { JsonValue_1 as J };
|
|
290
|
-
//# sourceMappingURL=JsonValue-
|
|
299
|
+
//# sourceMappingURL=JsonValue-ClBHqVOS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonValue-ClBHqVOS.js","sources":["../../../.svelte-kit/adapter-node/chunks/JsonValue.js"],"sourcesContent":["import \"./async.js\";\nimport { y as attr_class, x as attr, w as ensure_array_like } from \"./index2.js\";\nimport \"@sveltejs/kit/internal/server\";\nimport { T as Tooltip } from \"./Tooltip.js\";\nimport { e as escape_html } from \"./context.js\";\nfunction JsonValue_1($$renderer, $$props) {\n $$renderer.component(($$renderer2) => {\n const INDENT = \" \";\n let {\n value,\n key,\n autoCollapse = false,\n collapsed = false,\n depth = 0,\n isKeyMapped,\n fetchMappedDocument,\n keyPath = \"\"\n } = $$props;\n function getIndent(level) {\n return INDENT.repeat(level);\n }\n function isUrl(str) {\n return /^https?:\\/\\/[^\\s]+$/.test(str);\n }\n let showTooltip = false;\n const currentKeyPath = [keyPath, key].filter(Boolean).join(\".\");\n function getValueType(val) {\n if (val === null) return \"null\";\n if (Array.isArray(val)) return \"array\";\n switch (typeof val) {\n case \"boolean\":\n return \"boolean\";\n case \"number\":\n return \"number\";\n case \"string\":\n return \"string\";\n case \"object\":\n switch (val.$type) {\n case \"ObjectId\":\n return \"objectid\";\n case \"Date\":\n return \"date\";\n case \"RegExp\":\n return \"regexp\";\n case \"Binary\":\n return \"binary\";\n default:\n return \"object\";\n }\n default:\n return \"unknown\";\n }\n }\n const valueType = getValueType(value);\n const hasMappings = !!isKeyMapped && !!fetchMappedDocument && key === void 0 && isKeyMapped(currentKeyPath) && value !== null && value !== void 0 && valueType !== \"array\" && valueType !== \"object\";\n let isCollapsible = valueType === \"array\" || valueType === \"object\";\n let isEmpty = valueType === \"array\" && value.length === 0 || valueType === \"object\" && Object.keys(value).length === 0;\n let innerCollapsed = autoCollapse;\n if (key !== void 0) {\n $$renderer2.push(\"<!--[-->\");\n if (isCollapsible && !isEmpty) {\n $$renderer2.push(\"<!--[-->\");\n if (innerCollapsed) {\n $$renderer2.push(\"<!--[-->\");\n $$renderer2.push(`<span class=\"prop collapsible collapsed svelte-1c374kz\" role=\"button\" tabindex=\"0\">${escape_html(getIndent(depth + 1))}<span class=\"collapse-arrow svelte-1c374kz\">▶</span><var class=\"svelte-1c374kz\">${escape_html(key)}</var>: `);\n JsonValue_1($$renderer2, {\n value,\n autoCollapse,\n collapsed: innerCollapsed,\n depth: depth + 1,\n isKeyMapped,\n fetchMappedDocument,\n keyPath: currentKeyPath\n });\n $$renderer2.push(`<!----></span>`);\n } else {\n $$renderer2.push(\"<!--[!-->\");\n $$renderer2.push(`<span class=\"prop collapsible svelte-1c374kz\">${escape_html(getIndent(depth + 1))}<span class=\"collapse-arrow arrow-only svelte-1c374kz\" role=\"button\" tabindex=\"0\">▼</span><var class=\"svelte-1c374kz\">${escape_html(key)}</var>: `);\n JsonValue_1($$renderer2, {\n value,\n autoCollapse,\n collapsed: innerCollapsed,\n depth: depth + 1,\n isKeyMapped,\n fetchMappedDocument,\n keyPath: currentKeyPath\n });\n $$renderer2.push(`<!----></span>`);\n }\n $$renderer2.push(`<!--]-->`);\n } else {\n $$renderer2.push(\"<!--[!-->\");\n $$renderer2.push(`<span class=\"prop svelte-1c374kz\">${escape_html(getIndent(depth + 1))}<var class=\"svelte-1c374kz\">${escape_html(key)}</var>: `);\n JsonValue_1($$renderer2, {\n value,\n autoCollapse,\n collapsed: innerCollapsed,\n depth: depth + 1,\n isKeyMapped,\n fetchMappedDocument,\n keyPath: currentKeyPath\n });\n $$renderer2.push(`<!----></span>`);\n }\n $$renderer2.push(`<!--]-->`);\n } else {\n let valueSnippet = function($$renderer3) {\n if (valueType === \"string\") {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"value quoted svelte-1c374kz\">\"<span${attr_class(\"string svelte-1c374kz\", void 0, { \"url\": isUrl(value) })}>`);\n if (isUrl(value)) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<a${attr(\"href\", value)} target=\"_blank\" class=\"svelte-1c374kz\">${escape_html(value)}</a>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n $$renderer3.push(`${escape_html(value)}`);\n }\n $$renderer3.push(`<!--]--></span>\"</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n if (valueType === \"number\") {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"value number svelte-1c374kz\">${escape_html(value)}</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n if (valueType === \"boolean\") {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"value boolean svelte-1c374kz\">${escape_html(value)}</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n if (valueType === \"null\") {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"value null svelte-1c374kz\">null</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n if (valueType === \"objectid\") {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"call function svelte-1c374kz\">ObjectId(\"<span class=\"string\">${escape_html(value.$value)}</span>\")</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n if (valueType === \"date\") {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"call function svelte-1c374kz\">Date(\"<span class=\"string\">${escape_html(value.$value)}</span>\")</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n if (valueType === \"regexp\") {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"value regexp svelte-1c374kz\">/${escape_html(value.$value.$pattern)}/${escape_html(value.$value.$flags)}</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n if (valueType === \"binary\") {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"call function svelte-1c374kz\">BinData(<span class=\"number\">${escape_html(value.$subType)}</span>, \"<span class=\"string\">${escape_html(value.$value.length > 40 ? value.$value.substring(0, 40) + \"...\" : value.$value)}</span>\")</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n if (valueType === \"array\") {\n $$renderer3.push(\"<!--[-->\");\n if (isEmpty) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"value array svelte-1c374kz\">[]</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n $$renderer3.push(`<span class=\"value array svelte-1c374kz\">[<span${attr_class(\"collapsible-content svelte-1c374kz\", void 0, { \"hidden\": collapsed })}><!--[-->`);\n const each_array = ensure_array_like(value);\n for (let i = 0, $$length = each_array.length; i < $$length; i++) {\n let item = each_array[i];\n $$renderer3.push(`<br/>${escape_html(getIndent(depth + 1))}`);\n JsonValue_1($$renderer3, {\n value: item,\n autoCollapse,\n collapsed: false,\n depth: depth + 1,\n keyPath: currentKeyPath,\n isKeyMapped,\n fetchMappedDocument\n });\n $$renderer3.push(`<!---->`);\n }\n $$renderer3.push(`<!--]--> <br/>${escape_html(getIndent(depth))}</span>`);\n if (collapsed) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"collapsed-summary svelte-1c374kz\">... ${escape_html(value.length)} item${escape_html(value.length !== 1 ? \"s\" : \"\")}</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]-->]</span>`);\n }\n $$renderer3.push(`<!--]-->`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n if (valueType === \"object\") {\n $$renderer3.push(\"<!--[-->\");\n if (isEmpty) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"value object svelte-1c374kz\">{}</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n $$renderer3.push(`<span class=\"value object svelte-1c374kz\">{<span${attr_class(\"collapsible-content svelte-1c374kz\", void 0, { \"hidden\": collapsed })}><!--[-->`);\n const each_array_1 = ensure_array_like(Object.keys(value));\n for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {\n let objKey = each_array_1[$$index_1];\n JsonValue_1($$renderer3, {\n value: value[objKey],\n key: objKey,\n autoCollapse,\n collapsed: autoCollapse,\n depth,\n isKeyMapped,\n fetchMappedDocument,\n keyPath: currentKeyPath\n });\n }\n $$renderer3.push(`<!--]--></span>`);\n if (collapsed) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"collapsed-summary svelte-1c374kz\">... ${escape_html(Object.keys(value).length)} key${escape_html(Object.keys(value).length !== 1 ? \"s\" : \"\")}</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n $$renderer3.push(`${escape_html(getIndent(depth))}`);\n }\n $$renderer3.push(`<!--]-->}</span>`);\n }\n $$renderer3.push(`<!--]-->`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n $$renderer3.push(`<span>${escape_html(String(value))}</span>`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n };\n $$renderer2.push(\"<!--[!-->\");\n if (hasMappings) {\n $$renderer2.push(\"<!--[-->\");\n {\n let trigger = function($$renderer3) {\n $$renderer3.push(`<span${attr_class(\"string mapped svelte-1c374kz\", void 0, { \"url\": isUrl(value) })} role=\"button\" tabindex=\"0\">`);\n {\n $$renderer3.push(\"<!--[!-->\");\n valueSnippet?.($$renderer3);\n }\n $$renderer3.push(`<!--]--></span>`);\n }, content = function($$renderer3) {\n {\n $$renderer3.push(\"<!--[!-->\");\n {\n $$renderer3.push(\"<!--[!-->\");\n {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n }\n $$renderer3.push(`<!--]-->`);\n };\n Tooltip($$renderer2, {\n show: showTooltip,\n tooltipClass: \"max-w-[600px] max-h-[400px] overflow-auto whitespace-pre-wrap\",\n trigger,\n content\n });\n }\n } else {\n $$renderer2.push(\"<!--[!-->\");\n valueSnippet?.($$renderer2);\n }\n $$renderer2.push(`<!--]-->`);\n if (depth !== 0) {\n $$renderer2.push(\"<!--[-->\");\n $$renderer2.push(`,`);\n } else {\n $$renderer2.push(\"<!--[!-->\");\n }\n $$renderer2.push(`<!--]-->`);\n }\n $$renderer2.push(`<!--]-->`);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CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;AAClC,IAAI;AACJ,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;AAChC,EAAE,CAAC,CAAC;AACJ;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import './async-lVJA8xJZ.js';
|
|
2
2
|
import { b as attr_class, g as attr_style, a as attr, s as stringify } from './index2-DBFlGzWV.js';
|
|
3
|
-
import { f as fetchMappedDocument } from './servers.remote-
|
|
3
|
+
import { f as fetchMappedDocument } from './servers.remote-DrkuAWHP.js';
|
|
4
4
|
import { r as resolve } from './server2-_mGVuBoG.js';
|
|
5
5
|
import 'esprima';
|
|
6
|
-
import { J as JsonValue_1 } from './JsonValue-
|
|
6
|
+
import { J as JsonValue_1 } from './JsonValue-ClBHqVOS.js';
|
|
7
7
|
import { P as Panel } from './Panel-yg5YKL4d.js';
|
|
8
8
|
import { e as escape_html } from './context-C22hLSHK.js';
|
|
9
9
|
|
|
@@ -134,4 +134,4 @@ function PrettyJson($$renderer, $$props) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
export { PrettyJson as P };
|
|
137
|
-
//# sourceMappingURL=PrettyJson-
|
|
137
|
+
//# sourceMappingURL=PrettyJson-4GQa7qAU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrettyJson-mXYQacEL.js","sources":["../../../.svelte-kit/adapter-node/chunks/PrettyJson.js"],"sourcesContent":["import \"./async.js\";\nimport { y as attr_class, N as attr_style, x as attr, z as stringify } from \"./index2.js\";\nimport { f as fetchMappedDocument } from \"./servers.remote.js\";\nimport { r as resolve } from \"./server2.js\";\nimport \"esprima\";\nimport { J as JsonValue_1 } from \"./JsonValue.js\";\nimport { P as Panel } from \"./Panel.js\";\nimport { e as escape_html } from \"./context.js\";\nfunction PrettyJson($$renderer, $$props) {\n $$renderer.component(($$renderer2) => {\n let {\n json,\n autoCollapse = false,\n onedit,\n onremove,\n server,\n database,\n collection,\n mappings,\n startInEditMode = false\n } = $$props;\n function getIdValue(val) {\n if (val === null || val === void 0) return null;\n if (typeof val === \"string\" || typeof val === \"number\") return String(val);\n if (val.$type === \"ObjectId\" && val.$value) return val.$value;\n return null;\n }\n function isKeyMapped(path) {\n return !!mappings?.[path] && (Array.isArray(mappings[path]) ? mappings[path].length > 0 : true);\n }\n async function fetchMappedDocument$1(path, value) {\n if (!mappings || !mappings[path] || Array.isArray(mappings[path]) && mappings[path].length === 0) {\n return { document: null, url: null, collection: null };\n }\n const idValue = getIdValue(value);\n if (!idValue) {\n return { document: null, url: null, collection: null };\n }\n try {\n const result = await fetchMappedDocument({\n server,\n database,\n mappings: Array.isArray(mappings[path]) ? mappings[path] : [mappings[path]],\n value\n });\n if (result.error || !result.data || !result.collection) {\n return { document: null, url: null, collection: null };\n }\n const url = resolve(`/servers/${encodeURIComponent(server)}/databases/${encodeURIComponent(database)}/collections/${encodeURIComponent(result.collection)}/documents/${encodeURIComponent(idValue)}`);\n return { document: result.data, url, collection: result.collection };\n } catch {\n return { document: null, url: null, collection: null };\n }\n }\n let editorVisible = false;\n let editJson = \"\";\n let editorHeight = \"300px\";\n function getTimestampFromObjectId(objectId) {\n try {\n const timestamp = parseInt(objectId.substring(0, 8), 16);\n return new Date(timestamp * 1e3);\n } catch {\n return null;\n }\n }\n function title($$renderer3) {\n if (json._id) {\n $$renderer3.push(\"<!--[-->\");\n const idValue = json._id.$value ?? json._id;\n $$renderer3.push(`<div><a type=\"button\" class=\"bg-transparent border-none text-[var(--text)] no-underline cursor-pointer text-xl font-inherit p-0 hover:underline normal-case\"${attr(\"href\", resolve(`/servers/${encodeURIComponent(server)}/databases/${encodeURIComponent(database)}/collections/${encodeURIComponent(collection)}/documents/${idValue}`))}>${escape_html(idValue)}</a> `);\n if (json._id.$value) {\n $$renderer3.push(\"<!--[-->\");\n const timestamp = getTimestampFromObjectId(json._id.$value);\n if (timestamp) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"ml-2 text-md text-[var(--text-secondary,#888)]\">${escape_html(timestamp.toLocaleString())}</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]-->`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]-->`);\n }\n function actions($$renderer3) {\n $$renderer3.push(`<div class=\"hidden group-hover:block\"><button class=\"btn btn-outline-light btn-sm ml-2 -my-2\">Copy</button> `);\n if (onedit) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-light btn-sm ml-2 -my-2\">Edit</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--> `);\n if (onremove) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-danger btn-sm ml-2 -my-2\">Remove</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n Panel($$renderer2, {\n class: \"group\",\n title: json._id ? title : void 0,\n actions,\n children: ($$renderer3) => {\n $$renderer3.push(`<div class=\"p-4 relative border-t border-[var(--border-color)]\"><div class=\"font-mono text-sm leading-tight whitespace-pre-wrap break-words relative\">`);\n JsonValue_1($$renderer3, {\n value: json,\n autoCollapse,\n collapsed: false,\n isKeyMapped,\n fetchMappedDocument: fetchMappedDocument$1\n });\n $$renderer3.push(`<!----></div> <div${attr_class(\"absolute h-full z-[100] w-full top-0 left-0\", void 0, { \"hidden\": !editorVisible, \"block\": editorVisible })}><div class=\"absolute z-10 right-5 top-4\"><button class=\"btn btn-success ml-2\">Save</button> <button class=\"btn btn-default ml-2\">Cancel</button></div> <textarea${attr_style(`height: ${stringify(editorHeight)};`)} class=\"w-full font-mono text-sm leading-relaxed p-2.5 bg-[var(--color-1)] text-[var(--text)] border border-[var(--border-color)] rounded resize-y\">`);\n const $$body = escape_html(editJson);\n if ($$body) {\n $$renderer3.push(`${$$body}`);\n }\n $$renderer3.push(`</textarea></div> `);\n {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n });\n });\n}\nexport {\n PrettyJson as P\n};\n"],"names":[],"mappings":";;;;;;;;;AAQA,SAAS,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE;AACzC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,KAAK;AACxC,IAAI,IAAI;AACR,MAAM,IAAI;AACV,MAAM,YAAY,GAAG,KAAK;AAC1B,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,QAAQ;AACd,MAAM,eAAe,GAAG;AACxB,KAAK,GAAG,OAAO;AACf,IAAI,SAAS,UAAU,CAAC,GAAG,EAAE;AAC7B,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,MAAM,EAAE,OAAO,IAAI;AACrD,MAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC;AAChF,MAAM,IAAI,GAAG,CAAC,KAAK,KAAK,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,MAAM;AACnE,MAAM,OAAO,IAAI;AACjB,IAAI;AACJ,IAAI,SAAS,WAAW,CAAC,IAAI,EAAE;AAC/B,MAAM,OAAO,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;AACrG,IAAI;AACJ,IAAI,eAAe,qBAAqB,CAAC,IAAI,EAAE,KAAK,EAAE;AACtD,MAAM,IA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QAAQ,WAAW,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAC9C,QAAQ;AACR,UAAU,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;AACvC,QAAQ;AACR,QAAQ,WAAW,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC;AAC1C,MAAM;AACN,KAAK,CAAC;AACN,EAAE,CAAC,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"PrettyJson-4GQa7qAU.js","sources":["../../../.svelte-kit/adapter-node/chunks/PrettyJson.js"],"sourcesContent":["import \"./async.js\";\nimport { y as attr_class, N as attr_style, x as attr, z as stringify } from \"./index2.js\";\nimport { f as fetchMappedDocument } from \"./servers.remote.js\";\nimport { r as resolve } from \"./server2.js\";\nimport \"esprima\";\nimport { J as JsonValue_1 } from \"./JsonValue.js\";\nimport { P as Panel } from \"./Panel.js\";\nimport { e as escape_html } from \"./context.js\";\nfunction PrettyJson($$renderer, $$props) {\n $$renderer.component(($$renderer2) => {\n let {\n json,\n autoCollapse = false,\n onedit,\n onremove,\n server,\n database,\n collection,\n mappings,\n startInEditMode = false\n } = $$props;\n function getIdValue(val) {\n if (val === null || val === void 0) return null;\n if (typeof val === \"string\" || typeof val === \"number\") return String(val);\n if (val.$type === \"ObjectId\" && val.$value) return val.$value;\n return null;\n }\n function isKeyMapped(path) {\n return !!mappings?.[path] && (Array.isArray(mappings[path]) ? mappings[path].length > 0 : true);\n }\n async function fetchMappedDocument$1(path, value) {\n if (!mappings || !mappings[path] || Array.isArray(mappings[path]) && mappings[path].length === 0) {\n return { document: null, url: null, collection: null };\n }\n const idValue = getIdValue(value);\n if (!idValue) {\n return { document: null, url: null, collection: null };\n }\n try {\n const result = await fetchMappedDocument({\n server,\n database,\n mappings: Array.isArray(mappings[path]) ? mappings[path] : [mappings[path]],\n value\n });\n if (result.error || !result.data || !result.collection) {\n return { document: null, url: null, collection: null };\n }\n const url = resolve(`/servers/${encodeURIComponent(server)}/databases/${encodeURIComponent(database)}/collections/${encodeURIComponent(result.collection)}/documents/${encodeURIComponent(idValue)}`);\n return { document: result.data, url, collection: result.collection };\n } catch {\n return { document: null, url: null, collection: null };\n }\n }\n let editorVisible = false;\n let editJson = \"\";\n let editorHeight = \"300px\";\n function getTimestampFromObjectId(objectId) {\n try {\n const timestamp = parseInt(objectId.substring(0, 8), 16);\n return new Date(timestamp * 1e3);\n } catch {\n return null;\n }\n }\n function title($$renderer3) {\n if (json._id) {\n $$renderer3.push(\"<!--[-->\");\n const idValue = json._id.$value ?? json._id;\n $$renderer3.push(`<div><a type=\"button\" class=\"bg-transparent border-none text-[var(--text)] no-underline cursor-pointer text-xl font-inherit p-0 hover:underline normal-case\"${attr(\"href\", resolve(`/servers/${encodeURIComponent(server)}/databases/${encodeURIComponent(database)}/collections/${encodeURIComponent(collection)}/documents/${idValue}`))}>${escape_html(idValue)}</a> `);\n if (json._id.$value) {\n $$renderer3.push(\"<!--[-->\");\n const timestamp = getTimestampFromObjectId(json._id.$value);\n if (timestamp) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<span class=\"ml-2 text-md text-[var(--text-secondary,#888)]\">${escape_html(timestamp.toLocaleString())}</span>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]-->`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]-->`);\n }\n function actions($$renderer3) {\n $$renderer3.push(`<div class=\"hidden group-hover:block\"><button class=\"btn btn-outline-light btn-sm ml-2 -my-2\">Copy</button> `);\n if (onedit) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-light btn-sm ml-2 -my-2\">Edit</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--> `);\n if (onremove) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-danger btn-sm ml-2 -my-2\">Remove</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n Panel($$renderer2, {\n class: \"group\",\n title: json._id ? title : void 0,\n actions,\n children: ($$renderer3) => {\n $$renderer3.push(`<div class=\"p-4 relative border-t border-[var(--border-color)]\"><div class=\"font-mono text-sm leading-tight whitespace-pre-wrap break-words relative\">`);\n JsonValue_1($$renderer3, {\n value: json,\n autoCollapse,\n collapsed: false,\n isKeyMapped,\n fetchMappedDocument: fetchMappedDocument$1\n });\n $$renderer3.push(`<!----></div> <div${attr_class(\"absolute h-full z-[100] w-full top-0 left-0\", void 0, { \"hidden\": !editorVisible, \"block\": editorVisible })}><div class=\"absolute z-10 right-5 top-4\"><button class=\"btn btn-success ml-2\">Save</button> <button class=\"btn btn-default ml-2\">Cancel</button></div> <textarea${attr_style(`height: ${stringify(editorHeight)};`)} class=\"w-full font-mono text-sm leading-relaxed p-2.5 bg-[var(--color-1)] text-[var(--text)] border border-[var(--border-color)] rounded resize-y\">`);\n const $$body = escape_html(editJson);\n if ($$body) {\n $$renderer3.push(`${$$body}`);\n }\n $$renderer3.push(`</textarea></div> `);\n {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n });\n });\n}\nexport {\n PrettyJson as P\n};\n"],"names":[],"mappings":";;;;;;;;;AAQA,SAAS,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE;AACzC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,KAAK;AACxC,IAAI,IAAI;AACR,MAAM,IAAI;AACV,MAAM,YAAY,GAAG,KAAK;AAC1B,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,QAAQ;AACd,MAAM,eAAe,GAAG;AACxB,KAAK,GAAG,OAAO;AACf,IAAI,SAAS,UAAU,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CAAC,CAAC;AAClL,QAAQ,WAAW,CAAC,WAAW,EAAE;AACjC,UAAU,KAAK,EAAE,IAAI;AACrB,UAAU,YAAY;AACtB,UAAU,SAAS,EAAE,KAAK;AAC1B,UAAU,WAAW;AACrB,UAAU,mBAAmB,EAAE;AAC/B,SAAS,CAAC;AACV,QAAQ,WAAW,CAAC,IAAI,CAAC,CAAC,kBAAkB,EAAE,UAAU,CAAC,6CAA6C,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,iKAAiK,EAAE,UAAU,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,oJAAoJ,CAAC,CAAC;AACjhB,QAAQ,MAAM,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC;AAC5C,QAAQ,IAAI,MAAM,EAAE;AACpB,UAAU,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACvC,QAAQ;AACR,QAAQ,WAAW,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAC9C,QAAQ;AACR,UAAU,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;AACvC,QAAQ;AACR,QAAQ,WAAW,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC;AAC1C,MAAM;AACN,KAAK,CAAC;AACN,EAAE,CAAC,CAAC;AACJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './async-lVJA8xJZ.js';
|
|
2
2
|
import { s as stringify, a as attr, e as ensure_array_like } from './index2-DBFlGzWV.js';
|
|
3
|
-
import './servers.remote-
|
|
3
|
+
import './servers.remote-DrkuAWHP.js';
|
|
4
4
|
import { r as resolve } from './server2-_mGVuBoG.js';
|
|
5
5
|
import { P as Panel } from './Panel-yg5YKL4d.js';
|
|
6
6
|
import { e as escape_html } from './context-C22hLSHK.js';
|
|
@@ -8,12 +8,14 @@ import './event-DVH-6ISX.js';
|
|
|
8
8
|
import './utils-kjxf7BZO.js';
|
|
9
9
|
import './shared-Buki-xt5.js';
|
|
10
10
|
import './index-Djsj11qr.js';
|
|
11
|
-
import './jsonParser-
|
|
11
|
+
import './jsonParser-C3QUcODD.js';
|
|
12
12
|
import 'esprima';
|
|
13
|
-
import './JsonEncoder-
|
|
13
|
+
import './JsonEncoder-B8eJRYZ4.js';
|
|
14
14
|
import 'mongodb';
|
|
15
|
-
import './
|
|
16
|
-
import '
|
|
15
|
+
import './logger-KF6KpVP6.js';
|
|
16
|
+
import 'async_hooks';
|
|
17
|
+
import 'node:util';
|
|
18
|
+
import './mongo-Db8Vgimy.js';
|
|
17
19
|
import 'url';
|
|
18
20
|
import 'node:fs';
|
|
19
21
|
import 'node:os';
|
|
@@ -196,4 +198,4 @@ Please analyze the codebase and database, then generate the appropriate mappings
|
|
|
196
198
|
}
|
|
197
199
|
|
|
198
200
|
export { _page as default };
|
|
199
|
-
//# sourceMappingURL=_page.svelte-
|
|
201
|
+
//# sourceMappingURL=_page.svelte-C-13GpOe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_page.svelte-B-dLNs2Q.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/servers/_server_/databases/_database_/collections/_collection_/mappings/_page.svelte.js"],"sourcesContent":["import \"../../../../../../../../../chunks/async.js\";\nimport { x as attr, w as ensure_array_like, z as stringify } from \"../../../../../../../../../chunks/index2.js\";\nimport \"../../../../../../../../../chunks/servers.remote.js\";\nimport { r as resolve } from \"../../../../../../../../../chunks/server2.js\";\nimport { P as Panel } from \"../../../../../../../../../chunks/Panel.js\";\nimport { e as escape_html } from \"../../../../../../../../../chunks/context.js\";\nfunction _page($$renderer, $$props) {\n $$renderer.component(($$renderer2) => {\n let { data } = $$props;\n let mappingsArray = Object.entries(data.mappings).map(([fieldPath, targets]) => ({\n fieldPath,\n targets: Array.isArray(targets) ? targets : [targets]\n }));\n `I need help generating MongoDB collection mappings for my database.\n\n**Context:**\n- Database: ${data.database}\n- Collection: ${data.collection}\n- Available collections: ${data.availableCollections.join(\", \")}\n\n**Task:**\nPlease analyze my codebase to identify relationships between the \"${data.collection}\" collection and other collections. Look for:\n1. Fields that reference documents in other collections (foreign keys)\n2. Nested fields within arrays or objects that reference other documents\n3. Common patterns like userId, authorId, etc.\n\nIf you have access to the MongoDB MCP server, use it to:\n1. Query sample documents from the \"${data.collection}\" collection\n2. Analyze the schema and field types\n3. Identify potential foreign key relationships\n\n**Output Format:**\nCreate a file named \\`${data.collection}.mappings.json\\` with the following structure:\n\n\\`\\`\\`json\n{\n \"_id\": \"${data.collection}\",\n \"mappings\": {\n \"fieldPath\": { \"collection\": \"targetCollection\", \"on\": \"targetField\" },\n \"nested.fieldPath\": { \"collection\": \"targetCollection\", \"on\": \"targetField\" }\n }\n}\n\\`\\`\\`\n\n**Example:**\nIf the collection has documents like:\n\\`\\`\\`json\n{\n \"_id\": \"post1\",\n \"authorId\": \"user123\",\n \"comments\": [\n { \"authorId\": \"user456\", \"text\": \"Great post!\" }\n ]\n}\n\\`\\`\\`\n\nThe mappings would be:\n\\`\\`\\`json\n{\n \"_id\": \"${data.collection}\",\n \"mappings\": {\n \"authorId\": { \"collection\": \"users\", \"on\": \"_id\" },\n \"comments.authorId\": { \"collection\": \"users\", \"on\": \"_id\" }\n }\n}\n\\`\\`\\`\n\n**Notes:**\n- Use dot notation for nested fields (e.g., \"comments.authorId\")\n- Multiple mappings for the same field can be expressed as an array\n- Target field is usually \"_id\" but can be any unique field\n\nPlease analyze the codebase and database, then generate the appropriate mappings file.`;\n {\n let actions = function($$renderer3) {\n $$renderer3.push(`<button class=\"btn btn-outline-light btn-sm -my-2\">🤖 AI Helper</button> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-success btn-sm -my-2\">Save</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]-->`);\n };\n Panel($$renderer2, {\n title: `Mappings for ${stringify(data.collection)}`,\n actions,\n children: ($$renderer3) => {\n $$renderer3.push(`<div class=\"p-4\"><div class=\"mb-4\"><p class=\"mb-3\">Define relationships between collections to enable hover tooltips and navigation on foreign key fields. This\n\t\t\t\twill be stored in the <code class=\"px-1 bg-[var(--light-background)] rounded\">mongoku.mappings</code> collection\n\t\t\t\tas a document with <a${attr(\"href\", resolve(`/servers/${data.server}/databases/${data.database}/collections/mongoku.mappings/documents/${data.collection}`))} class=\"text-blue-500\">_id: \"${escape_html(data.collection)}\"</a>.</p> <details class=\"mb-2\" style=\"color: var(--text-secondary);\"><summary class=\"cursor-pointer font-medium mb-2\">Example</summary> <div class=\"mt-2\"><div class=\"mb-1\">Document in collection <code class=\"px-1 bg-[var(--light-background)] rounded\">posts</code>:</div> <code class=\"block px-2 py-1 bg-[var(--light-background)] rounded text-xs mb-2\">{ _id: \"post1\", title: \"Hello\", authorId: \"user123\", comments: [{authorId: \"user456\", text:\n\t\t\t\t\t\t\"Nice!\"}] }</code> <div class=\"text space-y-1\"><div>→ Mapping 1: Field path <code class=\"px-1 bg-[var(--light-background)] rounded\">authorId</code>, target\n\t\t\t\t\t\t\tcollection <code class=\"px-1 bg-[var(--light-background)] rounded\">users</code>, target field <code class=\"px-1 bg-[var(--light-background)] rounded\">_id</code></div> <div>→ Mapping 2: Field path <code class=\"px-1 bg-[var(--light-background)] rounded\">comments.authorId</code>,\n\t\t\t\t\t\t\ttarget collection <code class=\"px-1 bg-[var(--light-background)] rounded\">users</code>, target field <code class=\"px-1 bg-[var(--light-background)] rounded\">_id</code></div></div></div></details></div> `);\n if (mappingsArray.length > 0) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<div class=\"space-y-4\"><!--[-->`);\n const each_array = ensure_array_like(mappingsArray);\n for (let entryIndex = 0, $$length = each_array.length; entryIndex < $$length; entryIndex++) {\n let entry = each_array[entryIndex];\n $$renderer3.push(`<div class=\"border border-[var(--border-color)] rounded p-4\"><div class=\"flex items-start gap-4 mb-3\"><div class=\"flex-1\"><label class=\"block text-sm font-medium mb-1\">Field Path <input type=\"text\"${attr(\"value\", entry.fieldPath)} placeholder=\"e.g., authorId or comments.authorId\" class=\"w-full px-3 py-2 bg-[var(--color-1)] border border-[var(--border-color)] rounded text-sm mt-1\"${attr(\"disabled\", data.readOnly, true)}/></label></div> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-danger btn-sm mt-6\">Remove Mapping</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div> <div class=\"space-y-2\"><!--[-->`);\n const each_array_1 = ensure_array_like(entry.targets);\n for (let targetIndex = 0, $$length2 = each_array_1.length; targetIndex < $$length2; targetIndex++) {\n let target = each_array_1[targetIndex];\n $$renderer3.push(`<div class=\"flex items-start gap-2 pl-4 border-l-2 border-[var(--color-3)]\"><div class=\"flex-1\"><label class=\"block text-xs mb-1\">Target Collection `);\n $$renderer3.select(\n {\n value: target.collection,\n class: \"w-full px-3 py-2 bg-[var(--color-1)] border border-[var(--border-color)] rounded text-sm mt-1\",\n disabled: data.readOnly\n },\n ($$renderer4) => {\n $$renderer4.option({ value: \"\" }, ($$renderer5) => {\n $$renderer5.push(`Select collection...`);\n });\n $$renderer4.push(`<!--[-->`);\n const each_array_2 = ensure_array_like(data.availableCollections);\n for (let $$index = 0, $$length3 = each_array_2.length; $$index < $$length3; $$index++) {\n let col = each_array_2[$$index];\n $$renderer4.option({ value: col }, ($$renderer5) => {\n $$renderer5.push(`${escape_html(col)}`);\n });\n }\n $$renderer4.push(`<!--]-->`);\n }\n );\n $$renderer3.push(`</label></div> <div class=\"flex-1\"><label class=\"block text-xs mb-1\">Target Field <input type=\"text\"${attr(\"value\", target.on)} placeholder=\"_id\" class=\"w-full px-3 py-2 bg-[var(--color-1)] border border-[var(--border-color)] rounded text-sm mt-1\"${attr(\"disabled\", data.readOnly, true)}/></label></div> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-danger btn-sm mt-5\"${attr(\"disabled\", entry.targets.length === 1, true)}>×</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n $$renderer3.push(`<!--]--></div> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-light btn-sm mt-2 ml-4\">+ Add Alternative Target</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n $$renderer3.push(`<!--]--></div>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n $$renderer3.push(`<div class=\"text-center py-8\" style=\"color: var(--text-secondary);\">No mappings defined yet.</div>`);\n }\n $$renderer3.push(`<!--]--> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<div class=\"mt-4\">`);\n {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-success\">+ Add New Mapping</button>`);\n }\n $$renderer3.push(`<!--]--></div>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n });\n }\n $$renderer2.push(`<!----> `);\n {\n $$renderer2.push(\"<!--[!-->\");\n }\n $$renderer2.push(`<!--]-->`);\n });\n}\nexport {\n _page as default\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE;AACpC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,KAAK;AACxC,IAAI,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;AAC1B,IAAI,IAAI,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAA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;"}
|
|
1
|
+
{"version":3,"file":"_page.svelte-C-13GpOe.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/servers/_server_/databases/_database_/collections/_collection_/mappings/_page.svelte.js"],"sourcesContent":["import \"../../../../../../../../../chunks/async.js\";\nimport { x as attr, w as ensure_array_like, z as stringify } from \"../../../../../../../../../chunks/index2.js\";\nimport \"../../../../../../../../../chunks/servers.remote.js\";\nimport { r as resolve } from \"../../../../../../../../../chunks/server2.js\";\nimport { P as Panel } from \"../../../../../../../../../chunks/Panel.js\";\nimport { e as escape_html } from \"../../../../../../../../../chunks/context.js\";\nfunction _page($$renderer, $$props) {\n $$renderer.component(($$renderer2) => {\n let { data } = $$props;\n let mappingsArray = Object.entries(data.mappings).map(([fieldPath, targets]) => ({\n fieldPath,\n targets: Array.isArray(targets) ? targets : [targets]\n }));\n `I need help generating MongoDB collection mappings for my database.\n\n**Context:**\n- Database: ${data.database}\n- Collection: ${data.collection}\n- Available collections: ${data.availableCollections.join(\", \")}\n\n**Task:**\nPlease analyze my codebase to identify relationships between the \"${data.collection}\" collection and other collections. Look for:\n1. Fields that reference documents in other collections (foreign keys)\n2. Nested fields within arrays or objects that reference other documents\n3. Common patterns like userId, authorId, etc.\n\nIf you have access to the MongoDB MCP server, use it to:\n1. Query sample documents from the \"${data.collection}\" collection\n2. Analyze the schema and field types\n3. Identify potential foreign key relationships\n\n**Output Format:**\nCreate a file named \\`${data.collection}.mappings.json\\` with the following structure:\n\n\\`\\`\\`json\n{\n \"_id\": \"${data.collection}\",\n \"mappings\": {\n \"fieldPath\": { \"collection\": \"targetCollection\", \"on\": \"targetField\" },\n \"nested.fieldPath\": { \"collection\": \"targetCollection\", \"on\": \"targetField\" }\n }\n}\n\\`\\`\\`\n\n**Example:**\nIf the collection has documents like:\n\\`\\`\\`json\n{\n \"_id\": \"post1\",\n \"authorId\": \"user123\",\n \"comments\": [\n { \"authorId\": \"user456\", \"text\": \"Great post!\" }\n ]\n}\n\\`\\`\\`\n\nThe mappings would be:\n\\`\\`\\`json\n{\n \"_id\": \"${data.collection}\",\n \"mappings\": {\n \"authorId\": { \"collection\": \"users\", \"on\": \"_id\" },\n \"comments.authorId\": { \"collection\": \"users\", \"on\": \"_id\" }\n }\n}\n\\`\\`\\`\n\n**Notes:**\n- Use dot notation for nested fields (e.g., \"comments.authorId\")\n- Multiple mappings for the same field can be expressed as an array\n- Target field is usually \"_id\" but can be any unique field\n\nPlease analyze the codebase and database, then generate the appropriate mappings file.`;\n {\n let actions = function($$renderer3) {\n $$renderer3.push(`<button class=\"btn btn-outline-light btn-sm -my-2\">🤖 AI Helper</button> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-success btn-sm -my-2\">Save</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]-->`);\n };\n Panel($$renderer2, {\n title: `Mappings for ${stringify(data.collection)}`,\n actions,\n children: ($$renderer3) => {\n $$renderer3.push(`<div class=\"p-4\"><div class=\"mb-4\"><p class=\"mb-3\">Define relationships between collections to enable hover tooltips and navigation on foreign key fields. This\n\t\t\t\twill be stored in the <code class=\"px-1 bg-[var(--light-background)] rounded\">mongoku.mappings</code> collection\n\t\t\t\tas a document with <a${attr(\"href\", resolve(`/servers/${data.server}/databases/${data.database}/collections/mongoku.mappings/documents/${data.collection}`))} class=\"text-blue-500\">_id: \"${escape_html(data.collection)}\"</a>.</p> <details class=\"mb-2\" style=\"color: var(--text-secondary);\"><summary class=\"cursor-pointer font-medium mb-2\">Example</summary> <div class=\"mt-2\"><div class=\"mb-1\">Document in collection <code class=\"px-1 bg-[var(--light-background)] rounded\">posts</code>:</div> <code class=\"block px-2 py-1 bg-[var(--light-background)] rounded text-xs mb-2\">{ _id: \"post1\", title: \"Hello\", authorId: \"user123\", comments: [{authorId: \"user456\", text:\n\t\t\t\t\t\t\"Nice!\"}] }</code> <div class=\"text space-y-1\"><div>→ Mapping 1: Field path <code class=\"px-1 bg-[var(--light-background)] rounded\">authorId</code>, target\n\t\t\t\t\t\t\tcollection <code class=\"px-1 bg-[var(--light-background)] rounded\">users</code>, target field <code class=\"px-1 bg-[var(--light-background)] rounded\">_id</code></div> <div>→ Mapping 2: Field path <code class=\"px-1 bg-[var(--light-background)] rounded\">comments.authorId</code>,\n\t\t\t\t\t\t\ttarget collection <code class=\"px-1 bg-[var(--light-background)] rounded\">users</code>, target field <code class=\"px-1 bg-[var(--light-background)] rounded\">_id</code></div></div></div></details></div> `);\n if (mappingsArray.length > 0) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<div class=\"space-y-4\"><!--[-->`);\n const each_array = ensure_array_like(mappingsArray);\n for (let entryIndex = 0, $$length = each_array.length; entryIndex < $$length; entryIndex++) {\n let entry = each_array[entryIndex];\n $$renderer3.push(`<div class=\"border border-[var(--border-color)] rounded p-4\"><div class=\"flex items-start gap-4 mb-3\"><div class=\"flex-1\"><label class=\"block text-sm font-medium mb-1\">Field Path <input type=\"text\"${attr(\"value\", entry.fieldPath)} placeholder=\"e.g., authorId or comments.authorId\" class=\"w-full px-3 py-2 bg-[var(--color-1)] border border-[var(--border-color)] rounded text-sm mt-1\"${attr(\"disabled\", data.readOnly, true)}/></label></div> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-danger btn-sm mt-6\">Remove Mapping</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div> <div class=\"space-y-2\"><!--[-->`);\n const each_array_1 = ensure_array_like(entry.targets);\n for (let targetIndex = 0, $$length2 = each_array_1.length; targetIndex < $$length2; targetIndex++) {\n let target = each_array_1[targetIndex];\n $$renderer3.push(`<div class=\"flex items-start gap-2 pl-4 border-l-2 border-[var(--color-3)]\"><div class=\"flex-1\"><label class=\"block text-xs mb-1\">Target Collection `);\n $$renderer3.select(\n {\n value: target.collection,\n class: \"w-full px-3 py-2 bg-[var(--color-1)] border border-[var(--border-color)] rounded text-sm mt-1\",\n disabled: data.readOnly\n },\n ($$renderer4) => {\n $$renderer4.option({ value: \"\" }, ($$renderer5) => {\n $$renderer5.push(`Select collection...`);\n });\n $$renderer4.push(`<!--[-->`);\n const each_array_2 = ensure_array_like(data.availableCollections);\n for (let $$index = 0, $$length3 = each_array_2.length; $$index < $$length3; $$index++) {\n let col = each_array_2[$$index];\n $$renderer4.option({ value: col }, ($$renderer5) => {\n $$renderer5.push(`${escape_html(col)}`);\n });\n }\n $$renderer4.push(`<!--]-->`);\n }\n );\n $$renderer3.push(`</label></div> <div class=\"flex-1\"><label class=\"block text-xs mb-1\">Target Field <input type=\"text\"${attr(\"value\", target.on)} placeholder=\"_id\" class=\"w-full px-3 py-2 bg-[var(--color-1)] border border-[var(--border-color)] rounded text-sm mt-1\"${attr(\"disabled\", data.readOnly, true)}/></label></div> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-danger btn-sm mt-5\"${attr(\"disabled\", entry.targets.length === 1, true)}>×</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n $$renderer3.push(`<!--]--></div> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-outline-light btn-sm mt-2 ml-4\">+ Add Alternative Target</button>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n $$renderer3.push(`<!--]--></div>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n $$renderer3.push(`<div class=\"text-center py-8\" style=\"color: var(--text-secondary);\">No mappings defined yet.</div>`);\n }\n $$renderer3.push(`<!--]--> `);\n if (!data.readOnly) {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<div class=\"mt-4\">`);\n {\n $$renderer3.push(\"<!--[-->\");\n $$renderer3.push(`<button class=\"btn btn-success\">+ Add New Mapping</button>`);\n }\n $$renderer3.push(`<!--]--></div>`);\n } else {\n $$renderer3.push(\"<!--[!-->\");\n }\n $$renderer3.push(`<!--]--></div>`);\n }\n });\n }\n $$renderer2.push(`<!----> `);\n {\n $$renderer2.push(\"<!--[!-->\");\n }\n $$renderer2.push(`<!--]-->`);\n });\n}\nexport {\n _page as default\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE;AACpC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,KAAK;AACxC,IAAI,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;AAC1B,IAAI,IAAI,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM;AACrF,MAAM,SAAS;AACf,MAAM,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,CAAC,OAAO;AAC1D,KAAK,CAAC,CAAC;AACP,IAAI,CAAC;;AAEL;AACA,YAAY,EAAE,IAAI,CAAC,QAAQ;AAC3B,cAAc,EAAE,IAAI,CAAC,UAAU;AAC/B,yBAAyB,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;;AAE/D;AACA,kEAAkE,EAAE,IAAI,CAAC,UAAU,CAAC;AACpF;AACA;AACA;;AAEA;AACA,oCAAoC,EAAE,IAAI,CAAC,UAAU,CAAC;AACtD;AACA;;AAEA;AACA,sBAAsB,EAAE,IAAI,CAAC,UAAU,CAAC;;AAExC;AACA;AACA,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU,EAAE,IAAI,CAAC,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