@membranehq/sdk 0.15.6 → 0.16.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.
@@ -3497,36 +3497,78 @@ exports.WorkspaceElementDependencyType = void 0;
3497
3497
  WorkspaceElementDependencyType["Parent"] = "PARENT";
3498
3498
  })(exports.WorkspaceElementDependencyType || (exports.WorkspaceElementDependencyType = {}));
3499
3499
  const BaseWorkspaceElement = z.z.object({
3500
- id: z.z.string(),
3501
- name: z.z.string(),
3500
+ id: z.z.string().describe('Internal database ID of the element. Assigned by the API; unique per element.'),
3501
+ name: z.z.string().describe('Display name of the workspace element.'),
3502
3502
  });
3503
3503
  const BaseMembraneInterfaceEditableProperties = z.z.object({
3504
- uuid: z.z.string().optional(),
3505
- key: z.z.string().optional(),
3506
- name: z.z.string().optional(),
3507
- description: z.z.string().optional(),
3508
- meta: z.z.record(z.z.string(), z.z.any()).optional(),
3504
+ uuid: z.z
3505
+ .string()
3506
+ .optional()
3507
+ .describe('Stable unique identifier (UUID). Can be provided on create; otherwise generated. Must be unique across elements of this type.'),
3508
+ key: z.z
3509
+ .string()
3510
+ .optional()
3511
+ .describe('Stable key for referencing the element (e.g. in selectors). Unique per (parent, integration) scope. Generated from name if not provided on create.'),
3512
+ name: z.z.string().optional().describe('Display name. Optional on create; used to generate key when key is omitted.'),
3513
+ description: z.z.string().optional().describe('Optional human-readable description.'),
3514
+ meta: z.z.record(z.z.string(), z.z.any()).optional().describe('Optional key-value metadata.'),
3509
3515
  });
3510
3516
  const BaseMembraneInterfaceReadOnlyProperties = z.z.object({
3511
- name: z.z.string(),
3512
- state: z.z.enum(exports.WorkspaceElementState).optional(),
3513
- errors: z.z.array(ErrorDataSchema).optional(),
3514
- revision: z.z.string().optional(),
3515
- createdAt: z.z.string().optional(),
3516
- updatedAt: z.z.string().optional(),
3517
- archivedAt: z.z.string().optional(),
3518
- isDeactivated: z.z.boolean().optional(),
3519
- isReadOnly: z.z.boolean().optional(),
3517
+ name: z.z.string().describe('Display name. Always present in API responses (filled by API if not set on create).'),
3518
+ state: z.z
3519
+ .enum(exports.WorkspaceElementState)
3520
+ .optional()
3521
+ .describe('Current lifecycle or health state (e.g. READY, SETUP_FAILED, CONFIGURATION_ERROR). Set by the engine during setup and validation.'),
3522
+ errors: z.z.array(ErrorDataSchema).optional().describe('Validation or setup errors when state is not READY.'),
3523
+ revision: z.z
3524
+ .string()
3525
+ .optional()
3526
+ .describe('Opaque revision token; changes on each update. Used for optimistic concurrency.'),
3527
+ createdAt: z.z.string().optional().describe('ISO date when the element was created.'),
3528
+ updatedAt: z.z.string().optional().describe('ISO date when the element was last updated.'),
3529
+ archivedAt: z.z
3530
+ .string()
3531
+ .optional()
3532
+ .describe('When set, the element is archived (soft-deleted). Archived elements cannot be patched.'),
3533
+ isDeactivated: z.z
3534
+ .boolean()
3535
+ .optional()
3536
+ .describe('When true, setup is skipped and the element is treated as inactive (e.g. when dependencies are deactivated or the element is archived).'),
3537
+ isReadOnly: z.z
3538
+ .boolean()
3539
+ .optional()
3540
+ .describe('When true, the element cannot be modified (e.g. published package elements or elements from another workspace).'),
3520
3541
  });
3521
3542
  const BaseMembraneInterface = BaseWorkspaceElement.merge(BaseMembraneInterfaceEditableProperties).merge(BaseMembraneInterfaceReadOnlyProperties);
