antifraud-data-utils-ts 0.3.0 → 0.3.2
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 +23 -1
- package/README.md +21 -1
- package/dist/encoding/actor-contact-hash.d.ts +3 -0
- package/dist/encoding/actor-contact-hash.d.ts.map +1 -0
- package/dist/encoding/actor-contact-hash.js +8 -0
- package/dist/encoding/actor-contact-hash.js.map +1 -0
- package/dist/encoding.d.ts +7 -0
- package/dist/encoding.d.ts.map +1 -1
- package/dist/encoding.js +23 -0
- package/dist/encoding.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/jwk-thumbprints.d.ts +16 -0
- package/dist/jwk-thumbprints.d.ts.map +1 -0
- package/dist/jwk-thumbprints.js +29 -0
- package/dist/jwk-thumbprints.js.map +1 -0
- package/dist/organization-identity.d.ts +2 -0
- package/dist/organization-identity.d.ts.map +1 -1
- package/dist/organization-identity.js +10 -4
- package/dist/organization-identity.js.map +1 -1
- package/dist/public-aliases.d.ts +7 -0
- package/dist/public-aliases.d.ts.map +1 -0
- package/dist/public-aliases.js +59 -0
- package/dist/public-aliases.js.map +1 -0
- package/dist/schema-org-types.d.ts +19 -0
- package/dist/schema-org-types.d.ts.map +1 -0
- package/dist/schema-org-types.js +18 -0
- package/dist/schema-org-types.js.map +1 -0
- package/docs/JWK_THUMBPRINTS.md +19 -0
- package/docs/PUBLIC_ALIASES.md +30 -0
- package/package.json +15 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 0.3.2
|
|
6
|
+
|
|
7
|
+
- Extract the existing opaque actor component from bare-host and tenant employee
|
|
8
|
+
DIDs without changing actor bytes or treating extraction as authority,
|
|
9
|
+
role validation or contact-hash reversal.
|
|
10
|
+
|
|
11
|
+
## 0.3.1
|
|
12
|
+
|
|
13
|
+
- Add nine immutable canonical Schema.org Organization class IRIs and their
|
|
14
|
+
literal union through the root and `schema-org-types` entry. Keep sectors,
|
|
15
|
+
presentation labels and eligibility policy outside the neutral catalog.
|
|
16
|
+
|
|
17
|
+
- Own neutral public JWK SHA-256 thumbprints and RFC9278 URI framing, preserving
|
|
18
|
+
EC/RSA/OKP and the established AKP public-member wire profiles.
|
|
19
|
+
|
|
20
|
+
- Own opaque public alias splitting and controller/telephone exchange alias
|
|
21
|
+
normalization while preserving strict contact validation and existing actor
|
|
22
|
+
hash bytes. Reject unsupported object coercion and accessor/inherited array
|
|
23
|
+
entries without claiming contact possession or authorization.
|
|
24
|
+
|
|
25
|
+
- Add a neutral fixed DAG-JSON/SHA2-256 CIDv1 encoding primitive that validates
|
|
26
|
+
and hashes exact caller-supplied UTF-8 bytes. Preserve the existing raw/SHA3
|
|
27
|
+
profiles and leave semantic canonicalization with the owning caller.
|
|
6
28
|
|
|
7
29
|
## 0.3.0
|
|
8
30
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Antifraud Data Utilities
|
|
2
2
|
|
|
3
|
+
`schema-org-types` exposes nine immutable canonical Schema.org Organization
|
|
4
|
+
class IRIs. `Dentist` is the published class; no `DentalClinic` class is
|
|
5
|
+
invented. `ResearchOrganization` is published in Schema.org's new area.
|
|
6
|
+
Consumers own presentation labels and selection policy; these classes confer
|
|
7
|
+
no identity, occupation or authority. Each value links to its official class
|
|
8
|
+
definition, for example [Dentist](https://schema.org/Dentist).
|
|
9
|
+
|
|
10
|
+
The `encoding` entry point exposes `buildDagJsonCidV1FromUtf8String` for the
|
|
11
|
+
fixed CIDv1 DAG-JSON (`0x129`), SHA2-256 and base58btc profile. It validates
|
|
12
|
+
supplied DAG-JSON and hashes its exact UTF-8 bytes without normalization or
|
|
13
|
+
reserialization. Callers own canonicalization and semantic field selection;
|
|
14
|
+
the primitive neither strips business identifiers nor verifies any claim.
|
|
15
|
+
The existing raw (`0x55`), SHA3-384 evidence profile remains independent.
|
|
16
|
+
|
|
3
17
|
The executable draft for the non-health
|
|
4
18
|
[Antifraud Data Card v1](docs/ANTIFRAUD_DATA_CARD_V1.md) defines the `afdc:/`
|
|
5
19
|
JSON:API/Schema.org credential transport and its separate `pqc:/` detached
|
|
@@ -22,6 +36,9 @@ documents the `organization-identity` entry point. It accepts an explicit email
|
|
|
22
36
|
or E.164 phone channel and preserves the established actor multihash and
|
|
23
37
|
organization employee DID representation. These pure builders never verify a
|
|
24
38
|
contact, assign a role or replace an organization licence or device grant.
|
|
39
|
+
`stableActorIdentifierFromDidWeb` extracts the unchanged opaque employee actor
|
|
40
|
+
component from bare-host and tenant forms, including existing trailing paths.
|
|
41
|
+
It does not validate the DID's authority, role, hash material or contact ownership.
|
|
25
42
|
The related `organization-credentials` entry point builds compatible reviewed
|
|
26
43
|
admission/domain drafts with email or telephone parties and explicitly supplied
|
|
27
44
|
occupation/authority claims; signing and verification remain outside it.
|
|
@@ -258,7 +275,10 @@ user-interface acceptance boundary.
|
|
|
258
275
|
|
|
259
276
|
## Development
|
|
260
277
|
|
|
261
|
-
Node.js
|
|
278
|
+
Node.js 26.13.0 is required. See [public and contact exchange aliases](docs/PUBLIC_ALIASES.md)
|
|
279
|
+
for the distinction between opaque alias lists and strict contact validation.
|
|
280
|
+
See [public JWK thumbprints](docs/JWK_THUMBPRINTS.md) for exact public-member
|
|
281
|
+
hashing and URI framing without a key-possession or authority claim.
|
|
262
282
|
|
|
263
283
|
```bash
|
|
264
284
|
npm ci
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actor-contact-hash.d.ts","sourceRoot":"","sources":["../../src/encoding/actor-contact-hash.ts"],"names":[],"mappings":"AAGA,gGAAgG;AAChG,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { sha3_256 } from '@noble/hashes/sha3.js';
|
|
2
|
+
import { encodeBase58btc } from './base58btc.js';
|
|
3
|
+
/** Internal wire encoder; each caller owns its distinct contact/alias normalization profile. */
|
|
4
|
+
export function hashCanonicalActorContact(value) {
|
|
5
|
+
const digest = sha3_256(new TextEncoder().encode(value));
|
|
6
|
+
return `urn:multibase:${encodeBase58btc(Uint8Array.from([0x16, 0x20, ...digest]))}`;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=actor-contact-hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actor-contact-hash.js","sourceRoot":"","sources":["../../src/encoding/actor-contact-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,gGAAgG;AAChG,MAAM,UAAU,yBAAyB,CAAC,KAAa;IACrD,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IACxD,OAAO,iBAAiB,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;AACrF,CAAC"}
|
package/dist/encoding.d.ts
CHANGED
|
@@ -25,4 +25,11 @@ export declare const SHA3_384_MULTIHASH_PROFILE: Readonly<{
|
|
|
25
25
|
export declare function encodeMultibaseSha3(input: string | Uint8Array, bits?: Sha3DigestBits): string;
|
|
26
26
|
/** CIDv1 raw codec over exact UTF-8 bytes; callers own input canonicalization. */
|
|
27
27
|
export declare function buildRawCidV1FromUtf8String(value: string, profile?: MultihashProfile): string;
|
|
28
|
+
/**
|
|
29
|
+
* Fixed CIDv1(DAG-JSON, SHA2-256), encoded as multibase base58btc.
|
|
30
|
+
* The caller owns JSON canonicalization and semantic field selection. Validate
|
|
31
|
+
* the supplied DAG-JSON bytes, then hash those exact bytes without reserializing.
|
|
32
|
+
* This profile is independent from the existing raw/SHA3 evidence profile.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildDagJsonCidV1FromUtf8String(value: string): string;
|
|
28
35
|
//# sourceMappingURL=encoding.d.ts.map
|
package/dist/encoding.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../src/encoding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../src/encoding.ts"],"names":[],"mappings":"AAOA,0DAA0D;AAC1D,eAAO,MAAM,aAAa,GAAI,OAAM,UAAU,KAAE,MAAyC,CAAA;AACzF,eAAO,MAAM,gBAAgB,GAAI,OAAM,UAAU,KAAE,MAA4E,CAAA;AAC/H,OAAO,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAExE,MAAM,MAAM,cAAc,GAAG,GAAG,GAAC,GAAG,GAAC,GAAG,GAAC,GAAG,CAAA;AAC5C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,SAAS,EAAC,QAAQ,cAAc,EAAE,CAAA;IAClC,IAAI,EAAC,MAAM,CAAA;IACX,iBAAiB,EAAC,MAAM,CAAA;IACxB,MAAM,EAAC,CAAC,KAAK,EAAC,UAAU,KAAG,UAAU,CAAA;CACtC,CAAC,CAAA;AAOF,eAAO,MAAM,0BAA0B;eAX3B,QAAQ,cAAc,EAAE;UAC7B,MAAM;uBACO,MAAM;YACjB,CAAC,KAAK,EAAC,UAAU,KAAG,UAAU;EAQgB,CAAA;AACvD,eAAO,MAAM,0BAA0B;eAZ3B,QAAQ,cAAc,EAAE;UAC7B,MAAM;uBACO,MAAM;YACjB,CAAC,KAAK,EAAC,UAAU,KAAG,UAAU;EASgB,CAAA;AAQvD,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,KAAK,EAAC,MAAM,GAAC,UAAU,EAAC,IAAI,GAAC,cAAkB,GAAE,MAAM,CAI1F;AAED,kFAAkF;AAClF,wBAAgB,2BAA2B,CAAC,KAAK,EAAC,MAAM,EAAC,OAAO,GAAC,gBAA2C,GAAE,MAAM,CAEnH;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAC,MAAM,GAAE,MAAM,CAMnE"}
|
package/dist/encoding.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { sha3_224, sha3_256, sha3_384, sha3_512 } from '@noble/hashes/sha3.js';
|
|
2
|
+
import { sha256 } from '@noble/hashes/sha2.js';
|
|
3
|
+
import * as dagJson from '@ipld/dag-json';
|
|
4
|
+
import { CID } from 'multiformats/cid';
|
|
5
|
+
import { create as createDigest } from 'multiformats/hashes/digest';
|
|
2
6
|
import { encodeBase58btc } from './encoding/base58btc.js';
|
|
3
7
|
/** Raw base58btc digits, without the multibase prefix. */
|
|
4
8
|
export const bytesToBase58 = (bytes) => encodeBase58btc(bytes).slice(1);
|
|
@@ -28,4 +32,23 @@ export function encodeMultibaseSha3(input, bits = 384) {
|
|
|
28
32
|
export function buildRawCidV1FromUtf8String(value, profile = SHA3_384_MULTIHASH_PROFILE) {
|
|
29
33
|
return encodeBase58btc(Uint8Array.of(1, 0x55, ...multihash(value, profile)));
|
|
30
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Fixed CIDv1(DAG-JSON, SHA2-256), encoded as multibase base58btc.
|
|
37
|
+
* The caller owns JSON canonicalization and semantic field selection. Validate
|
|
38
|
+
* the supplied DAG-JSON bytes, then hash those exact bytes without reserializing.
|
|
39
|
+
* This profile is independent from the existing raw/SHA3 evidence profile.
|
|
40
|
+
*/
|
|
41
|
+
export function buildDagJsonCidV1FromUtf8String(value) {
|
|
42
|
+
if (typeof value !== 'string')
|
|
43
|
+
throw new TypeError('dag_json_string_required');
|
|
44
|
+
const bytes = new TextEncoder().encode(value);
|
|
45
|
+
try {
|
|
46
|
+
dagJson.decode(bytes);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
throw new TypeError('invalid_dag_json');
|
|
50
|
+
}
|
|
51
|
+
const digest = createDigest(0x12, sha256(bytes));
|
|
52
|
+
return encodeBase58btc(CID.createV1(dagJson.code, digest).bytes);
|
|
53
|
+
}
|
|
31
54
|
//# sourceMappingURL=encoding.js.map
|
package/dist/encoding.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoding.js","sourceRoot":"","sources":["../src/encoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,QAAQ,EAAC,QAAQ,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAA;AACzE,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAEvD,0DAA0D;AAC1D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAgB,EAAS,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACzF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAgB,EAAS,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAC,IAAI,CAAA,EAAE,CAAA,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC/H,OAAO,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAA;AASxE,MAAM,QAAQ,GAAqD,MAAM,CAAC,MAAM,CAAC;IAC/E,GAAG,EAAC,MAAM,CAAC,MAAM,CAAC,EAAC,SAAS,EAAC,UAAU,EAAC,IAAI,EAAC,IAAI,EAAC,iBAAiB,EAAC,EAAE,EAAC,MAAM,EAAC,QAAQ,EAAC,CAAC;IACxF,GAAG,EAAC,MAAM,CAAC,MAAM,CAAC,EAAC,SAAS,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AAO;QAAC,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAA;IAC/D,OAAO,eAAe,CAAC,SAAS,CAAC,KAAK,EAAC,OAAO,CAAC,CAAC,CAAA;AAClD,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,2BAA2B,CAAC,KAAY,EAAC,UAAyB,0BAA0B;IAC1G,OAAO,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAC,IAAI,EAAC,GAAG,SAAS,CAAC,KAAK,EAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAAC,KAAY;IAC1D,IAAG,OAAO,KAAK,KAAG,QAAQ;QAAC,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAA;IAC1E,MAAM,KAAK,GAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC3C,IAAG,CAAC;QAAA,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAAA,CAAC;IAAA,MAAK,CAAC;QAAA,MAAM,IAAI,SAAS,CAAC,kBAAkB,CAAC,CAAA;IAAA,CAAC;IACxE,MAAM,MAAM,GAAC,YAAY,CAAC,IAAI,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAC7C,OAAO,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAA;AACjE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './cryptography/index.js';
|
|
|
2
2
|
export * from './identity-assurance/index.js';
|
|
3
3
|
export * from './organization-service-catalog.js';
|
|
4
4
|
export * from './schema-org-claims.js';
|
|
5
|
+
export * from './schema-org-types.js';
|
|
5
6
|
export * from './openid-contracts.js';
|
|
6
7
|
export * from './credential-contracts.js';
|
|
7
8
|
export * from './credential-decoding.js';
|
|
@@ -14,4 +15,6 @@ export * from './didcomm-contracts.js';
|
|
|
14
15
|
export * from './organization-credentials.js';
|
|
15
16
|
export * from './isco-08.js';
|
|
16
17
|
export * from './encoding.js';
|
|
18
|
+
export * from './public-aliases.js';
|
|
19
|
+
export * from './jwk-thumbprints.js';
|
|
17
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './cryptography/index.js';
|
|
|
2
2
|
export * from './identity-assurance/index.js';
|
|
3
3
|
export * from './organization-service-catalog.js';
|
|
4
4
|
export * from './schema-org-claims.js';
|
|
5
|
+
export * from './schema-org-types.js';
|
|
5
6
|
export * from './openid-contracts.js';
|
|
6
7
|
export * from './credential-contracts.js';
|
|
7
8
|
export * from './credential-decoding.js';
|
|
@@ -14,4 +15,6 @@ export * from './didcomm-contracts.js';
|
|
|
14
15
|
export * from './organization-credentials.js';
|
|
15
16
|
export * from './isco-08.js';
|
|
16
17
|
export * from './encoding.js';
|
|
18
|
+
export * from './public-aliases.js';
|
|
19
|
+
export * from './jwk-thumbprints.js';
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Public thumbprint parameters, not a key-validity or private-material publication filter. */
|
|
2
|
+
export interface JwkThumbprintInput {
|
|
3
|
+
readonly kty?: string;
|
|
4
|
+
readonly crv?: string;
|
|
5
|
+
readonly x?: string;
|
|
6
|
+
readonly y?: string;
|
|
7
|
+
readonly e?: string;
|
|
8
|
+
readonly n?: string;
|
|
9
|
+
readonly alg?: string;
|
|
10
|
+
readonly pub?: string;
|
|
11
|
+
}
|
|
12
|
+
/** RFC7638 public-member transcript; AKP retains the existing alg/kty/pub extension profile. */
|
|
13
|
+
export declare function computeRfc7638JwkThumbprint(jwk: JwkThumbprintInput): string;
|
|
14
|
+
/** RFC9278 SHA-256 URI framing; computing an identifier does not establish key ownership. */
|
|
15
|
+
export declare function toJwkThumbprintSha256Urn(jwk: JwkThumbprintInput): string;
|
|
16
|
+
//# sourceMappingURL=jwk-thumbprints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwk-thumbprints.d.ts","sourceRoot":"","sources":["../src/jwk-thumbprints.ts"],"names":[],"mappings":"AAGA,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CACtB;AAUD,gGAAgG;AAChG,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAQ3E;AAED,6FAA6F;AAC7F,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAExE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { sha256 } from '@noble/hashes/sha2.js';
|
|
2
|
+
import { Content } from './cryptography/content.js';
|
|
3
|
+
function publicMembers(jwk) {
|
|
4
|
+
if (jwk.kty === 'EC')
|
|
5
|
+
return ['crv', 'kty', 'x', 'y'];
|
|
6
|
+
if (jwk.kty === 'RSA')
|
|
7
|
+
return ['e', 'kty', 'n'];
|
|
8
|
+
if (jwk.kty === 'OKP')
|
|
9
|
+
return ['crv', 'kty', 'x'];
|
|
10
|
+
if (jwk.kty === 'AKP')
|
|
11
|
+
return ['alg', 'kty', 'pub'];
|
|
12
|
+
throw new Error('Unsupported public JWK thumbprint family.');
|
|
13
|
+
}
|
|
14
|
+
/** RFC7638 public-member transcript; AKP retains the existing alg/kty/pub extension profile. */
|
|
15
|
+
export function computeRfc7638JwkThumbprint(jwk) {
|
|
16
|
+
const members = publicMembers(jwk);
|
|
17
|
+
const transcript = members.map(name => {
|
|
18
|
+
const value = jwk[name];
|
|
19
|
+
if (typeof value !== 'string' || !value)
|
|
20
|
+
throw new Error(`Public JWK thumbprint requires ${name}.`);
|
|
21
|
+
return `${JSON.stringify(name)}:${JSON.stringify(value)}`;
|
|
22
|
+
}).join(',');
|
|
23
|
+
return Content.bytesToRawBase64UrlSafe(sha256(new TextEncoder().encode(`{${transcript}}`)));
|
|
24
|
+
}
|
|
25
|
+
/** RFC9278 SHA-256 URI framing; computing an identifier does not establish key ownership. */
|
|
26
|
+
export function toJwkThumbprintSha256Urn(jwk) {
|
|
27
|
+
return `urn:ietf:params:oauth:jwk-thumbprint:sha-256:${computeRfc7638JwkThumbprint(jwk)}`;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=jwk-thumbprints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwk-thumbprints.js","sourceRoot":"","sources":["../src/jwk-thumbprints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAA;AAcjD,SAAS,aAAa,CAAC,GAAuB;IAC5C,IAAI,GAAG,CAAC,GAAG,KAAK,IAAI;QAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACrD,IAAI,GAAG,CAAC,GAAG,KAAK,KAAK;QAAE,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;IAC/C,IAAI,GAAG,CAAC,GAAG,KAAK,KAAK;QAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;IACjD,IAAI,GAAG,CAAC,GAAG,KAAK,KAAK;QAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IACnD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAA;AAC9D,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,2BAA2B,CAAC,GAAuB;IACjE,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;IAClC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACpC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAA;QACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,GAAG,CAAC,CAAA;QACnG,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAA;IAC3D,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACZ,OAAO,OAAO,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,UAAU,GAAG,CAAC,CAAC,CAAC,CAAA;AAC7F,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,wBAAwB,CAAC,GAAuB;IAC9D,OAAO,gDAAgD,2BAA2B,CAAC,GAAG,CAAC,EAAE,CAAA;AAC3F,CAAC"}
|
|
@@ -24,6 +24,8 @@ export type OrganizationEmployeeIdentityInput = ActorContactInput & Readonly<{
|
|
|
24
24
|
export declare function normalizeActorContact(input: ActorContactInput): string;
|
|
25
25
|
/** Builds the existing opaque SHA3-256 multihash actor identifier. */
|
|
26
26
|
export declare function buildStableActorIdentifier(input: ActorContactInput): string;
|
|
27
|
+
/** Extracts an existing opaque employee actor component, without validating DID authority, role or hash material. */
|
|
28
|
+
export declare function stableActorIdentifierFromDidWeb(didWeb: string): string;
|
|
27
29
|
/** Builds the existing organization employee DID, keeping role and actor separate. */
|
|
28
30
|
export declare function buildOrganizationEmployeeDidWeb(input: OrganizationEmployeeIdentityInput): string;
|
|
29
31
|
//# sourceMappingURL=organization-identity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-identity.d.ts","sourceRoot":"","sources":["../src/organization-identity.ts"],"names":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E;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,CAM3E;AAED,qHAAqH;AACrH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAItE;AAED,sFAAsF;AACtF,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,iCAAiC,GAAG,MAAM,CAQhG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { decodeBase58btc } from './encoding/base58btc.js';
|
|
3
|
+
import { hashCanonicalActorContact } from './encoding/actor-contact-hash.js';
|
|
4
4
|
/** Normalizes a full UUID representation; a short display identifier is never an identity. */
|
|
5
5
|
export function normalizeUuid(input) {
|
|
6
6
|
if (!input)
|
|
@@ -65,8 +65,14 @@ export function buildStableActorIdentifier(input) {
|
|
|
65
65
|
// Existing actor contract: multihash(SHA3-256), code 0x16, digest size 0x20.
|
|
66
66
|
// Compatibility is checked against the published predecessor in tests only;
|
|
67
67
|
// the runtime does not depend on that frozen package.
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
return hashCanonicalActorContact(contact);
|
|
69
|
+
}
|
|
70
|
+
/** Extracts an existing opaque employee actor component, without validating DID authority, role or hash material. */
|
|
71
|
+
export function stableActorIdentifierFromDidWeb(didWeb) {
|
|
72
|
+
const match = /:employee:(z[^:]+):[^:]+(?:[:]|$)/u.exec(String(didWeb || '').trim());
|
|
73
|
+
if (!match)
|
|
74
|
+
throw new TypeError('DID does not contain an employee actor binding');
|
|
75
|
+
return `urn:multibase:${match[1]}`;
|
|
70
76
|
}
|
|
71
77
|
/** Builds the existing organization employee DID, keeping role and actor separate. */
|
|
72
78
|
export function buildOrganizationEmployeeDidWeb(input) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-identity.js","sourceRoot":"","sources":["../src/organization-identity.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"organization-identity.js","sourceRoot":"","sources":["../src/organization-identity.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAE5E,8FAA8F;AAC9F,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAC5B,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;IAC3D,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAChC,IAAI,KAAK,IAAI,CAAC;QAAE,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CA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AM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAA;IACxE,MAAM,WAAW,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACpF,OAAO,CAAC,kBAAkB,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC/E,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Split opaque CSV aliases without hashing emails or reinterpreting CID values that start with z. */
|
|
2
|
+
export declare function normalizePublicAliasList(value: unknown): string[];
|
|
3
|
+
/** Exchange alias compatibility, not strict contact validation, multihash verification or authority. */
|
|
4
|
+
export declare function normalizeControllerAlias(value: unknown): string;
|
|
5
|
+
/** Formatted or already-hashed exchange telephone aliases; normalizeActorContact remains the strict E.164 API. */
|
|
6
|
+
export declare function normalizeTelephoneAlias(value: unknown): string;
|
|
7
|
+
//# sourceMappingURL=public-aliases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-aliases.d.ts","sourceRoot":"","sources":["../src/public-aliases.ts"],"names":[],"mappings":"AA4BA,sGAAsG;AACtG,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAGjE;AAED,wGAAwG;AACxG,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQ/D;AAED,kHAAkH;AAClH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQ9D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { hashCanonicalActorContact } from './encoding/actor-contact-hash.js';
|
|
2
|
+
const MULTIBASE_URN = 'urn:multibase:';
|
|
3
|
+
const bareMultibase = (value) => /^z\S+$/u.test(value);
|
|
4
|
+
function exchangeHashEnvelope(value) {
|
|
5
|
+
if (value.toLowerCase().startsWith(MULTIBASE_URN)) {
|
|
6
|
+
const suffix = value.slice(MULTIBASE_URN.length).trim();
|
|
7
|
+
return bareMultibase(suffix) ? MULTIBASE_URN + suffix : value;
|
|
8
|
+
}
|
|
9
|
+
return bareMultibase(value) ? MULTIBASE_URN + value : undefined;
|
|
10
|
+
}
|
|
11
|
+
function ownStringArray(value) {
|
|
12
|
+
const length = Object.getOwnPropertyDescriptor(value, 'length')?.value;
|
|
13
|
+
if (typeof length !== 'number')
|
|
14
|
+
return [];
|
|
15
|
+
const keys = Object.getOwnPropertyNames(value)
|
|
16
|
+
.filter(key => /^(?:0|[1-9][0-9]*)$/u.test(key) && Number(key) < length)
|
|
17
|
+
.sort((left, right) => Number(left) - Number(right));
|
|
18
|
+
const result = [];
|
|
19
|
+
for (const key of keys) {
|
|
20
|
+
const entry = Object.getOwnPropertyDescriptor(value, key);
|
|
21
|
+
if (!entry || !Object.hasOwn(entry, 'value') || typeof entry.value !== 'string')
|
|
22
|
+
return [];
|
|
23
|
+
result.push(entry.value);
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
/** Split opaque CSV aliases without hashing emails or reinterpreting CID values that start with z. */
|
|
28
|
+
export function normalizePublicAliasList(value) {
|
|
29
|
+
const entries = typeof value === 'string' ? [value] : Array.isArray(value) ? ownStringArray(value) : [];
|
|
30
|
+
return [...new Set(entries.flatMap(entry => entry.split(',')).map(entry => entry.trim()).filter(Boolean))];
|
|
31
|
+
}
|
|
32
|
+
/** Exchange alias compatibility, not strict contact validation, multihash verification or authority. */
|
|
33
|
+
export function normalizeControllerAlias(value) {
|
|
34
|
+
if (typeof value !== 'string')
|
|
35
|
+
return '';
|
|
36
|
+
const trimmed = value.trim();
|
|
37
|
+
if (!trimmed)
|
|
38
|
+
return '';
|
|
39
|
+
const envelope = exchangeHashEnvelope(trimmed);
|
|
40
|
+
if (envelope !== undefined)
|
|
41
|
+
return envelope;
|
|
42
|
+
if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(trimmed))
|
|
43
|
+
return hashCanonicalActorContact(trimmed.toLowerCase());
|
|
44
|
+
return trimmed;
|
|
45
|
+
}
|
|
46
|
+
/** Formatted or already-hashed exchange telephone aliases; normalizeActorContact remains the strict E.164 API. */
|
|
47
|
+
export function normalizeTelephoneAlias(value) {
|
|
48
|
+
if (typeof value !== 'string')
|
|
49
|
+
return '';
|
|
50
|
+
const trimmed = value.trim();
|
|
51
|
+
if (!trimmed)
|
|
52
|
+
return '';
|
|
53
|
+
const envelope = exchangeHashEnvelope(trimmed);
|
|
54
|
+
if (envelope !== undefined)
|
|
55
|
+
return envelope;
|
|
56
|
+
const telephone = trimmed.replace(/[^\d+]/gu, '');
|
|
57
|
+
return telephone ? hashCanonicalActorContact(telephone) : '';
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=public-aliases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-aliases.js","sourceRoot":"","sources":["../src/public-aliases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAE5E,MAAM,aAAa,GAAG,gBAAgB,CAAA;AACtC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAEvE,SAAS,oBAAoB,CAAC,KAAa;IACzC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAClD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;QACvD,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAA;IAC/D,CAAC;IACD,OAAO,aAAa,CAAC,KAAK,CAA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,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAC9D,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Schema.org Organization class IRIs, reviewed against each official
|
|
3
|
+
* class page (https://schema.org/<Class>). ResearchOrganization is published
|
|
4
|
+
* in Schema.org's new area. This bounded catalog is not the complete ontology.
|
|
5
|
+
* Classes are not occupations, sectors, service capabilities or admission.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SchemaOrgOrganizationTypes: Readonly<{
|
|
8
|
+
readonly Dentist: "https://schema.org/Dentist";
|
|
9
|
+
readonly Hospital: "https://schema.org/Hospital";
|
|
10
|
+
readonly MedicalClinic: "https://schema.org/MedicalClinic";
|
|
11
|
+
readonly VeterinaryCare: "https://schema.org/VeterinaryCare";
|
|
12
|
+
readonly GovernmentOrganization: "https://schema.org/GovernmentOrganization";
|
|
13
|
+
readonly NGO: "https://schema.org/NGO";
|
|
14
|
+
readonly Organization: "https://schema.org/Organization";
|
|
15
|
+
readonly Corporation: "https://schema.org/Corporation";
|
|
16
|
+
readonly ResearchOrganization: "https://schema.org/ResearchOrganization";
|
|
17
|
+
}>;
|
|
18
|
+
export type SchemaOrgOrganizationType = typeof SchemaOrgOrganizationTypes[keyof typeof SchemaOrgOrganizationTypes];
|
|
19
|
+
//# sourceMappingURL=schema-org-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-org-types.d.ts","sourceRoot":"","sources":["../src/schema-org-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;EAU5B,CAAA;AACX,MAAM,MAAM,yBAAyB,GAAC,OAAO,0BAA0B,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Schema.org Organization class IRIs, reviewed against each official
|
|
3
|
+
* class page (https://schema.org/<Class>). ResearchOrganization is published
|
|
4
|
+
* in Schema.org's new area. This bounded catalog is not the complete ontology.
|
|
5
|
+
* Classes are not occupations, sectors, service capabilities or admission.
|
|
6
|
+
*/
|
|
7
|
+
export const SchemaOrgOrganizationTypes = Object.freeze({
|
|
8
|
+
Dentist: 'https://schema.org/Dentist',
|
|
9
|
+
Hospital: 'https://schema.org/Hospital',
|
|
10
|
+
MedicalClinic: 'https://schema.org/MedicalClinic',
|
|
11
|
+
VeterinaryCare: 'https://schema.org/VeterinaryCare',
|
|
12
|
+
GovernmentOrganization: 'https://schema.org/GovernmentOrganization',
|
|
13
|
+
NGO: 'https://schema.org/NGO',
|
|
14
|
+
Organization: 'https://schema.org/Organization',
|
|
15
|
+
Corporation: 'https://schema.org/Corporation',
|
|
16
|
+
ResearchOrganization: 'https://schema.org/ResearchOrganization',
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=schema-org-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-org-types.js","sourceRoot":"","sources":["../src/schema-org-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAC,MAAM,CAAC,MAAM,CAAC;IACpD,OAAO,EAAC,4BAA4B;IACpC,QAAQ,EAAC,6BAA6B;IACtC,aAAa,EAAC,kCAAkC;IAChD,cAAc,EAAC,mCAAmC;IAClD,sBAAsB,EAAC,2CAA2C;IAClE,GAAG,EAAC,wBAAwB;IAC5B,YAAY,EAAC,iCAAiC;IAC9C,WAAW,EAAC,gCAAgC;IAC5C,oBAAoB,EAAC,yCAAyC;CACtD,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Public JWK thumbprints
|
|
2
|
+
|
|
3
|
+
`antifraud-data-utils-ts/jwk-thumbprints` exports a synchronous SHA-256
|
|
4
|
+
public-member thumbprint and its RFC9278 URI representation. EC uses
|
|
5
|
+
`crv,kty,x,y`; RSA uses `e,kty,n`; OKP uses `crv,kty,x`. The existing AKP profile
|
|
6
|
+
uses `alg,kty,pub`; this is an explicit extension, not a claim that the original
|
|
7
|
+
RFC7638 standardized post-quantum keys.
|
|
8
|
+
|
|
9
|
+
The exact selected fields are JSON encoded in lexicographic order. Extra
|
|
10
|
+
metadata, including `kid`, is ignored. Required fields must be nonempty strings;
|
|
11
|
+
the operation does not validate curve points, verify key possession, authorize
|
|
12
|
+
an actor, or make arbitrary input safe to publish. It returns only an identifier
|
|
13
|
+
and does not return the input key or any private fields.
|
|
14
|
+
|
|
15
|
+
The existing cryptography service's generated-key identifiers remain unchanged.
|
|
16
|
+
|
|
17
|
+
Read-only historical wire reference:
|
|
18
|
+
[original thumbprint helper](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/src/utils/jwk-thumbprint.ts).
|
|
19
|
+
This package has no runtime dependency on that source.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Public and contact exchange aliases
|
|
2
|
+
|
|
3
|
+
`antifraud-data-utils-ts/public-aliases` owns three data operations:
|
|
4
|
+
|
|
5
|
+
| Operation | Profile |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `normalizePublicAliasList` | Trim and deduplicate opaque CSV/array aliases in their original order. Preserve bare CIDs, DIDs and URNs without hashing or reinterpreting them. |
|
|
8
|
+
| `normalizeControllerAlias` | Preserve opaque aliases and normalize the established multibase-URN/email exchange profile. |
|
|
9
|
+
| `normalizeTelephoneAlias` | Preserve already-hashed aliases or hash the formatted telephone exchange profile. |
|
|
10
|
+
|
|
11
|
+
The exchange operations retain SHA3-256 multihash bytes. They share an internal
|
|
12
|
+
encoder with `buildStableActorIdentifier`; their input normalization remains
|
|
13
|
+
separate from strict `normalizeActorContact` validation. The telephone exchange
|
|
14
|
+
profile does not validate E.164. The email exchange profile retains a `mailto:`
|
|
15
|
+
prefix in the hashed input, while strict contact normalization removes it.
|
|
16
|
+
Existing multibase envelope recognition is syntactic and does not verify a digest.
|
|
17
|
+
|
|
18
|
+
Unsupported non-string objects are not coerced. Array inputs use only their own
|
|
19
|
+
string data entries; accessors, non-string entries and inherited entries do not
|
|
20
|
+
become aliases. This is an ordinary data-array boundary, not a sandbox for Proxy
|
|
21
|
+
traps. These input checks harden unsupported JavaScript inputs while retaining
|
|
22
|
+
the supported string/CSV/array wire profiles.
|
|
23
|
+
|
|
24
|
+
None of these functions proves contact possession, verifies a credential or
|
|
25
|
+
grants authority. An opaque alias list is also not a privacy filter: callers
|
|
26
|
+
remain responsible for deciding which values may be published.
|
|
27
|
+
|
|
28
|
+
Read-only wire-profile reference:
|
|
29
|
+
[original alias utilities](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/src/utils/same-as.ts).
|
|
30
|
+
There is no runtime dependency on that repository.
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antifraud-data-utils-ts",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Product-neutral identity, evidence and public organization catalog data contracts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
|
+
"./schema-org-types": {
|
|
10
|
+
"types": "./dist/schema-org-types.d.ts",
|
|
11
|
+
"default": "./dist/schema-org-types.js"
|
|
12
|
+
},
|
|
13
|
+
"./jwk-thumbprints": {
|
|
14
|
+
"types": "./dist/jwk-thumbprints.d.ts",
|
|
15
|
+
"default": "./dist/jwk-thumbprints.js"
|
|
16
|
+
},
|
|
17
|
+
"./public-aliases": {
|
|
18
|
+
"types": "./dist/public-aliases.d.ts",
|
|
19
|
+
"default": "./dist/public-aliases.js"
|
|
20
|
+
},
|
|
9
21
|
"./actor-kinds": {
|
|
10
22
|
"types": "./dist/actor-kinds.d.ts",
|
|
11
23
|
"default": "./dist/actor-kinds.js"
|
|
@@ -102,8 +114,10 @@
|
|
|
102
114
|
"typescript": "^5.9.3"
|
|
103
115
|
},
|
|
104
116
|
"dependencies": {
|
|
117
|
+
"@ipld/dag-json": "11.0.1",
|
|
105
118
|
"@noble/hashes": "^2.4.0",
|
|
106
119
|
"@noble/post-quantum": "^0.5.4",
|
|
120
|
+
"multiformats": "14.0.0",
|
|
107
121
|
"pako": "^2.2.0"
|
|
108
122
|
}
|
|
109
123
|
}
|