@singi-labs/sifa-sdk 0.21.0 → 0.23.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.
Files changed (87) hide show
  1. package/dist/{follow-profile-CgLLLQtJ.d.cts → follow-profile-BG_6eZwW.d.cts} +1 -1
  2. package/dist/{follow-profile-CVcA2w1v.d.ts → follow-profile-DGZzB5iM.d.ts} +1 -1
  3. package/dist/{index-BQAKeEoj.d.cts → index-BKvI1Bvg.d.cts} +1 -1
  4. package/dist/{index-DDh2RLvx.d.ts → index-BR8LDBo1.d.ts} +1 -1
  5. package/dist/index.cjs +35 -7
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +11 -11
  8. package/dist/index.d.ts +11 -11
  9. package/dist/index.js +3 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/jsonld/index.d.cts +2 -2
  12. package/dist/jsonld/index.d.ts +2 -2
  13. package/dist/{network-map-2OKh3wSB.d.ts → network-map-CMyjk6jc.d.ts} +4 -4
  14. package/dist/{network-map-DJonNOl0.d.cts → network-map-CqLYThmY.d.cts} +4 -4
  15. package/dist/{org-settings-BShvhyFp.d.ts → org-settings-BliQdqbB.d.cts} +57 -1
  16. package/dist/{profile-investment-QSwX2GL5.d.cts → profile-investment-BmuXFlZw.d.cts} +2 -0
  17. package/dist/{profile-investment-QSwX2GL5.d.ts → profile-investment-BmuXFlZw.d.ts} +2 -0
  18. package/dist/{org-settings-C73Sin5E.d.cts → profile-self-D59D_rhI.d.ts} +57 -1
  19. package/dist/{profile-summary-BCOKt3qS.d.cts → profile-summary-CoTNGDpt.d.cts} +1 -1
  20. package/dist/{profile-summary-DF8-evvA.d.ts → profile-summary-Sv6rqQbx.d.ts} +1 -1
  21. package/dist/publishing/index.cjs +21 -1
  22. package/dist/publishing/index.cjs.map +1 -1
  23. package/dist/query/fetchers/index.cjs +21 -1
  24. package/dist/query/fetchers/index.cjs.map +1 -1
  25. package/dist/query/fetchers/index.d.cts +9 -9
  26. package/dist/query/fetchers/index.d.ts +9 -9
  27. package/dist/query/fetchers/profile-mutations.js.map +1 -1
  28. package/dist/query/hooks/index.cjs +21 -1
  29. package/dist/query/hooks/index.cjs.map +1 -1
  30. package/dist/query/hooks/index.d.cts +7 -7
  31. package/dist/query/hooks/index.d.ts +7 -7
  32. package/dist/query/index.cjs.map +1 -1
  33. package/dist/query/index.d.cts +12 -12
  34. package/dist/query/index.d.ts +12 -12
  35. package/dist/resume/index.d.cts +2 -2
  36. package/dist/resume/index.d.ts +2 -2
  37. package/dist/schemas/index.cjs +29 -6
  38. package/dist/schemas/index.cjs.map +1 -1
  39. package/dist/schemas/index.d.cts +3 -3
  40. package/dist/schemas/index.d.ts +3 -3
  41. package/dist/schemas/index.js +2 -0
  42. package/dist/schemas/index.js.map +1 -1
  43. package/dist/schemas/profile-self.js +18 -6
  44. package/dist/schemas/profile-self.js.map +1 -1
  45. package/dist/schemas/shared.js +28 -1
  46. package/dist/schemas/shared.js.map +1 -1
  47. package/dist/schemas/write/certification.js +3 -3
  48. package/dist/schemas/write/certification.js.map +1 -1
  49. package/dist/schemas/write/course.js +5 -10
  50. package/dist/schemas/write/course.js.map +1 -1
  51. package/dist/schemas/write/education.js +3 -3
  52. package/dist/schemas/write/education.js.map +1 -1
  53. package/dist/schemas/write/honor.js +2 -2
  54. package/dist/schemas/write/honor.js.map +1 -1
  55. package/dist/schemas/write/index.cjs +58 -32
  56. package/dist/schemas/write/index.cjs.map +1 -1
  57. package/dist/schemas/write/index.d.cts +21 -64
  58. package/dist/schemas/write/index.d.ts +21 -64
  59. package/dist/schemas/write/index.js +5 -1
  60. package/dist/schemas/write/index.js.map +1 -1
  61. package/dist/schemas/write/investment.js +3 -3
  62. package/dist/schemas/write/investment.js.map +1 -1
  63. package/dist/schemas/write/involvement.js +3 -3
  64. package/dist/schemas/write/involvement.js.map +1 -1
  65. package/dist/schemas/write/position.js +8 -3
  66. package/dist/schemas/write/position.js.map +1 -1
  67. package/dist/schemas/write/profile-self.js +19 -5
  68. package/dist/schemas/write/profile-self.js.map +1 -1
  69. package/dist/schemas/write/project.js +3 -3
  70. package/dist/schemas/write/project.js.map +1 -1
  71. package/dist/schemas/write/publication.js +2 -2
  72. package/dist/schemas/write/publication.js.map +1 -1
  73. package/dist/schemas/write/shared.js +6 -0
  74. package/dist/schemas/write/shared.js.map +1 -1
  75. package/dist/schemas/write/volunteering.js +3 -3
  76. package/dist/schemas/write/volunteering.js.map +1 -1
  77. package/dist/testing/index.d.cts +2 -2
  78. package/dist/testing/index.d.ts +2 -2
  79. package/dist/{types-JydVIhN5.d.cts → types-BC4A9-W9.d.cts} +2 -2
  80. package/dist/{types-CkomzDlY.d.ts → types-CcVRIHcX.d.ts} +2 -2
  81. package/dist/{use-user-settings-DQ6Dyby7.d.ts → use-user-settings-CI9eZQpp.d.ts} +11 -6
  82. package/dist/{use-user-settings-Bn6g8bgr.d.cts → use-user-settings-CfQKSBAC.d.cts} +11 -6
  83. package/dist/{user-settings-BdNrDa9O.d.ts → user-settings-BVFxLAOa.d.cts} +6 -11
  84. package/dist/{user-settings-C8JUD4DM.d.cts → user-settings-C65eFsPR.d.ts} +6 -11
  85. package/dist/{verification-providers-DeyGqaoC.d.cts → verification-providers-DQLIOSCK.d.cts} +7 -1
  86. package/dist/{verification-providers-DeyGqaoC.d.ts → verification-providers-DQLIOSCK.d.ts} +7 -1
  87. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { a as AccountVerification } from './verification-providers-DeyGqaoC.cjs';
