@flashbacktech/tsclient 0.4.55 → 0.4.57

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
@@ -300,6 +300,18 @@ var OrganizationClient = class {
300
300
  const res = await this.http.get("/orgs/list-all");
301
301
  return res.data ?? [];
302
302
  }
303
+ /**
304
+ * Platform-admin only: typeahead org search. Returns up to `limit` matches
305
+ * (id+name) for the case-insensitive name substring `q` (or the first
306
+ * `limit` orgs when `q` is empty) plus the total match count, so a picker
307
+ * can show "N more — refine your search". Returns 403 unless platform admin.
308
+ */
309
+ async searchOrgs(q = "", limit = 10) {
310
+ const res = await this.http.get("/orgs/search", {
311
+ query: { q, limit }
312
+ });
313
+ return unwrapData(res);
314
+ }
303
315
  /**
304
316
  * Platform-admin only: provision a new organization + founding owner and
305
317
  * email the owner an invite link. The invite-only counterpart to public
@@ -597,6 +609,35 @@ var CredentialsClient = class {
597
609
  delete(credentialId) {
598
610
  return this.http.delete(`/credentials/${credentialId}`);
599
611
  }
612
+ /**
613
+ * listOrgNotify returns the org-scoped notification credentials (Slack /
614
+ * Teams / PagerDuty / SMTP, workspaceId NULL) — the channels the org owns
615
+ * for platform-event notifications, managed on Settings → System
616
+ * notifications. Distinct from project-scoped notify credentials.
617
+ */
618
+ async listOrgNotify() {
619
+ const res = await this.http.get(
620
+ "/credentials/org-notify"
621
+ );
622
+ return res.credentials ?? res.data ?? [];
623
+ }
624
+ /**
625
+ * createOrgNotify creates an org-scoped notification credential. The body is
626
+ * the universal credential shape minus projectId/workspaceId (the server
627
+ * pins workspaceId to NULL); provider must be a notify transport.
628
+ */
629
+ async createOrgNotify(body) {
630
+ const res = await this.http.post(
631
+ "/credentials/org-notify",
632
+ { body }
633
+ );
634
+ const value = res.data ?? res.credential;
635
+ if (!value) throw new Error("createOrgNotify response missing body.");
636
+ return value;
637
+ }
638
+ deleteOrgNotify(credentialId) {
639
+ return this.http.delete(`/credentials/org-notify/${credentialId}`);
640
+ }
600
641
  /**
601
642
  * providers fetches the server-side catalog. The tsclient ships its
602
643
  * own catalog mirror in ./providers.ts that the frontend can use