antifraud-data-utils-ts 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +91 -1
  2. package/README.md +33 -1
  3. package/dist/actor-kinds.d.ts +13 -0
  4. package/dist/actor-kinds.d.ts.map +1 -0
  5. package/dist/actor-kinds.js +15 -0
  6. package/dist/actor-kinds.js.map +1 -0
  7. package/dist/credential-contracts.d.ts +58 -0
  8. package/dist/credential-contracts.d.ts.map +1 -0
  9. package/dist/credential-contracts.js +10 -0
  10. package/dist/credential-contracts.js.map +1 -0
  11. package/dist/credential-decoding.d.ts +11 -0
  12. package/dist/credential-decoding.d.ts.map +1 -0
  13. package/dist/credential-decoding.js +84 -0
  14. package/dist/credential-decoding.js.map +1 -0
  15. package/dist/cryptography/cryptography-contract.d.ts +39 -0
  16. package/dist/cryptography/cryptography-contract.d.ts.map +1 -0
  17. package/dist/cryptography/cryptography-contract.js +2 -0
  18. package/dist/cryptography/cryptography-contract.js.map +1 -0
  19. package/dist/cryptography/cryptography-service.d.ts +2 -1
  20. package/dist/cryptography/cryptography-service.d.ts.map +1 -1
  21. package/dist/cryptography/cryptography-service.js.map +1 -1
  22. package/dist/cryptography/index.d.ts +2 -0
  23. package/dist/cryptography/index.d.ts.map +1 -1
  24. package/dist/cryptography/index.js +2 -0
  25. package/dist/cryptography/index.js.map +1 -1
  26. package/dist/cryptography/jws-types.d.ts +20 -0
  27. package/dist/cryptography/jws-types.d.ts.map +1 -0
  28. package/dist/cryptography/jws-types.js +2 -0
  29. package/dist/cryptography/jws-types.js.map +1 -0
  30. package/dist/cryptography/types.d.ts +36 -0
  31. package/dist/cryptography/types.d.ts.map +1 -1
  32. package/dist/did-document.d.ts +35 -0
  33. package/dist/did-document.d.ts.map +1 -0
  34. package/dist/did-document.js +2 -0
  35. package/dist/did-document.js.map +1 -0
  36. package/dist/didcomm-contracts.d.ts +32 -0
  37. package/dist/didcomm-contracts.d.ts.map +1 -0
  38. package/dist/didcomm-contracts.js +2 -0
  39. package/dist/didcomm-contracts.js.map +1 -0
  40. package/dist/encoding/actor-contact-hash.d.ts +3 -0
  41. package/dist/encoding/actor-contact-hash.d.ts.map +1 -0
  42. package/dist/encoding/actor-contact-hash.js +8 -0
  43. package/dist/encoding/actor-contact-hash.js.map +1 -0
  44. package/dist/encoding/base58btc.d.ts +2 -0
  45. package/dist/encoding/base58btc.d.ts.map +1 -1
  46. package/dist/encoding/base58btc.js +24 -0
  47. package/dist/encoding/base58btc.js.map +1 -1
  48. package/dist/encoding.d.ts +35 -0
  49. package/dist/encoding.d.ts.map +1 -0
  50. package/dist/encoding.js +54 -0
  51. package/dist/encoding.js.map +1 -0
  52. package/dist/identity-assurance/index.d.ts +1 -0
  53. package/dist/identity-assurance/index.d.ts.map +1 -1
  54. package/dist/identity-assurance/index.js +1 -0
  55. package/dist/identity-assurance/index.js.map +1 -1
  56. package/dist/identity-assurance/review-methods.d.ts +9 -0
  57. package/dist/identity-assurance/review-methods.d.ts.map +1 -0
  58. package/dist/identity-assurance/review-methods.js +8 -0
  59. package/dist/identity-assurance/review-methods.js.map +1 -0
  60. package/dist/identity-assurance/vocabulary.d.ts.map +1 -1
  61. package/dist/identity-assurance/vocabulary.js +8 -7
  62. package/dist/identity-assurance/vocabulary.js.map +1 -1
  63. package/dist/index.d.ts +13 -0
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +13 -0
  66. package/dist/index.js.map +1 -1
  67. package/dist/isco-08.d.ts +149 -0
  68. package/dist/isco-08.d.ts.map +1 -0
  69. package/dist/isco-08.js +74 -0
  70. package/dist/isco-08.js.map +1 -0
  71. package/dist/jwk-thumbprints.d.ts +16 -0
  72. package/dist/jwk-thumbprints.d.ts.map +1 -0
  73. package/dist/jwk-thumbprints.js +29 -0
  74. package/dist/jwk-thumbprints.js.map +1 -0
  75. package/dist/openid-contracts.d.ts +59 -0
  76. package/dist/openid-contracts.d.ts.map +1 -0
  77. package/dist/openid-contracts.js +2 -0
  78. package/dist/openid-contracts.js.map +1 -0
  79. package/dist/organization-credentials.d.ts.map +1 -1
  80. package/dist/organization-credentials.js +3 -2
  81. package/dist/organization-credentials.js.map +1 -1
  82. package/dist/organization-identity.d.ts +8 -0
  83. package/dist/organization-identity.d.ts.map +1 -1
  84. package/dist/organization-identity.js +39 -4
  85. package/dist/organization-identity.js.map +1 -1
  86. package/dist/organization-service-catalog.d.ts +1 -28
  87. package/dist/organization-service-catalog.d.ts.map +1 -1
  88. package/dist/organization-service-catalog.js +2 -28
  89. package/dist/organization-service-catalog.js.map +1 -1
  90. package/dist/public-aliases.d.ts +7 -0
  91. package/dist/public-aliases.d.ts.map +1 -0
  92. package/dist/public-aliases.js +59 -0
  93. package/dist/public-aliases.js.map +1 -0
  94. package/dist/schema-org-claims.d.ts +145 -0
  95. package/dist/schema-org-claims.d.ts.map +1 -0
  96. package/dist/schema-org-claims.js +137 -0
  97. package/dist/schema-org-claims.js.map +1 -0
  98. package/dist/schema-org-types.d.ts +19 -0
  99. package/dist/schema-org-types.d.ts.map +1 -0
  100. package/dist/schema-org-types.js +18 -0
  101. package/dist/schema-org-types.js.map +1 -0
  102. package/dist/vault-repository.d.ts +29 -0
  103. package/dist/vault-repository.d.ts.map +1 -0
  104. package/dist/vault-repository.js +2 -0
  105. package/dist/vault-repository.js.map +1 -0
  106. package/docs/CREDENTIAL_CONSUMER_PROFILES.md +55 -0
  107. package/docs/DIDCOMM_AND_ACTOR_SYNTAX.md +51 -0
  108. package/docs/DID_AND_JWS_DATA_CONTRACTS.md +20 -0
  109. package/docs/JWK_THUMBPRINTS.md +19 -0
  110. package/docs/NEUTRAL_IDENTITY_CONTRACTS.md +79 -0
  111. package/docs/NEUTRAL_VAULT_CONTRACTS.md +49 -0
  112. package/docs/ORGANIZATION_CONTACT_IDENTITY.md +3 -2
  113. package/docs/PUBLIC_ALIASES.md +30 -0
  114. package/docs/UNVERIFIED_CREDENTIAL_DECODING.md +63 -0
  115. package/package.json +55 -1
