monorise 1.0.0 → 1.1.0-dev.1

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 (100) hide show
  1. package/dist/base/index.d.ts +110 -3
  2. package/dist/base/index.js +3 -1
  3. package/dist/base/index.js.map +1 -1
  4. package/dist/cli/cli.js +6 -0
  5. package/dist/cli/cli.js.map +1 -1
  6. package/dist/core/chunk-QV4Q5377.js +76 -0
  7. package/dist/core/chunk-QV4Q5377.js.map +1 -0
  8. package/dist/core/index.d.ts +191 -38
  9. package/dist/core/index.js +1539 -122
  10. package/dist/core/index.js.map +1 -1
  11. package/dist/core/service.config-ZJEZ6EKA.js +13 -0
  12. package/dist/core/service.config-ZJEZ6EKA.js.map +1 -0
  13. package/dist/proxy/index.d.ts +35 -0
  14. package/dist/proxy/index.js +75 -0
  15. package/dist/proxy/index.js.map +1 -0
  16. package/dist/react/actions/websocket.action.d.ts +71 -0
  17. package/dist/react/actions/websocket.action.d.ts.map +1 -0
  18. package/dist/react/chunk-2QOYO3GF.js +182 -0
  19. package/dist/react/chunk-2QOYO3GF.js.map +1 -0
  20. package/dist/react/chunk-4WSYM746.js +383 -0
  21. package/dist/react/chunk-4WSYM746.js.map +1 -0
  22. package/dist/react/chunk-5XIRNUBL.js +43 -0
  23. package/dist/react/chunk-5XIRNUBL.js.map +1 -0
  24. package/dist/react/chunk-7JDOKZGQ.js +172 -0
  25. package/dist/react/chunk-7JDOKZGQ.js.map +1 -0
  26. package/dist/react/chunk-A5TI2FW3.js +13 -0
  27. package/dist/react/chunk-A5TI2FW3.js.map +1 -0
  28. package/dist/react/chunk-BJXCFDMF.js +15 -0
  29. package/dist/react/chunk-BJXCFDMF.js.map +1 -0
  30. package/dist/react/chunk-BUTF5RJU.js +29 -0
  31. package/dist/react/chunk-BUTF5RJU.js.map +1 -0
  32. package/dist/react/chunk-DTRWUIDH.js +402 -0
  33. package/dist/react/chunk-DTRWUIDH.js.map +1 -0
  34. package/dist/react/chunk-GFVCNWVT.js +54 -0
  35. package/dist/react/chunk-GFVCNWVT.js.map +1 -0
  36. package/dist/react/chunk-JT5EZZSL.js +489 -0
  37. package/dist/react/chunk-JT5EZZSL.js.map +1 -0
  38. package/dist/react/chunk-KJX5LOMN.js +43 -0
  39. package/dist/react/chunk-KJX5LOMN.js.map +1 -0
  40. package/dist/react/chunk-KLXK4V6G.js +65 -0
  41. package/dist/react/chunk-KLXK4V6G.js.map +1 -0
  42. package/dist/react/chunk-LJLMKEKI.js +245 -0
  43. package/dist/react/chunk-LJLMKEKI.js.map +1 -0
  44. package/dist/react/chunk-MIXAYX55.js +147 -0
  45. package/dist/react/chunk-MIXAYX55.js.map +1 -0
  46. package/dist/react/chunk-RPNCWADG.js +248 -0
  47. package/dist/react/chunk-RPNCWADG.js.map +1 -0
  48. package/dist/react/chunk-S6RDMHHH.js +47 -0
  49. package/dist/react/chunk-S6RDMHHH.js.map +1 -0
  50. package/dist/react/chunk-U6RIOMF4.js +893 -0
  51. package/dist/react/chunk-U6RIOMF4.js.map +1 -0
  52. package/dist/react/chunk-WCRLJFBW.js +5568 -0
  53. package/dist/react/chunk-WCRLJFBW.js.map +1 -0
  54. package/dist/react/chunk-YF6S7S36.js +588 -0
  55. package/dist/react/chunk-YF6S7S36.js.map +1 -0
  56. package/dist/react/dist-es-5WYA7CWK.js +379 -0
  57. package/dist/react/dist-es-5WYA7CWK.js.map +1 -0
  58. package/dist/react/dist-es-CR5AOOCO.js +333 -0
  59. package/dist/react/dist-es-CR5AOOCO.js.map +1 -0
  60. package/dist/react/dist-es-KZ3GLAJI.js +494 -0
  61. package/dist/react/dist-es-KZ3GLAJI.js.map +1 -0
  62. package/dist/react/dist-es-R4TRTT45.js +22 -0
  63. package/dist/react/dist-es-R4TRTT45.js.map +1 -0
  64. package/dist/react/dist-es-SKDPAJEW.js +169 -0
  65. package/dist/react/dist-es-SKDPAJEW.js.map +1 -0
  66. package/dist/react/dist-es-TOHBZNTZ.js +71 -0
  67. package/dist/react/dist-es-TOHBZNTZ.js.map +1 -0
  68. package/dist/react/dist-es-XNAC47MK.js +90 -0
  69. package/dist/react/dist-es-XNAC47MK.js.map +1 -0
  70. package/dist/react/event-streams-WAZW4P3K.js +277 -0
  71. package/dist/react/event-streams-WAZW4P3K.js.map +1 -0
  72. package/dist/react/index.d.ts +53 -4
  73. package/dist/react/index.d.ts.map +1 -1
  74. package/dist/react/index.js +10991 -190
  75. package/dist/react/index.js.map +1 -1
  76. package/dist/react/loadSso-KXVD6CBM.js +556 -0
  77. package/dist/react/loadSso-KXVD6CBM.js.map +1 -0
  78. package/dist/react/service.config-I7RKP6FE.js +14 -0
  79. package/dist/react/service.config-I7RKP6FE.js.map +1 -0
  80. package/dist/react/services/core.service.d.ts +11 -1
  81. package/dist/react/services/core.service.d.ts.map +1 -1
  82. package/dist/react/signin-SEY3FDQ5.js +653 -0
  83. package/dist/react/signin-SEY3FDQ5.js.map +1 -0
  84. package/dist/react/sso-oidc-REODVHH5.js +786 -0
  85. package/dist/react/sso-oidc-REODVHH5.js.map +1 -0
  86. package/dist/react/sts-I3M4QP37.js +3948 -0
  87. package/dist/react/sts-I3M4QP37.js.map +1 -0
  88. package/dist/react/websocket/WebSocketManager.d.ts +68 -0
  89. package/dist/react/websocket/WebSocketManager.d.ts.map +1 -0
  90. package/dist/react/websocket/index.d.ts +3 -0
  91. package/dist/react/websocket/index.d.ts.map +1 -0
  92. package/dist/react/websocket/optimistic.d.ts +51 -0
  93. package/dist/react/websocket/optimistic.d.ts.map +1 -0
  94. package/dist/react/websocket-OSLLJSNO.js +10 -0
  95. package/dist/react/websocket-OSLLJSNO.js.map +1 -0
  96. package/dist/sst/components/monorise-core.d.ts +10 -0
  97. package/dist/sst/components/monorise-core.d.ts.map +1 -1
  98. package/dist/sst/index.js +75 -12
  99. package/dist/sst/index.js.map +1 -1
  100. package/package.json +9 -1
