@singi-labs/sifa-sdk 0.7.4 → 0.7.6

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/README.md CHANGED
@@ -64,7 +64,7 @@ import { colors, spacing } from '@singi-labs/sifa-sdk/tokens';
64
64
 
65
65
  This SDK is the recommended way to build clients against the Sifa AppView. It does not depend on `react-dom`, `react-native`, `next`, or any browser/Node-only storage API -- it runs anywhere TypeScript runs.
66
66
 
67
- If you have a use case the current public surface does not cover, open a discussion on [`singi-labs/sifa-workspace`](https://github.com/singi-labs/sifa-workspace/discussions).
67
+ If you have a use case the current public surface does not cover, open an issue on [`singi-labs/sifa-workspace`](https://github.com/singi-labs/sifa-workspace/issues).
68
68
 
69
69
  ---
70
70
 
@@ -103,7 +103,7 @@ All changes go through Pull Requests. CI must pass before merge.
103
103
  ## Community
104
104
 
105
105
  - **Website:** [sifa.id](https://sifa.id)
106
- - **Discussions:** [GitHub Discussions](https://github.com/singi-labs/sifa-workspace/discussions)
106
+ - **Bluesky:** [@sifa.id](https://bsky.app/profile/sifa.id)
107
107
  - **Issues:** [Report bugs](https://github.com/singi-labs/sifa-sdk/issues)
108
108
 
109
109
  ---
@@ -219,6 +219,31 @@ interface Profile {
219
219
  industries?: ProfileIndustry[];
220
220
  location?: LocationValue | null;
221
221
  locations?: ProfileLocation[];
222
+ /**
223
+ * @deprecated Flat location field emitted at the response root during the
224
+ * additive response window for `community.lexicon.location.address`.
225
+ * Prefer the structured `locations[]` array (use the entry where
226
+ * `isPrimary` is true).
227
+ */
228
+ locationCountry?: string | null;
229
+ /**
230
+ * @deprecated See `locationCountry`. Prefer `locations[].locationRegion`.
231
+ */
232
+ locationRegion?: string | null;
233
+ /**
234
+ * @deprecated Legacy alias for `locationLocality`; emitted alongside it
235
+ * during the additive response window. Prefer `locations[].locationLocality`.
236
+ */
237
+ locationCity?: string | null;
238
+ /**
239
+ * @deprecated community.lexicon.location.address field name. Prefer
240
+ * `locations[].locationLocality`.
241
+ */
242
+ locationLocality?: string | null;
243
+ /**
244
+ * @deprecated See `locationCountry`. Prefer `locations[].countryCode`.
245
+ */
246
+ countryCode?: string | null;
222
247
  website?: string;
223
248
  openTo?: string[];
224
249
  preferredWorkplace?: string[];
@@ -219,6 +219,31 @@ interface Profile {
219
219
  industries?: ProfileIndustry[];
220
220
  location?: LocationValue | null;
221
221
  locations?: ProfileLocation[];
222
+ /**
223
+ * @deprecated Flat location field emitted at the response root during the
224
+ * additive response window for `community.lexicon.location.address`.
225
+ * Prefer the structured `locations[]` array (use the entry where
226
+ * `isPrimary` is true).
227
+ */
228
+ locationCountry?: string | null;
229
+ /**
230
+ * @deprecated See `locationCountry`. Prefer `locations[].locationRegion`.
231
+ */
232
+ locationRegion?: string | null;
233
+ /**
234
+ * @deprecated Legacy alias for `locationLocality`; emitted alongside it
235
+ * during the additive response window. Prefer `locations[].locationLocality`.
236
+ */
237
+ locationCity?: string | null;
238
+ /**
239
+ * @deprecated community.lexicon.location.address field name. Prefer
240
+ * `locations[].locationLocality`.
241
+ */
242
+ locationLocality?: string | null;
243
+ /**
244
+ * @deprecated See `locationCountry`. Prefer `locations[].countryCode`.
245
+ */
246
+ countryCode?: string | null;
222
247
  website?: string;
223
248
  openTo?: string[];
224
249
  preferredWorkplace?: string[];
package/dist/index.cjs CHANGED
@@ -928,6 +928,22 @@ function contrastRatio(color1, color2) {
928
928
  function meetsContrastAA(foreground, background) {
929
929
  return contrastRatio(foreground, background) >= 4.5;
930
930
  }
931
+
932
+ // src/logic/profile-completeness.ts
933
+ var COMPLETENESS_MAX_SCORE = 6;
934
+ function completenessScore(c) {
935
+ let filled = 0;
936
+ if (c.hasHeadline) filled++;
937
+ if (c.hasAbout) filled++;
938
+ if (c.positionCount > 0) filled++;
939
+ if (c.educationCount > 0) filled++;
940
+ if (c.skillCount > 0) filled++;
941
+ if (c.certificationCount > 0) filled++;
942
+ return filled;
943
+ }
944
+ function completenessPercent(c) {
945
+ return Math.round(completenessScore(c) / COMPLETENESS_MAX_SCORE * 100);
946
+ }
931
947
  function maxGraphemes(max) {
932
948
  return (value) => {
933
949
  const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
@@ -1088,10 +1104,11 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
1088
1104
  });
1089
1105
 
1090
1106
  // src/index.ts
1091
- var SIFA_SDK_VERSION = "0.7.4";
1107
+ var SIFA_SDK_VERSION = "0.7.6";
1092
1108
 
1093
1109
  exports.CATEGORY_LABELS = CATEGORY_LABELS;
1094
1110
  exports.CATEGORY_ORDER = CATEGORY_ORDER;
1111
+ exports.COMPLETENESS_MAX_SCORE = COMPLETENESS_MAX_SCORE;
1095
1112
  exports.CONTINENTS = CONTINENTS;
1096
1113
  exports.COUNTRIES = COUNTRIES;
1097
1114
  exports.EndorsementConfirmationRecordSchema = EndorsementConfirmationRecordSchema;
@@ -1118,6 +1135,8 @@ exports.SKILL_CATEGORIES = SKILL_CATEGORIES;
1118
1135
  exports.atUriSchema = atUriSchema;
1119
1136
  exports.certDateExtractor = certDateExtractor;
1120
1137
  exports.cidSchema = cidSchema;
1138
+ exports.completenessPercent = completenessPercent;
1139
+ exports.completenessScore = completenessScore;
1121
1140
  exports.contrastRatio = contrastRatio;
1122
1141
  exports.countryCodeToFlag = countryCodeToFlag;
1123
1142
  exports.dateRangeExtractor = dateRangeExtractor;