@flashbacktech/tsclient 0.4.37 → 0.4.40

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/dist/index.cjs CHANGED
@@ -138,6 +138,14 @@ var AuthClient = class {
138
138
  register(body) {
139
139
  return this.http.post("/user/register", { body, skipAuth: true });
140
140
  }
141
+ /**
142
+ * Unauthenticated boot config. The SPA reads `openRegistration` to decide
143
+ * whether to render the self-service signup form (false => invite-only /
144
+ * preview mode). Safe to call before any session exists.
145
+ */
146
+ publicConfig() {
147
+ return this.http.get("/public-config", { skipAuth: true });
148
+ }
141
149
  logout(refreshToken) {
142
150
  return this.http.post("/user/logout", {
143
151
  body: { refreshToken }
@@ -272,6 +280,20 @@ var OrganizationClient = class {
272
280
  const res = await this.http.get("/orgs/list-all");
273
281
  return res.data ?? [];
274
282
  }
283
+ /**
284
+ * Platform-admin only: provision a new organization + founding owner and
285
+ * email the owner an invite link. The invite-only counterpart to public
286
+ * self-service registration (used while the backend has OPEN_REGISTRATION
287
+ * disabled). Returns 403 unless the caller's home org is the configured
288
+ * ADMIN_ORGANIZATION; 409 when the owner email already exists.
289
+ */
290
+ async inviteOrg(body) {
291
+ const res = await this.http.post(
292
+ "/organization/invite-org",
293
+ { body }
294
+ );
295
+ return unwrapData(res);
296
+ }
275
297
  /**
276
298
  * Platform-admin only: enable or disable the debug surface for an org.
277
299
  * Returns the updated org entry with the new allowDebug value.
@@ -1166,6 +1188,7 @@ var CAP_STORAGE = 1;
1166
1188
  var CAP_AI = 2;
1167
1189
  var CAP_COMPUTE = 4;
1168
1190
  var CAP_VCS = 8;
1191
+ var CAP_NOTIFY = 16;
1169
1192
  var CAP_GENERAL = 255;
1170
1193
  var PROVIDER_CATALOG = {
1171
1194
  AWS: {
@@ -1553,9 +1576,113 @@ var PROVIDER_CATALOG = {
1553
1576
  help: "Override for proxies or regional endpoints. Most users leave blank to use the default Gemini API base URL."
1554
1577
  }
1555
1578
  ]
1579
+ },
1580
+ SLACK: {
1581
+ id: "SLACK",
1582
+ displayName: "Slack",
1583
+ capabilities: CAP_NOTIFY,
1584
+ fields: [
1585
+ {
1586
+ path: "secret",
1587
+ label: "Incoming Webhook URL",
1588
+ type: "password",
1589
+ required: true,
1590
+ secret: true,
1591
+ placeholder: "https://hooks.slack.com/services/T000/B000/xxxxxxxx",
1592
+ help: "A Slack Incoming Webhook URL. The target channel is fixed by the webhook. Encrypted at rest; never injected into the sandbox."
1593
+ },
1594
+ {
1595
+ path: "metadata.channelHint",
1596
+ label: "Channel Hint (optional)",
1597
+ type: "text",
1598
+ required: false,
1599
+ placeholder: "#oncall",
1600
+ help: "Display-only label for the channel this webhook posts to. Does not change routing \u2014 the webhook URL controls the destination."
1601
+ }
1602
+ ]
1603
+ },
1604
+ TEAMS: {
1605
+ id: "TEAMS",
1606
+ displayName: "Microsoft Teams",
1607
+ capabilities: CAP_NOTIFY,
1608
+ fields: [
1609
+ {
1610
+ path: "secret",
1611
+ label: "Incoming Webhook URL",
1612
+ type: "password",
1613
+ required: true,
1614
+ secret: true,
1615
+ placeholder: "https://outlook.office.com/webhook/...",
1616
+ help: "A Teams Incoming Webhook (connector) URL. The target channel is fixed by the webhook. Encrypted at rest; never injected into the sandbox."
1617
+ }
1618
+ ]
1619
+ },
1620
+ PAGERDUTY: {
1621
+ id: "PAGERDUTY",
1622
+ displayName: "PagerDuty",
1623
+ capabilities: CAP_NOTIFY,
1624
+ fields: [
1625
+ {
1626
+ path: "secret",
1627
+ label: "Integration / Routing Key",
1628
+ type: "password",
1629
+ required: true,
1630
+ secret: true,
1631
+ placeholder: "R0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
1632
+ help: "An Events API v2 integration (routing) key from a PagerDuty service. Encrypted at rest; never injected into the sandbox."
1633
+ }
1634
+ ]
1635
+ },
1636
+ SMTP: {
1637
+ id: "SMTP",
1638
+ displayName: "Email (SMTP)",
1639
+ capabilities: CAP_NOTIFY,
1640
+ fields: [
1641
+ {
1642
+ path: "metadata.host",
1643
+ label: "SMTP Host",
1644
+ type: "text",
1645
+ required: true,
1646
+ placeholder: "smtp.example.com",
1647
+ help: "Hostname of the SMTP relay."
1648
+ },
1649
+ {
1650
+ path: "metadata.port",
1651
+ label: "Port",
1652
+ type: "number",
1653
+ required: false,
1654
+ default: 587,
1655
+ placeholder: "587",
1656
+ help: "SMTP port. Defaults to 587 (STARTTLS). TLS is always required."
1657
+ },
1658
+ {
1659
+ path: "metadata.fromAddress",
1660
+ label: "From Address",
1661
+ type: "text",
1662
+ required: true,
1663
+ placeholder: "alerts@example.com",
1664
+ help: "Envelope-from / From header for messages the agent sends. Also used as the SMTP AUTH username."
1665
+ },
1666
+ {
1667
+ path: "metadata.toAddresses",
1668
+ label: "To Addresses",
1669
+ type: "stringList",
1670
+ required: true,
1671
+ placeholder: "oncall@example.com",
1672
+ help: "One or more recipient addresses. Every notify message is sent to all of them."
1673
+ },
1674
+ {
1675
+ path: "secret",
1676
+ label: "Password",
1677
+ type: "password",
1678
+ required: true,
1679
+ secret: true,
1680
+ help: "SMTP AUTH password for the From address. Encrypted at rest; never injected into the sandbox."
1681
+ }
1682
+ ]
1556
1683
  }
1557
1684
  };
1558
- var PROVIDER_ORDER = ["AWS", "BEDROCK", "GCP", "AZURE", "SSH", "GITHUB", "GITLAB", "AZURE_DEVOPS", "OPENAI", "ANTHROPIC", "GEMINI"];
1685
+ var PROVIDER_ORDER = ["AWS", "BEDROCK", "GCP", "AZURE", "SSH", "GITHUB", "GITLAB", "AZURE_DEVOPS", "OPENAI", "ANTHROPIC", "GEMINI", "SLACK", "TEAMS", "PAGERDUTY", "SMTP"];
1559
1686
  function listProviders() {
1560
1687
  return PROVIDER_ORDER.flatMap((id) => PROVIDER_CATALOG[id] ? [PROVIDER_CATALOG[id]] : []);
1561
1688
  }
@@ -1767,6 +1894,13 @@ function computeDisplayHint(providerId, metadata) {
1767
1894
  const prefix = str(metadata["tokenPrefix"]);
1768
1895
  return prefix ? `${prefix}\u2026` : "";
1769
1896
  }
1897
+ case "SLACK":
1898
+ return str(metadata["channelHint"]);
1899
+ case "SMTP": {
1900
+ const from = str(metadata["fromAddress"]);
1901
+ const host = str(metadata["host"]);
1902
+ return from + (host ? ` @ ${host}` : "");
1903
+ }
1770
1904
  default:
1771
1905
  return "";
1772
1906
  }
@@ -1800,6 +1934,7 @@ exports.BudgetsClient = BudgetsClient;
1800
1934
  exports.CAP_AI = CAP_AI;
1801
1935
  exports.CAP_COMPUTE = CAP_COMPUTE;
1802
1936
  exports.CAP_GENERAL = CAP_GENERAL;
1937
+ exports.CAP_NOTIFY = CAP_NOTIFY;
1803
1938
  exports.CAP_STORAGE = CAP_STORAGE;
1804
1939
  exports.CAP_VCS = CAP_VCS;
1805
1940
  exports.CloudAgentClient = CloudAgentClient;