@dench.com/cli 2.9.4-staging.231 → 2.9.5-staging.239

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.
@@ -1761,6 +1761,176 @@ const rawApiOperations = [
1761
1761
  responseSchema: anyResponse,
1762
1762
  backend: convex("query", "functions/crm/reports:generate"),
1763
1763
  }),
1764
+
1765
+ // CRM analytics — the dashboard strip above every object table. One
1766
+ // contract for the UI, the CLI and this API: `computePanels` is the only
1767
+ // chart math; a dashboard belongs to the object or to ONE saved view.
1768
+ op({
1769
+ id: "crm.analytics.get",
1770
+ group: "crm",
1771
+ summary:
1772
+ "Read an object's analytics dashboard: panels, field roles, the strip's collapsed flag, the named view's own dashboard (if any), and the fields panels may bucket on (synthetic $createdAt / $location last).",
1773
+ cli: "dench crm analytics get",
1774
+ method: "GET",
1775
+ path: "/crm/objects/{objectName}/analytics",
1776
+ requestSchema: anyObject,
1777
+ responseSchema: anyResponse,
1778
+ backend: convex("query", "functions/crm/analytics:getAnalyticsConfig"),
1779
+ }),
1780
+ op({
1781
+ id: "crm.analytics.compute",
1782
+ group: "crm",
1783
+ summary:
1784
+ "Compute chart-ready results (buckets / series / values) for the stored dashboard, a subset of its panels, or ad-hoc panel definitions — optionally scoped to a saved view, a period preset (with the previous interval as previousValue) and extra filters. Same query the strip renders from.",
1785
+ cli: "dench crm analytics compute",
1786
+ method: "POST",
1787
+ path: "/crm/objects/{objectName}/analytics/compute",
1788
+ requestSchema: anyObject,
1789
+ responseSchema: anyResponse,
1790
+ backend: convex("query", "functions/crm/analytics:computePanels"),
1791
+ }),
1792
+ op({
1793
+ id: "crm.analytics.save",
1794
+ group: "crm",
1795
+ summary:
1796
+ "Create or update one panel (upsert by id). With viewName the write lands on that saved view's own dashboard, forking a copy if it was still inheriting the object's.",
1797
+ cli: "dench crm analytics save",
1798
+ method: "PUT",
1799
+ path: "/crm/objects/{objectName}/analytics/panels/{panelId}",
1800
+ requestSchema: anyObject,
1801
+ responseSchema: anyResponse,
1802
+ backend: convex("mutation", "functions/crm/analytics:saveAnalyticsPanel"),
1803
+ }),
1804
+ op({
1805
+ id: "crm.analytics.update",
1806
+ group: "crm",
1807
+ summary:
1808
+ "Edit part of one stored panel: only the keys in `patch` change (title, type, metric, metricField, groupBy, dateField, dateBucket, filters, derived, span, hidden, sortOrder); null clears an optional key. What the card's ⋮ menu writes.",
1809
+ cli: "dench crm analytics update",
1810
+ method: "PATCH",
1811
+ path: "/crm/objects/{objectName}/analytics/panels/{panelId}",
1812
+ requestSchema: anyObject,
1813
+ responseSchema: anyResponse,
1814
+ backend: convex("mutation", "functions/crm/analytics:updateAnalyticsPanel"),
1815
+ }),
1816
+ op({
1817
+ id: "crm.analytics.hide",
1818
+ group: "crm",
1819
+ summary:
1820
+ "Take a chart off the strip above the table (hidden: true). It stays in the full analytics view, counted by the strip's “+N more”.",
1821
+ cli: "dench crm analytics hide",
1822
+ method: "POST",
1823
+ path: "/crm/objects/{objectName}/analytics/panels/{panelId}/hide",
1824
+ requestSchema: anyObject,
1825
+ responseSchema: anyResponse,
1826
+ backend: convex("mutation", "functions/crm/analytics:updateAnalyticsPanel"),
1827
+ }),
1828
+ op({
1829
+ id: "crm.analytics.show",
1830
+ group: "crm",
1831
+ summary: "Bring a hidden chart back onto the strip (hidden: false).",
1832
+ cli: "dench crm analytics show",
1833
+ method: "POST",
1834
+ path: "/crm/objects/{objectName}/analytics/panels/{panelId}/show",
1835
+ requestSchema: anyObject,
1836
+ responseSchema: anyResponse,
1837
+ backend: convex("mutation", "functions/crm/analytics:updateAnalyticsPanel"),
1838
+ }),
1839
+ op({
1840
+ id: "crm.analytics.resize",
1841
+ group: "crm",
1842
+ summary:
1843
+ "Set a card's width on the 6-track dashboard grid: span 2 (third), 3 (half), 4 (two thirds), 6 (full), or null for the chart kind's default.",
1844
+ cli: "dench crm analytics resize",
1845
+ method: "POST",
1846
+ path: "/crm/objects/{objectName}/analytics/panels/{panelId}/resize",
1847
+ requestSchema: anyObject,
1848
+ responseSchema: anyResponse,
1849
+ backend: convex("mutation", "functions/crm/analytics:updateAnalyticsPanel"),
1850
+ }),
1851
+ op({
1852
+ id: "crm.analytics.delete",
1853
+ group: "crm",
1854
+ summary:
1855
+ "Delete one panel (idempotent). Template panels are tombstoned so a re-install never resurrects them.",
1856
+ cli: "dench crm analytics delete",
1857
+ method: "DELETE",
1858
+ path: "/crm/objects/{objectName}/analytics/panels/{panelId}",
1859
+ requestSchema: anyObject,
1860
+ responseSchema: anyResponse,
1861
+ backend: convex("mutation", "functions/crm/analytics:deleteAnalyticsPanel"),
1862
+ }),
1863
+ op({
1864
+ id: "crm.analytics.reorder",
1865
+ group: "crm",
1866
+ summary:
1867
+ "Persist the full panel order. panelIds must name every stored panel of the targeted dashboard.",
1868
+ cli: "dench crm analytics reorder",
1869
+ method: "POST",
1870
+ path: "/crm/objects/{objectName}/analytics/reorder",
1871
+ requestSchema: anyObject,
1872
+ responseSchema: anyResponse,
1873
+ backend: convex(
1874
+ "mutation",
1875
+ "functions/crm/analytics:reorderAnalyticsPanels",
1876
+ ),
1877
+ }),
1878
+ op({
1879
+ id: "crm.analytics.roles",
1880
+ group: "crm",
1881
+ summary:
1882
+ "Set the object's analytics setup — the field roles shared by every chart and view (amount, stage, won/lost/converted values, stageProbabilities, closeDate, recurrence, owner, location). Replaces the mapping; with merge: true only the keys given change and null clears one.",
1883
+ cli: "dench crm analytics roles",
1884
+ method: "PUT",
1885
+ path: "/crm/objects/{objectName}/analytics/roles",
1886
+ requestSchema: anyObject,
1887
+ responseSchema: anyResponse,
1888
+ backend: convex(
1889
+ "mutation",
1890
+ "functions/crm/analytics:setAnalyticsFieldRoles",
1891
+ ),
1892
+ }),
1893
+ op({
1894
+ id: "crm.analytics.collapse",
1895
+ group: "crm",
1896
+ summary:
1897
+ "Collapse the analytics strip above the object's table (team-shared, like saved views).",
1898
+ cli: "dench crm analytics collapse",
1899
+ method: "POST",
1900
+ path: "/crm/objects/{objectName}/analytics/collapse",
1901
+ requestSchema: anyObject,
1902
+ responseSchema: anyResponse,
1903
+ backend: convex(
1904
+ "mutation",
1905
+ "functions/crm/analytics:setAnalyticsStripCollapsed",
1906
+ ),
1907
+ }),
1908
+ op({
1909
+ id: "crm.analytics.expand",
1910
+ group: "crm",
1911
+ summary: "Expand the analytics strip above the object's table.",
1912
+ cli: "dench crm analytics expand",
1913
+ method: "POST",
1914
+ path: "/crm/objects/{objectName}/analytics/expand",
1915
+ requestSchema: anyObject,
1916
+ responseSchema: anyResponse,
1917
+ backend: convex(
1918
+ "mutation",
1919
+ "functions/crm/analytics:setAnalyticsStripCollapsed",
1920
+ ),
1921
+ }),
1922
+ op({
1923
+ id: "crm.analytics.scope",
1924
+ group: "crm",
1925
+ summary:
1926
+ 'Give a saved view its own dashboard (mode "own": starts as a copy of the object\'s panels) or hand it back to the object\'s shared one (mode "shared").',
1927
+ cli: "dench crm analytics scope",
1928
+ method: "POST",
1929
+ path: "/crm/objects/{objectName}/views/{viewName}/analytics/scope",
1930
+ requestSchema: anyObject,
1931
+ responseSchema: anyResponse,
1932
+ backend: convex("mutation", "functions/crm/analytics:setViewAnalyticsMode"),
1933
+ }),
1764
1934
  op({
1765
1935
  id: "crm.enrich.cell",
1766
1936
  group: "crm",
package/notifications.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * sessions are user-bound and read their owner's inbox; an org API key
8
8
  * with no person behind it is refused by the backend.
9
9
  *
10
- * dench notifications list [--filter inbox|unread|archived|all] [--limit N] [--json]
10
+ * dench notifications list [--filter inbox|unread|archived|all|mentions] [--limit N] [--json]
11
11
  * dench notifications count
12
12
  * dench notifications read <id> [--unread]
13
13
  * dench notifications read-all
@@ -57,11 +57,11 @@ const api = {
57
57
  ),
58
58
  };
59
59
 
60
- const FILTERS = new Set(["inbox", "unread", "archived", "all"]);
60
+ const FILTERS = new Set(["inbox", "unread", "archived", "all", "mentions"]);
61
61
 
62
62
  const HELP = `dench notifications — your notification inbox
63
63
 
64
- dench notifications list [--filter inbox|unread|archived|all] [--limit N] [--json]
64
+ dench notifications list [--filter inbox|unread|archived|all|mentions] [--limit N] [--json]
65
65
  dench notifications count
66
66
  dench notifications read <notificationId> [--unread]
67
67
  dench notifications read-all
@@ -69,8 +69,9 @@ const HELP = `dench notifications — your notification inbox
69
69
  dench notifications prefs
70
70
  dench notifications prefs --set emailEnabled=false --set entry_activity.email=false
71
71
 
72
- Kinds: mention, comment_reply, comment_reaction, entry_activity, dench_reply,
73
- task_assigned, task_completed, date_reminder, automation, system.
72
+ Kinds: mention (includes assignment), comment_reply, comment_reaction,
73
+ entry_activity, dench_reply, task_completed, date_reminder, automation, system.
74
+ task_assigned is a legacy assignment kind; new assignments are mention.
74
75
  Comment links carry ?entry=<object>:<id>&comment=<commentId>.`;
75
76
 
76
77
  function withToken(ctx: Ctx, args: Record<string, unknown>) {
@@ -173,7 +174,7 @@ export async function runNotificationsCommand(opts: {
173
174
  const filter = getFlag(args, "--filter") ?? "inbox";
174
175
  if (!FILTERS.has(filter)) {
175
176
  throw new NotificationsCliError(
176
- "--filter must be inbox, unread, archived, or all",
177
+ "--filter must be inbox, unread, archived, all, or mentions",
177
178
  );
178
179
  }
179
180
  const rawLimit = getFlag(args, "--limit");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dench.com/cli",
3
- "version": "2.9.4-staging.231",
3
+ "version": "2.9.5-staging.239",
4
4
  "description": "Dench agent workspace CLI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -26,6 +26,7 @@
26
26
  "chat-spawn.ts",
27
27
  "crm.ts",
28
28
  "crm-comments.ts",
29
+ "crm-analytics.ts",
29
30
  "meetings.ts",
30
31
  "email.ts",
31
32
  "campaign.ts",