@kosdev-code/kos-codegen-core 3.0.22 → 3.0.23
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-codegen-core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.23",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"kos": {
|
|
27
27
|
"build": {
|
|
28
|
-
"gitHash": "
|
|
28
|
+
"gitHash": "78a2bbd25c176cfbcb4add6ee11dd660941657c2"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -11,12 +11,11 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
IKosDataModel
|
|
13
13
|
} from "../../../core/core/kosModel";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<% } %>import type { IKosIdentifiable } from "../../../core/core/types";
|
|
14
|
+
import type { KosRegistrationFor } from "../../../core/core/registration/model-registration";
|
|
15
|
+
import type { IKosIdentifiable } from "../../../core/core/types";
|
|
17
16
|
import type { PublicModelInterface } from "../../../core/types";
|
|
18
17
|
<% } else { %>import { kosModel, kosContainerAware, type KosContainerAware } from "@kosdev-code/kos-ui-sdk";
|
|
19
|
-
import { type
|
|
18
|
+
import { type KosRegistrationFor, IKosDataModel, IKosIdentifiable, PublicModelInterface, kosLoggerAware, type KosLoggerAware } from "@kosdev-code/kos-ui-sdk";<% } %>
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
import type { <%= nameProperCase %>Options } from "./types";
|
|
@@ -30,19 +29,16 @@ export type <%= nameProperCase %>Model = PublicModelInterface<<%= nameProperCase
|
|
|
30
29
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
31
30
|
export interface <%= nameProperCase %>ModelImpl extends KosLoggerAware, KosContainerAware<<%= modelNameProperCase %>Model> {}
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
// Flipping `singleton` here moves the Registration type with it.
|
|
33
|
+
export const MODEL_CONFIG = { modelTypeId: MODEL_TYPE, singleton: <%= singleton === false ? "false" : "true" %><% if (autoRegister) { %>, autoRegister: true<% } %> } as const;
|
|
34
|
+
|
|
35
|
+
@kosModel(MODEL_CONFIG)
|
|
34
36
|
@kosContainerAware<<%= modelNameProperCase %>Model>()
|
|
35
37
|
@kosLoggerAware()
|
|
36
38
|
export class <%= nameProperCase %>ModelImpl implements IKosIdentifiable, IKosDataModel {
|
|
37
39
|
|
|
38
|
-
// Registration property for type safety - actual value injected by @kosModel
|
|
39
|
-
|
|
40
|
-
// decorator injects SingletonKosModelRegistrationFactory when singleton: true,
|
|
41
|
-
// KosModelRegistrationFactory when false).
|
|
42
|
-
static Registration: <%= singleton === false ? "KosModelRegistrationType" : "SingletonKosModelRegistrationFactory" %><
|
|
43
|
-
<%= nameProperCase %>Model,
|
|
44
|
-
<%= nameProperCase %>Options
|
|
45
|
-
>;
|
|
40
|
+
// Registration property for type safety - actual value injected by @kosModel decorator
|
|
41
|
+
static Registration: KosRegistrationFor<typeof MODEL_CONFIG, <%= nameProperCase %>Model, <%= nameProperCase %>Options>;
|
|
46
42
|
|
|
47
43
|
|
|
48
44
|
id: string;
|