@membranehq/sdk 0.15.6 → 0.17.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.
@@ -3521,36 +3521,78 @@ exports.WorkspaceElementDependencyType = void 0;
3521
3521
  WorkspaceElementDependencyType["Parent"] = "PARENT";
3522
3522
  })(exports.WorkspaceElementDependencyType || (exports.WorkspaceElementDependencyType = {}));
3523
3523
  const BaseWorkspaceElement = z.z.object({
3524
- id: z.z.string(),
3525
- name: z.z.string(),
3524
+ id: z.z.string().describe('Internal database ID of the element. Assigned by the API; unique per element.'),
3525
+ name: z.z.string().describe('Display name of the workspace element.'),
3526
3526
  });
3527
3527
  const BaseMembraneInterfaceEditableProperties = z.z.object({
3528
- uuid: z.z.string().optional(),
3529
- key: z.z.string().optional(),
3530
- name: z.z.string().optional(),
3531
- description: z.z.string().optional(),
3532
- meta: z.z.record(z.z.string(), z.z.any()).optional(),
3528
+ uuid: z.z
3529
+ .string()
3530
+ .optional()
3531
+ .describe('Stable unique identifier (UUID). Can be provided on create; otherwise generated. Must be unique across elements of this type.'),
3532
+ key: z.z
3533
+ .string()
3534
+ .optional()
3535
+ .describe('Stable key for referencing the element (e.g. in selectors). Unique per (parent, integration) scope. Generated from name if not provided on create.'),
3536
+ name: z.z.string().optional().describe('Display name. Optional on create; used to generate key when key is omitted.'),
3537
+ description: z.z.string().optional().describe('Optional human-readable description.'),
3538
+ meta: z.z.record(z.z.string(), z.z.any()).optional().describe('Optional key-value metadata.'),
3533
3539
  });
3534
3540
  const BaseMembraneInterfaceReadOnlyProperties = z.z.object({
3535
- name: z.z.string(),
3536
- state: z.z.enum(exports.WorkspaceElementState).optional(),
3537
- errors: z.z.array(ErrorDataSchema).optional(),
3538
- revision: z.z.string().optional(),
3539
- createdAt: z.z.string().optional(),
3540
- updatedAt: z.z.string().optional(),
3541
- archivedAt: z.z.string().optional(),
3542
- isDeactivated: z.z.boolean().optional(),
3543
- isReadOnly: z.z.boolean().optional(),
3541
+ name: z.z.string().describe('Display name. Always present in API responses (filled by API if not set on create).'),
3542
+ state: z.z
3543
+ .enum(exports.WorkspaceElementState)
3544
+ .optional()
3545
+ .describe('Current lifecycle or health state (e.g. READY, SETUP_FAILED, CONFIGURATION_ERROR). Set by the engine during setup and validation.'),
3546
+ errors: z.z.array(ErrorDataSchema).optional().describe('Validation or setup errors when state is not READY.'),
3547
+ revision: z.z
3548
+ .string()
3549
+ .optional()
3550
+ .describe('Opaque revision token; changes on each update. Used for optimistic concurrency.'),
3551
+ createdAt: z.z.string().optional().describe('ISO date when the element was created.'),
3552
+ updatedAt: z.z.string().optional().describe('ISO date when the element was last updated.'),
3553
+ archivedAt: z.z
3554
+ .string()
3555
+ .optional()
3556
+ .describe('When set, the element is archived (soft-deleted). Archived elements cannot be patched.'),
3557
+ isDeactivated: z.z
3558
+ .boolean()
3559
+ .optional()
3560
+ .describe('When true, setup is skipped and the element is treated as inactive (e.g. when dependencies are deactivated or the element is archived).'),
3561
+ isReadOnly: z.z
3562
+ .boolean()
3563
+ .optional()
3564
+ .describe('When true, the element cannot be modified (e.g. published package elements or elements from another workspace).'),
3544
3565
  });
3545
3566
  const BaseMembraneInterface = BaseWorkspaceElement.merge(BaseMembraneInterfaceEditableProperties).merge(BaseMembraneInterfaceReadOnlyProperties);
