antifraud-data-utils-ts 0.1.11 → 0.3.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 +110 -0
- package/README.md +24 -0
- package/dist/actor-kinds.d.ts +13 -0
- package/dist/actor-kinds.d.ts.map +1 -0
- package/dist/actor-kinds.js +15 -0
- package/dist/actor-kinds.js.map +1 -0
- package/dist/credential-contracts.d.ts +58 -0
- package/dist/credential-contracts.d.ts.map +1 -0
- package/dist/credential-contracts.js +10 -0
- package/dist/credential-contracts.js.map +1 -0
- package/dist/credential-decoding.d.ts +11 -0
- package/dist/credential-decoding.d.ts.map +1 -0
- package/dist/credential-decoding.js +84 -0
- package/dist/credential-decoding.js.map +1 -0
- package/dist/cryptography/cryptography-contract.d.ts +39 -0
- package/dist/cryptography/cryptography-contract.d.ts.map +1 -0
- package/dist/cryptography/cryptography-contract.js +2 -0
- package/dist/cryptography/cryptography-contract.js.map +1 -0
- package/dist/cryptography/cryptography-service.d.ts +2 -1
- package/dist/cryptography/cryptography-service.d.ts.map +1 -1
- package/dist/cryptography/cryptography-service.js.map +1 -1
- package/dist/cryptography/index.d.ts +2 -0
- package/dist/cryptography/index.d.ts.map +1 -1
- package/dist/cryptography/index.js +2 -0
- package/dist/cryptography/index.js.map +1 -1
- package/dist/cryptography/jws-types.d.ts +20 -0
- package/dist/cryptography/jws-types.d.ts.map +1 -0
- package/dist/cryptography/jws-types.js +2 -0
- package/dist/cryptography/jws-types.js.map +1 -0
- package/dist/cryptography/types.d.ts +36 -0
- package/dist/cryptography/types.d.ts.map +1 -1
- package/dist/did-document.d.ts +35 -0
- package/dist/did-document.d.ts.map +1 -0
- package/dist/did-document.js +2 -0
- package/dist/did-document.js.map +1 -0
- package/dist/didcomm-contracts.d.ts +32 -0
- package/dist/didcomm-contracts.d.ts.map +1 -0
- package/dist/didcomm-contracts.js +2 -0
- package/dist/didcomm-contracts.js.map +1 -0
- package/dist/encoding/base58btc.d.ts +5 -0
- package/dist/encoding/base58btc.d.ts.map +1 -0
- package/dist/encoding/base58btc.js +43 -0
- package/dist/encoding/base58btc.js.map +1 -0
- package/dist/encoding.d.ts +28 -0
- package/dist/encoding.d.ts.map +1 -0
- package/dist/encoding.js +31 -0
- package/dist/encoding.js.map +1 -0
- package/dist/identity-assurance/didcomm-binary-attachment.d.ts.map +1 -1
- package/dist/identity-assurance/didcomm-binary-attachment.js +1 -18
- package/dist/identity-assurance/didcomm-binary-attachment.js.map +1 -1
- package/dist/identity-assurance/identity-evidence.d.ts.map +1 -1
- package/dist/identity-assurance/identity-evidence.js +1 -16
- package/dist/identity-assurance/identity-evidence.js.map +1 -1
- package/dist/identity-assurance/index.d.ts +1 -0
- package/dist/identity-assurance/index.d.ts.map +1 -1
- package/dist/identity-assurance/index.js +1 -0
- package/dist/identity-assurance/index.js.map +1 -1
- package/dist/identity-assurance/review-methods.d.ts +9 -0
- package/dist/identity-assurance/review-methods.d.ts.map +1 -0
- package/dist/identity-assurance/review-methods.js +8 -0
- package/dist/identity-assurance/review-methods.js.map +1 -0
- package/dist/identity-assurance/vocabulary.d.ts.map +1 -1
- package/dist/identity-assurance/vocabulary.js +8 -7
- package/dist/identity-assurance/vocabulary.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/isco-08.d.ts +149 -0
- package/dist/isco-08.d.ts.map +1 -0
- package/dist/isco-08.js +74 -0
- package/dist/isco-08.js.map +1 -0
- package/dist/openid-contracts.d.ts +59 -0
- package/dist/openid-contracts.d.ts.map +1 -0
- package/dist/openid-contracts.js +2 -0
- package/dist/openid-contracts.js.map +1 -0
- package/dist/organization-credentials.d.ts +75 -0
- package/dist/organization-credentials.d.ts.map +1 -0
- package/dist/organization-credentials.js +163 -0
- package/dist/organization-credentials.js.map +1 -0
- package/dist/organization-identity.d.ts +29 -0
- package/dist/organization-identity.d.ts.map +1 -0
- package/dist/organization-identity.js +83 -0
- package/dist/organization-identity.js.map +1 -0
- package/dist/organization-service-catalog.d.ts +1 -28
- package/dist/organization-service-catalog.d.ts.map +1 -1
- package/dist/organization-service-catalog.js +2 -28
- package/dist/organization-service-catalog.js.map +1 -1
- package/dist/schema-org-claims.d.ts +145 -0
- package/dist/schema-org-claims.d.ts.map +1 -0
- package/dist/schema-org-claims.js +137 -0
- package/dist/schema-org-claims.js.map +1 -0
- package/dist/vault-repository.d.ts +29 -0
- package/dist/vault-repository.d.ts.map +1 -0
- package/dist/vault-repository.js +2 -0
- package/dist/vault-repository.js.map +1 -0
- package/docs/CREDENTIAL_CONSUMER_PROFILES.md +55 -0
- package/docs/DIDCOMM_AND_ACTOR_SYNTAX.md +51 -0
- package/docs/DID_AND_JWS_DATA_CONTRACTS.md +20 -0
- package/docs/NEUTRAL_IDENTITY_CONTRACTS.md +79 -0
- package/docs/NEUTRAL_VAULT_CONTRACTS.md +49 -0
- package/docs/ORGANIZATION_CONTACT_IDENTITY.md +114 -0
- package/docs/UNVERIFIED_CREDENTIAL_DECODING.md +63 -0
- package/package.json +50 -2
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/** WHO SMART Base's ISCO-08 system URI; this is not a universal ILO-assigned identifier.
|
|
2
|
+
* https://smart.who.int/base/1.0.0/CodeSystem-ISCO08.html
|
|
3
|
+
*/
|
|
4
|
+
export declare const Isco08CodingSystem: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
5
|
+
/** HL7 Terminology's endorsed ISCO-08 identifier, distinct from the WHO profile URI.
|
|
6
|
+
* https://terminology.hl7.org/en/NamingSystem-ISCO08.xml.html
|
|
7
|
+
*/
|
|
8
|
+
export declare const Isco08Hl7CodingSystem: "urn:oid:2.16.840.1.113883.2.9.6.2.7";
|
|
9
|
+
/** Identifier equivalence only; this checks neither occupation membership nor authority. */
|
|
10
|
+
export declare function isIsco08CodingSystem(input: unknown): boolean;
|
|
11
|
+
/** Reads a classification token or native Coding-shaped value; membership and permissions remain separate checks. */
|
|
12
|
+
export declare function readIsco08Code(input: unknown): string | undefined;
|
|
13
|
+
/** Curated standard occupations, not the full classification; eligibility and access belong to consumers. */
|
|
14
|
+
export declare const Isco08Occupations: Readonly<{
|
|
15
|
+
SecondaryEducationTeacher: Readonly<{
|
|
16
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
17
|
+
code: "2330";
|
|
18
|
+
display: string;
|
|
19
|
+
}>;
|
|
20
|
+
Lawyer: Readonly<{
|
|
21
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
22
|
+
code: "2611";
|
|
23
|
+
display: string;
|
|
24
|
+
}>;
|
|
25
|
+
GeneralOfficeClerk: Readonly<{
|
|
26
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
27
|
+
code: "4110";
|
|
28
|
+
display: string;
|
|
29
|
+
}>;
|
|
30
|
+
MedicalDoctors: Readonly<{
|
|
31
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
32
|
+
code: "221";
|
|
33
|
+
display: string;
|
|
34
|
+
}>;
|
|
35
|
+
GeneralistMedicalPractitioner: Readonly<{
|
|
36
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
37
|
+
code: "2211";
|
|
38
|
+
display: string;
|
|
39
|
+
}>;
|
|
40
|
+
SpecialistMedicalPractitioner: Readonly<{
|
|
41
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
42
|
+
code: "2212";
|
|
43
|
+
display: string;
|
|
44
|
+
}>;
|
|
45
|
+
NursingProfessional: Readonly<{
|
|
46
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
47
|
+
code: "2221";
|
|
48
|
+
display: string;
|
|
49
|
+
}>;
|
|
50
|
+
MidwiferyProfessional: Readonly<{
|
|
51
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
52
|
+
code: "2222";
|
|
53
|
+
display: string;
|
|
54
|
+
}>;
|
|
55
|
+
ParamedicalPractitioner: Readonly<{
|
|
56
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
57
|
+
code: "2240";
|
|
58
|
+
display: string;
|
|
59
|
+
}>;
|
|
60
|
+
Veterinarian: Readonly<{
|
|
61
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
62
|
+
code: "2250";
|
|
63
|
+
display: string;
|
|
64
|
+
}>;
|
|
65
|
+
Dentist: Readonly<{
|
|
66
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
67
|
+
code: "2261";
|
|
68
|
+
display: string;
|
|
69
|
+
}>;
|
|
70
|
+
Biologist: Readonly<{
|
|
71
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
72
|
+
code: "2131";
|
|
73
|
+
display: string;
|
|
74
|
+
}>;
|
|
75
|
+
LifeScienceTechnician: Readonly<{
|
|
76
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
77
|
+
code: "3141";
|
|
78
|
+
display: string;
|
|
79
|
+
}>;
|
|
80
|
+
MedicalAndPathologyLaboratoryTechnician: Readonly<{
|
|
81
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
82
|
+
code: "3212";
|
|
83
|
+
display: string;
|
|
84
|
+
}>;
|
|
85
|
+
VeterinaryTechnicianOrAssistant: Readonly<{
|
|
86
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
87
|
+
code: "3240";
|
|
88
|
+
display: string;
|
|
89
|
+
}>;
|
|
90
|
+
MedicalSecretary: Readonly<{
|
|
91
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
92
|
+
code: "3344";
|
|
93
|
+
display: string;
|
|
94
|
+
}>;
|
|
95
|
+
Receptionist: Readonly<{
|
|
96
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
97
|
+
code: "4226";
|
|
98
|
+
display: string;
|
|
99
|
+
}>;
|
|
100
|
+
AmbulanceWorker: Readonly<{
|
|
101
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
102
|
+
code: "3258";
|
|
103
|
+
display: string;
|
|
104
|
+
}>;
|
|
105
|
+
Firefighter: Readonly<{
|
|
106
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
107
|
+
code: "5411";
|
|
108
|
+
display: string;
|
|
109
|
+
}>;
|
|
110
|
+
PoliceOfficer: Readonly<{
|
|
111
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
112
|
+
code: "5412";
|
|
113
|
+
display: string;
|
|
114
|
+
}>;
|
|
115
|
+
SecurityGuard: Readonly<{
|
|
116
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
117
|
+
code: "5414";
|
|
118
|
+
display: string;
|
|
119
|
+
}>;
|
|
120
|
+
OtherProtectiveServicesWorker: Readonly<{
|
|
121
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
122
|
+
code: "5419";
|
|
123
|
+
display: string;
|
|
124
|
+
}>;
|
|
125
|
+
TravelAttendant: Readonly<{
|
|
126
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
127
|
+
code: "5111";
|
|
128
|
+
display: string;
|
|
129
|
+
}>;
|
|
130
|
+
TransportConductor: Readonly<{
|
|
131
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
132
|
+
code: "5112";
|
|
133
|
+
display: string;
|
|
134
|
+
}>;
|
|
135
|
+
TravelConsultantOrClerk: Readonly<{
|
|
136
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
137
|
+
code: "4221";
|
|
138
|
+
display: string;
|
|
139
|
+
}>;
|
|
140
|
+
StatisticalFinanceOrInsuranceClerk: Readonly<{
|
|
141
|
+
system: "http://www.ilo.org/public/english/bureau/stat/isco/isco08/";
|
|
142
|
+
code: "4312";
|
|
143
|
+
display: string;
|
|
144
|
+
}>;
|
|
145
|
+
}>;
|
|
146
|
+
export type Isco08Occupation = typeof Isco08Occupations[keyof typeof Isco08Occupations];
|
|
147
|
+
/** Resolve an occupation code without interpreting it as a permission or accepting arbitrary role aliases. */
|
|
148
|
+
export declare function findIsco08Occupation(code: unknown): Isco08Occupation | undefined;
|
|
149
|
+
//# sourceMappingURL=isco-08.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isco-08.d.ts","sourceRoot":"","sources":["../src/isco-08.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAG,4DAAqE,CAAA;AACvG;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAG,qCAA8C,CAAA;AAEnF,4FAA4F;AAC5F,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK5D;AAED,qHAAqH;AACrH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAWjE;AAOD,6GAA6G;AAC7G,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2B5B,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAC,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;AAErF,8GAA8G;AAC9G,wBAAgB,oBAAoB,CAAC,IAAI,EAAC,OAAO,GAAE,gBAAgB,GAAC,SAAS,CAG5E"}
|
package/dist/isco-08.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** WHO SMART Base's ISCO-08 system URI; this is not a universal ILO-assigned identifier.
|
|
2
|
+
* https://smart.who.int/base/1.0.0/CodeSystem-ISCO08.html
|
|
3
|
+
*/
|
|
4
|
+
export const Isco08CodingSystem = 'http://www.ilo.org/public/english/bureau/stat/isco/isco08/';
|
|
5
|
+
/** HL7 Terminology's endorsed ISCO-08 identifier, distinct from the WHO profile URI.
|
|
6
|
+
* https://terminology.hl7.org/en/NamingSystem-ISCO08.xml.html
|
|
7
|
+
*/
|
|
8
|
+
export const Isco08Hl7CodingSystem = 'urn:oid:2.16.840.1.113883.2.9.6.2.7';
|
|
9
|
+
/** Identifier equivalence only; this checks neither occupation membership nor authority. */
|
|
10
|
+
export function isIsco08CodingSystem(input) {
|
|
11
|
+
if (typeof input !== 'string')
|
|
12
|
+
return false;
|
|
13
|
+
const value = input.trim();
|
|
14
|
+
return value === Isco08CodingSystem || value === Isco08Hl7CodingSystem
|
|
15
|
+
|| ['isco-08', 'org.ilo.isco', 'org.ilo.isco-08'].includes(value.toLowerCase());
|
|
16
|
+
}
|
|
17
|
+
/** Reads a classification token or native Coding-shaped value; membership and permissions remain separate checks. */
|
|
18
|
+
export function readIsco08Code(input) {
|
|
19
|
+
let system, code;
|
|
20
|
+
if (typeof input === 'string') {
|
|
21
|
+
const parts = input.trim().split('|');
|
|
22
|
+
if (parts.length !== 2)
|
|
23
|
+
return undefined;
|
|
24
|
+
[system, code] = parts;
|
|
25
|
+
}
|
|
26
|
+
else if (input && typeof input === 'object' && !Array.isArray(input)
|
|
27
|
+
&& Object.hasOwn(input, 'system') && Object.hasOwn(input, 'code')) {
|
|
28
|
+
;
|
|
29
|
+
({ system, code } = input);
|
|
30
|
+
}
|
|
31
|
+
else
|
|
32
|
+
return undefined;
|
|
33
|
+
return isIsco08CodingSystem(system) && typeof code === 'string' && /^[0-9]{1,4}$/u.test(code) ? code : undefined;
|
|
34
|
+
}
|
|
35
|
+
/** ISCO-08 codings; ILO classification: https://isco.ilo.org/ */
|
|
36
|
+
function occupation(code, display) {
|
|
37
|
+
return Object.freeze({ system: Isco08CodingSystem, code, display });
|
|
38
|
+
}
|
|
39
|
+
/** Curated standard occupations, not the full classification; eligibility and access belong to consumers. */
|
|
40
|
+
export const Isco08Occupations = Object.freeze({
|
|
41
|
+
SecondaryEducationTeacher: occupation('2330', 'Secondary Education Teachers'),
|
|
42
|
+
Lawyer: occupation('2611', 'Lawyers'),
|
|
43
|
+
GeneralOfficeClerk: occupation('4110', 'General Office Clerks'),
|
|
44
|
+
MedicalDoctors: occupation('221', 'Medical Doctors'),
|
|
45
|
+
GeneralistMedicalPractitioner: occupation('2211', 'Generalist Medical Practitioners'),
|
|
46
|
+
SpecialistMedicalPractitioner: occupation('2212', 'Specialist Medical Practitioners'),
|
|
47
|
+
NursingProfessional: occupation('2221', 'Nursing Professionals'),
|
|
48
|
+
MidwiferyProfessional: occupation('2222', 'Midwifery Professionals'),
|
|
49
|
+
ParamedicalPractitioner: occupation('2240', 'Paramedical Practitioners'),
|
|
50
|
+
Veterinarian: occupation('2250', 'Veterinarians'),
|
|
51
|
+
Dentist: occupation('2261', 'Dentists'),
|
|
52
|
+
Biologist: occupation('2131', 'Biologists, Botanists, Zoologists and Related Professionals'),
|
|
53
|
+
LifeScienceTechnician: occupation('3141', 'Life Science Technicians (excluding Medical)'),
|
|
54
|
+
MedicalAndPathologyLaboratoryTechnician: occupation('3212', 'Medical and Pathology Laboratory Technicians'),
|
|
55
|
+
VeterinaryTechnicianOrAssistant: occupation('3240', 'Veterinary Technicians and Assistants'),
|
|
56
|
+
MedicalSecretary: occupation('3344', 'Medical Secretaries'),
|
|
57
|
+
Receptionist: occupation('4226', 'Receptionists (general)'),
|
|
58
|
+
AmbulanceWorker: occupation('3258', 'Ambulance Workers'),
|
|
59
|
+
Firefighter: occupation('5411', 'Fire-fighters'),
|
|
60
|
+
PoliceOfficer: occupation('5412', 'Police Officers'),
|
|
61
|
+
SecurityGuard: occupation('5414', 'Security Guards'),
|
|
62
|
+
OtherProtectiveServicesWorker: occupation('5419', 'Protective Services Workers Not Elsewhere Classified'),
|
|
63
|
+
TravelAttendant: occupation('5111', 'Travel Attendants and Travel Stewards'),
|
|
64
|
+
TransportConductor: occupation('5112', 'Transport Conductors'),
|
|
65
|
+
TravelConsultantOrClerk: occupation('4221', 'Travel Consultants and Clerks'),
|
|
66
|
+
StatisticalFinanceOrInsuranceClerk: occupation('4312', 'Statistical, Finance and Insurance Clerks'),
|
|
67
|
+
});
|
|
68
|
+
/** Resolve an occupation code without interpreting it as a permission or accepting arbitrary role aliases. */
|
|
69
|
+
export function findIsco08Occupation(code) {
|
|
70
|
+
if (typeof code !== 'string')
|
|
71
|
+
return undefined;
|
|
72
|
+
return Object.values(Isco08Occupations).find(coding => coding.code === code.trim());
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=isco-08.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isco-08.js","sourceRoot":"","sources":["../src/isco-08.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,4DAAqE,CAAA;AACvG;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,qCAA8C,CAAA;AAEnF,4FAA4F;AAC5F,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAC1B,OAAO,KAAK,KAAK,kBAAkB,IAAI,KAAK,KAAK,qBAAqB;WACjE,CAAC,SAAS,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;AACnF,CAAC;AAED,qHAAqH;AACrH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,MAAe,EAAE,IAAa,CAAA;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,KAAK,C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,CAAC,CAAA;AAIF,8GAA8G;AAC9G,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,IAAG,OAAO,IAAI,KAAG,QAAQ;QAAC,OAAO,SAAS,CAAA;IAC1C,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAA,EAAE,CAAA,MAAM,CAAC,IAAI,KAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;AACjF,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { JwkSet } from './cryptography/types.js';
|
|
2
|
+
/** Registered JWT members only; no signature, issuer, audience or time validation is implied. */
|
|
3
|
+
export interface JwtRegisteredClaims {
|
|
4
|
+
iss?: string;
|
|
5
|
+
sub?: string;
|
|
6
|
+
aud?: string | string[];
|
|
7
|
+
exp?: number;
|
|
8
|
+
nbf?: number;
|
|
9
|
+
iat?: number;
|
|
10
|
+
jti?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Existing client-bound access-token application profile, not the universe of OAuth access tokens. */
|
|
13
|
+
export interface ClientAccessTokenClaims extends JwtRegisteredClaims {
|
|
14
|
+
iss: string;
|
|
15
|
+
sub: string;
|
|
16
|
+
aud: string;
|
|
17
|
+
exp: number;
|
|
18
|
+
iat: number;
|
|
19
|
+
scope: string;
|
|
20
|
+
client_id: string;
|
|
21
|
+
}
|
|
22
|
+
/** OIDC client metadata subset used by current registration consumers. Endpoint validation is separate. */
|
|
23
|
+
export interface OidcClientRegistrationRequest {
|
|
24
|
+
redirect_uris: string[];
|
|
25
|
+
application_type?: 'native' | 'web';
|
|
26
|
+
software_id?: string;
|
|
27
|
+
software_version?: string;
|
|
28
|
+
client_name?: string;
|
|
29
|
+
client_uri?: string;
|
|
30
|
+
token_endpoint_auth_method?: 'none' | 'private_key_jwt';
|
|
31
|
+
grant_types?: ('authorization_code' | 'implicit' | 'refresh_token' | 'client_credentials')[];
|
|
32
|
+
jwks_uri?: string;
|
|
33
|
+
jwks?: JwkSet;
|
|
34
|
+
}
|
|
35
|
+
/** Registration response subset; neither accepting this shape nor decoding it authenticates a client. */
|
|
36
|
+
export interface OidcClientRegistrationResponse {
|
|
37
|
+
client_id: string;
|
|
38
|
+
client_id_issued_at?: number;
|
|
39
|
+
client_secret?: string;
|
|
40
|
+
client_secret_expires_at?: number;
|
|
41
|
+
registration_access_token?: string;
|
|
42
|
+
registration_client_uri?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Application device extension; push delivery metadata does not establish client identity or a licence. */
|
|
45
|
+
export interface RegisteredDeviceInfo {
|
|
46
|
+
device_id: string;
|
|
47
|
+
device_name: string;
|
|
48
|
+
push_token?: string;
|
|
49
|
+
push_provider?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Explicit extension boundary: ext_device_info is not standard OIDC client metadata. */
|
|
52
|
+
export interface DeviceClientRegistrationRequest extends OidcClientRegistrationRequest {
|
|
53
|
+
ext_device_info?: RegisteredDeviceInfo;
|
|
54
|
+
}
|
|
55
|
+
/** Existing device-registration profile always returns the client issuance time. */
|
|
56
|
+
export interface DeviceClientRegistrationResponse extends OidcClientRegistrationResponse {
|
|
57
|
+
client_id_issued_at: number;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=openid-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openid-contracts.d.ts","sourceRoot":"","sources":["../src/openid-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAErD,iGAAiG;AACjG,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACvB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;I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EAAE,MAAM,CAAA;CACvB;AAED,yFAAyF;AACzF,MAAM,WAAW,+BAAgC,SAAQ,6BAA6B;IACpF,eAAe,CAAC,EAAE,oBAAoB,CAAA;CACvC;AAED,oFAAoF;AACpF,MAAM,WAAW,gCAAiC,SAAQ,8BAA8B;IACtF,mBAAmB,EAAE,MAAM,CAAA;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openid-contracts.js","sourceRoot":"","sources":["../src/openid-contracts.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { JsonValue } from './identity-assurance/types.js';
|
|
2
|
+
export declare const ReviewedOrganizationCredentialTypes: Readonly<{
|
|
3
|
+
readonly VerifiableCredential: "VerifiableCredential";
|
|
4
|
+
readonly Admission: "OrganizationTestNetworkCredential";
|
|
5
|
+
readonly Organization: "OrganizationCredential";
|
|
6
|
+
readonly Person: "PersonCredential";
|
|
7
|
+
readonly LegalRepresentative: "LegalRepresentativeCredential";
|
|
8
|
+
readonly ServiceController: "ServiceControllerCredential";
|
|
9
|
+
readonly TestNetwork: "TestNetworkCredential";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const TestNetworkOrganizationCredentialTypes: readonly ["OrganizationCredential", "LegalRepresentativeCredential", "ServiceControllerCredential"];
|
|
12
|
+
export type ReviewedOrganizationCredential = Readonly<{
|
|
13
|
+
'@context': readonly string[];
|
|
14
|
+
id: string;
|
|
15
|
+
type: readonly string[];
|
|
16
|
+
issuer: string;
|
|
17
|
+
credentialSubject: Readonly<Record<string, JsonValue>>;
|
|
18
|
+
validFrom: string;
|
|
19
|
+
validUntil: string;
|
|
20
|
+
evidence?: readonly JsonValue[];
|
|
21
|
+
proof?: JsonValue;
|
|
22
|
+
}>;
|
|
23
|
+
export type OrganizationControllerContact = Readonly<{
|
|
24
|
+
controllerEmail: string;
|
|
25
|
+
controllerTelephone?: never;
|
|
26
|
+
}> | Readonly<{
|
|
27
|
+
controllerTelephone: string;
|
|
28
|
+
controllerEmail?: never;
|
|
29
|
+
}>;
|
|
30
|
+
export type OrganizationRepresentativeContact = Readonly<{
|
|
31
|
+
legalRepresentativeEmail: string;
|
|
32
|
+
legalRepresentativeTelephone?: never;
|
|
33
|
+
}> | Readonly<{
|
|
34
|
+
legalRepresentativeTelephone: string;
|
|
35
|
+
legalRepresentativeEmail?: never;
|
|
36
|
+
}>;
|
|
37
|
+
export type OrganizationTestNetworkCredentialInput = OrganizationControllerContact & Readonly<{
|
|
38
|
+
issuerDid: string;
|
|
39
|
+
subjectDid: string;
|
|
40
|
+
credentialId: string;
|
|
41
|
+
validFrom: string;
|
|
42
|
+
validUntil: string;
|
|
43
|
+
legalName: string;
|
|
44
|
+
organizationIdentifier: string;
|
|
45
|
+
controllerKeyMaterial: string;
|
|
46
|
+
applicationId: string;
|
|
47
|
+
accessPath: 'partner' | 'test-network';
|
|
48
|
+
proof?: JsonValue;
|
|
49
|
+
}>;
|
|
50
|
+
export type TestNetworkOrganizationCredentialSetInput = OrganizationControllerContact & OrganizationRepresentativeContact & Readonly<{
|
|
51
|
+
issuerDid: string;
|
|
52
|
+
organizationDid: string;
|
|
53
|
+
applicationId: string;
|
|
54
|
+
validFrom: string;
|
|
55
|
+
validUntil: string;
|
|
56
|
+
pdfSha256: string;
|
|
57
|
+
documentVersion: string;
|
|
58
|
+
legalName: string;
|
|
59
|
+
organizationIdentifier: string;
|
|
60
|
+
identifierType: string;
|
|
61
|
+
addressCountry: string;
|
|
62
|
+
serviceCategory: string;
|
|
63
|
+
legalRepresentativeFullName: string;
|
|
64
|
+
legalRepresentativeOccupation: string;
|
|
65
|
+
controllerOccupation: string;
|
|
66
|
+
controllerAuthorityRole: string;
|
|
67
|
+
controllerKeyMaterial: string;
|
|
68
|
+
}>;
|
|
69
|
+
/** Creates a draft only; the host must sign and verify the exact admission evidence. */
|
|
70
|
+
export declare function buildOrganizationTestNetworkCredential(input: OrganizationTestNetworkCredentialInput): ReviewedOrganizationCredential;
|
|
71
|
+
/** Projects governed parties and roles; this builder never assigns or verifies them. */
|
|
72
|
+
export declare function buildTestNetworkOrganizationCredentialSet(input: TestNetworkOrganizationCredentialSetInput): readonly [ReviewedOrganizationCredential, ReviewedOrganizationCredential, ReviewedOrganizationCredential];
|
|
73
|
+
export declare function canonicalizeOrganizationTestNetworkCredential(credential: ReviewedOrganizationCredential): string;
|
|
74
|
+
export declare function canonicalizeTestNetworkOrganizationCredential(credential: ReviewedOrganizationCredential): string;
|
|
75
|
+
//# sourceMappingURL=organization-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-credentials.d.ts","sourceRoot":"","sources":["../src/organization-credentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAI9D,eAAO,MAAM,mCAAmC;;;;;;;;EAQrC,CAAA;AACX,eAAO,MAAM,sCAAsC,qGAIxC,CAAA;AAGX,MAAM,MAAM,8BAA8B,GAAG,QAAQ,CAAC;IACpD,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;IACtD,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAC,CAAA;AAEF,MAAM,MAAM,6BAA6B,GACrC,QAAQ,CAAC;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GAClE,QAAQ,CAAC;IAAE,mBAAmB,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAA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AM,CAAC;IAAC,uBAAuB,EAAE,MAAM,CAAA;IACpG,qBAAqB,EAAE,MAAM,CAAA;CAC9B,CAAC,CAAA;AAmBF,wFAAwF;AACxF,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,sCAAsC,GAAG,8BAA8B,CAuBpI;AAED,wFAAwF;AACxF,wBAAgB,yCAAyC,CAAC,KAAK,EAAE,yCAAyC,GAAG,SAAS,CAAC,8BAA8B,EAAE,8BAA8B,EAAE,8BAA8B,CAAC,CA8ErN;AAYD,wBAAgB,6CAA6C,CAAC,UAAU,EAAE,8BAA8B,GAAG,MAAM,CAGhH;AAED,wBAAgB,6CAA6C,CAAC,UAAU,EAAE,8BAA8B,GAAG,MAAM,CAIhH"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { buildStableActorIdentifier, normalizeActorContact } from './organization-identity.js';
|
|
2
|
+
import { W3cCredentialContexts, W3cCredentialTypes } from './credential-contracts.js';
|
|
3
|
+
export const ReviewedOrganizationCredentialTypes = Object.freeze({
|
|
4
|
+
VerifiableCredential: W3cCredentialTypes.VerifiableCredential,
|
|
5
|
+
Admission: 'OrganizationTestNetworkCredential',
|
|
6
|
+
Organization: 'OrganizationCredential',
|
|
7
|
+
Person: 'PersonCredential',
|
|
8
|
+
LegalRepresentative: 'LegalRepresentativeCredential',
|
|
9
|
+
ServiceController: 'ServiceControllerCredential',
|
|
10
|
+
TestNetwork: 'TestNetworkCredential',
|
|
11
|
+
});
|
|
12
|
+
export const TestNetworkOrganizationCredentialTypes = Object.freeze([
|
|
13
|
+
ReviewedOrganizationCredentialTypes.Organization,
|
|
14
|
+
ReviewedOrganizationCredentialTypes.LegalRepresentative,
|
|
15
|
+
ReviewedOrganizationCredentialTypes.ServiceController,
|
|
16
|
+
]);
|
|
17
|
+
const CONTEXTS = [W3cCredentialContexts.V2, 'https://schema.org'];
|
|
18
|
+
function required(value, name) {
|
|
19
|
+
const normalized = String(value || '').trim();
|
|
20
|
+
if (!normalized)
|
|
21
|
+
throw new TypeError(`Reviewed organization credentials require ${name}`);
|
|
22
|
+
return normalized;
|
|
23
|
+
}
|
|
24
|
+
function partyContact(email, telephone, party) {
|
|
25
|
+
if ((email !== undefined && typeof email !== 'string') || (telephone !== undefined && typeof telephone !== 'string')) {
|
|
26
|
+
throw new TypeError(`${party} contact must be a string`);
|
|
27
|
+
}
|
|
28
|
+
const hasEmail = Boolean(String(email || '').trim());
|
|
29
|
+
const hasTelephone = Boolean(String(telephone || '').trim());
|
|
30
|
+
if (hasEmail === hasTelephone)
|
|
31
|
+
throw new TypeError(`${party} requires exactly one email or telephone`);
|
|
32
|
+
const contactKind = hasEmail ? 'email' : 'phone';
|
|
33
|
+
return { contactKind, contact: normalizeActorContact({ contactKind, contact: String(hasEmail ? email : telephone) }) };
|
|
34
|
+
}
|
|
35
|
+
/** Creates a draft only; the host must sign and verify the exact admission evidence. */
|
|
36
|
+
export function buildOrganizationTestNetworkCredential(input) {
|
|
37
|
+
const applicationId = required(input.applicationId, 'applicationId');
|
|
38
|
+
const organizationIdentifier = required(input.organizationIdentifier, 'organizationIdentifier');
|
|
39
|
+
const contact = partyContact(input.controllerEmail, input.controllerTelephone, 'controller');
|
|
40
|
+
return {
|
|
41
|
+
'@context': [...CONTEXTS],
|
|
42
|
+
id: required(input.credentialId, 'credentialId'),
|
|
43
|
+
type: [ReviewedOrganizationCredentialTypes.VerifiableCredential, ReviewedOrganizationCredentialTypes.Admission],
|
|
44
|
+
issuer: required(input.issuerDid, 'issuerDid'),
|
|
45
|
+
credentialSubject: {
|
|
46
|
+
id: required(input.subjectDid, 'subjectDid'),
|
|
47
|
+
applicationId,
|
|
48
|
+
accessPath: input.accessPath,
|
|
49
|
+
organization: { legalName: required(input.legalName, 'legalName'), identifier: organizationIdentifier },
|
|
50
|
+
controller: {
|
|
51
|
+
...(contact.contactKind === 'email' ? { email: contact.contact } : { telephone: contact.contact }),
|
|
52
|
+
hasCredential: { material: required(input.controllerKeyMaterial, 'controllerKeyMaterial') },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
validFrom: required(input.validFrom, 'validFrom'),
|
|
56
|
+
validUntil: required(input.validUntil, 'validUntil'),
|
|
57
|
+
...(input.proof ? { proof: input.proof } : {}),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** Projects governed parties and roles; this builder never assigns or verifies them. */
|
|
61
|
+
export function buildTestNetworkOrganizationCredentialSet(input) {
|
|
62
|
+
const issuer = required(input.issuerDid, 'issuerDid');
|
|
63
|
+
const organizationDid = required(input.organizationDid, 'organizationDid');
|
|
64
|
+
const applicationId = required(input.applicationId, 'applicationId');
|
|
65
|
+
const validFrom = required(input.validFrom, 'validFrom');
|
|
66
|
+
const validUntil = required(input.validUntil, 'validUntil');
|
|
67
|
+
const legalName = required(input.legalName, 'legalName');
|
|
68
|
+
const organizationIdentifier = required(input.organizationIdentifier, 'organizationIdentifier');
|
|
69
|
+
const identifierType = required(input.identifierType, 'identifierType');
|
|
70
|
+
const addressCountry = required(input.addressCountry, 'addressCountry').toUpperCase();
|
|
71
|
+
const serviceCategory = required(input.serviceCategory, 'serviceCategory');
|
|
72
|
+
const representativeContact = partyContact(input.legalRepresentativeEmail, input.legalRepresentativeTelephone, 'legal representative');
|
|
73
|
+
const legalRepresentativeFullName = required(input.legalRepresentativeFullName, 'legalRepresentativeFullName');
|
|
74
|
+
const controllerContact = partyContact(input.controllerEmail, input.controllerTelephone, 'controller');
|
|
75
|
+
const representativeActor = buildStableActorIdentifier(representativeContact);
|
|
76
|
+
const controllerActor = buildStableActorIdentifier(controllerContact);
|
|
77
|
+
const representativeOccupation = required(input.legalRepresentativeOccupation, 'legalRepresentativeOccupation');
|
|
78
|
+
const controllerOccupation = required(input.controllerOccupation, 'controllerOccupation');
|
|
79
|
+
const controllerAuthorityRole = required(input.controllerAuthorityRole, 'controllerAuthorityRole');
|
|
80
|
+
const evidence = [{
|
|
81
|
+
type: 'DocumentVerification',
|
|
82
|
+
id: `urn:sha256:${required(input.pdfSha256, 'pdfSha256')}`,
|
|
83
|
+
documentVersion: required(input.documentVersion, 'documentVersion'),
|
|
84
|
+
applicationId,
|
|
85
|
+
}];
|
|
86
|
+
const base = { '@context': [...CONTEXTS], issuer, validFrom, validUntil, evidence };
|
|
87
|
+
const organization = {
|
|
88
|
+
...base,
|
|
89
|
+
id: `urn:uuid:${applicationId}:organization`,
|
|
90
|
+
type: [ReviewedOrganizationCredentialTypes.VerifiableCredential, ReviewedOrganizationCredentialTypes.Organization, ReviewedOrganizationCredentialTypes.TestNetwork],
|
|
91
|
+
credentialSubject: {
|
|
92
|
+
id: organizationDid,
|
|
93
|
+
'@type': 'Organization',
|
|
94
|
+
legalName,
|
|
95
|
+
identifier: { additionalType: identifierType, value: organizationIdentifier },
|
|
96
|
+
...(identifierType === 'taxID' ? { taxID: organizationIdentifier } : {}),
|
|
97
|
+
address: { '@type': 'PostalAddress', addressCountry },
|
|
98
|
+
makesOffer: { '@type': 'Offer', category: serviceCategory },
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
const representative = {
|
|
102
|
+
...base,
|
|
103
|
+
id: `urn:uuid:${applicationId}:legal-representative`,
|
|
104
|
+
type: [ReviewedOrganizationCredentialTypes.VerifiableCredential, ReviewedOrganizationCredentialTypes.Person, ReviewedOrganizationCredentialTypes.LegalRepresentative, ReviewedOrganizationCredentialTypes.TestNetwork],
|
|
105
|
+
credentialSubject: {
|
|
106
|
+
id: representativeActor,
|
|
107
|
+
'@type': 'Person',
|
|
108
|
+
name: legalRepresentativeFullName,
|
|
109
|
+
sameAs: representativeActor,
|
|
110
|
+
hasOccupation: { '@type': 'Occupation', occupationalCategory: representativeOccupation },
|
|
111
|
+
memberOf: {
|
|
112
|
+
'@type': 'Organization', legalName,
|
|
113
|
+
...(identifierType === 'taxID' ? { taxID: organizationIdentifier } : { identifier: { additionalType: identifierType, value: organizationIdentifier } }),
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
const controller = {
|
|
118
|
+
...base,
|
|
119
|
+
id: `urn:uuid:${applicationId}:service-controller`,
|
|
120
|
+
type: [ReviewedOrganizationCredentialTypes.VerifiableCredential, 'ServiceCredential', ReviewedOrganizationCredentialTypes.ServiceController, ReviewedOrganizationCredentialTypes.TestNetwork],
|
|
121
|
+
credentialSubject: {
|
|
122
|
+
id: organizationDid,
|
|
123
|
+
'@type': 'Service',
|
|
124
|
+
serviceType: 'OrganizationControllerService',
|
|
125
|
+
provider: {
|
|
126
|
+
'@type': 'Organization', legalName,
|
|
127
|
+
...(identifierType === 'taxID' ? { taxID: organizationIdentifier } : { identifier: { additionalType: identifierType, value: organizationIdentifier } }),
|
|
128
|
+
},
|
|
129
|
+
owner: {
|
|
130
|
+
'@type': 'Person',
|
|
131
|
+
additionalType: controllerAuthorityRole,
|
|
132
|
+
sameAs: controllerActor,
|
|
133
|
+
hasOccupation: { '@type': 'Occupation', occupationalCategory: controllerOccupation },
|
|
134
|
+
hasCredential: { material: required(input.controllerKeyMaterial, 'controllerKeyMaterial') },
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
return [organization, representative, controller];
|
|
139
|
+
}
|
|
140
|
+
/** Faithful existing proof-free JSON contract, not a new signing algorithm. */
|
|
141
|
+
function canonicalizeValue(value) {
|
|
142
|
+
if (Array.isArray(value))
|
|
143
|
+
return value.map(canonicalizeValue);
|
|
144
|
+
if (!value || typeof value !== 'object')
|
|
145
|
+
return value;
|
|
146
|
+
return Object.fromEntries(Object.entries(value)
|
|
147
|
+
.filter(([key]) => key !== 'proof')
|
|
148
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
149
|
+
.map(([key, nested]) => [key, canonicalizeValue(nested)]));
|
|
150
|
+
}
|
|
151
|
+
export function canonicalizeOrganizationTestNetworkCredential(credential) {
|
|
152
|
+
if (!credential.type.includes(ReviewedOrganizationCredentialTypes.Admission))
|
|
153
|
+
throw new TypeError('Credential is not an organization Test Network admission');
|
|
154
|
+
return JSON.stringify(canonicalizeValue(credential));
|
|
155
|
+
}
|
|
156
|
+
export function canonicalizeTestNetworkOrganizationCredential(credential) {
|
|
157
|
+
if (!TestNetworkOrganizationCredentialTypes.some(type => credential.type.includes(type)))
|
|
158
|
+
throw new TypeError('Credential is not a Test Network organization credential');
|
|
159
|
+
if (!credential.type.includes(ReviewedOrganizationCredentialTypes.TestNetwork))
|
|
160
|
+
throw new TypeError('Test Network credential marker is required');
|
|
161
|
+
return JSON.stringify(canonicalizeValue(credential));
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=organization-credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-credentials.js","sourceRoot":"","sources":["../src/organization-credentials.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAA0B,MAAM,4BAA4B,CAAA;AACtH,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAErF,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/D,oBAAoB,EAAE,kBAAkB,CAAC,oBAAoB;IAC7D,SAAS,EAAE,mCAAmC;IAC9C,YAAY,EAAE,wBAAwB;IACtC,MAAM,EAAE,kBAAkB;IAC1B,mBAAmB,EAAE,+BAA+B;IACpD,iBAAiB,EAAE,6BAA6B;IAChD,WAAW,EAAE,uBAAuB;CAC5B,CAAC,CAAA;AACX,MAAM,CAAC,MAAM,sCAAsC,GAAG,MAAM,CAAC,MAAM,CAAC;IAClE,mCAAmC,CAAC,YAAY;IAChD,mCAAmC,CAAC,mBAAmB;IACvD,mCAAmC,CAAC,iBAAiB;CAC7C,CAAC,CAAA;AACX,MAAM,QAAQ,GAAG,CAAC,qBAAqB,CAAC,EAAE,EAAE,oBAAoB,CAAC,CAAA;AAmCjE,SAAS,QAAQ,CAAC,KAAc,EAAE,IAAY;IAC5C,MAAM,UAAU,GAAG,MAAM,CAAC,KAA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CAAmC,CAAC,SAAS,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,0DAA0D,CAAC,CAAA;IAC7J,OAAO,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAA;AACtD,CAAC;AAED,MAAM,UAAU,6CAA6C,CAAC,UAA0C;IACtG,IAAI,CAAC,sCAAsC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,0DAA0D,CAAC,CAAA;IACzK,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,mCAAmC,CAAC,WAAW,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAA;IACjJ,OAAO,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Normalizes a full UUID representation; a short display identifier is never an identity. */
|
|
2
|
+
export declare function normalizeUuid(input: string | undefined): string | undefined;
|
|
3
|
+
/** Host-only authority identity; paths, user information and transport credentials are excluded. */
|
|
4
|
+
export declare function buildAuthorityDidWeb(input: Readonly<{
|
|
5
|
+
authority: string;
|
|
6
|
+
}>): string;
|
|
7
|
+
export declare const StableActorContactKinds: Readonly<{
|
|
8
|
+
readonly Email: "email";
|
|
9
|
+
readonly Phone: "phone";
|
|
10
|
+
}>;
|
|
11
|
+
/** Prefix/alphabet syntax only: no multihash decoding, digest validation or actor authority is established. */
|
|
12
|
+
export declare function isStableActorIdentifier(value: unknown): boolean;
|
|
13
|
+
export type StableActorContactKind = typeof StableActorContactKinds[keyof typeof StableActorContactKinds];
|
|
14
|
+
export type ActorContactInput = Readonly<{
|
|
15
|
+
contactKind: StableActorContactKind;
|
|
16
|
+
contact: string;
|
|
17
|
+
}>;
|
|
18
|
+
export type OrganizationEmployeeIdentityInput = ActorContactInput & Readonly<{
|
|
19
|
+
organizationDidWeb: string;
|
|
20
|
+
role: string;
|
|
21
|
+
deviceId?: string;
|
|
22
|
+
}>;
|
|
23
|
+
/** Normalization is a data operation, never proof of contact possession. */
|
|
24
|
+
export declare function normalizeActorContact(input: ActorContactInput): string;
|
|
25
|
+
/** Builds the existing opaque SHA3-256 multihash actor identifier. */
|
|
26
|
+
export declare function buildStableActorIdentifier(input: ActorContactInput): string;
|
|
27
|
+
/** Builds the existing organization employee DID, keeping role and actor separate. */
|
|
28
|
+
export declare function buildOrganizationEmployeeDidWeb(input: OrganizationEmployeeIdentityInput): string;
|
|
29
|
+
//# sourceMappingURL=organization-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-identity.d.ts","sourceRoot":"","sources":["../src/organization-identity.ts"],"names":[],"mappings":"AAIA,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAgB3E;AAED,oGAAoG;AACpG,wBAAgB,oBAAoB,CAAC,KAAK,EAAC,QAAQ,CAAC;IAAC,SAAS,EAAC,MAAM,CAAA;CAAC,CAAC,GAAE,MAAM,CAM9E;AAED,eAAO,MAAM,uBAAuB;;;EAA6D,CAAA;AAEjG,+GAA+G;AAC/G,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE/D;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,uBAAuB,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAA;AACzG,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IAAE,WAAW,EAAE,sBAAsB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAClG,MAAM,MAAM,iCAAiC,GAAG,iBAAiB,GAAG,QAAQ,CAAC;IAC3E,kBAAkB,EAAE,MAAM,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC,CAAA;AAEF,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAiBtE;AAED,sEAAsE;AACtE,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAO3E;AAED,sFAAsF;AACtF,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,iCAAiC,GAAG,MAAM,CAQhG"}
|