@things-factory/qc 8.0.6 → 9.0.0-beta.12

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/qc",
3
- "version": "8.0.6",
3
+ "version": "9.0.0-beta.12",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,9 +24,9 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration"
25
25
  },
26
26
  "dependencies": {
27
- "@operato/dataset": "^8.0.0",
28
- "@things-factory/dataset": "^8.0.6",
29
- "@things-factory/shell": "^8.0.2"
27
+ "@operato/dataset": "^9.0.0-beta",
28
+ "@things-factory/dataset": "^9.0.0-beta.12",
29
+ "@things-factory/shell": "^9.0.0-beta.12"
30
30
  },
31
- "gitHead": "89abb01bba2376bc5f074e0bc0088e32188d0396"
31
+ "gitHead": "5e9ade1c2d4b4c96b89396e36c3afa1caaf18ef0"
32
32
  }
@@ -1,44 +0,0 @@
1
- import { DataItemSpecSet, DataUseCase, EvaluationResult } from '@things-factory/dataset'
2
-
3
- export class DataUseCaseQC implements DataUseCase {
4
- getSpecification(): DataItemSpecSet {
5
- return {
6
- name: 'QC',
7
- description: 'Quality Control Data Spec',
8
- help: '',
9
- specs: [
10
- {
11
- type: 'qc-limits' /* 'A value which seperates acceptability from unacceptability' */,
12
- label: 'pass limits',
13
- name: 'passLimits'
14
- }
15
- ]
16
- }
17
- }
18
-
19
- evaluate(spec: any, values: any | any[]): EvaluationResult {
20
- const { minimum, maximum, acceptables } = spec['passLimits']
21
-
22
- if (!(values instanceof Array)) {
23
- values = [values]
24
- }
25
-
26
- for (let i = 0; i < values.length; i++) {
27
- const value = values[i]
28
-
29
- if (minimum != null && value < minimum) {
30
- return { oos: true, ooc: true }
31
- }
32
-
33
- if (maximum != null && value > maximum) {
34
- return { oos: true, ooc: true }
35
- }
36
-
37
- if (acceptables != null && !acceptables.includes(value)) {
38
- return { oos: true, ooc: true }
39
- }
40
- }
41
-
42
- return { oos: false, ooc: false }
43
- }
44
- }
@@ -1 +0,0 @@
1
- export * from './data-use-case-qc'
package/server/index.ts DELETED
@@ -1,8 +0,0 @@
1
- import { DataUseCase } from '@things-factory/dataset'
2
- import { DataUseCaseQC } from './controllers'
3
-
4
- process.on('bootstrap-module-start' as any, async ({ app, config, schema }: any) => {
5
- DataUseCase.registerUseCase('QC', new DataUseCaseQC())
6
-
7
- console.log('[qc:bootstrap] QC has just registered as a DataUseCase.')
8
- })
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../tsconfig-base.json",
3
- "compilerOptions": {
4
- "outDir": "./dist-server",
5
- "baseUrl": "./"
6
- },
7
- "include": ["./server/**/*"],
8
- "exclude": ["**/*.spec.ts"]
9
- }