@mutagent/cli 0.1.3 → 0.1.4

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.js CHANGED
@@ -185,9 +185,9 @@ function serverURLFromOptions(options) {
185
185
  var SDK_METADATA = {
186
186
  language: "typescript",
187
187
  openapiDocVersion: "2.0.0",
188
- sdkVersion: "0.2.21",
188
+ sdkVersion: "0.2.23",
189
189
  genVersion: "2.812.2",
190
- userAgent: "speakeasy-sdk/typescript 0.2.21 2.812.2 2.0.0 @mutagent/sdk"
190
+ userAgent: "speakeasy-sdk/typescript 0.2.23 2.812.2 2.0.0 @mutagent/sdk"
191
191
  };
192
192
  // ../mutagent-sdk/dist/esm/lib/http.js
193
193
  var DEFAULT_FETCHER = (input, init) => {
@@ -13807,6 +13807,32 @@ async function validateApiKey(apiKey, endpoint) {
13807
13807
  return false;
13808
13808
  }
13809
13809
  }
13810
+ async function fetchOrganizations(apiKey, endpoint) {
13811
+ try {
13812
+ const response = await fetch(`${endpoint}/api/organizations`, {
13813
+ headers: { "x-api-key": apiKey }
13814
+ });
13815
+ if (!response.ok)
13816
+ return [];
13817
+ const data = await response.json();
13818
+ return data.data ?? [];
13819
+ } catch {
13820
+ return [];
13821
+ }
13822
+ }
13823
+ async function fetchWorkspaces(apiKey, endpoint, orgId) {
13824
+ try {
13825
+ const response = await fetch(`${endpoint}/api/workspaces`, {
13826
+ headers: { "x-api-key": apiKey, "x-organization-id": orgId }
13827
+ });
13828
+ if (!response.ok)
13829
+ return [];
13830
+ const data = await response.json();
13831
+ return data.workspaces ?? [];
13832
+ } catch {
13833
+ return [];
13834
+ }
13835
+ }
13810
13836
  // src/lib/output.ts
13811
13837
  import chalk from "chalk";
13812
13838
  function getJsonFlag(command) {
@@ -13943,5 +13969,5 @@ export {
13943
13969
  ApiError
13944
13970
  };
13945
13971
 
13946
- //# debugId=460687AAB930C83264756E2164756E21
13972
+ //# debugId=D9DBD2ED1B8C7B3864756E2164756E21
13947
13973
  //# sourceMappingURL=index.js.map