@@ -1,4 +1,4 @@
1
- import { Entity as Entity$2, EntitySchemaMap, createEntityConfig } from '../base/index';
1
+ import { Entity as Entity$2, EntitySchemaMap, createEntityConfig, WhereConditions } from '../base/index';
2
2
  import * as hono from 'hono';
3
3
  import { Hono } from 'hono';
4
4
  import { DynamoDB, TransactWriteItemsInput, AttributeValue, TransactWriteItem, UpdateItemCommandInput } from '@aws-sdk/client-dynamodb';
@@ -9,7 +9,7 @@ import httpStatus8 from 'http-status';
9
9
  import { unmarshall, marshall } from '@aws-sdk/util-dynamodb';
10
10
  import { EventBridgeClient } from '@aws-sdk/client-eventbridge';
11
11
  import * as hono_aws_lambda from 'hono/aws-lambda';
12
- import { SQSEvent, SQSBatchItemFailure, DynamoDBBatchItemFailure } from 'aws-lambda';
12
+ import { SQSEvent, SQSBatchItemFailure, DynamoDBBatchItemFailure, APIGatewayProxyWebsocketEventV2, APIGatewayProxyResultV2, DynamoDBStreamEvent } from 'aws-lambda';
13
13
  import { _Record } from '@aws-sdk/client-dynamodb-streams';
