@membranehq/sdk 0.9.6 → 0.9.7

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.
@@ -3941,7 +3941,7 @@ const ConnectorAuthMethodTypes = {
3941
3941
  isRequired: false,
3942
3942
  },
3943
3943
  getCredentialsFromConnectionParameters: {
3944
- authTypes: ['client-credentials'],
3944
+ authTypes: ['client-credentials', 'oauth2'],
3945
3945
  getInputSchema: getDefaultAuthInputSchema,
3946
3946
  getOutputSchema: ({ connectorSpec, authOptionKey }) => {
3947
3947
  var _a;
@@ -4241,7 +4241,12 @@ exports.ConnectorStatus = void 0;
4241
4241
  ConnectorStatus["beta"] = "beta";
4242
4242
  ConnectorStatus["planned"] = "planned";
4243
4243
  })(exports.ConnectorStatus || (exports.ConnectorStatus = {}));
4244
- const ConnectorVersionData = z.z.object({
4244
+ const WritableConnectorVersionData = z.z.object({
4245
+ auth: ConnectorAuth.optional(),
4246
+ parametersSchema: DataSchema.optional(),
4247
+ });
4248
+ const ConnectorVersionData = z.z
4249
+ .object({
4245
4250
  baseUri: z.z.string(),
4246
4251
  revision: z.z.string().optional(),
4247
4252
  dataCollectionsCount: z.z.number().optional(),
@@ -4254,7 +4259,8 @@ const ConnectorVersionData = z.z.object({
4254
4259
  hasData: z.z.boolean().optional(),
4255
4260
  isReadOnly: z.z.boolean().optional(),
4256
4261
  version: z.z.string(),
4257
- });
4262
+ })
4263
+ .extend(WritableConnectorVersionData.shape);
4258
4264
  const ConnectorVersion = ConnectorVersionData.extend({
4259
4265
  id: z.z.string(),
4260
4266
  connectorId: z.z.string(),
@@ -10409,6 +10415,7 @@ function getMembraneElementPath(elementType, elementKey, integrationKey) {
10409
10415
  return `${integrationTypePath}/${integrationKey}/${elementTypePath}/${elementKey}/${MEMBRANE_ELEMENT_CONFIG_FILE_NAME}`;
10410
10416
  }
10411
10417
  function parseMembraneElementPath(relativePath) {
10418
+ const normalizedPath = relativePath.split(/[\\/]/).join('/');
10412
10419
  const typeByApiPath = new Map();
10413
10420
  for (const spec of Object.values(WorkspaceElementSpecs)) {
10414
10421
  typeByApiPath.set(spec.apiPath, spec.type);
@@ -10417,7 +10424,7 @@ function parseMembraneElementPath(relativePath) {
10417
10424
  .map((spec) => spec.apiPath)
10418
10425
  .join('|');
10419
10426
  const universalPattern = new RegExp(`^(?<elementType>${elementTypes})/(?<elementKey>[^/]+)/${MEMBRANE_ELEMENT_CONFIG_FILE_NAME}$`);
10420
- const universalMatch = relativePath.match(universalPattern);
10427
+ const universalMatch = normalizedPath.match(universalPattern);
10421
10428
  if (universalMatch === null || universalMatch === void 0 ? void 0 : universalMatch.groups) {
10422
10429
  const { elementType: elementTypePath, elementKey } = universalMatch.groups;
10423
10430
  const elementType = typeByApiPath.get(elementTypePath);
@@ -10425,8 +10432,12 @@ function parseMembraneElementPath(relativePath) {
10425
10432
  return { type: elementType, key: elementKey };
10426
10433
  }
10427
10434
  }
10428
- const integrationLevelPattern = new RegExp(`^integrations/(?<integrationKey>[^/]+)/(?<elementType>${elementTypes})/(?<elementKey>[^/]+)/${MEMBRANE_ELEMENT_CONFIG_FILE_NAME}$`);
10429
- const integrationLevelMatch = relativePath.match(integrationLevelPattern);
10435
+ const integrationLevelElementTypes = Object.values(WorkspaceElementSpecs)
10436
+ .filter((spec) => spec.isIntegrationLevel)
10437
+ .map((spec) => spec.apiPath)
10438
+ .join('|');
10439
+ const integrationLevelPattern = new RegExp(`^integrations/(?<integrationKey>[^/]+)/(?<elementType>${integrationLevelElementTypes})/(?<elementKey>[^/]+)/${MEMBRANE_ELEMENT_CONFIG_FILE_NAME}$`);
10440
+ const integrationLevelMatch = normalizedPath.match(integrationLevelPattern);
10430
10441
  if (integrationLevelMatch === null || integrationLevelMatch === void 0 ? void 0 : integrationLevelMatch.groups) {
10431
10442
  const { integrationKey, elementType: elementTypePath, elementKey } = integrationLevelMatch.groups;
10432
10443
  const elementType = typeByApiPath.get(elementTypePath);
@@ -12946,6 +12957,11 @@ exports.AgentSessionStatus = void 0;
12946
12957
  AgentSessionStatus["FAILED"] = "failed";
12947
12958
  AgentSessionStatus["CANCELLED"] = "cancelled";
12948
12959
  })(exports.AgentSessionStatus || (exports.AgentSessionStatus = {}));
12960
+ exports.AgentSessionState = void 0;
12961
+ (function (AgentSessionState) {
12962
+ AgentSessionState["BUSY"] = "busy";
12963
+ AgentSessionState["IDLE"] = "idle";
12964
+ })(exports.AgentSessionState || (exports.AgentSessionState = {}));
12949
12965
  const AgentSession = z.z.object({
12950
12966
  id: z.z.string(),
12951
12967
  workspaceId: z.z.string(),
@@ -12966,6 +12982,7 @@ const AgentSession = z.z.object({
12966
12982
  logs: z.z.array(z.z.any()).optional(),
12967
12983
  usage: z.z.number().optional(),
12968
12984
  summary: z.z.string().optional(),
12985
+ state: z.z.enum(exports.AgentSessionState).default(exports.AgentSessionState.IDLE),
12969
12986
  });
12970
12987
  const CreateAgentSession = z.z.object({
12971
12988
  workspaceElementType: z.z.enum(exports.WorkspaceElementType).optional(),
@@ -12977,6 +12994,12 @@ const AgentSessionInputSchema = z.z.object({
12977
12994
  input: z.z.string().min(1),
12978
12995
  synthetic: z.z.boolean().optional(),
12979
12996
  });
12997
+ const PatchAgentSessionSchema = z.z.object({
12998
+ state: z.z.enum(exports.AgentSessionState).optional(),
12999
+ lastActivityAt: z.z.iso.datetime().optional(),
13000
+ summary: z.z.string().optional(),
13001
+ status: z.z.enum(exports.AgentSessionStatus).optional(),
13002
+ });
12980
13003
 
12981
13004
  const API_VERSIONS = {
12982
13005
  LEGACY: 'legacy',
@@ -13292,6 +13315,7 @@ const membraneConfigSchema = z.z.object({
13292
13315
  workspaceKey: z.z.string(),
13293
13316
  workspaceSecret: z.z.string(),
13294
13317
  apiUri: z.z.string().optional(),
13318
+ consoleUri: z.z.string().optional(),
13295
13319
  testCustomerId: z.z.string().optional(),
13296
13320
  });
13297
13321
  class MembraneConfigLoader {
@@ -13409,6 +13433,9 @@ class MembraneConfigLoader {
13409
13433
  if (parsedConfig === null || parsedConfig === void 0 ? void 0 : parsedConfig.apiUri) {
13410
13434
  config.apiUri = String(parsedConfig.apiUri);
13411
13435
  }
13436
+ if (parsedConfig === null || parsedConfig === void 0 ? void 0 : parsedConfig.consoleUri) {
13437
+ config.consoleUri = String(parsedConfig.consoleUri);
13438
+ }
13412
13439
  if (parsedConfig === null || parsedConfig === void 0 ? void 0 : parsedConfig.testCustomerId) {
13413
13440
  config.testCustomerId = String(parsedConfig.testCustomerId);
13414
13441
  }
@@ -13425,6 +13452,9 @@ class MembraneConfigLoader {
13425
13452
  if (process.env.MEMBRANE_API_URI) {
13426
13453
  config.apiUri = process.env.MEMBRANE_API_URI;
13427
13454
  }
13455
+ if (process.env.MEMBRANE_CONSOLE_URI) {
13456
+ config.consoleUri = process.env.MEMBRANE_CONSOLE_URI;
13457
+ }
13428
13458
  if (process.env.MEMBRANE_TEST_CUSTOMER_ID) {
13429
13459
  config.testCustomerId = process.env.MEMBRANE_TEST_CUSTOMER_ID;
13430
13460
  }
@@ -13814,6 +13844,7 @@ exports.PackageExportProperties = PackageExportProperties;
13814
13844
  exports.PackagesAccessor = PackagesAccessor;
13815
13845
  exports.PaginationQuery = PaginationQuery;
13816
13846
  exports.PaginationResponse = PaginationResponse;
13847
+ exports.PatchAgentSessionSchema = PatchAgentSessionSchema;
13817
13848
  exports.PlatformUserSchema = PlatformUserSchema;
13818
13849
  exports.RATE_LIMITS = RATE_LIMITS;
13819
13850
  exports.RateLimitExceededError = RateLimitExceededError;
@@ -13850,6 +13881,7 @@ exports.WORKSPACE_SIZE_LIMITS = WORKSPACE_SIZE_LIMITS;
13850
13881
  exports.WorkspaceElementSpecs = WorkspaceElementSpecs;
13851
13882
  exports.WorkspaceLimitsSchema = WorkspaceLimitsSchema;
13852
13883
  exports.WorkspacePublicKey = WorkspacePublicKey;
13884
+ exports.WritableConnectorVersionData = WritableConnectorVersionData;
13853
13885
  exports.__resolveValue = __resolveValue;
13854
13886
  exports.addRequiredFieldsToSchema = addRequiredFieldsToSchema;
13855
13887
  exports.addUdmFallbackFields = addUdmFallbackFields;