@dineug/erd-editor 3.9.1 → 3.10.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.
Files changed (89) hide show
  1. package/README.md +46 -9
  2. package/dist/components/erd/Erd.d.ts +1 -0
  3. package/dist/components/erd/canvas/relationship-group/relationship/Relationship.d.ts +2 -0
  4. package/dist/components/erd/canvas/relationship-group/relationship/RelationshipActionLabel.d.ts +32 -0
  5. package/dist/components/erd/canvas/table/cellLayout.d.ts +11 -0
  6. package/dist/components/erd/canvas/table/column/Column.d.ts +7 -0
  7. package/dist/components/erd/canvas/table/goToErd.d.ts +3 -10
  8. package/dist/components/erd/erd-context-menu/menus/relationshipMenus.d.ts +11 -0
  9. package/dist/components/erd/goToErdTarget.d.ts +85 -0
  10. package/dist/components/erd/table-properties/TableProperties.d.ts +2 -0
  11. package/dist/components/erd/table-properties/TableProperties.styles.d.ts +24 -2
  12. package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.d.ts +2 -0
  13. package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.styles.d.ts +32 -0
  14. package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.d.ts +7 -0
  15. package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.styles.d.ts +5 -0
  16. package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.d.ts +7 -0
  17. package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.styles.d.ts +3 -0
  18. package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.d.ts +7 -0
  19. package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.styles.d.ts +6 -0
  20. package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.d.ts +15 -0
  21. package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.styles.d.ts +13 -0
  22. package/dist/components/erd-editor/ErdEditor.d.ts +1 -1
  23. package/dist/components/find-replace/FindReplace.d.ts +13 -0
  24. package/dist/components/find-replace/FindReplace.styles.d.ts +27 -0
  25. package/dist/components/find-replace/fieldIcon.d.ts +5 -0
  26. package/dist/components/find-replace/matchTarget.d.ts +26 -0
  27. package/dist/components/find-replace/panelLayout.d.ts +17 -0
  28. package/dist/components/primitives/icon/icons.d.ts +10 -1
  29. package/dist/components/quick-search/QuickSearch.styles.d.ts +6 -0
  30. package/dist/components/quick-search/actions.d.ts +23 -0
  31. package/dist/components/quick-search/hangul.d.ts +73 -0
  32. package/dist/components/quick-search/paletteQuery.d.ts +37 -0
  33. package/dist/components/quick-search/scopedActions.d.ts +41 -0
  34. package/dist/components/visualization/table/column/Column.d.ts +4 -0
  35. package/dist/constants/layout.d.ts +13 -0
  36. package/dist/constants/open.d.ts +1 -0
  37. package/dist/constants/schema.d.ts +13 -0
  38. package/dist/engine/index.d.ts +1 -1
  39. package/dist/engine/index.js +20 -14
  40. package/dist/engine/modules/relationship/actions.d.ts +13 -0
  41. package/dist/engine/modules/relationship/atom.actions.d.ts +54 -0
  42. package/dist/engine/modules/relationship/fkColumns.d.ts +20 -3
  43. package/dist/engine/modules/relationship/generator.actions.d.ts +5 -2
  44. package/dist/engine/modules/relationship/history.d.ts +2 -0
  45. package/dist/engine/modules/relationship/hooks.d.ts +11 -0
  46. package/dist/engine/modules/table-column/hooks.d.ts +6 -0
  47. package/dist/engine/replication-store.d.ts +15 -1
  48. package/dist/engine/rx-operators/flushOnNotifier.d.ts +6 -0
  49. package/dist/engine/shared-store.d.ts +2 -2
  50. package/dist/engine/store-hooks.d.ts +8 -0
  51. package/dist/erd-editor.umd.js +1038 -481
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.js +7151 -5306
  54. package/dist/konva/scene/metrics.d.ts +5 -0
  55. package/dist/{store-hooks-DuNN9ZKu.js → loadValue-Mdc5K4qO.js} +4002 -3426
  56. package/dist/peer/index.d.ts +1 -1
  57. package/dist/peer/index.js +77 -80
  58. package/dist/schemaGCService-CZtGFh2z.js +42 -0
  59. package/dist/services/schema-gc/schemaGCService.d.ts +5 -0
  60. package/dist/shared-store-D82WVL5a.js +1129 -0
  61. package/dist/utils/calcTable.d.ts +9 -1
  62. package/dist/utils/emitter.d.ts +13 -0
  63. package/dist/utils/find-replace/findMatches.d.ts +90 -0
  64. package/dist/utils/find-replace/index.d.ts +5 -0
  65. package/dist/utils/find-replace/matcher.d.ts +53 -0
  66. package/dist/utils/find-replace/present.d.ts +22 -0
  67. package/dist/utils/find-replace/replaceActions.d.ts +20 -0
  68. package/dist/utils/generator-code/utils.d.ts +12 -1
  69. package/dist/utils/keyboard-shortcut/index.d.ts +8 -1
  70. package/dist/utils/loadValue.d.ts +7 -0
  71. package/dist/utils/referentialAction.d.ts +21 -0
  72. package/dist/utils/schema-aml-parser/types.d.ts +6 -0
  73. package/dist/utils/schema-dbml-parser/types.d.ts +3 -0
  74. package/dist/utils/schema-sql/Databricks.d.ts +5 -0
  75. package/dist/utils/schema-sql/MSSQL.d.ts +5 -0
  76. package/dist/utils/schema-sql/MariaDB.d.ts +5 -0
  77. package/dist/utils/schema-sql/MySQL.d.ts +5 -0
  78. package/dist/utils/schema-sql/Oracle.d.ts +5 -0
  79. package/dist/utils/schema-sql/index.d.ts +5 -0
  80. package/dist/utils/schema-sql/utils.d.ts +19 -0
  81. package/dist/utils/schema-sql-parser/index.d.ts +5 -1
  82. package/dist/utils/table-clipboard/payload.d.ts +3 -0
  83. package/dist/utils/tableKeys.d.ts +46 -0
  84. package/dist/workers/elkLayout.shared-worker.js +1 -1
  85. package/dist/workers/exportPng.shared-worker.js +29 -27
  86. package/dist/workers/schemaGC.shared-worker.js +1 -1
  87. package/package.json +9 -8
  88. package/dist/schemaGCService-_8A8Oh9Q.js +0 -38
  89. package/dist/shared-store-CtJL8B4I.js +0 -1072
