@delta-base/core 1.4.0 → 1.5.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.
package/dist/openapi.json CHANGED
@@ -5956,6 +5956,501 @@
5956
5956
  }
5957
5957
  }
5958
5958
  },
5959
+ "/api/event-stores/{eventStoreName}/subscriptions/{subscriberId}/replay": {
5960
+ "post": {
5961
+ "tags": [
5962
+ "Event Bus"
5963
+ ],
5964
+ "summary": "Replay events for a subscription",
5965
+ "description": "Initiates replay of historical events for a subscription from a specific position or datetime. \n \nDuring replay:\n- Live event delivery is paused to maintain ordering\n- Events are re-processed in batches with rate limiting\n- Replay status can be monitored via the GET endpoint\n- Once caught up, live delivery automatically resumes\n\nReplay is useful for:\n- Recovering from missed events\n- Re-processing events after fixing subscriber logic\n- Populating new subscriptions with historical data",
5966
+ "security": [
5967
+ {
5968
+ "Bearer": []
5969
+ }
5970
+ ],
5971
+ "parameters": [
5972
+ {
5973
+ "schema": {
5974
+ "type": "string",
5975
+ "description": "Event store name (automatically scoped to your organization)"
5976
+ },
5977
+ "required": true,
5978
+ "description": "Event store name (automatically scoped to your organization)",
5979
+ "name": "eventStoreName",
5980
+ "in": "path"
5981
+ },
5982
+ {
5983
+ "schema": {
5984
+ "type": "string",
5985
+ "description": "Unique identifier for the subscription"
5986
+ },
5987
+ "required": true,
5988
+ "description": "Unique identifier for the subscription",
5989
+ "name": "subscriberId",
5990
+ "in": "path"
5991
+ }
5992
+ ],
5993
+ "requestBody": {
5994
+ "content": {
5995
+ "application/json": {
5996
+ "schema": {
5997
+ "type": "object",
5998
+ "properties": {
5999
+ "fromGlobalPosition": {
6000
+ "type": "integer",
6001
+ "minimum": 0,
6002
+ "exclusiveMinimum": true,
6003
+ "description": "Global position to start replay from"
6004
+ },
6005
+ "fromCreatedAt": {
6006
+ "type": "string",
6007
+ "format": "date-time",
6008
+ "description": "ISO 8601 datetime to start replay from"
6009
+ },
6010
+ "toGlobalPosition": {
6011
+ "type": "integer",
6012
+ "minimum": 0,
6013
+ "exclusiveMinimum": true,
6014
+ "description": "Global position to end replay at (inclusive)"
6015
+ },
6016
+ "toCreatedAt": {
6017
+ "type": "string",
6018
+ "format": "date-time",
6019
+ "description": "ISO 8601 datetime to end replay at (inclusive)"
6020
+ },
6021
+ "eventTypes": {
6022
+ "type": "array",
6023
+ "items": {
6024
+ "type": "string"
6025
+ },
6026
+ "description": "Filter to only replay specific event types"
6027
+ }
6028
+ }
6029
+ },
6030
+ "examples": {
6031
+ "fromPosition": {
6032
+ "summary": "Replay from specific global position",
6033
+ "value": {
6034
+ "fromGlobalPosition": 12345
6035
+ }
6036
+ },
6037
+ "fromDate": {
6038
+ "summary": "Replay from specific datetime",
6039
+ "value": {
6040
+ "fromCreatedAt": "2026-01-01T00:00:00Z"
6041
+ }
6042
+ },
6043
+ "withFilter": {
6044
+ "summary": "Replay with event type filter",
6045
+ "value": {
6046
+ "fromGlobalPosition": 1000,
6047
+ "eventTypes": [
6048
+ "orders.created",
6049
+ "orders.updated"
6050
+ ]
6051
+ }
6052
+ }
6053
+ }
6054
+ }
6055
+ }
6056
+ },
6057
+ "responses": {
6058
+ "202": {
6059
+ "description": "Replay initiated successfully",
6060
+ "content": {
6061
+ "application/json": {
6062
+ "schema": {
6063
+ "type": "object",
6064
+ "properties": {
6065
+ "message": {
6066
+ "type": "string"
6067
+ },
6068
+ "fromPosition": {
6069
+ "type": "number"
6070
+ },
6071
+ "estimatedEvents": {
6072
+ "type": "number"
6073
+ }
6074
+ },
6075
+ "required": [
6076
+ "message",
6077
+ "fromPosition",
6078
+ "estimatedEvents"
6079
+ ]
6080
+ },
6081
+ "examples": {
6082
+ "success": {
6083
+ "value": {
6084
+ "message": "Replay started",
6085
+ "fromPosition": 12345,
6086
+ "estimatedEvents": 5000
6087
+ }
6088
+ }
6089
+ }
6090
+ }
6091
+ }
6092
+ },
6093
+ "400": {
6094
+ "description": "Invalid request parameters",
6095
+ "content": {
6096
+ "application/json": {
6097
+ "schema": {
6098
+ "type": "object",
6099
+ "properties": {
6100
+ "error": {
6101
+ "type": "string",
6102
+ "description": "Error type"
6103
+ },
6104
+ "message": {
6105
+ "type": "string",
6106
+ "description": "Human-readable error message"
6107
+ },
6108
+ "details": {
6109
+ "type": "object",
6110
+ "additionalProperties": {
6111
+ "nullable": true
6112
+ },
6113
+ "description": "Additional error details"
6114
+ }
6115
+ },
6116
+ "required": [
6117
+ "error",
6118
+ "message"
6119
+ ]
6120
+ }
6121
+ }
6122
+ }
6123
+ },
6124
+ "401": {
6125
+ "description": "Unauthorized: Organization ID not found in authentication context",
6126
+ "content": {
6127
+ "application/json": {
6128
+ "schema": {
6129
+ "type": "object",
6130
+ "properties": {
6131
+ "error": {
6132
+ "type": "string",
6133
+ "description": "Error type"
6134
+ },
6135
+ "message": {
6136
+ "type": "string",
6137
+ "description": "Human-readable error message"
6138
+ },
6139
+ "details": {
6140
+ "type": "object",
6141
+ "additionalProperties": {
6142
+ "nullable": true
6143
+ },
6144
+ "description": "Additional error details"
6145
+ }
6146
+ },
6147
+ "required": [
6148
+ "error",
6149
+ "message"
6150
+ ]
6151
+ }
6152
+ }
6153
+ }
6154
+ },
6155
+ "404": {
6156
+ "description": "Subscription or event store not found",
6157
+ "content": {
6158
+ "application/json": {
6159
+ "schema": {
6160
+ "type": "object",
6161
+ "properties": {
6162
+ "error": {
6163
+ "type": "string",
6164
+ "description": "Error type"
6165
+ },
6166
+ "message": {
6167
+ "type": "string",
6168
+ "description": "Human-readable error message"
6169
+ },
6170
+ "details": {
6171
+ "type": "object",
6172
+ "additionalProperties": {
6173
+ "nullable": true
6174
+ },
6175
+ "description": "Additional error details"
6176
+ }
6177
+ },
6178
+ "required": [
6179
+ "error",
6180
+ "message"
6181
+ ]
6182
+ }
6183
+ }
6184
+ }
6185
+ },
6186
+ "409": {
6187
+ "description": "Replay already in progress",
6188
+ "content": {
6189
+ "application/json": {
6190
+ "schema": {
6191
+ "type": "object",
6192
+ "properties": {
6193
+ "error": {
6194
+ "type": "string",
6195
+ "description": "Error type"
6196
+ },
6197
+ "message": {
6198
+ "type": "string",
6199
+ "description": "Human-readable error message"
6200
+ },
6201
+ "details": {
6202
+ "type": "object",
6203
+ "additionalProperties": {
6204
+ "nullable": true
6205
+ },
6206
+ "description": "Additional error details"
6207
+ }
6208
+ },
6209
+ "required": [
6210
+ "error",
6211
+ "message"
6212
+ ]
6213
+ }
6214
+ }
6215
+ }
6216
+ },
6217
+ "500": {
6218
+ "description": "Internal server error",
6219
+ "content": {
6220
+ "application/json": {
6221
+ "schema": {
6222
+ "type": "object",
6223
+ "properties": {
6224
+ "error": {
6225
+ "type": "string",
6226
+ "description": "Error type"
6227
+ },
6228
+ "message": {
6229
+ "type": "string",
6230
+ "description": "Human-readable error message"
6231
+ },
6232
+ "details": {
6233
+ "type": "object",
6234
+ "additionalProperties": {
6235
+ "nullable": true
6236
+ },
6237
+ "description": "Additional error details"
6238
+ }
6239
+ },
6240
+ "required": [
6241
+ "error",
6242
+ "message"
6243
+ ]
6244
+ }
6245
+ }
6246
+ }
6247
+ }
6248
+ }
6249
+ },
6250
+ "get": {
6251
+ "tags": [
6252
+ "Event Bus"
6253
+ ],
6254
+ "summary": "Get replay status",
6255
+ "description": "Returns the current status of an in-progress or completed replay operation",
6256
+ "security": [
6257
+ {
6258
+ "Bearer": []
6259
+ }
6260
+ ],
6261
+ "parameters": [
6262
+ {
6263
+ "schema": {
6264
+ "type": "string",
6265
+ "description": "Event store name (automatically scoped to your organization)"
6266
+ },
6267
+ "required": true,
6268
+ "description": "Event store name (automatically scoped to your organization)",
6269
+ "name": "eventStoreName",
6270
+ "in": "path"
6271
+ },
6272
+ {
6273
+ "schema": {
6274
+ "type": "string",
6275
+ "description": "Unique identifier for the subscription"
6276
+ },
6277
+ "required": true,
6278
+ "description": "Unique identifier for the subscription",
6279
+ "name": "subscriberId",
6280
+ "in": "path"
6281
+ }
6282
+ ],
6283
+ "responses": {
6284
+ "200": {
6285
+ "description": "Replay status retrieved successfully",
6286
+ "content": {
6287
+ "application/json": {
6288
+ "schema": {
6289
+ "type": "object",
6290
+ "properties": {
6291
+ "inProgress": {
6292
+ "type": "boolean",
6293
+ "description": "Whether replay is currently in progress"
6294
+ },
6295
+ "startPosition": {
6296
+ "type": "number",
6297
+ "nullable": true,
6298
+ "description": "Global position where replay started"
6299
+ },
6300
+ "targetPosition": {
6301
+ "type": "number",
6302
+ "nullable": true,
6303
+ "description": "Global position where replay will end"
6304
+ },
6305
+ "currentPosition": {
6306
+ "type": "number",
6307
+ "description": "Current global position being processed"
6308
+ },
6309
+ "processedCount": {
6310
+ "type": "number",
6311
+ "description": "Number of events processed in this replay"
6312
+ },
6313
+ "estimatedEvents": {
6314
+ "type": "number",
6315
+ "description": "Estimated number of events remaining to process"
6316
+ },
6317
+ "startedAt": {
6318
+ "type": "string",
6319
+ "nullable": true,
6320
+ "description": "When the replay was initiated"
6321
+ }
6322
+ },
6323
+ "required": [
6324
+ "inProgress",
6325
+ "startPosition",
6326
+ "targetPosition",
6327
+ "currentPosition",
6328
+ "processedCount",
6329
+ "estimatedEvents",
6330
+ "startedAt"
6331
+ ]
6332
+ },
6333
+ "examples": {
6334
+ "inProgress": {
6335
+ "value": {
6336
+ "inProgress": true,
6337
+ "startPosition": 12345,
6338
+ "targetPosition": 67890,
6339
+ "currentPosition": 45678,
6340
+ "processedCount": 33333,
6341
+ "estimatedEvents": 22212
6342
+ }
6343
+ },
6344
+ "completed": {
6345
+ "value": {
6346
+ "inProgress": false,
6347
+ "startPosition": 12345,
6348
+ "targetPosition": 67890,
6349
+ "currentPosition": 67890,
6350
+ "processedCount": 55545,
6351
+ "estimatedEvents": 0
6352
+ }
6353
+ }
6354
+ }
6355
+ }
6356
+ }
6357
+ },
6358
+ "401": {
6359
+ "description": "Unauthorized: Organization ID not found in authentication context",
6360
+ "content": {
6361
+ "application/json": {
6362
+ "schema": {
6363
+ "type": "object",
6364
+ "properties": {
6365
+ "error": {
6366
+ "type": "string",
6367
+ "description": "Error type"
6368
+ },
6369
+ "message": {
6370
+ "type": "string",
6371
+ "description": "Human-readable error message"
6372
+ },
6373
+ "details": {
6374
+ "type": "object",
6375
+ "additionalProperties": {
6376
+ "nullable": true
6377
+ },
6378
+ "description": "Additional error details"
6379
+ }
6380
+ },
6381
+ "required": [
6382
+ "error",
6383
+ "message"
6384
+ ]
6385
+ }
6386
+ }
6387
+ }
6388
+ },
6389
+ "404": {
6390
+ "description": "Subscription or event store not found",
6391
+ "content": {
6392
+ "application/json": {
6393
+ "schema": {
6394
+ "type": "object",
6395
+ "properties": {
6396
+ "error": {
6397
+ "type": "string",
6398
+ "description": "Error type"
6399
+ },
6400
+ "message": {
6401
+ "type": "string",
6402
+ "description": "Human-readable error message"
6403
+ },
6404
+ "details": {
6405
+ "type": "object",
6406
+ "additionalProperties": {
6407
+ "nullable": true
6408
+ },
6409
+ "description": "Additional error details"
6410
+ }
6411
+ },
6412
+ "required": [
6413
+ "error",
6414
+ "message"
6415
+ ]
6416
+ }
6417
+ }
6418
+ }
6419
+ },
6420
+ "500": {
6421
+ "description": "Internal server error",
6422
+ "content": {
6423
+ "application/json": {
6424
+ "schema": {
6425
+ "type": "object",
6426
+ "properties": {
6427
+ "error": {
6428
+ "type": "string",
6429
+ "description": "Error type"
6430
+ },
6431
+ "message": {
6432
+ "type": "string",
6433
+ "description": "Human-readable error message"
6434
+ },
6435
+ "details": {
6436
+ "type": "object",
6437
+ "additionalProperties": {
6438
+ "nullable": true
6439
+ },
6440
+ "description": "Additional error details"
6441
+ }
6442
+ },
6443
+ "required": [
6444
+ "error",
6445
+ "message"
6446
+ ]
6447
+ }
6448
+ }
6449
+ }
6450
+ }
6451
+ }
6452
+ }
6453
+ },
5959
6454
  "/api/event-stores/{eventStoreName}/events/ws": {
5960
6455
  "get": {
5961
6456
  "tags": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delta-base/core",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Deltabase Core",
5
5
  "type": "module",
6
6
  "private": false,
@@ -28,8 +28,8 @@
28
28
  "nanoid": "^5.0.9",
29
29
  "zod": "^4.1.13",
30
30
  "@delta-base/api-keys": "0.1.6",
31
- "@delta-base/toolkit": "0.1.0",
32
- "@delta-base/auth": "0.2.0"
31
+ "@delta-base/auth": "0.2.0",
32
+ "@delta-base/toolkit": "0.1.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@cloudflare/vitest-pool-workers": "^0.8.37",