14
14
 
15
15
  type EventDetail = {
@@ -88,7 +88,7 @@ declare class Entity$1<T extends Entity$2> extends Item$1 {
88
88
  }
89
89
  declare class EntityRepository extends Repository {
90
90
  private EntityConfig;
91
- private readonly TABLE_NAME;
91
+ readonly TABLE_NAME: string;
92
92
  private readonly dynamodbClient;
93
93
  private readonly EmailAuthEnabledEntities;
94
94
  constructor(EntityConfig: Record<Entity$2, ReturnType<typeof createEntityConfig>>, TABLE_NAME: string, dynamodbClient: DynamoDB, EmailAuthEnabledEntities: Entity$2[]);
@@ -132,11 +132,10 @@ declare class EntityRepository extends Repository {
132
132
  ExpressionAttributeNames?: Record<string, string>;
133
133
  ExpressionAttributeValues?: Record<string, AttributeValue>;
134
134
  }): Promise<Entity$1<T>>;
135
- adjustEntity<T extends Entity$2>(entityType: T, entityId: string, adjustments: Record<string, number>, constraints?: {
136
- [field: string]: {
137
- min?: number;
138
- max?: number;
139
- };
135
+ adjustEntity<T extends Entity$2>(entityType: T, entityId: string, adjustments: Record<string, number>, opts?: {
136
+ ConditionExpression?: string;
137
+ ExpressionAttributeNames?: Record<string, string>;
138
+ ExpressionAttributeValues?: Record<string, AttributeValue>;
140
139
  }): Promise<Entity$1<T>>;
141
140
  deleteEntity<T extends Entity$2>(entityType: T, entityId: string): Promise<void>;
142
141
  queryEntities<T extends Entity$2>(entityType: T, query: string): Promise<{
@@ -317,6 +316,47 @@ declare class TagRepository extends Repository {
317
316
  }): Promise<void>;
318
317
  }
319
318
 
319
+ interface ConnectionRecord {
320
+ connectionId: string;
321
+ entityType?: string;
322
+ entityId?: string;
323
+ connectedAt?: string;
324
+ expiresAt?: number;
325
+ }
326
+ interface SubscriptionRecord {
327
+ PK: string;
328
+ SK: string;
329
+ connectionId: string;
330
+ subscriptionType: string;
331
+ feedTypes?: string[];
332
+ [key: string]: unknown;
333
+ }
334
+ interface TicketData {
335
+ entityType: string;
336
+ entityId: string;
337
+ feedTypes: string[];
338
+ }
339
+ declare class WebSocketRepository extends Repository {
340
+ private tableName;
341
+ private dynamodbClient;
342
+ private docClient;
343
+ constructor(tableName: string, dynamodbClient: DynamoDB);
344
+ createConnection(connectionId: string, metadata: Record<string, unknown>, expiresAt: number): Promise<void>;
345
+ getConnection(connectionId: string): Promise<ConnectionRecord | undefined>;
346
+ deleteConnection(connectionId: string): Promise<void>;
347
+ createSubscription(subKey: string, connectionId: string, data: Record<string, unknown>): Promise<void>;
348
+ deleteSubscription(subKey: string, connectionId: string): Promise<void>;
349
+ querySubscriptionsByKey(subKey: string): Promise<SubscriptionRecord[]>;
350
+ querySubscriptionsByConnectionId(connectionId: string): Promise<SubscriptionRecord[]>;
351
+ createTicket(ticket: string, entityType: string, entityId: string, feedTypes: string[], expiresAt: number): Promise<void>;
352
+ consumeTicket(ticket: string): Promise<TicketData | null>;
353
+ queryMutualConnections(byEntityType: string, byEntityId: string): Promise<{
354
+ entityType: string;
355
+ entityId: string;
356
+ }[]>;
357
+ queryFeedSubscriptions(entityType: string, entityId: string): Promise<SubscriptionRecord[]>;
358
+ }
359
+
320
360
  var __defProp = Object.defineProperty;
321
361
  var __defProps = Object.defineProperties;
322
362
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
@@ -361,6 +401,10 @@ var __async = (__this, __arguments, generator) => {
361
401
  });
362
402
  };