@@ -1,5 +1,5 @@
1
1
  export { COLUMN_MIN_WIDTH, MEMO_MIN_HEIGHT, MEMO_MIN_WIDTH, } from '../constants/layout';
2
- export { BracketType, CanvasType, ColumnOption, ColumnType, Database, Language, NameCase, OrderType, RelationshipType, SaveSettingType, Show, } from '../constants/schema';
2
+ export { BracketType, CanvasType, ColumnOption, ColumnType, Database, Language, NameCase, OrderType, ReferentialAction, RelationshipType, SaveSettingType, Show, } from '../constants/schema';
3
3
  export { type DatabaseVendor, DatabaseVendorList, DatabaseVendorToDatabase, } from '../constants/sql/database';
4
4
  export { type ActionType, ChangeActionTypes, SharedFollowingActionTypes, StreamActionTypes, } from '../engine/actions';
5
5
  export { createEngineContext, type EngineContext } from '../engine/context';
@@ -1,8 +1,7 @@
1
- import { $i as e, $n as t, Bn as n, E as r, G as i, H as a, Hi as o, I as s, In as c, Jn as l, Jr as u, L as d, Li as ee, M as f, Qi as p, Qt as m, Rn as h, Sa as te, Si as g, Tn as _, Vi as v, Zi as y, _n as b, aa as x, b as S, da as C, ea as w, fa as T, g as E, ga as D, gn as O, ha as k, ia as A, in as j, jt as ne, la as re, li as ie, ma as ae, oa as M, on as N, pa as P, pn as F, rn as I, ta as L, tt as R, un as z, v as B, w as V, wi as H, xn as U, ya as W, zn as G, zt as K } from "../store-hooks-DuNN9ZKu.js";
2
- import { c as q, d as J, f as oe, l as se, n as ce, t as le } from "../shared-store-CtJL8B4I.js";
3
- import { isEmpty as ue } from "es-toolkit/compat";
1
+ import { D as e, Ea as t, Ia as n, Jn as r, K as i, Kt as a, L as o, La as s, Ln as ee, Ma as c, N as l, Na as u, Nn as d, Oi as f, On as p, Pa as m, Qn as h, R as g, Ra as _, Rt as v, T as y, Ta as b, Tn as x, U as S, Ui as C, Va as w, Vi as T, Wa as E, Xn as D, Zn as te, _ as O, _a as k, an as A, ba as j, bn as M, ca as ne, dn as re, hn as ie, ja as ae, ka as N, kn as P, mr as F, nt as I, sa as L, sr as R, t as z, ui as B, un as V, va as H, wa as U, x as W, xa as G, y as K, ya as q } from "../loadValue-Mdc5K4qO.js";
2
+ import { c as J, d as oe, f as se, l as ce, n as le, t as ue } from "../shared-store-D82WVL5a.js";
4
3
  //#region src/engine/presence.ts
