@things-factory/kpi 1.0.0-alpha.5
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/CHANGELOG.md +8 -0
- package/assets/images/hatiolab-logo.png +0 -0
- package/client/index.ts +0 -0
- package/client/pages/kpe-metric/kpe-metric-importer.ts +90 -0
- package/client/pages/kpe-metric/kpe-metric-list-page.ts +398 -0
- package/client/pages/kpi/kpi-importer.ts +90 -0
- package/client/pages/kpi/kpi-list-page.ts +398 -0
- package/client/pages/kpi-category/kpi-category-importer.ts +90 -0
- package/client/pages/kpi-category/kpi-category-list-page.ts +398 -0
- package/client/pages/kpi-formula/kpi-formula-importer.ts +90 -0
- package/client/pages/kpi-formula/kpi-formula-list-page.ts +398 -0
- package/client/pages/kpi-grade/kpi-grade-importer.ts +90 -0
- package/client/pages/kpi-grade/kpi-grade-list-page.ts +398 -0
- package/client/pages/kpi-metric/kpi-metric-importer.ts +90 -0
- package/client/pages/kpi-metric/kpi-metric-list-page.ts +398 -0
- package/client/pages/kpi-value/kpi-value-importer.ts +90 -0
- package/client/pages/kpi-value/kpi-value-list-page.ts +398 -0
- package/client/pages/metric/metric-importer.ts +90 -0
- package/client/pages/metric/metric-list-page.ts +398 -0
- package/client/route.ts +4 -0
- package/client/tsconfig.json +11 -0
- package/design-entities.md +97 -0
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/kpe-metric/kpe-metric-importer.d.ts +23 -0
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js +93 -0
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js.map +1 -0
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.d.ts +66 -0
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js +370 -0
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js.map +1 -0
- package/dist-client/pages/kpi/kpi-importer.d.ts +23 -0
- package/dist-client/pages/kpi/kpi-importer.js +93 -0
- package/dist-client/pages/kpi/kpi-importer.js.map +1 -0
- package/dist-client/pages/kpi/kpi-list-page.d.ts +66 -0
- package/dist-client/pages/kpi/kpi-list-page.js +370 -0
- package/dist-client/pages/kpi/kpi-list-page.js.map +1 -0
- package/dist-client/pages/kpi-category/kpi-category-importer.d.ts +23 -0
- package/dist-client/pages/kpi-category/kpi-category-importer.js +93 -0
- package/dist-client/pages/kpi-category/kpi-category-importer.js.map +1 -0
- package/dist-client/pages/kpi-category/kpi-category-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-category/kpi-category-list-page.js +370 -0
- package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +1 -0
- package/dist-client/pages/kpi-formula/kpi-formula-importer.d.ts +23 -0
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js +93 -0
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js.map +1 -0
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js +370 -0
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js.map +1 -0
- package/dist-client/pages/kpi-grade/kpi-grade-importer.d.ts +23 -0
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js +93 -0
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js.map +1 -0
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js +370 -0
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.d.ts +23 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js +93 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js.map +1 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +370 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.d.ts +23 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js +93 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +370 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -0
- package/dist-client/pages/metric/metric-importer.d.ts +23 -0
- package/dist-client/pages/metric/metric-importer.js +93 -0
- package/dist-client/pages/metric/metric-importer.js.map +1 -0
- package/dist-client/pages/metric/metric-list-page.d.ts +66 -0
- package/dist-client/pages/metric/metric-list-page.js +370 -0
- package/dist-client/pages/metric/metric-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +5 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/index.d.ts +2 -0
- package/dist-server/index.js +6 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/routes.d.ts +0 -0
- package/dist-server/routes.js +24 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/index.d.ts +16 -0
- package/dist-server/service/index.js +45 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/kpi/event-subscriber.d.ts +7 -0
- package/dist-server/service/kpi/event-subscriber.js +21 -0
- package/dist-server/service/kpi/event-subscriber.js.map +1 -0
- package/dist-server/service/kpi/index.d.ts +7 -0
- package/dist-server/service/kpi/index.js +12 -0
- package/dist-server/service/kpi/index.js.map +1 -0
- package/dist-server/service/kpi/kpi-history.d.ts +25 -0
- package/dist-server/service/kpi/kpi-history.js +128 -0
- package/dist-server/service/kpi/kpi-history.js.map +1 -0
- package/dist-server/service/kpi/kpi-mutation.d.ts +10 -0
- package/dist-server/service/kpi/kpi-mutation.js +169 -0
- package/dist-server/service/kpi/kpi-mutation.js.map +1 -0
- package/dist-server/service/kpi/kpi-query.d.ts +12 -0
- package/dist-server/service/kpi/kpi-query.js +97 -0
- package/dist-server/service/kpi/kpi-query.js.map +1 -0
- package/dist-server/service/kpi/kpi-type.d.ts +23 -0
- package/dist-server/service/kpi/kpi-type.js +86 -0
- package/dist-server/service/kpi/kpi-type.js.map +1 -0
- package/dist-server/service/kpi/kpi.d.ts +25 -0
- package/dist-server/service/kpi/kpi.js +113 -0
- package/dist-server/service/kpi/kpi.js.map +1 -0
- package/dist-server/service/kpi-category/index.d.ts +6 -0
- package/dist-server/service/kpi-category/index.js +10 -0
- package/dist-server/service/kpi-category/index.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +10 -0
- package/dist-server/service/kpi-category/kpi-category-mutation.js +128 -0
- package/dist-server/service/kpi-category/kpi-category-mutation.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category-query.d.ts +11 -0
- package/dist-server/service/kpi-category/kpi-category-query.js +79 -0
- package/dist-server/service/kpi-category/kpi-category-query.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category-type.d.ts +20 -0
- package/dist-server/service/kpi-category/kpi-category-type.js +77 -0
- package/dist-server/service/kpi-category/kpi-category-type.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category.d.ts +22 -0
- package/dist-server/service/kpi-category/kpi-category.js +95 -0
- package/dist-server/service/kpi-category/kpi-category.js.map +1 -0
- package/dist-server/service/kpi-formula/event-subscriber.d.ts +7 -0
- package/dist-server/service/kpi-formula/event-subscriber.js +21 -0
- package/dist-server/service/kpi-formula/event-subscriber.js.map +1 -0
- package/dist-server/service/kpi-formula/index.d.ts +7 -0
- package/dist-server/service/kpi-formula/index.js +12 -0
- package/dist-server/service/kpi-formula/index.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula-history.d.ts +25 -0
- package/dist-server/service/kpi-formula/kpi-formula-history.js +128 -0
- package/dist-server/service/kpi-formula/kpi-formula-history.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula-mutation.d.ts +10 -0
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js +128 -0
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula-query.d.ts +11 -0
- package/dist-server/service/kpi-formula/kpi-formula-query.js +79 -0
- package/dist-server/service/kpi-formula/kpi-formula-query.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula-type.d.ts +20 -0
- package/dist-server/service/kpi-formula/kpi-formula-type.js +77 -0
- package/dist-server/service/kpi-formula/kpi-formula-type.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula.d.ts +24 -0
- package/dist-server/service/kpi-formula/kpi-formula.js +109 -0
- package/dist-server/service/kpi-formula/kpi-formula.js.map +1 -0
- package/dist-server/service/kpi-grade/event-subscriber.d.ts +7 -0
- package/dist-server/service/kpi-grade/event-subscriber.js +21 -0
- package/dist-server/service/kpi-grade/event-subscriber.js.map +1 -0
- package/dist-server/service/kpi-grade/index.d.ts +7 -0
- package/dist-server/service/kpi-grade/index.js +12 -0
- package/dist-server/service/kpi-grade/index.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade-history.d.ts +25 -0
- package/dist-server/service/kpi-grade/kpi-grade-history.js +128 -0
- package/dist-server/service/kpi-grade/kpi-grade-history.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade-mutation.d.ts +10 -0
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js +128 -0
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade-query.d.ts +11 -0
- package/dist-server/service/kpi-grade/kpi-grade-query.js +79 -0
- package/dist-server/service/kpi-grade/kpi-grade-query.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade-type.d.ts +20 -0
- package/dist-server/service/kpi-grade/kpi-grade-type.js +77 -0
- package/dist-server/service/kpi-grade/kpi-grade-type.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade.d.ts +24 -0
- package/dist-server/service/kpi-grade/kpi-grade.js +109 -0
- package/dist-server/service/kpi-grade/kpi-grade.js.map +1 -0
- package/dist-server/service/kpi-metric/event-subscriber.d.ts +7 -0
- package/dist-server/service/kpi-metric/event-subscriber.js +21 -0
- package/dist-server/service/kpi-metric/event-subscriber.js.map +1 -0
- package/dist-server/service/kpi-metric/index.d.ts +7 -0
- package/dist-server/service/kpi-metric/index.js +12 -0
- package/dist-server/service/kpi-metric/index.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-history.d.ts +25 -0
- package/dist-server/service/kpi-metric/kpi-metric-history.js +128 -0
- package/dist-server/service/kpi-metric/kpi-metric-history.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-mutation.d.ts +10 -0
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js +169 -0
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-query.d.ts +12 -0
- package/dist-server/service/kpi-metric/kpi-metric-query.js +97 -0
- package/dist-server/service/kpi-metric/kpi-metric-query.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-type.d.ts +23 -0
- package/dist-server/service/kpi-metric/kpi-metric-type.js +86 -0
- package/dist-server/service/kpi-metric/kpi-metric-type.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric.d.ts +25 -0
- package/dist-server/service/kpi-metric/kpi-metric.js +113 -0
- package/dist-server/service/kpi-metric/kpi-metric.js.map +1 -0
- package/dist-server/service/kpi-value/index.d.ts +6 -0
- package/dist-server/service/kpi-value/index.js +10 -0
- package/dist-server/service/kpi-value/index.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-mutation.d.ts +10 -0
- package/dist-server/service/kpi-value/kpi-value-mutation.js +128 -0
- package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +11 -0
- package/dist-server/service/kpi-value/kpi-value-query.js +79 -0
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-type.d.ts +20 -0
- package/dist-server/service/kpi-value/kpi-value-type.js +77 -0
- package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value.d.ts +22 -0
- package/dist-server/service/kpi-value/kpi-value.js +95 -0
- package/dist-server/service/kpi-value/kpi-value.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/helps/kpi/kpe-metric.md +160 -0
- package/helps/kpi/kpi-category.md +160 -0
- package/helps/kpi/kpi-formula.md +160 -0
- package/helps/kpi/kpi-grade.md +160 -0
- package/helps/kpi/kpi-metric.md +160 -0
- package/helps/kpi/kpi-value.md +160 -0
- package/helps/kpi/kpi.md +160 -0
- package/helps/kpi/metric.md +160 -0
- package/kpi-grade.csv +41 -0
- package/package.json +36 -0
- package/server/index.ts +3 -0
- package/server/routes.ts +26 -0
- package/server/service/index.ts +43 -0
- package/server/service/kpi/event-subscriber.ts +17 -0
- package/server/service/kpi/index.ts +9 -0
- package/server/service/kpi/kpi-history.ts +116 -0
- package/server/service/kpi/kpi-mutation.ts +198 -0
- package/server/service/kpi/kpi-query.ts +62 -0
- package/server/service/kpi/kpi-type.ts +61 -0
- package/server/service/kpi/kpi.ts +98 -0
- package/server/service/kpi-category/index.ts +7 -0
- package/server/service/kpi-category/kpi-category-mutation.ts +137 -0
- package/server/service/kpi-category/kpi-category-query.ts +48 -0
- package/server/service/kpi-category/kpi-category-type.ts +55 -0
- package/server/service/kpi-category/kpi-category.ts +84 -0
- package/server/service/kpi-formula/event-subscriber.ts +17 -0
- package/server/service/kpi-formula/index.ts +9 -0
- package/server/service/kpi-formula/kpi-formula-history.ts +116 -0
- package/server/service/kpi-formula/kpi-formula-mutation.ts +137 -0
- package/server/service/kpi-formula/kpi-formula-query.ts +48 -0
- package/server/service/kpi-formula/kpi-formula-type.ts +55 -0
- package/server/service/kpi-formula/kpi-formula.ts +95 -0
- package/server/service/kpi-grade/event-subscriber.ts +17 -0
- package/server/service/kpi-grade/index.ts +9 -0
- package/server/service/kpi-grade/kpi-grade-history.ts +116 -0
- package/server/service/kpi-grade/kpi-grade-mutation.ts +137 -0
- package/server/service/kpi-grade/kpi-grade-query.ts +48 -0
- package/server/service/kpi-grade/kpi-grade-type.ts +55 -0
- package/server/service/kpi-grade/kpi-grade.ts +95 -0
- package/server/service/kpi-metric/event-subscriber.ts +17 -0
- package/server/service/kpi-metric/index.ts +9 -0
- package/server/service/kpi-metric/kpi-metric-history.ts +116 -0
- package/server/service/kpi-metric/kpi-metric-mutation.ts +198 -0
- package/server/service/kpi-metric/kpi-metric-query.ts +62 -0
- package/server/service/kpi-metric/kpi-metric-type.ts +61 -0
- package/server/service/kpi-metric/kpi-metric.ts +98 -0
- package/server/service/kpi-value/index.ts +7 -0
- package/server/service/kpi-value/kpi-value-mutation.ts +137 -0
- package/server/service/kpi-value/kpi-value-query.ts +48 -0
- package/server/service/kpi-value/kpi-value-type.ts +55 -0
- package/server/service/kpi-value/kpi-value.ts +84 -0
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +10 -0
- package/translations/en.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-grade-query.js","sourceRoot":"","sources":["../../../server/service/kpi-grade/kpi-grade-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,2CAAsC;AACtC,qDAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAElB,AAAN,KAAK,CAAC,QAAQ,CAAY,EAAU,EAAS,OAAwB;QACnE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,oBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,EAA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A,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,oBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACpE,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;6CAM3C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6BAAY,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAC9D,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;8CAazD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;2CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;4CAEvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;4CAEvC;wBAvCU,aAAa;IADzB,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,aAAa,CAwCzB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { KpiGrade } from './kpi-grade'\nimport { KpiGradeList } from './kpi-grade-type'\n\n@Resolver(KpiGrade)\nexport class KpiGradeQuery {\n @Query(returns => KpiGrade!, { nullable: true, description: 'To fetch a KpiGrade' })\n async kpiGrade(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<KpiGrade> {\n const { domain } = context.state\n\n return await getRepository(KpiGrade).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => KpiGradeList, { description: 'To fetch multiple KpiGrades' })\n async kpiGrades(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<KpiGradeList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(KpiGrade),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() kpiGrade: KpiGrade): Promise<Domain> {\n return kpiGrade.domainId && (await getRepository(Domain).findOneBy({ id: kpiGrade.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() kpiGrade: KpiGrade): Promise<User> {\n return kpiGrade.updaterId && (await getRepository(User).findOneBy({ id: kpiGrade.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() kpiGrade: KpiGrade): Promise<User> {\n return kpiGrade.creatorId && (await getRepository(User).findOneBy({ id: kpiGrade.creatorId }))\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { KpiGrade, KpiGradeStatus } from './kpi-grade';
|
|
2
|
+
export declare class NewKpiGrade {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
state?: KpiGradeStatus;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
params?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class KpiGradePatch {
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
state?: KpiGradeStatus;
|
|
14
|
+
active?: boolean;
|
|
15
|
+
cuFlag?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class KpiGradeList {
|
|
18
|
+
items: KpiGrade[];
|
|
19
|
+
total: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiGradeList = exports.KpiGradePatch = exports.NewKpiGrade = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const kpi_grade_1 = require("./kpi-grade");
|
|
7
|
+
let NewKpiGrade = class NewKpiGrade {
|
|
8
|
+
};
|
|
9
|
+
exports.NewKpiGrade = NewKpiGrade;
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)(),
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
13
|
+
], NewKpiGrade.prototype, "name", void 0);
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
16
|
+
tslib_1.__metadata("design:type", String)
|
|
17
|
+
], NewKpiGrade.prototype, "description", void 0);
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.Field)(type => kpi_grade_1.KpiGradeStatus, { nullable: true }),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], NewKpiGrade.prototype, "state", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
24
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
25
|
+
], NewKpiGrade.prototype, "active", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
29
|
+
], NewKpiGrade.prototype, "params", void 0);
|
|
30
|
+
exports.NewKpiGrade = NewKpiGrade = tslib_1.__decorate([
|
|
31
|
+
(0, type_graphql_1.InputType)()
|
|
32
|
+
], NewKpiGrade);
|
|
33
|
+
let KpiGradePatch = class KpiGradePatch {
|
|
34
|
+
};
|
|
35
|
+
exports.KpiGradePatch = KpiGradePatch;
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
39
|
+
], KpiGradePatch.prototype, "id", void 0);
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], KpiGradePatch.prototype, "name", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], KpiGradePatch.prototype, "description", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, type_graphql_1.Field)(type => kpi_grade_1.KpiGradeStatus, { nullable: true }),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], KpiGradePatch.prototype, "state", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
55
|
+
], KpiGradePatch.prototype, "active", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
58
|
+
tslib_1.__metadata("design:type", String)
|
|
59
|
+
], KpiGradePatch.prototype, "cuFlag", void 0);
|
|
60
|
+
exports.KpiGradePatch = KpiGradePatch = tslib_1.__decorate([
|
|
61
|
+
(0, type_graphql_1.InputType)()
|
|
62
|
+
], KpiGradePatch);
|
|
63
|
+
let KpiGradeList = class KpiGradeList {
|
|
64
|
+
};
|
|
65
|
+
exports.KpiGradeList = KpiGradeList;
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, type_graphql_1.Field)(type => [kpi_grade_1.KpiGrade]),
|
|
68
|
+
tslib_1.__metadata("design:type", Array)
|
|
69
|
+
], KpiGradeList.prototype, "items", void 0);
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
72
|
+
tslib_1.__metadata("design:type", Number)
|
|
73
|
+
], KpiGradeList.prototype, "total", void 0);
|
|
74
|
+
exports.KpiGradeList = KpiGradeList = tslib_1.__decorate([
|
|
75
|
+
(0, type_graphql_1.ObjectType)()
|
|
76
|
+
], KpiGradeList);
|
|
77
|
+
//# sourceMappingURL=kpi-grade-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-grade-type.js","sourceRoot":"","sources":["../../../server/service/kpi-grade/kpi-grade-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAItF,2CAAsD;AAG/C,IAAM,WAAW,GAAjB,MAAM,WAAW;CAevB,CAAA;AAfY,kCAAW;AAEtB;IADC,IAAA,oBAAK,GAAE;;yCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC5B;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACX;sBAdJ,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CAevB;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAkBzB,CAAA;AAlBY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC5B;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;wBAjBJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAkBzB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oBAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { KpiGrade, KpiGradeStatus } from './kpi-grade'\n\n@InputType()\nexport class NewKpiGrade {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => KpiGradeStatus, { nullable: true })\n state?: KpiGradeStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class KpiGradePatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => KpiGradeStatus, { nullable: true })\n state?: KpiGradeStatus\n\n @Field({ nullable: true })\n active?: boolean\n \n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class KpiGradeList {\n @Field(type => [KpiGrade])\n items: KpiGrade[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
export declare enum KpiGradeStatus {
|
|
4
|
+
STATUS_A = "STATUS_A",
|
|
5
|
+
STATUS_B = "STATUS_B"
|
|
6
|
+
}
|
|
7
|
+
export declare class KpiGrade {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
version?: number;
|
|
10
|
+
domain?: Domain;
|
|
11
|
+
domainId?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
active?: boolean;
|
|
15
|
+
state?: KpiGradeStatus;
|
|
16
|
+
params?: string;
|
|
17
|
+
createdAt?: Date;
|
|
18
|
+
updatedAt?: Date;
|
|
19
|
+
deletedAt?: Date;
|
|
20
|
+
creator?: User;
|
|
21
|
+
creatorId?: string;
|
|
22
|
+
updater?: User;
|
|
23
|
+
updaterId?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiGrade = exports.KpiGradeStatus = 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
|
+
var KpiGradeStatus;
|
|
10
|
+
(function (KpiGradeStatus) {
|
|
11
|
+
KpiGradeStatus["STATUS_A"] = "STATUS_A";
|
|
12
|
+
KpiGradeStatus["STATUS_B"] = "STATUS_B";
|
|
13
|
+
})(KpiGradeStatus || (exports.KpiGradeStatus = KpiGradeStatus = {}));
|
|
14
|
+
(0, type_graphql_1.registerEnumType)(KpiGradeStatus, {
|
|
15
|
+
name: 'KpiGradeStatus',
|
|
16
|
+
description: 'state enumeration of a kpiGrade'
|
|
17
|
+
});
|
|
18
|
+
let KpiGrade = class KpiGrade {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.version = 1;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.KpiGrade = KpiGrade;
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
26
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
27
|
+
tslib_1.__metadata("design:type", String)
|
|
28
|
+
], KpiGrade.prototype, "id", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, typeorm_1.VersionColumn)(),
|
|
31
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
32
|
+
tslib_1.__metadata("design:type", Number)
|
|
33
|
+
], KpiGrade.prototype, "version", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
36
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
37
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
38
|
+
], KpiGrade.prototype, "domain", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.RelationId)((kpiGrade) => kpiGrade.domain),
|
|
41
|
+
tslib_1.__metadata("design:type", String)
|
|
42
|
+
], KpiGrade.prototype, "domainId", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, typeorm_1.Column)(),
|
|
45
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], KpiGrade.prototype, "name", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
50
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
51
|
+
tslib_1.__metadata("design:type", String)
|
|
52
|
+
], KpiGrade.prototype, "description", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ nullable: false, default: false }),
|
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
56
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
57
|
+
], KpiGrade.prototype, "active", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
60
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
62
|
+
], KpiGrade.prototype, "state", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], KpiGrade.prototype, "params", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
70
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
71
|
+
tslib_1.__metadata("design:type", Date)
|
|
72
|
+
], KpiGrade.prototype, "createdAt", void 0);
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
75
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
76
|
+
tslib_1.__metadata("design:type", Date)
|
|
77
|
+
], KpiGrade.prototype, "updatedAt", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
80
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
81
|
+
tslib_1.__metadata("design:type", Date)
|
|
82
|
+
], KpiGrade.prototype, "deletedAt", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
85
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
86
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
87
|
+
], KpiGrade.prototype, "creator", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.RelationId)((kpiGrade) => kpiGrade.creator),
|
|
90
|
+
tslib_1.__metadata("design:type", String)
|
|
91
|
+
], KpiGrade.prototype, "creatorId", void 0);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
94
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
95
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
96
|
+
], KpiGrade.prototype, "updater", void 0);
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
(0, typeorm_1.RelationId)((kpiGrade) => kpiGrade.updater),
|
|
99
|
+
tslib_1.__metadata("design:type", String)
|
|
100
|
+
], KpiGrade.prototype, "updaterId", void 0);
|
|
101
|
+
exports.KpiGrade = KpiGrade = tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_1.Entity)(),
|
|
103
|
+
(0, typeorm_1.Index)('ix_kpi_grade_0', (kpiGrade) => [kpiGrade.domain, kpiGrade.name], {
|
|
104
|
+
where: '"deleted_at" IS NULL',
|
|
105
|
+
unique: true
|
|
106
|
+
}),
|
|
107
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for KpiGrade' })
|
|
108
|
+
], KpiGrade);
|
|
109
|
+
//# sourceMappingURL=kpi-grade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-grade.js","sourceRoot":"","sources":["../../../server/service/kpi-grade/kpi-grade.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD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QAAQ,CAAC,OAAO,CAAC;;2CACnC;mBA5DP,QAAQ;IANpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE;QACjF,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CA6DpB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n VersionColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum KpiGradeStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(KpiGradeStatus, {\n name: 'KpiGradeStatus',\n description: 'state enumeration of a kpiGrade'\n})\n\n@Entity()\n@Index('ix_kpi_grade_0', (kpiGrade: KpiGrade) => [kpiGrade.domain, kpiGrade.name], {\n where: '\"deleted_at\" IS NULL',\n unique: true\n})\n@ObjectType({ description: 'Entity for KpiGrade' })\nexport class KpiGrade {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n \n @VersionColumn()\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((kpiGrade: KpiGrade) => kpiGrade.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: false, default: false })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: KpiGradeStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((kpiGrade: KpiGrade) => kpiGrade.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((kpiGrade: KpiGrade) => kpiGrade.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HistoryEntitySubscriber } from '@operato/typeorm-history';
|
|
2
|
+
import { KpiMetric } from './kpi-metric';
|
|
3
|
+
import { KpiMetricHistory } from './kpi-metric-history';
|
|
4
|
+
export declare class KpiMetricHistoryEntitySubscriber extends HistoryEntitySubscriber<KpiMetric, KpiMetricHistory> {
|
|
5
|
+
get entity(): typeof KpiMetric;
|
|
6
|
+
get historyEntity(): typeof KpiMetricHistory;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiMetricHistoryEntitySubscriber = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const typeorm_history_1 = require("@operato/typeorm-history");
|
|
7
|
+
const kpi_metric_1 = require("./kpi-metric");
|
|
8
|
+
const kpi_metric_history_1 = require("./kpi-metric-history");
|
|
9
|
+
let KpiMetricHistoryEntitySubscriber = class KpiMetricHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
|
|
10
|
+
get entity() {
|
|
11
|
+
return kpi_metric_1.KpiMetric;
|
|
12
|
+
}
|
|
13
|
+
get historyEntity() {
|
|
14
|
+
return kpi_metric_history_1.KpiMetricHistory;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.KpiMetricHistoryEntitySubscriber = KpiMetricHistoryEntitySubscriber;
|
|
18
|
+
exports.KpiMetricHistoryEntitySubscriber = KpiMetricHistoryEntitySubscriber = tslib_1.__decorate([
|
|
19
|
+
(0, typeorm_1.EventSubscriber)()
|
|
20
|
+
], KpiMetricHistoryEntitySubscriber);
|
|
21
|
+
//# sourceMappingURL=event-subscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/kpi-metric/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,6CAAwC;AACxC,6DAAuD;AAGhD,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,yCAAoD;IACxG,IAAW,MAAM;QACf,OAAO,sBAAS,CAAA;IAClB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,qCAAgB,CAAA;IACzB,CAAC;CACF,CAAA;AARY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,yBAAe,GAAE;GACL,gCAAgC,CAQ5C","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { KpiMetric } from './kpi-metric'\nimport { KpiMetricHistory } from './kpi-metric-history'\n\n@EventSubscriber()\nexport class KpiMetricHistoryEntitySubscriber extends HistoryEntitySubscriber<KpiMetric, KpiMetricHistory> {\n public get entity() {\n return KpiMetric\n }\n\n public get historyEntity() {\n return KpiMetricHistory\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KpiMetric } from './kpi-metric';
|
|
2
|
+
import { KpiMetricHistoryEntitySubscriber } from './event-subscriber';
|
|
3
|
+
import { KpiMetricQuery } from './kpi-metric-query';
|
|
4
|
+
import { KpiMetricMutation } from './kpi-metric-mutation';
|
|
5
|
+
export declare const entities: (typeof KpiMetric)[];
|
|
6
|
+
export declare const resolvers: (typeof KpiMetricQuery | typeof KpiMetricMutation)[];
|
|
7
|
+
export declare const subscribers: (typeof KpiMetricHistoryEntitySubscriber)[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const kpi_metric_1 = require("./kpi-metric");
|
|
5
|
+
const kpi_metric_history_1 = require("./kpi-metric-history");
|
|
6
|
+
const event_subscriber_1 = require("./event-subscriber");
|
|
7
|
+
const kpi_metric_query_1 = require("./kpi-metric-query");
|
|
8
|
+
const kpi_metric_mutation_1 = require("./kpi-metric-mutation");
|
|
9
|
+
exports.entities = [kpi_metric_1.KpiMetric, kpi_metric_history_1.KpiMetricHistory];
|
|
10
|
+
exports.resolvers = [kpi_metric_query_1.KpiMetricQuery, kpi_metric_mutation_1.KpiMetricMutation];
|
|
11
|
+
exports.subscribers = [event_subscriber_1.KpiMetricHistoryEntitySubscriber];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/kpi-metric/index.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AACxC,6DAAuD;AACvD,yDAAqE;AACrE,yDAAmD;AACnD,+DAAyD;AAE5C,QAAA,QAAQ,GAAG,CAAC,sBAAS,EAAE,qCAAgB,CAAC,CAAA;AACxC,QAAA,SAAS,GAAG,CAAC,iCAAc,EAAE,uCAAiB,CAAC,CAAA;AAC/C,QAAA,WAAW,GAAG,CAAC,mDAAgC,CAAC,CAAA","sourcesContent":["import { KpiMetric } from './kpi-metric'\nimport { KpiMetricHistory } from './kpi-metric-history'\nimport { KpiMetricHistoryEntitySubscriber } from './event-subscriber'\nimport { KpiMetricQuery } from './kpi-metric-query'\nimport { KpiMetricMutation } from './kpi-metric-mutation'\n\nexport const entities = [KpiMetric, KpiMetricHistory]\nexport const resolvers = [KpiMetricQuery, KpiMetricMutation]\nexport const subscribers = [KpiMetricHistoryEntitySubscriber]\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-history';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { Domain } from '@things-factory/shell';
|
|
4
|
+
import { KpiMetric, KpiMetricStatus } from './kpi-metric';
|
|
5
|
+
export declare class KpiMetricHistory implements HistoryEntityInterface<KpiMetric> {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
version?: number;
|
|
8
|
+
domain?: Domain;
|
|
9
|
+
domainId?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
state?: KpiMetricStatus;
|
|
14
|
+
params?: string;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
updatedAt?: Date;
|
|
17
|
+
deletedAt?: Date;
|
|
18
|
+
creator?: User;
|
|
19
|
+
creatorId?: string;
|
|
20
|
+
updater?: User;
|
|
21
|
+
updaterId?: string;
|
|
22
|
+
thumbnail?: string;
|
|
23
|
+
originalId: string;
|
|
24
|
+
action: HistoryActionType;
|
|
25
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiMetricHistory = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const typeorm_history_1 = require("@operato/typeorm-history");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
const env_1 = require("@things-factory/env");
|
|
10
|
+
const shell_1 = require("@things-factory/shell");
|
|
11
|
+
const kpi_metric_1 = require("./kpi-metric");
|
|
12
|
+
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
13
|
+
const DATABASE_TYPE = ORMCONFIG.type;
|
|
14
|
+
let KpiMetricHistory = class KpiMetricHistory {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.version = 1;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.KpiMetricHistory = KpiMetricHistory;
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
24
|
+
], KpiMetricHistory.prototype, "id", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ nullable: true, default: 1 }),
|
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
28
|
+
tslib_1.__metadata("design:type", Number)
|
|
29
|
+
], KpiMetricHistory.prototype, "version", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
32
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
33
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
34
|
+
], KpiMetricHistory.prototype, "domain", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, typeorm_1.RelationId)((kpiMetric) => kpiMetric.domain),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], KpiMetricHistory.prototype, "domainId", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.Column)(),
|
|
41
|
+
(0, type_graphql_1.Field)(),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], KpiMetricHistory.prototype, "name", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
47
|
+
tslib_1.__metadata("design:type", String)
|
|
48
|
+
], KpiMetricHistory.prototype, "description", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
52
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
53
|
+
], KpiMetricHistory.prototype, "active", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
56
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
57
|
+
tslib_1.__metadata("design:type", String)
|
|
58
|
+
], KpiMetricHistory.prototype, "state", void 0);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
62
|
+
tslib_1.__metadata("design:type", String)
|
|
63
|
+
], KpiMetricHistory.prototype, "params", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
66
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
67
|
+
tslib_1.__metadata("design:type", Date)
|
|
68
|
+
], KpiMetricHistory.prototype, "createdAt", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
71
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
72
|
+
tslib_1.__metadata("design:type", Date)
|
|
73
|
+
], KpiMetricHistory.prototype, "updatedAt", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
76
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
|
+
tslib_1.__metadata("design:type", Date)
|
|
78
|
+
], KpiMetricHistory.prototype, "deletedAt", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
81
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
82
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
83
|
+
], KpiMetricHistory.prototype, "creator", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, typeorm_1.RelationId)((kpiMetric) => kpiMetric.creator),
|
|
86
|
+
tslib_1.__metadata("design:type", String)
|
|
87
|
+
], KpiMetricHistory.prototype, "creatorId", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
90
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
91
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
92
|
+
], KpiMetricHistory.prototype, "updater", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.RelationId)((kpiMetric) => kpiMetric.updater),
|
|
95
|
+
tslib_1.__metadata("design:type", String)
|
|
96
|
+
], KpiMetricHistory.prototype, "updaterId", void 0);
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true }),
|
|
99
|
+
tslib_1.__metadata("design:type", String)
|
|
100
|
+
], KpiMetricHistory.prototype, "thumbnail", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_history_1.HistoryOriginalIdColumn)(),
|
|
103
|
+
tslib_1.__metadata("design:type", String)
|
|
104
|
+
], KpiMetricHistory.prototype, "originalId", void 0);
|
|
105
|
+
tslib_1.__decorate([
|
|
106
|
+
(0, typeorm_history_1.HistoryActionColumn)({
|
|
107
|
+
nullable: false,
|
|
108
|
+
type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
109
|
+
? 'enum'
|
|
110
|
+
: DATABASE_TYPE == 'oracle'
|
|
111
|
+
? 'varchar2'
|
|
112
|
+
: DATABASE_TYPE == 'mssql'
|
|
113
|
+
? 'nvarchar'
|
|
114
|
+
: 'varchar',
|
|
115
|
+
enum: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
116
|
+
? typeorm_history_1.HistoryActionType
|
|
117
|
+
: undefined,
|
|
118
|
+
length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 32
|
|
119
|
+
}),
|
|
120
|
+
tslib_1.__metadata("design:type", String)
|
|
121
|
+
], KpiMetricHistory.prototype, "action", void 0);
|
|
122
|
+
exports.KpiMetricHistory = KpiMetricHistory = tslib_1.__decorate([
|
|
123
|
+
(0, typeorm_1.Entity)(),
|
|
124
|
+
(0, typeorm_1.Index)('ix_kpi-metric_history_0', (kpiMetricHistory) => [kpiMetricHistory.originalId, kpiMetricHistory.version], { unique: true }),
|
|
125
|
+
(0, typeorm_1.Index)('ix_kpi-metric_history_1', (kpiMetricHistory) => [kpiMetricHistory.domain, kpiMetricHistory.originalId, kpiMetricHistory.version], { unique: true }),
|
|
126
|
+
(0, type_graphql_1.ObjectType)({ description: 'History Entity of KpiMetric' })
|
|
127
|
+
], KpiMetricHistory);
|
|
128
|
+
//# sourceMappingURL=kpi-metric-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-metric-history.js","sourceRoot":"","sources":["../../../server/service/kpi-metric/kpi-metric-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,6CAAyD;AAEzD,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAc7B,IAAM,gBAA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n, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { KpiMetric, KpiMetricStatus } from './kpi-metric'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_kpi-metric_history_0',\n (kpiMetricHistory: KpiMetricHistory) => [kpiMetricHistory.originalId, kpiMetricHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_kpi-metric_history_1',\n (kpiMetricHistory: KpiMetricHistory) => [kpiMetricHistory.domain, kpiMetricHistory.originalId, kpiMetricHistory.version],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of KpiMetric' })\nexport class KpiMetricHistory implements HistoryEntityInterface<KpiMetric> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((kpiMetric: KpiMetric) => kpiMetric.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: KpiMetricStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((kpiMetric: KpiMetric) => kpiMetric.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((kpiMetric: KpiMetric) => kpiMetric.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n thumbnail?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n enum:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? HistoryActionType\n : undefined,\n length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined: 32\n })\n public action!: HistoryActionType\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { KpiMetric } from './kpi-metric';
|
|
2
|
+
import { NewKpiMetric, KpiMetricPatch } from './kpi-metric-type';
|
|
3
|
+
export declare class KpiMetricMutation {
|
|
4
|
+
createKpiMetric(kpiMetric: NewKpiMetric, context: ResolverContext): Promise<KpiMetric>;
|
|
5
|
+
updateKpiMetric(id: string, patch: KpiMetricPatch, context: ResolverContext): Promise<KpiMetric>;
|
|
6
|
+
updateMultipleKpiMetric(patches: KpiMetricPatch[], context: ResolverContext): Promise<KpiMetric[]>;
|
|
7
|
+
deleteKpiMetric(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
+
deleteKpiMetrics(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
+
importKpiMetrics(kpiMetrics: KpiMetricPatch[], context: ResolverContext): Promise<boolean>;
|
|
10
|
+
}
|