@dench.com/cli 2.9.4 → 2.9.6-staging.240

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",
@@ -3043,6 +3213,20 @@ const rawApiOperations = [
3043
3213
  responseSchema: anyResponse,
3044
3214
  backend: custom("filesMove", "bearer"),
3045
3215
  }),
3216
+ op({
3217
+ id: "files.mkdir",
3218
+ group: "files",
3219
+ summary:
3220
+ "Create a workspace directory (and any missing parents). Idempotent.",
3221
+ cli: "dench files mkdir",
3222
+ method: "POST",
3223
+ path: "/files/mkdir",
3224
+ requestSchema: anyObject,
3225
+ responseSchema: anyResponse,
3226
+ backend: convex("mutation", "functions/files:recordDirCreate", "bearer", {
3227
+ tokenArg: "apiKey",
3228
+ }),
3229
+ }),
3046
3230
  op({
3047
3231
  id: "files.stage",
3048
3232
  group: "files",
@@ -3358,6 +3542,65 @@ const rawApiOperations = [
3358
3542
  responseSchema: anyResponse,
3359
3543
  backend: convex("mutation", "functions/appStore:setPinned"),
3360
3544
  }),
3545
+ op({
3546
+ id: "apps.validate",
3547
+ group: "apps",
3548
+ summary:
3549
+ "Validate a .dench.app folder: manifest, permissions, and every window.dench call it makes.",
3550
+ cli: "dench apps validate",
3551
+ method: "POST",
3552
+ path: "/local/apps/validate",
3553
+ requestSchema: anyObject,
3554
+ responseSchema: anyResponse,
3555
+ backend: local(
3556
+ "Validation reads the app folder on the caller's disk. In the browser, the same catalog is window.dench.api.operations().",
3557
+ ),
3558
+ }),
3559
+ op({
3560
+ id: "apps.webhooks.register",
3561
+ group: "apps",
3562
+ summary:
3563
+ "Register an inbound webhook for an app. Returns the URL and signing secret ONCE.",
3564
+ cli: "dench apps webhooks register",
3565
+ method: "POST",
3566
+ path: "/apps/{slug}/webhooks",
3567
+ requestSchema: anyObject,
3568
+ responseSchema: anyResponse,
3569
+ backend: convex("mutation", "functions/appWebhooks:register"),
3570
+ }),
3571
+ op({
3572
+ id: "apps.webhooks.list",
3573
+ group: "apps",
3574
+ summary: "List an app's registered webhooks (URLs, never secrets).",
3575
+ cli: "dench apps webhooks list",
3576
+ method: "GET",
3577
+ path: "/apps/{slug}/webhooks",
3578
+ requestSchema: anyObject,
3579
+ responseSchema: anyResponse,
3580
+ backend: convex("query", "functions/appWebhooks:list"),
3581
+ }),
3582
+ op({
3583
+ id: "apps.webhooks.poll",
3584
+ group: "apps",
3585
+ summary: "Read events an app webhook received since a timestamp.",
3586
+ cli: "dench apps webhooks poll",
3587
+ method: "GET",
3588
+ path: "/apps/{slug}/webhooks/{hookName}/events",
3589
+ requestSchema: anyObject,
3590
+ responseSchema: anyResponse,
3591
+ backend: convex("query", "functions/appWebhooks:poll"),
3592
+ }),
3593
+ op({
3594
+ id: "apps.webhooks.delete",
3595
+ group: "apps",
3596
+ summary: "Remove an app webhook and every event it stored.",
3597
+ cli: "dench apps webhooks delete",
3598
+ method: "DELETE",
3599
+ path: "/apps/{slug}/webhooks/{hookName}",
3600
+ requestSchema: anyObject,
3601
+ responseSchema: anyResponse,
3602
+ backend: convex("mutation", "functions/appWebhooks:remove"),
3603
+ }),
3361
3604
  op({
3362
3605
  id: "tool.status",
3363
3606
  group: "gateway",
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",
3
+ "version": "2.9.6-staging.240",
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",
@@ -47,8 +48,16 @@
47
48
  "session.ts",
48
49
  "lib/organizationSelector.ts",
49
50
  "lib/",
51
+ "app-sdk.d.ts",
50
52
  "README.md"
51
53
  ],
54
+ "exports": {
55
+ "./app-sdk": {
56
+ "types": "./app-sdk.d.ts"
57
+ },
58
+ "./package.json": "./package.json",
59
+ "./*": "./*"
60
+ },
52
61
  "engines": {
53
62
  "node": ">=20.0.0"
54
63
  },