@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.
@@ -3917,7 +3917,7 @@ const ConnectorAuthMethodTypes = {
3917
3917
  isRequired: false,
3918
3918
  },
3919
3919
  getCredentialsFromConnectionParameters: {
3920
- authTypes: ['client-credentials'],
3920
+ authTypes: ['client-credentials', 'oauth2'],
3921
3921
  getInputSchema: getDefaultAuthInputSchema,
3922
3922
  getOutputSchema: ({ connectorSpec, authOptionKey }) => {
3923
3923
  var _a;
@@ -4217,7 +4217,12 @@ exports.ConnectorStatus = void 0;
4217
4217
  ConnectorStatus["beta"] = "beta";
4218
4218
  ConnectorStatus["planned"] = "planned";
4219
4219
  })(exports.ConnectorStatus || (exports.ConnectorStatus = {}));
4220
- const ConnectorVersionData = z.z.object({
4220
+ const WritableConnectorVersionData = z.z.object({
4221
+ auth: ConnectorAuth.optional(),
4222
+ parametersSchema: DataSchema.optional(),
4223
+ });
4224
+ const ConnectorVersionData = z.z
4225
+ .object({
4221
4226
  baseUri: z.z.string(),
4222
4227
  revision: z.z.string().optional(),
4223
4228
  dataCollectionsCount: z.z.number().optional(),
@@ -4230,7 +4235,8 @@ const ConnectorVersionData = z.z.object({
4230
4235
  hasData: z.z.boolean().optional(),
4231
4236
  isReadOnly: z.z.boolean().optional(),
4232
4237
  version: z.z.string(),
4233
- });
4238
+ })
4239
+ .extend(WritableConnectorVersionData.shape);
4234
4240
  const ConnectorVersion = ConnectorVersionData.extend({
4235
4241
  id: z.z.string(),
4236
4242
  connectorId: z.z.string(),
@@ -10385,6 +10391,7 @@ function getMembraneElementPath(elementType, elementKey, integrationKey) {
10385
10391
  return `${integrationTypePath}/${integrationKey}/${elementTypePath}/${elementKey}/${MEMBRANE_ELEMENT_CONFIG_FILE_NAME}`;
10386
10392
  }
10387
10393
  function parseMembraneElementPath(relativePath) {
10394
+ const normalizedPath = relativePath.split(/[\\/]/).join('/');
10388
10395
  const typeByApiPath = new Map();
10389
10396
  for (const spec of Object.values(WorkspaceElementSpecs)) {
10390
10397
  typeByApiPath.set(spec.apiPath, spec.type);
@@ -10393,7 +10400,7 @@ function parseMembraneElementPath(relativePath) {
10393
10400
  .map((spec) => spec.apiPath)
10394
10401
  .join('|');
10395
10402
  const universalPattern = new RegExp(`^(?<elementType>${elementTypes})/(?<elementKey>[^/]+)/${MEMBRANE_ELEMENT_CONFIG_FILE_NAME}$`);
10396
- const universalMatch = relativePath.match(universalPattern);
10403
+ const universalMatch = normalizedPath.match(universalPattern);
10397
10404
  if (universalMatch === null || universalMatch === void 0 ? void 0 : universalMatch.groups) {
10398
10405
  const { elementType: elementTypePath, elementKey } = universalMatch.groups;
10399
10406
  const elementType = typeByApiPath.get(elementTypePath);
@@ -10401,8 +10408,12 @@ function parseMembraneElementPath(relativePath) {
10401
10408
  return { type: elementType, key: elementKey };
10402
10409
  }
10403
10410
  }
10404
- const integrationLevelPattern = new RegExp(`^integrations/(?<integrationKey>[^/]+)/(?<elementType>${elementTypes})/(?<elementKey>[^/]+)/${MEMBRANE_ELEMENT_CONFIG_FILE_NAME}$`);
10405
- const integrationLevelMatch = relativePath.match(integrationLevelPattern);
10411
+ const integrationLevelElementTypes = Object.values(WorkspaceElementSpecs)
10412
+ .filter((spec) => spec.isIntegrationLevel)
10413
+ .map((spec) => spec.apiPath)
10414
+ .join('|');
10415
+ const integrationLevelPattern = new RegExp(`^integrations/(?<integrationKey>[^/]+)/(?<elementType>${integrationLevelElementTypes})/(?<elementKey>[^/]+)/${MEMBRANE_ELEMENT_CONFIG_FILE_NAME}$`);
10416
+ const integrationLevelMatch = normalizedPath.match(integrationLevelPattern);
10406
10417
  if (integrationLevelMatch === null || integrationLevelMatch === void 0 ? void 0 : integrationLevelMatch.groups) {
10407
10418
  const { integrationKey, elementType: elementTypePath, elementKey } = integrationLevelMatch.groups;
10408
10419
  const elementType = typeByApiPath.get(elementTypePath);
@@ -12922,6 +12933,11 @@ exports.AgentSessionStatus = void 0;
12922
12933
  AgentSessionStatus["FAILED"] = "failed";
12923
12934
  AgentSessionStatus["CANCELLED"] = "cancelled";
12924
12935
  })(exports.AgentSessionStatus || (exports.AgentSessionStatus = {}));
12936
+ exports.AgentSessionState = void 0;
12937
+ (function (AgentSessionState) {
12938
+ AgentSessionState["BUSY"] = "busy";
12939
+ AgentSessionState["IDLE"] = "idle";
12940
+ })(exports.AgentSessionState || (exports.AgentSessionState = {}));
12925
12941
  const AgentSession = z.z.object({
12926
12942
  id: z.z.string(),
12927
12943
  workspaceId: z.z.string(),
@@ -12942,6 +12958,7 @@ const AgentSession = z.z.object({
12942
12958
  logs: z.z.array(z.z.any()).optional(),
12943
12959
  usage: z.z.number().optional(),
12944
12960
  summary: z.z.string().optional(),
12961
+ state: z.z.enum(exports.AgentSessionState).default(exports.AgentSessionState.IDLE),
12945
12962
  });
12946
12963
  const CreateAgentSession = z.z.object({
12947
12964
  workspaceElementType: z.z.enum(exports.WorkspaceElementType).optional(),
@@ -12953,6 +12970,12 @@ const AgentSessionInputSchema = z.z.object({
12953
12970
  input: z.z.string().min(1),
12954
12971
  synthetic: z.z.boolean().optional(),
12955
12972
  });
12973
+ const PatchAgentSessionSchema = z.z.object({
12974
+ state: z.z.enum(exports.AgentSessionState).optional(),
12975
+ lastActivityAt: z.z.iso.datetime().optional(),
12976
+ summary: z.z.string().optional(),
12977
+ status: z.z.enum(exports.AgentSessionStatus).optional(),
12978
+ });
12956
12979
 
12957
12980
  const API_VERSIONS = {
12958
12981
  LEGACY: 'legacy',
@@ -13622,6 +13645,7 @@ exports.PackageExportProperties = PackageExportProperties;
13622
13645
  exports.PackagesAccessor = PackagesAccessor;
13623
13646
  exports.PaginationQuery = PaginationQuery;
13624
13647
  exports.PaginationResponse = PaginationResponse;
13648
+ exports.PatchAgentSessionSchema = PatchAgentSessionSchema;
13625
13649
  exports.PlatformUserSchema = PlatformUserSchema;
13626
13650
  exports.RATE_LIMITS = RATE_LIMITS;
13627
13651
  exports.RateLimitExceededError = RateLimitExceededError;
@@ -13658,6 +13682,7 @@ exports.WORKSPACE_SIZE_LIMITS = WORKSPACE_SIZE_LIMITS;
13658
13682
  exports.WorkspaceElementSpecs = WorkspaceElementSpecs;
13659
13683
  exports.WorkspaceLimitsSchema = WorkspaceLimitsSchema;
13660
13684
  exports.WorkspacePublicKey = WorkspacePublicKey;
13685
+ exports.WritableConnectorVersionData = WritableConnectorVersionData;
13661
13686
  exports.__resolveValue = __resolveValue;
13662
13687
  exports.addRequiredFieldsToSchema = addRequiredFieldsToSchema;
13663
13688
  exports.addUdmFallbackFields = addUdmFallbackFields;