2
+ import { a as AccountVerification } from './verification-providers-DQLIOSCK.cjs';
3
3
 
4
4
  /**
5
5
  * A single typeahead row. Discriminated on `source`: a curated `entity` row
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { a as AccountVerification } from './verification-providers-DeyGqaoC.js';
2
+ import { a as AccountVerification } from './verification-providers-DQLIOSCK.js';
3
3
 
4
4
  /**
5
5
  * A single typeahead row. Discriminated on `source`: a curated `entity` row
@@ -1,4 +1,4 @@
1
- import { A as AgentRef, a as AccountVerification } from './verification-providers-DeyGqaoC.cjs';
1
+ import { A as AgentRef, a as AccountVerification } from './verification-providers-DQLIOSCK.cjs';
2
2
 
3
3
  interface LocationValue {
4
4
  city?: string;
@@ -1,4 +1,4 @@
1
- import { A as AgentRef, a as AccountVerification } from './verification-providers-DeyGqaoC.js';
1
+ import { A as AgentRef, a as AccountVerification } from './verification-providers-DQLIOSCK.js';
2
2
 
3
3
  interface LocationValue {
4
4
  city?: string;
package/dist/index.cjs CHANGED
@@ -3819,6 +3819,11 @@ function isValidPartialDate(input) {
3819
3819
  if (typeof input !== "string") return false;
3820
3820
  return PARTIAL_DATE_RE.test(input) || isValidDateOnly(input);
3821
3821
  }
3822
+ var DATETIME_DAY_RE = /^(\d{4}-\d{2}-\d{2})T\d{2}:\d{2}/;
3823
+ zod.z.string().transform((v) => DATETIME_DAY_RE.exec(v)?.[1] ?? v).refine(
3824
+ (v) => v === "" || isValidPartialDate(v),
3825
+ "must be a valid YYYY, YYYY-MM or YYYY-MM-DD date"
3826
+ ).nullable().optional();
3822
3827
  zod.z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional();
3823
3828
  zod.z.object({
3824
3829
  url: zod.z.string().max(2048).refine((v) => httpUrlOrNull(v) !== null, "must be an http(s) URL"),
@@ -3836,8 +3841,8 @@ var presentationLinkSchema = zod.z.object({
3836
3841
  type: zod.z.string().max(256).nullable().optional()
3837
3842
  });
3838
3843
  function maxGraphemes(max) {
3844
+ const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
3839
3845
  return (value) => {
3840
- const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
3841
3846
  let count = 0;
3842
3847
  for (const _ of segmenter.segment(value)) {
3843
3848
  count++;
@@ -3846,6 +3851,26 @@ function maxGraphemes(max) {
3846
3851
  return true;
3847
3852
  };
3848
3853
  }
3854
+ function maxBytes(max) {
3855
+ const encoder = new TextEncoder();
3856
+ return (value) => {
3857
+ if (value.length * 3 <= max) return true;
3858
+ return encoder.encode(value).length <= max;
3859
+ };
3860
+ }
3861
+ function lexiconString(graphemes, bytes) {
3862
+ return zod.z.string().refine(maxGraphemes(graphemes), {
3863
+ message: `Must be at most ${graphemes} characters`,
3864
+ abort: true
3865
+ }).refine(maxBytes(bytes), {
3866
+ message: "This text is too long. Emoji and some scripts take more space, so shorten it a little."
3867
+ });
3868
+ }
3869
+ var profileDisplayNameSchema = lexiconString(64, 640);
3870
+ var profileNameSchema = lexiconString(64, 640);
3871
+ var profilePronounsSchema = lexiconString(20, 200);
3872
+ var profileHeadlineSchema = lexiconString(120, 1200);
3873
+ var profileAboutSchema = lexiconString(5e3, 5e4);
3849
3874
  var didSchema = zod.z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, "Invalid DID");
3850
3875
  var datetimeSchema = zod.z.string().datetime({ offset: true });
3851
3876
  var partialDateSchema = zod.z.string().regex(/^\d{4}(-\d{2}(-\d{2}(T.+)?)?)?$/, "Expected YYYY, YYYY-MM, YYYY-MM-DD, or a datetime");
@@ -7680,12 +7705,14 @@ var ProfilePublicationRecordSchema = zod.z.object({
7680
7705
  createdAt: datetimeSchema
7681
7706
  });
7682
7707
  var ProfileSelfRecordSchema = zod.z.object({
7683
- headline: zod.z.string().refine(maxGraphemes(120)).max(1200).optional(),
7684
- about: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
7708
+ displayName: profileDisplayNameSchema.optional(),
7709
+ pronouns: profilePronounsSchema.optional(),
7710
+ headline: profileHeadlineSchema.optional(),
7711
+ about: profileAboutSchema.optional(),
7685
7712
  industry: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
7686
- givenName: zod.z.string().refine(maxGraphemes(64)).max(640).optional(),
7687
- familyName: zod.z.string().refine(maxGraphemes(64)).max(640).optional(),
7688
- namePronunciation: zod.z.string().refine(maxGraphemes(64)).max(640).optional(),
7713
+ givenName: profileNameSchema.optional(),
7714
+ familyName: profileNameSchema.optional(),
7715
+ namePronunciation: profileNameSchema.optional(),
7689
7716
  location: zod.z.unknown().optional(),
7690
7717
  openTo: zod.z.array(zod.z.string()).max(10).optional(),
7691
7718
  preferredWorkplace: zod.z.array(zod.z.string()).max(3).optional(),
@@ -8005,7 +8032,7 @@ function describeSifaRecord(collection, value) {
8005
8032
  }
8006
8033
 
8007
8034
  // src/index.ts
8008
- var SIFA_SDK_VERSION = "0.21.0";
8035
+ var SIFA_SDK_VERSION = "0.23.0";
8009
8036
 
8010
8037
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
8011
8038
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
@@ -8280,6 +8307,7 @@ exports.looksLikeDomain = looksLikeDomain;
8280
8307
  exports.makeGraphFollowRecordSchema = makeGraphFollowRecordSchema;
8281
8308
  exports.matchesSiteActivityPreset = matchesSiteActivityPreset;
8282
8309
  exports.matchesSitePresetTags = matchesSitePresetTags;
8310
+ exports.maxBytes = maxBytes;
8283
8311
  exports.maxGraphemes = maxGraphemes;
8284
8312
  exports.meetsContrastAA = meetsContrastAA;
8285
8313
  exports.normalizeCompanyKey = normalizeCompanyKey;