@uncefact/untp-utils 0.3.0 → 0.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.
- package/README.md +13 -13
- package/build/artefacts/detect-version-from-context.d.ts +7 -2
- package/build/artefacts/detect-version-from-context.js +17 -6
- package/build/artefacts/detect-version-from-context.js.map +1 -1
- package/build/artefacts/detect-version-from-context.test.js +59 -0
- package/build/artefacts/detect-version-from-context.test.js.map +1 -1
- package/build/artefacts/urls.d.ts +2 -1
- package/build/artefacts/urls.js +9 -5
- package/build/artefacts/urls.js.map +1 -1
- package/build/artefacts/urls.test.js +54 -0
- package/build/artefacts/urls.test.js.map +1 -1
- package/build/bundle/lookup.test.js +8 -8
- package/build/bundle/lookup.test.js.map +1 -1
- package/build/bundle/public.d.ts +7 -3
- package/build/bundle/public.js +7 -3
- package/build/bundle/public.js.map +1 -1
- package/build/bundle/public.test.js +6 -0
- package/build/bundle/public.test.js.map +1 -1
- package/build/common/canonical-json.d.ts +10 -0
- package/build/common/canonical-json.js +29 -0
- package/build/common/canonical-json.js.map +1 -0
- package/build/common/canonical-json.test.d.ts +1 -0
- package/build/common/canonical-json.test.js +20 -0
- package/build/common/canonical-json.test.js.map +1 -0
- package/build/common/index.d.ts +1 -0
- package/build/common/index.js +1 -0
- package/build/common/index.js.map +1 -1
- package/build/conformity-vocabulary/codes.d.ts +4 -0
- package/build/conformity-vocabulary/codes.js +4 -0
- package/build/conformity-vocabulary/codes.js.map +1 -1
- package/build/conformity-vocabulary/parse-conformity-scheme.test.js +150 -0
- package/build/conformity-vocabulary/parse-conformity-scheme.test.js.map +1 -1
- package/build/conformity-vocabulary/parsers/v0-7-0.parser.js +225 -0
- package/build/conformity-vocabulary/parsers/v0-7-0.parser.js.map +1 -1
- package/build/conformity-vocabulary/types.d.ts +69 -15
- package/build/conformity-vocabulary/validate-conformity-claim.d.ts +17 -11
- package/build/conformity-vocabulary/validate-conformity-claim.js +118 -13
- package/build/conformity-vocabulary/validate-conformity-claim.js.map +1 -1
- package/build/conformity-vocabulary/validate-conformity-claim.test.js +265 -0
- package/build/conformity-vocabulary/validate-conformity-claim.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -21,6 +21,30 @@ export interface ConformityTopic {
|
|
|
21
21
|
/** Free-text definition, when present. */
|
|
22
22
|
definition?: string;
|
|
23
23
|
}
|
|
24
|
+
/** A code published by a conformity scoring framework. */
|
|
25
|
+
export interface ConformityScore {
|
|
26
|
+
/** Exact score code. Empty strings are retained when published. */
|
|
27
|
+
code: string;
|
|
28
|
+
rank?: number;
|
|
29
|
+
definition?: string;
|
|
30
|
+
}
|
|
31
|
+
/** A named set of scores published by a scheme or profile. */
|
|
32
|
+
export interface ConformityScoringFramework {
|
|
33
|
+
name: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
scores: ConformityScore[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A criterion's required performance, which may be a metric, a score, both, or
|
|
39
|
+
* neither when the publisher supplies neither.
|
|
40
|
+
*/
|
|
41
|
+
export interface ConformityRequiredPerformance {
|
|
42
|
+
metric?: {
|
|
43
|
+
canonicalId?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
};
|
|
46
|
+
score?: ConformityScore;
|
|
47
|
+
}
|
|
24
48
|
/**
|
|
25
49
|
* A single auditable criterion within a profile.
|
|
26
50
|
*
|
|
@@ -42,6 +66,8 @@ export interface ConformityCriterion {
|
|
|
42
66
|
topics: ConformityTopic[];
|
|
43
67
|
/** Free-form tags attached to the criterion. */
|
|
44
68
|
tags: string[];
|
|
69
|
+
/** Performance levels required by this criterion, when published. */
|
|
70
|
+
requiredPerformance?: ConformityRequiredPerformance[];
|
|
45
71
|
}
|
|
46
72
|
/**
|
|
47
73
|
* A profile within a scheme. Profile URI is stable and versioned per spec.
|
|
@@ -60,6 +86,8 @@ export interface ConformityProfile {
|
|
|
60
86
|
validFrom?: string;
|
|
61
87
|
/** Criteria inlined within this profile. */
|
|
62
88
|
criteria: ConformityCriterion[];
|
|
89
|
+
/** Scoring frameworks applied to criteria in this profile, when published. */
|
|
90
|
+
criterionScoringFrameworks?: ConformityScoringFramework[];
|
|
63
91
|
}
|
|
64
92
|
/**
|
|
65
93
|
* A parsed conformity scheme as published by a scheme owner.
|
|
@@ -82,6 +110,21 @@ export interface ConformityScheme {
|
|
|
82
110
|
documentation?: string;
|
|
83
111
|
owner?: ConformitySchemeOwner;
|
|
84
112
|
profiles: ConformityProfile[];
|
|
113
|
+
/** Overall scoring framework published by the scheme, when present. */
|
|
114
|
+
scoringFramework?: ConformityScoringFramework;
|
|
115
|
+
}
|
|
116
|
+
/** A catalogue match for an id that may belong to a different vocabulary tier. */
|
|
117
|
+
export interface ConformityReferenceMatch {
|
|
118
|
+
tier: 'scheme' | 'profile' | 'criterion';
|
|
119
|
+
/** Canonical ids of the visible schemes containing the matched entry. */
|
|
120
|
+
schemes: string[];
|
|
121
|
+
/** Canonical ids of the visible profiles containing a matched criterion, read by wrong-tier diagnostic messages. */
|
|
122
|
+
profiles?: string[];
|
|
123
|
+
}
|
|
124
|
+
/** Catalogue matches supplied by a caller that has resolved submitted ids. */
|
|
125
|
+
export interface ConformityReferenceResolution {
|
|
126
|
+
scheme?: ConformityReferenceMatch[];
|
|
127
|
+
profile?: ConformityReferenceMatch[];
|
|
85
128
|
}
|
|
86
129
|
/**
|
|
87
130
|
* One entry in the UNTP Conformity Vocabulary Catalogue Register. Ingestion
|
|
@@ -124,25 +167,31 @@ export interface ConformityClaimCriterion {
|
|
|
124
167
|
}
|
|
125
168
|
/**
|
|
126
169
|
* A single assessment entry on a credential's conformity claim: the criteria
|
|
127
|
-
* the assessment references
|
|
128
|
-
*
|
|
129
|
-
* published topics of the assessment's
|
|
130
|
-
* declared topic outside the union warns,
|
|
131
|
-
* does not declare is acceptable, because
|
|
132
|
-
* categorisation rather than an exhaustive
|
|
170
|
+
* the assessment references, the topics it declares for itself, and the
|
|
171
|
+
* performance score codes it carries. The declared topics are validated
|
|
172
|
+
* against the deduplicated union of the published topics of the assessment's
|
|
173
|
+
* criteria, in one direction only: a declared topic outside the union warns,
|
|
174
|
+
* while a union topic the assessment does not declare is acceptable, because
|
|
175
|
+
* the assessment's topics are a categorisation rather than an exhaustive
|
|
176
|
+
* enumeration.
|
|
133
177
|
*/
|
|
134
178
|
export interface ConformityClaimAssessment {
|
|
135
179
|
/**
|
|
136
180
|
* Criterion URIs the assessment references. Extractors must also emit every
|
|
137
181
|
* entry here as a {@link ConformityClaimCriterion} in the claim's `criteria`
|
|
138
|
-
* list: the validator's assessment
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
182
|
+
* list: the validator's assessment topic and score checks both skip
|
|
183
|
+
* unresolved criteria on the assumption that
|
|
184
|
+
* `conformity-criterion.not-in-profile` has already surfaced them from
|
|
185
|
+
* `criteria`, so an entry present only here would silently escape the
|
|
186
|
+
* criterion, topic and score checks alike.
|
|
142
187
|
*/
|
|
143
188
|
criteria: string[];
|
|
144
189
|
/** Topic URIs the assessment declares for itself. */
|
|
145
190
|
conformityTopics: string[];
|
|
191
|
+
/** Performance score codes extracted from this assessment; absent and empty both mean nothing to check. */
|
|
192
|
+
assessedScores?: {
|
|
193
|
+
code: string;
|
|
194
|
+
}[];
|
|
146
195
|
}
|
|
147
196
|
/**
|
|
148
197
|
* A conformity claim extracted from a Digital Conformity Credential, in the
|
|
@@ -165,16 +214,21 @@ export interface ConformityClaim {
|
|
|
165
214
|
/**
|
|
166
215
|
* Profile URI the claim references. Optional because not every data model
|
|
167
216
|
* requires a profile reference. When absent, the validator checks the scheme
|
|
168
|
-
* reference
|
|
169
|
-
* since criteria are published
|
|
217
|
+
* reference and the attestation `profileScore`, and emits a
|
|
218
|
+
* `conformity-profile.not-specified` advisory, since criteria are published
|
|
219
|
+
* per versioned profile.
|
|
170
220
|
*/
|
|
171
221
|
profile?: string;
|
|
222
|
+
/** Overall score code for the referenced profile, when carried by the claim. */
|
|
223
|
+
profileScore?: {
|
|
224
|
+
code: string;
|
|
225
|
+
};
|
|
172
226
|
/** Criteria the claim addresses. */
|
|
173
227
|
criteria: ConformityClaimCriterion[];
|
|
174
228
|
/**
|
|
175
|
-
* Assessment-level topic declarations. Optional and
|
|
176
|
-
* extractor populates it
|
|
177
|
-
* topic.
|
|
229
|
+
* Assessment-level topic and performance-score declarations. Optional and
|
|
230
|
+
* version-specific: an extractor populates it when its data model classifies
|
|
231
|
+
* assessments by topic, carries assessment performance scores, or both.
|
|
178
232
|
*/
|
|
179
233
|
assessments?: ConformityClaimAssessment[];
|
|
180
234
|
}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import type { ConformityClaim, ConformityScheme, ConformityWarning } from './types.js';
|
|
1
|
+
import type { ConformityClaim, ConformityReferenceResolution, ConformityScheme, ConformityWarning } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Validates a credential's conformity claim against a parsed scheme.
|
|
4
4
|
*
|
|
5
5
|
* Short-circuits at the first miss:
|
|
6
|
-
* - scheme null or `canonicalId` mismatch → only `conformity-scheme.not-found
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - profile
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* - scheme null or `canonicalId` mismatch → only `conformity-scheme.not-found`,
|
|
7
|
+
* unless the caller supplied a wrong-tier reference diagnosis.
|
|
8
|
+
* - attestation `profileScore` outside the codes the scheme's framework
|
|
9
|
+
* publishes → `conformity-attestation.score-not-in-framework`. This check
|
|
10
|
+
* runs before the profile branches, so its warning can accompany any of them.
|
|
11
|
+
* - profile absent on the claim → the checks above plus a
|
|
12
|
+
* `conformity-profile.not-specified` advisory. Criteria are published per
|
|
13
|
+
* versioned profile, so without one the criterion, topic and performance-score
|
|
14
|
+
* checks cannot run, and silence would be indistinguishable from a clean pass.
|
|
15
|
+
* - profile not in scheme → `conformity-profile.not-found` or
|
|
16
|
+
* `conformity-profile.wrong-tier`, beside any attestation-score warning
|
|
17
|
+
* already raised.
|
|
18
|
+
* - otherwise → criteria-level, criterion-topic, assessment-topic and
|
|
19
|
+
* assessment-score warnings accumulate.
|
|
14
20
|
*
|
|
15
21
|
* Pointers are relative to `claim`. A consumer that holds the document the
|
|
16
22
|
* claim was extracted from re-maps them onto it, and prepending a wrapper path
|
|
@@ -21,6 +27,6 @@ import type { ConformityClaim, ConformityScheme, ConformityWarning } from './typ
|
|
|
21
27
|
* that filters empty or malformed entries shifts both `/assessments/{i}` and
|
|
22
28
|
* topic indices away from their source positions (#753).
|
|
23
29
|
*
|
|
24
|
-
* @see ADR-033 §3 for warning code definitions.
|
|
30
|
+
* @see ADR-033 §3 and ADR-059 for warning code definitions.
|
|
25
31
|
*/
|
|
26
|
-
export declare function validateConformityClaim(claim: ConformityClaim, scheme: ConformityScheme | null): readonly ConformityWarning[];
|
|
32
|
+
export declare function validateConformityClaim(claim: ConformityClaim, scheme: ConformityScheme | null, references?: ConformityReferenceResolution): readonly ConformityWarning[];
|
|
@@ -3,14 +3,20 @@ import { ConformityWarningCode } from './codes.js';
|
|
|
3
3
|
* Validates a credential's conformity claim against a parsed scheme.
|
|
4
4
|
*
|
|
5
5
|
* Short-circuits at the first miss:
|
|
6
|
-
* - scheme null or `canonicalId` mismatch → only `conformity-scheme.not-found
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - profile
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* - scheme null or `canonicalId` mismatch → only `conformity-scheme.not-found`,
|
|
7
|
+
* unless the caller supplied a wrong-tier reference diagnosis.
|
|
8
|
+
* - attestation `profileScore` outside the codes the scheme's framework
|
|
9
|
+
* publishes → `conformity-attestation.score-not-in-framework`. This check
|
|
10
|
+
* runs before the profile branches, so its warning can accompany any of them.
|
|
11
|
+
* - profile absent on the claim → the checks above plus a
|
|
12
|
+
* `conformity-profile.not-specified` advisory. Criteria are published per
|
|
13
|
+
* versioned profile, so without one the criterion, topic and performance-score
|
|
14
|
+
* checks cannot run, and silence would be indistinguishable from a clean pass.
|
|
15
|
+
* - profile not in scheme → `conformity-profile.not-found` or
|
|
16
|
+
* `conformity-profile.wrong-tier`, beside any attestation-score warning
|
|
17
|
+
* already raised.
|
|
18
|
+
* - otherwise → criteria-level, criterion-topic, assessment-topic and
|
|
19
|
+
* assessment-score warnings accumulate.
|
|
14
20
|
*
|
|
15
21
|
* Pointers are relative to `claim`. A consumer that holds the document the
|
|
16
22
|
* claim was extracted from re-maps them onto it, and prepending a wrapper path
|
|
@@ -21,12 +27,13 @@ import { ConformityWarningCode } from './codes.js';
|
|
|
21
27
|
* that filters empty or malformed entries shifts both `/assessments/{i}` and
|
|
22
28
|
* topic indices away from their source positions (#753).
|
|
23
29
|
*
|
|
24
|
-
* @see ADR-033 §3 for warning code definitions.
|
|
30
|
+
* @see ADR-033 §3 and ADR-059 for warning code definitions.
|
|
25
31
|
*/
|
|
26
|
-
export function validateConformityClaim(claim, scheme) {
|
|
32
|
+
export function validateConformityClaim(claim, scheme, references) {
|
|
27
33
|
const warnings = [];
|
|
28
34
|
if (!scheme || scheme.canonicalId !== claim.scheme) {
|
|
29
|
-
|
|
35
|
+
const wrongTier = schemeWrongTierWarning(claim.scheme, references?.scheme);
|
|
36
|
+
warnings.push(wrongTier ?? {
|
|
30
37
|
code: ConformityWarningCode.SchemeNotFound,
|
|
31
38
|
message: 'Scheme URI is not in the known set.',
|
|
32
39
|
received: claim.scheme,
|
|
@@ -34,22 +41,60 @@ export function validateConformityClaim(claim, scheme) {
|
|
|
34
41
|
});
|
|
35
42
|
return warnings;
|
|
36
43
|
}
|
|
44
|
+
const schemeScoreCodes = uniqueStrings(scheme.scoringFramework?.scores.map((score) => score.code) ?? []);
|
|
45
|
+
if (claim.profileScore != null &&
|
|
46
|
+
schemeScoreCodes.length > 0 &&
|
|
47
|
+
!schemeScoreCodes.includes(claim.profileScore.code)) {
|
|
48
|
+
warnings.push({
|
|
49
|
+
code: ConformityWarningCode.AttestationScoreNotInFramework,
|
|
50
|
+
message: `Profile score code is not published by scheme ${scheme.canonicalId}'s scoring framework.`,
|
|
51
|
+
received: claim.profileScore.code,
|
|
52
|
+
expected: schemeScoreCodes,
|
|
53
|
+
pointer: '/profileScore/code',
|
|
54
|
+
});
|
|
55
|
+
}
|
|
37
56
|
// `== null` covers undefined and a runtime null from JSON or database rows.
|
|
38
57
|
if (claim.profile == null) {
|
|
39
58
|
warnings.push({
|
|
40
59
|
code: ConformityWarningCode.ProfileNotSpecified,
|
|
41
|
-
message: 'The claim references no profile; criterion and topic checks were not performed because criteria are published per profile.',
|
|
60
|
+
message: 'The claim references no profile; assessment performance scores were not checked, and criterion and topic checks were not performed because criteria are published per profile.',
|
|
42
61
|
pointer: '/profile',
|
|
43
62
|
});
|
|
44
63
|
return warnings;
|
|
45
64
|
}
|
|
46
65
|
const profile = scheme.profiles.find((p) => p.canonicalId === claim.profile);
|
|
47
66
|
if (!profile) {
|
|
67
|
+
const expected = uniqueSortedStrings(scheme.profiles.map((p) => p.canonicalId));
|
|
68
|
+
const profileMatch = references?.profile?.find((match) => match.tier === 'profile');
|
|
69
|
+
if (profileMatch) {
|
|
70
|
+
warnings.push({
|
|
71
|
+
code: ConformityWarningCode.ProfileNotFound,
|
|
72
|
+
message: `Profile URI is not among the selected scheme's published profiles; the id belongs to scheme${profileMatch.schemes.length === 1 ? '' : 's'} ${profileMatch.schemes.join(', ')}.`,
|
|
73
|
+
received: claim.profile,
|
|
74
|
+
expected,
|
|
75
|
+
pointer: '/profile',
|
|
76
|
+
});
|
|
77
|
+
return warnings;
|
|
78
|
+
}
|
|
79
|
+
const wrongTier = references?.profile?.find((match) => match.tier !== 'profile' && match.schemes.length > 0);
|
|
80
|
+
if (wrongTier) {
|
|
81
|
+
const message = wrongTier.tier === 'scheme'
|
|
82
|
+
? 'The referenced id is a scheme, not a profile in the selected scheme.'
|
|
83
|
+
: `The referenced id is a criterion of ${wrongTier.profiles?.length === 1 ? 'profile' : 'profiles'} ${uniqueSortedStrings(wrongTier.profiles ?? []).join(', ')} in ${wrongTier.schemes.length === 1 ? 'scheme' : 'schemes'} ${uniqueSortedStrings(wrongTier.schemes).join(', ')}, not a profile in the selected scheme.`;
|
|
84
|
+
warnings.push({
|
|
85
|
+
code: ConformityWarningCode.ProfileWrongTier,
|
|
86
|
+
message,
|
|
87
|
+
received: claim.profile,
|
|
88
|
+
expected,
|
|
89
|
+
pointer: '/profile',
|
|
90
|
+
});
|
|
91
|
+
return warnings;
|
|
92
|
+
}
|
|
48
93
|
warnings.push({
|
|
49
94
|
code: ConformityWarningCode.ProfileNotFound,
|
|
50
95
|
message: "Profile URI is not among the scheme's published profiles.",
|
|
51
96
|
received: claim.profile,
|
|
52
|
-
expected
|
|
97
|
+
expected,
|
|
53
98
|
pointer: '/profile',
|
|
54
99
|
});
|
|
55
100
|
return warnings;
|
|
@@ -160,6 +205,66 @@ export function validateConformityClaim(claim, scheme) {
|
|
|
160
205
|
}
|
|
161
206
|
});
|
|
162
207
|
});
|
|
208
|
+
// assessment-score membership is independent of assessment-topic membership.
|
|
209
|
+
// The DCC does not identify the framework for a performance score, so the
|
|
210
|
+
// validator accepts a code published by any applicable framework. An
|
|
211
|
+
// unresolved criterion suppresses only this assessment's score check because
|
|
212
|
+
// that criterion could publish the received code.
|
|
213
|
+
claim.assessments?.forEach((assessment, i) => {
|
|
214
|
+
if (!assessment.assessedScores || assessment.assessedScores.length === 0)
|
|
215
|
+
return;
|
|
216
|
+
const resolvedCriteria = assessment.criteria
|
|
217
|
+
.map((criterionId) => profileCriteriaById.get(criterionId))
|
|
218
|
+
.filter((criterion) => criterion !== undefined);
|
|
219
|
+
if (resolvedCriteria.length !== assessment.criteria.length)
|
|
220
|
+
return;
|
|
221
|
+
const expected = performanceScoreCodes(scheme, profile, resolvedCriteria);
|
|
222
|
+
if (expected.length === 0)
|
|
223
|
+
return;
|
|
224
|
+
assessment.assessedScores.forEach((score, scoreIndex) => {
|
|
225
|
+
if (expected.includes(score.code))
|
|
226
|
+
return;
|
|
227
|
+
warnings.push({
|
|
228
|
+
code: ConformityWarningCode.AssessmentScoreNotInFramework,
|
|
229
|
+
message: `Assessment score code is not published by the scheme, profile or referenced-criterion frameworks that apply to profile ${profile.canonicalId}.`,
|
|
230
|
+
received: score.code,
|
|
231
|
+
expected,
|
|
232
|
+
pointer: `/assessments/${i}/assessedScores/${scoreIndex}/code`,
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
});
|
|
163
236
|
return warnings;
|
|
164
237
|
}
|
|
238
|
+
function uniqueStrings(values) {
|
|
239
|
+
return [...new Set(values)];
|
|
240
|
+
}
|
|
241
|
+
function uniqueSortedStrings(values) {
|
|
242
|
+
return [...new Set(values)].sort();
|
|
243
|
+
}
|
|
244
|
+
function schemeWrongTierWarning(received, matches) {
|
|
245
|
+
const usableMatches = matches?.filter((match) => match.schemes.length > 0) ?? [];
|
|
246
|
+
if (usableMatches.length === 0 || usableMatches.some((match) => match.tier === 'scheme'))
|
|
247
|
+
return undefined;
|
|
248
|
+
const tiers = uniqueStrings(usableMatches.map((match) => match.tier));
|
|
249
|
+
const expected = uniqueSortedStrings(usableMatches.flatMap((match) => match.schemes));
|
|
250
|
+
return {
|
|
251
|
+
code: ConformityWarningCode.SchemeWrongTier,
|
|
252
|
+
message: `The referenced id is a ${tiers.join(' or ')}, not a scheme; it belongs to scheme${expected.length === 1 ? '' : 's'} ${expected.join(', ')}.`,
|
|
253
|
+
received,
|
|
254
|
+
expected,
|
|
255
|
+
pointer: '/scheme',
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function performanceScoreCodes(scheme, profile, resolvedCriteria) {
|
|
259
|
+
const codes = [];
|
|
260
|
+
scheme.scoringFramework?.scores.forEach((score) => codes.push(score.code));
|
|
261
|
+
profile.criterionScoringFrameworks?.forEach((framework) => framework.scores.forEach((score) => codes.push(score.code)));
|
|
262
|
+
resolvedCriteria.forEach((criterion) => {
|
|
263
|
+
criterion.requiredPerformance?.forEach((performance) => {
|
|
264
|
+
if (performance.score)
|
|
265
|
+
codes.push(performance.score.code);
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
return uniqueStrings(codes);
|
|
269
|
+
}
|
|
165
270
|
//# sourceMappingURL=validate-conformity-claim.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-conformity-claim.js","sourceRoot":"","sources":["../../src/conformity-vocabulary/validate-conformity-claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-conformity-claim.js","sourceRoot":"","sources":["../../src/conformity-vocabulary/validate-conformity-claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAUnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,uBAAuB,CACrC,KAAsB,EACtB,MAA+B,EAC/B,UAA0C;IAE1C,MAAM,QAAQ,GAAwB,EAAE,CAAC;IAEzC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,WAAW,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QACnD,MAAM,SAAS,GAAG,sBAAsB,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;QAC3E,QAAQ,CAAC,IAAI,CACX,SAAS,IAAI;YACX,IAAI,EAAE,qBAAqB,CAAC,cAAc;YAC1C,OAAO,EAAE,qCAAqC;YAC9C,QAAQ,EAAE,KAAK,CAAC,MAAM;YACtB,OAAO,EAAE,SAAS;SACnB,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAA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