@membranehq/sdk 0.17.3 → 0.17.4

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.
Files changed (33) hide show
  1. package/dist/bundle.d.ts +12 -4
  2. package/dist/bundle.js +5 -2
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/dts/clusters/types.d.ts +19 -0
  5. package/dist/dts/index.browser.d.ts +2 -0
  6. package/dist/dts/pending-tasks/index.d.ts +1 -0
  7. package/dist/dts/pending-tasks/types.d.ts +48 -0
  8. package/dist/dts/stats/index.d.ts +3 -3
  9. package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +15 -6
  10. package/dist/dts/workspace-elements/api/app-event-log-records-api.d.ts +2 -2
  11. package/dist/dts/workspace-elements/api/external-api-logs-api.d.ts +2 -2
  12. package/dist/dts/workspace-elements/api/external-event-log-records-api.d.ts +2 -1
  13. package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +2 -1
  14. package/dist/dts/workspace-elements/api/external-events-api.d.ts +2 -1
  15. package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +12 -4
  16. package/dist/dts/workspace-elements/api/incoming-webhooks-api.d.ts +2 -1
  17. package/dist/dts/workspace-elements/base/action-run-log-records/index.d.ts +5 -2
  18. package/dist/dts/workspace-elements/base/external-events/api.d.ts +4 -2
  19. package/dist/dts/workspace-elements/base/flow-runs/index.d.ts +4 -1
  20. package/dist/dts/workspace-elements/filter-meta.d.ts +2 -0
  21. package/dist/index.browser.d.mts +122 -26
  22. package/dist/index.browser.d.ts +122 -26
  23. package/dist/index.browser.js +146 -43
  24. package/dist/index.browser.js.map +1 -1
  25. package/dist/index.browser.mjs +141 -44
  26. package/dist/index.browser.mjs.map +1 -1
  27. package/dist/index.node.d.mts +122 -26
  28. package/dist/index.node.d.ts +122 -26
  29. package/dist/index.node.js +146 -43
  30. package/dist/index.node.js.map +1 -1
  31. package/dist/index.node.mjs +141 -44
  32. package/dist/index.node.mjs.map +1 -1
  33. package/package.json +1 -1
