antifraud-data-utils-ts 0.0.0-stage → 0.1.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/CHANGELOG.md +48 -0
- package/LICENSE +13 -0
- package/README.md +155 -2
- package/dist/identity-assurance/claim-proofs.d.ts +62 -0
- package/dist/identity-assurance/claim-proofs.d.ts.map +1 -0
- package/dist/identity-assurance/claim-proofs.js +50 -0
- package/dist/identity-assurance/claim-proofs.js.map +1 -0
- package/dist/identity-assurance/converters.d.ts +10 -0
- package/dist/identity-assurance/converters.d.ts.map +1 -0
- package/dist/identity-assurance/converters.js +47 -0
- package/dist/identity-assurance/converters.js.map +1 -0
- package/dist/identity-assurance/identity-evidence.d.ts +124 -0
- package/dist/identity-assurance/identity-evidence.d.ts.map +1 -0
- package/dist/identity-assurance/identity-evidence.js +247 -0
- package/dist/identity-assurance/identity-evidence.js.map +1 -0
- package/dist/identity-assurance/index.d.ts +11 -0
- package/dist/identity-assurance/index.d.ts.map +1 -0
- package/dist/identity-assurance/index.js +11 -0
- package/dist/identity-assurance/index.js.map +1 -0
- package/dist/identity-assurance/professional-qualification.d.ts +150 -0
- package/dist/identity-assurance/professional-qualification.d.ts.map +1 -0
- package/dist/identity-assurance/professional-qualification.js +234 -0
- package/dist/identity-assurance/professional-qualification.js.map +1 -0
- package/dist/identity-assurance/schema-org-evidence.d.ts +30 -0
- package/dist/identity-assurance/schema-org-evidence.d.ts.map +1 -0
- package/dist/identity-assurance/schema-org-evidence.js +50 -0
- package/dist/identity-assurance/schema-org-evidence.js.map +1 -0
- package/dist/identity-assurance/schemas.d.ts +256 -0
- package/dist/identity-assurance/schemas.d.ts.map +1 -0
- package/dist/identity-assurance/schemas.js +163 -0
- package/dist/identity-assurance/schemas.js.map +1 -0
- package/dist/identity-assurance/tenant-trust.d.ts +29 -0
- package/dist/identity-assurance/tenant-trust.d.ts.map +1 -0
- package/dist/identity-assurance/tenant-trust.js +37 -0
- package/dist/identity-assurance/tenant-trust.js.map +1 -0
- package/dist/identity-assurance/types.d.ts +35 -0
- package/dist/identity-assurance/types.d.ts.map +1 -0
- package/dist/identity-assurance/types.js +2 -0
- package/dist/identity-assurance/types.js.map +1 -0
- package/dist/identity-assurance/vocabulary.d.ts +52 -0
- package/dist/identity-assurance/vocabulary.d.ts.map +1 -0
- package/dist/identity-assurance/vocabulary.js +48 -0
- package/dist/identity-assurance/vocabulary.js.map +1 -0
- package/dist/identity-assurance/workforce-assignment.d.ts +47 -0
- package/dist/identity-assurance/workforce-assignment.d.ts.map +1 -0
- package/dist/identity-assurance/workforce-assignment.js +52 -0
- package/dist/identity-assurance/workforce-assignment.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -4
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { IdentityAttestationCapability } from './vocabulary.js';
|
|
2
|
+
const evidenceSchema = {
|
|
3
|
+
type: 'object',
|
|
4
|
+
required: ['type'],
|
|
5
|
+
properties: {
|
|
6
|
+
type: { type: 'string', minLength: 1 },
|
|
7
|
+
},
|
|
8
|
+
additionalProperties: true,
|
|
9
|
+
};
|
|
10
|
+
const workforceEvidenceCheckSchema = {
|
|
11
|
+
type: 'object',
|
|
12
|
+
required: ['checkMethod', 'checkId'],
|
|
13
|
+
properties: {
|
|
14
|
+
checkMethod: { type: 'string', minLength: 1 },
|
|
15
|
+
organizationReference: { type: 'string', minLength: 1 },
|
|
16
|
+
checkId: { type: 'string', minLength: 1 },
|
|
17
|
+
checkedAt: { type: 'string', format: 'date-time' },
|
|
18
|
+
},
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
};
|
|
21
|
+
const workforceEvidenceAttachmentSchema = {
|
|
22
|
+
type: 'object',
|
|
23
|
+
required: ['id', 'digestAlgorithm', 'digest'],
|
|
24
|
+
properties: {
|
|
25
|
+
id: { type: 'string', minLength: 1 },
|
|
26
|
+
mediaType: { type: 'string', minLength: 1 },
|
|
27
|
+
contentUrl: { type: 'string', minLength: 1, format: 'uri' },
|
|
28
|
+
contentSize: { type: 'integer', minimum: 0 },
|
|
29
|
+
digestAlgorithm: { enum: ['sha-256', 'sha-384', 'sha-512', 'sha3-384'] },
|
|
30
|
+
digest: { type: 'string', minLength: 1 },
|
|
31
|
+
contentId: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
pattern: '^z[1-9A-HJ-NP-Za-km-z]+$',
|
|
34
|
+
description: 'Optional CIDv1(raw, SHA3-384) encoded with multibase base58btc.',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
};
|
|
39
|
+
const workforceEvidenceItemSchema = {
|
|
40
|
+
type: 'object',
|
|
41
|
+
required: ['id', 'type', 'observedAt', 'checks'],
|
|
42
|
+
properties: {
|
|
43
|
+
id: { type: 'string', minLength: 1 },
|
|
44
|
+
type: { enum: ['document', 'electronic_record', 'vouch', 'electronic_signature'] },
|
|
45
|
+
observedAt: { type: 'string', format: 'date-time' },
|
|
46
|
+
checks: {
|
|
47
|
+
type: 'array',
|
|
48
|
+
minItems: 1,
|
|
49
|
+
items: workforceEvidenceCheckSchema,
|
|
50
|
+
},
|
|
51
|
+
attachments: {
|
|
52
|
+
type: 'array',
|
|
53
|
+
items: workforceEvidenceAttachmentSchema,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
additionalProperties: false,
|
|
57
|
+
};
|
|
58
|
+
export const verifiedClaimsJsonSchema = Object.freeze({
|
|
59
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
60
|
+
$id: 'https://antifraudservices.github.io/antifraud-data-utils-ts/schemas/oidc4ida-verified-claims.json',
|
|
61
|
+
title: 'OIDC4IDA Verified Claims',
|
|
62
|
+
type: 'object',
|
|
63
|
+
required: ['claims', 'verification'],
|
|
64
|
+
properties: {
|
|
65
|
+
claims: {
|
|
66
|
+
type: 'object',
|
|
67
|
+
additionalProperties: true,
|
|
68
|
+
},
|
|
69
|
+
verification: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
required: ['evidence'],
|
|
72
|
+
properties: {
|
|
73
|
+
trust_framework: { type: ['string', 'null'] },
|
|
74
|
+
assurance_level: { type: ['string', 'null'] },
|
|
75
|
+
assurance_process: { type: ['string', 'null'] },
|
|
76
|
+
verification_process: { type: ['string', 'null'] },
|
|
77
|
+
time: { type: ['string', 'null'], format: 'date-time' },
|
|
78
|
+
evidence: {
|
|
79
|
+
type: 'array',
|
|
80
|
+
minItems: 1,
|
|
81
|
+
items: evidenceSchema,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
additionalProperties: true,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
additionalProperties: false,
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Stored-statement schema. A form may render its evidence fields, but the host
|
|
91
|
+
* must populate the read-only actor and authorization fields from its trusted
|
|
92
|
+
* session, active group membership and reusable group authorization.
|
|
93
|
+
*/
|
|
94
|
+
export const workforceIdentityEvidenceStatementJsonSchema = Object.freeze({
|
|
95
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
96
|
+
$id: 'https://antifraudservices.github.io/antifraud-data-utils-ts/schemas/workforce-identity-evidence-statement.json',
|
|
97
|
+
title: 'Authorized workforce identity evidence statement',
|
|
98
|
+
type: 'object',
|
|
99
|
+
required: [
|
|
100
|
+
'operationId',
|
|
101
|
+
'subjectReference',
|
|
102
|
+
'capability',
|
|
103
|
+
'createdBy',
|
|
104
|
+
'authorization',
|
|
105
|
+
'targets',
|
|
106
|
+
'evidence',
|
|
107
|
+
],
|
|
108
|
+
properties: {
|
|
109
|
+
operationId: { type: 'string', minLength: 1 },
|
|
110
|
+
subjectReference: { type: 'string', minLength: 1 },
|
|
111
|
+
capability: { const: IdentityAttestationCapability.RecordEvidence, readOnly: true },
|
|
112
|
+
createdBy: {
|
|
113
|
+
type: 'object',
|
|
114
|
+
readOnly: true,
|
|
115
|
+
required: ['actorReference', 'assignmentReference', 'organizationReference'],
|
|
116
|
+
properties: {
|
|
117
|
+
actorReference: { type: 'string', minLength: 1 },
|
|
118
|
+
assignmentReference: { type: 'string', minLength: 1 },
|
|
119
|
+
organizationReference: { type: 'string', minLength: 1 },
|
|
120
|
+
},
|
|
121
|
+
additionalProperties: false,
|
|
122
|
+
},
|
|
123
|
+
authorization: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
readOnly: true,
|
|
126
|
+
required: ['groupReference', 'groupAuthorizationReference', 'controllerReference'],
|
|
127
|
+
properties: {
|
|
128
|
+
groupReference: { type: 'string', minLength: 1 },
|
|
129
|
+
groupAuthorizationReference: { type: 'string', minLength: 1 },
|
|
130
|
+
controllerReference: { type: 'string', minLength: 1 },
|
|
131
|
+
subjectAuthorizationReference: { type: 'string', minLength: 1 },
|
|
132
|
+
},
|
|
133
|
+
additionalProperties: false,
|
|
134
|
+
},
|
|
135
|
+
targets: {
|
|
136
|
+
type: 'array',
|
|
137
|
+
minItems: 1,
|
|
138
|
+
items: {
|
|
139
|
+
type: 'object',
|
|
140
|
+
required: ['kind'],
|
|
141
|
+
properties: {
|
|
142
|
+
kind: { enum: ['subject', 'claim', 'relationship', 'predicate'] },
|
|
143
|
+
claimPath: { type: 'string', minLength: 1 },
|
|
144
|
+
relationshipType: { type: 'string', minLength: 1 },
|
|
145
|
+
relatedSubjectReference: { type: 'string', minLength: 1 },
|
|
146
|
+
predicate: { const: 'age-over' },
|
|
147
|
+
sourceSubjectReference: { type: 'string', minLength: 1 },
|
|
148
|
+
sourceClaimPath: { const: 'org.schema.Person.birthDate' },
|
|
149
|
+
threshold: { type: 'integer', minimum: 1, maximum: 150 },
|
|
150
|
+
result: { type: 'boolean' },
|
|
151
|
+
},
|
|
152
|
+
additionalProperties: false,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
evidence: {
|
|
156
|
+
type: 'array',
|
|
157
|
+
minItems: 1,
|
|
158
|
+
items: workforceEvidenceItemSchema,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
additionalProperties: false,
|
|
162
|
+
});
|
|
163
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/identity-assurance/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAA;AAE/D,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;KACvC;IACD,oBAAoB,EAAE,IAAI;CAClB,CAAA;AAEV,MAAM,4BAA4B,GAAG;IACnC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;IACpC,UAAU,EAAE;QACV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QAC7C,qBAAqB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QACvD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QACzC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE;KACnD;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAA;AAEV,MAAM,iCAAiC,GAAG;IACxC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,CAAC;IAC7C,UAAU,EAAE;QACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QACpC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EA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B,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,CAAC,EAAE;oBACjE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;oBAC3C,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;oBAClD,uBAAuB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;oBACzD,SAAS,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE;oBAChC,sBAAsB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;oBACxD,eAAe,EAAE,EAAE,KAAK,EAAE,6BAA6B,EAAE;oBACzD,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE;oBACxD,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;iBAC5B;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,CAAC;YACX,KAAK,EAAE,2BAA2B;SACnC;KACF;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAC,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Capabilities that an authoritative tenant may publish at its endpoint. */
|
|
2
|
+
export declare const ClearingHouseTenantCapability: Readonly<{
|
|
3
|
+
readonly Employer: "employer";
|
|
4
|
+
readonly IndexProvider: "index-provider";
|
|
5
|
+
readonly Verifier: "verifier";
|
|
6
|
+
}>;
|
|
7
|
+
export type ClearingHouseTenantCapabilityValue = typeof ClearingHouseTenantCapability[keyof typeof ClearingHouseTenantCapability];
|
|
8
|
+
export type ClearingHouseTenantDescriptor = Readonly<{
|
|
9
|
+
tenantReference: string;
|
|
10
|
+
endpoint: string;
|
|
11
|
+
capabilities: readonly ClearingHouseTenantCapabilityValue[];
|
|
12
|
+
}>;
|
|
13
|
+
export type AuthoritativeTenantEndpointSelection = Readonly<{
|
|
14
|
+
trust: 'home-tenant' | 'federated-tenant';
|
|
15
|
+
tenantReference: string;
|
|
16
|
+
endpoint: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Selects one tenant-published authoritative endpoint. The home tenant is the
|
|
20
|
+
* only implicit trust root; every external source requires an explicit
|
|
21
|
+
* federation-trust entry and the advertised source capability.
|
|
22
|
+
*/
|
|
23
|
+
export declare function selectAuthoritativeTenantEndpoint(input: Readonly<{
|
|
24
|
+
homeTenantReference: string;
|
|
25
|
+
sourceTenant: ClearingHouseTenantDescriptor;
|
|
26
|
+
requiredCapability: ClearingHouseTenantCapabilityValue;
|
|
27
|
+
trustedFederatedTenantReferences: readonly string[];
|
|
28
|
+
}>): AuthoritativeTenantEndpointSelection;
|
|
29
|
+
//# sourceMappingURL=tenant-trust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-trust.d.ts","sourceRoot":"","sources":["../../src/identity-assurance/tenant-trust.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,eAAO,MAAM,6BAA6B;;;;EAI/B,CAAA;AAEX,MAAM,MAAM,kCAAkC,GAC5C,OAAO,6BAA6B,CAAC,MAAM,OAAO,6BAA6B,CAAC,CAAA;AAElF,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IACnD,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,SAAS,kCAAkC,EAAE,CAAA;CAC5D,CAAC,CAAA;AAEF,MAAM,MAAM,oCAAoC,GAAG,QAAQ,CAAC;IAC1D,KAAK,EAAE,aAAa,GAAG,kBAAkB,CAAA;IACzC,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,QAAQ,CAAC;IAChE,mBAAmB,EAAE,MAAM,CAAA;IAC3B,YAAY,EAAE,6BAA6B,CAAA;IAC3C,kBAAkB,EAAE,kCAAkC,CAAA;IACtD,gCAAgC,EAAE,SAAS,MAAM,EAAE,CAAA;CACpD,CAAC,GAAG,oCAAoC,CAyBxC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Capabilities that an authoritative tenant may publish at its endpoint. */
|
|
2
|
+
export const ClearingHouseTenantCapability = Object.freeze({
|
|
3
|
+
Employer: 'employer',
|
|
4
|
+
IndexProvider: 'index-provider',
|
|
5
|
+
Verifier: 'verifier',
|
|
6
|
+
});
|
|
7
|
+
/**
|
|
8
|
+
* Selects one tenant-published authoritative endpoint. The home tenant is the
|
|
9
|
+
* only implicit trust root; every external source requires an explicit
|
|
10
|
+
* federation-trust entry and the advertised source capability.
|
|
11
|
+
*/
|
|
12
|
+
export function selectAuthoritativeTenantEndpoint(input) {
|
|
13
|
+
if (!input.sourceTenant.capabilities.includes(input.requiredCapability)) {
|
|
14
|
+
throw new TypeError(`Source tenant does not advertise capability: ${input.requiredCapability}`);
|
|
15
|
+
}
|
|
16
|
+
let endpoint;
|
|
17
|
+
try {
|
|
18
|
+
endpoint = new URL(input.sourceTenant.endpoint);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
throw new TypeError('Authoritative tenant endpoint must be an absolute HTTPS URL');
|
|
22
|
+
}
|
|
23
|
+
if (endpoint.protocol !== 'https:') {
|
|
24
|
+
throw new TypeError('Authoritative tenant endpoint must be an absolute HTTPS URL');
|
|
25
|
+
}
|
|
26
|
+
const isHomeTenant = input.sourceTenant.tenantReference === input.homeTenantReference;
|
|
27
|
+
if (!isHomeTenant
|
|
28
|
+
&& !input.trustedFederatedTenantReferences.includes(input.sourceTenant.tenantReference)) {
|
|
29
|
+
throw new TypeError('Source tenant is not trusted by the home tenant');
|
|
30
|
+
}
|
|
31
|
+
return Object.freeze({
|
|
32
|
+
trust: isHomeTenant ? 'home-tenant' : 'federated-tenant',
|
|
33
|
+
tenantReference: input.sourceTenant.tenantReference,
|
|
34
|
+
endpoint: endpoint.toString().replace(/\/$/, ''),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=tenant-trust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-trust.js","sourceRoot":"","sources":["../../src/identity-assurance/tenant-trust.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,gBAAgB;IAC/B,QAAQ,EAAE,UAAU;CACZ,CAAC,CAAA;AAiBX;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,KAKhD;IACA,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,SAAS,CAAC,gDAAgD,KAAK,CAAC,kBAAkB,EAAE,CAAC,CAAA;IACjG,CAAC;IACD,IAAI,QAAa,CAAA;IACjB,IAAI,CAAC;QACH,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,SAAS,CAAC,6DAA6D,CAAC,CAAA;IACpF,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,IAAI,SAAS,CAAC,6DAA6D,CAAC,CAAA;IACpF,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,eAAe,KAAK,KAAK,CAAC,mBAAmB,CAAA;IACrF,IAAI,CAAC,YAAY;WACZ,CAAC,KAAK,CAAC,gCAAgC,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC;QAC1F,MAAM,IAAI,SAAS,CAAC,iDAAiD,CAAC,CAAA;IACxE,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,kBAAkB;QACxD,eAAe,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe;QACnD,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;KACjD,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SchemaOrgIdentityClaimValue } from './vocabulary.js';
|
|
2
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
3
|
+
export type JsonValue = JsonPrimitive | readonly JsonValue[] | {
|
|
4
|
+
readonly [key: string]: JsonValue;
|
|
5
|
+
};
|
|
6
|
+
export type FlatClaims = Readonly<Record<string, JsonValue>>;
|
|
7
|
+
export type Oidc4IdaEvidence = Readonly<{
|
|
8
|
+
type: string;
|
|
9
|
+
[key: string]: JsonValue;
|
|
10
|
+
}>;
|
|
11
|
+
export type Oidc4IdaVerification = Readonly<{
|
|
12
|
+
trust_framework?: string | null;
|
|
13
|
+
assurance_level?: string | null;
|
|
14
|
+
assurance_process?: string | null;
|
|
15
|
+
verification_process?: string | null;
|
|
16
|
+
time?: string | null;
|
|
17
|
+
evidence: readonly Oidc4IdaEvidence[];
|
|
18
|
+
[key: string]: JsonValue | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export type Oidc4IdaVerifiedClaims = Readonly<{
|
|
21
|
+
claims: Readonly<Record<string, JsonValue>>;
|
|
22
|
+
verification: Oidc4IdaVerification;
|
|
23
|
+
}>;
|
|
24
|
+
export type IdentityClaimConflict = Readonly<{
|
|
25
|
+
claim: SchemaOrgIdentityClaimValue;
|
|
26
|
+
existingValue: JsonValue;
|
|
27
|
+
importedValue: JsonValue;
|
|
28
|
+
}>;
|
|
29
|
+
export type ImportedIdentityAssurance = Readonly<{
|
|
30
|
+
claims: FlatClaims;
|
|
31
|
+
verification: Oidc4IdaVerification;
|
|
32
|
+
conflicts: readonly IdentityClaimConflict[];
|
|
33
|
+
unmappedClaims: readonly string[];
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/identity-assurance/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAA;AAElE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAC5D,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,SAAS,EAAE,GAAG;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AACpG,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;AAE5D,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CACzB,CAAC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;CACrC,CAAC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;IAC3C,YAAY,EAAE,oBAAoB,CAAA;CACnC,CAAC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,KAAK,EAAE,2BAA2B,CAAA;IAClC,aAAa,EAAE,SAAS,CAAA;IACxB,aAAa,EAAE,SAAS,CAAA;CACzB,CAAC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC/C,MAAM,EAAE,UAAU,CAAA;IAClB,YAAY,EAAE,oBAAoB,CAAA;IAClC,SAAS,EAAE,SAAS,qBAAqB,EAAE,CAAA;IAC3C,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;CAClC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/identity-assurance/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const IdentityAttestationCapability: Readonly<{
|
|
2
|
+
readonly CreateSubject: "identity.subject.create";
|
|
3
|
+
readonly UpdateSubject: "identity.subject.update";
|
|
4
|
+
readonly RecordEvidence: "identity.evidence.record";
|
|
5
|
+
readonly VerifyClaim: "identity.claim.verify";
|
|
6
|
+
readonly AttestSubject: "identity.subject.attest";
|
|
7
|
+
readonly AttestRelationship: "identity.relationship.attest";
|
|
8
|
+
}>;
|
|
9
|
+
export type IdentityAttestationCapabilityValue = typeof IdentityAttestationCapability[keyof typeof IdentityAttestationCapability];
|
|
10
|
+
/** Canonical Schema.org flat claims currently mapped to registered OpenID claims. */
|
|
11
|
+
export declare const SchemaOrgIdentityClaim: Readonly<{
|
|
12
|
+
readonly PersonName: "org.schema.Person.name";
|
|
13
|
+
readonly PersonGivenName: "org.schema.Person.givenName";
|
|
14
|
+
readonly PersonFamilyName: "org.schema.Person.familyName";
|
|
15
|
+
readonly PersonBirthDate: "org.schema.Person.birthDate";
|
|
16
|
+
readonly PersonGender: "org.schema.Person.gender";
|
|
17
|
+
readonly PersonEmail: "org.schema.Person.email";
|
|
18
|
+
readonly PersonTelephone: "org.schema.Person.telephone";
|
|
19
|
+
}>;
|
|
20
|
+
export type SchemaOrgIdentityClaimValue = typeof SchemaOrgIdentityClaim[keyof typeof SchemaOrgIdentityClaim];
|
|
21
|
+
/** Registered OpenID Connect claim names used by the identity-assurance projection. */
|
|
22
|
+
export declare const OidcIdentityClaim: Readonly<{
|
|
23
|
+
readonly Name: "name";
|
|
24
|
+
readonly GivenName: "given_name";
|
|
25
|
+
readonly FamilyName: "family_name";
|
|
26
|
+
readonly Birthdate: "birthdate";
|
|
27
|
+
readonly Gender: "gender";
|
|
28
|
+
readonly Email: "email";
|
|
29
|
+
readonly PhoneNumber: "phone_number";
|
|
30
|
+
}>;
|
|
31
|
+
export type OidcIdentityClaimValue = typeof OidcIdentityClaim[keyof typeof OidcIdentityClaim];
|
|
32
|
+
/**
|
|
33
|
+
* EUDI Person Identification Data elements are credential data elements, not
|
|
34
|
+
* aliases for the OpenID Identity Assurance `verified_claims` member names.
|
|
35
|
+
*/
|
|
36
|
+
export declare const EudiPidClaim: Readonly<{
|
|
37
|
+
readonly FamilyName: "family_name";
|
|
38
|
+
readonly GivenName: "given_name";
|
|
39
|
+
readonly BirthDate: "birth_date";
|
|
40
|
+
readonly AgeOver18: "age_over_18";
|
|
41
|
+
}>;
|
|
42
|
+
export type EudiPidClaimValue = typeof EudiPidClaim[keyof typeof EudiPidClaim];
|
|
43
|
+
export declare const SchemaOrgToOidcIdentityClaim: Readonly<{
|
|
44
|
+
"org.schema.Person.name": "name";
|
|
45
|
+
"org.schema.Person.givenName": "given_name";
|
|
46
|
+
"org.schema.Person.familyName": "family_name";
|
|
47
|
+
"org.schema.Person.birthDate": "birthdate";
|
|
48
|
+
"org.schema.Person.gender": "gender";
|
|
49
|
+
"org.schema.Person.email": "email";
|
|
50
|
+
"org.schema.Person.telephone": "phone_number";
|
|
51
|
+
}>;
|
|
52
|
+
//# sourceMappingURL=vocabulary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../../src/identity-assurance/vocabulary.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;EAO/B,CAAA;AAEX,MAAM,MAAM,kCAAkC,GAC5C,OAAO,6BAA6B,CAAC,MAAM,OAAO,6BAA6B,CAAC,CAAA;AAElF,qFAAqF;AACrF,eAAO,MAAM,sBAAsB;;;;;;;;EAQxB,CAAA;AAEX,MAAM,MAAM,2BAA2B,GACrC,OAAO,sBAAsB,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAA;AAEpE,uFAAuF;AACvF,eAAO,MAAM,iBAAiB;;;;;;;;EAQnB,CAAA;AAEX,MAAM,MAAM,sBAAsB,GAChC,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;AAE1D;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;EAKd,CAAA;AAEX,MAAM,MAAM,iBAAiB,GAC3B,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAA;AAEhD,eAAO,MAAM,4BAA4B;;;;;;;;EAQyC,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const IdentityAttestationCapability = Object.freeze({
|
|
2
|
+
CreateSubject: 'identity.subject.create',
|
|
3
|
+
UpdateSubject: 'identity.subject.update',
|
|
4
|
+
RecordEvidence: 'identity.evidence.record',
|
|
5
|
+
VerifyClaim: 'identity.claim.verify',
|
|
6
|
+
AttestSubject: 'identity.subject.attest',
|
|
7
|
+
AttestRelationship: 'identity.relationship.attest',
|
|
8
|
+
});
|
|
9
|
+
/** Canonical Schema.org flat claims currently mapped to registered OpenID claims. */
|
|
10
|
+
export const SchemaOrgIdentityClaim = Object.freeze({
|
|
11
|
+
PersonName: 'org.schema.Person.name',
|
|
12
|
+
PersonGivenName: 'org.schema.Person.givenName',
|
|
13
|
+
PersonFamilyName: 'org.schema.Person.familyName',
|
|
14
|
+
PersonBirthDate: 'org.schema.Person.birthDate',
|
|
15
|
+
PersonGender: 'org.schema.Person.gender',
|
|
16
|
+
PersonEmail: 'org.schema.Person.email',
|
|
17
|
+
PersonTelephone: 'org.schema.Person.telephone',
|
|
18
|
+
});
|
|
19
|
+
/** Registered OpenID Connect claim names used by the identity-assurance projection. */
|
|
20
|
+
export const OidcIdentityClaim = Object.freeze({
|
|
21
|
+
Name: 'name',
|
|
22
|
+
GivenName: 'given_name',
|
|
23
|
+
FamilyName: 'family_name',
|
|
24
|
+
Birthdate: 'birthdate',
|
|
25
|
+
Gender: 'gender',
|
|
26
|
+
Email: 'email',
|
|
27
|
+
PhoneNumber: 'phone_number',
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* EUDI Person Identification Data elements are credential data elements, not
|
|
31
|
+
* aliases for the OpenID Identity Assurance `verified_claims` member names.
|
|
32
|
+
*/
|
|
33
|
+
export const EudiPidClaim = Object.freeze({
|
|
34
|
+
FamilyName: 'family_name',
|
|
35
|
+
GivenName: 'given_name',
|
|
36
|
+
BirthDate: 'birth_date',
|
|
37
|
+
AgeOver18: 'age_over_18',
|
|
38
|
+
});
|
|
39
|
+
export const SchemaOrgToOidcIdentityClaim = Object.freeze({
|
|
40
|
+
[SchemaOrgIdentityClaim.PersonName]: OidcIdentityClaim.Name,
|
|
41
|
+
[SchemaOrgIdentityClaim.PersonGivenName]: OidcIdentityClaim.GivenName,
|
|
42
|
+
[SchemaOrgIdentityClaim.PersonFamilyName]: OidcIdentityClaim.FamilyName,
|
|
43
|
+
[SchemaOrgIdentityClaim.PersonBirthDate]: OidcIdentityClaim.Birthdate,
|
|
44
|
+
[SchemaOrgIdentityClaim.PersonGender]: OidcIdentityClaim.Gender,
|
|
45
|
+
[SchemaOrgIdentityClaim.PersonEmail]: OidcIdentityClaim.Email,
|
|
46
|
+
[SchemaOrgIdentityClaim.PersonTelephone]: OidcIdentityClaim.PhoneNumber,
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=vocabulary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/identity-assurance/vocabulary.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD,aAAa,EAAE,yBAAyB;IACxC,aAAa,EAAE,yBAAyB;IACxC,cAAc,EAAE,0BAA0B;IAC1C,WAAW,EAAE,uBAAuB;IACpC,aAAa,EAAE,yBAAyB;IACxC,kBAAkB,EAAE,8BAA8B;CAC1C,CAAC,CAAA;AAKX,qFAAqF;AACrF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC;IAClD,UAAU,EAAE,wBAAwB;IACpC,eAAe,EAAE,6BAA6B;IAC9C,gBAAgB,EAAE,8BAA8B;IAChD,eAAe,EAAE,6BAA6B;IAC9C,YAAY,EAAE,0BAA0B;IACxC,WAAW,EAAE,yBAAyB;IACtC,eAAe,EAAE,6BAA6B;CACtC,CAAC,CAAA;AAKX,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,aAAa;IACzB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,cAAc;CACnB,CAAC,CAAA;AAKX;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,UAAU,EAAE,aAAa;IACzB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,aAAa;CAChB,CAAC,CAAA;AAKX,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,CAAC;IACxD,CAAC,sBAAsB,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAC,IAAI;IAC3D,CAAC,sBAAsB,CAAC,eAAe,CAAC,EAAE,iBAAiB,CAAC,SAAS;IACrE,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,UAAU;IACvE,CAAC,sBAAsB,CAAC,eAAe,CAAC,EAAE,iBAAiB,CAAC,SAAS;IACrE,CAAC,sBAAsB,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC,MAAM;IAC/D,CAAC,sBAAsB,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAC,KAAK;IAC7D,CAAC,sBAAsB,CAAC,eAAe,CAAC,EAAE,iBAAiB,CAAC,WAAW;CACQ,CAAC,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type WorkforceAssignmentState = Readonly<{
|
|
2
|
+
departmentReference?: string;
|
|
3
|
+
groupReferences: readonly string[];
|
|
4
|
+
}>;
|
|
5
|
+
export type WorkforceInvitationAssignmentProposal = WorkforceAssignmentState & Readonly<{
|
|
6
|
+
invitationReference: string;
|
|
7
|
+
inviteeReference: string;
|
|
8
|
+
organizationReference: string;
|
|
9
|
+
status: 'proposed';
|
|
10
|
+
grantsAuthorization: false;
|
|
11
|
+
}>;
|
|
12
|
+
export type WorkforceAssignmentChangeNotice = Readonly<{
|
|
13
|
+
kind: 'workforce-assignment-change';
|
|
14
|
+
recipientAssignmentReference: string;
|
|
15
|
+
organizationReference: string;
|
|
16
|
+
authorizedByControllerReference: string;
|
|
17
|
+
effectiveAt: string;
|
|
18
|
+
previous: WorkforceAssignmentState;
|
|
19
|
+
current: WorkforceAssignmentState;
|
|
20
|
+
communicationRequired: true;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Defines non-authorizing department and group proposals carried by an
|
|
24
|
+
* employee invitation. Acceptance still requires activation of the employee
|
|
25
|
+
* assignment and each group membership through the authoritative backend.
|
|
26
|
+
*/
|
|
27
|
+
export declare function defineWorkforceInvitationAssignmentProposal(input: Readonly<{
|
|
28
|
+
invitationReference: string;
|
|
29
|
+
inviteeReference: string;
|
|
30
|
+
organizationReference: string;
|
|
31
|
+
departmentReference?: string;
|
|
32
|
+
groupReferences: readonly string[];
|
|
33
|
+
}>): WorkforceInvitationAssignmentProposal;
|
|
34
|
+
/**
|
|
35
|
+
* Builds the non-personal payload that a transport adapter places in a
|
|
36
|
+
* Communication. It records an assignment change; it never creates or updates
|
|
37
|
+
* an employee-specific Consent.
|
|
38
|
+
*/
|
|
39
|
+
export declare function defineWorkforceAssignmentChangeNotice(input: Readonly<{
|
|
40
|
+
recipientAssignmentReference: string;
|
|
41
|
+
organizationReference: string;
|
|
42
|
+
authorizedByControllerReference: string;
|
|
43
|
+
effectiveAt: string;
|
|
44
|
+
previous: WorkforceAssignmentState;
|
|
45
|
+
current: WorkforceAssignmentState;
|
|
46
|
+
}>): WorkforceAssignmentChangeNotice;
|
|
47
|
+
//# sourceMappingURL=workforce-assignment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workforce-assignment.d.ts","sourceRoot":"","sources":["../../src/identity-assurance/workforce-assignment.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC,CAAC,CAAA;AAEF,MAAM,MAAM,qCAAqC,GAAG,wBAAwB,GAAG,QAAQ,CAAC;IACtF,mBAAmB,EAAE,MAAM,CAAA;IAC3B,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,mBAAmB,EAAE,KAAK,CAAA;CAC3B,CAAC,CAAA;AAEF,MAAM,MAAM,+BAA+B,GAAG,QAAQ,CAAC;IACrD,IAAI,EAAE,6BAA6B,CAAA;IACnC,4BAA4B,EAAE,MAAM,CAAA;IACpC,qBAAqB,EAAE,MAAM,CAAA;IAC7B,+BAA+B,EAAE,MAAM,CAAA;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,wBAAwB,CAAA;IAClC,OAAO,EAAE,wBAAwB,CAAA;IACjC,qBAAqB,EAAE,IAAI,CAAA;CAC5B,CAAC,CAAA;AAqBF;;;;GAIG;AACH,wBAAgB,2CAA2C,CAAC,KAAK,EAAE,QAAQ,CAAC;IAC1E,mBAAmB,EAAE,MAAM,CAAA;IAC3B,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC,CAAC,GAAG,qCAAqC,CAUzC;AAED;;;;GAIG;AACH,wBAAgB,qCAAqC,CAAC,KAAK,EAAE,QAAQ,CAAC;IACpE,4BAA4B,EAAE,MAAM,CAAA;IACpC,qBAAqB,EAAE,MAAM,CAAA;IAC7B,+BAA+B,EAAE,MAAM,CAAA;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,wBAAwB,CAAA;IAClC,OAAO,EAAE,wBAAwB,CAAA;CAClC,CAAC,GAAG,+BAA+B,CAWnC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
function requireNonEmpty(value, field) {
|
|
2
|
+
const normalized = value.trim();
|
|
3
|
+
if (!normalized)
|
|
4
|
+
throw new TypeError(`${field} must not be empty`);
|
|
5
|
+
return normalized;
|
|
6
|
+
}
|
|
7
|
+
function normalizeAssignmentState(input) {
|
|
8
|
+
const groupReferences = input.groupReferences.map((reference) => requireNonEmpty(reference, 'groupReference'));
|
|
9
|
+
if (new Set(groupReferences).size !== groupReferences.length) {
|
|
10
|
+
throw new TypeError('Duplicate group proposals are not allowed');
|
|
11
|
+
}
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
...(input.departmentReference
|
|
14
|
+
? { departmentReference: requireNonEmpty(input.departmentReference, 'departmentReference') }
|
|
15
|
+
: {}),
|
|
16
|
+
groupReferences: Object.freeze(groupReferences),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Defines non-authorizing department and group proposals carried by an
|
|
21
|
+
* employee invitation. Acceptance still requires activation of the employee
|
|
22
|
+
* assignment and each group membership through the authoritative backend.
|
|
23
|
+
*/
|
|
24
|
+
export function defineWorkforceInvitationAssignmentProposal(input) {
|
|
25
|
+
const assignment = normalizeAssignmentState(input);
|
|
26
|
+
return Object.freeze({
|
|
27
|
+
invitationReference: requireNonEmpty(input.invitationReference, 'invitationReference'),
|
|
28
|
+
inviteeReference: requireNonEmpty(input.inviteeReference, 'inviteeReference'),
|
|
29
|
+
organizationReference: requireNonEmpty(input.organizationReference, 'organizationReference'),
|
|
30
|
+
status: 'proposed',
|
|
31
|
+
grantsAuthorization: false,
|
|
32
|
+
...assignment,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Builds the non-personal payload that a transport adapter places in a
|
|
37
|
+
* Communication. It records an assignment change; it never creates or updates
|
|
38
|
+
* an employee-specific Consent.
|
|
39
|
+
*/
|
|
40
|
+
export function defineWorkforceAssignmentChangeNotice(input) {
|
|
41
|
+
return Object.freeze({
|
|
42
|
+
kind: 'workforce-assignment-change',
|
|
43
|
+
recipientAssignmentReference: requireNonEmpty(input.recipientAssignmentReference, 'recipientAssignmentReference'),
|
|
44
|
+
organizationReference: requireNonEmpty(input.organizationReference, 'organizationReference'),
|
|
45
|
+
authorizedByControllerReference: requireNonEmpty(input.authorizedByControllerReference, 'authorizedByControllerReference'),
|
|
46
|
+
effectiveAt: requireNonEmpty(input.effectiveAt, 'effectiveAt'),
|
|
47
|
+
previous: normalizeAssignmentState(input.previous),
|
|
48
|
+
current: normalizeAssignmentState(input.current),
|
|
49
|
+
communicationRequired: true,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=workforce-assignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workforce-assignment.js","sourceRoot":"","sources":["../../src/identity-assurance/workforce-assignment.ts"],"names":[],"mappings":"AAwBA,SAAS,eAAe,CAAC,KAAa,EAAE,KAAa;IACnD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAC/B,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,oBAAoB,CAAC,CAAA;IAClE,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,SAAS,wBAAwB,CAAC,KAA+B;IAC/D,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAA;IAC9G,IAAI,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC,MAAM,EAAE,CAAC;QAC7D,MAAM,IAAI,SAAS,CAAC,2CAA2C,CAAC,CAAA;IAClE,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,CAAC,KAAK,CAAC,mBAAmB;YAC3B,CAAC,CAAC,EAAE,mBAAmB,EAAE,eAAe,CAAC,KAAK,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,EAAE;YAC5F,CAAC,CAAC,EAAE,CAAC;QACP,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;KAChD,CAAC,CAAA;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2CAA2C,CAAC,KAM1D;IACA,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAA;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,mBAAmB,EAAE,eAAe,CAAC,KAAK,CAAC,mBAAmB,EAAE,qBAAqB,CAAC;QACtF,gBAAgB,EAAE,eAAe,CAAC,KAAK,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;QAC7E,qBAAqB,EAAE,eAAe,CAAC,KAAK,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;QAC5F,MAAM,EAAE,UAAU;QAClB,mBAAmB,EAAE,KAAK;QAC1B,GAAG,UAAU;KACd,CAAC,CAAA;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qCAAqC,CAAC,KAOpD;IACA,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,6BAA6B;QACnC,4BAA4B,EAAE,eAAe,CAAC,KAAK,CAAC,4BAA4B,EAAE,8BAA8B,CAAC;QACjH,qBAAqB,EAAE,eAAe,CAAC,KAAK,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;QAC5F,+BAA+B,EAAE,eAAe,CAAC,KAAK,CAAC,+BAA+B,EAAE,iCAAiC,CAAC;QAC1H,WAAW,EAAE,eAAe,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC;QAC9D,QAAQ,EAAE,wBAAwB,CAAC,KAAK,CAAC,QAAQ,CAAC;QAClD,OAAO,EAAE,wBAAwB,CAAC,KAAK,CAAC,OAAO,CAAC;QAChD,qBAAqB,EAAE,IAAI;KAC5B,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antifraud-data-utils-ts",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Product-neutral identity verification, evidence and attestation data contracts",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./identity-assurance": {
|
|
14
|
+
"types": "./dist/identity-assurance/index.d.ts",
|
|
15
|
+
"default": "./dist/identity-assurance/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"CHANGELOG.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -p tsconfig.json",
|
|
26
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
27
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=24.0.0"
|
|
31
|
+
},
|
|
32
|
+
"license": "Apache-2.0",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/antifraudservices/antifraud-data-utils-ts.git"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"typescript": "^5.9.3"
|
|
39
|
+
}
|
|
40
|
+
}
|