File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Copyright (c) Dolittle. All rights reserved.
22// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3- import { artifact } from '@dolittle/sdk.artifacts ' ;
3+ import { eventType } from '@dolittle/sdk.events ' ;
44
5- @artifact ( 'c7b37f26-ffe4-4ffc-9a53-8d67acbecd4d' )
5+ @eventType ( 'c7b37f26-ffe4-4ffc-9a53-8d67acbecd4d' )
66export class MyEvent {
77 anInteger ! : number ;
88 aString ! : string ;
Original file line number Diff line number Diff line change @@ -58,15 +58,3 @@ export class Artifact {
5858 return `[${ this . id . toString ( ) } - ${ this . generation . toString ( ) } ]` ;
5959 }
6060}
61-
62- /**
63- * Decorator for associating a type with an artifact.
64- */
65- export function artifact ( identifier : Guid | string , generationNumber ?: number ) {
66- return function ( target : any ) {
67- ArtifactsFromDecorators . associate (
68- target . prototype . constructor ,
69- ArtifactId . from ( identifier ) ,
70- generationNumber != null ? Generation . from ( generationNumber ) : Generation . first ) ;
71- } ;
72- }
Original file line number Diff line number Diff line change 44export { GenerationMustBeNaturalNumber } from './GenerationMustBeNaturalNumber' ;
55export { Generation } from './Generation' ;
66export { ArtifactId } from './ArtifactId' ;
7- export { Artifact , artifact } from './Artifact' ;
7+ export { Artifact } from './Artifact' ;
88export { UnknownType } from './UnknownType' ;
99export { UnknownArtifact } from './UnknownArtifact' ;
1010export { UnableToResolveArtifact } from './UnableToResolveArtifact' ;
Original file line number Diff line number Diff line change 11// Copyright (c) Dolittle. All rights reserved.
22// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
4- import { artifact } from '@dolittle/sdk.artifacts' ;
4+ import { ArtifactsFromDecorators , ArtifactId , Generation } from '@dolittle/sdk.artifacts' ;
55import { Guid } from '@dolittle/rudiments' ;
66
77/**
88 * Decorator for associating an event with an artifact.
99 */
1010export function eventType ( identifier : Guid | string , generationNumber ?: number ) {
1111 return function ( target : any ) {
12- artifact ( identifier , generationNumber ) ( target ) ;
12+ ArtifactsFromDecorators . associate (
13+ target . prototype . constructor ,
14+ ArtifactId . from ( identifier ) ,
15+ generationNumber != null ? Generation . from ( generationNumber ) : Generation . first ) ;
1316 } ;
1417}
You can’t perform that action at this time.
0 commit comments