@openframe-org/criteria-set-protocol 1.3.7 → 1.4.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.
@@ -22,6 +22,7 @@ export type Metadata = {
22
22
  locales?: string[];
23
23
  defaultLocale?: string;
24
24
  schemas?: SchemaDefinitions;
25
+ certificateDefinitions?: CertificateDefinition[];
25
26
  };
26
27
  export type PdfDocumentationItem = {
27
28
  type: 'pdf';
@@ -44,6 +45,7 @@ export type DocumentationItem = PdfDocumentationItem | InlineDocumentationItem |
44
45
  export type CriteriaTree = {
45
46
  version: string;
46
47
  qualities: Quality[];
48
+ certificates?: string[];
47
49
  result?: any;
48
50
  };
49
51
  type BaseElement<Type extends CriteriaTreeElementType> = {
@@ -98,8 +100,9 @@ export type BooleanType = AbstractDefinition<'boolean'> & {
98
100
  export type PointOption = {
99
101
  id?: string;
100
102
  text: string;
103
+ intro?: string;
104
+ outro?: string;
101
105
  value: string | number | boolean | null;
102
- annotations?: string[];
103
106
  };
104
107
  export type TaskItemScalarValue = string | number | boolean | null;
105
108
  export type TaskItemValue = TaskItemScalarValue | Array<TaskItemScalarValue>;
@@ -111,4 +114,32 @@ export type DataMap = {
111
114
  elements: Record<string, any>;
112
115
  result: any;
113
116
  };
117
+ export type CertificateDefinitionType = 'number' | 'percentage';
118
+ type AbstractCertificateDefinition<Type extends CertificateDefinitionType, Rules> = {
119
+ code: string;
120
+ type: Type;
121
+ icon?: string;
122
+ name: string;
123
+ description?: string;
124
+ } & (Rules extends undefined | never ? {
125
+ rules?: never;
126
+ } : {
127
+ rules: Rules;
128
+ });
129
+ type NumberBasedCertificateDefinitionRules = ({
130
+ minimum?: number;
131
+ exclusiveMinimum?: never;
132
+ } | {
133
+ minimum?: never;
134
+ exclusiveMinimum?: number;
135
+ }) & ({
136
+ maximum?: number;
137
+ exclusiveMaximum?: never;
138
+ } | {
139
+ maximum?: never;
140
+ exclusiveMaximum?: number;
141
+ });
142
+ export type NumberBasedCertificateDefinition = AbstractCertificateDefinition<'number', NumberBasedCertificateDefinitionRules>;
143
+ export type PercentageBasedCertificateDefinition = AbstractCertificateDefinition<'percentage', NumberBasedCertificateDefinitionRules>;
144
+ export type CertificateDefinition = NumberBasedCertificateDefinition | PercentageBasedCertificateDefinition;
114
145
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openframe-org/criteria-set-protocol",
3
- "version": "1.3.7",
3
+ "version": "1.4.0",
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>",