@membranehq/sdk 0.24.0 → 0.25.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.
@@ -4288,6 +4288,7 @@ const ConnectorAuthHandlerBase = ConnectorAuthSpec.extend({
4288
4288
  makeApiClient: ConnectorMethodImplementationBase.optional(),
4289
4289
  refreshCredentials: ConnectorMethodImplementationBase.optional(),
4290
4290
  test: ConnectorMethodImplementationBase.optional(),
4291
+ disconnect: ConnectorMethodImplementationBase.optional(),
4291
4292
  enabled: z.z.any().optional(),
4292
4293
  });
4293
4294
  function getAuthSpec(spec, authOptionKey) {
@@ -4425,6 +4426,12 @@ const ConnectorAuthMethodTypes = {
4425
4426
  }),
4426
4427
  isRequired: true,
4427
4428
  },
4429
+ disconnect: {
4430
+ authTypes: ['oauth2', 'oauth1', 'client-credentials'],
4431
+ getInputSchema: getDefaultAuthInputSchema,
4432
+ supportedImplementationTypes: [exports.ConnectorMethodImplementationType.javascript],
4433
+ isRequired: false,
4434
+ },
4428
4435
  };
4429
4436
  const ConnectorAuthOAuth2 = ConnectorAuthHandlerBase.extend({
4430
4437
  type: z.z.literal('oauth2'),
@@ -4609,7 +4616,7 @@ const CONNECTOR_GLOBAL_WEBHOOKS_DIR = 'global-webhooks';
4609
4616
  const CONNECTOR_EVENTS_DIR = 'events';
4610
4617
 
4611
4618
  function getEffectiveConnectorOption(connector, optionKey) {
4612
- var _a, _b, _c, _d, _e, _f, _g;
4619
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4613
4620
  const option = (_a = connector.options) === null || _a === void 0 ? void 0 : _a[optionKey];
4614
4621
  const connectorInputSchema = (_b = connector.inputSchema) !== null && _b !== void 0 ? _b : (_c = connector.ui) === null || _c === void 0 ? void 0 : _c.schema;
4615
4622
  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;
@@ -4621,6 +4628,7 @@ function getEffectiveConnectorOption(connector, optionKey) {
4621
4628
  credentialsSchema: mergeSchemas([connector.credentialsSchema, option === null || option === void 0 ? void 0 : option.credentialsSchema]),
4622
4629
  makeApiClient: (_f = option === null || option === void 0 ? void 0 : option.makeApiClient) !== null && _f !== void 0 ? _f : connector.makeApiClient,
4623
4630
  test: (_g = option === null || option === void 0 ? void 0 : option.test) !== null && _g !== void 0 ? _g : connector.test,
4631
+ disconnect: (_h = option === null || option === void 0 ? void 0 : option.disconnect) !== null && _h !== void 0 ? _h : connector.disconnect,
4624
4632
  };
4625
4633
  }
4626
4634
  const getDefaultInputSchema = (authConfig) => {
@@ -4748,6 +4756,12 @@ const ConnectorFunctionSpecs = {
4748
4756
  }),
4749
4757
  isRequired: true,
4750
4758
  },
4759
+ disconnect: {
4760
+ authTypes: ['oauth2', 'oauth1', 'client-credentials'],
4761
+ getInputSchema: getDefaultInputSchema,
4762
+ supportedFunctionTypes: [exports.FunctionType.javascript],
4763
+ isRequired: false,
4764
+ },
4751
4765
  };
4752
4766
 