3546
3567
  const BaseIntegrationLevelMembraneInterfaceEditableProperties = BaseMembraneInterfaceEditableProperties.extend({
3547
- integrationId: z.z.string().optional(),
3548
- integrationUuid: z.z.string().optional(),
3549
- parentId: z.z.string().optional(),
3550
- parentUuid: z.z.string().optional(),
3551
- connectionId: z.z.string().optional(),
3552
- instanceKey: z.z.string().optional(),
3553
- isUniversal: z.z.boolean().optional(),
3568
+ integrationId: z.z
3569
+ .string()
3570
+ .optional()
3571
+ .describe('Internal ID of the integration this element belongs to. Omit for universal elements; set for integration-specific elements. Uniqueness of key is scoped per integration.'),
3572
+ integrationUuid: z.z
3573
+ .string()
3574
+ .optional()
3575
+ .describe('UUID of the integration; alternative to integrationId when creating from export. Resolved to integrationId by the API.'),
3576
+ parentId: z.z
3577
+ .string()
3578
+ .optional()
3579
+ .describe('Internal ID of the parent workspace element. Used for hierarchy (e.g. integration-level under universal). Child key uniqueness is scoped by parent and integration.'),
3580
+ parentUuid: z.z
3581
+ .string()
3582
+ .optional()
3583
+ .describe('UUID of the parent element; alternative to parentId when creating (e.g. from export). Resolved to parentId by the API.'),
3584
+ connectionId: z.z
3585
+ .string()
3586
+ .optional()
3587
+ .describe('Connection ID. Used when filtering by connection in list/selector queries, or when creating or identifying connection-level instances.'),
3588
+ instanceKey: z.z
3589
+ .string()
3590
+ .optional()
3591
+ .describe('Key identifying a specific connection-level instance when multiple instances exist per (element, connection). Used in selector queries and when creating instances.'),
3592
+ isUniversal: z.z
3593
+ .boolean()
3594
+ .optional()
3595
+ .describe('When true, the element is universal (shared across all integrations). Requires universal-element access. Omit or false for integration-specific elements.'),
3554
3596
  });
