sos-sdk-node-ts 0.1.9 → 0.1.10
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
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.10 - 2026-10-20
|
|
6
|
+
|
|
7
|
+
- Discover canonical animal cards through any governed `animal-*` sector,
|
|
8
|
+
including `animal-research`, instead of treating `animal-care` as the only
|
|
9
|
+
animal subject directory.
|
|
10
|
+
|
|
5
11
|
- Send authorized-subject directory submit and poll envelopes with the
|
|
6
12
|
canonical `application/didcomm-plain+json` media type so compat-mode SOS
|
|
7
13
|
gateways do not reject card discovery as legacy JSON.
|
|
@@ -170,7 +170,7 @@ function readOwnedSubjects(body, context, verified) {
|
|
|
170
170
|
const subjectDid = selectSubjectCardAlias(claims[CLAIM_ORGANIZATION_SAME_AS], context);
|
|
171
171
|
if (!subjectDid)
|
|
172
172
|
return [];
|
|
173
|
-
const role = context.sector
|
|
173
|
+
const role = isAnimalSector(context.sector)
|
|
174
174
|
? 'RESPRSN'
|
|
175
175
|
: String(claims[CLAIM_ORGANIZATION_MEMBER_ROLE] || '').trim();
|
|
176
176
|
const relatedPersonId = String(claims[CLAIM_ORGANIZATION_OWNER_IDENTIFIER] || '').trim();
|
|
@@ -222,7 +222,7 @@ function readData(body) {
|
|
|
222
222
|
}
|
|
223
223
|
function selectSubjectCardAlias(value, context) {
|
|
224
224
|
const aliases = publicAliases(value);
|
|
225
|
-
const candidate = aliases.find((alias) => context.sector
|
|
225
|
+
const candidate = aliases.find((alias) => isAnimalSector(context.sector)
|
|
226
226
|
? alias.includes(':card:vetchain:')
|
|
227
227
|
: alias.includes(':card:uhc:'));
|
|
228
228
|
if (!candidate)
|
|
@@ -231,13 +231,16 @@ function selectSubjectCardAlias(value, context) {
|
|
|
231
231
|
return candidate;
|
|
232
232
|
}
|
|
233
233
|
function requireCanonicalSubjectDid(subjectDid, context) {
|
|
234
|
-
if (context.sector
|
|
234
|
+
if (isAnimalSector(context.sector) && !parseAnimalCardDidWeb(subjectDid)) {
|
|
235
235
|
throw new Error('animal_card_did_invalid');
|
|
236
236
|
}
|
|
237
|
-
if (context.sector
|
|
237
|
+
if (!isAnimalSector(context.sector) && !/^did:web:[^\s]+:card:uhc:(?:personal|professional):[^\s]+$/i.test(subjectDid)) {
|
|
238
238
|
throw new Error('human_card_did_invalid');
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
+
function isAnimalSector(sector) {
|
|
242
|
+
return sector.toLowerCase().startsWith('animal-');
|
|
243
|
+
}
|
|
241
244
|
function publicAliases(value) {
|
|
242
245
|
const values = Array.isArray(value) ? value : String(value ?? '').split(',');
|
|
243
246
|
return [...new Set(values.map((alias) => String(alias).trim()).filter(Boolean))];
|
package/package.json
CHANGED