@vibiz/cli 0.3.20 → 0.3.22

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.
@@ -1622,6 +1622,56 @@ var Vibiz = class {
1622
1622
  permissions: () => this.request("/api-keys/permissions").then((r) => r.data),
1623
1623
  revoke: (id) => this.request(`/api-keys/${id}`, { method: "DELETE" })
1624
1624
  };
1625
+ /**
1626
+ * Dashboards (docs: dashboards): a project's or the account's grid of widgets
1627
+ * over the metric catalogue (payments, analytics, replay, sign-in, AI, email,
1628
+ * hosting…). Pick metrics from `metrics()`, never SQL; `create({ template })`
1629
+ * makes a whole dashboard in one call. Each answer has `console_url`.
1630
+ */
1631
+ dashboards = {
1632
+ /** The catalogue: metrics (with breakdowns, filters, unit, permission), widget types, templates. */
1633
+ metrics: () => this.request("/dashboards/metrics"),
1634
+ list: (opts = {}) => this.request(
1635
+ `/dashboards${qs(opts)}`
1636
+ ),
1637
+ /** With `project_id` a project's; without, the account's (`project_ids`: some businesses). */
1638
+ create: (body) => this.request("/dashboards", { method: "POST", body }),
1639
+ get: (id) => this.request(`/dashboards/${encodeURIComponent(id)}`),
1640
+ /** `widgets` replaces the whole list (move and resize by sending layouts). */
1641
+ update: (id, body) => this.request(`/dashboards/${encodeURIComponent(id)}`, { method: "PATCH", body }),
1642
+ delete: (id) => this.request(
1643
+ `/dashboards/${encodeURIComponent(id)}`,
1644
+ { method: "DELETE" }
1645
+ ),
1646
+ addWidget: (id, widget) => this.request(
1647
+ `/dashboards/${encodeURIComponent(id)}/widgets`,
1648
+ { method: "POST", body: widget }
1649
+ ),
1650
+ updateWidget: (id, widgetId, patch) => this.request(
1651
+ `/dashboards/${encodeURIComponent(id)}/widgets/${encodeURIComponent(widgetId)}`,
1652
+ { method: "PATCH", body: patch }
1653
+ ),
1654
+ removeWidget: (id, widgetId) => this.request(
1655
+ `/dashboards/${encodeURIComponent(id)}/widgets/${encodeURIComponent(widgetId)}`,
1656
+ { method: "DELETE" }
1657
+ ),
1658
+ /** Every widget's data (or one's): each has `data` or its own `error`. */
1659
+ data: (id, opts = {}) => this.request(
1660
+ `/dashboards/${encodeURIComponent(id)}/data${qs({
1661
+ range: opts.range,
1662
+ from: opts.from,
1663
+ to: opts.to,
1664
+ project_ids: opts.project_ids?.join(","),
1665
+ widget: opts.widget,
1666
+ refresh: opts.refresh ? "1" : void 0
1667
+ })}`
1668
+ ),
1669
+ /** An unsaved widget's data: try a metric before adding it. */
1670
+ query: (body) => this.request(
1671
+ "/dashboards/query",
1672
+ { method: "POST", body }
1673
+ )
1674
+ };
1625
1675
  /** A short-lived link to the hosted usage dashboard (admin scope needs an admin key). */
1626
1676
  dashboard = {
1627
1677
  link: (opts = {}) => this.request("/dashboard/link", { method: "POST", body: opts })
@@ -2030,7 +2080,7 @@ function formatMinor(minor, currency) {
2030
2080
  }
2031
2081
 
2032
2082
  // packages/sdk/src/one-key.ts
2033
- var APP_SDK_VERSION = "0.3.20";
2083
+ var APP_SDK_VERSION = "0.3.22";
2034
2084
  var ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
2035
2085
  function oneKeyMessage(url, host) {
2036
2086
  const where = host ?? "your host";