@wirecat/cli-core 0.675.0 → 0.677.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/CHANGELOG.md +104 -0
- package/dist/calendar/mcp/index.d.ts +12 -12
- package/dist/cli/command-runs.d.ts +2 -0
- package/dist/cli/command-runs.js +2 -0
- package/dist/cli/documents/words.d.ts +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +1 -1
- package/dist/cli/list-query.d.ts +3 -2
- package/dist/cli/list-query.js +5 -2
- package/dist/cli/setup-command.js +9 -3
- package/dist/crm/cli/index.d.ts +7 -1
- package/dist/crm/cli/index.js +104 -20
- package/dist/crm/cli/pipeline-view.js +15 -1
- package/dist/crm/cli/records.js +11 -3
- package/dist/crm/cli/search-all.d.ts +5 -2
- package/dist/crm/cli/search-all.js +15 -3
- package/dist/crm/source.d.ts +3 -2
- package/dist/crm/stage-tasks.js +1 -1
- package/dist/crm/sync.js +13 -11
- package/dist/crm/testing/write-contract.js +5 -1
- package/dist/crm/viewer.d.ts +28 -0
- package/dist/crm/viewer.js +63 -0
- package/dist/crm/writer.d.ts +3 -0
- package/dist/crm/writes.d.ts +7 -2
- package/dist/crm/writes.js +24 -14
- package/dist/domain/crm.d.ts +9 -9
- package/dist/domain/moment.d.ts +2 -0
- package/dist/domain/moment.js +2 -0
- package/dist/entities/business-context.js +1 -1
- package/dist/entities/deal.d.ts +86 -39
- package/dist/entities/deal.js +45 -4
- package/dist/entities/index.d.ts +20 -32
- package/dist/errors/reasons.js +2 -0
- package/dist/meetings/mcp/index.d.ts +15 -15
- package/dist/services/metadata.d.ts +1 -1
- package/dist/services/search-all.d.ts +3 -1
- package/dist/services/search-all.js +1 -0
- package/dist/setup/define.d.ts +17 -2
- package/dist/store/exports.d.ts +1 -0
- package/dist/store/exports.js +1 -0
- package/dist/store/identity-links.d.ts +73 -0
- package/dist/store/identity-links.js +14 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/people.d.ts +23 -1
- package/dist/store/people.js +12 -1
- package/dist/store/sqlite/agent-links.d.ts +34 -0
- package/dist/store/sqlite/agent-links.js +184 -0
- package/dist/store/sqlite/copy-viewer.d.ts +16 -0
- package/dist/store/sqlite/copy-viewer.js +11 -0
- package/dist/store/sqlite/crm-activities.d.ts +7 -1
- package/dist/store/sqlite/crm-activities.js +32 -5
- package/dist/store/sqlite/crm-contacts.d.ts +5 -2
- package/dist/store/sqlite/crm-contacts.js +30 -14
- package/dist/store/sqlite/crm-rows.d.ts +7 -0
- package/dist/store/sqlite/crm-rows.js +37 -5
- package/dist/store/sqlite/crm-settings.d.ts +2 -1
- package/dist/store/sqlite/crm-settings.js +3 -2
- package/dist/store/sqlite/crm-stage-entries.d.ts +24 -4
- package/dist/store/sqlite/crm-stage-entries.js +77 -18
- package/dist/store/sqlite/crm.d.ts +14 -4
- package/dist/store/sqlite/crm.js +59 -7
- package/dist/store/sqlite/deals.d.ts +47 -29
- package/dist/store/sqlite/deals.js +64 -76
- package/dist/store/sqlite/identity-proposals.d.ts +2 -0
- package/dist/store/sqlite/identity-proposals.js +2 -0
- package/dist/store/sqlite/person-match-scan.d.ts +29 -0
- package/dist/store/sqlite/person-match-scan.js +4 -4
- package/dist/store/sqlite/person-merges.d.ts +3 -0
- package/dist/store/sqlite/pipeline-period.d.ts +85 -0
- package/dist/store/sqlite/pipeline-period.js +199 -0
- package/dist/store/sqlite/stage-amounts.d.ts +6 -2
- package/dist/store/sqlite/stage-amounts.js +8 -5
- package/package.json +3 -3
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { formatDecimal, scaleOf } from "../../domain/money.js";
|
|
2
|
+
import { viewerSql } from "./copy-viewer.js";
|
|
2
3
|
const TABLES = { deal: "deals", lead: "leads" };
|
|
3
|
-
/** What stands in each stage of `stageIds`, in that order
|
|
4
|
-
export const stageAmountsOf = ({ database }, kind, stageIds,
|
|
4
|
+
/** What stands in each stage of `stageIds`, in that order, of the rows made in the window (epoch ms, inclusive). */
|
|
5
|
+
export const stageAmountsOf = ({ database }, kind, stageIds, { since, until }, viewer) => {
|
|
6
|
+
const seen = viewerSql("d", viewer);
|
|
5
7
|
const rows = database
|
|
6
8
|
.prepare("SELECT stage_id, currency, count(*) AS items, coalesce(sum(amount), 0) AS units " +
|
|
7
|
-
`FROM ${TABLES[kind]} WHERE stage_id IN (${stageIds.map(() => "?").join(", ") || "NULL"}) ` +
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
`FROM ${TABLES[kind]} d WHERE stage_id IN (${stageIds.map(() => "?").join(", ") || "NULL"}) ` +
|
|
10
|
+
`AND deleted_at IS NULL AND (? IS NULL OR created_at >= ?) AND (? IS NULL OR created_at <= ?) AND ${seen.sql} ` +
|
|
11
|
+
"GROUP BY stage_id, currency ORDER BY currency")
|
|
12
|
+
.all(...stageIds, since, since, until, until, ...seen.params);
|
|
10
13
|
return stageIds.map((stage) => {
|
|
11
14
|
const within = rows.filter((row) => Number(row.stage_id) === stage);
|
|
12
15
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.677.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",
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
"@types/pngjs": "6.0.5",
|
|
301
301
|
"@types/ssh2": "1.15.5",
|
|
302
302
|
"@vitest/coverage-v8": "^5.0.5",
|
|
303
|
-
"@wirecat/cli-base": "0.
|
|
303
|
+
"@wirecat/cli-base": "0.103.0",
|
|
304
304
|
"@wirecat/cli-core-legacy-tags": "npm:@wirecat/cli-core@0.414.0",
|
|
305
305
|
"ajv": "8.17.1",
|
|
306
306
|
"commander": "15.0.0",
|
|
@@ -324,7 +324,7 @@
|
|
|
324
324
|
},
|
|
325
325
|
"peerDependencies": {
|
|
326
326
|
"@napi-rs/canvas": ">=0.1.69 <2",
|
|
327
|
-
"@wirecat/cli-base": ">=0.
|
|
327
|
+
"@wirecat/cli-base": ">=0.103.0 <1.0.0",
|
|
328
328
|
"commander": ">=15",
|
|
329
329
|
"mysql2": "^3.24.6",
|
|
330
330
|
"pg": "^8.23.1",
|