@atproto/bsky 0.0.4 → 0.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atproto/bsky
2
2
 
3
+ ## 0.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`2cc329f2`](https://github.com/bluesky-social/atproto/commit/2cc329f26547217dd94b6bb11ee590d707cbd14f)]:
8
+ - @atproto/api@0.6.15
9
+
10
+ ## 0.0.5
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`b1dc3555`](https://github.com/bluesky-social/atproto/commit/b1dc355504f9f2e047093dc56682b8034518cf80)]:
15
+ - @atproto/syntax@0.1.1
16
+ - @atproto/api@0.6.14
17
+ - @atproto/lexicon@0.2.1
18
+ - @atproto/repo@0.3.1
19
+ - @atproto/xrpc-server@0.3.1
20
+
3
21
  ## 0.0.4
4
22
 
5
23
  ### Patch Changes
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022-2023 Bluesky PBLLC
3
+ Copyright (c) 2022-2023 Bluesky PBC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.js CHANGED
@@ -105127,7 +105127,7 @@ var lexObject = z.object({
105127
105127
  description: z.string().optional(),
105128
105128
  required: z.string().array().optional(),
105129
105129
  nullable: z.string().array().optional(),
105130
- properties: z.record(z.union([lexRefVariant, lexIpldType, lexArray, lexBlob, lexPrimitive])).optional()
105130
+ properties: z.record(z.union([lexRefVariant, lexIpldType, lexArray, lexBlob, lexPrimitive]))
105131
105131
  }).strict().superRefine(requiredPropertiesRefinement);
105132
105132
  var lexXrpcParameters = z.object({
105133
105133
  type: z.literal("params"),
@@ -105822,7 +105822,7 @@ var XRPCError2 = class extends Error {
105822
105822
  }
105823
105823
  };
105824
105824
  function isHandlerError(v) {
105825
- return handlerError.safeParse(v).success;
105825
+ return !!v && typeof v === "object" && typeof v["status"] === "number" && (v["error"] === void 0 || typeof v["error"] === "string") && (v["message"] === void 0 || typeof v["message"] === "string");
105826
105826
  }
105827
105827
  var InvalidRequestError = class extends XRPCError2 {
105828
105828
  constructor(errorMessage, customErrorName) {
@@ -110783,7 +110783,8 @@ var Server = class {
110783
110783
  if (config2.rateLimit) {
110784
110784
  const limits = Array.isArray(config2.rateLimit) ? config2.rateLimit : [config2.rateLimit];
110785
110785
  this.routeRateLimiterFns[nsid2] = [];
110786
- for (const limit of limits) {
110786
+ for (let i = 0; i < limits.length; i++) {
110787
+ const limit = limits[i];
110787
110788
  const { calcKey, calcPoints } = limit;
110788
110789
  if (isShared(limit)) {
110789
110790
  const rateLimiter = this.sharedRateLimiters[limit.name];
@@ -110797,7 +110798,7 @@ var Server = class {
110797
110798
  } else {
110798
110799
  const { durationMs, points } = limit;
110799
110800
  const rateLimiter = this.options.rateLimits?.creator({
110800
- keyPrefix: nsid2,
110801
+ keyPrefix: `nsid-${i}`,
110801
110802
  durationMs,
110802
110803
  points,
110803
110804
  calcKey,
@@ -122426,7 +122427,9 @@ var schemaDict = {
122426
122427
  "lex:app.bsky.actor.defs#adultContentPref",
122427
122428
  "lex:app.bsky.actor.defs#contentLabelPref",
122428
122429
  "lex:app.bsky.actor.defs#savedFeedsPref",
122429
- "lex:app.bsky.actor.defs#personalDetailsPref"
122430
+ "lex:app.bsky.actor.defs#personalDetailsPref",
122431
+ "lex:app.bsky.actor.defs#feedViewPref",
122432
+ "lex:app.bsky.actor.defs#threadViewPref"
122430
122433
  ]
122431
122434
  }
122432
122435
  },
@@ -122482,6 +122485,50 @@ var schemaDict = {
122482
122485
  description: "The birth date of the owner of the account."
122483
122486
  }
122484
122487
  }
122488
+ },
122489
+ feedViewPref: {
122490
+ type: "object",
122491
+ required: ["feed"],
122492
+ properties: {
122493
+ feed: {
122494
+ type: "string",
122495
+ description: "The URI of the feed, or an identifier which describes the feed."
122496
+ },
122497
+ hideReplies: {
122498
+ type: "boolean",
122499
+ description: "Hide replies in the feed."
122500
+ },
122501
+ hideRepliesByUnfollowed: {
122502
+ type: "boolean",
122503
+ description: "Hide replies in the feed if they are not by followed users."
122504
+ },
122505
+ hideRepliesByLikeCount: {
122506
+ type: "integer",
122507
+ description: "Hide replies in the feed if they do not have this number of likes."
122508
+ },
122509
+ hideReposts: {
122510
+ type: "boolean",
122511
+ description: "Hide reposts in the feed."
122512
+ },
122513
+ hideQuotePosts: {
122514
+ type: "boolean",
122515
+ description: "Hide quote posts in the feed."
122516
+ }
122517
+ }
122518
+ },
122519
+ threadViewPref: {
122520
+ type: "object",
122521
+ properties: {
122522
+ sort: {
122523
+ type: "string",
122524
+ description: "Sorting mode.",
122525
+ knownValues: ["oldest", "newest", "most-likes", "random"]
122526
+ },
122527
+ prioritizeFollowedUsers: {
122528
+ type: "boolean",
122529
+ description: "Show followed users at the top of all replies."
122530
+ }
122531
+ }
122485
122532
  }
122486
122533
  }
122487
122534
  },
@@ -124422,11 +124469,13 @@ var schemaDict = {
124422
124469
  },
124423
124470
  mentionRule: {
124424
124471
  type: "object",
124425
- description: "Allow replies from actors mentioned in your post."
124472
+ description: "Allow replies from actors mentioned in your post.",
124473
+ properties: {}
124426
124474
  },
124427
124475
  followingRule: {
124428
124476
  type: "object",
124429
- description: "Allow replies from actors you follow."
124477
+ description: "Allow replies from actors you follow.",
124478
+ properties: {}
124430
124479
  },
124431
124480
  listRule: {
124432
124481
  type: "object",
@@ -132660,7 +132709,9 @@ var schemaDict2 = {
132660
132709
  "lex:app.bsky.actor.defs#adultContentPref",
132661
132710
  "lex:app.bsky.actor.defs#contentLabelPref",
132662
132711
  "lex:app.bsky.actor.defs#savedFeedsPref",
132663
- "lex:app.bsky.actor.defs#personalDetailsPref"
132712
+ "lex:app.bsky.actor.defs#personalDetailsPref",
132713
+ "lex:app.bsky.actor.defs#feedViewPref",
132714
+ "lex:app.bsky.actor.defs#threadViewPref"
132664
132715
  ]
132665
132716
  }
132666
132717
  },
@@ -132716,6 +132767,50 @@ var schemaDict2 = {
132716
132767
  description: "The birth date of the owner of the account."
132717
132768
  }
132718
132769
  }
132770
+ },
132771
+ feedViewPref: {
132772
+ type: "object",
132773
+ required: ["feed"],
132774
+ properties: {
132775
+ feed: {
132776
+ type: "string",
132777
+ description: "The URI of the feed, or an identifier which describes the feed."
132778
+ },
132779
+ hideReplies: {
132780
+ type: "boolean",
132781
+ description: "Hide replies in the feed."
132782
+ },
132783
+ hideRepliesByUnfollowed: {
132784
+ type: "boolean",
132785
+ description: "Hide replies in the feed if they are not by followed users."
132786
+ },
132787
+ hideRepliesByLikeCount: {
132788
+ type: "integer",
132789
+ description: "Hide replies in the feed if they do not have this number of likes."
132790
+ },
132791
+ hideReposts: {
132792
+ type: "boolean",
132793
+ description: "Hide reposts in the feed."
132794
+ },
132795
+ hideQuotePosts: {
132796
+ type: "boolean",
132797
+ description: "Hide quote posts in the feed."
132798
+ }
132799
+ }
132800
+ },
132801
+ threadViewPref: {
132802
+ type: "object",
132803
+ properties: {
132804
+ sort: {
132805
+ type: "string",
132806
+ description: "Sorting mode.",
132807
+ knownValues: ["oldest", "newest", "most-likes", "random"]
132808
+ },
132809
+ prioritizeFollowedUsers: {
132810
+ type: "boolean",
132811
+ description: "Show followed users at the top of all replies."
132812
+ }
132813
+ }
132719
132814
  }
132720
132815
  }
132721
132816
  },
@@ -134656,11 +134751,13 @@ var schemaDict2 = {
134656
134751
  },
134657
134752
  mentionRule: {
134658
134753
  type: "object",
134659
- description: "Allow replies from actors mentioned in your post."
134754
+ description: "Allow replies from actors mentioned in your post.",
134755
+ properties: {}
134660
134756
  },
134661
134757
  followingRule: {
134662
134758
  type: "object",
134663
- description: "Allow replies from actors you follow."
134759
+ description: "Allow replies from actors you follow.",
134760
+ properties: {}
134664
134761
  },
134665
134762
  listRule: {
134666
134763
  type: "object",
@@ -136200,7 +136297,7 @@ var composeThread = (threadData, actors, state, ctx) => {
136200
136297
  const post = feedService.views.formatPostView(threadData.post.postUri, actors, posts, threadgates, embeds, labels, lists);
136201
136298
  const isAnchorPost = state.threadData.post.uri === threadData.post.postUri;
136202
136299
  const info = posts[threadData.post.postUri];
136203
- const badReply = !!info?.invalidReplyRoot || !!info?.violatesThreadGate;
136300
+ const badReply = !!info?.violatesThreadGate;
136204
136301
  const omitBadReply = !isAnchorPost && badReply;
136205
136302
  if (!post || blocks[post.uri]?.reply || omitBadReply) {
136206
136303
  return {
@@ -136323,7 +136420,7 @@ var getChildrenData = (childrenByParentUri, uri2, depth) => {
136323
136420
  var checkViewerCanReply = async (db, anchor, viewer, owner, root, threadgate) => {
136324
136421
  if (!viewer)
136325
136422
  return false;
136326
- if (anchor?.invalidReplyRoot || anchor?.violatesThreadGate)
136423
+ if (anchor?.violatesThreadGate)
136327
136424
  return false;
136328
136425
  const viewerViolatesThreadGate = await violatesThreadGate(db, viewer, owner, root, threadgate);
136329
136426
  return !viewerViolatesThreadGate;