@openpeepshq/common 0.9.1 → 0.10.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.
@@ -316,6 +316,15 @@ export declare const toHiddenPost: <T extends {
316
316
  export declare const isHiddenPost: (post: {
317
317
  hidden?: boolean;
318
318
  }) => boolean;
319
+ /**
320
+ * Only posts with `visibility === 'public'` are considered worth handing to
321
+ * the outside world. `withPublicPostReadScopes` additionally grants anonymous
322
+ * read to some `group` posts, but sharing a group post to an anonymous
323
+ * audience is consciously out of scope here.
324
+ */
325
+ export declare const isPubliclyShareable: (post: {
326
+ visibility: VisibilityType;
327
+ }) => boolean;
319
328
  export declare const participantIds: (post: Pick<PublicPost, "audience" | "profile"> & {
320
329
  creatorId?: string;
321
330
  }) => Set<string>;
@@ -517,6 +517,13 @@ export const toHiddenPost = (post) => ({
517
517
  },
518
518
  });
519
519
  export const isHiddenPost = (post) => !!post.hidden;
520
+ /**
521
+ * Only posts with `visibility === 'public'` are considered worth handing to
522
+ * the outside world. `withPublicPostReadScopes` additionally grants anonymous
523
+ * read to some `group` posts, but sharing a group post to an anonymous
524
+ * audience is consciously out of scope here.
525
+ */
526
+ export const isPubliclyShareable = (post) => post.visibility === 'public';
520
527
  export const participantIds = (post) => {
521
528
  const ids = new Set((post.audience ?? []).map((member) => member.id).filter(Boolean));
522
529
  const creatorId = post.creatorId ?? post.profile?.id;
@@ -38318,6 +38318,7 @@ export declare const serverInfoSchema: z.ZodObject<{
38318
38318
  codeOfConduct: z.ZodOptional<z.ZodString>;
38319
38319
  welcomeEmail: z.ZodOptional<z.ZodString>;
38320
38320
  pinnedPost: z.ZodOptional<z.ZodString>;
38321
+ autoFollow: z.ZodOptional<z.ZodArray<z.ZodString>>;
38321
38322
  }, z.core.$strip>;
38322
38323
  settings: z.ZodObject<{
38323
38324
  openRegistrations: z.ZodBoolean;
@@ -695,6 +695,7 @@ export declare const communityConfigSchemaFactory: (_sanitize?: boolean) => z.Zo
695
695
  codeOfConduct: z.ZodOptional<z.ZodString>;
696
696
  welcomeEmail: z.ZodOptional<z.ZodString>;
697
697
  pinnedPost: z.ZodOptional<z.ZodString>;
698
+ autoFollow: z.ZodOptional<z.ZodArray<z.ZodString>>;
698
699
  }, z.core.$strip>;
699
700
  settings: z.ZodObject<{
700
701
  openRegistrations: z.ZodBoolean;
@@ -777,6 +778,7 @@ export declare const communityConfigSchema: z.ZodObject<{
777
778
  codeOfConduct: z.ZodOptional<z.ZodString>;
778
779
  welcomeEmail: z.ZodOptional<z.ZodString>;
779
780
  pinnedPost: z.ZodOptional<z.ZodString>;
781
+ autoFollow: z.ZodOptional<z.ZodArray<z.ZodString>>;
780
782
  }, z.core.$strip>;
781
783
  settings: z.ZodObject<{
782
784
  openRegistrations: z.ZodBoolean;
@@ -859,6 +861,7 @@ export declare const communityConfigSanitizedSchema: z.ZodObject<{
859
861
  codeOfConduct: z.ZodOptional<z.ZodString>;
860
862
  welcomeEmail: z.ZodOptional<z.ZodString>;
861
863
  pinnedPost: z.ZodOptional<z.ZodString>;
864
+ autoFollow: z.ZodOptional<z.ZodArray<z.ZodString>>;
862
865
  }, z.core.$strip>;
863
866
  settings: z.ZodObject<{
864
867
  openRegistrations: z.ZodBoolean;
@@ -339,6 +339,10 @@ export const communityConfigSchemaFactory = (_sanitize) => z.object({
339
339
  codeOfConduct: z.string().optional(),
340
340
  welcomeEmail: z.string().optional(),
341
341
  pinnedPost: z.string().optional(),
342
+ /** Local handles new members are made to follow on registration.
343
+ * Admin-managed via Community → Auto-follow accounts; only resolvable
344
+ * local profiles may be designated (federated handles are rejected). */
345
+ autoFollow: z.string().array().optional(),
342
346
  }),
343
347
  settings: z.object({
344
348
  openRegistrations: z.boolean(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpeepshq/common",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -851,6 +851,16 @@ export const toHiddenPost = <
851
851
  export const isHiddenPost = (post: { hidden?: boolean }): boolean =>
852
852
  !!post.hidden;
853
853
 
854
+ /**
855
+ * Only posts with `visibility === 'public'` are considered worth handing to
856
+ * the outside world. `withPublicPostReadScopes` additionally grants anonymous
857
+ * read to some `group` posts, but sharing a group post to an anonymous
858
+ * audience is consciously out of scope here.
859
+ */
860
+ export const isPubliclyShareable = (post: {
861
+ visibility: VisibilityType;
862
+ }): boolean => post.visibility === 'public';
863
+
854
864
  export const participantIds = (
855
865
  post: Pick<PublicPost, 'audience' | 'profile'> & { creatorId?: string },
856
866
  ): Set<string> => {
@@ -408,6 +408,10 @@ export const communityConfigSchemaFactory = (_sanitize?: boolean) =>
408
408
  codeOfConduct: z.string().optional(),
409
409
  welcomeEmail: z.string().optional(),
410
410
  pinnedPost: z.string().optional(),
411
+ /** Local handles new members are made to follow on registration.
412
+ * Admin-managed via Community → Auto-follow accounts; only resolvable
413
+ * local profiles may be designated (federated handles are rejected). */
414
+ autoFollow: z.string().array().optional(),
411
415
  }),
412
416
  settings: z.object({
413
417
  openRegistrations: z.boolean(),