@mbc-cqrs-serverless/core 1.0.14 → 1.0.16

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 (49) hide show
  1. package/dist/commands/data.service.d.ts +42 -0
  2. package/dist/commands/data.service.js +42 -0
  3. package/dist/commands/data.service.js.map +1 -1
  4. package/dist/decorators/auth.decorator.d.ts +18 -0
  5. package/dist/decorators/auth.decorator.js +18 -0
  6. package/dist/decorators/auth.decorator.js.map +1 -1
  7. package/dist/decorators/event-handler.decorator.d.ts +15 -0
  8. package/dist/decorators/event-handler.decorator.js +15 -0
  9. package/dist/decorators/event-handler.decorator.js.map +1 -1
  10. package/dist/decorators/roles.decorator.d.ts +12 -0
  11. package/dist/decorators/roles.decorator.js +12 -0
  12. package/dist/decorators/roles.decorator.js.map +1 -1
  13. package/dist/interfaces/app-module-options.interface.d.ts +12 -0
  14. package/dist/interfaces/command-input-model.interface.d.ts +24 -0
  15. package/dist/interfaces/command-model.interface.d.ts +17 -0
  16. package/dist/interfaces/command-module-options.interface.d.ts +14 -0
  17. package/dist/interfaces/command.dto.d.ts +15 -0
  18. package/dist/interfaces/command.dto.js +15 -0
  19. package/dist/interfaces/command.dto.js.map +1 -1
  20. package/dist/interfaces/command.entity.d.ts +7 -0
  21. package/dist/interfaces/command.entity.js +7 -0
  22. package/dist/interfaces/command.entity.js.map +1 -1
  23. package/dist/interfaces/command.options.interface.d.ts +13 -0
  24. package/dist/interfaces/data-list.entity.d.ts +15 -0
  25. package/dist/interfaces/data-list.entity.js +15 -0
  26. package/dist/interfaces/data-list.entity.js.map +1 -1
  27. package/dist/interfaces/data-model.interface.d.ts +13 -0
  28. package/dist/interfaces/data.entity.d.ts +26 -0
  29. package/dist/interfaces/data.entity.js +18 -0
  30. package/dist/interfaces/data.entity.js.map +1 -1
  31. package/dist/interfaces/ddb-update-item.interface.d.ts +33 -0
  32. package/dist/interfaces/ddb-update-item.interface.js +4 -0
  33. package/dist/interfaces/ddb-update-item.interface.js.map +1 -1
  34. package/dist/interfaces/detail-key.interface.d.ts +6 -0
  35. package/dist/interfaces/detail.dto.d.ts +8 -0
  36. package/dist/interfaces/detail.dto.js +8 -0
  37. package/dist/interfaces/detail.dto.js.map +1 -1
  38. package/dist/interfaces/event-factory.interface.d.ts +13 -0
  39. package/dist/interfaces/event-raw.interface.d.ts +4 -0
  40. package/dist/interfaces/event.interface.d.ts +5 -0
  41. package/dist/interfaces/master.interface.d.ts +4 -0
  42. package/dist/interfaces/notification.interface.d.ts +29 -0
  43. package/dist/interfaces/paginate.dto.d.ts +7 -0
  44. package/dist/interfaces/paginate.dto.js +7 -0
  45. package/dist/interfaces/paginate.dto.js.map +1 -1
  46. package/dist/interfaces/search.dto.d.ts +7 -0
  47. package/dist/interfaces/search.dto.js +7 -0
  48. package/dist/interfaces/search.dto.js.map +1 -1
  49. package/package.json +2 -2
@@ -1,6 +1,24 @@
1
1
  import { DynamoDbService } from '../data-store/dynamodb.service';
2
2
  import { CommandModel, CommandModuleOptions, DataListEntity, DataModel, DetailKey } from '../interfaces';
3
3
  declare const TABLE_NAME: unique symbol;
