@singi-labs/sifa-sdk 0.11.31 → 0.12.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/dist/index.cjs +83 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -2
- package/dist/index.d.ts +73 -2
- package/dist/index.js +78 -33
- package/dist/index.js.map +1 -1
- package/dist/publishing/index.cjs +1 -0
- package/dist/publishing/index.cjs.map +1 -1
- package/dist/publishing/index.js +1 -0
- package/dist/publishing/index.js.map +1 -1
- package/dist/schemas/index.cjs +15 -31
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +11 -1
- package/dist/schemas/index.d.ts +11 -1
- package/dist/schemas/index.js +15 -32
- package/dist/schemas/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1481,6 +1481,68 @@ function getArtifactLinkKindLabel(value) {
|
|
|
1481
1481
|
return ARTIFACT_LINK_KIND_LABELS[value] ?? value;
|
|
1482
1482
|
}
|
|
1483
1483
|
|
|
1484
|
+
// src/taxonomy/verification-providers.ts
|
|
1485
|
+
var MU_VERIFIER_DIDS = [
|
|
1486
|
+
"did:plc:ooensn4mr5mhznzypvxelfa3",
|
|
1487
|
+
// eurosky.social -- coordinates the trusted-verifier program
|
|
1488
|
+
"did:plc:durcipmx2rwgzzagbiumobs5",
|
|
1489
|
+
// france-atmosphe.re
|
|
1490
|
+
"did:plc:zsf5p7rqilz2qvyd7ezmxrfj",
|
|
1491
|
+
// belgium-atmosphe.re
|
|
1492
|
+
"did:plc:hd564mpf6bekrwzyhvujs54b",
|
|
1493
|
+
// medsky.network
|
|
1494
|
+
"did:plc:u5zp7npt5kpueado77kuihyz",
|
|
1495
|
+
// npmx.dev
|
|
1496
|
+
"did:plc:6tndl5lqrzjrx7ahjom2gjbq",
|
|
1497
|
+
// stewardshiplab.org
|
|
1498
|
+
"did:plc:vnycpb2e4lh4tc7oyr3n2jvh",
|
|
1499
|
+
// newsmastfoundation.org
|
|
1500
|
+
"did:plc:dsiqe4pszk5ldbjk66fyryjv"
|
|
1501
|
+
// cpesr.fr
|
|
1502
|
+
];
|
|
1503
|
+
var VERIFICATION_PROVIDERS = {
|
|
1504
|
+
bluesky: {
|
|
1505
|
+
id: "bluesky",
|
|
1506
|
+
label: "Bluesky",
|
|
1507
|
+
priority: 0,
|
|
1508
|
+
source: "bluesky-api",
|
|
1509
|
+
verifierDids: []
|
|
1510
|
+
},
|
|
1511
|
+
mu: {
|
|
1512
|
+
id: "mu",
|
|
1513
|
+
label: "mu (Eurosky)",
|
|
1514
|
+
priority: 1,
|
|
1515
|
+
source: "firehose",
|
|
1516
|
+
verifierDids: MU_VERIFIER_DIDS
|
|
1517
|
+
}
|
|
1518
|
+
};
|
|
1519
|
+
function isKnownVerificationProvider(id) {
|
|
1520
|
+
return Object.hasOwn(VERIFICATION_PROVIDERS, id);
|
|
1521
|
+
}
|
|
1522
|
+
function getVerificationProvider(id) {
|
|
1523
|
+
return isKnownVerificationProvider(id) ? VERIFICATION_PROVIDERS[id] : void 0;
|
|
1524
|
+
}
|
|
1525
|
+
function resolveVerifierProvider(issuerDid) {
|
|
1526
|
+
for (const provider of Object.values(VERIFICATION_PROVIDERS)) {
|
|
1527
|
+
if (provider.source !== "firehose") continue;
|
|
1528
|
+
if (provider.verifierDids.includes(issuerDid)) return provider.id;
|
|
1529
|
+
}
|
|
1530
|
+
return null;
|
|
1531
|
+
}
|
|
1532
|
+
function primaryVerification(verifications) {
|
|
1533
|
+
let best = null;
|
|
1534
|
+
let bestPriority = Number.POSITIVE_INFINITY;
|
|
1535
|
+
for (const verification of verifications) {
|
|
1536
|
+
const provider = getVerificationProvider(verification.provider);
|
|
1537
|
+
if (!provider) continue;
|
|
1538
|
+
if (provider.priority < bestPriority) {
|
|
1539
|
+
best = verification;
|
|
1540
|
+
bestPriority = provider.priority;
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
return best;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1484
1546
|
// src/format/company-name.ts
|
|
1485
1547
|
var SMALL_WORDS = /* @__PURE__ */ new Set([
|
|
1486
1548
|
"a",
|
|
@@ -2719,6 +2781,7 @@ function maxGraphemes(max) {
|
|
|
2719
2781
|
}
|
|
2720
2782
|
var didSchema = zod.z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, "Invalid DID");
|
|
2721
2783
|
var datetimeSchema = zod.z.string().datetime({ offset: true });
|
|
2784
|
+
var partialDateSchema = zod.z.string().regex(/^\d{4}(-\d{2}(-\d{2}(T.+)?)?)?$/, "Expected YYYY, YYYY-MM, YYYY-MM-DD, or a datetime");
|
|
2722
2785
|
var atUriSchema = zod.z.string().regex(/^at:\/\/[^\s]+$/, "Invalid AT-URI");
|
|
2723
2786
|
var cidSchema = zod.z.string().regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, "Invalid CID");
|
|
2724
2787
|
var languageTagSchema = zod.z.string().regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, "Invalid BCP 47 language tag");
|
|
@@ -2903,10 +2966,8 @@ var ProfileCertificationRecordSchema = zod.z.object({
|
|
|
2903
2966
|
entityRef: zod.z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional(),
|
|
2904
2967
|
credentialId: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
2905
2968
|
credentialUrl: uriSchema.optional(),
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
issuedAt: zod.z.string().optional(),
|
|
2909
|
-
expiresAt: zod.z.string().optional(),
|
|
2969
|
+
issuedAt: partialDateSchema.optional(),
|
|
2970
|
+
expiresAt: partialDateSchema.optional(),
|
|
2910
2971
|
labels: selfLabelsSchema.optional(),
|
|
2911
2972
|
createdAt: datetimeSchema
|
|
2912
2973
|
});
|
|
@@ -2921,10 +2982,7 @@ var ProfileCourseRecordSchema = zod.z.object({
|
|
|
2921
2982
|
// AT-URI of the associated id.sifa.profile.certification record. Plain
|
|
2922
2983
|
// at-uri (not a strongRef) so the link tracks the live certification.
|
|
2923
2984
|
credential: atUriSchema.optional(),
|
|
2924
|
-
|
|
2925
|
-
// datetime) so month-granularity and partial dates are accepted. See
|
|
2926
|
-
// sifa-lexicons#256.
|
|
2927
|
-
completedAt: zod.z.string().optional(),
|
|
2985
|
+
completedAt: partialDateSchema.optional(),
|
|
2928
2986
|
createdAt: datetimeSchema
|
|
2929
2987
|
});
|
|
2930
2988
|
var ProfileEducationRecordSchema = zod.z.object({
|
|
@@ -2939,10 +2997,8 @@ var ProfileEducationRecordSchema = zod.z.object({
|
|
|
2939
2997
|
activities: zod.z.string().refine(maxGraphemes(1e3)).max(1e4).optional(),
|
|
2940
2998
|
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
2941
2999
|
location: zod.z.unknown().optional(),
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
startedAt: zod.z.string().optional(),
|
|
2945
|
-
endedAt: zod.z.string().optional(),
|
|
3000
|
+
startedAt: partialDateSchema.optional(),
|
|
3001
|
+
endedAt: partialDateSchema.optional(),
|
|
2946
3002
|
labels: selfLabelsSchema.optional(),
|
|
2947
3003
|
createdAt: datetimeSchema
|
|
2948
3004
|
});
|
|
@@ -2962,13 +3018,10 @@ var ProfileHonorRecordSchema = zod.z.object({
|
|
|
2962
3018
|
// Constrained to http(s) so a script-bearing scheme is never a valid ref (#159).
|
|
2963
3019
|
entityRef: zod.z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional(),
|
|
2964
3020
|
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
2965
|
-
|
|
2966
|
-
// and LinkedIn-importer writes are accepted. See sifa-lexicons#256.
|
|
2967
|
-
awardedAt: zod.z.string().optional(),
|
|
3021
|
+
awardedAt: partialDateSchema.optional(),
|
|
2968
3022
|
createdAt: datetimeSchema
|
|
2969
3023
|
});
|
|
2970
3024
|
var PROFILE_INVOLVEMENT_NSID = "id.sifa.profile.involvement";
|
|
2971
|
-
var partialDateSchema = zod.z.string().regex(/^\d{4}(-\d{2}(-\d{2}(T.+)?)?)?$/, "Expected YYYY, YYYY-MM, YYYY-MM-DD, or a datetime");
|
|
2972
3025
|
var ArtifactLinkSchema = zod.z.object({
|
|
2973
3026
|
url: uriSchema,
|
|
2974
3027
|
kind: zod.z.string().optional(),
|
|
@@ -3010,10 +3063,8 @@ var ProfilePositionRecordSchema = zod.z.object({
|
|
|
3010
3063
|
employmentType: zod.z.string().optional(),
|
|
3011
3064
|
workplaceType: zod.z.string().optional(),
|
|
3012
3065
|
location: zod.z.unknown().optional(),
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
startedAt: zod.z.string(),
|
|
3016
|
-
endedAt: zod.z.string().optional(),
|
|
3066
|
+
startedAt: partialDateSchema,
|
|
3067
|
+
endedAt: partialDateSchema.optional(),
|
|
3017
3068
|
skills: zod.z.array(strongRefSchema).max(50).optional(),
|
|
3018
3069
|
labels: selfLabelsSchema.optional(),
|
|
3019
3070
|
createdAt: datetimeSchema
|
|
@@ -3065,10 +3116,8 @@ var ProfileProjectRecordSchema = zod.z.object({
|
|
|
3065
3116
|
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
3066
3117
|
url: uriSchema.optional(),
|
|
3067
3118
|
position: strongRefSchema.optional(),
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
startedAt: zod.z.string().optional(),
|
|
3071
|
-
endedAt: zod.z.string().optional(),
|
|
3119
|
+
startedAt: partialDateSchema.optional(),
|
|
3120
|
+
endedAt: partialDateSchema.optional(),
|
|
3072
3121
|
labels: selfLabelsSchema.optional(),
|
|
3073
3122
|
createdAt: datetimeSchema
|
|
3074
3123
|
});
|
|
@@ -3083,9 +3132,7 @@ var ProfilePublicationRecordSchema = zod.z.object({
|
|
|
3083
3132
|
url: uriSchema.optional(),
|
|
3084
3133
|
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
3085
3134
|
authors: zod.z.array(PublicationAuthorSchema).max(50).optional(),
|
|
3086
|
-
|
|
3087
|
-
// and LinkedIn-importer writes are accepted. See sifa-lexicons#256.
|
|
3088
|
-
publishedAt: zod.z.string().optional(),
|
|
3135
|
+
publishedAt: partialDateSchema.optional(),
|
|
3089
3136
|
createdAt: datetimeSchema
|
|
3090
3137
|
});
|
|
3091
3138
|
var ProfileSelfRecordSchema = zod.z.object({
|
|
@@ -3116,15 +3163,13 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
|
3116
3163
|
role: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
3117
3164
|
cause: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
3118
3165
|
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
startedAt: zod.z.string().optional(),
|
|
3122
|
-
endedAt: zod.z.string().optional(),
|
|
3166
|
+
startedAt: partialDateSchema.optional(),
|
|
3167
|
+
endedAt: partialDateSchema.optional(),
|
|
3123
3168
|
createdAt: datetimeSchema
|
|
3124
3169
|
});
|
|
3125
3170
|
|
|
3126
3171
|
// src/index.ts
|
|
3127
|
-
var SIFA_SDK_VERSION = "0.
|
|
3172
|
+
var SIFA_SDK_VERSION = "0.12.0";
|
|
3128
3173
|
|
|
3129
3174
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
3130
3175
|
exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
|
|
@@ -3207,6 +3252,7 @@ exports.SIFA_SDK_VERSION = SIFA_SDK_VERSION;
|
|
|
3207
3252
|
exports.SKILL_CATEGORIES = SKILL_CATEGORIES;
|
|
3208
3253
|
exports.STANDARD_PUBLISHER_ID = STANDARD_PUBLISHER_ID;
|
|
3209
3254
|
exports.SifaFeedItemSchema = SifaFeedItemSchema;
|
|
3255
|
+
exports.VERIFICATION_PROVIDERS = VERIFICATION_PROVIDERS;
|
|
3210
3256
|
exports.WORKPLACE_TYPE_LABELS = WORKPLACE_TYPE_LABELS;
|
|
3211
3257
|
exports.WORKPLACE_TYPE_OPTIONS = WORKPLACE_TYPE_OPTIONS;
|
|
3212
3258
|
exports.atUriSchema = atUriSchema;
|
|
@@ -3263,6 +3309,7 @@ exports.getPublisherByHost = getPublisherByHost;
|
|
|
3263
3309
|
exports.getPublisherById = getPublisherById;
|
|
3264
3310
|
exports.getPublisherFromSiteUrl = getPublisherFromSiteUrl;
|
|
3265
3311
|
exports.getTierMeta = getTierMeta;
|
|
3312
|
+
exports.getVerificationProvider = getVerificationProvider;
|
|
3266
3313
|
exports.getWorkplaceTypeLabel = getWorkplaceTypeLabel;
|
|
3267
3314
|
exports.groupSkillsByCategory = groupSkillsByCategory;
|
|
3268
3315
|
exports.hasAdultContent = hasAdultContent;
|
|
@@ -3270,6 +3317,7 @@ exports.isAppCategory = isAppCategory;
|
|
|
3270
3317
|
exports.isCompanyRequired = isCompanyRequired;
|
|
3271
3318
|
exports.isKnownAppId = isKnownAppId;
|
|
3272
3319
|
exports.isKnownPlatform = isKnownPlatform;
|
|
3320
|
+
exports.isKnownVerificationProvider = isKnownVerificationProvider;
|
|
3273
3321
|
exports.isLinked = isLinked;
|
|
3274
3322
|
exports.isPseudoEmployer = isPseudoEmployer;
|
|
3275
3323
|
exports.isValidRgbColor = isValidRgbColor;
|
|
@@ -3293,14 +3341,17 @@ exports.openToValueToToken = openToValueToToken;
|
|
|
3293
3341
|
exports.parseIntendedAudiences = parseIntendedAudiences;
|
|
3294
3342
|
exports.parseLocationString = parseLocationString;
|
|
3295
3343
|
exports.parsePresentationDuration = parsePresentationDuration;
|
|
3344
|
+
exports.partialDateSchema = partialDateSchema;
|
|
3296
3345
|
exports.pdsProviderFromApi = pdsProviderFromApi;
|
|
3297
3346
|
exports.pickPrimaryPosition = pickPrimaryPosition;
|
|
3298
3347
|
exports.presentationCsvRowToRecord = presentationCsvRowToRecord;
|
|
3299
3348
|
exports.presentationDeliveryCsvRowToRecord = presentationDeliveryCsvRowToRecord;
|
|
3349
|
+
exports.primaryVerification = primaryVerification;
|
|
3300
3350
|
exports.profileToDimensionInputs = profileToDimensionInputs;
|
|
3301
3351
|
exports.relativeLuminance = relativeLuminance;
|
|
3302
3352
|
exports.resolveCardHealth = resolveCardHealth;
|
|
3303
3353
|
exports.resolveCardUrl = resolveCardUrl;
|
|
3354
|
+
exports.resolveVerifierProvider = resolveVerifierProvider;
|
|
3304
3355
|
exports.rgbToString = rgbToString;
|
|
3305
3356
|
exports.sanitizeDisplayText = sanitizeDisplayText;
|
|
3306
3357
|
exports.sanitizeHandleInput = sanitizeHandleInput;
|