@singi-labs/sifa-sdk 0.19.74 → 0.19.75

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 (48) hide show
  1. package/dist/index.cjs +63 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +3 -3
  4. package/dist/index.d.ts +3 -3
  5. package/dist/index.js +25 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/logic/index.js +26 -0
  8. package/dist/logic/index.js.map +1 -1
  9. package/dist/logic/site-activity-preset.js +68 -0
  10. package/dist/logic/site-activity-preset.js.map +1 -0
  11. package/dist/{network-map-DIUQSB0r.d.ts → network-map-73EK_ow8.d.ts} +2 -2
  12. package/dist/{network-map-BRBzAHrT.d.cts → network-map-DPt0o-vA.d.cts} +2 -2
  13. package/dist/{org-A9Tz-Uv9.d.cts → org-Bb1cRhJu.d.cts} +63 -3
  14. package/dist/{org-Spq8yU-B.d.ts → org-aUopODEW.d.ts} +63 -3
  15. package/dist/{profile-summary-6GySSJvO.d.ts → profile-summary-8TYJWh1y.d.ts} +1 -1
  16. package/dist/{profile-summary-X4MGExfS.d.cts → profile-summary-CaPVQo_x.d.cts} +1 -1
  17. package/dist/query/fetchers/activity-preferences.js +43 -0
  18. package/dist/query/fetchers/activity-preferences.js.map +1 -0
  19. package/dist/query/fetchers/activity.js +3 -0
  20. package/dist/query/fetchers/activity.js.map +1 -1
  21. package/dist/query/fetchers/index.cjs +43 -1
  22. package/dist/query/fetchers/index.cjs.map +1 -1
  23. package/dist/query/fetchers/index.d.cts +5 -5
  24. package/dist/query/fetchers/index.d.ts +5 -5
  25. package/dist/query/fetchers/index.js +8 -0
  26. package/dist/query/fetchers/index.js.map +1 -1
  27. package/dist/query/hooks/index.cjs +76 -1
  28. package/dist/query/hooks/index.cjs.map +1 -1
  29. package/dist/query/hooks/index.d.cts +3 -3
  30. package/dist/query/hooks/index.d.ts +3 -3
  31. package/dist/query/hooks/index.js +8 -0
  32. package/dist/query/hooks/index.js.map +1 -1
  33. package/dist/query/hooks/use-activity-preferences.js +53 -0
  34. package/dist/query/hooks/use-activity-preferences.js.map +1 -0
  35. package/dist/query/hooks/use-activity.js.map +1 -1
  36. package/dist/query/index.cjs +77 -1
  37. package/dist/query/index.cjs.map +1 -1
  38. package/dist/query/index.d.cts +8 -8
  39. package/dist/query/index.d.ts +8 -8
  40. package/dist/query/index.js +16 -0
  41. package/dist/query/index.js.map +1 -1
  42. package/dist/query/keys.js +4 -1
  43. package/dist/query/keys.js.map +1 -1
  44. package/dist/{types-DXep6553.d.cts → types-BY3qFPDf.d.cts} +67 -1
  45. package/dist/{types-DxMMqOJo.d.ts → types-Dl-uk0Ds.d.ts} +67 -1
  46. package/dist/{use-org-notification-emails-CfDfHwBl.d.ts → use-org-notification-emails-ObFoUWP3.d.ts} +11 -4
  47. package/dist/{use-org-notification-emails-5V3ZAlRd.d.cts → use-org-notification-emails-u0AQu9Ez.d.cts} +11 -4
  48. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -5980,6 +5980,56 @@ function excludeSelfApp(apps) {
5980
5980
  function actorShowsIdentity(actor) {
5981
5981
  return !!(actor.confirmed || actor.claimed);
5982
5982
  }
5983
+ var SITE_PRESET_MAX_TAGS = 20;
5984
+ var SITE_PRESET_MAX_TAG_LENGTH = 64;
5985
+ var siteActivityPresetSchema = zod.z.object({
5986
+ categories: zod.z.array(zod.z.string().min(1).max(100)).max(100),
5987
+ tags: zod.z.array(zod.z.string().min(1).max(SITE_PRESET_MAX_TAG_LENGTH)).max(SITE_PRESET_MAX_TAGS)
5988
+ });
5989
+ var EMPTY_SITE_ACTIVITY_PRESET = { categories: [], tags: [] };
5990
+ var SITE_PRESET_TAG_CATEGORY = "Articles";
5991
+ function normalizeSitePresetTag(raw) {
5992
+ const tag = raw.trim().replace(/^#+/, "").trim().replace(/\s+/g, " ").toLowerCase();
5993
+ if (tag.length === 0 || tag.length > SITE_PRESET_MAX_TAG_LENGTH) return null;
5994
+ return tag;
5995
+ }
5996
+ function parseSitePresetTags(input) {
5997
+ const parts = (typeof input === "string" ? [input] : input).flatMap((s) => s.split(/[,\n]/));
5998
+ const out = [];
5999
+ for (const part of parts) {
6000
+ const tag = normalizeSitePresetTag(part);
6001
+ if (tag && !out.includes(tag)) out.push(tag);
6002
+ if (out.length >= SITE_PRESET_MAX_TAGS) break;
6003
+ }
6004
+ return out;
6005
+ }
6006
+ function isSiteActivityPresetActive(preset) {
6007
+ return preset.categories.length > 0 || preset.tags.length > 0;
6008
+ }
6009
+ function recordTags(record) {
6010
+ if (typeof record !== "object" || record === null) return [];
6011
+ const tags = "tags" in record ? record.tags : void 0;
6012
+ if (!Array.isArray(tags)) return [];
6013
+ const out = [];
6014
+ for (const t of tags) {
6015
+ if (typeof t !== "string") continue;
6016
+ const tag = normalizeSitePresetTag(t);
6017
+ if (tag) out.push(tag);
6018
+ }
6019
+ return out;
6020
+ }
6021
+ function matchesSitePresetTags(item, tags) {
6022
+ if (tags.length === 0 || item.category !== SITE_PRESET_TAG_CATEGORY) return true;
6023
+ return recordTags(item.record).some((t) => tags.includes(t));
6024
+ }
6025
+ function matchesSiteActivityPreset(item, preset) {
6026
+ if (preset.categories.length > 0 && !preset.categories.includes(item.category)) return false;
6027
+ return matchesSitePresetTags(item, preset.tags);
6028
+ }
6029
+ var siteActivityPresetUpdateSchema = zod.z.object({
6030
+ categories: zod.z.array(zod.z.string().refine(isAppCategory, { message: "Unknown category" })).max(100).transform((list) => [...new Set(list)]),
6031
+ tags: zod.z.array(zod.z.string().max(200)).max(100).transform((list) => parseSitePresetTags(list))
6032
+ });
5983
6033
 
5984
6034
  // src/profile/range-sort.ts
5985
6035
  var hasValue = (date) => !!date;
@@ -7250,7 +7300,7 @@ function describeSifaRecord(collection, value) {
7250
7300
  }
7251
7301
 
7252
7302
  // src/index.ts
7253
- var SIFA_SDK_VERSION = "0.19.74";
7303
+ var SIFA_SDK_VERSION = "0.19.75";
7254
7304
 
7255
7305
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
7256
7306
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
@@ -7288,6 +7338,7 @@ exports.DIMENSIONS_MAX_SCORE = DIMENSIONS_MAX_SCORE;
7288
7338
  exports.EMPLOYMENT_STATUS_TOKENS = EMPLOYMENT_STATUS_TOKENS;
7289
7339
  exports.EMPLOYMENT_TYPE_GROUPS = EMPLOYMENT_TYPE_GROUPS;
7290
7340
  exports.EMPLOYMENT_TYPE_LABELS = EMPLOYMENT_TYPE_LABELS;
7341
+ exports.EMPTY_SITE_ACTIVITY_PRESET = EMPTY_SITE_ACTIVITY_PRESET;
7291
7342
  exports.ENTITY_REF_ANCHORS = ENTITY_REF_ANCHORS;
7292
7343
  exports.EQF_LEVEL_LABELS = EQF_LEVEL_LABELS;
7293
7344
  exports.EQF_LEVEL_OPTIONS = EQF_LEVEL_OPTIONS;
@@ -7373,6 +7424,9 @@ exports.SECTION_LABELS = SECTION_LABELS;
7373
7424
  exports.SELF_APP_ID = SELF_APP_ID;
7374
7425
  exports.SIFA_REPO_GROUPS = SIFA_REPO_GROUPS;
7375
7426
  exports.SIFA_SDK_VERSION = SIFA_SDK_VERSION;
7427
+ exports.SITE_PRESET_MAX_TAGS = SITE_PRESET_MAX_TAGS;
7428
+ exports.SITE_PRESET_MAX_TAG_LENGTH = SITE_PRESET_MAX_TAG_LENGTH;
7429
+ exports.SITE_PRESET_TAG_CATEGORY = SITE_PRESET_TAG_CATEGORY;
7376
7430
  exports.SKILL_CATEGORIES = SKILL_CATEGORIES;
7377
7431
  exports.STANDARD_PUBLISHER_ID = STANDARD_PUBLISHER_ID;
7378
7432
  exports.STREAM_VERBS = STREAM_VERBS;
@@ -7492,6 +7546,7 @@ exports.isRelationalActivity = isRelationalActivity;
7492
7546
  exports.isRoleLineRedundant = isRoleLineRedundant;
7493
7547
  exports.isSectionPopulated = isSectionPopulated;
7494
7548
  exports.isSelfAuthoredRich = isSelfAuthoredRich;
7549
+ exports.isSiteActivityPresetActive = isSiteActivityPresetActive;
7495
7550
  exports.isTeachingCourse = isTeachingCourse;
7496
7551
  exports.isUpcomingStart = isUpcomingStart;
7497
7552
  exports.isValidRgbColor = isValidRgbColor;
@@ -7502,6 +7557,8 @@ exports.limitCombiningMarks = limitCombiningMarks;
7502
7557
  exports.locationSegments = locationSegments;
7503
7558
  exports.looksLikeDomain = looksLikeDomain;
7504
7559
  exports.makeGraphFollowRecordSchema = makeGraphFollowRecordSchema;
7560
+ exports.matchesSiteActivityPreset = matchesSiteActivityPreset;
7561
+ exports.matchesSitePresetTags = matchesSitePresetTags;
7505
7562
  exports.maxGraphemes = maxGraphemes;
7506
7563
  exports.meetsContrastAA = meetsContrastAA;
7507
7564
  exports.normalizeCompanyKey = normalizeCompanyKey;
@@ -7511,6 +7568,7 @@ exports.normalizeOpenTo = normalizeOpenTo;
7511
7568
  exports.normalizePlatformId = normalizePlatformId;
7512
7569
  exports.normalizePresentationMode = normalizePresentationMode;
7513
7570
  exports.normalizePresentationRole = normalizePresentationRole;
7571
+ exports.normalizeSitePresetTag = normalizeSitePresetTag;
7514
7572
  exports.normalizeSkillCategory = normalizeSkillCategory;
7515
7573
  exports.normalizeWorkplaceTypes = normalizeWorkplaceTypes;
7516
7574
  exports.openToTokenToValue = openToTokenToValue;
@@ -7519,6 +7577,7 @@ exports.parseEndorsementComment = parseEndorsementComment;
7519
7577
  exports.parseIntendedAudiences = parseIntendedAudiences;
7520
7578
  exports.parseLocationString = parseLocationString;
7521
7579
  exports.parsePresentationDuration = parsePresentationDuration;
7580
+ exports.parseSitePresetTags = parseSitePresetTags;
7522
7581
  exports.parseTalkRkey = parseTalkRkey;
7523
7582
  exports.partialDateSchema = partialDateSchema;
7524
7583
  exports.pdsProviderFromApi = pdsProviderFromApi;
@@ -7530,6 +7589,7 @@ exports.primaryVerification = primaryVerification;
7530
7589
  exports.profileToDimensionInputs = profileToDimensionInputs;
7531
7590
  exports.qualifiesAsOrg = qualifiesAsOrg;
7532
7591
  exports.readEqfLevel = readEqfLevel;
7592
+ exports.recordTags = recordTags;
7533
7593
  exports.relativeLuminance = relativeLuminance;
7534
7594
  exports.renderAsLine = renderAsLine;
7535
7595
  exports.rendersCompanyProfile = rendersCompanyProfile;
@@ -7550,6 +7610,8 @@ exports.searchResultDisambiguation = searchResultDisambiguation;
7550
7610
  exports.selfLabelsSchema = selfLabelsSchema;
7551
7611
  exports.shouldRenderHighlights = shouldRenderHighlights;
7552
7612
  exports.singleDateExtractor = singleDateExtractor;
7613
+ exports.siteActivityPresetSchema = siteActivityPresetSchema;
7614
+ exports.siteActivityPresetUpdateSchema = siteActivityPresetUpdateSchema;
7553
7615
  exports.skillRefSchema = skillRefSchema;
7554
7616
  exports.slugifyTitle = slugifyTitle;
7555
7617
  exports.sortByActiveDateRange = sortByActiveDateRange;