@wirecat/cli-core 0.749.0 → 0.751.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 (37) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/attachments/tesseract.d.ts +4 -1
  3. package/dist/attachments/tesseract.js +13 -4
  4. package/dist/background/report/render.js +1 -1
  5. package/dist/cli/documents/library.js +2 -0
  6. package/dist/crm/cli/index.js +1 -1
  7. package/dist/crm/source.d.ts +5 -0
  8. package/dist/crm/sync.d.ts +3 -1
  9. package/dist/crm/sync.js +31 -3
  10. package/dist/crm/testing/files-contract.js +5 -2
  11. package/dist/domain/tracker.d.ts +27 -6
  12. package/dist/domain/tracker.js +13 -8
  13. package/dist/errors/reasons.js +11 -0
  14. package/dist/services/documents/scans.d.ts +2 -0
  15. package/dist/services/documents/scans.js +3 -0
  16. package/dist/store/sqlite/crm-activities.d.ts +14 -0
  17. package/dist/store/sqlite/crm-activities.js +25 -1
  18. package/dist/store/sqlite/crm.d.ts +3 -5
  19. package/dist/store/sqlite/crm.js +2 -2
  20. package/dist/store/sqlite/tracker.d.ts +6 -2
  21. package/dist/store/sqlite/tracker.js +72 -5
  22. package/dist/tracker/cli/index.js +21 -8
  23. package/dist/tracker/manifest/manifest.d.ts +4 -1
  24. package/dist/tracker/manifest/manifest.js +4 -1
  25. package/dist/tracker/manifest/map.js +19 -1
  26. package/dist/tracker/manifest/source.js +5 -1
  27. package/dist/tracker/sync.d.ts +9 -0
  28. package/dist/tracker/sync.js +8 -2
  29. package/dist/tracker/tasks.d.ts +4 -4
  30. package/dist/tracker/tasks.js +6 -5
  31. package/dist/tracker/testing/manifest-fake.d.ts +2 -0
  32. package/dist/tracker/testing/manifest-fake.js +20 -0
  33. package/dist/tracker/testing/source-contract.d.ts +8 -0
  34. package/dist/tracker/testing/source-contract.js +28 -2
  35. package/dist/tracker/testing/source.d.ts +9 -1
  36. package/dist/tracker/testing/source.js +25 -2
  37. package/package.json +1 -1
@@ -59,7 +59,9 @@ export const fakeTrackerSource = (options) => {
59
59
  },
60
60
  async ids(kind, page, _context) {
61
61
  const offset = page === undefined ? 0 : Number(page);
62
- const all = listOf(kind).map((one) => one.externalId);
62
+ const all = listOf(kind)
63
+ .filter((one) => one.deleted !== true)
64
+ .map((one) => one.externalId);
63
65
  const items = all.slice(offset, offset + size);
64
66
  return offset + size < all.length
65
67
  ? { items, hasMore: true, nextCursor: String(offset + size) }
@@ -73,6 +75,11 @@ export const fakeTrackerSource = (options) => {
73
75
  found.archivedAt = clock();
74
76
  found.updatedAt = found.archivedAt;
75
77
  },
78
+ trash(kind, externalId) {
79
+ const found = find(kind, externalId);
80
+ found.archivedAt = clock();
81
+ found.deleted = true;
82
+ },
76
83
  remove(kind, externalId) {
77
84
  const list = rows[kind];
78
85
  const at = list?.findIndex((one) => one.externalId === externalId) ?? -1;
@@ -131,7 +138,10 @@ export const fakeTrackerSource = (options) => {
131
138
  return make(options.skew ?? 0);
132
139
  };
133
140
  const T0 = Date.UTC(2026, 10, 1);
134
- /** A small Linear-like workspace: one team, two users, the six state types, a label, a project, three issues. */
141
+ /**
142
+ * A small Linear-like workspace: one team, two users, the seven state types, a label, a project, a sprint, three
143
+ * issues.
144
+ */
135
145
  export const exampleTrackerRows = () => ({
136
146
  team: [{ externalId: "team-1", key: "ENG", name: "Engineering", updatedAt: T0 }],
137
147
  user: [
@@ -145,6 +155,7 @@ export const exampleTrackerRows = () => ({
145
155
  { externalId: "state-doing", name: "In Progress", type: "started", team: "team-1", position: 3, updatedAt: T0 },
146
156
  { externalId: "state-done", name: "Done", type: "completed", team: "team-1", position: 4, updatedAt: T0 },
147
157
  { externalId: "state-gone", name: "Canceled", type: "canceled", team: "team-1", position: 5, updatedAt: T0 },
158
+ { externalId: "state-twin", name: "Duplicate", type: "duplicate", team: "team-1", position: 6, updatedAt: T0 },
148
159
  ],
149
160
  label: [{ externalId: "label-bug", name: "Bug", team: "team-1", updatedAt: T0 }],
150
161
  project: [
@@ -158,6 +169,17 @@ export const exampleTrackerRows = () => ({
158
169
  updatedAt: T0,
159
170
  },
160
171
  ],
172
+ sprint: [
173
+ {
174
+ externalId: "sprint-1",
175
+ name: "",
176
+ number: 1,
177
+ team: "team-1",
178
+ startsAt: T0,
179
+ endsAt: T0 + 14 * 86_400_000,
180
+ updatedAt: T0,
181
+ },
182
+ ],
161
183
  issue: [
162
184
  {
163
185
  externalId: "issue-1",
@@ -167,6 +189,7 @@ export const exampleTrackerRows = () => ({
167
189
  state: "state-doing",
168
190
  team: "team-1",
169
191
  project: "project-1",
192
+ sprint: "sprint-1",
170
193
  assignee: "user-1",
171
194
  labels: ["label-bug"],
172
195
  priority: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-core",
3
- "version": "0.749.0",
3
+ "version": "0.751.0",
4
4
  "description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Viacheslav Ptsarev",