4753
4767
  const ConnectorOperationMethodImplementationTypes = [
@@ -9189,6 +9203,7 @@ const ConnectorAuthWithFunctions = z.z.object({
9189
9203
  getCredentialsFromAccessTokenResponse: GenericFunctionDefinition.optional(),
9190
9204
  getCredentialsFromRefreshTokenResponse: GenericFunctionDefinition.optional(),
9191
9205
  test: GenericFunctionDefinition.optional(),
9206
+ disconnect: GenericFunctionDefinition.optional(),
9192
9207
  proxyKey: z.z.string().optional(),
9193
9208
  ui: z.z
9194
9209
  .object({
@@ -9283,11 +9298,7 @@ const BaseConnector = z.z.object({
9283
9298
  popularity: z.z.number().optional(),
9284
9299
  tenantId: z.z.string().optional(),
9285
9300
  });
9286
- const Connector = z.z
9287
- .object({})
9288
- .extend(ConnectorSpec.shape)
9289
- .extend(BaseConnector.shape)
9290
- .extend(ConnectorVersionData.shape);
9301
+ const Connector = z.z.object({}).extend(BaseConnector.shape).extend(ConnectorVersionData.shape);
9291
9302
  const MinimalConnector = z.z.object({
9292
9303
  id: z.z.string(),
9293
9304
  key: z.z.string(),
@@ -13790,6 +13801,13 @@ const FindOrgWorkspacesQuery = z.z.object({
13790
13801
  cursor: z.z.coerce.number().optional(),
13791
13802
  limit: z.z.coerce.number().optional(),
13792
13803
  });
13804
+ const ListOrgWorkspacesQuery = FindOrgWorkspacesQuery.extend({
13805
+ orgId: z.z.string().optional().describe('Filter by organization ID'),
13806
+ });
13807
+ const ListOrgWorkspacesResponse = z.z.object({
13808
+ items: z.z.array(OrgWorkspace),
13809
+ cursor: z.z.string().optional(),
13810
+ });
13793
13811
  const CreateOrgWorkspaceRequest = z.z.object({
13794
13812
  name: z.z.string().min(1).optional().describe('Name of the workspace'),
13795
13813
  logoUri: z.z.string().optional().describe('URI for the workspace logo'),
@@ -15936,6 +15954,16 @@ const PendingTasksSummarySchema = z.z.object({
15936
15954
  total: z.z.number().describe('Sum of available pending task counts. Excludes unavailable queues.'),
15937
15955
  });
15938
15956
 
15957
+ const HUB_INSTANCE_ID = 'hub';
15958
+ function isHubInstanceId(instanceId) {
15959
+ return instanceId === HUB_INSTANCE_ID;
15960
+ }
15961
+ function isHubWorkspace(workspace) {
15962
+ return workspace.membraneInstanceId == null;
15963
+ }
15964
+ function isSelfHostedInstance(instance) {
15965
+ return !isHubInstanceId(instance.id);
15966
+ }
15939
15967
  const MembraneInstance = z.z.object({
15940
15968
  id: z.z.string(),
15941
15969
  name: z.z.string(),
@@ -16880,6 +16908,7 @@ exports.GraphQLApiMappingSchema = GraphQLApiMappingSchema;
16880
16908
  exports.GraphQLFieldMappingSchema = GraphQLFieldMappingSchema;
16881
16909
  exports.GraphqlApiMappingFunction = GraphqlApiMappingFunction;
16882
16910
  exports.HTTP_REQUEST_SCHEMA = HTTP_REQUEST_SCHEMA;
16911
+ exports.HUB_INSTANCE_ID = HUB_INSTANCE_ID;
16883
16912
  exports.HandyScenarioTemplateElement = HandyScenarioTemplateElement;
16884
16913
  exports.HttpRequestSpec = HttpRequestSpec;
16885
16914
  exports.IncludeArchivedQuery = IncludeArchivedQuery;
@@ -16924,6 +16953,8 @@ exports.ListFlowInstancesForConnectionQuery = ListFlowInstancesForConnectionQuer
16924
16953
  exports.ListIncomingWebhooksQuery = ListIncomingWebhooksQuery;
16925
16954
  exports.ListMembraneInstancesQuery = ListMembraneInstancesQuery;
16926
16955
  exports.ListMembraneInstancesResponse = ListMembraneInstancesResponse;
16956
+ exports.ListOrgWorkspacesQuery = ListOrgWorkspacesQuery;
16957
+ exports.ListOrgWorkspacesResponse = ListOrgWorkspacesResponse;
16927
16958
  exports.ListPublicConnectorsQuery = ListPublicConnectorsQuery;
16928
16959
  exports.ListPublicPackagesQuery = ListPublicPackagesQuery;
16929
16960
  exports.ListWorkspacesQuery = ListWorkspacesQuery;
@@ -17158,11 +17189,14 @@ exports.isDataActionType = isDataActionType;
17158
17189
  exports.isDataLocationMethodSupported = isDataLocationMethodSupported;
17159
17190
  exports.isDeliveryMethodEnabled = isDeliveryMethodEnabled;
17160
17191
  exports.isFormula_internalDoNotUse = isFormula;
17192
+ exports.isHubInstanceId = isHubInstanceId;
17193
+ exports.isHubWorkspace = isHubWorkspace;
17161
17194
  exports.isMembraneError = isMembraneError;
17162
17195
  exports.isObject = isObject;
17163
17196
  exports.isPathUserEditable = isPathUserEditable;
17164
17197
  exports.isSameDataLocation = isSameDataLocation;
17165
17198
  exports.isSchemaEmpty = isSchemaEmpty;
17199
+ exports.isSelfHostedInstance = isSelfHostedInstance;
17166
17200
  exports.isStream = isStream;
17167
17201
  exports.isValidAlertType = isValidAlertType;
17168
17202
  exports.isValidLocator = isValidLocator;