363
403
 
404
+ // configs/service.config.ts
405
+ process.env.CORE_TABLE || "";
406
+ process.env.CORE_EVENT_BUS || "";
407
+
364
408
  // errors/standard-error.ts
365
409
  var StandardError$1 = class StandardError extends Error {
366
410
  constructor(errorCode, message, lastError, context) {
@@ -474,10 +518,6 @@ factory.createMiddleware((c, next) => __async(null, null, function* () {
474
518
  return yield next();
475
519
  }));
476
520
 
477
- // configs/service.config.ts
478
- process.env.CORE_TABLE || "";
479
- process.env.CORE_EVENT_BUS || "";
480
-
481
521
  // helpers/event.ts
482
522
  new EventBridgeClient();
483
523
 
@@ -4446,26 +4486,6 @@ external_exports.object({
4446
4486
  lastKey: external_exports.string().optional()
4447
4487
  });
4448
4488
 
4449
- type WhereOperator = {
4450
- $eq: string | number | boolean;
4451
- } | {
4452
- $ne: string | number | boolean;
4453
- } | {
4454
- $gt: number;
4455
- } | {
4456
- $lt: number;
4457
- } | {
4458
- $gte: number;
4459
- } | {
4460
- $lte: number;
4461
- } | {
4462
- $exists: boolean;
4463
- } | {
4464
- $beginsWith: string;
4465
- };
4466
- type WhereClause = WhereOperator | string | number | boolean;
4467
- type WhereConditions = Record<string, WhereClause>;
4468
-
4469
4489
  declare class EntityServiceLifeCycle {
4470
4490
  private EntityConfig;
4471
4491
  private publishEvent;
@@ -4491,19 +4511,24 @@ declare class EntityService {
4491
4511
  mutualId?: string;
4492
4512
  };
4493
4513
  }) => Promise<Entity<T>>;
4494
- adjustEntity: <T extends Entity$2>({ entityType, entityId, adjustments, accountId, }: {
4514
+ adjustEntity: <T extends Entity$2>({ entityType, entityId, adjustments, accountId, condition, }: {
4495
4515
  entityType: T;
4496
4516
  entityId: string;
4497
4517
  adjustments: Record<string, number>;
4498
4518
  accountId?: string;
4519
+ condition?: string;
4499
4520
  }) => Promise<Entity<T>>;
4500
- updateEntity: <T extends Entity$2>({ entityType, entityId, entityPayload, accountId, where, }: {
4521
+ updateEntity: <T extends Entity$2>({ entityType, entityId, entityPayload, accountId, condition, where, }: {
4501
4522
  entityType: T;
4502
4523
  entityId: string;
4503
4524
  entityPayload: Partial<EntitySchemaMap[T]>;
4504
4525
  accountId?: string | string[];
4526
+ condition?: string;
4527
+ /** @deprecated Use `condition` (named condition) instead of raw `where`. */
4505
4528
  where?: WhereConditions;
4506
4529
  }) => Promise<Entity<T>>;
4530
+ /** @deprecated Converts legacy adjustmentConstraints to condition expression opts. */
4531
+ private buildLegacyAdjustCondition;
4507
4532
  deleteEntity: <T extends Entity$2>({ entityType, entityId, accountId, }: {
4508
4533
  entityType: T;
4509
4534
  entityId: string;
@@ -4583,12 +4608,14 @@ declare class UpsertEntityController {
4583
4608
  }
4584
4609
 
4585
4610
  declare class MutualService {
4611
+ private EntityConfig;
4586
4612
  private entityRepository;
4587
4613
  private mutualRepository;
4588
4614
  private publishEvent;
4589
4615
  private ddbUtils;
4590
4616
  private entityServiceLifeCycle;
4591
- constructor(entityRepository: EntityRepository, mutualRepository: MutualRepository, publishEvent: typeof publishEvent, ddbUtils: DbUtils, entityServiceLifeCycle: EntityServiceLifeCycle);
4617
+ constructor(EntityConfig: Record<Entity$2, ReturnType<typeof createEntityConfig>>, entityRepository: EntityRepository, mutualRepository: MutualRepository, publishEvent: typeof publishEvent, ddbUtils: DbUtils, entityServiceLifeCycle: EntityServiceLifeCycle);
4618
+ private getMutualDataSchema;
4592
4619
  createMutual: <B extends Entity$2, T extends Entity$2, A extends Entity$2>({ byEntityType, byEntityId, entityType, entityId, mutualPayload, accountId, options, }: {
4593
4620
  byEntityType: B;
4594
4621
  byEntityId: string;
@@ -4607,13 +4634,17 @@ declare class MutualService {
4607
4634
  ExpressionAttributeValues?: Record<string, AttributeValue>;
4608
4635
  };
4609
4636
  }) => Promise<{
4610
- mutual: Mutual<B, T, Record<string, any>>;
4637
+ mutual: Mutual<B, T, {
4638
+ [x: string]: any;
4639
+ }>;
4611
4640
  eventPayload: {
4612
4641
  byEntityType: B;
4613
4642
  byEntityId: string;
4614
4643
  entityType: T;
4615
4644
  entityId: string;
4616
- parsedMutualPayload: Record<string, any>;
4645
+ parsedMutualPayload: {
4646
+ [x: string]: any;
4647
+ };
4617
4648
  accountId: string | string[] | undefined;
4618
4649
  publishedAt: string;
4619
4650
  };
@@ -4693,6 +4724,78 @@ declare class ListTagsController {
4693
4724
  }, hono_utils_http_status.ContentfulStatusCode, "json">>;
4694
4725
  }
4695
4726
 
4727
+ type TransactionCreateEntity<T extends Entity$2 = Entity$2> = {
4728
+ operation: 'createEntity';
4729
+ entityType: T;
4730
+ entityId?: string;
4731
+ payload: EntitySchemaMap[T];
4732
+ };
4733
+ type TransactionUpdateEntity<T extends Entity$2 = Entity$2> = {
4734
+ operation: 'updateEntity';
4735
+ entityType: T;
4736
+ entityId: string;
4737
+ payload: Partial<EntitySchemaMap[T]>;
4738
+ accountId?: string;
4739
+ condition?: string;
4740
+ };
4741
+ type TransactionAdjustEntity<T extends Entity$2 = Entity$2> = {
4742
+ operation: 'adjustEntity';
4743
+ entityType: T;
4744
+ entityId: string;
4745
+ adjustments: Record<string, number>;
4746
+ accountId?: string;
4747
+ condition?: string;
4748
+ };
4749
+ type TransactionDeleteEntity<T extends Entity$2 = Entity$2> = {
4750
+ operation: 'deleteEntity';
4751
+ entityType: T;
4752
+ entityId: string;
4753
+ };
4754
+ type TransactionOperation = TransactionCreateEntity | TransactionUpdateEntity | TransactionAdjustEntity | TransactionDeleteEntity;
4755
+ type TransactionResultEntry = {
4756
+ operation: string;
4757
+ entityType: Entity$2;
4758
+ entityId: string;
4759
+ data?: Record<string, unknown>;
4760
+ };
4761
+ type TransactionResult = {
4762
+ results: TransactionResultEntry[];
4763
+ };
4764
+
4765
+ declare class TransactionService {
4766
+ private EntityConfig;
4767
+ private EmailAuthEnabledEntities;
4768
+ private entityRepository;
4769
+ private dynamodbClient;
4770
+ private publishEvent;
4771
+ private entityServiceLifeCycle;
4772
+ private eventUtils;
4773
+ constructor(EntityConfig: Record<Entity$2, ReturnType<typeof createEntityConfig>>, EmailAuthEnabledEntities: Entity$2[], entityRepository: EntityRepository, dynamodbClient: DynamoDB, publishEvent: typeof publishEvent, entityServiceLifeCycle: EntityServiceLifeCycle, eventUtils: EventUtils);
4774
+ executeTransaction: (operations: TransactionOperation[], accountId?: string) => Promise<TransactionResult>;
4775
+ private buildCreateItems;
4776
+ private buildUpdateItem;
4777
+ private buildAdjustItem;
4778
+ private buildDeleteItem;
4779
+ private collectCreateEvents;
4780
+ private collectUpdateEvents;
4781
+ }
4782
+
4783
+ declare class ExecuteTransactionController {
4784
+ private transactionService;
4785
+ constructor(transactionService: TransactionService);
4786
+ controller: hono.MiddlewareHandler<any, string, {}, any>;
4787
+ }
4788
+
4789
+ declare class CreateTicketController {
4790
+ private container;
4791
+ constructor(container: DependencyContainer);
4792
+ controller: hono.MiddlewareHandler<any, string, {}, Response & hono.TypedResponse<{
4793
+ ticket: string;
4794
+ wsUrl: string;
4795
+ expiresIn: number;
4796
+ }, hono_utils_http_status.ContentfulStatusCode, "json">>;
4797
+ }
4798
+
4696
4799
  declare class DependencyContainer {
4697
4800
  config: {
4698
4801
  EntityConfig: Record<Entity$2, ReturnType<typeof createEntityConfig>>;
@@ -4721,6 +4824,7 @@ declare class DependencyContainer {
4721
4824
  get entityService(): EntityService;
4722
4825
  get mutualService(): MutualService;
4723
4826
  get tagRepository(): TagRepository;
4827
+ get websocketRepository(): WebSocketRepository;
4724
4828
  get getEntityController(): GetEntityController;
4725
4829
  get getEntityByUniqueFieldController(): GetEntityByUniqueFieldValueController;
4726
4830
  get listEntitiesController(): ListEntitiesController;
@@ -4735,6 +4839,9 @@ declare class DependencyContainer {
4735
4839
  get updateMutualController(): UpdateMutualController;
4736
4840
  get deleteMutualController(): DeleteMutualController;
4737
4841
  get listTagsController(): ListTagsController;
4842
+ get transactionService(): TransactionService;
4843
+ get executeTransactionController(): ExecuteTransactionController;
4844
+ get createTicketController(): CreateTicketController;
4738
4845
  }
4739
4846
 
4740
4847
  declare const setupCommonRoutes: (container: DependencyContainer) => Hono;
@@ -4755,6 +4862,7 @@ declare const StandardErrorCode: {
4755
4862
  readonly ENTITY_ID_IS_UNDEFINED: "ENTITY_ID_IS_UNDEFINED";
4756
4863
  readonly ENTITY_IS_UNDEFINED: "ENTITY_IS_UNDEFINED";
4757
4864
  readonly ENTITY_NOT_FOUND: "ENTITY_NOT_FOUND";
4865
+ readonly INVALID_CONDITION: "INVALID_CONDITION";
4758
4866
  readonly INVALID_ENTITY_TYPE: "INVALID_ENTITY_TYPE";
4759
4867
  readonly INVALID_MUTUAL: "INVALID_MUTUAL";
4760
4868
  readonly INVALID_QUERY: "INVALID_QUERY";
@@ -4767,7 +4875,10 @@ declare const StandardErrorCode: {
4767
4875
  readonly REPLICATION_ERROR: "REPLICATION_ERROR";
4768
4876
  readonly RETRYABLE_MUTUAL_LOCK_CONFLICT: "RETRYABLE_MUTUAL_LOCK_CONFLICT";
4769
4877
  readonly TAG_IS_UNDEFINED: "TAG_IS_UNDEFINED";
4878
+ readonly TRANSACTION_EMPTY: "TRANSACTION_EMPTY";
4770
4879
  readonly TRANSACTION_FAILED: "TRANSACTION_FAILED";
4880
+ readonly TRANSACTION_ITEM_LIMIT_EXCEEDED: "TRANSACTION_ITEM_LIMIT_EXCEEDED";
4881
+ readonly TRANSACTION_UNIQUE_FIELD_UPDATE: "TRANSACTION_UNIQUE_FIELD_UPDATE";
4771
4882
  readonly UNIQUE_VALUE_EXISTS: "UNIQUE_VALUE_EXISTS";
4772
4883
  };
4773
4884
  type StandardErrorCode = typeof StandardErrorCode[keyof typeof StandardErrorCode];
@@ -4807,6 +4918,44 @@ declare const handler: (container: DependencyContainer) => (ev: SQSEvent) => Pro
4807
4918
  batchItemFailures: SQSBatchItemFailure[];
4808
4919
  }>;
4809
4920
 
4921
+ type WebSocketConnectEvent = APIGatewayProxyWebsocketEventV2 & {
4922
+ queryStringParameters?: Record<string, string | undefined>;
4923
+ headers?: Record<string, string | undefined>;
4924
+ };
4925
+ /**
4926
+ * $connect handler
4927
+ * Supports two auth modes:
4928
+ * - ticket: ?ticket=abc123 (issued via /ws/ticket/:entityType/:entityId)
4929
+ * - token: ?token=userId (simplified direct auth)
4930
+ */
4931
+ declare const connect: (container: DependencyContainer) => (event: WebSocketConnectEvent) => Promise<APIGatewayProxyResultV2>;
4932
+ /**
4933
+ * $disconnect handler
4934
+ * Cleans up connection record and all associated subscription records.
4935
+ */
4936
+ declare const disconnect: (container: DependencyContainer) => (event: APIGatewayProxyWebsocketEventV2) => Promise<APIGatewayProxyResultV2>;
4937
+ /**
4938
+ * $default handler - route messages
4939
+ */
4940
+ declare const $default: (container: DependencyContainer) => (event: APIGatewayProxyWebsocketEventV2) => Promise<APIGatewayProxyResultV2>;
4941
+ /**
4942
+ * Broadcast handler - triggered by DynamoDB Streams
4943
+ */
4944
+ declare const broadcast: (container: DependencyContainer) => (event: DynamoDBStreamEvent) => Promise<void>;
4945
+
4946
+ declare const transactional: {
4947
+ createEntity: <T extends Entity$2>(entityType: T, payload: EntitySchemaMap[T] & {
4948
+ entityId?: string;
4949
+ }) => TransactionCreateEntity<T>;
4950
+ updateEntity: <T extends Entity$2>(entityType: T, entityId: string, payload: Partial<EntitySchemaMap[T]> & {
4951
+ $condition?: string;
4952
+ }) => TransactionUpdateEntity<T>;
4953
+ adjustEntity: <T extends Entity$2>(entityType: T, entityId: string, adjustments: Record<string, number> & {
4954
+ $condition?: string;
4955
+ }) => TransactionAdjustEntity<T>;
4956
+ deleteEntity: <T extends Entity$2>(entityType: T, entityId: string) => TransactionDeleteEntity<T>;
4957
+ };
4958
+
4810
4959
  declare class CoreFactory {
4811
4960
  private config;
4812
4961
  setupCommonRoutes: ReturnType<typeof setupCommonRoutes>;
@@ -4816,6 +4965,10 @@ declare class CoreFactory {
4816
4965
  prejoinProcessor: ReturnType<typeof handler$2>;
4817
4966
  tagProcessor: ReturnType<typeof handler>;
4818
4967
  appHandler: ReturnType<typeof appHandler>;
4968
+ wsConnect: ReturnType<typeof connect>;
4969
+ wsDisconnect: ReturnType<typeof disconnect>;
4970
+ wsDefault: ReturnType<typeof $default>;
4971
+ wsBroadcast: ReturnType<typeof broadcast>;
4819
4972
  dependencyContainer: DependencyContainer;
4820
4973
  constructor(config: {
4821
4974
  EntityConfig: Record<Entity$2, ReturnType<typeof createEntityConfig>>;
@@ -4824,4 +4977,4 @@ declare class CoreFactory {
4824
4977
  });
4825
4978
  }
4826
4979
 
4827
- export { DependencyContainer, Entity$1 as Entity, EntityRepository, EntityService, Mutual, MutualRepository, MutualService, PROJECTION_EXPRESSION, StandardError, StandardErrorCode, TagRepository, appHandler, handler$4 as createEntityProcessor, CoreFactory as default, handler$3 as mutualProcessor, handler$2 as prejoinProcessor, handler$1 as replicationProcessor, setupCommonRoutes, handler as tagProcessor };
4980
+ export { DependencyContainer, Entity$1 as Entity, EntityRepository, EntityService, Mutual, MutualRepository, MutualService, PROJECTION_EXPRESSION, StandardError, StandardErrorCode, TagRepository, TransactionService, WebSocketRepository, appHandler, handler$4 as createEntityProcessor, CoreFactory as default, handler$3 as mutualProcessor, handler$2 as prejoinProcessor, handler$1 as replicationProcessor, setupCommonRoutes, handler as tagProcessor, transactional, broadcast as wsBroadcast, connect as wsConnect, $default as wsDefault, disconnect as wsDisconnect };