@singi-labs/sifa-sdk 0.11.1 → 0.11.3

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.
@@ -168,6 +168,10 @@ interface ProfileCourse {
168
168
  name: string;
169
169
  institution?: string;
170
170
  number?: string;
171
+ /** rkey of the associated certification, resolved from the course's
172
+ * `credential` at-uri. Used to join the course to a certification in the
173
+ * same profile payload (for the linked-credential date and link). */
174
+ credentialRkey?: string;
171
175
  hidden?: boolean;
172
176
  }
173
177
  interface TrustStat {
@@ -168,6 +168,10 @@ interface ProfileCourse {
168
168
  name: string;
169
169
  institution?: string;
170
170
  number?: string;
171
+ /** rkey of the associated certification, resolved from the course's
172
+ * `credential` at-uri. Used to join the course to a certification in the
173
+ * same profile payload (for the linked-credential date and link). */
174
+ credentialRkey?: string;
171
175
  hidden?: boolean;
172
176
  }
173
177
  interface TrustStat {
package/dist/index.cjs CHANGED
@@ -1244,6 +1244,8 @@ var activity_tiers_default = {
1244
1244
  "id.sifa.profile.language": { tier: "creation", app: "sifa" },
1245
1245
  "id.sifa.profile.externalAccount": { tier: "creation", app: "sifa" },
1246
1246
  "id.sifa.profile.location": { tier: "creation", app: "sifa" },
1247
+ "id.sifa.profile.presentation": { tier: "creation", app: "sifa" },
1248
+ "id.sifa.profile.presentationDelivery": { tier: "creation", app: "sifa" },
1247
1249
  "id.sifa.endorsement": {
1248
1250
  tier: "creation",
1249
1251
  app: "sifa",
@@ -1326,6 +1328,61 @@ function getActivityTaxonomyVersion() {
1326
1328
  return { version: ACTIVITY_TIERS.version, updated: ACTIVITY_TIERS.updated };
1327
1329
  }
1328
1330
 
1331
+ // src/taxonomy/presentation-role.ts
1332
+ var PRESENTATION_ROLE_OPTIONS = [
1333
+ { value: "id.sifa.defs#presenter", label: "Presenter" },
1334
+ { value: "id.sifa.defs#panelist", label: "Panelist" },
1335
+ { value: "id.sifa.defs#keynote", label: "Keynote" },
1336
+ { value: "id.sifa.defs#workshop", label: "Workshop" },
1337
+ { value: "id.sifa.defs#host", label: "Host" }
1338
+ ];
1339
+ var PRESENTATION_ROLE_LABELS = Object.fromEntries(
1340
+ PRESENTATION_ROLE_OPTIONS.map((o) => [o.value, o.label])
1341
+ );
1342
+ function getPresentationRoleLabel(value) {
1343
+ if (!value) return void 0;
1344
+ return PRESENTATION_ROLE_LABELS[value] ?? value;
1345
+ }
1346
+
1347
+ // src/taxonomy/presentation-link-type.ts
1348
+ var PRESENTATION_LINK_TYPE_OPTIONS = [
1349
+ { value: "id.sifa.defs#linkSlides", label: "Slides" },
1350
+ { value: "id.sifa.defs#linkRecording", label: "Recording" },
1351
+ { value: "id.sifa.defs#linkEvent", label: "Event page" },
1352
+ { value: "id.sifa.defs#linkRegistration", label: "Registration" },
1353
+ { value: "id.sifa.defs#linkWriteup", label: "Write-up" },
1354
+ { value: "id.sifa.defs#linkOther", label: "Link" }
1355
+ ];
1356
+ var PRESENTATION_LINK_TYPE_LABELS = Object.fromEntries(
1357
+ PRESENTATION_LINK_TYPE_OPTIONS.map((o) => [o.value, o.label])
1358
+ );
1359
+ function getPresentationLinkTypeLabel(value) {
1360
+ if (!value) return void 0;
1361
+ return PRESENTATION_LINK_TYPE_LABELS[value] ?? value;
1362
+ }
1363
+
1364
+ // src/taxonomy/calendar-event.ts
1365
+ var CALENDAR_EVENT_MODE_LABELS = {
1366
+ "community.lexicon.calendar.event#inperson": "In person",
1367
+ "community.lexicon.calendar.event#virtual": "Virtual",
1368
+ "community.lexicon.calendar.event#hybrid": "Hybrid"
1369
+ };
1370
+ function getCalendarEventModeLabel(value) {
1371
+ if (!value) return void 0;
1372
+ return CALENDAR_EVENT_MODE_LABELS[value] ?? value;
1373
+ }
1374
+ var CALENDAR_EVENT_STATUS_LABELS = {
1375
+ "community.lexicon.calendar.event#scheduled": "Scheduled",
1376
+ "community.lexicon.calendar.event#cancelled": "Cancelled",
1377
+ "community.lexicon.calendar.event#postponed": "Postponed",
1378
+ "community.lexicon.calendar.event#rescheduled": "Rescheduled",
1379
+ "community.lexicon.calendar.event#planned": "Planned"
1380
+ };
1381
+ function getCalendarEventStatusLabel(value) {
1382
+ if (!value) return void 0;
1383
+ return CALENDAR_EVENT_STATUS_LABELS[value] ?? value;
1384
+ }
1385
+
1329
1386
  // src/format/format-time.ts
1330
1387
  function formatRelativeTime(dateString) {
1331
1388
  const date = new Date(dateString);
@@ -2109,6 +2166,10 @@ var strongRefSchema = zod.z.object({
2109
2166
  uri: atUriSchema,
2110
2167
  cid: cidSchema
2111
2168
  });
2169
+ var externalRecordRefSchema = zod.z.object({
2170
+ uri: atUriSchema,
2171
+ cid: cidSchema.optional()
2172
+ });
2112
2173
  var selfLabelsSchema = zod.z.object({
2113
2174
  $type: zod.z.literal("com.atproto.label.defs#selfLabels").optional(),
2114
2175
  values: zod.z.array(zod.z.object({ val: zod.z.string() }))
@@ -2235,6 +2296,9 @@ var ProfileCourseRecordSchema = zod.z.object({
2235
2296
  number: zod.z.string().refine(maxGraphemes(50)).max(500).optional(),
2236
2297
  institution: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
2237
2298
  education: strongRefSchema.optional(),
2299
+ // AT-URI of the associated id.sifa.profile.certification record. Plain
2300
+ // at-uri (not a strongRef) so the link tracks the live certification.
2301
+ credential: atUriSchema.optional(),
2238
2302
  createdAt: datetimeSchema
2239
2303
  });
2240
2304
  var ProfileEducationRecordSchema = zod.z.object({
@@ -2286,6 +2350,46 @@ var ProfilePositionRecordSchema = zod.z.object({
2286
2350
  labels: selfLabelsSchema.optional(),
2287
2351
  createdAt: datetimeSchema
2288
2352
  });
2353
+ var PresentationDurationSchema = zod.z.object({
2354
+ minMinutes: zod.z.number().int().min(1),
2355
+ maxMinutes: zod.z.number().int().min(1).optional()
2356
+ }).refine((d) => d.maxMinutes === void 0 || d.maxMinutes >= d.minMinutes, {
2357
+ message: "maxMinutes must be greater than or equal to minMinutes",
2358
+ path: ["maxMinutes"]
2359
+ });
2360
+ var PresentationLinkSchema = zod.z.object({
2361
+ uri: uriSchema,
2362
+ label: zod.z.string().refine(maxGraphemes(64)).max(640).optional(),
2363
+ type: zod.z.string().optional()
2364
+ });
2365
+ var ProfilePresentationRecordSchema = zod.z.object({
2366
+ title: zod.z.string().min(1).refine(maxGraphemes(300)).max(3e3),
2367
+ description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
2368
+ duration: PresentationDurationSchema.optional(),
2369
+ intendedAudiences: zod.z.array(zod.z.string().refine(maxGraphemes(100)).max(1e3)).max(20).optional(),
2370
+ links: zod.z.array(PresentationLinkSchema).max(20).optional(),
2371
+ // Optional reference to a long-form write-up (pub.leaflet.document or
2372
+ // site.standard.document). Plain at-uri + optional cid so it tracks edits.
2373
+ writeupRef: externalRecordRefSchema.optional(),
2374
+ createdAt: datetimeSchema
2375
+ });
2376
+ var ProfilePresentationDeliveryRecordSchema = zod.z.object({
2377
+ // Optional reference to the id.sifa.profile.presentation delivered here.
2378
+ presentationRef: externalRecordRefSchema.optional(),
2379
+ // Fallback title used when there is no presentationRef.
2380
+ title: zod.z.string().refine(maxGraphemes(300)).max(3e3).optional(),
2381
+ role: zod.z.string().refine(maxGraphemes(64)).max(640).optional(),
2382
+ eventName: zod.z.string().refine(maxGraphemes(300)).max(3e3).optional(),
2383
+ // Calendar date as YYYY-MM-DD (day only).
2384
+ date: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "date must be YYYY-MM-DD").optional(),
2385
+ location: zod.z.string().refine(maxGraphemes(256)).max(2560).optional(),
2386
+ mode: zod.z.string().optional(),
2387
+ status: zod.z.string().optional(),
2388
+ links: zod.z.array(PresentationLinkSchema).max(20).optional(),
2389
+ // Optional reference to a community.lexicon.calendar.event for this occasion.
2390
+ eventRef: externalRecordRefSchema.optional(),
2391
+ createdAt: datetimeSchema
2392
+ });
2289
2393
  var ProfileProjectRecordSchema = zod.z.object({
2290
2394
  name: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
2291
2395
  description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
@@ -2340,7 +2444,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
2340
2444
  });
2341
2445
 
2342
2446
  // src/index.ts
2343
- var SIFA_SDK_VERSION = "0.11.1";
2447
+ var SIFA_SDK_VERSION = "0.11.3";
2344
2448
 
2345
2449
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
2346
2450
  exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
@@ -2350,6 +2454,8 @@ exports.APP_CATEGORY_IDS = APP_CATEGORY_IDS;
2350
2454
  exports.APP_CATEGORY_MAP = APP_CATEGORY_MAP;
2351
2455
  exports.APP_URL_PATTERNS = APP_URL_PATTERNS;
2352
2456
  exports.AtmosphereFeedItemSchema = AtmosphereFeedItemSchema;
2457
+ exports.CALENDAR_EVENT_MODE_LABELS = CALENDAR_EVENT_MODE_LABELS;
2458
+ exports.CALENDAR_EVENT_STATUS_LABELS = CALENDAR_EVENT_STATUS_LABELS;
2353
2459
  exports.CATEGORY_LABELS = CATEGORY_LABELS;
2354
2460
  exports.CATEGORY_ORDER = CATEGORY_ORDER;
2355
2461
  exports.COLLECTION_TO_APP = COLLECTION_TO_APP;
@@ -2378,7 +2484,13 @@ exports.OPEN_TO_TOKEN_TO_VALUE = OPEN_TO_TOKEN_TO_VALUE;
2378
2484
  exports.OPEN_TO_VALUE_TO_TOKEN = OPEN_TO_VALUE_TO_TOKEN;
2379
2485
  exports.PLATFORM_LABELS = PLATFORM_LABELS;
2380
2486
  exports.PLATFORM_OPTIONS = PLATFORM_OPTIONS;
2487
+ exports.PRESENTATION_LINK_TYPE_LABELS = PRESENTATION_LINK_TYPE_LABELS;
2488
+ exports.PRESENTATION_LINK_TYPE_OPTIONS = PRESENTATION_LINK_TYPE_OPTIONS;
2489
+ exports.PRESENTATION_ROLE_LABELS = PRESENTATION_ROLE_LABELS;
2490
+ exports.PRESENTATION_ROLE_OPTIONS = PRESENTATION_ROLE_OPTIONS;
2381
2491
  exports.PUBLISHERS = PUBLISHERS;
2492
+ exports.PresentationDurationSchema = PresentationDurationSchema;
2493
+ exports.PresentationLinkSchema = PresentationLinkSchema;
2382
2494
  exports.ProfileCertificationRecordSchema = ProfileCertificationRecordSchema;
2383
2495
  exports.ProfileCourseRecordSchema = ProfileCourseRecordSchema;
2384
2496
  exports.ProfileEducationRecordSchema = ProfileEducationRecordSchema;
@@ -2386,6 +2498,8 @@ exports.ProfileExternalAccountRecordSchema = ProfileExternalAccountRecordSchema;
2386
2498
  exports.ProfileHonorRecordSchema = ProfileHonorRecordSchema;
2387
2499
  exports.ProfileLanguageRecordSchema = ProfileLanguageRecordSchema;
2388
2500
  exports.ProfilePositionRecordSchema = ProfilePositionRecordSchema;
2501
+ exports.ProfilePresentationDeliveryRecordSchema = ProfilePresentationDeliveryRecordSchema;
2502
+ exports.ProfilePresentationRecordSchema = ProfilePresentationRecordSchema;
2389
2503
  exports.ProfileProjectRecordSchema = ProfileProjectRecordSchema;
2390
2504
  exports.ProfilePublicationRecordSchema = ProfilePublicationRecordSchema;
2391
2505
  exports.ProfileSelfRecordSchema = ProfileSelfRecordSchema;
@@ -2415,6 +2529,7 @@ exports.detectPdsProvider = detectPdsProvider;
2415
2529
  exports.didSchema = didSchema;
2416
2530
  exports.dimensionsFromInputs = dimensionsFromInputs;
2417
2531
  exports.encodeFeedCursor = encodeFeedCursor;
2532
+ exports.externalRecordRefSchema = externalRecordRefSchema;
2418
2533
  exports.findIndustry = findIndustry;
2419
2534
  exports.formatDistanceToNow = formatDistanceToNow;
2420
2535
  exports.formatLocation = formatLocation;
@@ -2423,6 +2538,8 @@ exports.getActivityTaxonomyVersion = getActivityTaxonomyVersion;
2423
2538
  exports.getActivityTier = getActivityTier;
2424
2539
  exports.getAppCategoryIcon = getAppCategoryIcon;
2425
2540
  exports.getAppIdForCollection = getAppIdForCollection;
2541
+ exports.getCalendarEventModeLabel = getCalendarEventModeLabel;
2542
+ exports.getCalendarEventStatusLabel = getCalendarEventStatusLabel;
2426
2543
  exports.getContinent = getContinent;
2427
2544
  exports.getDisplayLabel = getDisplayLabel;
2428
2545
  exports.getEmploymentTypeLabel = getEmploymentTypeLabel;
@@ -2434,6 +2551,8 @@ exports.getLexiconEntry = getLexiconEntry;
2434
2551
  exports.getOpenToLabelKey = getOpenToLabelKey;
2435
2552
  exports.getPdsDisplayName = getPdsDisplayName;
2436
2553
  exports.getPlatformLabel = getPlatformLabel;
2554
+ exports.getPresentationLinkTypeLabel = getPresentationLinkTypeLabel;
2555
+ exports.getPresentationRoleLabel = getPresentationRoleLabel;
2437
2556
  exports.getPublisherByHost = getPublisherByHost;
2438
2557
  exports.getPublisherById = getPublisherById;
2439
2558
  exports.getPublisherFromSiteUrl = getPublisherFromSiteUrl;