3522
3543
  const BaseIntegrationLevelMembraneInterfaceEditableProperties = BaseMembraneInterfaceEditableProperties.extend({
3523
- integrationId: z.z.string().optional(),
3524
- integrationUuid: z.z.string().optional(),
3525
- parentId: z.z.string().optional(),
3526
- parentUuid: z.z.string().optional(),
3527
- connectionId: z.z.string().optional(),
3528
- instanceKey: z.z.string().optional(),
3529
- isUniversal: z.z.boolean().optional(),
3544
+ integrationId: z.z
3545
+ .string()
3546
+ .optional()
3547
+ .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.'),
3548
+ integrationUuid: z.z
3549
+ .string()
3550
+ .optional()
3551
+ .describe('UUID of the integration; alternative to integrationId when creating from export. Resolved to integrationId by the API.'),
3552
+ parentId: z.z
3553
+ .string()
3554
+ .optional()
3555
+ .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.'),
3556
+ parentUuid: z.z
3557
+ .string()
3558
+ .optional()
3559
+ .describe('UUID of the parent element; alternative to parentId when creating (e.g. from export). Resolved to parentId by the API.'),
3560
+ connectionId: z.z
3561
+ .string()
3562
+ .optional()
3563
+ .describe('Connection ID. Used when filtering by connection in list/selector queries, or when creating or identifying connection-level instances.'),
3564
+ instanceKey: z.z
3565
+ .string()
3566
+ .optional()
3567
+ .describe('Key identifying a specific connection-level instance when multiple instances exist per (element, connection). Used in selector queries and when creating instances.'),
3568
+ isUniversal: z.z
3569
+ .boolean()
3570
+ .optional()
3571
+ .describe('When true, the element is universal (shared across all integrations). Requires universal-element access. Omit or false for integration-specific elements.'),
3530
3572
  });