4
+ /**
5
+ * Service for reading data from DynamoDB.
6
+ * Provides query operations for the read side of CQRS.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * @Injectable()
11
+ * export class OrderService {
12
+ * constructor(
13
+ * @InjectDataService() private readonly dataService: DataService
14
+ * ) {}
15
+ *
16
+ * async getOrder(pk: string, sk: string) {
17
+ * return this.dataService.getItem({ pk, sk });
18
+ * }
19
+ * }
20
+ * ```
21
+ */
4
22
  export declare class DataService {
5
23
  private readonly options;
6
24
  private readonly dynamoDbService;
@@ -9,8 +27,32 @@ export declare class DataService {
9
27
  constructor(options: CommandModuleOptions, dynamoDbService: DynamoDbService);
10
28
  set tableName(name: string);
11
29
  get tableName(): string;
30
+ /**
31
+ * Publishes command data to the data table.
32
+ * Updates or creates the data record based on the command.
33
+ *
34
+ * @param cmd - The command model to publish
35
+ * @returns The published data model
36
+ */
12
37
  publish(cmd: CommandModel): Promise<DataModel>;
38
+ /**
39
+ * Retrieves a single item from the data table.
40
+ *
41
+ * @param key - The partition key and sort key
42
+ * @returns The data model or undefined if not found
43
+ */
13
44
  getItem(key: DetailKey): Promise<DataModel>;
45
+ /**
46
+ * Lists items by partition key with optional filtering and pagination.
47
+ *
48
+ * @param pk - The partition key to query
49
+ * @param opts - Optional query parameters
50
+ * @param opts.sk - Sort key filter expression
51
+ * @param opts.startFromSk - Start key for pagination
52
+ * @param opts.limit - Maximum number of items to return
53
+ * @param opts.order - Sort order ('asc' or 'desc')
54
+ * @returns List of data entities with pagination info
55
+ */
14
56
  listItemsByPk(pk: string, opts?: {
15
57
  sk?: {
16
58
  skExpession: string;
@@ -21,6 +21,24 @@ const interfaces_1 = require("../interfaces");
21
21
  const command_module_definition_1 = require("./command.module-definition");
22
22
  const enums_1 = require("./enums");
23
23
  const TABLE_NAME = Symbol('data');
24
+ /**
25
+ * Service for reading data from DynamoDB.
26
+ * Provides query operations for the read side of CQRS.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * @Injectable()
31
+ * export class OrderService {
32
+ * constructor(
33
+ * @InjectDataService() private readonly dataService: DataService
34
+ * ) {}
35
+ *
36
+ * async getOrder(pk: string, sk: string) {
37
+ * return this.dataService.getItem({ pk, sk });
38
+ * }
39
+ * }
40
+ * ```
41
+ */
24
42
  let DataService = DataService_1 = class DataService {
25
43
  constructor(options, dynamoDbService) {
26
44
  this.options = options;
@@ -34,6 +52,13 @@ let DataService = DataService_1 = class DataService {
34
52
  get tableName() {
35
53
  return this[TABLE_NAME];
36
54
  }
55
+ /**
56
+ * Publishes command data to the data table.
57
+ * Updates or creates the data record based on the command.
58
+ *
59
+ * @param cmd - The command model to publish
60
+ * @returns The published data model
61
+ */
37
62
  async publish(cmd) {
38
63
  const pk = cmd.pk;
39
64
  const sk = (0, key_1.removeSortKeyVersion)(cmd.sk);
@@ -66,9 +91,26 @@ let DataService = DataService_1 = class DataService {
66
91
  await this.dynamoDbService.putItem(this.tableName, dataModel);
67
92
  return dataModel;
68
93
  }
94
+ /**
95
+ * Retrieves a single item from the data table.
96
+ *
97
+ * @param key - The partition key and sort key
98
+ * @returns The data model or undefined if not found
99
+ */
69
100
  async getItem(key) {
70
101
  return await this.dynamoDbService.getItem(this.tableName, key);
71
102
  }
103
+ /**
104
+ * Lists items by partition key with optional filtering and pagination.
105
+ *
106
+ * @param pk - The partition key to query
107
+ * @param opts - Optional query parameters
108
+ * @param opts.sk - Sort key filter expression
109
+ * @param opts.startFromSk - Start key for pagination
110
+ * @param opts.limit - Maximum number of items to return
111
+ * @param opts.order - Sort order ('asc' or 'desc')
112
+ * @returns List of data entities with pagination info
113
+ */
72
114
  async listItemsByPk(pk, opts) {
73
115
  const { lastSk, items } = await this.dynamoDbService.listItemsByPk(this.tableName, pk, opts?.sk, opts?.startFromSk, opts?.limit, opts?.order);
74
116
  return new interfaces_1.DataListEntity({
@@ -1 +1 @@
1
- {"version":3,"file":"data.service.js","sourceRoot":"","sources":["../../src/commands/data.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA2D;AAE3D,qEAAgE;AAChE,wCAAqD;AACrD,8CAOsB;AACtB,2EAAkE;AAClE,mCAAmC;AAEnC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAG1B,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAItB,YAEmB,OAA6B,EAC7B,eAAgC;QADhC,YAAO,GAAP,OAAO,CAAsB;QAC7B,oBAAe,GAAf,eAAe,CAAiB;QAEjD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAChD,IAAI,CAAC,OAAO,CAAC,SAAS,EACtB,iBAAS,CAAC,IAAI,CACf,CAAA;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,GAAG,aAAW,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA;IACnE,C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,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAlHY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,eAAM,EAAC,gDAAoB,CAAC,CAAA;6CAEK,kCAAe;GAPxC,WAAW,CAkHvB"}
@@ -1,7 +1,25 @@
1
1
  import { CanActivate } from '@nestjs/common';
2
+ /**
3
+ * Decorator that applies authentication and role-based access control.
4
+ * Combines RolesGuard with Swagger documentation.
5
+ *
6
+ * @param roles - Required roles for access
7
+ * @example
8
+ * ```typescript
9
+ * @Controller('orders')
10
+ * export class OrderController {
11
+ * @Post()
12
+ * @Auth('admin', 'manager')
13
+ * createOrder() {}
14
+ * }
15
+ * ```
16
+ */
2
17
  export declare function Auth(...roles: string[]): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
3
18
  export declare function AuthGuard({ guard, roles, }: {
4
19
  guard?: CanActivate | Function;
5
20
  roles: string[];
6
21
  }): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
22
+ /**
23
+ * Decorator that adds tenant code header requirement to Swagger docs.
24
+ */
7
25
  export declare function HeaderTenant(): MethodDecorator & ClassDecorator;
@@ -8,6 +8,21 @@ const swagger_1 = require("@nestjs/swagger");
8
8
  const constants_1 = require("../constants");
9
9
  const guard_1 = require("../guard");
10
10
  const roles_decorator_1 = require("./roles.decorator");
11
+ /**
12
+ * Decorator that applies authentication and role-based access control.
13
+ * Combines RolesGuard with Swagger documentation.
14
+ *
15
+ * @param roles - Required roles for access
16
+ * @example
17
+ * ```typescript
18
+ * @Controller('orders')
19
+ * export class OrderController {
20
+ * @Post()
21
+ * @Auth('admin', 'manager')
22
+ * createOrder() {}
23
+ * }
24
+ * ```
25
+ */
11
26
  function Auth(...roles) {
12
27
  return AuthGuard({ roles });
13
28
  }
@@ -16,6 +31,9 @@ function AuthGuard({ guard = guard_1.RolesGuard, roles, }) {
16
31
  description: 'Request unauthorized',
17
32
  }));
18
33
  }
34
+ /**
35
+ * Decorator that adds tenant code header requirement to Swagger docs.
36
+ */
19
37
  function HeaderTenant() {
20
38
  return (0, swagger_1.ApiHeader)({
21
39
  name: constants_1.HEADER_TENANT_CODE,
@@ -1 +1 @@
1
- {"version":3,"file":"auth.decorator.js","sourceRoot":"","sources":["../../src/decorators/auth.decorator.ts"],"names":[],"mappings":";;AAWA,oBAEC;AAED,8BAgBC;AAED,oCAQC;AAzCD,2CAAwE;AACxE,6CAIwB;AAExB,4CAAiD;AACjD,oCAAqC;AACrC,uDAAyC;AAEzC,SAAgB,IAAI,CAAC,GAAG,KAAe;IACrC,OAAO,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AAC7B,CAAC;AAED,SAAgB,SAAS,CAAC,EACxB,KAAK,GAAG,kBAAU,EAClB,KAAK,GAKN;IACC,OAAO,IAAA,wBAAe,EACpB,IAAA,uBAAK,EAAC,GAAG,KAAK,CAAC,EACf,IAAA,kBAAS,EAAC,KAAK,CAAC,EAChB,IAAA,uBAAa,GAAE,EACf,IAAA,iCAAuB,EAAC;QACtB,WAAW,EAAE,sBAAsB;KACpC,CAAC,CACH,CAAA;AACH,CAAC;AAED,SAAgB,YAAY;IAC1B,OAAO,IAAA,mBAAS,EAAC;QACf,IAAI,EAAE,8BAAkB;QACxB,WAAW,EAAE,6BAA6B;QAC1C,QAAQ,EAAE,IAAI;QACd,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,QAAQ;KAClB,CAAC,CAAA;AACJ,CAAC"}
1
+ {"version":3,"file":"auth.decorator.js","sourceRoot":"","sources":["../../src/decorators/auth.decorator.ts"],"names":[],"mappings":";;AA0BA,oBAEC;AAED,8BAgBC;AAKD,oCAQC;AA3DD,2CAAwE;AACxE,6CAIwB;AAExB,4CAAiD;AACjD,oCAAqC;AACrC,uDAAyC;AAEzC;;;;;;;;;;;;;;GAcG;AACH,SAAgB,IAAI,CAAC,GAAG,KAAe;IACrC,OAAO,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AAC7B,CAAC;AAED,SAAgB,SAAS,CAAC,EACxB,KAAK,GAAG,kBAAU,EAClB,KAAK,GAKN;IACC,OAAO,IAAA,wBAAe,EACpB,IAAA,uBAAK,EAAC,GAAG,KAAK,CAAC,EACf,IAAA,kBAAS,EAAC,KAAK,CAAC,EAChB,IAAA,uBAAa,GAAE,EACf,IAAA,iCAAuB,EAAC;QACtB,WAAW,EAAE,sBAAsB;KACpC,CAAC,CACH,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY;IAC1B,OAAO,IAAA,mBAAS,EAAC;QACf,IAAI,EAAE,8BAAkB;QACxB,WAAW,EAAE,6BAA6B;QAC1C,QAAQ,EAAE,IAAI;QACd,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,QAAQ;KAClB,CAAC,CAAA;AACJ,CAAC"}
@@ -1,3 +1,18 @@
1
1
  import 'reflect-metadata';
2
2
  import { IEvent } from '../interfaces/event.interface';
3
+ /**
4
+ * Decorator that marks a class as an event handler.
5
+ * The handler will be invoked when the specified event is published.
6
+ *
7
+ * @param event - The event class or instance to handle
8
+ * @example
9
+ * ```typescript
10
+ * @EventHandler(OrderCreatedEvent)
11
+ * export class OrderCreatedHandler implements IEventHandler<OrderCreatedEvent> {
12
+ * async handle(event: OrderCreatedEvent) {
13
+ * // Handle the event
14
+ * }
15
+ * }
16
+ * ```
17
+ */
3
18
  export declare const EventHandler: (event: IEvent | (new (...args: any[]) => IEvent)) => ClassDecorator;
@@ -4,6 +4,21 @@ exports.EventHandler = void 0;
4
4
  require("reflect-metadata");
5
5
  const ulid_1 = require("ulid");
6
6
  const constants_1 = require("./constants");
7
+ /**
8
+ * Decorator that marks a class as an event handler.
9
+ * The handler will be invoked when the specified event is published.
10
+ *
11
+ * @param event - The event class or instance to handle
12
+ * @example
13
+ * ```typescript
14
+ * @EventHandler(OrderCreatedEvent)
15
+ * export class OrderCreatedHandler implements IEventHandler<OrderCreatedEvent> {
16
+ * async handle(event: OrderCreatedEvent) {
17
+ * // Handle the event
18
+ * }
19
+ * }
20
+ * ```
21
+ */
7
22
  const EventHandler = (event) => {
8
23
  return (target) => {
9
24
  if (!Reflect.hasOwnMetadata(constants_1.EVENT_METADATA, event)) {
@@ -1 +1 @@
1
- {"version":3,"file":"event-handler.decorator.js","sourceRoot":"","sources":["../../src/decorators/event-handler.decorator.ts"],"names":[],"mappings":";;;AAAA,4BAAyB;AAEzB,+BAA2B;AAG3B,2CAAoE;AAE7D,MAAM,YAAY,GAAG,CAC1B,KAAgD,EAChC,EAAE;IAClB,OAAO,CAAC,MAAc,EAAE,EAAE;QACxB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,0BAAc,EAAE,KAAK,CAAC,EAAE,CAAC;YACnD,OAAO,CAAC,cAAc,CAAC,0BAAc,EAAE,EAAE,EAAE,EAAE,IAAA,WAAI,GAAE,EAAE,EAAE,KAAK,CAAC,CAAA;QAC/D,CAAC;QACD,OAAO,CAAC,cAAc,CAAC,kCAAsB,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IAC/D,CAAC,CAAA;AACH,CAAC,CAAA;AATY,QAAA,YAAY,gBASxB"}
1
+ {"version":3,"file":"event-handler.decorator.js","sourceRoot":"","sources":["../../src/decorators/event-handler.decorator.ts"],"names":[],"mappings":";;;AAAA,4BAAyB;AAEzB,+BAA2B;AAG3B,2CAAoE;AAEpE;;;;;;;;;;;;;;GAcG;AACI,MAAM,YAAY,GAAG,CAC1B,KAAgD,EAChC,EAAE;IAClB,OAAO,CAAC,MAAc,EAAE,EAAE;QACxB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,0BAAc,EAAE,KAAK,CAAC,EAAE,CAAC;YACnD,OAAO,CAAC,cAAc,CAAC,0BAAc,EAAE,EAAE,EAAE,EAAE,IAAA,WAAI,GAAE,EAAE,EAAE,KAAK,CAAC,CAAA;QAC/D,CAAC;QACD,OAAO,CAAC,cAAc,CAAC,kCAAsB,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IAC/D,CAAC,CAAA;AACH,CAAC,CAAA;AATY,QAAA,YAAY,gBASxB"}
@@ -1 +1,13 @@
1
+ /**
2
+ * Decorator that sets required roles for route access.
3
+ * Used with RolesGuard to enforce role-based access control.
4
+ *
5
+ * @param roles - List of allowed roles
6
+ * @example
7
+ * ```typescript
8
+ * @Get()
9
+ * @Roles('admin', 'manager')
10
+ * findAll() {}
11
+ * ```
12
+ */
1
13
  export declare const Roles: (...roles: string[]) => import("@nestjs/common").CustomDecorator<string>;
@@ -3,6 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Roles = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const constants_1 = require("./constants");
6
+ /**
7
+ * Decorator that sets required roles for route access.
8
+ * Used with RolesGuard to enforce role-based access control.
9
+ *
10
+ * @param roles - List of allowed roles
11
+ * @example
12
+ * ```typescript
13
+ * @Get()
14
+ * @Roles('admin', 'manager')
15
+ * findAll() {}
16
+ * ```
17
+ */
6
18
  const Roles = (...roles) => (0, common_1.SetMetadata)(constants_1.ROLE_METADATA, roles);
7
19
  exports.Roles = Roles;
8
20
  //# sourceMappingURL=roles.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"roles.decorator.js","sourceRoot":"","sources":["../../src/decorators/roles.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,2CAA2C;AAEpC,MAAM,KAAK,GAAG,CAAC,GAAG,KAAe,EAAE,EAAE,CAAC,IAAA,oBAAW,EAAC,yBAAa,EAAE,KAAK,CAAC,CAAA;AAAjE,QAAA,KAAK,SAA4D"}
1
+ {"version":3,"file":"roles.decorator.js","sourceRoot":"","sources":["../../src/decorators/roles.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,2CAA2C;AAE3C;;;;;;;;;;;GAWG;AACI,MAAM,KAAK,GAAG,CAAC,GAAG,KAAe,EAAE,EAAE,CAAC,IAAA,oBAAW,EAAC,yBAAa,EAAE,KAAK,CAAC,CAAA;AAAjE,QAAA,KAAK,SAA4D"}
@@ -1,6 +1,18 @@
1
1
  import { ClassConstructor } from 'class-transformer';
2
2
  import { EnvironmentVariables } from '../env.validation';
3
+ /**
4
+ * Configuration options for the root AppModule.
5
+ * Used when bootstrapping the NestJS application.
6
+ *
7
+ * @example
8
+ * bootstrap({
9
+ * rootModule: AppModule,
10
+ * envCls: CustomEnvironmentVariables,
11
+ * })
12
+ */
3
13
  export interface AppModuleOptions {
14
+ /** The root NestJS module class */
4
15
  rootModule: any;
16
+ /** Optional custom environment variables class for validation */
5
17
  envCls?: ClassConstructor<EnvironmentVariables>;
6
18
  }
@@ -1,19 +1,43 @@
1
+ /**
2
+ * Interface for complete command input data.
3
+ * Used when creating or fully updating an entity.
4
+ */
1
5
  export interface CommandInputModel {
6
+ /** Partition key. Format: {tenantCode}#{entityType} */
2
7
  pk: string;
8
+ /** Sort key. Format: {entityType}#{entityId} */
3
9
  sk: string;
10
+ /** Unique entity identifier */
4
11
  id: string;
12
+ /** Business code */
5
13
  code: string;
14
+ /** Display name */
6
15
  name: string;
16
+ /** Version for optimistic locking */
7
17
  version: number;
18
+ /** Tenant code for isolation */
8
19
  tenantCode: string;
20
+ /** Entity type */
9
21
  type: string;
22
+ /** Soft delete flag */
10
23
  isDeleted?: boolean;
24
+ /** Sequence number */
11
25
  seq?: number;
26
+ /** Time-to-live in seconds */
12
27
  ttl?: number;
28
+ /** Custom attributes */
13
29
  attributes?: Record<string, any>;
14
30
  }
31
+ /**
32
+ * Interface for partial command input data.
33
+ * Used when updating only specific fields of an entity.
34
+ * Requires pk, sk, and version for identification and locking.
35
+ */
15
36
  export interface CommandPartialInputModel extends Partial<CommandInputModel> {
37
+ /** Partition key (required) */
16
38
  pk: string;
39
+ /** Sort key (required) */
17
40
  sk: string;
41
+ /** Version for optimistic locking (required) */
18
42
  version: number;
19
43
  }
@@ -1,13 +1,30 @@
1
1
  import { CommandInputModel } from './command-input-model.interface';
2
+ /**
3
+ * Complete command model stored in the command (write) table.
4
+ * Extends CommandInputModel with audit fields and processing metadata.
5
+ *
6
+ * This represents a single versioned command record in event sourcing.
7
+ * Each command creates a new version with sk format: {baseSk}@{version}
8
+ */
2
9
  export interface CommandModel extends CommandInputModel {
10
+ /** Processing status (e.g., 'PENDING', 'COMPLETED', 'FAILED') */
3
11
  status?: string;
12
+ /** Event source identifier (e.g., 'POST /api/master', 'SQS') */
4
13
  source?: string;
14
+ /** Unique request ID for tracing and idempotency */
5
15
  requestId?: string;
16
+ /** Timestamp when the command was created */
6
17
  createdAt?: Date;
18
+ /** Timestamp when the command was last updated */
7
19
  updatedAt?: Date;
20
+ /** User ID who created the command */
8
21
  createdBy?: string;
22
+ /** User ID who last updated the command */
9
23
  updatedBy?: string;
24
+ /** IP address of the creator */
10
25
  createdIp?: string;
26
+ /** IP address of the last updater */
11
27
  updatedIp?: string;
28
+ /** Step Functions task token for async workflows */
12
29
  taskToken?: string;
13
30
  }
@@ -1,8 +1,22 @@
1
1
  import { Type } from '@nestjs/common';
2
2
  import { IDataSyncHandler } from './data-sync-handler.interface';
3
+ /**
4
+ * Configuration options for CommandModule.
5
+ * Used when importing CommandModule.register() in your application.
6
+ *
7
+ * @example
8
+ * CommandModule.register({
9
+ * tableName: 'my-table',
10
+ * dataSyncHandlers: [OrderDataSyncHandler],
11
+ * })
12
+ */
3
13
  export interface CommandModuleOptions {
14
+ /** DynamoDB table name for command storage */
4
15
  tableName: string;
16
+ /** If true, skips errors from previous command versions */
5
17
  skipError?: boolean;
18
+ /** Custom handlers for syncing command data to read models */
6
19
  dataSyncHandlers?: Type<IDataSyncHandler>[];
20
+ /** If true, disables the default data sync handler */
7
21
  disableDefaultHandler?: boolean;
8
22
  }
@@ -1,4 +1,19 @@
1
1
  import { CommandInputModel } from './command-input-model.interface';
2
+ /**
3
+ * Base DTO class for command input validation.
4
+ * Implements CommandInputModel with class-validator decorators.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * class CreateOrderDto extends CommandDto {
9
+ * @IsString()
10
+ * customerId: string;
11
+ *
12
+ * @IsNumber()
13
+ * amount: number;
14
+ * }
15
+ * ```
16
+ */
2
17
  export declare class CommandDto implements CommandInputModel {
3
18
  pk: string;
4
19
  sk: string;
@@ -12,6 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CommandDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Base DTO class for command input validation.
17
+ * Implements CommandInputModel with class-validator decorators.
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * class CreateOrderDto extends CommandDto {
22
+ * @IsString()
23
+ * customerId: string;
24
+ *
25
+ * @IsNumber()
26
+ * amount: number;
27
+ * }
28
+ * ```
29
+ */
15
30
  class CommandDto {
16
31
  }
17
32
  exports.CommandDto = CommandDto;
@@ -1 +1 @@
1
- {"version":3,"file":"command.dto.js","sourceRoot":"","sources":["../../src/interfaces/command.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkE;AAClE,qDAA2E;AAI3E,MAAa,UAAU;CAiDtB;AAjDD,gCAiDC;AA9CC;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;sCACD;AAIV;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;sCACD;AAIV;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;sCACD;AAIV;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;wCACC;AAIZ;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;wCACC;AAIZ;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;2CACI;AAIf;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,4BAAU,GAAE;;8CACK;AAIlB;IAFC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IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;6CACO"}
@@ -1,5 +1,12 @@
1
1
  import { CommandModel } from './command-model.interface';
2
2
  import { DetailKey } from './detail-key.interface';
3
+ /**
4
+ * Entity class implementing CommandModel for API responses.
5
+ * Includes Swagger decorators for API documentation.
6
+ *
7
+ * Use this class when returning command data from REST endpoints.
8
+ * The `key` getter provides convenient access to the DynamoDB key pair.
9
+ */
3
10
  export declare class CommandEntity implements CommandModel {
4
11
  source?: string;
5
12
  isDeleted?: boolean;
@@ -11,6 +11,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CommandEntity = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ /**
15
+ * Entity class implementing CommandModel for API responses.
16
+ * Includes Swagger decorators for API documentation.
17
+ *
18
+ * Use this class when returning command data from REST endpoints.
19
+ * The `key` getter provides convenient access to the DynamoDB key pair.
20
+ */
14
21
  class CommandEntity {
15
22
  get key() {
16
23
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"command.entity.js","sourceRoot":"","sources":["../../src/interfaces/command.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkE;AAKlE,MAAa,aAAa;IA4CxB,IAAI,GAAG;QACL,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAA;IACH,CAAC;CACF;AAlDD,sCAkDC;AAhDC;IADC,IAAA,6BAAmB,GAAE;;6CACP;AAEf;IADC,IAAA,6BAAmB,GAAE;;gDACH;AAEnB;IADC,IAAA,6BAAmB,GAAE;;6CACP;AAEf;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;8BACV,IAAI;gDAAA;AAEhB;IADC,IAAA,6BAAmB,GAAE;8BACV,IAAI;gDAAA;AAEhB;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,qBAAW,GAAE;;yCACJ;AAEV;IADC,IAAA,qBAAW,GAAE;;yCACJ;AAEV;IADC,IAAA,qBAAW,GAAE;;yCACJ;AAEV;IADC,IAAA,qBAAW,GAAE;;2CACF;AAEZ;IADC,IAAA,qBAAW,GAAE;;2CACF;AAEZ;IADC,IAAA,qBAAW,GAAE;;8CACC;AAEf;IADC,IAAA,qBAAW,GAAE;;iDACI;AAElB;IADC,IAAA,qBAAW,GAAE;;2CACF;AAEZ;IADC,IAAA,6BAAmB,GAAE;;0CACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;0CACV"}
1
+ {"version":3,"file":"command.entity.js","sourceRoot":"","sources":["../../src/interfaces/command.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkE;AAKlE;;;;;;GAMG;AACH,MAAa,aAAa;IA4CxB,IAAI,GAAG;QACL,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAA;IACH,CAAC;CACF;AAlDD,sCAkDC;AAhDC;IADC,IAAA,6BAAmB,GAAE;;6CACP;AAEf;IADC,IAAA,6BAAmB,GAAE;;gDACH;AAEnB;IADC,IAAA,6BAAmB,GAAE;;6CACP;AAEf;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;8BACV,IAAI;gDAAA;AAEhB;IADC,IAAA,6BAAmB,GAAE;8BACV,IAAI;gDAAA;AAEhB;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;gDACJ;AAElB;IADC,IAAA,qBAAW,GAAE;;yCACJ;AAEV;IADC,IAAA,qBAAW,GAAE;;yCACJ;AAEV;IADC,IAAA,qBAAW,GAAE;;yCACJ;AAEV;IADC,IAAA,qBAAW,GAAE;;2CACF;AAEZ;IADC,IAAA,qBAAW,GAAE;;2CACF;AAEZ;IADC,IAAA,qBAAW,GAAE;;8CACC;AAEf;IADC,IAAA,qBAAW,GAAE;;iDACI;AAElB;IADC,IAAA,qBAAW,GAAE;;2CACF;AAEZ;IADC,IAAA,6BAAmB,GAAE;;0CACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;0CACV"}
@@ -1,6 +1,19 @@
1
1
  import { IInvoke } from '../context';
2
+ /**
3
+ * Options passed to command service methods.
4
+ * Contains context information needed for command processing.
5
+ *
6
+ * @example
7
+ * await commandService.publishAsync(input, {
8
+ * source: 'POST /api/orders',
9
+ * invokeContext: { event, context }
10
+ * })
11
+ */
2
12
  export interface ICommandOptions {
13
+ /** Origin of the command (e.g., 'POST /api/orders', 'SQS', 'StepFunction') */
3
14
  source?: string;
15
+ /** Unique request ID for tracing - auto-generated if not provided */
4
16
  requestId?: string;
17
+ /** Lambda invoke context containing event and AWS context */
5
18
  invokeContext: IInvoke;
6
19
  }
@@ -1,4 +1,19 @@
1
1
  import { DataEntity } from './data.entity';
2
+ /**
3
+ * Paginated list response for data queries.
4
+ * Used when listing items by partition key with cursor-based pagination.
5
+ *
6
+ * @example
7
+ * // API response
8
+ * {
9
+ * "total": 100,
10
+ * "lastSk": "ITEM#50",
11
+ * "items": [...]
12
+ * }
13
+ *
14
+ * // Next page request uses lastSk as cursor
15
+ * GET /items?pk=ORDER&startSk=ITEM#50
16
+ */
2
17
  export declare class DataListEntity {
3
18
  total?: number;
4
19
  lastSk?: string;
@@ -12,6 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DataListEntity = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const data_entity_1 = require("./data.entity");
15
+ /**
16
+ * Paginated list response for data queries.
17
+ * Used when listing items by partition key with cursor-based pagination.
18
+ *
19
+ * @example
20
+ * // API response
21
+ * {
22
+ * "total": 100,
23
+ * "lastSk": "ITEM#50",
24
+ * "items": [...]
25
+ * }
26
+ *
27
+ * // Next page request uses lastSk as cursor
28
+ * GET /items?pk=ORDER&startSk=ITEM#50
29
+ */
15
30
  class DataListEntity {
16
31
  constructor(data) {
17
32
  Object.assign(this, data);
@@ -1 +1 @@
1
- {"version":3,"file":"data-list.entity.js","sourceRoot":"","sources":["../../src/interfaces/data-list.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkE;AAElE,+CAA0C;AAE1C,MAAa,cAAc;IAUzB,YAAY,IAA6B;QACvC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC;CACF;AAbD,wCAaC;AAXC;IADC,IAAA,6BAAmB,GAAE;;6CACR;AAEd;IADC,IAAA,6BAAmB,GAAE;;8CACP;AAIf;IAHC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,CAAC,wBAAU,CAAC;KACnB,CAAC;;6CACiB"}
1
+ {"version":3,"file":"data-list.entity.js","sourceRoot":"","sources":["../../src/interfaces/data-list.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkE;AAElE,+CAA0C;AAE1C;;;;;;;;;;;;;;GAcG;AACH,MAAa,cAAc;IAUzB,YAAY,IAA6B;QACvC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC;CACF;AAbD,wCAaC;AAXC;IADC,IAAA,6BAAmB,GAAE;;6CACR;AAEd;IADC,IAAA,6BAAmB,GAAE;;8CACP;AAIf;IAHC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,CAAC,wBAAU,CAAC;KACnB,CAAC;;6CACiB"}
@@ -1,5 +1,18 @@
1
1
  import { CommandModel } from './command-model.interface';
2
+ /**
3
+ * Data model stored in the data (read) table.
4
+ * Represents the current/projected state of an entity for queries.
5
+ *
6
+ * In CQRS, this is the read-side projection derived from command events.
7
+ * Unlike CommandModel, DataModel stores only the latest state without version suffix.
8
+ *
9
+ * @example
10
+ * Command table: pk='ORDER#123', sk='ITEM#A@3' (version 3)
11
+ * Data table: pk='ORDER#123', sk='ITEM#A' (current state)
12
+ */
2
13
  export interface DataModel extends Omit<CommandModel, 'status'> {
14
+ /** Command partition key - references source command record */
3
15
  cpk?: string;
16
+ /** Command sort key with version - references exact command version */
4
17
  csk?: string;
5
18
  }
@@ -1,5 +1,23 @@
1
1
  import { DataModel } from './data-model.interface';
2
2
  import { DetailKey } from './detail-key.interface';
3
+ /**
4
+ * Base entity class for all data stored in DynamoDB.
5
+ * Implements the DataModel interface with common fields for CQRS operations.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const entity = new DataEntity({
10
+ * pk: 'TENANT001#ORDER',
11
+ * sk: 'ORDER#123',
12
+ * id: '123',
13
+ * code: 'ORD-001',
14
+ * name: 'Sample Order',
15
+ * version: 1,
16
+ * tenantCode: 'TENANT001',
17
+ * type: 'ORDER',
18
+ * });
19
+ * ```
20
+ */
3
21
  export declare class DataEntity implements DataModel {
4
22
  cpk?: string;
5
23
  csk?: string;
@@ -11,13 +29,21 @@ export declare class DataEntity implements DataModel {
11
29
  updatedBy?: string;
12
30
  createdIp?: string;
13
31
  updatedIp?: string;
32
+ /** Partition key for DynamoDB. Format: {tenantCode}#{entityType} */
14
33
  pk: string;
34
+ /** Sort key for DynamoDB. Format: {entityType}#{entityId} */
15
35
  sk: string;
36
+ /** Unique identifier for the entity */
16
37
  id: string;
38
+ /** Business code for the entity */
17
39
  code: string;
40
+ /** Display name of the entity */
18
41
  name: string;
42
+ /** Version number for optimistic locking */
19
43
  version: number;
44
+ /** Tenant code for multi-tenant isolation */
20
45
  tenantCode: string;
46
+ /** Entity type identifier */
21
47
  type: string;
22
48
  seq?: number;
23
49
  ttl?: number;
@@ -11,6 +11,24 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DataEntity = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ /**
15
+ * Base entity class for all data stored in DynamoDB.
16
+ * Implements the DataModel interface with common fields for CQRS operations.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const entity = new DataEntity({
21
+ * pk: 'TENANT001#ORDER',
22
+ * sk: 'ORDER#123',
23
+ * id: '123',
24
+ * code: 'ORD-001',
25
+ * name: 'Sample Order',
26
+ * version: 1,
27
+ * tenantCode: 'TENANT001',
28
+ * type: 'ORDER',
29
+ * });
30
+ * ```
31
+ */
14
32
  class DataEntity {
15
33
  constructor(data) {
16
34
  Object.assign(this, data);
@@ -1 +1 @@
1
- {"version":3,"file":"data.entity.js","sourceRoot":"","sources":["../../src/interfaces/data.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkE;AAKlE,MAAa,UAAU;IA8CrB,YAAY,IAAyB;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC;IAED,IAAI,GAAG;QACL,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAA;IACH,CAAC;CACF;AAxDD,gCAwDC;AAtDC;IADC,IAAA,6BAAmB,GAAE;;uCACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;uCACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;0CACP;AAEf;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;8BACV,IAAI;6CAAA;AAEhB;IADC,IAAA,6BAAmB,GAAE;8BACV,IAAI;6CAAA;AAEhB;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAElB;IADC,IAAA,qBAAW,GAAE;;sCACJ;AAEV;IADC,IAAA,qBAAW,GAAE;;sCACJ;AAEV;IADC,IAAA,qBAAW,GAAE;;sCACJ;AAEV;IADC,IAAA,qBAAW,GAAE;;wCACF;AAEZ;IADC,IAAA,qBAAW,GAAE;;wCACF;AAEZ;IADC,IAAA,qBAAW,GAAE;;2CACC;AAEf;IADC,IAAA,qBAAW,GAAE;;8CACI;AAElB;IADC,IAAA,qBAAW,GAAE;;wCACF;AAEZ;IADC,IAAA,6BAAmB,GAAE;;uCACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;uCACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;6CACH"}
1
+ {"version":3,"file":"data.entity.js","sourceRoot":"","sources":["../../src/interfaces/data.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkE;AAKlE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,UAAU;IA6DrB,YAAY,IAAyB;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC;IAED,IAAI,GAAG;QACL,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAA;IACH,CAAC;CACF;AAvED,gCAuEC;AArEC;IADC,IAAA,6BAAmB,GAAE;;uCACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;uCACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;0CACP;AAEf;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;8BACV,IAAI;6CAAA;AAEhB;IADC,IAAA,6BAAmB,GAAE;8BACV,IAAI;6CAAA;AAEhB;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAElB;IADC,IAAA,6BAAmB,GAAE;;6CACJ;AAGlB;IADC,IAAA,qBAAW,GAAE;;sCACJ;AAIV;IADC,IAAA,qBAAW,GAAE;;sCACJ;AAIV;IADC,IAAA,qBAAW,GAAE;;sCACJ;AAIV;IADC,IAAA,qBAAW,GAAE;;wCACF;AAIZ;IADC,IAAA,qBAAW,GAAE;;wCACF;AAIZ;IADC,IAAA,qBAAW,GAAE;;2CACC;AAIf;IADC,IAAA,qBAAW,GAAE;;8CACI;AAIlB;IADC,IAAA,qBAAW,GAAE;;wCACF;AAEZ;IADC,IAAA,6BAAmB,GAAE;;uCACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;uCACV;AAEZ;IADC,IAAA,6BAAmB,GAAE;;6CACH"}
@@ -1,19 +1,52 @@
1
+ /**
2
+ * DynamoDB Update Expression Types
3
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html
4
+ */
5
+ /** Primitive value types supported by DynamoDB */
1
6
  export type DdbValueType = boolean | number | string | Record<string, any>;
7
+ /** All DynamoDB value types including arrays */
2
8
  export type DdbValueAllType = DdbValueType | DdbValueType[];
9
+ /**
10
+ * Path-value pair for SET operations.
11
+ * Used with if_not_exists() and list_append() functions.
12
+ */
3
13
  export type DdbUpdateSetPathValue = {
14
+ /** Attribute path (e.g., 'attributes.count') */
4
15
  path: string;
16
+ /** Value to set */
5
17
  value: DdbValueAllType;
6
18
  };
19
+ /**
20
+ * SET operation value with optional modifiers.
21
+ * Supports atomic counters and list operations.
22
+ */
7
23
  export type DdbUpdateSetValue = {
24
+ /** Increment numeric value by this amount */
8
25
  incrementBy?: number;
26
+ /** Decrement numeric value by this amount */
9
27
  decrementBy?: number;
28
+ /** Set value only if attribute doesn't exist */
10
29
  ifNotExists?: string | DdbUpdateSetPathValue;
30
+ /** Append to list attribute */
11
31
  listAppend?: string[] | DdbUpdateSetPathValue;
12
32
  };
33
+ /**
34
+ * DynamoDB UpdateItem expression builder.
35
+ * Provides type-safe interface for update operations.
36
+ *
37
+ * @example
38
+ * const update: DdbUpdateItem = {
39
+ * set: { name: 'New Name', 'attributes.count': { incrementBy: 1 } },
40
+ * remove: { oldField: true }
41
+ * }
42
+ */
13
43
  export interface DdbUpdateItem {
44
+ /** SET expression - add or modify attributes */
14
45
  set?: Record<string, DdbValueAllType | DdbUpdateSetValue>;
46
+ /** REMOVE expression - delete attributes or list elements */
15
47
  remove?: Record<string, boolean | {
16
48
  index: number;
17
49
  }>;
50
+ /** DELETE expression - remove elements from a set */
18
51
  delete?: Record<string, DdbValueType>;
19
52
  }
@@ -1,3 +1,7 @@
1
1
  "use strict";
2
+ /**
3
+ * DynamoDB Update Expression Types
4
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html
5
+ */
2
6
  Object.defineProperty(exports, "__esModule", { value: true });
3
7
  //# sourceMappingURL=ddb-update-item.interface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ddb-update-item.interface.js","sourceRoot":"","sources":["../../src/interfaces/ddb-update-item.interface.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"ddb-update-item.interface.js","sourceRoot":"","sources":["../../src/interfaces/ddb-update-item.interface.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -1,4 +1,10 @@
1
+ /**
2
+ * Interface for DynamoDB composite key.
3
+ * Used to identify items in the data store.
4
+ */
1
5
  export interface DetailKey {
6
+ /** Partition key */
2
7
  pk: string;
8
+ /** Sort key */
3
9
  sk: string;
4
10
  }
@@ -1,4 +1,12 @@
1
1
  import { DetailKey } from './detail-key.interface';
2
+ /**
3
+ * DTO for retrieving a single item by its DynamoDB key.
4
+ * Used in GET, PUT, DELETE operations that target a specific item.
5
+ *
6
+ * @example
7
+ * // GET /items/:pk/:sk
8
+ * // Request: { pk: "ORDER#123", sk: "ITEM#A" }
9
+ */
2
10
  export declare class DetailDto implements DetailKey {
3
11
  pk: string;
4
12
  sk: string;
@@ -12,6 +12,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DetailDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
+ /**
16
+ * DTO for retrieving a single item by its DynamoDB key.
17
+ * Used in GET, PUT, DELETE operations that target a specific item.
18
+ *
19
+ * @example
20
+ * // GET /items/:pk/:sk
21
+ * // Request: { pk: "ORDER#123", sk: "ITEM#A" }
22
+ */
15
23
  class DetailDto {
16
24
  }
17
25
  exports.DetailDto = DetailDto;
@@ -1 +1 @@
1
- {"version":3,"file":"detail.dto.js","sourceRoot":"","sources":["../../src/interfaces/detail.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6C;AAC7C,qDAA0C;AAI1C,MAAa,SAAS;CAQrB;AARD,8BAQC;AALC;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;qCACD;AAIV;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;qCACD"}
1
+ {"version":3,"file":"detail.dto.js","sourceRoot":"","sources":["../../src/interfaces/detail.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6C;AAC7C,qDAA0C;AAI1C;;;;;;;GAOG;AACH,MAAa,SAAS;CAQrB;AARD,8BAQC;AALC;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;qCACD;AAIV;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;qCACD"}
@@ -1,11 +1,24 @@
1
1
  import { DynamoDBStreamEvent, EventBridgeEvent, S3Event, SNSEvent, SQSEvent } from 'aws-lambda';
2
2
  import { StepFunctionsEvent } from './aws/step-function.interface';
3
3
  import { IEvent } from './event.interface';
4
+ /**
5
+ * Factory interface for transforming AWS events into domain events.
6
+ * Implement this to customize how incoming AWS events are parsed.
7
+ *
8
+ * Each transform method receives the raw AWS event and returns
9
+ * an array of domain events to be processed by handlers.
10
+ */
4
11
  export interface IEventFactory<TEvent extends IEvent = any> {
12
+ /** Transform SQS messages into domain events */
5
13
  transformSqs(event: SQSEvent): Promise<TEvent[]>;
14
+ /** Transform SNS notifications into domain events */
6
15
  transformSns(event: SNSEvent): Promise<TEvent[]>;
16
+ /** Transform DynamoDB Stream records into domain events */
7
17
  transformDynamodbStream(event: DynamoDBStreamEvent): Promise<TEvent[]>;
18
+ /** Transform EventBridge events into domain events */
8
19
  transformEventBridge(event: EventBridgeEvent<any, any>): Promise<TEvent[]>;
20
+ /** Transform Step Functions task input into domain events */
9
21
  transformStepFunction(event: StepFunctionsEvent<any>): Promise<TEvent[]>;
22
+ /** Transform S3 notifications into domain events */
10
23
  transformS3(event: S3Event): Promise<TEvent[]>;
11
24
  }
@@ -1,2 +1,6 @@
1
+ /**
2
+ * Marker interface for raw AWS Lambda events.
3
+ * Extend this interface to type your custom event payloads.
4
+ */
1
5
  export interface IRawEvent {
2
6
  }
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Base interface for domain events.
3
+ * All events should implement this interface.
4
+ */
1
5
  export interface IEvent {
6
+ /** Source identifier of the event */
2
7
  source: string;
3
8
  }
@@ -1,4 +1,8 @@
1
1
  import { DetailKey } from './detail-key.interface';
2
+ /**
3
+ * Interface for master data providers.
4
+ * Implement this to create custom data sources for master data lookup.
5
+ */
2
6
  export interface IMasterDataProvider {
3
7
  /**
4
8
  * Get the data for a specific key.
@@ -1,24 +1,53 @@
1
+ /**
2
+ * Real-time notification payload for WebSocket/AppSync subscriptions.
3
+ * Published when data changes occur in the system.
4
+ */
1
5
  export interface INotification {
6
+ /** Unique notification ID */
2
7
  id: string;
8
+ /** Source DynamoDB table name */
3
9
  table: string;
10
+ /** Partition key of the changed item */
4
11
  pk: string;
12
+ /** Sort key of the changed item */
5
13
  sk: string;
14
+ /** Tenant code for filtering notifications */
6
15
  tenantCode: string;
16
+ /** Type of change: 'INSERT', 'MODIFY', 'REMOVE' */
7
17
  action: string;
18
+ /** Optional payload with changed data */
8
19
  content?: object;
9
20
  }
21
+ /**
22
+ * Email attachment for SES notifications.
23
+ */
10
24
  export interface Attachment {
25
+ /** Filename shown to recipient */
11
26
  filename: string;
27
+ /** File content as Buffer */
12
28
  content: Buffer;
29
+ /** MIME type (e.g., 'application/pdf') */
13
30
  contentType?: string;
14
31
  }
32
+ /**
33
+ * Email notification configuration for SES.
34
+ * Used by NotificationService to send emails.
35
+ */
15
36
  export interface EmailNotification {
37
+ /** Sender email address (uses default if not specified) */
16
38
  fromAddr?: string;
39
+ /** List of recipient email addresses */
17
40
  toAddrs: string[];
41
+ /** Optional CC recipients */
18
42
  ccAddrs?: string[];
43
+ /** Optional BCC recipients */
19
44
  bccAddrs?: string[];
45
+ /** Email subject line */
20
46
  subject: string;
47
+ /** Email body as HTML */
21
48
  body: string;
49
+ /** Optional reply-to addresses */
22
50
  replyToAddrs?: string[];
51
+ /** Optional file attachments */
23
52
  attachments?: Attachment[];
24
53
  }
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Base DTO for paginated list requests.
3
+ * Provides page-based pagination with configurable page size.
4
+ *
5
+ * @example
6
+ * // GET /items?page=2&pageSize=20
7
+ */
1
8
  export declare class PaginateDto {
2
9
  /**
3
10
  * Current page number
@@ -13,6 +13,13 @@ exports.PaginateDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const class_validator_1 = require("class-validator");
16
+ /**
17
+ * Base DTO for paginated list requests.
18
+ * Provides page-based pagination with configurable page size.
19
+ *
20
+ * @example
21
+ * // GET /items?page=2&pageSize=20
22
+ */
16
23
  class PaginateDto {
17
24
  constructor(partial) {
18
25
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"paginate.dto.js","sourceRoot":"","sources":["../../src/interfaces/paginate.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAqD;AACrD,yDAA6C;AAC7C,qDAA4C;AAE5C,MAAa,WAAW;IAqBtB,YAAY,OAA6B;QApBzC;;;WAGG;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EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;6CACe"}
@@ -1,4 +1,11 @@
1
1
  import { PaginateDto } from './paginate.dto';
2
+ /**
3
+ * DTO for search operations with filtering and sorting.
4
+ * Extends PaginateDto with search-specific parameters.
5
+ *
6
+ * @example
7
+ * // GET /items?keyword=test&pk=ORDER&orderBys=createdAt:desc
8
+ */
2
9
  export declare class SearchDto extends PaginateDto {
3
10
  /**
4
11
  * search keyword
@@ -14,6 +14,13 @@ const swagger_1 = require("@nestjs/swagger");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const class_validator_1 = require("class-validator");
16
16
  const paginate_dto_1 = require("./paginate.dto");
17
+ /**
18
+ * DTO for search operations with filtering and sorting.
19
+ * Extends PaginateDto with search-specific parameters.
20
+ *
21
+ * @example
22
+ * // GET /items?keyword=test&pk=ORDER&orderBys=createdAt:desc
23
+ */
17
24
  class SearchDto extends paginate_dto_1.PaginateDto {
18
25
  }
19
26
  exports.SearchDto = SearchDto;
@@ -1 +1 @@
1
- {"version":3,"file":"search.dto.js","sourceRoot":"","sources":["../../src/interfaces/search.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAqD;AACrD,yDAA6C;AAC7C,qDAAsD;AAEtD,iDAA4C;AAE5C,MAAa,SAAU,SAAQ,0BAAW;CA0BzC;AA1BD,8BA0BC;AApBC;IAFC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;;0CACG;AAIhB;IAFC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;;qCACF;AAKX;IAHC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAmB,GAAE;;qCACX;AAIX;IAFC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;;qCACF;AAMX;IAJC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxB,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;;2CAChD"}
1
+ {"version":3,"file":"search.dto.js","sourceRoot":"","sources":["../../src/interfaces/search.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAqD;AACrD,yDAA6C;AAC7C,qDAAsD;AAEtD,iDAA4C;AAE5C;;;;;;GAMG;AACH,MAAa,SAAU,SAAQ,0BAAW;CA0BzC;AA1BD,8BA0BC;AApBC;IAFC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;;0CACG;AAIhB;IAFC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;;qCACF;AAKX;IAHC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAmB,GAAE;;qCACX;AAIX;IAFC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;;qCACF;AAMX;IAJC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxB,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;;2CAChD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mbc-cqrs-serverless/core",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "CQRS and event base core",
5
5
  "keywords": [
6
6
  "mbc",
@@ -88,5 +88,5 @@
88
88
  "serverless-step-functions-local": "^0.5.1",
89
89
  "supertest": "^7.0.0"
90
90
  },
91
- "gitHead": "799960ab779dab7f9ce9be3cb83083f019a29208"
91
+ "gitHead": "4ab967474160873735b8cb816272a7012b8940d5"
92
92
  }