@things-factory/mlops 10.0.0-zeta.7 → 10.0.0

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 (66) hide show
  1. package/dist-client/bootstrap.d.ts +1 -0
  2. package/dist-client/bootstrap.js +40 -0
  3. package/dist-client/bootstrap.js.map +1 -0
  4. package/dist-client/index.d.ts +2 -0
  5. package/dist-client/index.js +3 -0
  6. package/dist-client/index.js.map +1 -0
  7. package/dist-client/pages/ml-deployment/ml-deployment-list-page.d.ts +5 -0
  8. package/dist-client/pages/ml-deployment/ml-deployment-list-page.js +49 -0
  9. package/dist-client/pages/ml-deployment/ml-deployment-list-page.js.map +1 -0
  10. package/dist-client/pages/ml-model/ml-model-list-page.d.ts +5 -0
  11. package/dist-client/pages/ml-model/ml-model-list-page.js +49 -0
  12. package/dist-client/pages/ml-model/ml-model-list-page.js.map +1 -0
  13. package/dist-client/pages/ml-pipeline/ml-pipeline-list-page.d.ts +5 -0
  14. package/dist-client/pages/ml-pipeline/ml-pipeline-list-page.js +49 -0
  15. package/dist-client/pages/ml-pipeline/ml-pipeline-list-page.js.map +1 -0
  16. package/dist-client/pages/mlops-dashboard/mlops-dashboard-page.d.ts +5 -0
  17. package/dist-client/pages/mlops-dashboard/mlops-dashboard-page.js +93 -0
  18. package/dist-client/pages/mlops-dashboard/mlops-dashboard-page.js.map +1 -0
  19. package/dist-client/route.d.ts +1 -0
  20. package/dist-client/route.js +17 -0
  21. package/dist-client/route.js.map +1 -0
  22. package/dist-client/tsconfig.tsbuildinfo +1 -0
  23. package/dist-server/index.d.ts +2 -0
  24. package/dist-server/index.js +6 -0
  25. package/dist-server/index.js.map +1 -0
  26. package/dist-server/routes.d.ts +5 -0
  27. package/dist-server/routes.js +12 -0
  28. package/dist-server/routes.js.map +1 -0
  29. package/dist-server/service/index.d.ts +8 -0
  30. package/dist-server/service/index.js +31 -0
  31. package/dist-server/service/index.js.map +1 -0
  32. package/dist-server/service/ml-deployment/index.d.ts +3 -0
  33. package/dist-server/service/ml-deployment/index.js +8 -0
  34. package/dist-server/service/ml-deployment/index.js.map +1 -0
  35. package/dist-server/service/ml-deployment/ml-deployment.d.ts +48 -0
  36. package/dist-server/service/ml-deployment/ml-deployment.js +153 -0
  37. package/dist-server/service/ml-deployment/ml-deployment.js.map +1 -0
  38. package/dist-server/service/ml-model/index.d.ts +5 -0
  39. package/dist-server/service/ml-model/index.js +11 -0
  40. package/dist-server/service/ml-model/index.js.map +1 -0
  41. package/dist-server/service/ml-model/ml-model-mutation.d.ts +24 -0
  42. package/dist-server/service/ml-model/ml-model-mutation.js +177 -0
  43. package/dist-server/service/ml-model/ml-model-mutation.js.map +1 -0
  44. package/dist-server/service/ml-model/ml-model-query.d.ts +23 -0
  45. package/dist-server/service/ml-model/ml-model-query.js +123 -0
  46. package/dist-server/service/ml-model/ml-model-query.js.map +1 -0
  47. package/dist-server/service/ml-model/ml-model-types.d.ts +27 -0
  48. package/dist-server/service/ml-model/ml-model-types.js +105 -0
  49. package/dist-server/service/ml-model/ml-model-types.js.map +1 -0
  50. package/dist-server/service/ml-model/ml-model.d.ts +52 -0
  51. package/dist-server/service/ml-model/ml-model.js +161 -0
  52. package/dist-server/service/ml-model/ml-model.js.map +1 -0
  53. package/dist-server/service/ml-pipeline/index.d.ts +3 -0
  54. package/dist-server/service/ml-pipeline/index.js +8 -0
  55. package/dist-server/service/ml-pipeline/index.js.map +1 -0
  56. package/dist-server/service/ml-pipeline/ml-pipeline.d.ts +50 -0
  57. package/dist-server/service/ml-pipeline/ml-pipeline.js +163 -0
  58. package/dist-server/service/ml-pipeline/ml-pipeline.js.map +1 -0
  59. package/dist-server/service/ml-pipeline-run/index.d.ts +3 -0
  60. package/dist-server/service/ml-pipeline-run/index.js +8 -0
  61. package/dist-server/service/ml-pipeline-run/index.js.map +1 -0
  62. package/dist-server/service/ml-pipeline-run/ml-pipeline-run.d.ts +40 -0
  63. package/dist-server/service/ml-pipeline-run/ml-pipeline-run.js +136 -0
  64. package/dist-server/service/ml-pipeline-run/ml-pipeline-run.js.map +1 -0
  65. package/dist-server/tsconfig.tsbuildinfo +1 -0
  66. package/package.json +12 -12
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MLModelQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const typeorm_1 = require("typeorm");
7
+ const ml_model_1 = require("./ml-model");
8
+ let MLModelQuery = class MLModelQuery {
9
+ /**
10
+ * Get all ML models
11
+ */
12
+ async mlModels(context) {
13
+ const { domain } = context.state;
14
+ return await (0, typeorm_1.getRepository)(ml_model_1.MLModel).find({
15
+ where: { domain: { id: domain.id } },
16
+ order: { createdAt: 'DESC' },
17
+ relations: ['creator', 'updater']
18
+ });
19
+ }
20
+ /**
21
+ * Get ML model by ID
22
+ */
23
+ async mlModel(id, context) {
24
+ const { domain } = context.state;
25
+ return await (0, typeorm_1.getRepository)(ml_model_1.MLModel).findOne({
26
+ where: { id, domain: { id: domain.id } },
27
+ relations: ['creator', 'updater']
28
+ });
29
+ }
30
+ /**
31
+ * Get models by stage
32
+ */
33
+ async mlModelsByStage(stage, context) {
34
+ const { domain } = context.state;
35
+ return await (0, typeorm_1.getRepository)(ml_model_1.MLModel).find({
36
+ where: { domain: { id: domain.id }, stage },
37
+ order: { updatedAt: 'DESC' },
38
+ relations: ['creator', 'updater']
39
+ });
40
+ }
41
+ /**
42
+ * Get models by name (all versions)
43
+ */
44
+ async mlModelVersions(name, context) {
45
+ const { domain } = context.state;
46
+ return await (0, typeorm_1.getRepository)(ml_model_1.MLModel).find({
47
+ where: { domain: { id: domain.id }, name },
48
+ order: { createdAt: 'DESC' },
49
+ relations: ['creator', 'updater']
50
+ });
51
+ }
52
+ /**
53
+ * Get models by Label Studio project
54
+ */
55
+ async mlModelsByLabelStudioProject(projectId, context) {
56
+ const { domain } = context.state;
57
+ return await (0, typeorm_1.getRepository)(ml_model_1.MLModel).find({
58
+ where: { domain: { id: domain.id }, labelStudioProjectId: projectId },
59
+ order: { createdAt: 'DESC' },
60
+ relations: ['creator', 'updater']
61
+ });
62
+ }
63
+ };
64
+ exports.MLModelQuery = MLModelQuery;
65
+ tslib_1.__decorate([
66
+ (0, type_graphql_1.Query)(returns => [ml_model_1.MLModel], {
67
+ description: 'Get all ML models in the system'
68
+ }),
69
+ (0, type_graphql_1.Directive)('@privilege(category: "mlops", privilege: "query")'),
70
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
71
+ tslib_1.__metadata("design:type", Function),
72
+ tslib_1.__metadata("design:paramtypes", [Object]),
73
+ tslib_1.__metadata("design:returntype", Promise)
74
+ ], MLModelQuery.prototype, "mlModels", null);
75
+ tslib_1.__decorate([
76
+ (0, type_graphql_1.Query)(returns => ml_model_1.MLModel, {
77
+ description: 'Get ML model by ID',
78
+ nullable: true
79
+ }),
80
+ (0, type_graphql_1.Directive)('@privilege(category: "mlops", privilege: "query")'),
81
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
82
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
83
+ tslib_1.__metadata("design:type", Function),
84
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
85
+ tslib_1.__metadata("design:returntype", Promise)
86
+ ], MLModelQuery.prototype, "mlModel", null);
87
+ tslib_1.__decorate([
88
+ (0, type_graphql_1.Query)(returns => [ml_model_1.MLModel], {
89
+ description: 'Get models by deployment stage'
90
+ }),
91
+ (0, type_graphql_1.Directive)('@privilege(category: "mlops", privilege: "query")'),
92
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('stage', type => ml_model_1.ModelStage)),
93
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
94
+ tslib_1.__metadata("design:type", Function),
95
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
96
+ tslib_1.__metadata("design:returntype", Promise)
97
+ ], MLModelQuery.prototype, "mlModelsByStage", null);
98
+ tslib_1.__decorate([
99
+ (0, type_graphql_1.Query)(returns => [ml_model_1.MLModel], {
100
+ description: 'Get all versions of a model by name'
101
+ }),
102
+ (0, type_graphql_1.Directive)('@privilege(category: "mlops", privilege: "query")'),
103
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
104
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
105
+ tslib_1.__metadata("design:type", Function),
106
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
107
+ tslib_1.__metadata("design:returntype", Promise)
108
+ ], MLModelQuery.prototype, "mlModelVersions", null);
109
+ tslib_1.__decorate([
110
+ (0, type_graphql_1.Query)(returns => [ml_model_1.MLModel], {
111
+ description: 'Get models associated with Label Studio project'
112
+ }),
113
+ (0, type_graphql_1.Directive)('@privilege(category: "mlops", privilege: "query")'),
114
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('projectId', type => Number)),
115
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
116
+ tslib_1.__metadata("design:type", Function),
117
+ tslib_1.__metadata("design:paramtypes", [Number, Object]),
118
+ tslib_1.__metadata("design:returntype", Promise)
119
+ ], MLModelQuery.prototype, "mlModelsByLabelStudioProject", null);
120
+ exports.MLModelQuery = MLModelQuery = tslib_1.__decorate([
121
+ (0, type_graphql_1.Resolver)(ml_model_1.MLModel)
122
+ ], MLModelQuery);
123
+ //# sourceMappingURL=ml-model-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ml-model-query.js","sourceRoot":"","sources":["../../../server/service/ml-model/ml-model-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmE;AACnE,qCAA2C;AAC3C,yCAAgD;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB;;OAEG;IAKG,AAAN,KAAK,CAAC,QAAQ,CAAQ,OAAwB;QAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,IAA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AAE;QAC3B,WAAW,EAAE,gCAAgC;KAC9C,CAAC;IACD,IAAA,wBAAS,EAAC,mDAAmD,CAAC;IAE5D,mBAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,qBAAU,CAAC,CAAA;IAChC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;mDASP;AASK;IAJL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,kBAAO,CAAC,EAAE;QAC3B,WAAW,EAAE,qCAAqC;KACnD,CAAC;IACD,IAAA,wBAAS,EAAC,mDAAmD,CAAC;IACxC,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;mDAQtD;AASK;IAJL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,kBAAO,CAAC,EAAE;QAC3B,WAAW,EAAE,iDAAiD;KAC/D,CAAC;IACD,IAAA,wBAAS,EAAC,mDAAmD,CAAC;IAE5D,mBAAA,IAAA,kBAAG,EAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;IAChC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gEASP;uBA1FU,YAAY;IADxB,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CA2FxB","sourcesContent":["import { Resolver, Query, Arg, Ctx, Directive } from 'type-graphql'\nimport { getRepository, In } from 'typeorm'\nimport { MLModel, ModelStage } from './ml-model'\n\n@Resolver(MLModel)\nexport class MLModelQuery {\n /**\n * Get all ML models\n */\n @Query(returns => [MLModel], {\n description: 'Get all ML models in the system'\n })\n @Directive('@privilege(category: \"mlops\", privilege: \"query\")')\n async mlModels(@Ctx() context: ResolverContext): Promise<MLModel[]> {\n const { domain } = context.state\n\n return await getRepository(MLModel).find({\n where: { domain: { id: domain.id } },\n order: { createdAt: 'DESC' },\n relations: ['creator', 'updater']\n })\n }\n\n /**\n * Get ML model by ID\n */\n @Query(returns => MLModel, {\n description: 'Get ML model by ID',\n nullable: true\n })\n @Directive('@privilege(category: \"mlops\", privilege: \"query\")')\n async mlModel(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<MLModel | undefined> {\n const { domain } = context.state\n\n return await getRepository(MLModel).findOne({\n where: { id, domain: { id: domain.id } },\n relations: ['creator', 'updater']\n })\n }\n\n /**\n * Get models by stage\n */\n @Query(returns => [MLModel], {\n description: 'Get models by deployment stage'\n })\n @Directive('@privilege(category: \"mlops\", privilege: \"query\")')\n async mlModelsByStage(\n @Arg('stage', type => ModelStage) stage: ModelStage,\n @Ctx() context: ResolverContext\n ): Promise<MLModel[]> {\n const { domain } = context.state\n\n return await getRepository(MLModel).find({\n where: { domain: { id: domain.id }, stage },\n order: { updatedAt: 'DESC' },\n relations: ['creator', 'updater']\n })\n }\n\n /**\n * Get models by name (all versions)\n */\n @Query(returns => [MLModel], {\n description: 'Get all versions of a model by name'\n })\n @Directive('@privilege(category: \"mlops\", privilege: \"query\")')\n async mlModelVersions(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<MLModel[]> {\n const { domain } = context.state\n\n return await getRepository(MLModel).find({\n where: { domain: { id: domain.id }, name },\n order: { createdAt: 'DESC' },\n relations: ['creator', 'updater']\n })\n }\n\n /**\n * Get models by Label Studio project\n */\n @Query(returns => [MLModel], {\n description: 'Get models associated with Label Studio project'\n })\n @Directive('@privilege(category: \"mlops\", privilege: \"query\")')\n async mlModelsByLabelStudioProject(\n @Arg('projectId', type => Number) projectId: number,\n @Ctx() context: ResolverContext\n ): Promise<MLModel[]> {\n const { domain } = context.state\n\n return await getRepository(MLModel).find({\n where: { domain: { id: domain.id }, labelStudioProjectId: projectId },\n order: { createdAt: 'DESC' },\n relations: ['creator', 'updater']\n })\n }\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { ModelStage, ModelFramework } from './ml-model';
2
+ export declare class RegisterMLModelInput {
3
+ name: string;
4
+ version: string;
5
+ description?: string;
6
+ stage?: ModelStage;
7
+ framework?: ModelFramework;
8
+ metrics?: string;
9
+ metadata?: string;
10
+ artifactUri?: string;
11
+ mlflowRunId?: string;
12
+ mlflowExperimentId?: string;
13
+ labelStudioProjectId?: number;
14
+ tags?: string;
15
+ }
16
+ export declare class UpdateMLModelInput {
17
+ description?: string;
18
+ stage?: ModelStage;
19
+ metrics?: string;
20
+ metadata?: string;
21
+ tags?: string;
22
+ }
23
+ export declare class PromoteModelInput {
24
+ modelId: string;
25
+ targetStage: ModelStage;
26
+ notes?: string;
27
+ }
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PromoteModelInput = exports.UpdateMLModelInput = exports.RegisterMLModelInput = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const ml_model_1 = require("./ml-model");
7
+ let RegisterMLModelInput = class RegisterMLModelInput {
8
+ };
9
+ exports.RegisterMLModelInput = RegisterMLModelInput;
10
+ tslib_1.__decorate([
11
+ (0, type_graphql_1.Field)({ description: 'Model name' }),
12
+ tslib_1.__metadata("design:type", String)
13
+ ], RegisterMLModelInput.prototype, "name", void 0);
14
+ tslib_1.__decorate([
15
+ (0, type_graphql_1.Field)({ description: 'Model version' }),
16
+ tslib_1.__metadata("design:type", String)
17
+ ], RegisterMLModelInput.prototype, "version", void 0);
18
+ tslib_1.__decorate([
19
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Model description' }),
20
+ tslib_1.__metadata("design:type", String)
21
+ ], RegisterMLModelInput.prototype, "description", void 0);
22
+ tslib_1.__decorate([
23
+ (0, type_graphql_1.Field)(type => ml_model_1.ModelStage, { nullable: true, description: 'Initial stage' }),
24
+ tslib_1.__metadata("design:type", String)
25
+ ], RegisterMLModelInput.prototype, "stage", void 0);
26
+ tslib_1.__decorate([
27
+ (0, type_graphql_1.Field)(type => ml_model_1.ModelFramework, { nullable: true, description: 'ML framework' }),
28
+ tslib_1.__metadata("design:type", String)
29
+ ], RegisterMLModelInput.prototype, "framework", void 0);
30
+ tslib_1.__decorate([
31
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Model metrics as JSON string' }),
32
+ tslib_1.__metadata("design:type", String)
33
+ ], RegisterMLModelInput.prototype, "metrics", void 0);
34
+ tslib_1.__decorate([
35
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Model metadata as JSON string' }),
36
+ tslib_1.__metadata("design:type", String)
37
+ ], RegisterMLModelInput.prototype, "metadata", void 0);
38
+ tslib_1.__decorate([
39
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Artifact URI' }),
40
+ tslib_1.__metadata("design:type", String)
41
+ ], RegisterMLModelInput.prototype, "artifactUri", void 0);
42
+ tslib_1.__decorate([
43
+ (0, type_graphql_1.Field)({ nullable: true, description: 'MLflow run ID' }),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], RegisterMLModelInput.prototype, "mlflowRunId", void 0);
46
+ tslib_1.__decorate([
47
+ (0, type_graphql_1.Field)({ nullable: true, description: 'MLflow experiment ID' }),
48
+ tslib_1.__metadata("design:type", String)
49
+ ], RegisterMLModelInput.prototype, "mlflowExperimentId", void 0);
50
+ tslib_1.__decorate([
51
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Label Studio project ID' }),
52
+ tslib_1.__metadata("design:type", Number)
53
+ ], RegisterMLModelInput.prototype, "labelStudioProjectId", void 0);
54
+ tslib_1.__decorate([
55
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Tags as JSON array string' }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], RegisterMLModelInput.prototype, "tags", void 0);
58
+ exports.RegisterMLModelInput = RegisterMLModelInput = tslib_1.__decorate([
59
+ (0, type_graphql_1.InputType)({ description: 'Input for registering ML model' })
60
+ ], RegisterMLModelInput);
61
+ let UpdateMLModelInput = class UpdateMLModelInput {
62
+ };
63
+ exports.UpdateMLModelInput = UpdateMLModelInput;
64
+ tslib_1.__decorate([
65
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Model description' }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], UpdateMLModelInput.prototype, "description", void 0);
68
+ tslib_1.__decorate([
69
+ (0, type_graphql_1.Field)(type => ml_model_1.ModelStage, { nullable: true, description: 'Stage' }),
70
+ tslib_1.__metadata("design:type", String)
71
+ ], UpdateMLModelInput.prototype, "stage", void 0);
72
+ tslib_1.__decorate([
73
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Model metrics as JSON string' }),
74
+ tslib_1.__metadata("design:type", String)
75
+ ], UpdateMLModelInput.prototype, "metrics", void 0);
76
+ tslib_1.__decorate([
77
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Model metadata as JSON string' }),
78
+ tslib_1.__metadata("design:type", String)
79
+ ], UpdateMLModelInput.prototype, "metadata", void 0);
80
+ tslib_1.__decorate([
81
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Tags as JSON array string' }),
82
+ tslib_1.__metadata("design:type", String)
83
+ ], UpdateMLModelInput.prototype, "tags", void 0);
84
+ exports.UpdateMLModelInput = UpdateMLModelInput = tslib_1.__decorate([
85
+ (0, type_graphql_1.InputType)({ description: 'Input for updating ML model' })
86
+ ], UpdateMLModelInput);
87
+ let PromoteModelInput = class PromoteModelInput {
88
+ };
89
+ exports.PromoteModelInput = PromoteModelInput;
90
+ tslib_1.__decorate([
91
+ (0, type_graphql_1.Field)({ description: 'Model ID to promote' }),
92
+ tslib_1.__metadata("design:type", String)
93
+ ], PromoteModelInput.prototype, "modelId", void 0);
94
+ tslib_1.__decorate([
95
+ (0, type_graphql_1.Field)(type => ml_model_1.ModelStage, { description: 'Target stage' }),
96
+ tslib_1.__metadata("design:type", String)
97
+ ], PromoteModelInput.prototype, "targetStage", void 0);
98
+ tslib_1.__decorate([
99
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Promotion notes' }),
100
+ tslib_1.__metadata("design:type", String)
101
+ ], PromoteModelInput.prototype, "notes", void 0);
102
+ exports.PromoteModelInput = PromoteModelInput = tslib_1.__decorate([
103
+ (0, type_graphql_1.InputType)({ description: 'Input for promoting model stage' })
104
+ ], PromoteModelInput);
105
+ //# sourceMappingURL=ml-model-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ml-model-types.js","sourceRoot":"","sources":["../../../server/service/ml-model/ml-model-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,yCAAuD;AAGhD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAoChC,CAAA;AApCY,oDAAoB;AAE/B;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;;kDACzB;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;;qDACzB;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;yDACxC;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,qBAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;;mDAC1D;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,yBAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;uDACrD;AAG1B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;;qDACvD;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;;sDACvD;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;yDACnC;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ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B;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAS7B,CAAA;AATY,8CAAiB;AAE5B;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;kDAC/B;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,qBAAU,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;sDACpC;AAGvB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;;gDAC5C;4BARH,iBAAiB;IAD7B,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;GACjD,iBAAiB,CAS7B","sourcesContent":["import { InputType, Field, Int } from 'type-graphql'\nimport { ModelStage, ModelFramework } from './ml-model'\n\n@InputType({ description: 'Input for registering ML model' })\nexport class RegisterMLModelInput {\n @Field({ description: 'Model name' })\n name: string\n\n @Field({ description: 'Model version' })\n version: string\n\n @Field({ nullable: true, description: 'Model description' })\n description?: string\n\n @Field(type => ModelStage, { nullable: true, description: 'Initial stage' })\n stage?: ModelStage\n\n @Field(type => ModelFramework, { nullable: true, description: 'ML framework' })\n framework?: ModelFramework\n\n @Field({ nullable: true, description: 'Model metrics as JSON string' })\n metrics?: string\n\n @Field({ nullable: true, description: 'Model metadata as JSON string' })\n metadata?: string\n\n @Field({ nullable: true, description: 'Artifact URI' })\n artifactUri?: string\n\n @Field({ nullable: true, description: 'MLflow run ID' })\n mlflowRunId?: string\n\n @Field({ nullable: true, description: 'MLflow experiment ID' })\n mlflowExperimentId?: string\n\n @Field(type => Int, { nullable: true, description: 'Label Studio project ID' })\n labelStudioProjectId?: number\n\n @Field({ nullable: true, description: 'Tags as JSON array string' })\n tags?: string\n}\n\n@InputType({ description: 'Input for updating ML model' })\nexport class UpdateMLModelInput {\n @Field({ nullable: true, description: 'Model description' })\n description?: string\n\n @Field(type => ModelStage, { nullable: true, description: 'Stage' })\n stage?: ModelStage\n\n @Field({ nullable: true, description: 'Model metrics as JSON string' })\n metrics?: string\n\n @Field({ nullable: true, description: 'Model metadata as JSON string' })\n metadata?: string\n\n @Field({ nullable: true, description: 'Tags as JSON array string' })\n tags?: string\n}\n\n@InputType({ description: 'Input for promoting model stage' })\nexport class PromoteModelInput {\n @Field({ description: 'Model ID to promote' })\n modelId: string\n\n @Field(type => ModelStage, { description: 'Target stage' })\n targetStage: ModelStage\n\n @Field({ nullable: true, description: 'Promotion notes' })\n notes?: string\n}\n"]}
@@ -0,0 +1,52 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ /**
4
+ * ML Model Stage
5
+ */
6
+ export declare enum ModelStage {
7
+ NONE = "None",
8
+ STAGING = "Staging",
9
+ PRODUCTION = "Production",
10
+ ARCHIVED = "Archived"
11
+ }
12
+ /**
13
+ * Model Framework
14
+ */
15
+ export declare enum ModelFramework {
16
+ TENSORFLOW = "TensorFlow",
17
+ PYTORCH = "PyTorch",
18
+ SKLEARN = "Scikit-Learn",
19
+ XGBOOST = "XGBoost",
20
+ LIGHTGBM = "LightGBM",
21
+ ONNX = "ONNX",
22
+ CUSTOM = "Custom"
23
+ }
24
+ /**
25
+ * ML Model Entity
26
+ *
27
+ * Represents a registered ML model with version management
28
+ */
29
+ export declare class MLModel {
30
+ id: string;
31
+ name: string;
32
+ version: string;
33
+ description?: string;
34
+ stage: ModelStage;
35
+ framework?: ModelFramework;
36
+ metrics?: string;
37
+ metadata?: string;
38
+ artifactUri?: string;
39
+ mlflowRunId?: string;
40
+ mlflowExperimentId?: string;
41
+ labelStudioProjectId?: number;
42
+ tags?: string;
43
+ domain?: Domain;
44
+ domainId?: string;
45
+ creator?: User;
46
+ creatorId?: string;
47
+ updater?: User;
48
+ updaterId?: string;
49
+ createdAt: Date;
50
+ updatedAt: Date;
51
+ deletedAt?: Date;
52
+ }
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MLModel = exports.ModelFramework = exports.ModelStage = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const type_graphql_1 = require("type-graphql");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ /**
10
+ * ML Model Stage
11
+ */
12
+ var ModelStage;
13
+ (function (ModelStage) {
14
+ ModelStage["NONE"] = "None";
15
+ ModelStage["STAGING"] = "Staging";
16
+ ModelStage["PRODUCTION"] = "Production";
17
+ ModelStage["ARCHIVED"] = "Archived";
18
+ })(ModelStage || (exports.ModelStage = ModelStage = {}));
19
+ (0, type_graphql_1.registerEnumType)(ModelStage, {
20
+ name: 'ModelStage',
21
+ description: 'ML model deployment stage'
22
+ });
23
+ /**
24
+ * Model Framework
25
+ */
26
+ var ModelFramework;
27
+ (function (ModelFramework) {
28
+ ModelFramework["TENSORFLOW"] = "TensorFlow";
29
+ ModelFramework["PYTORCH"] = "PyTorch";
30
+ ModelFramework["SKLEARN"] = "Scikit-Learn";
31
+ ModelFramework["XGBOOST"] = "XGBoost";
32
+ ModelFramework["LIGHTGBM"] = "LightGBM";
33
+ ModelFramework["ONNX"] = "ONNX";
34
+ ModelFramework["CUSTOM"] = "Custom";
35
+ })(ModelFramework || (exports.ModelFramework = ModelFramework = {}));
36
+ (0, type_graphql_1.registerEnumType)(ModelFramework, {
37
+ name: 'ModelFramework',
38
+ description: 'ML framework used for model training'
39
+ });
40
+ /**
41
+ * ML Model Entity
42
+ *
43
+ * Represents a registered ML model with version management
44
+ */
45
+ let MLModel = class MLModel {
46
+ };
47
+ exports.MLModel = MLModel;
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
50
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Model ID' }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], MLModel.prototype, "id", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ nullable: true, comment: 'Model name' }),
55
+ (0, type_graphql_1.Field)({ description: 'Model name' }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], MLModel.prototype, "name", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.Column)({ nullable: true, comment: 'Model version' }),
60
+ (0, type_graphql_1.Field)({ description: 'Model version' }),
61
+ tslib_1.__metadata("design:type", String)
62
+ ], MLModel.prototype, "version", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.Column)({ nullable: true, comment: 'Model description' }),
65
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Model description' }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], MLModel.prototype, "description", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.Column)({ type: 'varchar', default: ModelStage.NONE, comment: 'Deployment stage' }),
70
+ (0, type_graphql_1.Field)(type => ModelStage, { description: 'Current deployment stage' }),
71
+ tslib_1.__metadata("design:type", String)
72
+ ], MLModel.prototype, "stage", void 0);
73
+ tslib_1.__decorate([
74
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true, comment: 'ML framework' }),
75
+ (0, type_graphql_1.Field)(type => ModelFramework, { nullable: true, description: 'Framework used for training' }),
76
+ tslib_1.__metadata("design:type", String)
77
+ ], MLModel.prototype, "framework", void 0);
78
+ tslib_1.__decorate([
79
+ (0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: 'Model metrics (accuracy, loss, etc.)' }),
80
+ (0, type_graphql_1.Field)(type => String, { nullable: true, description: 'Model metrics as JSON' }),
81
+ tslib_1.__metadata("design:type", String)
82
+ ], MLModel.prototype, "metrics", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: 'Model metadata' }),
85
+ (0, type_graphql_1.Field)(type => String, { nullable: true, description: 'Model metadata as JSON' }),
86
+ tslib_1.__metadata("design:type", String)
87
+ ], MLModel.prototype, "metadata", void 0);
88
+ tslib_1.__decorate([
89
+ (0, typeorm_1.Column)({ nullable: true, comment: 'Model artifact URI (S3, local path, etc.)' }),
90
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Model artifact storage URI' }),
91
+ tslib_1.__metadata("design:type", String)
92
+ ], MLModel.prototype, "artifactUri", void 0);
93
+ tslib_1.__decorate([
94
+ (0, typeorm_1.Column)({ nullable: true, comment: 'MLflow run ID' }),
95
+ (0, type_graphql_1.Field)({ nullable: true, description: 'MLflow run ID for tracking' }),
96
+ tslib_1.__metadata("design:type", String)
97
+ ], MLModel.prototype, "mlflowRunId", void 0);
98
+ tslib_1.__decorate([
99
+ (0, typeorm_1.Column)({ nullable: true, comment: 'MLflow experiment ID' }),
100
+ (0, type_graphql_1.Field)({ nullable: true, description: 'MLflow experiment ID' }),
101
+ tslib_1.__metadata("design:type", String)
102
+ ], MLModel.prototype, "mlflowExperimentId", void 0);
103
+ tslib_1.__decorate([
104
+ (0, typeorm_1.Column)({ type: 'int', nullable: true, comment: 'Label Studio project ID' }),
105
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Associated Label Studio project' }),
106
+ tslib_1.__metadata("design:type", Number)
107
+ ], MLModel.prototype, "labelStudioProjectId", void 0);
108
+ tslib_1.__decorate([
109
+ (0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: 'Model tags' }),
110
+ (0, type_graphql_1.Field)(type => String, { nullable: true, description: 'Tags as JSON array' }),
111
+ tslib_1.__metadata("design:type", String)
112
+ ], MLModel.prototype, "tags", void 0);
113
+ tslib_1.__decorate([
114
+ (0, typeorm_1.ManyToOne)(() => shell_1.Domain),
115
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Domain' }),
116
+ tslib_1.__metadata("design:type", shell_1.Domain)
117
+ ], MLModel.prototype, "domain", void 0);
118
+ tslib_1.__decorate([
119
+ (0, typeorm_1.RelationId)((model) => model.domain),
120
+ tslib_1.__metadata("design:type", String)
121
+ ], MLModel.prototype, "domainId", void 0);
122
+ tslib_1.__decorate([
123
+ (0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true }),
124
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Creator' }),
125
+ tslib_1.__metadata("design:type", auth_base_1.User)
126
+ ], MLModel.prototype, "creator", void 0);
127
+ tslib_1.__decorate([
128
+ (0, typeorm_1.RelationId)((model) => model.creator),
129
+ tslib_1.__metadata("design:type", String)
130
+ ], MLModel.prototype, "creatorId", void 0);
131
+ tslib_1.__decorate([
132
+ (0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true }),
133
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Last updater' }),
134
+ tslib_1.__metadata("design:type", auth_base_1.User)
135
+ ], MLModel.prototype, "updater", void 0);
136
+ tslib_1.__decorate([
137
+ (0, typeorm_1.RelationId)((model) => model.updater),
138
+ tslib_1.__metadata("design:type", String)
139
+ ], MLModel.prototype, "updaterId", void 0);
140
+ tslib_1.__decorate([
141
+ (0, typeorm_1.CreateDateColumn)(),
142
+ (0, type_graphql_1.Field)({ description: 'Created at' }),
143
+ tslib_1.__metadata("design:type", Date)
144
+ ], MLModel.prototype, "createdAt", void 0);
145
+ tslib_1.__decorate([
146
+ (0, typeorm_1.UpdateDateColumn)(),
147
+ (0, type_graphql_1.Field)({ description: 'Updated at' }),
148
+ tslib_1.__metadata("design:type", Date)
149
+ ], MLModel.prototype, "updatedAt", void 0);
150
+ tslib_1.__decorate([
151
+ (0, typeorm_1.DeleteDateColumn)(),
152
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Deleted at' }),
153
+ tslib_1.__metadata("design:type", Date)
154
+ ], MLModel.prototype, "deletedAt", void 0);
155
+ exports.MLModel = MLModel = tslib_1.__decorate([
156
+ (0, typeorm_1.Entity)('ml_models'),
157
+ (0, typeorm_1.Index)('ix_ml_model_0', ['domain', 'name', 'version'], { unique: true }),
158
+ (0, typeorm_1.Index)('ix_ml_model_1', ['domain', 'stage']),
159
+ (0, type_graphql_1.ObjectType)({ description: 'ML Model registered in the system' })
160
+ ], MLModel);
161
+ //# sourceMappingURL=ml-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ml-model.js","sourceRoot":"","sources":["../../../server/service/ml-model/ml-model.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAA2E;AAC3E,iDAA8C;AAC9C,yDAAgD;AAEhD;;GAEG;AACH,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,uCAAyB,CAAA;IACzB,mCAAqB,CAAA;AACvB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAED,IAAA,+BAAgB,EAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,2BAA2B;CACzC,CAAC,CAAA;AAEF;;GAEG;AACH,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,2CAAyB,CAAA;IACzB,qCAAmB,CAAA;IACnB,0CAAwB,CAAA;IACxB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACnB,CAAC,EARW,cAAc,8BAAd,cAAc,QAQzB;AAED,IAAA,+BAAgB,EAAC,cAAc,EAAE;IAC/B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,sCAAsC;CACpD,CAAC,CAAA;AAEF;;;;GAIG;AAKI,IAAM,OAAO,GAAb,MAAM,OAAO;CAqFnB,CAAA;AArFY,0BAAO;AAGlB;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;mCACrC;AAIV;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IACjD,IAAA,oBAAK,EA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,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;sCACzC,IAAI;0CAAA;kBApFL,OAAO;IAJnB,IAAA,gBAAM,EAAC,WAAW,CAAC;IACnB,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvE,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3C,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;GACpD,OAAO,CAqFnB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n/**\n * ML Model Stage\n */\nexport enum ModelStage {\n NONE = 'None',\n STAGING = 'Staging',\n PRODUCTION = 'Production',\n ARCHIVED = 'Archived'\n}\n\nregisterEnumType(ModelStage, {\n name: 'ModelStage',\n description: 'ML model deployment stage'\n})\n\n/**\n * Model Framework\n */\nexport enum ModelFramework {\n TENSORFLOW = 'TensorFlow',\n PYTORCH = 'PyTorch',\n SKLEARN = 'Scikit-Learn',\n XGBOOST = 'XGBoost',\n LIGHTGBM = 'LightGBM',\n ONNX = 'ONNX',\n CUSTOM = 'Custom'\n}\n\nregisterEnumType(ModelFramework, {\n name: 'ModelFramework',\n description: 'ML framework used for model training'\n})\n\n/**\n * ML Model Entity\n *\n * Represents a registered ML model with version management\n */\n@Entity('ml_models')\n@Index('ix_ml_model_0', ['domain', 'name', 'version'], { unique: true })\n@Index('ix_ml_model_1', ['domain', 'stage'])\n@ObjectType({ description: 'ML Model registered in the system' })\nexport class MLModel {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Model ID' })\n id: string\n\n @Column({ nullable: true, comment: 'Model name' })\n @Field({ description: 'Model name' })\n name: string\n\n @Column({ nullable: true, comment: 'Model version' })\n @Field({ description: 'Model version' })\n version: string\n\n @Column({ nullable: true, comment: 'Model description' })\n @Field({ nullable: true, description: 'Model description' })\n description?: string\n\n @Column({ type: 'varchar', default: ModelStage.NONE, comment: 'Deployment stage' })\n @Field(type => ModelStage, { description: 'Current deployment stage' })\n stage: ModelStage\n\n @Column({ type: 'varchar', nullable: true, comment: 'ML framework' })\n @Field(type => ModelFramework, { nullable: true, description: 'Framework used for training' })\n framework?: ModelFramework\n\n @Column({ type: 'simple-json', nullable: true, comment: 'Model metrics (accuracy, loss, etc.)' })\n @Field(type => String, { nullable: true, description: 'Model metrics as JSON' })\n metrics?: string\n\n @Column({ type: 'simple-json', nullable: true, comment: 'Model metadata' })\n @Field(type => String, { nullable: true, description: 'Model metadata as JSON' })\n metadata?: string\n\n @Column({ nullable: true, comment: 'Model artifact URI (S3, local path, etc.)' })\n @Field({ nullable: true, description: 'Model artifact storage URI' })\n artifactUri?: string\n\n @Column({ nullable: true, comment: 'MLflow run ID' })\n @Field({ nullable: true, description: 'MLflow run ID for tracking' })\n mlflowRunId?: string\n\n @Column({ nullable: true, comment: 'MLflow experiment ID' })\n @Field({ nullable: true, description: 'MLflow experiment ID' })\n mlflowExperimentId?: string\n\n @Column({ type: 'int', nullable: true, comment: 'Label Studio project ID' })\n @Field(type => Int, { nullable: true, description: 'Associated Label Studio project' })\n labelStudioProjectId?: number\n\n @Column({ type: 'simple-json', nullable: true, comment: 'Model tags' })\n @Field(type => String, { nullable: true, description: 'Tags as JSON array' })\n tags?: string\n\n @ManyToOne(() => Domain)\n @Field({ nullable: true, description: 'Domain' })\n domain?: Domain\n\n @RelationId((model: MLModel) => model.domain)\n domainId?: string\n\n @ManyToOne(() => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Creator' })\n creator?: User\n\n @RelationId((model: MLModel) => model.creator)\n creatorId?: string\n\n @ManyToOne(() => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Last updater' })\n updater?: User\n\n @RelationId((model: MLModel) => model.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ description: 'Created at' })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ description: 'Updated at' })\n updatedAt: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Deleted at' })\n deletedAt?: Date\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { MLPipeline } from './ml-pipeline';
2
+ export declare const entities: (typeof MLPipeline)[];
3
+ export declare const resolvers: any[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const ml_pipeline_1 = require("./ml-pipeline");
5
+ exports.entities = [ml_pipeline_1.MLPipeline];
6
+ exports.resolvers = [];
7
+ // export * from './ml-pipeline'
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/ml-pipeline/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAE7B,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,EAAE,CAAA;AAE3B,gCAAgC","sourcesContent":["import { MLPipeline } from './ml-pipeline'\n\nexport const entities = [MLPipeline]\nexport const resolvers = []\n\n// export * from './ml-pipeline'\n"]}
@@ -0,0 +1,50 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ /**
4
+ * Pipeline Status
5
+ */
6
+ export declare enum PipelineStatus {
7
+ DRAFT = "DRAFT",
8
+ ACTIVE = "ACTIVE",
9
+ PAUSED = "PAUSED",
10
+ ARCHIVED = "ARCHIVED"
11
+ }
12
+ /**
13
+ * Pipeline Trigger Type
14
+ */
15
+ export declare enum PipelineTriggerType {
16
+ MANUAL = "MANUAL",
17
+ SCHEDULE = "SCHEDULE",
18
+ WEBHOOK = "WEBHOOK",
19
+ EVENT = "EVENT"
20
+ }
21
+ /**
22
+ * ML Pipeline Entity
23
+ *
24
+ * Represents an end-to-end ML pipeline for auto-training
25
+ */
26
+ export declare class MLPipeline {
27
+ id: string;
28
+ name: string;
29
+ description?: string;
30
+ status: PipelineStatus;
31
+ triggerType: PipelineTriggerType;
32
+ schedule?: string;
33
+ labelStudioProjectId?: number;
34
+ annotationThreshold?: number;
35
+ config?: string;
36
+ trainingParams?: string;
37
+ promotionThreshold?: number;
38
+ notifications?: string;
39
+ lastExecutedAt?: Date;
40
+ executionCount: number;
41
+ domain?: Domain;
42
+ domainId?: string;
43
+ creator?: User;
44
+ creatorId?: string;
45
+ updater?: User;
46
+ updaterId?: string;
47
+ createdAt: Date;
48
+ updatedAt: Date;
49
+ deletedAt?: Date;
50
+ }