3531
3573
  const BaseIntegrationLevelMembraneInterfaceReadOnlyProperties = BaseMembraneInterfaceReadOnlyProperties.extend({
3532
3574
  isCustomized: z.z.boolean().optional(),
@@ -3822,24 +3864,52 @@ const ActionDependency = z.z.object({
3822
3864
  element: z.z.any().optional(),
3823
3865
  });
3824
3866
  const ActionSpecificProperties = z.z.object({
3825
- connectionId: z.z.string().optional(),
3826
- instanceKey: z.z.string().optional(),
3827
- inputSchema: DataSchema.optional(),
3828
- type: z.z.enum(exports.ActionType).optional(),
3829
- config: z.z.object({}).loose().optional(),
3830
- outputMapping: z.z.any().optional(),
3831
- customOutputSchema: DataSchema.optional(),
3867
+ connectionId: z.z
3868
+ .string()
3869
+ .optional()
3870
+ .describe('Connection ID for filtering or for connection-level instances. Same semantics as base integration-level property.'),
3871
+ instanceKey: z.z
3872
+ .string()
3873
+ .optional()
3874
+ .describe('Key for the connection-level instance when multiple exist per connection. Same semantics as base integration-level property.'),
3875
+ 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.'),
3876
+ type: z.z
3877
+ .enum(exports.ActionType)
3878
+ .optional()
3879
+ .describe('Action type (e.g. ConnectorOperation, RunJavascript). Determines which handler runs and which config schema is used for validation.'),
3880
+ config: z.z
3881
+ .object({})
3882
+ .loose()
3883
+ .optional()
3884
+ .describe("Type-specific configuration object. Validated by the handler's config schema; passed to handler setup/run and getTemplateOutputSchema."),
3885
+ outputMapping: z.z
3886
+ .any()
3887
+ .optional()
3888
+ .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."),
3889
+ customOutputSchema: DataSchema.optional().describe('Explicit output schema for the action. Takes precedence over the transformed or default output schema when resolving outputSchema.'),
3832
3890
  });
3833
- const ActionEditableProperties = BaseIntegrationLevelMembraneInterfaceEditableProperties.extend(ActionSpecificProperties.shape);
3891
+ const ActionEditableProperties = BaseIntegrationLevelMembraneInterfaceEditableProperties.extend(ActionSpecificProperties.shape).describe('Action editable properties: key, name, type, config, inputSchema, outputMapping, optional connectionId and instanceKey for connection-level instances.');
3834
3892
  const ActionExportProperties = BaseIntegrationLevelMembraneInterfaceExportProperties.extend(ActionSpecificProperties.shape).omit({
3835
3893
  connectionId: true,
3836
3894
  });
3837
3895
  const ActionReadOnlyProperties = BaseIntegrationLevelMembraneInterfaceReadOnlyProperties.extend({
3838
3896
  ...TenantLayerElement.partial().shape,
3839
- universalParentId: z.z.string().optional(),
3840
- outputSchema: z.z.any().optional(),
3841
- isPublic: z.z.boolean().optional(),
3842
- externalAppUuid: z.z.string().optional(),
3897
+ universalParentId: z.z
3898
+ .string()
3899
+ .optional()
3900
+ .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.'),
3901
+ outputSchema: z.z
3902
+ .any()
3903
+ .optional()
3904
+ .describe('Resolved output schema (cached after setup). Derived from customOutputSchema, transformed schema from outputMapping, default output schema, or parent custom output schema. Read-only.'),
3905
+ isPublic: z.z
3906
+ .boolean()
3907
+ .optional()
3908
+ .describe('When true, the element is publicly listed (e.g. in universe). Used for published packages; publish/unpublish updates this on published elements.'),
3909
+ externalAppUuid: z.z
3910
+ .string()
3911
+ .optional()
3912
+ .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.'),
3843
3913
  });
3844
3914
  const BaseAction = BaseMembraneInterface.merge(ActionEditableProperties).merge(ActionReadOnlyProperties);
3845
3915
  const BaseActionInstance = BaseAction;
@@ -10244,7 +10314,9 @@ const ConnectPayload = z.z.object({
10244
10314
  redirectUri: z.z.string().optional(),
10245
10315
  customState: z.z.string().optional(),
10246
10316
  });
10247
- const ConnectUIOptions = ConnectPayload.omit({ input: true, redirectUri: true });
10317
+ const ConnectUIOptions = ConnectPayload.omit({ input: true, redirectUri: true }).extend({
10318
+ theme: z.z.enum(['light', 'dark', 'auto']).optional(),
10319
+ });
10248
10320
 
10249
10321
  const ListPublicConnectorsQuery = PaginationQuery.extend({
10250
10322
  search: z.z.string().optional(),
@@ -11249,6 +11321,11 @@ function hasCycles(nodes) {
11249
11321
  return hasCycles;
11250
11322
  }
11251
11323
 
11324
+ function getSchemaDescription(schema) {
11325
+ const json = z.z.toJSONSchema(schema);
11326
+ return json.description;
11327
+ }
11328
+
11252
11329
  function addUndefinedWriteableProperties(value, schema) {
11253
11330
  if (!(schema instanceof z.z.ZodObject)) {
11254
11331
  return value;
@@ -15051,6 +15128,31 @@ const AsyncRequestTriggerResponse = z.z.object({
15051
15128
  accessKey: z.z.string(),
15052
15129
  });
15053
15130
 
15131
+ const SelfHostingToken = z.z.object({
15132
+ id: z.z.string(),
15133
+ name: z.z.string(),
15134
+ orgId: z.z.string(),
15135
+ tokenPrefix: z.z.string(),
15136
+ createdAt: z.z.coerce.date(),
15137
+ updatedAt: z.z.coerce.date(),
15138
+ lastUsedAt: z.z.coerce.date().optional(),
15139
+ });
15140
+ const CreateSelfHostingTokenRequest = z.z.object({
15141
+ name: z.z.string().min(1).max(100),
15142
+ });
15143
+ const CreateSelfHostingTokenResponse = SelfHostingToken.extend({
15144
+ token: z.z.string(),
15145
+ });
15146
+ const UpdateSelfHostingTokenRequest = z.z.object({
15147
+ name: z.z.string().min(1).max(100),
15148
+ });
15149
+ const ValidateSelfHostingTokenRequest = z.z.object({});
15150
+ const ValidateSelfHostingTokenResponse = z.z.object({
15151
+ valid: z.z.boolean(),
15152
+ orgId: z.z.string().optional(),
15153
+ orgName: z.z.string().optional(),
15154
+ });
15155
+
15054
15156
  const CONSOLE_ACCOUNT_API_TOKEN_PATH = 'settings/account/api-token';
15055
15157
 
15056
15158
  class UI {
@@ -15681,6 +15783,8 @@ exports.CreateOrgRequest = CreateOrgRequest;
15681
15783
  exports.CreateOrgUserRequest = CreateOrgUserRequest;
15682
15784
  exports.CreatePackageRequest = CreatePackageRequest;
15683
15785
  exports.CreateScreenRequest = CreateScreenRequest;
15786
+ exports.CreateSelfHostingTokenRequest = CreateSelfHostingTokenRequest;
15787
+ exports.CreateSelfHostingTokenResponse = CreateSelfHostingTokenResponse;
15684
15788
  exports.CustomCodeError = CustomCodeError;
15685
15789
  exports.CustomerAccessor = CustomerAccessor;
15686
15790
  exports.CustomerApiResponse = CustomerApiResponse;
@@ -15966,6 +16070,7 @@ exports.ScreenSelector = ScreenSelector;
15966
16070
  exports.ScreensAccessor = ScreensAccessor;
15967
16071
  exports.SearchQuery = SearchQuery;
15968
16072
  exports.SelfAccessor = SelfAccessor;
16073
+ exports.SelfHostingToken = SelfHostingToken;
15969
16074
  exports.StatsFilterQuery = StatsFilterQuery;
15970
16075
  exports.TenantLayerElement = TenantLayerElement;
15971
16076
  exports.UNIFIED_DATA_MODELS = UNIFIED_DATA_MODELS;
@@ -15987,9 +16092,12 @@ exports.UpdateOrgRequest = UpdateOrgRequest;
15987
16092
  exports.UpdateOrgUserRequest = UpdateOrgUserRequest;
15988
16093
  exports.UpdatePackageRequest = UpdatePackageRequest;
15989
16094
  exports.UpdateScreenRequest = UpdateScreenRequest;
16095
+ exports.UpdateSelfHostingTokenRequest = UpdateSelfHostingTokenRequest;
15990
16096
  exports.UpstreamFlowNodeRunSchema = UpstreamFlowNodeRunSchema;
15991
16097
  exports.UserAccessor = UserAccessor;
15992
16098
  exports.UsersAccessor = UsersAccessor;
16099
+ exports.ValidateSelfHostingTokenRequest = ValidateSelfHostingTokenRequest;
16100
+ exports.ValidateSelfHostingTokenResponse = ValidateSelfHostingTokenResponse;
15993
16101
  exports.WORKSPACE_ELEMENTS_STATS_COLLECTIONS = WORKSPACE_ELEMENTS_STATS_COLLECTIONS;
15994
16102
  exports.WORKSPACE_SIZE_LIMITS = WORKSPACE_SIZE_LIMITS;
15995
16103
  exports.Workspace = Workspace;
@@ -16084,6 +16192,7 @@ exports.getReferenceCollectionPointerForSchema = getReferenceCollectionPointerFo
16084
16192
  exports.getRequiredFieldsFromSchema = getRequiredFieldsFromSchema;
16085
16193
  exports.getRootNodeKeys = getRootNodeKeys;
16086
16194
  exports.getSchemaByLocator = getSchemaByLocator;
16195
+ exports.getSchemaDescription = getSchemaDescription;
16087
16196
  exports.getSchemaFromValue = getSchemaFromValue;
16088
16197
  exports.getUpstreamNodeKeys = getUpstreamNodeKeys;
16089
16198
  exports.getValueAtLocator = getValueAtLocator;