@openframe-org/criteria-set-protocol 1.0.24 → 1.0.26

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.
@@ -1,4 +1,4 @@
1
- import { CriteriaTree, Metadata, StreamMatrixResponse, TaskItemValueMap } from '../types';
1
+ import { CriteriaTree, CriteriaSetMetadata, StreamMatrixResponse, TaskItemValueMap } from '../types';
2
2
  /**
3
3
  * Interface for services which implement the v1 protocol
4
4
  */
@@ -22,7 +22,7 @@ export interface IProtocolV1Service {
22
22
  /**
23
23
  * Get the metadata of all criteria sets supported by this service
24
24
  */
25
- getCriteriaSetMetadataList(): Metadata[];
25
+ getCriteriaSetMetadataList(): CriteriaSetMetadata[];
26
26
  /**
27
27
  * Get the JSON schema for the given criteria set ID
28
28
  */
@@ -8,6 +8,15 @@ export type QualityStyle = {
8
8
  secondaryColor: Color;
9
9
  };
10
10
  export type Metadata = {
11
+ protocol: string;
12
+ metadata: CriteriaSetMetadata;
13
+ locales?: string[];
14
+ defaultLocale?: string;
15
+ parameters: Record<string, any>;
16
+ result: Record<string, any>;
17
+ definitions: Record<string, any>;
18
+ };
19
+ export type CriteriaSetMetadata = {
11
20
  id: string;
12
21
  version: string;
13
22
  date: Date;
@@ -44,7 +53,7 @@ type BaseElement<Type extends CriteriaTreeElementType> = {
44
53
  label?: string;
45
54
  tags?: string[];
46
55
  documentation?: DocumentationItem[];
47
- data: Record<string, any>;
56
+ data?: Record<string, any>;
48
57
  };
49
58
  export type Quality = Pick<BaseElement<'quality'>, 'type' | 'tags' | 'documentation' | 'data'> & {
50
59
  code: string;
@@ -1,9 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { Stream } from 'stream';
3
- import { CriteriaTree, Metadata, TaskItemValue } from './criteria';
4
- export type MetadataResponse<Parameters extends ParameterCombination = ParameterCombination> = {
5
- protocol: 1;
6
- metadata: Metadata;
3
+ import { CriteriaTree, CriteriaSetMetadata, TaskItemValue, Metadata } from './criteria';
4
+ export type MetadataResponse<Parameters extends ParameterCombination = ParameterCombination> = Omit<Metadata, 'parameters'> & {
7
5
  parameters: Parameters;
8
6
  };
9
7
  export type CriteriaTreeResponse = CriteriaTree;
@@ -19,5 +17,5 @@ export type StreamMatrixResponse = {
19
17
  contentType: string;
20
18
  stream: Stream;
21
19
  };
22
- export type CriteriaSetsAndVersionsMap = Record<string, Metadata[]>;
20
+ export type CriteriaSetsAndVersionsMap = Record<string, CriteriaSetMetadata[]>;
23
21
  export type ParameterCombination = Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openframe-org/criteria-set-protocol",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "A protocol and tools for defining and working with criteria sets",
5
5
  "private": false,
6
6
  "author": "Andrés Angulo <aa@openframe.org>",