@@ -3749,7 +3749,7 @@ const FieldMappingSpecificProperties = z.z.object({
3749
3749
  universalFieldMappingId: z.z.string().optional(),
3750
3750
  dataSourceId: z.z.string().optional(),
3751
3751
  dataSourceUuid: z.z.string().optional(),
3752
- dataSourceKey: z.z.string().optional(),
3752
+ dataSourceKey: z.z.string().optional().describe('[INTERNAL] Deprecated: Use dataSourceId instead'),
3753
3753
  appSchema: DataSchema.optional(),
3754
3754
  direction: z.z.enum(exports.FieldMappingDirection).optional(),
3755
3755
  defaultImportValue: z.z.any().optional(),
@@ -9386,8 +9386,11 @@ const FlowRunNode = z.z.object({
9386
9386
  });
9387
9387
  const BaseFlowRun = ActivityLogRecord.extend({
9388
9388
  name: z.z.string().optional(),
9389
- flowInstanceId: z.z.string(),
9389
+ connectionFlowId: z.z.string(),
9390
+ integrationFlowId: z.z.string().optional(),
9390
9391
  universalFlowId: z.z.string().optional(),
9392
+ flowInstanceId: z.z.string().optional().describe('[INTERNAL] Deprecated: Use connectionFlowId instead'),
9393
+ flowId: z.z.string().optional().describe('[INTERNAL] Deprecated: Use integrationFlowId instead'),
9391
9394
  startNodeKey: z.z.string(),
9392
9395
  input: z.z.any().optional(),
9393
9396
  state: z.z.enum(exports.FlowRunState),
@@ -10132,8 +10135,11 @@ exports.ActionRunLogStatus = void 0;
10132
10135
  })(exports.ActionRunLogStatus || (exports.ActionRunLogStatus = {}));
10133
10136
  const BaseActionRunLogRecord = ActivityLogRecord.extend({
10134
10137
  name: z.z.string(),
10135
- actionId: z.z.string(),
10136
- actionInstanceId: z.z.string(),
10138
+ universalActionId: z.z.string().optional(),
10139
+ integrationActionId: z.z.string(),
10140
+ connectionActionId: z.z.string().optional(),
10141
+ actionId: z.z.string().optional().describe('[INTERNAL] Deprecated: Use integrationActionId instead'),
10142
+ actionInstanceId: z.z.string().optional().describe('[INTERNAL] Deprecated: Use connectionActionId instead'),
10137
10143
  integrationId: z.z.string(),
10138
10144
  connectionId: z.z.string(),
10139
10145
  input: z.z.any().optional(),
@@ -10229,20 +10235,17 @@ const ActionRunLogRecordApiResponse = BaseActionRunLogRecord.extend({
10229
10235
  user: BaseCustomer.optional(),
10230
10236
  });
10231
10237
  const FindActionRunLogsQuery = PaginationQuery.extend({
10232
- actionInstanceId: z.z
10233
- .string()
10234
- .optional()
10235
- .meta({
10236
- filterTitle: 'Action Instance',
10237
- referenceElementType: exports.WorkspaceElementType.ActionInstance,
10238
- }),
10239
10238
  actionId: z.z
10240
10239
  .string()
10241
10240
  .optional()
10242
10241
  .meta({
10243
10242
  filterTitle: 'Action',
10244
10243
  referenceElementType: exports.WorkspaceElementType.Action,
10244
+ useWorkspaceSearch: true,
10245
10245
  }),
10246
+ universalActionId: z.z.string().optional().meta({ hidden: true }),
10247
+ integrationActionId: z.z.string().optional().meta({ hidden: true }),
10248
+ connectionActionId: z.z.string().optional().meta({ hidden: true }),
10246
10249
  integrationId: z.z
10247
10250
  .string()
10248
10251
  .optional()
@@ -10273,8 +10276,19 @@ const FindActionRunLogsQuery = PaginationQuery.extend({
10273
10276
  .meta({
10274
10277
  filterTitle: 'Status',
10275
10278
  }),
10276
- startedAfter: z.z.string().optional().meta({
10277
- hidden: true,
10279
+ from: z.z
10280
+ .string()
10281
+ .optional()
10282
+ .meta({
10283
+ filterTitle: 'From',
10284
+ isDatetime: true,
10285
+ }),
10286
+ to: z.z
10287
+ .string()
10288
+ .optional()
10289
+ .meta({
10290
+ filterTitle: 'To',
10291
+ isDatetime: true,
10278
10292
  }),
10279
10293
  });
10280
10294
  const FindActionRunLogsResponse = createPaginationResponseSchema(ActionRunLogRecordApiResponse);
@@ -10558,23 +10572,17 @@ const CreateFlowRunRequest = z.z.object({
10558
10572
  meta: z.z.record(z.z.string(), z.z.any()).optional(),
10559
10573
  });
10560
10574
  const FindFlowRunsQuery = PaginationQuery.extend({
10561
- flowInstanceId: z.z
10562
- .string()
10563
- .optional()
10564
- .meta({
10565
- filterTitle: 'Flow Instance',
10566
- referenceElementType: exports.WorkspaceElementType.FlowInstance,
10567
- }),
10568
10575
  flowId: z.z
10569
10576
  .string()
10570
10577
  .optional()
10571
10578
  .meta({
10572
10579
  filterTitle: 'Flow',
10573
10580
  referenceElementType: exports.WorkspaceElementType.Flow,
10581
+ useWorkspaceSearch: true,
10574
10582
  }),
10575
- universalFlowId: z.z.string().optional().meta({
10576
- hidden: true,
10577
- }),
10583
+ universalFlowId: z.z.string().optional().meta({ hidden: true }),
10584
+ integrationFlowId: z.z.string().optional().meta({ hidden: true }),
10585
+ connectionFlowId: z.z.string().optional().meta({ hidden: true }),
10578
10586
  tenantId: z.z
10579
10587
  .string()
10580
10588
  .optional()
@@ -10605,8 +10613,19 @@ const FindFlowRunsQuery = PaginationQuery.extend({
10605
10613
  filterTitle: 'Connection',
10606
10614
  referenceElementType: exports.WorkspaceElementType.Connection,
10607
10615
  }),
10608
- startedAfter: z.z.string().optional().meta({
10609
- hidden: true,
10616
+ from: z.z
10617
+ .string()
10618
+ .optional()
10619
+ .meta({
10620
+ filterTitle: 'From',
10621
+ isDatetime: true,
10622
+ }),
10623
+ to: z.z
10624
+ .string()
10625
+ .optional()
10626
+ .meta({
10627
+ filterTitle: 'To',
10628
+ isDatetime: true,
10610
10629
  }),
10611
10630
  });
10612
10631
  const FlowRunLaunchedByApi = z.z.object({
@@ -11027,8 +11046,19 @@ const ListExternalEventLogRecordsQuery = PaginationQuery.extend({
11027
11046
  .meta({
11028
11047
  filterTitle: 'Status',
11029
11048
  }),
11030
- startedAfter: z.z.string().optional().meta({
11031
- hidden: true,
11049
+ from: z.z
11050
+ .string()
11051
+ .optional()
11052
+ .meta({
11053
+ filterTitle: 'From',
11054
+ isDatetime: true,
11055
+ }),
11056
+ to: z.z
11057
+ .string()
11058
+ .optional()
11059
+ .meta({
11060
+ filterTitle: 'To',
11061
+ isDatetime: true,
11032
11062
  }),
11033
11063
  });
11034
11064
  const ExternalEventLogRecordApiResponse = BaseExternalEventLogRecord.extend({
@@ -11105,8 +11135,19 @@ const FindExternalEventPullsQuery = PaginationQuery.extend({
11105
11135
  .meta({
11106
11136
  filterTitle: 'Status',
11107
11137
  }),
11108
- startedAfter: z.z.string().optional().meta({
11109
- hidden: true,
11138
+ from: z.z
11139
+ .string()
11140
+ .optional()
11141
+ .meta({
11142
+ filterTitle: 'From',
11143
+ isDatetime: true,
11144
+ }),
11145
+ to: z.z
11146
+ .string()
11147
+ .optional()
11148
+ .meta({
11149
+ filterTitle: 'To',
11150
+ isDatetime: true,
11110
11151
  }),
11111
11152
  });
11112
11153
  const ExternalEventPullApiResponse = BaseExternalEventPull.extend({
@@ -11166,11 +11207,19 @@ const ListAppEventLogRecordsQuery = CommonListElementsQuery.extend({
11166
11207
  filterTitle: 'Event Type',
11167
11208
  referenceElementType: exports.WorkspaceElementType.AppEventType,
11168
11209
  }),
11169
- startDatetime: z.z.string().optional().meta({
11170
- hidden: true,
11210
+ from: z.z
11211
+ .string()
11212
+ .optional()
11213
+ .meta({
11214
+ filterTitle: 'From',
11215
+ isDatetime: true,
11171
11216
  }),
11172
- endDatetime: z.z.string().optional().meta({
11173
- hidden: true,
11217
+ to: z.z
11218
+ .string()
11219
+ .optional()
11220
+ .meta({
11221
+ filterTitle: 'To',
11222
+ isDatetime: true,
11174
11223
  }),
11175
11224
  });
11176
11225
  const AppEventLogRecordApiResponse = z.z.object({
@@ -11215,11 +11264,19 @@ const ListExternalApiLogsQuery = PaginationQuery.extend({
11215
11264
  filterTitle: 'Status',
11216
11265
  isFlag: true,
11217
11266
  }),
11218
- createdAtStart: z.z.string().optional().meta({
11219
- hidden: true,
11267
+ from: z.z
11268
+ .string()
11269
+ .optional()
11270
+ .meta({
11271
+ filterTitle: 'From',
11272
+ isDatetime: true,
11220
11273
  }),
11221
- createdAtEnd: z.z.string().optional().meta({
11222
- hidden: true,
11274
+ to: z.z
11275
+ .string()
11276
+ .optional()
11277
+ .meta({
11278
+ filterTitle: 'To',
11279
+ isDatetime: true,
11223
11280
  }),
11224
11281
  sortOrder: z.z.enum(['asc', 'desc']).optional().meta({
11225
11282
  hidden: true,
@@ -11270,8 +11327,19 @@ const ListIncomingWebhooksQuery = PaginationQuery.extend({
11270
11327
  .meta({
11271
11328
  filterTitle: 'Status',
11272
11329
  }),
11273
- createdAt: z.z.string().optional().meta({
11274
- hidden: true,
11330
+ from: z.z
11331
+ .string()
11332
+ .optional()
11333
+ .meta({
11334
+ filterTitle: 'From',
11335
+ isDatetime: true,
11336
+ }),
11337
+ to: z.z
11338
+ .string()
11339
+ .optional()
11340
+ .meta({
11341
+ filterTitle: 'To',
11342
+ isDatetime: true,
11275
11343
  }),
11276
11344
  });
11277
11345
  const IncomingWebhookApiResponse = z.z.object({
@@ -12310,12 +12378,12 @@ const ActivityStatsQuery = StatsFilterQuery.extend({
12310
12378
  const IntegrationLayerStatsQuery = StatsFilterQuery;
12311
12379
  const ActionRunsStatsQuery = z.z.object({
12312
12380
  actionId: z.z.string().optional(),
12313
- actionInstanceId: z.z.string().optional(),
12381
+ connectionActionId: z.z.string().optional(),
12314
12382
  startDatetime: z.z.string().datetime({ offset: true }),
12315
12383
  });
12316
12384
  const FlowRunsStatsQuery = z.z.object({
12317
- flowId: z.z.string().optional(),
12318
- flowInstanceId: z.z.string().optional(),
12385
+ integrationFlowId: z.z.string().optional(),
12386
+ connectionFlowId: z.z.string().optional(),
12319
12387
  universalFlowId: z.z.string().optional(),
12320
12388
  startDatetime: z.z.string().datetime({ offset: true }),
12321
12389
  });
@@ -14192,7 +14260,7 @@ class FlowRunAccessor {
14192
14260
  throw new BadRequestError('Cannot repeat a running flow run.');
14193
14261
  }
14194
14262
  return this.client.post(`/flow-runs`, {
14195
- flowInstanceId: flowRun.flowInstanceId,
14263
+ flowInstanceId: flowRun.connectionFlowId || flowRun.flowInstanceId,
14196
14264
  startNodeKey: flowRun.startNodeKey,
14197
14265
  input: flowRun.input,
14198
14266
  });
@@ -15380,6 +15448,35 @@ const OAuthTokenResponse = z.z.object({
15380
15448
 
15381
15449
  const CONSOLE_ACCOUNT_API_TOKEN_PATH = 'settings/account/api-token';
15382
15450
 
15451
+ const PendingQueueCountSchema = z.z.object({
15452
+ pending: z.z.number().nullable().describe('Number of pending tasks, or null if the queue is unavailable.'),
15453
+ error: z.z.string().optional().describe('Error message if the queue count could not be retrieved.'),
15454
+ });
15455
+ const DbBackedCountsSchema = z.z.object({
15456
+ flowRuns: PendingQueueCountSchema.describe('Queued/running flow runs in MongoDB.'),
15457
+ eventPulls: PendingQueueCountSchema.describe('Queued/running external event pulls in MongoDB.'),
15458
+ eventLogs: PendingQueueCountSchema.describe('Created external event log records in MongoDB.'),
15459
+ });
15460
+ const PendingTasksSummarySchema = z.z.object({
15461
+ instant: PendingQueueCountSchema.optional().describe('Instant (BullMQ) queue counts.'),
15462
+ queued: PendingQueueCountSchema.optional().describe('Slow (Redis-backed) queue counts.'),
15463
+ dbBacked: DbBackedCountsSchema.optional().describe('DB-backed job counts from MongoDB (source of truth).'),
15464
+ total: z.z.number().describe('Sum of available pending task counts. Excludes unavailable queues.'),
15465
+ });
15466
+
15467
+ const Cluster = z.z.object({
15468
+ id: z.z.string(),
15469
+ name: z.z.string(),
15470
+ apiBaseUri: z.z.string(),
15471
+ consoleBaseUri: z.z.string().optional(),
15472
+ });
15473
+ const CreateClusterRequest = z.z.object({
15474
+ name: z.z.string().min(1),
15475
+ apiBaseUri: z.z.string().min(1),
15476
+ consoleBaseUri: z.z.string().min(1).optional(),
15477
+ });
15478
+ const ListClustersQuery = PaginationQuery;
15479
+
15383
15480
  class UI {
15384
15481
  constructor(client) {
15385
15482
  this.client = client;
@@ -16106,6 +16203,7 @@ exports.CheckpointDiffResponseSchema = CheckpointDiffResponseSchema;
16106
16203
  exports.ClientToken = ClientToken;
16107
16204
  exports.ClientTokenGrantType = ClientTokenGrantType;
16108
16205
  exports.ClientTokenListResponse = ClientTokenListResponse;
16206
+ exports.Cluster = Cluster;
16109
16207
  exports.CommonFindElementsQuery = CommonFindElementsQuery;
16110
16208
  exports.CommonFindInstancesQuery = CommonFindInstancesQuery;
16111
16209
  exports.CommonInstancesListQuery = CommonInstancesListQuery;
@@ -16188,6 +16286,7 @@ exports.CreateAgentSession = CreateAgentSession;
16188
16286
  exports.CreateAlert = CreateAlert;
16189
16287
  exports.CreateClientTokenRequest = CreateClientTokenRequest;
16190
16288
  exports.CreateClientTokenResponse = CreateClientTokenResponse;
16289
+ exports.CreateClusterRequest = CreateClusterRequest;
16191
16290
  exports.CreateConnectedProductRequest = CreateConnectedProductRequest;
16192
16291
  exports.CreateConnectionRequest = CreateConnectionRequest;
16193
16292
  exports.CreateConnectionRequestPayload = CreateConnectionRequestPayload;
@@ -16281,6 +16380,7 @@ exports.DataSourceInstanceApiResponse = DataSourceInstanceApiResponse;
16281
16380
  exports.DataSourceInstancesAccessor = DataSourceInstancesAccessor;
16282
16381
  exports.DataSourceUnitConfig = DataSourceUnitConfig;
16283
16382
  exports.DataSourcesAccessor = DataSourcesAccessor;
16383
+ exports.DbBackedCountsSchema = DbBackedCountsSchema;
16284
16384
  exports.DependencyError = DependencyError;
16285
16385
  exports.DownstreamFlowNodeRunSchema = DownstreamFlowNodeRunSchema;
16286
16386
  exports.EDITABLE_LIMITS = EDITABLE_LIMITS;
@@ -16420,6 +16520,7 @@ exports.InvalidLocatorError = InvalidLocatorError;
16420
16520
  exports.JavascriptFunction = JavascriptFunction;
16421
16521
  exports.ListActionInstancesForConnectionQuery = ListActionInstancesForConnectionQuery;
16422
16522
  exports.ListAppEventLogRecordsQuery = ListAppEventLogRecordsQuery;
16523
+ exports.ListClustersQuery = ListClustersQuery;
16423
16524
  exports.ListDataSourceInstancesForConnectionQuery = ListDataSourceInstancesForConnectionQuery;
16424
16525
  exports.ListExternalApiLogsQuery = ListExternalApiLogsQuery;
16425
16526
  exports.ListExternalAppsQuery = ListExternalAppsQuery;
@@ -16477,6 +16578,8 @@ exports.PackagesAccessor = PackagesAccessor;
16477
16578
  exports.PaginationQuery = PaginationQuery;
16478
16579
  exports.PaginationResponse = PaginationResponse;
16479
16580
  exports.PatchAgentSessionSchema = PatchAgentSessionSchema;
16581
+ exports.PendingQueueCountSchema = PendingQueueCountSchema;
16582
+ exports.PendingTasksSummarySchema = PendingTasksSummarySchema;
16480
16583
  exports.PlatformUser = PlatformUser;
16481
16584
  exports.RATE_LIMITS = RATE_LIMITS;
16482
16585
  exports.REFERENCE_ELEMENT_TYPE_SELF = REFERENCE_ELEMENT_TYPE_SELF;