@singi-labs/sifa-sdk 0.11.2 → 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.
- package/dist/index.cjs +117 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -2
- package/dist/index.d.ts +42 -2
- package/dist/index.js +103 -2
- package/dist/index.js.map +1 -1
- package/dist/publishing/index.cjs +4 -0
- package/dist/publishing/index.cjs.map +1 -1
- package/dist/publishing/index.js +4 -0
- package/dist/publishing/index.js.map +1 -1
- package/dist/schemas/index.cjs +49 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +86 -1
- package/dist/schemas/index.d.ts +86 -1
- package/dist/schemas/index.js +45 -1
- package/dist/schemas/index.js.map +1 -1
- package/package.json +1 -1
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() }))
|
|
@@ -2289,6 +2350,46 @@ var ProfilePositionRecordSchema = zod.z.object({
|
|
|
2289
2350
|
labels: selfLabelsSchema.optional(),
|
|
2290
2351
|
createdAt: datetimeSchema
|
|
2291
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
|
+
});
|
|
2292
2393
|
var ProfileProjectRecordSchema = zod.z.object({
|
|
2293
2394
|
name: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
|
|
2294
2395
|
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
@@ -2343,7 +2444,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
|
2343
2444
|
});
|
|
2344
2445
|
|
|
2345
2446
|
// src/index.ts
|
|
2346
|
-
var SIFA_SDK_VERSION = "0.11.
|
|
2447
|
+
var SIFA_SDK_VERSION = "0.11.3";
|
|
2347
2448
|
|
|
2348
2449
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
2349
2450
|
exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
|
|
@@ -2353,6 +2454,8 @@ exports.APP_CATEGORY_IDS = APP_CATEGORY_IDS;
|
|
|
2353
2454
|
exports.APP_CATEGORY_MAP = APP_CATEGORY_MAP;
|
|
2354
2455
|
exports.APP_URL_PATTERNS = APP_URL_PATTERNS;
|
|
2355
2456
|
exports.AtmosphereFeedItemSchema = AtmosphereFeedItemSchema;
|
|
2457
|
+
exports.CALENDAR_EVENT_MODE_LABELS = CALENDAR_EVENT_MODE_LABELS;
|
|
2458
|
+
exports.CALENDAR_EVENT_STATUS_LABELS = CALENDAR_EVENT_STATUS_LABELS;
|
|
2356
2459
|
exports.CATEGORY_LABELS = CATEGORY_LABELS;
|
|
2357
2460
|
exports.CATEGORY_ORDER = CATEGORY_ORDER;
|
|
2358
2461
|
exports.COLLECTION_TO_APP = COLLECTION_TO_APP;
|
|
@@ -2381,7 +2484,13 @@ exports.OPEN_TO_TOKEN_TO_VALUE = OPEN_TO_TOKEN_TO_VALUE;
|
|
|
2381
2484
|
exports.OPEN_TO_VALUE_TO_TOKEN = OPEN_TO_VALUE_TO_TOKEN;
|
|
2382
2485
|
exports.PLATFORM_LABELS = PLATFORM_LABELS;
|
|
2383
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;
|
|
2384
2491
|
exports.PUBLISHERS = PUBLISHERS;
|
|
2492
|
+
exports.PresentationDurationSchema = PresentationDurationSchema;
|
|
2493
|
+
exports.PresentationLinkSchema = PresentationLinkSchema;
|
|
2385
2494
|
exports.ProfileCertificationRecordSchema = ProfileCertificationRecordSchema;
|
|
2386
2495
|
exports.ProfileCourseRecordSchema = ProfileCourseRecordSchema;
|
|
2387
2496
|
exports.ProfileEducationRecordSchema = ProfileEducationRecordSchema;
|
|
@@ -2389,6 +2498,8 @@ exports.ProfileExternalAccountRecordSchema = ProfileExternalAccountRecordSchema;
|
|
|
2389
2498
|
exports.ProfileHonorRecordSchema = ProfileHonorRecordSchema;
|
|
2390
2499
|
exports.ProfileLanguageRecordSchema = ProfileLanguageRecordSchema;
|
|
2391
2500
|
exports.ProfilePositionRecordSchema = ProfilePositionRecordSchema;
|
|
2501
|
+
exports.ProfilePresentationDeliveryRecordSchema = ProfilePresentationDeliveryRecordSchema;
|
|
2502
|
+
exports.ProfilePresentationRecordSchema = ProfilePresentationRecordSchema;
|
|
2392
2503
|
exports.ProfileProjectRecordSchema = ProfileProjectRecordSchema;
|
|
2393
2504
|
exports.ProfilePublicationRecordSchema = ProfilePublicationRecordSchema;
|
|
2394
2505
|
exports.ProfileSelfRecordSchema = ProfileSelfRecordSchema;
|
|
@@ -2418,6 +2529,7 @@ exports.detectPdsProvider = detectPdsProvider;
|
|
|
2418
2529
|
exports.didSchema = didSchema;
|
|
2419
2530
|
exports.dimensionsFromInputs = dimensionsFromInputs;
|
|
2420
2531
|
exports.encodeFeedCursor = encodeFeedCursor;
|
|
2532
|
+
exports.externalRecordRefSchema = externalRecordRefSchema;
|
|
2421
2533
|
exports.findIndustry = findIndustry;
|
|
2422
2534
|
exports.formatDistanceToNow = formatDistanceToNow;
|
|
2423
2535
|
exports.formatLocation = formatLocation;
|
|
@@ -2426,6 +2538,8 @@ exports.getActivityTaxonomyVersion = getActivityTaxonomyVersion;
|
|
|
2426
2538
|
exports.getActivityTier = getActivityTier;
|
|
2427
2539
|
exports.getAppCategoryIcon = getAppCategoryIcon;
|
|
2428
2540
|
exports.getAppIdForCollection = getAppIdForCollection;
|
|
2541
|
+
exports.getCalendarEventModeLabel = getCalendarEventModeLabel;
|
|
2542
|
+
exports.getCalendarEventStatusLabel = getCalendarEventStatusLabel;
|
|
2429
2543
|
exports.getContinent = getContinent;
|
|
2430
2544
|
exports.getDisplayLabel = getDisplayLabel;
|
|
2431
2545
|
exports.getEmploymentTypeLabel = getEmploymentTypeLabel;
|
|
@@ -2437,6 +2551,8 @@ exports.getLexiconEntry = getLexiconEntry;
|
|
|
2437
2551
|
exports.getOpenToLabelKey = getOpenToLabelKey;
|
|
2438
2552
|
exports.getPdsDisplayName = getPdsDisplayName;
|
|
2439
2553
|
exports.getPlatformLabel = getPlatformLabel;
|
|
2554
|
+
exports.getPresentationLinkTypeLabel = getPresentationLinkTypeLabel;
|
|
2555
|
+
exports.getPresentationRoleLabel = getPresentationRoleLabel;
|
|
2440
2556
|
exports.getPublisherByHost = getPublisherByHost;
|
|
2441
2557
|
exports.getPublisherById = getPublisherById;
|
|
2442
2558
|
exports.getPublisherFromSiteUrl = getPublisherFromSiteUrl;
|