antifraud-data-utils-ts 0.0.0-stage → 0.1.1

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/LICENSE +13 -0
  3. package/README.md +155 -2
  4. package/dist/identity-assurance/claim-proofs.d.ts +62 -0
  5. package/dist/identity-assurance/claim-proofs.d.ts.map +1 -0
  6. package/dist/identity-assurance/claim-proofs.js +50 -0
  7. package/dist/identity-assurance/claim-proofs.js.map +1 -0
  8. package/dist/identity-assurance/converters.d.ts +10 -0
  9. package/dist/identity-assurance/converters.d.ts.map +1 -0
  10. package/dist/identity-assurance/converters.js +47 -0
  11. package/dist/identity-assurance/converters.js.map +1 -0
  12. package/dist/identity-assurance/credential-issuance.d.ts +41 -0
  13. package/dist/identity-assurance/credential-issuance.d.ts.map +1 -0
  14. package/dist/identity-assurance/credential-issuance.js +93 -0
  15. package/dist/identity-assurance/credential-issuance.js.map +1 -0
  16. package/dist/identity-assurance/identity-evidence.d.ts +124 -0
  17. package/dist/identity-assurance/identity-evidence.d.ts.map +1 -0
  18. package/dist/identity-assurance/identity-evidence.js +247 -0
  19. package/dist/identity-assurance/identity-evidence.js.map +1 -0
  20. package/dist/identity-assurance/index.d.ts +12 -0
  21. package/dist/identity-assurance/index.d.ts.map +1 -0
  22. package/dist/identity-assurance/index.js +12 -0
  23. package/dist/identity-assurance/index.js.map +1 -0
  24. package/dist/identity-assurance/professional-qualification.d.ts +150 -0
  25. package/dist/identity-assurance/professional-qualification.d.ts.map +1 -0
  26. package/dist/identity-assurance/professional-qualification.js +234 -0
  27. package/dist/identity-assurance/professional-qualification.js.map +1 -0
  28. package/dist/identity-assurance/schema-org-evidence.d.ts +30 -0
  29. package/dist/identity-assurance/schema-org-evidence.d.ts.map +1 -0
  30. package/dist/identity-assurance/schema-org-evidence.js +50 -0
  31. package/dist/identity-assurance/schema-org-evidence.js.map +1 -0
  32. package/dist/identity-assurance/schemas.d.ts +256 -0
  33. package/dist/identity-assurance/schemas.d.ts.map +1 -0
  34. package/dist/identity-assurance/schemas.js +163 -0
  35. package/dist/identity-assurance/schemas.js.map +1 -0
  36. package/dist/identity-assurance/tenant-trust.d.ts +29 -0
  37. package/dist/identity-assurance/tenant-trust.d.ts.map +1 -0
  38. package/dist/identity-assurance/tenant-trust.js +37 -0
  39. package/dist/identity-assurance/tenant-trust.js.map +1 -0
  40. package/dist/identity-assurance/types.d.ts +35 -0
  41. package/dist/identity-assurance/types.d.ts.map +1 -0
  42. package/dist/identity-assurance/types.js +2 -0
  43. package/dist/identity-assurance/types.js.map +1 -0
  44. package/dist/identity-assurance/vocabulary.d.ts +52 -0
  45. package/dist/identity-assurance/vocabulary.d.ts.map +1 -0
  46. package/dist/identity-assurance/vocabulary.js +48 -0
  47. package/dist/identity-assurance/vocabulary.js.map +1 -0
  48. package/dist/identity-assurance/workforce-assignment.d.ts +47 -0
  49. package/dist/identity-assurance/workforce-assignment.d.ts.map +1 -0
  50. package/dist/identity-assurance/workforce-assignment.js +52 -0
  51. package/dist/identity-assurance/workforce-assignment.js.map +1 -0
  52. package/dist/index.d.ts +2 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +2 -0
  55. package/dist/index.js.map +1 -0
  56. package/package.json +38 -4
