@quadnix/octo 0.0.18 → 0.0.20
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/decorators/action.decorator.js +3 -1
- package/dist/decorators/action.decorator.js.map +1 -1
- package/dist/decorators/anchor.decorator.js +3 -1
- package/dist/decorators/anchor.decorator.js.map +1 -1
- package/dist/decorators/container.d.ts +1 -0
- package/dist/decorators/container.js +5 -1
- package/dist/decorators/container.js.map +1 -1
- package/dist/decorators/event-source.decorator.d.ts +3 -0
- package/dist/decorators/event-source.decorator.js +7 -0
- package/dist/decorators/event-source.decorator.js.map +1 -0
- package/dist/decorators/model.decorator.js +3 -1
- package/dist/decorators/model.decorator.js.map +1 -1
- package/dist/decorators/on-event.decorator.d.ts +3 -0
- package/dist/decorators/on-event.decorator.js +7 -0
- package/dist/decorators/on-event.decorator.js.map +1 -0
- package/dist/decorators/overlay.decorator.js +3 -1
- package/dist/decorators/overlay.decorator.js.map +1 -1
- package/dist/decorators/resource.decorator.js +3 -1
- package/dist/decorators/resource.decorator.js.map +1 -1
- package/dist/events/error.event.d.ts +5 -0
- package/dist/events/error.event.js +6 -0
- package/dist/events/error.event.js.map +1 -0
- package/dist/events/event.model.d.ts +10 -0
- package/dist/events/event.model.js +19 -0
- package/dist/events/event.model.js.map +1 -0
- package/dist/events/hook.event.d.ts +27 -0
- package/dist/events/hook.event.js +28 -0
- package/dist/events/hook.event.js.map +1 -0
- package/dist/events/module.event.d.ts +3 -0
- package/dist/events/module.event.js +4 -0
- package/dist/events/module.event.js.map +1 -0
- package/dist/events/registration.event.d.ts +22 -0
- package/dist/events/registration.event.js +80 -0
- package/dist/events/registration.event.js.map +1 -0
- package/dist/events/serialization.event.d.ts +11 -0
- package/dist/events/serialization.event.js +12 -0
- package/dist/events/serialization.event.js.map +1 -0
- package/dist/events/transaction.event.d.ts +7 -0
- package/dist/events/transaction.event.js +8 -0
- package/dist/events/transaction.event.js.map +1 -0
- package/dist/functions/hook/commit.hook.js +5 -0
- package/dist/functions/hook/commit.hook.js.map +1 -1
- package/dist/functions/hook/model-action.hook.js +5 -0
- package/dist/functions/hook/model-action.hook.js.map +1 -1
- package/dist/functions/hook/resource-action.hook.js +5 -0
- package/dist/functions/hook/resource-action.hook.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +7 -1
- package/dist/main.js +7 -1
- package/dist/main.js.map +1 -1
- package/dist/modules/module.container.js +5 -2
- package/dist/modules/module.container.js.map +1 -1
- package/dist/modules/test-module.container.d.ts +2 -1
- package/dist/modules/test-module.container.js +3 -3
- package/dist/modules/test-module.container.js.map +1 -1
- package/dist/services/event/event.service.d.ts +17 -0
- package/dist/services/event/event.service.js +89 -0
- package/dist/services/event/event.service.js.map +1 -0
- package/dist/services/serialization/model/model-serialization.service.d.ts +1 -1
- package/dist/services/serialization/model/model-serialization.service.js +18 -1
- package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
- package/dist/services/serialization/resource/resource-serialization.service.js +18 -3
- package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
- package/dist/services/transaction/transaction.service.js +29 -1
- package/dist/services/transaction/transaction.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ModelType } from '../app.type.js';
|
|
2
|
+
import { RegistrationErrorEvent } from '../events/error.event.js';
|
|
2
3
|
import { ModelActionHook } from '../functions/hook/model-action.hook.js';
|
|
3
4
|
import { ResourceActionHook } from '../functions/hook/resource-action.hook.js';
|
|
5
|
+
import { EventService } from '../services/event/event.service.js';
|
|
4
6
|
import { TransactionService } from '../services/transaction/transaction.service.js';
|
|
5
7
|
import { Container } from './container.js';
|
|
6
8
|
export function Action(type) {
|
|
@@ -32,7 +34,7 @@ export function Action(type) {
|
|
|
32
34
|
}
|
|
33
35
|
})
|
|
34
36
|
.catch((error) => {
|
|
35
|
-
|
|
37
|
+
EventService.getInstance().emit(new RegistrationErrorEvent(error));
|
|
36
38
|
});
|
|
37
39
|
};
|
|
38
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.decorator.js","sourceRoot":"","sources":["../../src/decorators/action.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,UAAU,MAAM,CAAC,IAAe;IACpC,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC;aAC9B,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE;YACjC,QAAQ,IAAI,EAAE,CAAC;gBACb,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;oBAErB,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,GAAG,CAAe,WAAW,CAAC,IAAI,CAAC,CAAC;oBACxE,kBAAkB,CAAC,oBAAoB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;oBAGvD,eAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;oBACrD,MAAM;gBACR,CAAC;gBACD,KAAK,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;oBAEvB,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,GAAG,CAAe,WAAW,CAAC,IAAI,CAAC,CAAC;oBACxE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;oBAGzD,eAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;oBACrD,MAAM;gBACR,CAAC;gBACD,KAAK,SAA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,kBAAkB,CAAC,oBAAoB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;oBAGvD,eAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;oBACrD,MAAM;gBACR,CAAC;gBACD,KAAK,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;oBAEvB,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,GAAG,CAAe,WAAW,CAAC,IAAI,CAAC,CAAC;oBACxE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;oBAGzD,eAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;oBACrD,MAAM;gBACR,CAAC;gBACD,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAExB,MAAM,cAAc,GAAG,MAAM,SAAS,CAAC,GAAG,CAAkB,WAAW,CAAC,IAAI,CAAC,CAAC;oBAC9E,kBAAkB,CAAC,uBAAuB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;oBAG7D,kBAAkB,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;oBAC3D,MAAM;gBACR,CAAC;gBACD,OAAO,CAAC,CAAC,CAAC;oBACR,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACpE,CAAC;YACH,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { RegistrationErrorEvent } from '../events/error.event.js';
|
|
2
|
+
import { EventService } from '../services/event/event.service.js';
|
|
1
3
|
import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
|
|
2
4
|
import { Container } from './container.js';
|
|
3
5
|
export function Anchor() {
|
|
@@ -7,7 +9,7 @@ export function Anchor() {
|
|
|
7
9
|
modelSerializationService.registerClass(constructor.name, constructor);
|
|
8
10
|
})
|
|
9
11
|
.catch((error) => {
|
|
10
|
-
|
|
12
|
+
EventService.getInstance().emit(new RegistrationErrorEvent(error));
|
|
11
13
|
});
|
|
12
14
|
};
|
|
13
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.decorator.js","sourceRoot":"","sources":["../../src/decorators/anchor.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,UAAU,MAAM;IACpB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC;aACrC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAClC,yBAAyB,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,
|
|
1
|
+
{"version":3,"file":"anchor.decorator.js","sourceRoot":"","sources":["../../src/decorators/anchor.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,UAAU,MAAM;IACpB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC;aACrC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAClC,yBAAyB,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -19,5 +19,6 @@ export declare class Container {
|
|
|
19
19
|
static reset(): void;
|
|
20
20
|
static setDefault<T>(type: Constructable<T> | string, factory: Factory<T>): void;
|
|
21
21
|
static setFactoryTimeout(timeoutInMs: number): void;
|
|
22
|
+
static unRegisterFactory<T>(type: Constructable<T> | string): void;
|
|
22
23
|
}
|
|
23
24
|
export {};
|
|
@@ -29,7 +29,7 @@ export class Container {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
const newFactoryContainer = {
|
|
32
|
-
default:
|
|
32
|
+
default: true,
|
|
33
33
|
metadata,
|
|
34
34
|
};
|
|
35
35
|
this.factories[name].push(newFactoryContainer);
|
|
@@ -88,5 +88,9 @@ export class Container {
|
|
|
88
88
|
static setFactoryTimeout(timeoutInMs) {
|
|
89
89
|
this.FACTORY_TIMEOUT_IN_MS = timeoutInMs;
|
|
90
90
|
}
|
|
91
|
+
static unRegisterFactory(type) {
|
|
92
|
+
const name = typeof type === 'string' ? type : type.name;
|
|
93
|
+
delete this.factories[name];
|
|
94
|
+
}
|
|
91
95
|
}
|
|
92
96
|
//# sourceMappingURL=container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/decorators/container.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,SAAS;IACZ,MAAM,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAEpC,MAAM,CAAU,SAAS,GAM7B,EAAE,CAAC;IAEP,MAAM,CAAC,KAAK,CAAC,GAAG,CACd,IAA+B,EAC/B,OAGC;QAED,MAAM,IAAI,GAAG,O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,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACzD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EventService } from '../services/event/event.service.js';
|
|
2
|
+
export function EventSource(ofType) {
|
|
3
|
+
return function (target, propertyKey, descriptor) {
|
|
4
|
+
ofType.registrar(EventService.getInstance(), descriptor);
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=event-source.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-source.decorator.js","sourceRoot":"","sources":["../../src/decorators/event-source.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,MAAM,UAAU,WAAW,CACzB,MAAqC;IAErC,OAAO,UAAU,MAAW,EAAE,WAAmB,EAAE,UAA8B;QAC9E,MAAc,CAAC,SAAS,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { RegistrationErrorEvent } from '../events/error.event.js';
|
|
2
|
+
import { EventService } from '../services/event/event.service.js';
|
|
1
3
|
import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
|
|
2
4
|
import { Container } from './container.js';
|
|
3
5
|
export function Model() {
|
|
@@ -7,7 +9,7 @@ export function Model() {
|
|
|
7
9
|
modelSerializationService.registerClass(constructor.name, constructor);
|
|
8
10
|
})
|
|
9
11
|
.catch((error) => {
|
|
10
|
-
|
|
12
|
+
EventService.getInstance().emit(new RegistrationErrorEvent(error));
|
|
11
13
|
});
|
|
12
14
|
};
|
|
13
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.decorator.js","sourceRoot":"","sources":["../../src/decorators/model.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,UAAU,KAAK;IACnB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC;aACrC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAClC,yBAAyB,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,
|
|
1
|
+
{"version":3,"file":"model.decorator.js","sourceRoot":"","sources":["../../src/decorators/model.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,UAAU,KAAK;IACnB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC;aACrC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAClC,yBAAyB,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EventService } from '../services/event/event.service.js';
|
|
2
|
+
export function OnEvent(ofType) {
|
|
3
|
+
return function (target, propertyKey, descriptor) {
|
|
4
|
+
EventService.getInstance().registerListeners(ofType, target, descriptor);
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=on-event.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-event.decorator.js","sourceRoot":"","sources":["../../src/decorators/on-event.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,MAAM,UAAU,OAAO,CACrB,MAAqC;IAErC,OAAO,UAAU,MAAW,EAAE,WAAmB,EAAE,UAA8B;QAC/E,YAAY,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3E,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { RegistrationErrorEvent } from '../events/error.event.js';
|
|
2
|
+
import { EventService } from '../services/event/event.service.js';
|
|
1
3
|
import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
|
|
2
4
|
import { Container } from './container.js';
|
|
3
5
|
export function Overlay() {
|
|
@@ -7,7 +9,7 @@ export function Overlay() {
|
|
|
7
9
|
modelSerializationService.registerClass(constructor.name, constructor);
|
|
8
10
|
})
|
|
9
11
|
.catch((error) => {
|
|
10
|
-
|
|
12
|
+
EventService.getInstance().emit(new RegistrationErrorEvent(error));
|
|
11
13
|
});
|
|
12
14
|
};
|
|
13
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.decorator.js","sourceRoot":"","sources":["../../src/decorators/overlay.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,UAAU,OAAO;IACrB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC;aACrC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAClC,yBAAyB,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,
|
|
1
|
+
{"version":3,"file":"overlay.decorator.js","sourceRoot":"","sources":["../../src/decorators/overlay.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,UAAU,OAAO;IACrB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC;aACrC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAClC,yBAAyB,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { RegistrationErrorEvent } from '../events/error.event.js';
|
|
2
|
+
import { EventService } from '../services/event/event.service.js';
|
|
1
3
|
import { ResourceSerializationService } from '../services/serialization/resource/resource-serialization.service.js';
|
|
2
4
|
import { Container } from './container.js';
|
|
3
5
|
export function Resource() {
|
|
@@ -7,7 +9,7 @@ export function Resource() {
|
|
|
7
9
|
resourceSerializationService.registerClass(constructor.name, constructor);
|
|
8
10
|
})
|
|
9
11
|
.catch((error) => {
|
|
10
|
-
|
|
12
|
+
EventService.getInstance().emit(new RegistrationErrorEvent(error));
|
|
11
13
|
});
|
|
12
14
|
};
|
|
13
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.decorator.js","sourceRoot":"","sources":["../../src/decorators/resource.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sEAAsE,CAAC;AACpH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,UAAU,QAAQ;IACtB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC;aACxC,IAAI,CAAC,CAAC,4BAA4B,EAAE,EAAE;YACrC,4BAA4B,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC5E,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,
|
|
1
|
+
{"version":3,"file":"resource.decorator.js","sourceRoot":"","sources":["../../src/decorators/resource.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sEAAsE,CAAC;AACpH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,UAAU,QAAQ;IACtB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC;aACxC,IAAI,CAAC,CAAC,4BAA4B,EAAE,EAAE;YACrC,4BAA4B,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC5E,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.event.js","sourceRoot":"","sources":["../../src/events/error.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,OAAO,UAAW,SAAQ,KAAY;CAAG;AAE/C,MAAM,OAAO,sBAAuB,SAAQ,UAAU;CAAG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EventService } from '../services/event/event.service.js';
|
|
2
|
+
export declare class Event<T> {
|
|
3
|
+
readonly header: {
|
|
4
|
+
timestamp: number;
|
|
5
|
+
};
|
|
6
|
+
readonly payload: T;
|
|
7
|
+
readonly userData: object;
|
|
8
|
+
constructor(payload: T, userData?: object);
|
|
9
|
+
static registrar(...args: [EventService, PropertyDescriptor]): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class Event {
|
|
2
|
+
header;
|
|
3
|
+
payload;
|
|
4
|
+
userData;
|
|
5
|
+
constructor(payload, userData = {}) {
|
|
6
|
+
this.header = {
|
|
7
|
+
timestamp: Date.now(),
|
|
8
|
+
};
|
|
9
|
+
this.payload = payload;
|
|
10
|
+
this.userData = userData;
|
|
11
|
+
}
|
|
12
|
+
static registrar(...args) {
|
|
13
|
+
if (args.length !== 2) {
|
|
14
|
+
throw new Error('Invalid number of args in event registrar!');
|
|
15
|
+
}
|
|
16
|
+
throw new Error('Method not implemented! Use derived class implementation');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=event.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.model.js","sourceRoot":"","sources":["../../src/events/event.model.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,KAAK;IACP,MAAM,CAEb;IAEO,OAAO,CAAI;IAEX,QAAQ,CAAS;IAE1B,YAAY,OAAU,EAAE,WAAmB,EAAE;QAC3C,IAAI,CAAC,MAAM,GAAG;YACZ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,GAAG,IAAwC;QAC1D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Event } from './event.model.js';
|
|
2
|
+
export declare class HookEvent extends Event<void> {
|
|
3
|
+
}
|
|
4
|
+
export declare class CommitHookEvent extends HookEvent {
|
|
5
|
+
}
|
|
6
|
+
export declare class ModelActionHookEvent extends HookEvent {
|
|
7
|
+
}
|
|
8
|
+
export declare class ResourceActionHookEvent extends HookEvent {
|
|
9
|
+
}
|
|
10
|
+
export declare class CommitHookCallbackDoneEvent extends CommitHookEvent {
|
|
11
|
+
}
|
|
12
|
+
export declare class ModelActionHookCallbackDoneEvent extends ModelActionHookEvent {
|
|
13
|
+
}
|
|
14
|
+
export declare class ResourceActionHookCallbackDoneEvent extends ResourceActionHookEvent {
|
|
15
|
+
}
|
|
16
|
+
export declare class PostCommitHookCallbackDoneEvent extends CommitHookEvent {
|
|
17
|
+
}
|
|
18
|
+
export declare class PostModelActionHookCallbackDoneEvent extends ModelActionHookEvent {
|
|
19
|
+
}
|
|
20
|
+
export declare class PostResourceActionHookCallbackDoneEvent extends ResourceActionHookEvent {
|
|
21
|
+
}
|
|
22
|
+
export declare class PreCommitHookCallbackDoneEvent extends CommitHookEvent {
|
|
23
|
+
}
|
|
24
|
+
export declare class PreModelActionHookCallbackDoneEvent extends ModelActionHookEvent {
|
|
25
|
+
}
|
|
26
|
+
export declare class PreResourceActionHookCallbackDoneEvent extends ResourceActionHookEvent {
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Event } from './event.model.js';
|
|
2
|
+
export class HookEvent extends Event {
|
|
3
|
+
}
|
|
4
|
+
export class CommitHookEvent extends HookEvent {
|
|
5
|
+
}
|
|
6
|
+
export class ModelActionHookEvent extends HookEvent {
|
|
7
|
+
}
|
|
8
|
+
export class ResourceActionHookEvent extends HookEvent {
|
|
9
|
+
}
|
|
10
|
+
export class CommitHookCallbackDoneEvent extends CommitHookEvent {
|
|
11
|
+
}
|
|
12
|
+
export class ModelActionHookCallbackDoneEvent extends ModelActionHookEvent {
|
|
13
|
+
}
|
|
14
|
+
export class ResourceActionHookCallbackDoneEvent extends ResourceActionHookEvent {
|
|
15
|
+
}
|
|
16
|
+
export class PostCommitHookCallbackDoneEvent extends CommitHookEvent {
|
|
17
|
+
}
|
|
18
|
+
export class PostModelActionHookCallbackDoneEvent extends ModelActionHookEvent {
|
|
19
|
+
}
|
|
20
|
+
export class PostResourceActionHookCallbackDoneEvent extends ResourceActionHookEvent {
|
|
21
|
+
}
|
|
22
|
+
export class PreCommitHookCallbackDoneEvent extends CommitHookEvent {
|
|
23
|
+
}
|
|
24
|
+
export class PreModelActionHookCallbackDoneEvent extends ModelActionHookEvent {
|
|
25
|
+
}
|
|
26
|
+
export class PreResourceActionHookCallbackDoneEvent extends ResourceActionHookEvent {
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=hook.event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.event.js","sourceRoot":"","sources":["../../src/events/hook.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,OAAO,SAAU,SAAQ,KAAW;CAAG;AAE7C,MAAM,OAAO,eAAgB,SAAQ,SAAS;CAAG;AAEjD,MAAM,OAAO,oBAAqB,SAAQ,SAAS;CAAG;AAEtD,MAAM,OAAO,uBAAwB,SAAQ,SAAS;CAAG;AAEzD,MAAM,OAAO,2BAA4B,SAAQ,eAAe;CAAG;AAEnE,MAAM,OAAO,gCAAiC,SAAQ,oBAAoB;CAAG;AAE7E,MAAM,OAAO,mCAAoC,SAAQ,uBAAuB;CAAG;AAEnF,MAAM,OAAO,+BAAgC,SAAQ,eAAe;CAAG;AAEvE,MAAM,OAAO,oCAAqC,SAAQ,oBAAoB;CAAG;AAEjF,MAAM,OAAO,uCAAwC,SAAQ,uBAAuB;CAAG;AAEvF,MAAM,OAAO,8BAA+B,SAAQ,eAAe;CAAG;AAEtE,MAAM,OAAO,mCAAoC,SAAQ,oBAAoB;CAAG;AAEhF,MAAM,OAAO,sCAAuC,SAAQ,uBAAuB;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.event.js","sourceRoot":"","sources":["../../src/events/module.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,OAAO,WAAY,SAAQ,KAAa;CAAG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { EventService } from '../services/event/event.service.js';
|
|
2
|
+
import { Event } from './event.model.js';
|
|
3
|
+
export declare class RegistrationEvent extends Event<string> {
|
|
4
|
+
}
|
|
5
|
+
export declare class AnchorRegistrationEvent extends RegistrationEvent {
|
|
6
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
7
|
+
}
|
|
8
|
+
export declare class ModelActionRegistrationEvent extends RegistrationEvent {
|
|
9
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class ModelRegistrationEvent extends RegistrationEvent {
|
|
12
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class OverlayRegistrationEvent extends RegistrationEvent {
|
|
15
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
16
|
+
}
|
|
17
|
+
export declare class ResourceActionRegistrationEvent extends RegistrationEvent {
|
|
18
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
19
|
+
}
|
|
20
|
+
export declare class ResourceRegistrationEvent extends RegistrationEvent {
|
|
21
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { AModel } from '../models/model.abstract.js';
|
|
2
|
+
import { AAnchor } from '../overlays/anchor.abstract.js';
|
|
3
|
+
import { AOverlay } from '../overlays/overlay.abstract.js';
|
|
4
|
+
import { AResource } from '../resources/resource.abstract.js';
|
|
5
|
+
import { Event } from './event.model.js';
|
|
6
|
+
export class RegistrationEvent extends Event {
|
|
7
|
+
}
|
|
8
|
+
export class AnchorRegistrationEvent extends RegistrationEvent {
|
|
9
|
+
static registrar(eventService, descriptor) {
|
|
10
|
+
const originalMethod = descriptor.value;
|
|
11
|
+
descriptor.value = function (...args) {
|
|
12
|
+
originalMethod.apply(this, args);
|
|
13
|
+
if (args[1].prototype instanceof AAnchor) {
|
|
14
|
+
const event = new AnchorRegistrationEvent(args[1].name);
|
|
15
|
+
eventService.emit(event);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class ModelActionRegistrationEvent extends RegistrationEvent {
|
|
21
|
+
static registrar(eventService, descriptor) {
|
|
22
|
+
const originalMethod = descriptor.value;
|
|
23
|
+
descriptor.value = function (...args) {
|
|
24
|
+
originalMethod.apply(this, args);
|
|
25
|
+
for (const action of args[0]) {
|
|
26
|
+
const event = new ModelActionRegistrationEvent(action.ACTION_NAME);
|
|
27
|
+
eventService.emit(event);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export class ModelRegistrationEvent extends RegistrationEvent {
|
|
33
|
+
static registrar(eventService, descriptor) {
|
|
34
|
+
const originalMethod = descriptor.value;
|
|
35
|
+
descriptor.value = function (...args) {
|
|
36
|
+
originalMethod.apply(this, args);
|
|
37
|
+
if (args[1].prototype instanceof AModel) {
|
|
38
|
+
const event = new ModelRegistrationEvent(args[1].name);
|
|
39
|
+
eventService.emit(event);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export class OverlayRegistrationEvent extends RegistrationEvent {
|
|
45
|
+
static registrar(eventService, descriptor) {
|
|
46
|
+
const originalMethod = descriptor.value;
|
|
47
|
+
descriptor.value = function (...args) {
|
|
48
|
+
originalMethod.apply(this, args);
|
|
49
|
+
if (args[1].prototype instanceof AOverlay) {
|
|
50
|
+
const event = new OverlayRegistrationEvent(args[1].name);
|
|
51
|
+
eventService.emit(event);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export class ResourceActionRegistrationEvent extends RegistrationEvent {
|
|
57
|
+
static registrar(eventService, descriptor) {
|
|
58
|
+
const originalMethod = descriptor.value;
|
|
59
|
+
descriptor.value = function (...args) {
|
|
60
|
+
originalMethod.apply(this, args);
|
|
61
|
+
for (const action of args[0]) {
|
|
62
|
+
const event = new ResourceActionRegistrationEvent(action.ACTION_NAME);
|
|
63
|
+
eventService.emit(event);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export class ResourceRegistrationEvent extends RegistrationEvent {
|
|
69
|
+
static registrar(eventService, descriptor) {
|
|
70
|
+
const originalMethod = descriptor.value;
|
|
71
|
+
descriptor.value = function (...args) {
|
|
72
|
+
originalMethod.apply(this, args);
|
|
73
|
+
if (args[1].prototype instanceof AResource) {
|
|
74
|
+
const event = new ResourceRegistrationEvent(args[1].name);
|
|
75
|
+
eventService.emit(event);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=registration.event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration.event.js","sourceRoot":"","sources":["../../src/events/registration.event.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,OAAO,iBAAkB,SAAQ,KAAa;CAAG;AAEvD,MAAM,OAAO,uBAAwB,SAAQ,iBAAiB;IAC5D,MAAM,CAAU,SAAS,CAAC,YAA0B,EAAE,UAA8B;QAClF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAsC;YACpE,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEjC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,YAAY,OAAO,EAAE,CAAC;gBACzC,MAAM,KAAK,GAAG,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBACxD,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,4BAA6B,SAAQ,iBAAiB;IACjE,MAAM,CAAU,SAAS,CAAC,YAA0B,EAAE,UAA8B;QAClF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAsB;YACpD,cAA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YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,+BAAgC,SAAQ,iBAAiB;IACpE,MAAM,CAAU,SAAS,CAAC,YAA0B,EAAE,UAA8B;QAClF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAyB;YACvD,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEjC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC7B,MAAM,KAAK,GAAG,IAAI,+BAA+B,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;gBACtE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IAC9D,MAAM,CAAU,SAAS,CAAC,YAA0B,EAAE,UAA8B;QAClF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAsC;YACpE,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEjC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,YAAY,SAAS,EAAE,CAAC;gBAC3C,MAAM,KAAK,GAAG,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBAC1D,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Event } from './event.model.js';
|
|
2
|
+
export declare class SerializationEvent extends Event<void> {
|
|
3
|
+
}
|
|
4
|
+
export declare class ModelDeserializedEvent extends SerializationEvent {
|
|
5
|
+
}
|
|
6
|
+
export declare class ModelSerializedEvent extends SerializationEvent {
|
|
7
|
+
}
|
|
8
|
+
export declare class ResourceDeserializedEvent extends SerializationEvent {
|
|
9
|
+
}
|
|
10
|
+
export declare class ResourceSerializedEvent extends SerializationEvent {
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Event } from './event.model.js';
|
|
2
|
+
export class SerializationEvent extends Event {
|
|
3
|
+
}
|
|
4
|
+
export class ModelDeserializedEvent extends SerializationEvent {
|
|
5
|
+
}
|
|
6
|
+
export class ModelSerializedEvent extends SerializationEvent {
|
|
7
|
+
}
|
|
8
|
+
export class ResourceDeserializedEvent extends SerializationEvent {
|
|
9
|
+
}
|
|
10
|
+
export class ResourceSerializedEvent extends SerializationEvent {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=serialization.event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialization.event.js","sourceRoot":"","sources":["../../src/events/serialization.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,OAAO,kBAAmB,SAAQ,KAAW;CAAG;AAEtD,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;CAAG;AAEjE,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;CAAG;AAE/D,MAAM,OAAO,yBAA0B,SAAQ,kBAAkB;CAAG;AAEpE,MAAM,OAAO,uBAAwB,SAAQ,kBAAkB;CAAG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Event } from './event.model.js';
|
|
2
|
+
export declare class TransactionEvent extends Event<string> {
|
|
3
|
+
}
|
|
4
|
+
export declare class ModelActionTransactionEvent extends TransactionEvent {
|
|
5
|
+
}
|
|
6
|
+
export declare class ResourceActionTransactionEvent extends TransactionEvent {
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Event } from './event.model.js';
|
|
2
|
+
export class TransactionEvent extends Event {
|
|
3
|
+
}
|
|
4
|
+
export class ModelActionTransactionEvent extends TransactionEvent {
|
|
5
|
+
}
|
|
6
|
+
export class ResourceActionTransactionEvent extends TransactionEvent {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=transaction.event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.event.js","sourceRoot":"","sources":["../../src/events/transaction.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,OAAO,gBAAiB,SAAQ,KAAa;CAAG;AAEtD,MAAM,OAAO,2BAA4B,SAAQ,gBAAgB;CAAG;AAEpE,MAAM,OAAO,8BAA+B,SAAQ,gBAAgB;CAAG"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CommitHookCallbackDoneEvent, PostCommitHookCallbackDoneEvent, PreCommitHookCallbackDoneEvent, } from '../../events/hook.event.js';
|
|
2
|
+
import { EventService } from '../../services/event/event.service.js';
|
|
1
3
|
export class CommitHook {
|
|
2
4
|
static instance;
|
|
3
5
|
postCommitHooks = [];
|
|
@@ -24,10 +26,13 @@ export class CommitHook {
|
|
|
24
26
|
descriptor.value = async function (...args) {
|
|
25
27
|
for (const callback of self.preCommitHooks) {
|
|
26
28
|
await callback.apply(this, args);
|
|
29
|
+
EventService.getInstance().emit(new PreCommitHookCallbackDoneEvent());
|
|
27
30
|
}
|
|
28
31
|
await originalMethod.apply(this, args);
|
|
32
|
+
EventService.getInstance().emit(new CommitHookCallbackDoneEvent());
|
|
29
33
|
for (const callback of self.postCommitHooks) {
|
|
30
34
|
await callback.apply(this, args);
|
|
35
|
+
EventService.getInstance().emit(new PostCommitHookCallbackDoneEvent());
|
|
31
36
|
}
|
|
32
37
|
};
|
|
33
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit.hook.js","sourceRoot":"","sources":["../../../src/functions/hook/commit.hook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commit.hook.js","sourceRoot":"","sources":["../../../src/functions/hook/commit.hook.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAIrE,MAAM,OAAO,UAAU;IACb,MAAM,CAAC,QAAQ,CAAa;IAEnB,eAAe,GAAgC,EAAE,CAAC;IAClD,cAAc,GAAgC,EAAE,CAAC;IAElE,YAAY,CAAC,iBAA6C;QACxD,KAAK,MAAM,CAAC,IAAI,iBAAiB,EAAE,CAAC;YAClC,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,eAAe,IAAI,EAAE,EAAE,CAAC;gBAC9D,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtC,CAAC;YAED,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,cAAc,IAAI,EAAE,EAAE,CAAC;gBAC7D,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,SAAS,CAAC,UAA8B;QAGtC,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,KAAK,WAAW,GAAG,IAA6B;YACjE,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBAC3C,MAAM,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBACjC,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,8BAA8B,EAAE,CAAC,CAAC;YACxE,CAAC;YAED,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACvC,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,2BAA2B,EAAE,CAAC,CAAC;YAEnE,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBAC5C,MAAM,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBACjC,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,+BAA+B,EAAE,CAAC,CAAC;YACzE,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IAED,KAAK;QACH,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Container } from '../../decorators/container.js';
|
|
2
|
+
import { ModelActionHookCallbackDoneEvent, PostModelActionHookCallbackDoneEvent, PreModelActionHookCallbackDoneEvent, } from '../../events/hook.event.js';
|
|
3
|
+
import { EventService } from '../../services/event/event.service.js';
|
|
2
4
|
import { InputService } from '../../services/input/input.service.js';
|
|
3
5
|
export class ModelActionHook {
|
|
4
6
|
static instance;
|
|
@@ -42,8 +44,10 @@ export class ModelActionHook {
|
|
|
42
44
|
return accumulator;
|
|
43
45
|
}, {});
|
|
44
46
|
output = await handle.apply(this, [args[0], resolvedInputs, output]);
|
|
47
|
+
EventService.getInstance().emit(new PreModelActionHookCallbackDoneEvent());
|
|
45
48
|
}
|
|
46
49
|
output = await originalHandleMethod.apply(this, [args[0], args[1], output]);
|
|
50
|
+
EventService.getInstance().emit(new ModelActionHookCallbackDoneEvent());
|
|
47
51
|
for (const { collectInput, handle } of self.postModelActionHooks[modelAction.ACTION_NAME] || []) {
|
|
48
52
|
const inputs = collectInput ? collectInput(args[0]) : [];
|
|
49
53
|
const resolvedInputs = inputs.reduce((accumulator, currentValue) => {
|
|
@@ -54,6 +58,7 @@ export class ModelActionHook {
|
|
|
54
58
|
return accumulator;
|
|
55
59
|
}, {});
|
|
56
60
|
output = await handle.apply(this, [args[0], resolvedInputs, output]);
|
|
61
|
+
EventService.getInstance().emit(new PostModelActionHookCallbackDoneEvent());
|
|
57
62
|
}
|
|
58
63
|
return output;
|
|
59
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-action.hook.js","sourceRoot":"","sources":["../../../src/functions/hook/model-action.hook.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"model-action.hook.js","sourceRoot":"","sources":["../../../src/functions/hook/model-action.hook.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EACL,gCAAgC,EAChC,oCAAoC,EACpC,mCAAmC,GACpC,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAIrE,MAAM,OAAO,eAAe;IAClB,MAAM,CAAC,QAAQ,CAAkB;IAExB,oBAAoB,GAEjC,EAAE,CAAC;IACU,mBAAmB,GAEhC,EAAE,CAAC;IAEP,YAAY,CAAC,iBAA6C;QACxD,KAAK,MAAM,CAAC,IAAI,iBAAiB,EAAE,CAAC;YAClC,KAAK,MAAM,EAAE,WAAW,EAAE,Y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MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzD,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,YAAY,EAAE,EAAE;oBACjE,WAAW,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;oBAChE,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC;wBAC/B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;oBAChE,CAAC;oBACD,OAAO,WAAW,CAAC;gBACrB,CAAC,EAAE,EAAE,CAAC,CAAC;gBACP,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;gBACrE,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,oCAAoC,EAAE,CAAC,CAAC;YAC9E,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;IAED,KAAK;QACH,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PostResourceActionHookCallbackDoneEvent, PreResourceActionHookCallbackDoneEvent, ResourceActionHookCallbackDoneEvent, } from '../../events/hook.event.js';
|
|
2
|
+
import { EventService } from '../../services/event/event.service.js';
|
|
1
3
|
export class ResourceActionHook {
|
|
2
4
|
static instance;
|
|
3
5
|
postResourceActionHooks = {};
|
|
@@ -30,10 +32,13 @@ export class ResourceActionHook {
|
|
|
30
32
|
resourceAction.handle = async function (...args) {
|
|
31
33
|
for (const { handle } of self.preResourceActionHooks[resourceAction.ACTION_NAME] || []) {
|
|
32
34
|
await handle.apply(this, args);
|
|
35
|
+
EventService.getInstance().emit(new PreResourceActionHookCallbackDoneEvent());
|
|
33
36
|
}
|
|
34
37
|
await originalHandleMethod.apply(this, args);
|
|
38
|
+
EventService.getInstance().emit(new ResourceActionHookCallbackDoneEvent());
|
|
35
39
|
for (const { handle } of self.postResourceActionHooks[resourceAction.ACTION_NAME] || []) {
|
|
36
40
|
await handle.apply(this, args);
|
|
41
|
+
EventService.getInstance().emit(new PostResourceActionHookCallbackDoneEvent());
|
|
37
42
|
}
|
|
38
43
|
};
|
|
39
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-action.hook.js","sourceRoot":"","sources":["../../../src/functions/hook/resource-action.hook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resource-action.hook.js","sourceRoot":"","sources":["../../../src/functions/hook/resource-action.hook.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uCAAuC,EACvC,sCAAsC,EACtC,mCAAmC,GACpC,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAIrE,MAAM,OAAO,kBAAkB;IACrB,MAAM,CAAC,QAAQ,CAAqB;IAE3B,uBAAuB,GAEpC,EAAE,CAAC;IACU,sBAAsB,GAEnC,EAAE,CAAC;IAEP,YAAY,CAAC,iBAA6C;QACxD,KAAK,MAAM,CAAC,IAAI,iBAAiB,EAAE,CAAC;YAClC,KAAK,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,uBAAuB,IAAI,EAAE,EAAE,CAAC;gBACjF,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC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