@singi-labs/sifa-sdk 0.12.19 → 0.12.20
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 +24 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +24 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2828,6 +2828,12 @@ var streamSourceSchema = zod.z.object({
|
|
|
2828
2828
|
label: zod.z.string(),
|
|
2829
2829
|
color: zod.z.string()
|
|
2830
2830
|
});
|
|
2831
|
+
var streamAuthorSchema = zod.z.object({
|
|
2832
|
+
did: zod.z.string().optional(),
|
|
2833
|
+
handle: zod.z.string().optional(),
|
|
2834
|
+
displayName: zod.z.string().optional(),
|
|
2835
|
+
avatar: zod.z.string().optional()
|
|
2836
|
+
});
|
|
2831
2837
|
var streamThemeSchema = zod.z.object({
|
|
2832
2838
|
background: rgbColorSchema,
|
|
2833
2839
|
foreground: rgbColorSchema,
|
|
@@ -3010,6 +3016,7 @@ var streamCardVMSchema = zod.z.lazy(
|
|
|
3010
3016
|
cid: zod.z.string(),
|
|
3011
3017
|
verb: streamVerbSchema,
|
|
3012
3018
|
source: streamSourceSchema,
|
|
3019
|
+
author: streamAuthorSchema.optional(),
|
|
3013
3020
|
tier: zod.z.enum(["creation", "action", "filtered"]),
|
|
3014
3021
|
timestamp: zod.z.string(),
|
|
3015
3022
|
title: zod.z.string(),
|
|
@@ -3175,6 +3182,19 @@ function buildSource(item, options) {
|
|
|
3175
3182
|
color: options.resolveSourceColor?.(item.appId) ?? DEFAULT_SOURCE_COLOR
|
|
3176
3183
|
};
|
|
3177
3184
|
}
|
|
3185
|
+
function buildAuthor(item) {
|
|
3186
|
+
const did = didFromUri(item.uri);
|
|
3187
|
+
const handle = asNonEmptyString(item.authorHandle);
|
|
3188
|
+
const displayName = asNonEmptyString(item.authorDisplayName);
|
|
3189
|
+
const avatar = asNonEmptyString(item.authorAvatar);
|
|
3190
|
+
if (!did && !handle && !displayName && !avatar) return void 0;
|
|
3191
|
+
const author = {};
|
|
3192
|
+
if (did) author.did = did;
|
|
3193
|
+
if (handle) author.handle = handle;
|
|
3194
|
+
if (displayName) author.displayName = displayName;
|
|
3195
|
+
if (avatar) author.avatar = avatar;
|
|
3196
|
+
return author;
|
|
3197
|
+
}
|
|
3178
3198
|
var TITLE_BY_VERB = {
|
|
3179
3199
|
posted: () => "Posted",
|
|
3180
3200
|
reposted: () => "Reposted",
|
|
@@ -3706,6 +3726,8 @@ function toStreamCardVM(item, options = {}) {
|
|
|
3706
3726
|
timestamp,
|
|
3707
3727
|
title: buildTitle(verb, source.label)
|
|
3708
3728
|
};
|
|
3729
|
+
const author = buildAuthor(item);
|
|
3730
|
+
if (author) vm.author = author;
|
|
3709
3731
|
const theme = readTheme(record);
|
|
3710
3732
|
if (theme) vm.theme = theme;
|
|
3711
3733
|
if (record) {
|
|
@@ -4575,7 +4597,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
|
4575
4597
|
});
|
|
4576
4598
|
|
|
4577
4599
|
// src/index.ts
|
|
4578
|
-
var SIFA_SDK_VERSION = "0.12.
|
|
4600
|
+
var SIFA_SDK_VERSION = "0.12.20";
|
|
4579
4601
|
|
|
4580
4602
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
4581
4603
|
exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
|
|
@@ -4800,6 +4822,7 @@ exports.sortPositions = sortPositions;
|
|
|
4800
4822
|
exports.sortProjects = sortProjects;
|
|
4801
4823
|
exports.sortPublications = sortPublications;
|
|
4802
4824
|
exports.streamAddressSchema = streamAddressSchema;
|
|
4825
|
+
exports.streamAuthorSchema = streamAuthorSchema;
|
|
4803
4826
|
exports.streamCardBodySchema = streamCardBodySchema;
|
|
4804
4827
|
exports.streamCardSubjectSchema = streamCardSubjectSchema;
|
|
4805
4828
|
exports.streamCardVMSchema = streamCardVMSchema;
|