5
- var de = U / 3, fe = (e) => {
4
+ var de = d / 3, fe = (e) => {
6
5
  e?.unref?.();
7
6
  }, pe = [
8
7
  "sharedMouseTrackerMap",
@@ -17,16 +16,16 @@ function me(e) {
17
16
  }
18
17
  }
19
18
  function he(e) {
20
- let t = "", r = (n) => {
21
- let r = q(e.state.editor.focusTable), i = se(r);
22
- i === t && !n || (t = i, e.dispatch(l({ focus: r })));
23
- }, i = e.subscribe((e) => {
24
- r(e.some((e) => e.type === n.type));
25
- }), a = setInterval(() => {
26
- t && r(!0);
19
+ let t = "", n = (n) => {
20
+ let r = J(e.state.editor.focusTable), i = ce(r);
21
+ (i !== t || n) && (t = i, e.dispatch(R({ focus: r })));
22
+ }, r = e.subscribe((e) => {
23
+ n(e.some((e) => e.type === h.type));
24
+ }), i = setInterval(() => {
25
+ t && n(!0);
27
26
  }, de);
28
- return fe(a), Object.freeze({ destroy: () => {
29
- i(), clearInterval(a);
27
+ return fe(i), Object.freeze({ destroy: () => {
28
+ r(), clearInterval(i);
30
29
  } });
31
30
  }
32
31
  //#endregion
@@ -46,9 +45,9 @@ var _e = 2, Y = 10, X = (e) => Math.round(e.length * Y) + _e, Z = {
46
45
  destroyed: "this document session was closed; open the document again"
47
46
  }, Q = class extends Error {
48
47
  constructor(e, t) {
49
- super(ve[e]), B(this, "code", void 0), B(this, "operation", void 0), this.name = "PeerStoreError", this.code = e, this.operation = t;
48
+ super(ve[e]), K(this, "code", void 0), K(this, "operation", void 0), this.name = "PeerStoreError", this.code = e, this.operation = t;
50
49
  }
51
- }, $ = y(S), ye = y(r), be = y([
50
+ }, $ = k(W), ye = k(e), be = k([
52
51
  "table.add",
53
52
  "column.add",
54
53
  "memo.add",
@@ -85,62 +84,62 @@ function xe(e) {
85
84
  }
86
85
  function Se(e) {
87
86
  if (!e) return [];
88
- let { tableId: t, columnId: n, focusType: r } = e;
89
- return n === void 0 ? [h({
87
+ let { tableId: t, columnId: n, focusType: i } = e;
88
+ return n === void 0 ? [D({
90
89
  tableId: t,
91
- focusType: r
92
- })] : [c({
90
+ focusType: i
91
+ })] : [r({
93
92
  tableId: t,
94
93
  columnId: n,
95
- focusType: r,
94
+ focusType: i,
96
95
  $mod: !1,
97
96
  shiftKey: !1
98
97
  })];
99
98
  }
100
- function Ce({ nickname: e, toWidth: t = X, presence: r = !0, readonly: i = !1 }) {
101
- let a = null, o = J(E({ toWidth: t }), {
99
+ function Ce({ nickname: e, toWidth: t = X, presence: n = !0, readonly: r = !1 }) {
100
+ let i = null, a = oe(O({ toWidth: t }), {
102
101
  manualStreamFlush: !0,
103
102
  observable: !1,
104
- getHistory: (e) => (a = xe(oe(e)), a.history)
105
- }), s = () => a?.getPushes() ?? 0, c = () => a?.getLimit() ?? 0, l = le(o, { getNickname: () => e }, { manualStreamFlush: !0 }), u = ge(o, l), d = /* @__PURE__ */ new Set(), f = o.state.editor.id, p = i, m = !1, h = null, g = !1, v = 0, y = [], b = [], x = null;
106
- o.dispatchSync(_({
103
+ getHistory: (e) => (i = xe(se(e)), i.history)
104
+ }), o = () => i?.getPushes() ?? 0, s = () => i?.getLimit() ?? 0, c = ue(a, { getNickname: () => e }, { manualStreamFlush: !0 }), l = ge(a, c), u = /* @__PURE__ */ new Set(), d = a.state.editor.id, f = r, p = !1, m = null, g = !1, _ = 0, v = [], y = [], b = null;
105
+ a.dispatchSync(ee({
107
106
  width: 0,
108
107
  height: 0
109
108
  }));
110
- let S = r ? he(o) : null, C = () => {
111
- h ||= l.subscribe((e) => {
112
- e.some((e) => $(e.type)) && v++;
113
- for (let t of Array.from(d)) I(t, e);
109
+ let x = n ? he(a) : null, S = () => {
110
+ m ||= c.subscribe((e) => {
111
+ e.some((e) => $(e.type)) && _++;
112
+ for (let t of Array.from(u)) V(t, e);
114
113
  });
115
- }, w = (e) => {
116
- if (m) throw new Q(Z.destroyed, e);
114
+ }, C = (e) => {
115
+ if (p) throw new Q(Z.destroyed, e);
117
116
  }, T = (e) => {
118
- if (x) throw Error(`${e} cannot run inside a group`);
117
+ if (b) throw Error(`${e} cannot run inside a group`);
119
118
  }, D = (e) => {
120
- if (w(e), p) throw new Q(Z.readonly, e);
121
- }, O = () => {
122
- let e = c();
119
+ if (C(e), f) throw new Q(Z.readonly, e);
120
+ }, k = () => {
121
+ let e = s();
123
122
  if (!e) return;
124
- let t = y.reduce((e, { historyEntries: t }) => e + t, 0);
125
- for (; t > e;) t -= y.shift().historyEntries;
126
- for (; y.length > e;) y.splice(y.findIndex(({ historyEntries: e }) => !e), 1);
127
- }, k = (e, t = {}) => {
128
- D("dispatch"), C();
129
- let n = v, r = s(), i = te(o.state, o.context, [...Se(t.focus), ...e]);
130
- o.dispatchSync(i), i.some((e) => ye(e.type)) && u.flush();
131
- let a = {
123
+ let t = v.reduce((e, { historyEntries: t }) => e + t, 0);
124
+ for (; t > e;) t -= v.shift().historyEntries;
125
+ for (; v.length > e;) v.splice(v.findIndex(({ historyEntries: e }) => !e), 1);
126
+ }, A = (e, t = {}) => {
127
+ D("dispatch"), S();
128
+ let n = _, r = o(), i = E(a.state, a.context, [...Se(t.focus), ...e]);
129
+ a.dispatchSync(i), i.some((e) => ye(e.type)) && l.flush();
130
+ let s = {
132
131
  label: t.label ?? null,
133
132
  actions: i.filter((e) => $(e.type)),
134
133
  createdIds: i.filter((e) => be(e.type)).map((e) => e.payload.id),
135
- batches: v - n,
136
- historyEntries: s() - r
134
+ batches: _ - n,
135
+ historyEntries: o() - r
137
136
  };
138
- return x ? (x.unit.historyEntries += a.historyEntries, x.dispatched = !0) : y.push({
139
- label: a.label,
140
- historyEntries: a.historyEntries
141
- }), a.historyEntries && (b = []), x || O(), a;
142
- }, A = (e, t) => {
143
- if (D("group"), x) return t();
137
+ return b ? (b.unit.historyEntries += s.historyEntries, b.dispatched = !0) : v.push({
138
+ label: s.label,
139
+ historyEntries: s.historyEntries
140
+ }), s.historyEntries && (y = []), b || k(), s;
141
+ }, j = (e, t) => {
142
+ if (D("group"), b) return t();
144
143
  let n = {
145
144
  unit: {
146
145
  label: e,
@@ -148,51 +147,49 @@ function Ce({ nickname: e, toWidth: t = X, presence: r = !0, readonly: i = !1 })
148
147
  },
149
148
  dispatched: !1
150
149
  };
151
- x = n;
150
+ b = n;
152
151
  try {
153
152
  return t();
154
153
  } finally {
155
- x = null, n.dispatched && (y.push(n.unit), O());
154
+ b = null, n.dispatched && (v.push(n.unit), k());
156
155
  }
157
- }, j = (e, t) => {
156
+ }, M = (e, t) => {
158
157
  for (let n = 0; n < e.historyEntries; n++) t();
159
- u.flush();
158
+ l.flush();
160
159
  };
161
160
  return Object.freeze({
162
- editorId: f,
161
+ editorId: d,
163
162
  get value() {
164
- return W(o.state);
163
+ return w(a.state);
165
164
  },
166
165
  get state() {
167
- return o.state;
166
+ return a.state;
168
167
  },
169
168
  get isReadonly() {
170
- return p;
169
+ return f;
171
170
  },
172
171
  get isDestroyed() {
173
- return m;
172
+ return p;
174
173
  },
175
174
  setReadonly: (e) => {
176
- p = e;
175
+ f = e;
177
176
  },
178
177
  setInitialValue: (e) => {
179
- w("setInitialValue"), T("setInitialValue");
180
- let t = ee(e);
181
- o.dispatchSync(G(), R(ue(t) ? "{}" : t)), o.resetHistory(), y = [], b = [];
178
+ C("setInitialValue"), T("setInitialValue"), a.dispatchSync(te(), I(z(e))), a.resetHistory(), v = [], y = [];
182
179
  },
183
180
  mergeClock: (e) => {
184
- o.context.clock.merge(e);
181
+ a.context.clock.merge(e);
185
182
  },
186
- dispatch: k,
183
+ dispatch: A,
187
184
  receive: (e) => {
188
- m || l.dispatchSync(e);
185
+ p || c.dispatchSync(e);
189
186
  },
190
- group: A,
187
+ group: j,
191
188
  undo: () => {
192
- D("undo"), T("undo"), C();
193
- let e = [], t = y.pop();
194
- for (; t && !t.historyEntries;) t.label !== null && e.push(t.label), t = y.pop();
195
- return t ? (j(t, o.undo), b.push(t), {
189
+ D("undo"), T("undo"), S();
190
+ let e = [], t = v.pop();
191
+ for (; t && !t.historyEntries;) t.label !== null && e.push(t.label), t = v.pop();
192
+ return t ? (M(t, a.undo), y.push(t), {
196
193
  label: t.label,
197
194
  entries: t.historyEntries,
198
195
  skipped: e
@@ -203,9 +200,9 @@ function Ce({ nickname: e, toWidth: t = X, presence: r = !0, readonly: i = !1 })
203
200
  };
204
201
  },
205
202
  redo: () => {
206
- D("redo"), T("redo"), C();
207
- let e = b.pop();
208
- return e ? (j(e, o.redo), y.push(e), {
203
+ D("redo"), T("redo"), S();
204
+ let e = y.pop();
205
+ return e ? (M(e, a.redo), v.push(e), {
209
206
  label: e.label,
210
207
  entries: e.historyEntries,
211
208
  skipped: []
@@ -215,16 +212,16 @@ function Ce({ nickname: e, toWidth: t = X, presence: r = !0, readonly: i = !1 })
215
212
  skipped: []
216
213
  };
217
214
  },
218
- subscribe: (e) => (w("subscribe"), d.add(e), g || (g = !0, h ? o.dispatchSync(n()) : C()), () => {
219
- d.delete(e);
215
+ subscribe: (e) => (C("subscribe"), u.add(e), g || (g = !0, m ? a.dispatchSync(h()) : S()), () => {
216
+ u.delete(e);
220
217
  }),
221
218
  flushStreamBuffers: () => {
222
- m || u.flush();
219
+ p || l.flush();
223
220
  },
224
221
  destroy: () => {
225
- m || (m = !0, S?.destroy(), h?.(), h = null, d.clear(), l.destroy(), o.destroy(), me(o.state.editor), y = [], b = []);
222
+ p || (p = !0, x?.destroy(), m?.(), m = null, u.clear(), c.destroy(), a.destroy(), me(a.state.editor), v = [], y = []);
226
223
  }
227
224
  });
228
225
  }
229
226
  //#endregion
230
- export { L as BracketType, p as COLUMN_MIN_WIDTH, A as CanvasType, S as ChangeActionTypes, x as ColumnOption, M as ColumnType, re as Database, v as DatabaseVendorList, o as DatabaseVendorToDatabase, g as FocusType, C as Language, e as MEMO_MIN_HEIGHT, w as MEMO_MIN_WIDTH, T as NameCase, P as OrderType, Q as PeerStoreError, Z as PeerStoreErrorCode, ae as RelationshipType, k as SaveSettingType, H as SelectType, V as SharedFollowingActionTypes, D as Show, r as StreamActionTypes, ie as bHas, E as createEngineContext, Ce as createPeerStore, ce as createSchemaSQL, X as defaultToWidth, i as editorActions$, b as indexActions, a as indexActions$, O as indexColumnActions, d as indexColumnActions$, u as measureTableSize, F as memoActions, m as memoActions$, z as relationshipActions, s as relationshipActions$, t as settingsActions, f as settingsActions$, N as tableActions, K as tableActions$, j as tableColumnActions, ne as tableColumnActions$ };
227
+ export { G as BracketType, H as COLUMN_MIN_WIDTH, U as CanvasType, W as ChangeActionTypes, b as ColumnOption, t as ColumnType, N as Database, L as DatabaseVendorList, ne as DatabaseVendorToDatabase, T as FocusType, ae as Language, q as MEMO_MIN_HEIGHT, j as MEMO_MIN_WIDTH, c as NameCase, u as OrderType, Q as PeerStoreError, Z as PeerStoreErrorCode, m as ReferentialAction, n as RelationshipType, s as SaveSettingType, C as SelectType, y as SharedFollowingActionTypes, _ as Show, e as StreamActionTypes, f as bHas, O as createEngineContext, Ce as createPeerStore, le as createSchemaSQL, X as defaultToWidth, i as editorActions$, P as indexActions, S as indexActions$, p as indexColumnActions, g as indexColumnActions$, B as measureTableSize, x as memoActions, A as memoActions$, M as relationshipActions, o as relationshipActions$, F as settingsActions, l as settingsActions$, ie as tableActions, a as tableActions$, re as tableColumnActions, v as tableColumnActions$ };
@@ -0,0 +1,42 @@
1
+ import { Ha as e, Ua as t, _a as n } from "./loadValue-Mdc5K4qO.js";
2
+ import { DateTime as r } from "luxon";
3
+ //#region src/services/schema-gc/procGC.ts
4
+ function i({ collections: t }, { tableIds: n, tableColumnIds: r, relationshipIds: i, indexIds: a, indexColumnIds: o, memoIds: s }) {
5
+ e(t).collection("tableEntities").removeMany(n), e(t).collection("tableColumnEntities").removeMany(r), e(t).collection("relationshipEntities").removeMany(i), e(t).collection("indexEntities").removeMany(a), e(t).collection("indexColumnEntities").removeMany(o), e(t).collection("memoEntities").removeMany(s);
6
+ }
7
+ //#endregion
8
+ //#region src/services/schema-gc/schemaGCService.ts
9
+ var a = 3, o = class {
10
+ async run(e) {
11
+ return s(e);
12
+ }
13
+ };
14
+ function s(a) {
15
+ let o = JSON.parse(a), s = t(o), { doc: { tableIds: l, memoIds: u, indexIds: d, relationshipIds: f }, collections: p } = s, m = n(l), h = n(u), g = n(d), _ = n(f), v = c(r.now()), y = e(p).collection("tableEntities"), b = e(p).collection("tableColumnEntities"), x = e(p).collection("indexEntities"), S = e(p).collection("indexColumnEntities"), C = e(p).collection("relationshipEntities"), w = e(p).collection("memoEntities"), T = new Set(y.selectAll().filter(v(m)).map(({ id: e }) => e)), E = /* @__PURE__ */ new Set(), D = new Set(C.selectAll().filter(v(_)).map(({ id: e }) => e)), O = new Set(x.selectAll().filter(v(g)).map(({ id: e }) => e)), k = /* @__PURE__ */ new Set(), A = new Set(w.selectAll().filter(v(h)).map(({ id: e }) => e));
16
+ b.selectAll().filter(({ tableId: e }) => T.has(e)).forEach(({ id: e }) => E.add(e)), C.selectAll().filter(({ id: e, start: t, end: n }) => !D.has(e) && (T.has(t.tableId) || T.has(n.tableId))).forEach(({ id: e }) => D.add(e)), x.selectAll().filter(({ id: e, tableId: t }) => !O.has(e) && T.has(t)).forEach(({ id: e }) => O.add(e)), S.selectAll().filter(({ indexId: e }) => O.has(e)).forEach(({ id: e }) => k.add(e)), i(s, {
17
+ tableIds: [...T],
18
+ tableColumnIds: [...E],
19
+ relationshipIds: [...D],
20
+ indexIds: [...O],
21
+ indexColumnIds: [...k],
22
+ memoIds: [...A]
23
+ });
24
+ let j = n(y.selectAll().map(({ id: e }) => e)), M = n(x.selectAll().map(({ id: e }) => e));
25
+ return b.selectAll().filter(({ tableId: e, id: t, meta: n }) => !j(e) && v(() => !1)({
26
+ id: t,
27
+ meta: n
28
+ })).forEach(({ id: e }) => E.add(e)), S.selectAll().filter(({ indexId: e, id: t, meta: n }) => !M(e) && v(() => !1)({
29
+ id: t,
30
+ meta: n
31
+ })).forEach(({ id: e }) => k.add(e)), {
32
+ tableIds: [...T],
33
+ tableColumnIds: [...E],
34
+ relationshipIds: [...D],
35
+ indexIds: [...O],
36
+ indexColumnIds: [...k],
37
+ memoIds: [...A]
38
+ };
39
+ }
40
+ var c = (e) => (t) => ({ id: n, meta: i }) => !t(n) && a < Math.floor(e.diff(r.fromMillis(i.updateAt), "days").toObject().days ?? 0);
41
+ //#endregion
42
+ export { s as n, i as r, o as t };
@@ -2,4 +2,9 @@ import { GCIds } from '.';
2
2
  export declare class SchemaGCService {
3
3
  run(source: string): Promise<GCIds>;
4
4
  }
5
+ /**
6
+ * The ids of what the collector removes from a document. The service answers
7
+ * them behind a promise, for a worker; a replica collects them as it loads.
8
+ */
9
+ export declare function collectGCIds(source: string): GCIds;
5
10
  //# sourceMappingURL=schemaGCService.d.ts.map