@@ -0,0 +1,124 @@
1
+ import { IdentityAttestationCapability, SchemaOrgIdentityClaim, type IdentityAttestationCapabilityValue } from './vocabulary.js';
2
+ import { IdentityPredicateKind } from './claim-proofs.js';
3
+ /** Evidence types registered by OpenID Identity Assurance. */
4
+ export declare const IdentityEvidenceType: Readonly<{
5
+ readonly Document: "document";
6
+ readonly ElectronicRecord: "electronic_record";
7
+ readonly Vouch: "vouch";
8
+ readonly ElectronicSignature: "electronic_signature";
9
+ }>;
10
+ export type IdentityEvidenceTypeValue = typeof IdentityEvidenceType[keyof typeof IdentityEvidenceType];
11
+ export type IdentityEvidenceAttachmentReference = Readonly<{
12
+ id: string;
13
+ mediaType?: string;
14
+ contentUrl?: string;
15
+ contentSize?: number;
16
+ digestAlgorithm: 'sha-256' | 'sha-384' | 'sha-512' | 'sha3-384';
17
+ digest: string;
18
+ contentId?: string;
19
+ }>;
20
+ /** Validates CIDv1(raw, SHA3-384) encoded with multibase base58btc. */
21
+ export declare function assertSha3_384EvidenceContentId(contentId: string): void;
22
+ export type IdentityEvidenceCheck = Readonly<{
23
+ checkMethod: string;
24
+ organizationReference?: string;
25
+ checkId: string;
26
+ checkedAt?: string;
27
+ }>;
28
+ export type IdentityEvidenceInput = Readonly<{
29
+ id: string;
30
+ type: IdentityEvidenceTypeValue;
31
+ observedAt: string;
32
+ checks: readonly [IdentityEvidenceCheck, ...IdentityEvidenceCheck[]];
33
+ attachments?: readonly IdentityEvidenceAttachmentReference[];
34
+ }>;
35
+ export type IdentityEvidenceTarget = Readonly<{
36
+ kind: 'subject';
37
+ }> | Readonly<{
38
+ kind: 'claim';
39
+ claimPath: string;
40
+ }> | Readonly<{
41
+ kind: 'relationship';
42
+ relationshipType: string;
43
+ relatedSubjectReference: string;
44
+ }> | Readonly<{
45
+ kind: 'predicate';
46
+ predicate: typeof IdentityPredicateKind.AgeOver;
47
+ sourceSubjectReference: string;
48
+ sourceClaimPath: typeof SchemaOrgIdentityClaim.PersonBirthDate;
49
+ threshold: number;
50
+ result: boolean;
51
+ }>;
52
+ export declare const IdentityEvidenceTargetClaim: Readonly<{
53
+ readonly SubjectReference: "identity.evidence.subjectReference";
54
+ readonly Kind: "identity.evidence.target.kind";
55
+ readonly ClaimPath: "identity.evidence.target.claimPath";
56
+ readonly RelationshipType: "identity.evidence.target.relationshipType";
57
+ readonly RelatedSubjectReference: "identity.evidence.target.relatedSubjectReference";
58
+ readonly Predicate: "identity.evidence.target.predicate";
59
+ readonly SourceSubjectReference: "identity.evidence.target.sourceSubjectReference";
60
+ readonly SourceClaimPath: "identity.evidence.target.sourceClaimPath";
61
+ readonly Threshold: "identity.evidence.target.threshold";
62
+ readonly Result: "identity.evidence.target.result";
63
+ }>;
64
+ export declare const IdentityEvidenceCheckClaim: Readonly<{
65
+ readonly Reference: "identity.evidence.checkReference";
66
+ }>;
67
+ export type AuthenticatedWorkforceEvidenceContext = Readonly<{
68
+ actorReference: string;
69
+ assignmentReference: string;
70
+ organizationReference: string;
71
+ groupMembership: Readonly<{
72
+ groupReference: string;
73
+ status: 'active' | 'inactive';
74
+ }>;
75
+ groupAuthorization: Readonly<{
76
+ authorizationReference: string;
77
+ groupReference: string;
78
+ controllerReference: string;
79
+ status: 'active' | 'inactive';
80
+ capabilities: readonly IdentityAttestationCapabilityValue[];
81
+ }>;
82
+ subjectAuthorizationReference?: string;
83
+ }>;
84
+ export type WorkforceIdentityEvidenceStatementRequest = Readonly<{
85
+ operationId: string;
86
+ subjectReference: string;
87
+ targets: readonly [IdentityEvidenceTarget, ...IdentityEvidenceTarget[]];
88
+ evidence: readonly [IdentityEvidenceInput, ...IdentityEvidenceInput[]];
89
+ }>;
90
+ export type WorkforceIdentityEvidenceStatement = Readonly<{
91
+ operationId: string;
92
+ subjectReference: string;
93
+ capability: typeof IdentityAttestationCapability.RecordEvidence;
94
+ createdBy: Readonly<{
95
+ actorReference: string;
96
+ assignmentReference: string;
97
+ organizationReference: string;
98
+ }>;
99
+ authorization: Readonly<{
100
+ groupReference: string;
101
+ groupAuthorizationReference: string;
102
+ controllerReference: string;
103
+ subjectAuthorizationReference?: string;
104
+ }>;
105
+ targets: readonly IdentityEvidenceTarget[];
106
+ evidence: readonly IdentityEvidenceInput[];
107
+ }>;
108
+ /** Converts one validated target into strings suitable for claims-first indexing. */
109
+ export declare function toIdentityEvidenceTargetFlatClaims(input: Readonly<{
110
+ subjectReference: string;
111
+ target: IdentityEvidenceTarget;
112
+ }>): Readonly<Record<string, string>>;
113
+ /**
114
+ * Creates an unsigned, governed evidence statement for an authorized workforce
115
+ * member. The actor, assignment, organization, active group membership and
116
+ * reusable group authorization always come from trusted server context. A
117
+ * credential provider may later read this statement back and issue a signed
118
+ * attestation. No employee-specific Consent is created.
119
+ */
120
+ export declare function defineAuthorizedWorkforceIdentityEvidenceStatement(input: Readonly<{
121
+ context: AuthenticatedWorkforceEvidenceContext;
122
+ request: WorkforceIdentityEvidenceStatementRequest;
123
+ }>): WorkforceIdentityEvidenceStatement;
124
+ //# sourceMappingURL=identity-evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-evidence.d.ts","sourceRoot":"","sources":["../../src/identity-assurance/identity-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,EACtB,KAAK,kCAAkC,EACxC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB;;;;;EAKtB,CAAA;AAEX,MAAM,MAAM,yBAAyB,GACnC,OAAO,oBAAoB,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAA;AAEhE,MAAM,MAAM,mCAAmC,GAAG,QAAQ,CAAC;IACzD,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;IAC/D,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAuBF,uEAAuE;AACvE,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAcvE;AAmBD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAA;IACnB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,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,gBAAgB,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,sBAAsB,CAAA;CAC/B,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAyBpC;AAED;;;;;;GAMG;AACH,wBAAgB,kDAAkD,CAAC,KAAK,EAAE,QAAQ,CAAC;IACjF,OAAO,EAAE,qCAAqC,CAAA;IAC9C,OAAO,EAAE,yCAAyC,CAAA;CACnD,CAAC,GAAG,kCAAkC,CAwDtC"}
@@ -0,0 +1,247 @@
1
+ import { IdentityAttestationCapability, SchemaOrgIdentityClaim, } from './vocabulary.js';
2
+ import { IdentityPredicateKind } from './claim-proofs.js';
3
+ /** Evidence types registered by OpenID Identity Assurance. */
4
+ export const IdentityEvidenceType = Object.freeze({
5
+ Document: 'document',
6
+ ElectronicRecord: 'electronic_record',
7
+ Vouch: 'vouch',
8
+ ElectronicSignature: 'electronic_signature',
9
+ });
10
+ const BASE58BTC_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
11
+ function decodeBase58btc(value) {
12
+ let decoded = 0n;
13
+ for (const character of value) {
14
+ const index = BASE58BTC_ALPHABET.indexOf(character);
15
+ if (index < 0)
16
+ throw new TypeError('Invalid base58btc character');
17
+ decoded = decoded * 58n + BigInt(index);
18
+ }
19
+ const bytes = [];
20
+ while (decoded > 0n) {
21
+ bytes.unshift(Number(decoded & 0xffn));
22
+ decoded >>= 8n;
23
+ }
24
+ for (const character of value) {
25
+ if (character !== '1')
26
+ break;
27
+ bytes.unshift(0);
28
+ }
29
+ return Uint8Array.from(bytes);
30
+ }
31
+ /** Validates CIDv1(raw, SHA3-384) encoded with multibase base58btc. */
32
+ export function assertSha3_384EvidenceContentId(contentId) {
33
+ if (!/^z[1-9A-HJ-NP-Za-km-z]+$/u.test(contentId)) {
34
+ throw new TypeError('Evidence contentId must be a base58btc multibase CID');
35
+ }
36
+ const bytes = decodeBase58btc(contentId.slice(1));
37
+ if (bytes.length !== 52
38
+ || bytes[0] !== 0x01
39
+ || bytes[1] !== 0x55
40
+ || bytes[2] !== 0x15
41
+ || bytes[3] !== 0x30) {
42
+ throw new TypeError('Evidence contentId must be CIDv1 raw with a SHA3-384 multihash');
43
+ }
44
+ }
45
+ function assertContentIdMatchesDigest(contentId, digest) {
46
+ const cidBytes = decodeBase58btc(contentId.slice(1));
47
+ let digestBytes;
48
+ try {
49
+ digestBytes = Uint8Array.from(atob(digest), character => character.charCodeAt(0));
50
+ }
51
+ catch {
52
+ throw new TypeError('Evidence attachment digest must be base64 encoded');
53
+ }
54
+ const cidDigest = cidBytes.slice(4);
55
+ if (digestBytes.length !== cidDigest.length
56
+ || digestBytes.some((value, index) => value !== cidDigest[index])) {
57
+ throw new TypeError('Evidence attachment digest does not match contentId');
58
+ }
59
+ }
60
+ export const IdentityEvidenceTargetClaim = Object.freeze({
61
+ SubjectReference: 'identity.evidence.subjectReference',
62
+ Kind: 'identity.evidence.target.kind',
63
+ ClaimPath: 'identity.evidence.target.claimPath',
64
+ RelationshipType: 'identity.evidence.target.relationshipType',
65
+ RelatedSubjectReference: 'identity.evidence.target.relatedSubjectReference',
66
+ Predicate: 'identity.evidence.target.predicate',
67
+ SourceSubjectReference: 'identity.evidence.target.sourceSubjectReference',
68
+ SourceClaimPath: 'identity.evidence.target.sourceClaimPath',
69
+ Threshold: 'identity.evidence.target.threshold',
70
+ Result: 'identity.evidence.target.result',
71
+ });
72
+ export const IdentityEvidenceCheckClaim = Object.freeze({
73
+ Reference: 'identity.evidence.checkReference',
74
+ });
75
+ const RAW_EVIDENCE_PROPERTIES = Object.freeze([
76
+ 'base64',
77
+ 'bytes',
78
+ 'content',
79
+ 'document',
80
+ 'image',
81
+ ]);
82
+ function requireNonEmpty(value, field) {
83
+ if (value.trim().length === 0) {
84
+ throw new TypeError(`${field} must not be empty`);
85
+ }
86
+ }
87
+ function assertReferenceOnlyEvidence(evidence) {
88
+ for (const property of RAW_EVIDENCE_PROPERTIES) {
89
+ if (Object.hasOwn(evidence, property)) {
90
+ throw new TypeError('Raw evidence documents are not accepted; use digest-bound attachment references');
91
+ }
92
+ }
93
+ requireNonEmpty(evidence.id, 'evidence.id');
94
+ requireNonEmpty(evidence.observedAt, 'evidence.observedAt');
95
+ if (!Object.values(IdentityEvidenceType).includes(evidence.type)) {
96
+ throw new TypeError(`Unsupported identity evidence type: ${String(evidence.type)}`);
97
+ }
98
+ if (!Array.isArray(evidence.checks) || evidence.checks.length === 0) {
99
+ throw new TypeError('Identity evidence requires at least one check');
100
+ }
101
+ evidence.checks.forEach((check) => {
102
+ requireNonEmpty(check.checkMethod, 'evidence.checks.checkMethod');
103
+ requireNonEmpty(check.checkId, 'evidence.checks.checkId');
104
+ });
105
+ evidence.attachments?.forEach((attachment) => {
106
+ requireNonEmpty(attachment.id, 'evidence.attachments.id');
107
+ requireNonEmpty(attachment.digest, 'evidence.attachments.digest');
108
+ if (attachment.contentUrl !== undefined) {
109
+ requireNonEmpty(attachment.contentUrl, 'evidence.attachments.contentUrl');
110
+ }
111
+ if (attachment.contentSize !== undefined
112
+ && (!Number.isSafeInteger(attachment.contentSize) || attachment.contentSize < 0)) {
113
+ throw new TypeError('Evidence attachment contentSize must be a non-negative safe integer');
114
+ }
115
+ if (attachment.contentId !== undefined) {
116
+ assertSha3_384EvidenceContentId(attachment.contentId);
117
+ if (attachment.digestAlgorithm !== 'sha3-384') {
118
+ throw new TypeError('A SHA3-384 evidence contentId requires digestAlgorithm sha3-384');
119
+ }
120
+ assertContentIdMatchesDigest(attachment.contentId, attachment.digest);
121
+ }
122
+ });
123
+ }
124
+ function assertEvidenceTarget(target) {
125
+ if (target.kind === 'subject')
126
+ return;
127
+ if (target.kind === 'claim') {
128
+ requireNonEmpty(target.claimPath, 'targets.claimPath');
129
+ return;
130
+ }
131
+ if (target.kind === 'relationship') {
132
+ requireNonEmpty(target.relationshipType, 'targets.relationshipType');
133
+ requireNonEmpty(target.relatedSubjectReference, 'targets.relatedSubjectReference');
134
+ return;
135
+ }
136
+ if (target.kind === 'predicate') {
137
+ if (target.predicate !== IdentityPredicateKind.AgeOver) {
138
+ throw new TypeError(`Unsupported identity predicate: ${String(target.predicate)}`);
139
+ }
140
+ requireNonEmpty(target.sourceSubjectReference, 'targets.sourceSubjectReference');
141
+ if (target.sourceClaimPath !== SchemaOrgIdentityClaim.PersonBirthDate) {
142
+ throw new TypeError('Age-over evidence must derive from the Schema.org Person.birthDate claim');
143
+ }
144
+ if (!Number.isInteger(target.threshold) || target.threshold < 1 || target.threshold > 150) {
145
+ throw new TypeError('Age-over threshold must be an integer between 1 and 150');
146
+ }
147
+ if (typeof target.result !== 'boolean') {
148
+ throw new TypeError('Age-over evidence result must be boolean');
149
+ }
150
+ return;
151
+ }
152
+ throw new TypeError('Unsupported identity evidence target');
153
+ }
154
+ /** Converts one validated target into strings suitable for claims-first indexing. */
155
+ export function toIdentityEvidenceTargetFlatClaims(input) {
156
+ requireNonEmpty(input.subjectReference, 'subjectReference');
157
+ assertEvidenceTarget(input.target);
158
+ const common = {
159
+ [IdentityEvidenceTargetClaim.SubjectReference]: input.subjectReference,
160
+ [IdentityEvidenceTargetClaim.Kind]: input.target.kind,
161
+ };
162
+ if (input.target.kind === 'subject')
163
+ return Object.freeze(common);
164
+ if (input.target.kind === 'claim')
165
+ return Object.freeze({
166
+ ...common,
167
+ [IdentityEvidenceTargetClaim.ClaimPath]: input.target.claimPath,
168
+ });
169
+ if (input.target.kind === 'relationship')
170
+ return Object.freeze({
171
+ ...common,
172
+ [IdentityEvidenceTargetClaim.RelationshipType]: input.target.relationshipType,
173
+ [IdentityEvidenceTargetClaim.RelatedSubjectReference]: input.target.relatedSubjectReference,
174
+ });
175
+ return Object.freeze({
176
+ ...common,
177
+ [IdentityEvidenceTargetClaim.Predicate]: input.target.predicate,
178
+ [IdentityEvidenceTargetClaim.SourceSubjectReference]: input.target.sourceSubjectReference,
179
+ [IdentityEvidenceTargetClaim.SourceClaimPath]: input.target.sourceClaimPath,
180
+ [IdentityEvidenceTargetClaim.Threshold]: String(input.target.threshold),
181
+ [IdentityEvidenceTargetClaim.Result]: String(input.target.result),
182
+ });
183
+ }
184
+ /**
185
+ * Creates an unsigned, governed evidence statement for an authorized workforce
186
+ * member. The actor, assignment, organization, active group membership and
187
+ * reusable group authorization always come from trusted server context. A
188
+ * credential provider may later read this statement back and issue a signed
189
+ * attestation. No employee-specific Consent is created.
190
+ */
191
+ export function defineAuthorizedWorkforceIdentityEvidenceStatement(input) {
192
+ if (!input.context.groupAuthorization.capabilities.includes(IdentityAttestationCapability.RecordEvidence)) {
193
+ throw new TypeError(`Missing required capability: ${IdentityAttestationCapability.RecordEvidence}`);
194
+ }
195
+ requireNonEmpty(input.context.actorReference, 'context.actorReference');
196
+ requireNonEmpty(input.context.assignmentReference, 'context.assignmentReference');
197
+ requireNonEmpty(input.context.organizationReference, 'context.organizationReference');
198
+ if (input.context.groupMembership.status !== 'active') {
199
+ throw new TypeError('An active group membership is required');
200
+ }
201
+ requireNonEmpty(input.context.groupMembership.groupReference, 'context.groupMembership.groupReference');
202
+ if (input.context.groupAuthorization.status !== 'active') {
203
+ throw new TypeError('An active group authorization is required');
204
+ }
205
+ requireNonEmpty(input.context.groupAuthorization.authorizationReference, 'context.groupAuthorization.authorizationReference');
206
+ requireNonEmpty(input.context.groupAuthorization.controllerReference, 'context.groupAuthorization.controllerReference');
207
+ if (input.context.groupMembership.groupReference !== input.context.groupAuthorization.groupReference) {
208
+ throw new TypeError('Membership and authorization must reference the same professional group');
209
+ }
210
+ requireNonEmpty(input.request.operationId, 'request.operationId');
211
+ requireNonEmpty(input.request.subjectReference, 'request.subjectReference');
212
+ if (!Array.isArray(input.request.targets) || input.request.targets.length === 0) {
213
+ throw new TypeError('Identity evidence requires at least one target');
214
+ }
215
+ input.request.targets.forEach(assertEvidenceTarget);
216
+ if (!Array.isArray(input.request.evidence) || input.request.evidence.length === 0) {
217
+ throw new TypeError('Identity evidence requires at least one evidence item');
218
+ }
219
+ input.request.evidence.forEach(assertReferenceOnlyEvidence);
220
+ return Object.freeze({
221
+ operationId: input.request.operationId,
222
+ subjectReference: input.request.subjectReference,
223
+ capability: IdentityAttestationCapability.RecordEvidence,
224
+ createdBy: Object.freeze({
225
+ actorReference: input.context.actorReference,
226
+ assignmentReference: input.context.assignmentReference,
227
+ organizationReference: input.context.organizationReference,
228
+ }),
229
+ authorization: Object.freeze({
230
+ groupReference: input.context.groupMembership.groupReference,
231
+ groupAuthorizationReference: input.context.groupAuthorization.authorizationReference,
232
+ controllerReference: input.context.groupAuthorization.controllerReference,
233
+ ...(input.context.subjectAuthorizationReference
234
+ ? { subjectAuthorizationReference: input.context.subjectAuthorizationReference }
235
+ : {}),
236
+ }),
237
+ targets: Object.freeze(input.request.targets.map((target) => Object.freeze({ ...target }))),
238
+ evidence: Object.freeze(input.request.evidence.map((evidence) => Object.freeze({
239
+ ...evidence,
240
+ checks: Object.freeze(evidence.checks.map((check) => Object.freeze({ ...check }))),
241
+ ...(evidence.attachments
242
+ ? { attachments: Object.freeze(evidence.attachments.map((attachment) => Object.freeze({ ...attachment }))) }
243
+ : {}),
244
+ }))),
245
+ });
246
+ }
247
+ //# sourceMappingURL=identity-evidence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-evidence.js","sourceRoot":"","sources":["../../src/identity-assurance/identity-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,GAEvB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,QAAQ,EAAE,UAAU;IACpB,gBAAgB,EAAE,mBAAmB;IACrC,KAAK,EAAE,OAAO;IACd,mBAAmB,EAAE,sBAAsB;CACnC,CAAC,CAAA;AAeX,MAAM,kBAAkB,GAAG,4DAA4D,CAAA;AAEv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+ export * from './converters.js';
3
+ export * from './credential-issuance.js';
4
+ export * from './identity-evidence.js';
5
+ export * from './professional-qualification.js';
6
+ export * from './schema-org-evidence.js';
7
+ export * from './schemas.js';
8
+ export * from './tenant-trust.js';
9
+ export * from './types.js';
10
+ export * from './vocabulary.js';
11
+ export * from './workforce-assignment.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity-assurance/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,12 @@
1
+ export * from './claim-proofs.js';
2
+ export * from './converters.js';
3
+ export * from './credential-issuance.js';
4
+ export * from './identity-evidence.js';
5
+ export * from './professional-qualification.js';
6
+ export * from './schema-org-evidence.js';
7
+ export * from './schemas.js';
8
+ export * from './tenant-trust.js';
9
+ export * from './types.js';
10
+ export * from './vocabulary.js';
11
+ export * from './workforce-assignment.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity-assurance/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,150 @@
1
+ export declare const QualificationType: Readonly<{
2
+ readonly Degree: "degree";
3
+ readonly Certificate: "certificate";
4
+ readonly Licence: "licence";
5
+ readonly Accreditation: "accreditation";
6
+ readonly Training: "training";
7
+ }>;
8
+ export type QualificationTypeValue = typeof QualificationType[keyof typeof QualificationType];
9
+ export declare const QualificationAuthorityKind: Readonly<{
10
+ readonly Employer: "employer";
11
+ readonly QualificationIssuer: "qualification-issuer";
12
+ readonly ProfessionalBody: "professional-body";
13
+ }>;
14
+ export type QualificationAuthorityKindValue = typeof QualificationAuthorityKind[keyof typeof QualificationAuthorityKind];
15
+ /** Product-neutral result of checking one authoritative proof. */
16
+ export declare const QualificationVerificationStatus: Readonly<{
17
+ readonly Attested: "attested";
18
+ readonly Verified: "verified";
19
+ readonly InProcess: "in-process";
20
+ readonly RequiresReverification: "requires-reverification";
21
+ readonly VerificationFailed: "verification-failed";
22
+ readonly ReverificationFailed: "reverification-failed";
23
+ readonly EnteredInError: "entered-in-error";
24
+ }>;
25
+ export type QualificationVerificationStatusValue = typeof QualificationVerificationStatus[keyof typeof QualificationVerificationStatus];
26
+ export declare const QualificationLifecycleStatus: Readonly<{
27
+ readonly Active: "active";
28
+ readonly Suspended: "suspended";
29
+ readonly Revoked: "revoked";
30
+ readonly Expired: "expired";
31
+ readonly Unknown: "unknown";
32
+ }>;
33
+ export type QualificationLifecycleStatusValue = typeof QualificationLifecycleStatus[keyof typeof QualificationLifecycleStatus];
34
+ export type QualificationOrganizationReference = Readonly<{
35
+ organizationReference: string;
36
+ legalIdentifier: string;
37
+ jurisdiction: string;
38
+ }>;
39
+ export type QualificationProof = Readonly<{
40
+ id: string;
41
+ authorityKind: QualificationAuthorityKindValue;
42
+ organizationReference: string;
43
+ legalIdentifier: string;
44
+ jurisdiction: string;
45
+ verificationStatus: QualificationVerificationStatusValue;
46
+ verifiedAt: string;
47
+ proofReference: string;
48
+ }>;
49
+ export type ProfessionalQualification = Readonly<{
50
+ id: string;
51
+ subjectReference: string;
52
+ type: QualificationTypeValue;
53
+ identifier: Readonly<{
54
+ system?: string;
55
+ value: string;
56
+ }>;
57
+ code: Readonly<{
58
+ system: string;
59
+ code: string;
60
+ display?: string;
61
+ }>;
62
+ issuer: QualificationOrganizationReference;
63
+ period?: Readonly<{
64
+ start?: string;
65
+ end?: string;
66
+ }>;
67
+ lifecycleStatus: QualificationLifecycleStatusValue;
68
+ proofs: readonly QualificationProof[];
69
+ }>;
70
+ export type QualificationTrustBadge = Readonly<{
71
+ kind: 'employer-attested' | 'issuer-verified' | 'professional-body-verified' | 'licence-active' | 'licence-suspended' | 'licence-revoked' | 'licence-expired' | 'licence-status-unknown';
72
+ status: 'current' | 'attention';
73
+ proofId?: string;
74
+ }>;
75
+ /**
76
+ * Defines the claims-first qualification and its independent verification
77
+ * proofs. Native FHIR and Schema.org objects are generated only by explicit
78
+ * projection functions below.
79
+ */
80
+ export declare function defineProfessionalQualification(input: ProfessionalQualification): ProfessionalQualification;
81
+ export declare function deriveQualificationTrustBadges(qualification: ProfessionalQualification): readonly QualificationTrustBadge[];
82
+ /** Schema.org flat-claim names shared by forms, indexes and credential exchange. */
83
+ export declare const SchemaOrgQualificationClaim: Readonly<{
84
+ readonly Id: "org.schema.EducationalOccupationalCredential.id";
85
+ readonly IdentifierPropertyId: "org.schema.EducationalOccupationalCredential.identifier.propertyID";
86
+ readonly IdentifierValue: "org.schema.EducationalOccupationalCredential.identifier.value";
87
+ readonly Name: "org.schema.EducationalOccupationalCredential.name";
88
+ readonly CredentialCategory: "org.schema.EducationalOccupationalCredential.credentialCategory";
89
+ readonly PublisherIdentifierValue: "org.schema.EducationalOccupationalCredential.publisher.identifier.value";
90
+ readonly ValidInIdentifier: "org.schema.EducationalOccupationalCredential.validIn.identifier";
91
+ readonly ValidFrom: "org.schema.EducationalOccupationalCredential.validFrom";
92
+ readonly Expires: "org.schema.EducationalOccupationalCredential.expires";
93
+ }>;
94
+ export declare function toSchemaOrgQualificationFlatClaims(qualification: ProfessionalQualification): Readonly<Record<string, string>>;
95
+ export declare function projectProfessionalQualificationToSchemaOrg(qualification: ProfessionalQualification): Readonly<{
96
+ '@context': "https://schema.org";
97
+ '@type': "Person";
98
+ '@id': string;
99
+ hasCredential: {
100
+ credentialCategory: QualificationTypeValue;
101
+ publisher: {
102
+ '@type': string;
103
+ '@id': string;
104
+ identifier: {
105
+ '@type': string;
106
+ propertyID: string;
107
+ value: string;
108
+ };
109
+ };
110
+ validIn: {
111
+ '@type': string;
112
+ identifier: string;
113
+ };
114
+ recognizedBy: {
115
+ '@type': string;
116
+ '@id': string;
117
+ identifier: {
118
+ '@type': string;
119
+ propertyID: string;
120
+ value: string;
121
+ };
122
+ }[];
123
+ name?: string | undefined;
124
+ '@type': string;
125
+ '@id': string;
126
+ identifier: {
127
+ value: string;
128
+ propertyID?: string | undefined;
129
+ '@type': string;
130
+ };
131
+ };
132
+ }>;
133
+ export type QualificationLedgerAnchor = Readonly<{
134
+ assetType: 'qualification-evidence';
135
+ evidenceId: string;
136
+ subjectLink: string;
137
+ issuerLink: string;
138
+ verifierLinks: readonly string[];
139
+ contentHash: string;
140
+ lifecycleStatus: QualificationLifecycleStatusValue;
141
+ jurisdiction: string;
142
+ recordedAt: string;
143
+ }>;
144
+ /**
145
+ * Builds the only qualification projection suitable for a shared ledger.
146
+ * Personal claims, qualification values, legal identifiers, documents,
147
+ * credentials and signatures remain in confidential off-ledger storage.
148
+ */
149
+ export declare function buildQualificationLedgerAnchor(input: Omit<QualificationLedgerAnchor, 'assetType'>): QualificationLedgerAnchor;
150
+ //# sourceMappingURL=professional-qualification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"professional-qualification.d.ts","sourceRoot":"","sources":["../../src/identity-assurance/professional-qualification.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;EAMnB,CAAA;AAEX,MAAM,MAAM,sBAAsB,GAChC,OAAO,iBAA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