@monorise/core 5.0.0-dev.2 → 5.0.0-dev.3

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/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Entity as Entity$2, EntitySchemaMap, createEntityConfig, WhereConditions } from '@monorise/base';
1
+ import { Entity as Entity$2, EntitySchemaMap, createEntityConfig, WhereConditions, TransactionOperation, TransactionResult } from '@monorise/base';
2
+ export { transactional } from '@monorise/base';
2
3
  import * as hono from 'hono';
3
4
  import { Hono } from 'hono';
4
5
  import { DynamoDB, TransactWriteItemsInput, AttributeValue, TransactWriteItem, UpdateItemCommandInput } from '@aws-sdk/client-dynamodb';
@@ -4724,44 +4725,6 @@ declare class ListTagsController {
4724
4725
  }, hono_utils_http_status.ContentfulStatusCode, "json">>;
4725
4726
  }
4726
4727
 
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
4728
  declare class TransactionService {
4766
4729
  private EntityConfig;
4767
4730
  private EmailAuthEnabledEntities;
@@ -4943,19 +4906,6 @@ declare const $default: (container: DependencyContainer) => (event: APIGatewayPr
4943
4906
  */
4944
4907
  declare const broadcast: (container: DependencyContainer) => (event: DynamoDBStreamEvent) => Promise<void>;
4945
4908
 
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
-
4959
4909
  declare class CoreFactory {
4960
4910
  private config;
4961
4911
  setupCommonRoutes: ReturnType<typeof setupCommonRoutes>;
@@ -4977,4 +4927,4 @@ declare class CoreFactory {
4977
4927
  });
4978
4928
  }
4979
4929
 
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 };
4930
+ 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, broadcast as wsBroadcast, connect as wsConnect, $default as wsDefault, disconnect as wsDisconnect };
package/dist/index.js CHANGED
@@ -9547,7 +9547,7 @@ var DependencyContainer = class {
9547
9547
  }
9548
9548
  };
9549
9549
 
9550
- // helpers/transactional.ts
9550
+ // ../base/transactional.ts
9551
9551
  var transactional = {
9552
9552
  createEntity: (entityType, payload) => {
9553
9553
  const _a = payload, { entityId } = _a, rest = __objRest(_a, ["entityId"]);