@membranehq/sdk 0.25.0 → 0.27.0

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.
@@ -10,7 +10,6 @@ import { createTwoFilesPatch } from 'diff';
10
10
  import * as yaml from 'js-yaml';
11
11
  import qs from 'qs';
12
12
  import { connectToChild } from 'penpal';
13
- import axiosOriginal from 'axios';
14
13
  import { fromZodError } from 'zod-validation-error';
15
14
 
16
15
  var ErrorType;
@@ -4597,6 +4596,9 @@ const CONNECTOR_EVENTS_DIR = 'events';
4597
4596
  function getEffectiveConnectorOption(connector, optionKey) {
4598
4597
  var _a, _b, _c, _d, _e, _f, _g, _h;
4599
4598
  const option = (_a = connector.options) === null || _a === void 0 ? void 0 : _a[optionKey];
4599
+ if (!option) {
4600
+ throw new BadRequestError(`Connector doesn't have auth option ${optionKey}`);
4601
+ }
4600
4602
  const connectorInputSchema = (_b = connector.inputSchema) !== null && _b !== void 0 ? _b : (_c = connector.ui) === null || _c === void 0 ? void 0 : _c.schema;
4601
4603
  const optionInputSchema = (_d = option === null || option === void 0 ? void 0 : option.inputSchema) !== null && _d !== void 0 ? _d : (_e = option === null || option === void 0 ? void 0 : option.ui) === null || _e === void 0 ? void 0 : _e.schema;
4602
4604
  return {
@@ -15957,6 +15959,14 @@ const MembraneInstance = z.object({
15957
15959
  lastReportedAt: z.coerce.date().optional(),
15958
15960
  activeTenants: z.number().optional(),
15959
15961
  billableTenants: z.number().optional(),
15962
+ clusterName: z.string().optional(),
15963
+ argoCdUrl: z.url().optional(),
15964
+ grafanaUrl: z.url().optional(),
15965
+ mongoAtlasUrl: z.url().optional(),
15966
+ helmBranch: z.string().optional(),
15967
+ helmValuesPath: z.url().optional(),
15968
+ awsAccountName: z.string().optional(),
15969
+ awsSsoUrl: z.url().optional(),
15960
15970
  });
15961
15971
  const CreateMembraneInstanceRequest = z.object({
15962
15972
  name: z.string().min(1),
@@ -15970,6 +15980,14 @@ const UpdateMembraneInstanceRequest = z
15970
15980
  apiBaseUri: z.string().min(1).optional(),
15971
15981
  consoleBaseUri: z.string().min(1).nullable().optional(),
15972
15982
  orgId: z.string().min(1).nullable().optional(),
15983
+ clusterName: z.string().nullable().optional(),
15984
+ argoCdUrl: z.url().nullable().optional(),
15985
+ grafanaUrl: z.url().nullable().optional(),
15986
+ mongoAtlasUrl: z.url().nullable().optional(),
15987
+ helmBranch: z.string().nullable().optional(),
15988
+ helmValuesPath: z.url().nullable().optional(),
15989
+ awsAccountName: z.string().nullable().optional(),
15990
+ awsSsoUrl: z.url().nullable().optional(),
15973
15991
  })
15974
15992
  .strict();
15975
15993
  const ListMembraneInstancesQuery = PaginationQuery.extend({
@@ -16042,8 +16060,34 @@ function decodeJWT(token) {
16042
16060
  }
16043
16061
  }
16044
16062
 
16045
- const axiosGlobal = ((axiosOriginal === null || axiosOriginal === void 0 ? void 0 : axiosOriginal.default) || axiosOriginal);
16046
- const axios = axiosGlobal.create();
16063
+ let _axiosGlobal;
16064
+ let _axiosInstance;
16065
+ function getAxiosGlobal() {
16066
+ if (!_axiosGlobal) {
16067
+ let axiosOriginal;
16068
+ axiosOriginal = require('axios');
16069
+ _axiosGlobal = ((axiosOriginal === null || axiosOriginal === void 0 ? void 0 : axiosOriginal.default) || axiosOriginal);
16070
+ }
16071
+ return _axiosGlobal;
16072
+ }
16073
+ function getAxiosInstance() {
16074
+ if (!_axiosInstance) {
16075
+ _axiosInstance = getAxiosGlobal().create();
16076
+ }
16077
+ return _axiosInstance;
16078
+ }
16079
+ const axios = new Proxy(((...args) => getAxiosInstance()(...args)), {
16080
+ get(_, prop) {
16081
+ return getAxiosInstance()[prop];
16082
+ },
16083
+ set(_, prop, value) {
16084
+ getAxiosInstance()[prop] = value;
16085
+ return true;
16086
+ },
16087
+ apply(_, thisArg, args) {
16088
+ return getAxiosInstance().apply(thisArg, args);
16089
+ },
16090
+ });
16047
16091
  const DEFAULT_API_URI = 'https://api.getmembrane.com';
16048
16092
  const DEFAULT_UI_URI = 'https://ui.getmembrane.com';
16049
16093
  const membraneClientOptionsSchema = z
@@ -16210,7 +16254,7 @@ class MembraneApiClient {
16210
16254
  params.withCredentials = false;
16211
16255
  let response;
16212
16256
  try {
16213
- response = await axios.request(params);
16257
+ response = await getAxiosInstance().request(params);
16214
16258
  }
16215
16259
  catch (err) {
16216
16260
  log.data.timeMs = new Date().getTime() - startTime.getTime();
@@ -16246,7 +16290,7 @@ class MembraneApiClient {
16246
16290
  }
16247
16291
  handleRequestError(err) {
16248
16292
  var _a, _b;
16249
- if (axiosGlobal.isAxiosError(err) && ((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.type)) {
16293
+ if (getAxiosGlobal().isAxiosError(err) && ((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.type)) {
16250
16294
  const error = getErrorFromData(err.response.data);
16251
16295
  if (error)
16252
16296
  throw error;