@singi-labs/sifa-sdk 0.19.100 → 0.19.102
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/dist/index.cjs +57 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/jev/index.cjs +0 -2
- package/dist/jev/index.cjs.map +1 -1
- package/dist/jev/index.d.cts +4 -0
- package/dist/jev/index.d.ts +4 -0
- package/dist/jev/index.js +0 -2
- package/dist/jev/index.js.map +1 -1
- package/dist/jev/issue.cjs.map +1 -1
- package/dist/logic/index.js +10 -0
- package/dist/logic/index.js.map +1 -1
- package/dist/logic/registry-org-type.js +58 -0
- package/dist/logic/registry-org-type.js.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6425,6 +6425,58 @@ var siteActivityPresetUpdateSchema = zod.z.object({
|
|
|
6425
6425
|
tags: zod.z.array(zod.z.string().max(200)).max(100).transform((list) => parseSitePresetTags(list))
|
|
6426
6426
|
});
|
|
6427
6427
|
|
|
6428
|
+
// src/logic/registry-org-type.ts
|
|
6429
|
+
var ROR_TYPE_PRIORITY = [
|
|
6430
|
+
["healthcare", "healthcare_provider"],
|
|
6431
|
+
["education", "educational"],
|
|
6432
|
+
["facility", "research_institute"],
|
|
6433
|
+
["government", "government"],
|
|
6434
|
+
["nonprofit", "nonprofit"],
|
|
6435
|
+
["company", "company"]
|
|
6436
|
+
];
|
|
6437
|
+
function orgTypeFromRorTypes(types) {
|
|
6438
|
+
if (!types || types.length === 0) return null;
|
|
6439
|
+
const lower = new Set(types.map((t) => t.toLowerCase()));
|
|
6440
|
+
for (const [rorType, orgType] of ROR_TYPE_PRIORITY) {
|
|
6441
|
+
if (lower.has(rorType)) return orgType;
|
|
6442
|
+
}
|
|
6443
|
+
return null;
|
|
6444
|
+
}
|
|
6445
|
+
var WIKIDATA_ORG_TYPE_CLASSES = [
|
|
6446
|
+
// hospital, clinic
|
|
6447
|
+
{ orgType: "healthcare_provider", qids: ["Q16917", "Q1774898"] },
|
|
6448
|
+
// higher education institution, university, school
|
|
6449
|
+
{ orgType: "educational", qids: ["Q38723", "Q3918", "Q3914"] },
|
|
6450
|
+
// research institute
|
|
6451
|
+
{ orgType: "research_institute", qids: ["Q31855"] },
|
|
6452
|
+
// government agency, intergovernmental organization
|
|
6453
|
+
{ orgType: "government", qids: ["Q327333", "Q245065"] },
|
|
6454
|
+
// political party
|
|
6455
|
+
{ orgType: "political", qids: ["Q7278"] },
|
|
6456
|
+
// religious organization
|
|
6457
|
+
{ orgType: "religious", qids: ["Q1530022"] },
|
|
6458
|
+
// cooperative
|
|
6459
|
+
{ orgType: "cooperative", qids: ["Q4539"] },
|
|
6460
|
+
// labor union, professional or trade association
|
|
6461
|
+
{ orgType: "professional_association", qids: ["Q178790", "Q1391517"] },
|
|
6462
|
+
// foundation
|
|
6463
|
+
{ orgType: "foundation", qids: ["Q157031"] },
|
|
6464
|
+
// nonprofit organization
|
|
6465
|
+
{ orgType: "nonprofit", qids: ["Q163740"] },
|
|
6466
|
+
// business, company
|
|
6467
|
+
{ orgType: "company", qids: ["Q4830453", "Q783794"] }
|
|
6468
|
+
];
|
|
6469
|
+
var WIKIDATA_ORG_TYPE_CLASS_QIDS = WIKIDATA_ORG_TYPE_CLASSES.flatMap(
|
|
6470
|
+
(c) => c.qids
|
|
6471
|
+
);
|
|
6472
|
+
function orgTypeFromWikidataClasses(matchedQids) {
|
|
6473
|
+
const matched = new Set(matchedQids);
|
|
6474
|
+
for (const { orgType, qids } of WIKIDATA_ORG_TYPE_CLASSES) {
|
|
6475
|
+
if (qids.some((q) => matched.has(q))) return orgType;
|
|
6476
|
+
}
|
|
6477
|
+
return null;
|
|
6478
|
+
}
|
|
6479
|
+
|
|
6428
6480
|
// src/profile/range-sort.ts
|
|
6429
6481
|
var hasValue = (date) => !!date;
|
|
6430
6482
|
function sortByActiveDateRange(items) {
|
|
@@ -7696,7 +7748,7 @@ function describeSifaRecord(collection, value) {
|
|
|
7696
7748
|
}
|
|
7697
7749
|
|
|
7698
7750
|
// src/index.ts
|
|
7699
|
-
var SIFA_SDK_VERSION = "0.19.
|
|
7751
|
+
var SIFA_SDK_VERSION = "0.19.102";
|
|
7700
7752
|
|
|
7701
7753
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
7702
7754
|
exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
|
|
@@ -7832,6 +7884,8 @@ exports.STREAM_VERBS = STREAM_VERBS;
|
|
|
7832
7884
|
exports.SifaFeedItemSchema = SifaFeedItemSchema;
|
|
7833
7885
|
exports.VERIFICATION_METHOD_TOKENS = VERIFICATION_METHOD_TOKENS;
|
|
7834
7886
|
exports.VERIFICATION_PROVIDERS = VERIFICATION_PROVIDERS;
|
|
7887
|
+
exports.WIKIDATA_ORG_TYPE_CLASSES = WIKIDATA_ORG_TYPE_CLASSES;
|
|
7888
|
+
exports.WIKIDATA_ORG_TYPE_CLASS_QIDS = WIKIDATA_ORG_TYPE_CLASS_QIDS;
|
|
7835
7889
|
exports.WORKPLACE_TYPE_LABELS = WORKPLACE_TYPE_LABELS;
|
|
7836
7890
|
exports.WORKPLACE_TYPE_OPTIONS = WORKPLACE_TYPE_OPTIONS;
|
|
7837
7891
|
exports.actorShowsIdentity = actorShowsIdentity;
|
|
@@ -7976,6 +8030,8 @@ exports.normalizeWorkplaceTypes = normalizeWorkplaceTypes;
|
|
|
7976
8030
|
exports.openAlexWorkUrl = openAlexWorkUrl;
|
|
7977
8031
|
exports.openToTokenToValue = openToTokenToValue;
|
|
7978
8032
|
exports.openToValueToToken = openToValueToToken;
|
|
8033
|
+
exports.orgTypeFromRorTypes = orgTypeFromRorTypes;
|
|
8034
|
+
exports.orgTypeFromWikidataClasses = orgTypeFromWikidataClasses;
|
|
7979
8035
|
exports.parseEndorsementComment = parseEndorsementComment;
|
|
7980
8036
|
exports.parseIntendedAudiences = parseIntendedAudiences;
|
|
7981
8037
|
exports.parseLocationString = parseLocationString;
|