3555
3597
  const BaseIntegrationLevelMembraneInterfaceReadOnlyProperties = BaseMembraneInterfaceReadOnlyProperties.extend({
3556
3598
  isCustomized: z.z.boolean().optional(),
@@ -3846,24 +3888,52 @@ const ActionDependency = z.z.object({
3846
3888
  element: z.z.any().optional(),
3847
3889
  });
3848
3890
  const ActionSpecificProperties = z.z.object({
3849
- connectionId: z.z.string().optional(),
3850
- instanceKey: z.z.string().optional(),
3851
- inputSchema: DataSchema.optional(),
3852
- type: z.z.enum(exports.ActionType).optional(),
3853
- config: z.z.object({}).loose().optional(),
3854
- outputMapping: z.z.any().optional(),
3855
- customOutputSchema: DataSchema.optional(),
3891
+ connectionId: z.z
3892
+ .string()
3893
+ .optional()
3894
+ .describe('Connection ID for filtering or for connection-level instances. Same semantics as base integration-level property.'),
3895
+ instanceKey: z.z
3896
+ .string()
3897
+ .optional()
3898
+ .describe('Key for the connection-level instance when multiple exist per connection. Same semantics as base integration-level property.'),
3899
+ inputSchema: DataSchema.optional().describe('JSON Schema for the action input. Used by the action engine for template output schema, run-time variables, and output mapping.'),
3900
+ type: z.z
3901
+ .enum(exports.ActionType)
3902
+ .optional()
3903
+ .describe('Action type (e.g. ConnectorOperation, RunJavascript). Determines which handler runs and which config schema is used for validation.'),
3904
+ config: z.z
3905
+ .object({})
3906
+ .loose()
3907
+ .optional()
3908
+ .describe("Type-specific configuration object. Validated by the handler's config schema; passed to handler setup/run and getTemplateOutputSchema."),
3909
+ outputMapping: z.z
3910
+ .any()
3911
+ .optional()
3912
+ .describe("Mapping expression to transform the action's raw output. Evaluated with access to input, output, and user; used to compute transformed output schema and at run time."),
3913
+ customOutputSchema: DataSchema.optional().describe('Explicit output schema for the action. Takes precedence over the transformed or default output schema when resolving outputSchema.'),
3856
3914
  });
3857
- const ActionEditableProperties = BaseIntegrationLevelMembraneInterfaceEditableProperties.extend(ActionSpecificProperties.shape);
3915
+ const ActionEditableProperties = BaseIntegrationLevelMembraneInterfaceEditableProperties.extend(ActionSpecificProperties.shape).describe('Action editable properties: key, name, type, config, inputSchema, outputMapping, optional connectionId and instanceKey for connection-level instances.');
3858
3916
  const ActionExportProperties = BaseIntegrationLevelMembraneInterfaceExportProperties.extend(ActionSpecificProperties.shape).omit({
3859
3917
  connectionId: true,
3860
3918
  });
3861
3919
  const ActionReadOnlyProperties = BaseIntegrationLevelMembraneInterfaceReadOnlyProperties.extend({
3862
3920
  ...TenantLayerElement.partial().shape,
3863
- universalParentId: z.z.string().optional(),
3864
- outputSchema: z.z.any().optional(),
3865
- isPublic: z.z.boolean().optional(),
3866
- externalAppUuid: z.z.string().optional(),
3921
+ universalParentId: z.z
3922
+ .string()
3923
+ .optional()
3924
+ .describe('For connection-level instances: ID of the universal (root) action in the hierarchy. Set automatically when creating an instance; used in list/selector queries to filter by universal parent.'),
3925
+ outputSchema: z.z
3926
+ .any()
3927
+ .optional()
3928
+ .describe('Resolved output schema (cached after setup). Derived from customOutputSchema, transformed schema from outputMapping, default output schema, or parent custom output schema. Read-only.'),
3929
+ isPublic: z.z
3930
+ .boolean()
3931
+ .optional()
3932
+ .describe('When true, the element is publicly listed (e.g. in universe). Used for published packages; publish/unpublish updates this on published elements.'),
3933
+ externalAppUuid: z.z
3934
+ .string()
3935
+ .optional()
3936
+ .describe('UUID of the external app when this action is published in a package that has an external app. Populated in API responses for published actions.'),
3867
3937
  });
3868
3938
  const BaseAction = BaseMembraneInterface.merge(ActionEditableProperties).merge(ActionReadOnlyProperties);
3869
3939
  const BaseActionInstance = BaseAction;
@@ -10188,7 +10258,7 @@ const CreateConnectionRequest = ConnectionEditableProperties.extend({
10188
10258
  externalAppId: z.z.string().optional(),
10189
10259
  });
10190
10260
  const UpdateConnectionRequest = ConnectionEditableProperties;
10191
- const ConnectionExport = ConnectionEditableProperties.omit({
10261
+ const ConnectionExportProperties = ConnectionEditableProperties.omit({
10192
10262
  credentials: true,
10193
10263
  connectorParameters: true,
10194
10264
  input: true,
@@ -10268,7 +10338,9 @@ const ConnectPayload = z.z.object({
10268
10338
  redirectUri: z.z.string().optional(),
10269
10339
  customState: z.z.string().optional(),
10270
10340
  });
10271
- const ConnectUIOptions = ConnectPayload.omit({ input: true, redirectUri: true });
10341
+ const ConnectUIOptions = ConnectPayload.omit({ input: true, redirectUri: true }).extend({
10342
+ theme: z.z.enum(['light', 'dark', 'auto']).optional(),
10343
+ });
10272
10344
 
10273
10345
  const ListPublicConnectorsQuery = PaginationQuery.extend({
10274
10346
  search: z.z.string().optional(),
@@ -11273,6 +11345,11 @@ function hasCycles(nodes) {
11273
11345
  return hasCycles;
11274
11346
  }
11275
11347
 
11348
+ function getSchemaDescription(schema) {
11349
+ const json = z.z.toJSONSchema(schema);
11350
+ return json.description;
11351
+ }
11352
+
11276
11353
  function addUndefinedWriteableProperties(value, schema) {
11277
11354
  if (!(schema instanceof z.z.ZodObject)) {
11278
11355
  return value;
@@ -11481,6 +11558,7 @@ const WorkspaceElementSpecs = {
11481
11558
  apiPath: 'connections',
11482
11559
  name: 'Connection',
11483
11560
  namePlural: 'Connections',
11561
+ exportPropertiesSchema: ConnectionExportProperties,
11484
11562
  hasKey: false,
11485
11563
  hasUuid: false,
11486
11564
  },
@@ -11556,6 +11634,7 @@ const WorkspaceElementSpecs = {
11556
11634
  namePlural: 'Flows',
11557
11635
  parentFieldKey: 'flowId',
11558
11636
  universalParentFieldKey: 'universalFlowId',
11637
+ exportPropertiesSchema: FlowExportProperties,
11559
11638
  isMembraneInterface: true,
11560
11639
  isProOnly: true,
11561
11640
  },
@@ -14926,6 +15005,9 @@ class ExternalEventSubscriptionAccessor {
14926
15005
  async resubscribe() {
14927
15006
  await this.client.post(this.getPath('resubscribe'));
14928
15007
  }
15008
+ async refreshWebhook() {
15009
+ await this.client.post(this.getPath('refresh-webhook'));
15010
+ }
14929
15011
  async pullEvents() {
14930
15012
  await this.client.post(this.getPath('pull-events'));
14931
15013
  }
@@ -15075,6 +15157,31 @@ const AsyncRequestTriggerResponse = z.z.object({
15075
15157
  accessKey: z.z.string(),
15076
15158
  });
15077
15159
 
15160
+ const SelfHostingToken = z.z.object({
15161
+ id: z.z.string(),
15162
+ name: z.z.string(),
15163
+ orgId: z.z.string(),
15164
+ tokenPrefix: z.z.string(),
15165
+ createdAt: z.z.coerce.date(),
15166
+ updatedAt: z.z.coerce.date(),
15167
+ lastUsedAt: z.z.coerce.date().optional(),
15168
+ });
15169
+ const CreateSelfHostingTokenRequest = z.z.object({
15170
+ name: z.z.string().min(1).max(100),
15171
+ });
15172
+ const CreateSelfHostingTokenResponse = SelfHostingToken.extend({
15173
+ token: z.z.string(),
15174
+ });
15175
+ const UpdateSelfHostingTokenRequest = z.z.object({
15176
+ name: z.z.string().min(1).max(100),
15177
+ });
15178
+ const ValidateSelfHostingTokenRequest = z.z.object({});
15179
+ const ValidateSelfHostingTokenResponse = z.z.object({
15180
+ valid: z.z.boolean(),
15181
+ orgId: z.z.string().optional(),
15182
+ orgName: z.z.string().optional(),
15183
+ });
15184
+
15078
15185
  const CONSOLE_ACCOUNT_API_TOKEN_PATH = 'settings/account/api-token';
15079
15186
 
15080
15187
  class UI {
@@ -15137,7 +15244,7 @@ function decodeJWT(token) {
15137
15244
  const axiosGlobal = ((axiosOriginal === null || axiosOriginal === void 0 ? void 0 : axiosOriginal.default) || axiosOriginal);
15138
15245
  const axios = axiosGlobal.create();
15139
15246
  const DEFAULT_API_URI = 'https://api.getmembrane.com';
15140
- const DEFAULT_UI_URI = 'https://console.getmembrane.com';
15247
+ const DEFAULT_UI_URI = 'https://ui.getmembrane.com';
15141
15248
  const membraneClientOptionsSchema = z.z
15142
15249
  .object({
15143
15250
  token: z.z.string().nullish(),
@@ -15808,7 +15915,7 @@ exports.ConnectionApiResponseWithSecrets = ConnectionApiResponseWithSecrets;
15808
15915
  exports.ConnectionDataCollectionAccessor = ConnectionDataCollectionAccessor;
15809
15916
  exports.ConnectionEditableProperties = ConnectionEditableProperties;
15810
15917
  exports.ConnectionError = ConnectionError;
15811
- exports.ConnectionExport = ConnectionExport;
15918
+ exports.ConnectionExportProperties = ConnectionExportProperties;
15812
15919
  exports.ConnectionLevelActionAccessor = ConnectionLevelActionAccessor;
15813
15920
  exports.ConnectionLevelActionsAccessor = ConnectionLevelActionsAccessor;
15814
15921
  exports.ConnectionLevelDataSourceAccessor = ConnectionLevelDataSourceAccessor;
@@ -15886,6 +15993,8 @@ exports.CreateOrgRequest = CreateOrgRequest;
15886
15993
  exports.CreateOrgUserRequest = CreateOrgUserRequest;
15887
15994
  exports.CreatePackageRequest = CreatePackageRequest;
15888
15995
  exports.CreateScreenRequest = CreateScreenRequest;
15996
+ exports.CreateSelfHostingTokenRequest = CreateSelfHostingTokenRequest;
15997
+ exports.CreateSelfHostingTokenResponse = CreateSelfHostingTokenResponse;
15889
15998
  exports.CustomCodeError = CustomCodeError;
15890
15999
  exports.CustomerAccessor = CustomerAccessor;
15891
16000
  exports.CustomerApiResponse = CustomerApiResponse;
@@ -16172,6 +16281,7 @@ exports.ScreenSelector = ScreenSelector;
16172
16281
  exports.ScreensAccessor = ScreensAccessor;
16173
16282
  exports.SearchQuery = SearchQuery;
16174
16283
  exports.SelfAccessor = SelfAccessor;
16284
+ exports.SelfHostingToken = SelfHostingToken;
16175
16285
  exports.StatsFilterQuery = StatsFilterQuery;
16176
16286
  exports.TenantLayerElement = TenantLayerElement;
16177
16287
  exports.UNIFIED_DATA_MODELS = UNIFIED_DATA_MODELS;
@@ -16193,9 +16303,12 @@ exports.UpdateOrgRequest = UpdateOrgRequest;
16193
16303
  exports.UpdateOrgUserRequest = UpdateOrgUserRequest;
16194
16304
  exports.UpdatePackageRequest = UpdatePackageRequest;
16195
16305
  exports.UpdateScreenRequest = UpdateScreenRequest;
16306
+ exports.UpdateSelfHostingTokenRequest = UpdateSelfHostingTokenRequest;
16196
16307
  exports.UpstreamFlowNodeRunSchema = UpstreamFlowNodeRunSchema;
16197
16308
  exports.UserAccessor = UserAccessor;
16198
16309
  exports.UsersAccessor = UsersAccessor;
16310
+ exports.ValidateSelfHostingTokenRequest = ValidateSelfHostingTokenRequest;
16311
+ exports.ValidateSelfHostingTokenResponse = ValidateSelfHostingTokenResponse;
16199
16312
  exports.WORKSPACE_ELEMENTS_STATS_COLLECTIONS = WORKSPACE_ELEMENTS_STATS_COLLECTIONS;
16200
16313
  exports.WORKSPACE_SIZE_LIMITS = WORKSPACE_SIZE_LIMITS;
16201
16314
  exports.Workspace = Workspace;
@@ -16291,6 +16404,7 @@ exports.getReferenceCollectionPointerForSchema = getReferenceCollectionPointerFo
16291
16404
  exports.getRequiredFieldsFromSchema = getRequiredFieldsFromSchema;
16292
16405
  exports.getRootNodeKeys = getRootNodeKeys;
16293
16406
  exports.getSchemaByLocator = getSchemaByLocator;
16407
+ exports.getSchemaDescription = getSchemaDescription;
16294
16408
  exports.getSchemaFromValue = getSchemaFromValue;
16295
16409
  exports.getUpstreamNodeKeys = getUpstreamNodeKeys;
16296
16410
  exports.getValueAtLocator = getValueAtLocator;