@@ -0,0 +1,51 @@
1
+ # Plaintext DIDComm data and actor identifier syntax
2
+
3
+ `didcomm-contracts` exports the supported `DidCommPayload<Body>` plaintext
4
+ projection and `DidCommAttachment` attachment profile. These are neutral data
5
+ contracts for education and other sectors, independent of a business resource
6
+ type, SDK transport, persistence model, professional role or clinical policy.
7
+
8
+ The envelope retains the current consumer requirement for `id`, protocol `type`
9
+ and an object `body`; optional fields cover sender/recipients, parent/thread
10
+ identifiers, created/expiry times and attachments. A typed object interface can
11
+ serve as the body without adding an index signature. Arrays and primitive types
12
+ are rejected by the supported body profile. These compile-time checks do not
13
+ replace runtime JSON validation. A protocol `type` is not a business resource's
14
+ type or a FHIR `resourceType`.
15
+
16
+ The attachment profile requires `id`, `media_type` and `data`, preserving existing
17
+ consumers. Requiring those metadata members is a consumer constraint, not a
18
+ claim that every DIDComm attachment must have them. It accepts the existing
19
+ immutable inline/linked binary attachment builders directly, including readonly
20
+ link arrays, byte counts and linked hashes. Optional inline JSON uses the owned
21
+ `JsonValue` shape. The projection does not enforce every standard attachment
22
+ combination, content encoding or hash rule. Callers validate their selected
23
+ transport and content profile before processing attachments.
24
+
25
+ `DIDCOMM_PLAINTEXT_JSON_MEDIA_TYPE` identifies plaintext data. It grants no
26
+ confidentiality, authenticity or authorization. Default HTTP Accept negotiation
27
+ is caller policy and is not defined here. Reading or assigning a plaintext
28
+ envelope does not verify a signer, sender, recipient, replay binding or issuer.
29
+
30
+ Original compatibility source:
31
+ <https://github.com/Global-DataCare/gdc-common-utils-ts>, specifically the reviewed
32
+ [communication data](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/f4031b221216cacd9917d1d20c5ff0b03bed7045/src/models/comm.ts).
33
+ The [DIDComm specification](https://identity.foundation/didcomm-messaging/spec/v2.1/)
34
+ describes a broader protocol. This implementation is the explicitly supported
35
+ consumer projection, not a claim to implement or validate every feature.
36
+
37
+ ## Stable actor syntax
38
+
39
+ `isStableActorIdentifier(value)` returns a boolean for a primitive string whose
40
+ trimmed value has the existing `urn:multibase:z` prefix followed by one or more
41
+ base58btc alphabet characters. Short strings such as `urn:multibase:z1` retain
42
+ their historical syntactic result. The helper does not decode a multihash,
43
+ validate its digest algorithm or length, prove contact possession or establish
44
+ actor identity. Use the actual authenticated identity and proof checks for that.
45
+
46
+ Objects are rejected without reading conversion hooks, including inherited
47
+ `toString` and `Symbol.toPrimitive` getters. This deliberately hardens the old
48
+ coercion behavior while preserving primitive string compatibility. The result
49
+ is boolean rather than a type predicate, so an invalid known string does not
50
+ become an impossible type in its false branch. Original source evidence is the
51
+ reviewed [actor identifier helper](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/f4031b221216cacd9917d1d20c5ff0b03bed7045/src/utils/actor-identifier.ts).
@@ -0,0 +1,20 @@
1
+ # Neutral identity and signature data contracts
2
+
3
+ `did-document` describes the key-bearing JSON-LD projection used by the engine,
4
+ with DID verification relationships and explicit public-key shapes. It follows
5
+ the [W3C DID Core vocabulary](https://www.w3.org/TR/did-core/), but is not a
6
+ schema validator, resolver, proof verifier or authorization decision.
7
+
8
+ String service endpoints and string or string-array contexts are compatibility
9
+ defaults. Generic service and context parameters let an exchange adapter model
10
+ other structured representations explicitly. Extension fields remain unknown
11
+ until a consuming adapter validates its own profile.
12
+
13
+ The cryptography entry point exports the engine's JWS signing profile based on
14
+ RFC 7515. Decoded headers require explicit algorithm and key selection; encoded
15
+ General JWS signature fields remain strings. This is a supported engine profile,
16
+ not every valid JOSE serialization. Embedded JWK import types do not enforce
17
+ public-only publication: the emitting host must validate or project the key.
18
+
19
+ These contracts contain no sector, controller policy, transport, persistence or
20
+ clinical catalog. SDK runtime layers own resolution and authenticated handling.
@@ -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,79 @@
1
+ # Neutral identity and registration contracts
2
+
3
+ Antifraud owns the reusable person, organization, action, place and service flat
4
+ claim vocabularies in `schema-org-claims`. These describe identity and catalog
5
+ data for education, administrative work and other sectors. They contain no
6
+ healthcare role selection, licence entitlement, clinical policy or portal code.
7
+ The flat keys are an application wire profile using Schema.org vocabulary;
8
+ they are not a declaration that Schema.org publishes these reverse-DNS keys.
9
+
10
+ `organization-service-catalog` re-exports the same organization, place and service
11
+ objects. Its existing `Organization.Identifier`, `Place.Identifier` and
12
+ `Service.Identifier` keys still address `identifier.value`. In the expanded
13
+ organization and service vocabularies, `IdentifierReference` addresses the
14
+ containing `identifier`; `IdentifierValue` is an explicit alias for the existing
15
+ value key. Consumers must select the required field explicitly. Changing an
16
+ import must not change stored claims, searches, proofs or signed payloads.
17
+
18
+ `SchemaOrgPersonClaim` retains the identity-assurance mapper's seven existing
19
+ person fields and adds the occupation, identity and organization-membership
20
+ fields already required by shared onboarding and employee consumers.
21
+ `SchemaOrgActionClaim` records the agent, participant, provider and start time of
22
+ an action. A field claiming an actor or credential material never establishes
23
+ that actor's authority. Verified sessions and proofs remain caller concerns.
24
+
25
+ ## Registration and token data
26
+
27
+ The `openid-contracts` subpath exports data types only:
28
+
29
+ | Contract | Existing consumer need | Boundary |
30
+ | --- | --- | --- |
31
+ | `JwtRegisteredClaims` | Registered issuer, subject, audience, time and token identifiers | Optional registered members; no token validation |
32
+ | `ClientAccessTokenClaims` | Authorization managers require a client ID, scope, issuer, subject, single audience and issued/expiry times | A constrained application profile, not every OAuth access token |
33
+ | `OidcClientRegistrationRequest` | Device registration receives redirect URIs, application/software metadata, authentication method, grants and JWK metadata | The metadata subset currently supported by consumers, not every registered OIDC field or authentication method |
34
+ | `OidcClientRegistrationResponse` | Registration returns a client ID and optional issuance/secret/management metadata | Metadata only; issuance time remains optional in this neutral subset |
35
+ | `RegisteredDeviceInfo` | Registration distinguishes stable device identity from optional push delivery metadata | Application extension data, not standard OIDC metadata |
36
+ | `DeviceClientRegistrationRequest` | Existing device admission carries `ext_device_info` | Explicit extension of the neutral metadata subset |
37
+ | `DeviceClientRegistrationResponse` | Existing device admission always returns client issuance time | Constrained application response profile |
38
+
39
+ The existing source consumers are `DeviceRegistrationManager`,
40
+ `IAuthorizationManager`, `SmartAuthorizationManager` and `FhirController` in
41
+ <https://github.com/soschain/sos-gw-node-ts>. The flat claim consumers include
42
+ shared onboarding in <https://github.com/soschain/sos-data-utils-ts> and the
43
+ existing Antifraud public organization catalog. Original compatibility source:
44
+ <https://github.com/Global-DataCare/gdc-common-utils-ts>, specifically the reviewed
45
+ [flat claim catalog](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/f4031b221216cacd9917d1d20c5ff0b03bed7045/src/constants/schemaorg.ts),
46
+ [device registration data](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/f4031b221216cacd9917d1d20c5ff0b03bed7045/src/models/openid-device.ts)
47
+ and [access-token application profile](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/f4031b221216cacd9917d1d20c5ff0b03bed7045/src/models/auth.ts).
48
+ These links identify source evidence and add no runtime dependency.
49
+
50
+ Standards references are [OpenID Connect Dynamic Client Registration](https://openid.net/specs/openid-connect-registration-1_0.html),
51
+ [OAuth client metadata](https://www.rfc-editor.org/rfc/rfc7591.html#section-2)
52
+ and [JWT registered claims](https://www.rfc-editor.org/rfc/rfc7519.html#section-4.1).
53
+ TypeScript does not enforce these protocols at runtime. JSON decoding, assigning
54
+ a type, accepting JWK import data or receiving device metadata does not verify a
55
+ signature, establish trust, enforce replay protection or grant a licence.
56
+
57
+ ## Commerce data used by existing consumers
58
+
59
+ `SchemaOrgOfferClaim`, `SchemaOrgOrderClaim` and
60
+ `SchemaOrgIndividualProductClaim` contain the generic flat fields already read
61
+ by `HostingOfferOrderService`, `process-order-entry`, `payment-confirmation`,
62
+ `FamilyManager`, `license-search` and related hosting handlers in the Gateway
63
+ source linked above. These fields include offer quantity and price, accepted
64
+ offer references, order confirmation/payment references and product serials.
65
+ They preserve the exact existing indexed wire identities. Host-specific pricing,
66
+ payment verification, role entitlements, device limits and licence decisions
67
+ remain outside these neutral vocabularies. A product category or serial is data,
68
+ not authorization. No unused SoftwareApplication vocabulary is added merely to
69
+ reproduce a larger historical catalog.
70
+
71
+ ## Validation
72
+
73
+ Public consumer fixtures compile the positive shapes and reject missing client
74
+ scope, missing device identity, string numeric dates, unknown claim keys and a
75
+ device extension accidentally placed in the standard metadata subset. Runtime
76
+ tests preserve the distinction between identifier references and values, the
77
+ existing public-catalog exports and identity-assurance mapping keys. Existing
78
+ catalog and cryptography tests continue to validate their own behavior. These
79
+ checks do not claim complete OpenID conformance or an education service journey.
@@ -0,0 +1,49 @@
1
+ # Neutral record and vault contracts
2
+
3
+ The `vault-repository` subpath exports five type-only contracts:
4
+ `RecordBase`, `VaultRecord`, `VaultQueryCondition`, `VaultQuery` and
5
+ `IVaultRepository`. They provide one reusable abstract storage boundary for
6
+ education, administration and other sector consumers without importing a product
7
+ SDK, clinical vocabulary or a storage backend.
8
+
9
+ `RecordBase` requires `id: string`; `VaultRecord` aliases it. The repository
10
+ retains the existing four methods and results: write one or several records,
11
+ read an optional typed record, query typed records, and delete a record. Write
12
+ and delete results remain `Promise<boolean>`. An identifier does not establish
13
+ authority; host composition must enforce the authenticated account, tenant and
14
+ collection scope.
15
+
16
+ ## Query profile and compatibility
17
+
18
+ `VaultQueryCondition` retains `attribute`, optional `equals` and optional `in`.
19
+ `VaultQuery` retains optional `where`, `orderBy`, `limit` and `offset`. This is the
20
+ existing exact record-field profile. In particular an attribute containing dots
21
+ is not automatically interpreted as a nested path, an EAV attribute name or a
22
+ protected HMAC index selector. This extraction adds no `extraIndex` capability
23
+ or implicit index dialect. Protected-index queries need a separately named and
24
+ tested profile/capability that retains vault, tenant and index namespaces.
25
+
26
+ Original contract source: <https://github.com/soschain/sos-sdk-core-ts>, reviewed
27
+ at the [four-method repository port](https://github.com/soschain/sos-sdk-core-ts/blob/53adaa88724560b728f9c6e5e897951c8da9550b/src/vault-repository.ts).
28
+ Compatibility consumers can retain their existing public subpaths through
29
+ type-only re-exports. Record metadata or a query input alone does not authorize
30
+ collection access or select a backend.
31
+
32
+ ## What the abstract port does not implement
33
+
34
+ There is no memory, SQLite, IndexedDB, Firestore or other persistence adapter in
35
+ this module. There is no transaction implementation, driver, transport client,
36
+ cross-device synchronization or key-custody implementation. Those behaviors
37
+ belong to explicit runtime owners and require their own adapter and journey
38
+ proof. Antifraud Data must not import a product runtime to implement this port.
39
+
40
+ The richer Gateway repository class, with section/history/hydration operations
41
+ and a runtime DI token, is a separate contract. It must not be silently replaced
42
+ with this four-method type-only interface merely because the public names match.
43
+
44
+ Public consumer fixtures check typed record reads/queries, required IDs and
45
+ method results while rejecting an unsupported EAV condition shape. A scoped
46
+ source check rejects reverse product/clinical dependencies and runtime
47
+ implementations in the abstract module. These are contract/ownership checks,
48
+ not proof of native or browser persistence, encrypted key reopening or backend
49
+ query parity.
@@ -44,8 +44,9 @@ employee DID retains the existing organization `did:web` root followed by
44
44
  is separate from the stable actor; two roles for one phone do not require two
45
45
  phone accounts. Neither clear contact is embedded in the generated identifier.
46
46
 
47
- The algorithm and representation are ported from the published predecessor
48
- `gdc-common-utils-ts@2.9.30` actor identifier and employee DID helpers. Tests use
47
+ The algorithm and representation preserve the actor identifier and employee
48
+ DID helpers in [the original source repository](https://github.com/Global-DataCare/gdc-common-utils-ts).
49
+ Tests use
49
50
  that existing **development dependency only** as a compatibility oracle for
50
51
  email case, plus-addresses, URI/format normalization, phone hashes, employee
51
52
  DIDs and device suffixes. Email DID compatibility is defined on normalized
@@ -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.
@@ -0,0 +1,63 @@
1
+ # Unverified credential and presentation parsing
2
+
3
+ The `credential-decoding` subpath provides two product-neutral parsing
4
+ helpers: `decodeUnverifiedJsonOrJwtObject(input)` and
5
+ `extractUnverifiedPresentationCredentials(input)`. They read data, not trust.
6
+ Neither helper verifies JOSE headers, signatures, issuers, recipients, validity
7
+ periods, nonces, role types or any authorization policy. They do not replace the
8
+ cryptography engine's JWS/JWE processing or an application's token verifier.
9
+
10
+ ## Supported input and raw-object boundary
11
+
12
+ The object decoder accepts a raw JSON object string, a three-part compact input
13
+ with a nonempty base64url JSON object payload, or an already decoded plain data
14
+ object. Compact inputs preserve the current parser's payload-only behavior:
15
+ their header and signature segments are not validated. Payload bytes use the
16
+ existing `Content` strict base64url decoding and fatal UTF-8 conversion.
17
+
18
+ Already decoded containers must have the ordinary object prototype or a null
19
+ prototype and only own string-keyed data properties. Own accessors, inherited
20
+ containers, arrays and class instances are excluded. The parser reads property
21
+ descriptors rather than calling conversion functions or property getters. It
22
+ returns a shallow copy of enumerable own data fields; nested values remain
23
+ opaque, unvalidated values. This is deliberately not a recursive JSON validator
24
+ or arbitrary JavaScript-object sandbox. Hostile Proxy reflection traps cannot
25
+ be guaranteed inert by a portable JavaScript helper; reflection errors are
26
+ handled as invalid input. Input strings and bytes are the preferred boundary.
27
+
28
+ The presentation collector reads only an own `vp` data container and an own
29
+ `verifiableCredential` array. It reads own array data entries through descriptors,
30
+ without using a caller-provided iterator or invoking array-entry getters.
31
+ Candidates can be plain decoded objects, raw JSON object strings or compact
32
+ credential payloads. Malformed candidates are omitted in their existing order.
33
+ There is no credential-type selection or profile admission policy in this layer.
34
+
35
+ Malformed input returns `undefined` from the object decoder or an empty array
36
+ from the collector. A valid empty JSON object can be parsed as data; it does not
37
+ become a valid credential or a successful authentication result. Public return
38
+ types retain unknown field values so callers must validate a selected schema.
39
+
40
+ ## Compatibility and hardening
41
+
42
+ Current source consumers include `individual-controller-smart` and duplicated
43
+ activation parsing helpers in <https://github.com/soschain/sos-gw-node-ts>.
44
+ Original compatibility source:
45
+ <https://github.com/Global-DataCare/gdc-common-utils-ts>, specifically the reviewed
46
+ [presentation parsing helpers](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/f4031b221216cacd9917d1d20c5ff0b03bed7045/src/utils/vp-token.ts).
47
+ Existing consumer wrappers may retain their old public spelling while importing
48
+ the explicitly unverified neutral implementation. Controller/representative
49
+ credential selection and activation policy remain in their owning product or
50
+ service; they do not become generic cryptographic verification.
51
+
52
+ Valid serialized object payloads preserve their data and order. The new boundary
53
+ explicitly rejects non-object JSON, invalid base64url/UTF-8, inherited fields,
54
+ nonplain containers and accessor/coercion-dependent objects that the older
55
+ permissive helpers could accept. It does not mutate a source object or assign
56
+ prototype keys through a prototype setter. Its own-container checks do not
57
+ validate nested subject values; callers must not infer recursive safety.
58
+
59
+ Tests cover exact Unicode data, supported input forms, mixed credential arrays,
60
+ malformed/scalar encodings, object/prototype/accessor boundaries, own array entries,
61
+ prototype-key preservation and unchanged unverified results under altered header
62
+ or signature segments. Those last cases prove the limit of parsing, not a
63
+ cryptographic success result.
package/package.json CHANGED
@@ -1,11 +1,63 @@
1
1
  {
2
2
  "name": "antifraud-data-utils-ts",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
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
+ },
21
+ "./actor-kinds": {
22
+ "types": "./dist/actor-kinds.d.ts",
23
+ "default": "./dist/actor-kinds.js"
24
+ },
25
+ "./vault-repository": {
26
+ "types": "./dist/vault-repository.d.ts",
27
+ "default": "./dist/vault-repository.js"
28
+ },
29
+ "./credential-decoding": {
30
+ "types": "./dist/credential-decoding.d.ts",
31
+ "default": "./dist/credential-decoding.js"
32
+ },
33
+ "./credential-contracts": {
34
+ "types": "./dist/credential-contracts.d.ts",
35
+ "default": "./dist/credential-contracts.js"
36
+ },
37
+ "./didcomm-contracts": {
38
+ "types": "./dist/didcomm-contracts.d.ts",
39
+ "default": "./dist/didcomm-contracts.js"
40
+ },
41
+ "./schema-org-claims": {
42
+ "types": "./dist/schema-org-claims.d.ts",
43
+ "default": "./dist/schema-org-claims.js"
44
+ },
45
+ "./openid-contracts": {
46
+ "types": "./dist/openid-contracts.d.ts",
47
+ "default": "./dist/openid-contracts.js"
48
+ },
49
+ "./did-document": {
50
+ "types": "./dist/did-document.d.ts",
51
+ "default": "./dist/did-document.js"
52
+ },
53
+ "./encoding": {
54
+ "types": "./dist/encoding.d.ts",
55
+ "default": "./dist/encoding.js"
56
+ },
57
+ "./isco-08": {
58
+ "types": "./dist/isco-08.d.ts",
59
+ "default": "./dist/isco-08.js"
60
+ },
9
61
  ".": {
10
62
  "types": "./dist/index.d.ts",
11
63
  "default": "./dist/index.js"
@@ -62,8 +114,10 @@
62
114
  "typescript": "^5.9.3"
63
115
  },
64
116
  "dependencies": {
117
+ "@ipld/dag-json": "11.0.1",
65
118
  "@noble/hashes": "^2.4.0",
66
119
  "@noble/post-quantum": "^0.5.4",
120
+ "multiformats": "14.0.0",
67
121
  "pako": "^2.2.0"
68
122
  }
69
123
  }