@atproto/api 0.6.2 → 0.6.4

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.
Files changed (84) hide show
  1. package/dist/client/lexicons.d.ts +28 -0
  2. package/dist/client/types/app/bsky/embed/record.d.ts +3 -0
  3. package/dist/client/types/com/atproto/admin/defs.d.ts +3 -0
  4. package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +1 -0
  5. package/dist/index.js +60 -9
  6. package/dist/index.js.map +2 -2
  7. package/dist/moderation/accumulator.d.ts +1 -0
  8. package/dist/moderation/types.d.ts +4 -0
  9. package/package.json +1 -1
  10. package/src/client/lexicons.ts +34 -2
  11. package/src/client/types/app/bsky/embed/record.ts +3 -0
  12. package/src/client/types/com/atproto/admin/defs.ts +6 -0
  13. package/src/client/types/com/atproto/admin/takeModerationAction.ts +2 -0
  14. package/src/moderation/accumulator.ts +15 -1
  15. package/src/moderation/subjects/quoted-post.ts +18 -0
  16. package/src/moderation/types.ts +1 -0
  17. package/src/moderation/util.ts +2 -14
  18. package/tsconfig.build.tsbuildinfo +1 -1
  19. package/dist/client/types/app/bsky/actor/createScene.d.ts +0 -32
  20. package/dist/client/types/app/bsky/actor/ref.d.ts +0 -28
  21. package/dist/client/types/app/bsky/actor/search.d.ts +0 -22
  22. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +0 -20
  23. package/dist/client/types/app/bsky/actor/updateProfile.d.ts +0 -40
  24. package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +0 -28
  25. package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +0 -21
  26. package/dist/client/types/app/bsky/feed/getVotes.d.ts +0 -36
  27. package/dist/client/types/app/bsky/feed/saveFeed.d.ts +0 -17
  28. package/dist/client/types/app/bsky/feed/setVote.d.ts +0 -25
  29. package/dist/client/types/app/bsky/feed/trend.d.ts +0 -9
  30. package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +0 -17
  31. package/dist/client/types/app/bsky/feed/vote.d.ts +0 -10
  32. package/dist/client/types/app/bsky/graph/assertCreator.d.ts +0 -1
  33. package/dist/client/types/app/bsky/graph/assertMember.d.ts +0 -1
  34. package/dist/client/types/app/bsky/graph/assertion.d.ts +0 -10
  35. package/dist/client/types/app/bsky/graph/confirmation.d.ts +0 -11
  36. package/dist/client/types/app/bsky/graph/getAssertions.d.ts +0 -48
  37. package/dist/client/types/app/bsky/graph/getListBlocks.d.ts +0 -21
  38. package/dist/client/types/app/bsky/graph/getMembers.d.ts +0 -36
  39. package/dist/client/types/app/bsky/graph/getMemberships.d.ts +0 -36
  40. package/dist/client/types/app/bsky/graph/listblock.d.ts +0 -8
  41. package/dist/client/types/app/bsky/graph/mute.d.ts +0 -17
  42. package/dist/client/types/app/bsky/graph/subscribeMuteList.d.ts +0 -17
  43. package/dist/client/types/app/bsky/graph/unmute.d.ts +0 -17
  44. package/dist/client/types/app/bsky/graph/unsubscribeMuteList.d.ts +0 -17
  45. package/dist/client/types/app/bsky/notification/getCount.d.ts +0 -17
  46. package/dist/client/types/app/bsky/notification/list.d.ts +0 -35
  47. package/dist/client/types/app/bsky/system/actorScene.d.ts +0 -1
  48. package/dist/client/types/app/bsky/system/actorUser.d.ts +0 -1
  49. package/dist/client/types/app/bsky/system/declRef.d.ts +0 -8
  50. package/dist/client/types/app/bsky/system/declaration.d.ts +0 -7
  51. package/dist/client/types/com/atproto/account/create.d.ts +0 -41
  52. package/dist/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
  53. package/dist/client/types/com/atproto/account/delete.d.ts +0 -25
  54. package/dist/client/types/com/atproto/account/get.d.ts +0 -12
  55. package/dist/client/types/com/atproto/account/requestDelete.d.ts +0 -13
  56. package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
  57. package/dist/client/types/com/atproto/account/resetPassword.d.ts +0 -24
  58. package/dist/client/types/com/atproto/admin/blob.d.ts +0 -37
  59. package/dist/client/types/com/atproto/admin/moderationAction.d.ts +0 -60
  60. package/dist/client/types/com/atproto/admin/moderationReport.d.ts +0 -37
  61. package/dist/client/types/com/atproto/admin/record.d.ts +0 -43
  62. package/dist/client/types/com/atproto/admin/repo.d.ts +0 -45
  63. package/dist/client/types/com/atproto/blob/upload.d.ts +0 -19
  64. package/dist/client/types/com/atproto/handle/resolve.d.ts +0 -18
  65. package/dist/client/types/com/atproto/handle/update.d.ts +0 -17
  66. package/dist/client/types/com/atproto/repo/batchWrite.d.ts +0 -46
  67. package/dist/client/types/com/atproto/repo/describe.d.ts +0 -22
  68. package/dist/client/types/com/atproto/repo/recordRef.d.ts +0 -8
  69. package/dist/client/types/com/atproto/repo/repoRef.d.ts +0 -7
  70. package/dist/client/types/com/atproto/report/create.d.ts +0 -39
  71. package/dist/client/types/com/atproto/report/reasonType.d.ts +0 -3
  72. package/dist/client/types/com/atproto/report/subject.d.ts +0 -23
  73. package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -27
  74. package/dist/client/types/com/atproto/session/create.d.ts +0 -29
  75. package/dist/client/types/com/atproto/session/delete.d.ts +0 -13
  76. package/dist/client/types/com/atproto/session/get.d.ts +0 -18
  77. package/dist/client/types/com/atproto/session/refresh.d.ts +0 -24
  78. package/dist/client/types/com/atproto/sync/getRoot.d.ts +0 -18
  79. package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +0 -9
  80. package/dist/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
  81. package/dist/helpers/bsky.d.ts +0 -20
  82. package/dist/mixins/bsky.d.ts +0 -23
  83. package/dist/rich-text/sanitize.d.ts +0 -4
  84. package/dist/session.d.ts +0 -42
@@ -15,6 +15,10 @@ export declare const schemaDict: {
15
15
  type: string;
16
16
  ref: string;
17
17
  };
18
+ durationInHours: {
19
+ type: string;
20
+ description: string;
21
+ };
18
22
  subject: {
19
23
  type: string;
20
24
  refs: string[];
@@ -71,6 +75,10 @@ export declare const schemaDict: {
71
75
  type: string;
72
76
  ref: string;
73
77
  };
78
+ durationInHours: {
79
+ type: string;
80
+ description: string;
81
+ };
74
82
  subject: {
75
83
  type: string;
76
84
  refs: string[];
@@ -129,6 +137,10 @@ export declare const schemaDict: {
129
137
  type: string;
130
138
  ref: string;
131
139
  };
140
+ durationInHours: {
141
+ type: string;
142
+ description: string;
143
+ };
132
144
  };
133
145
  };
134
146
  actionReversal: {
@@ -1144,6 +1156,10 @@ export declare const schemaDict: {
1144
1156
  reason: {
1145
1157
  type: string;
1146
1158
  };
1159
+ durationInHours: {
1160
+ type: string;
1161
+ description: string;
1162
+ };
1147
1163
  createdBy: {
1148
1164
  type: string;
1149
1165
  format: string;
@@ -4001,6 +4017,10 @@ export declare const schemaDict: {
4001
4017
  type: string;
4002
4018
  format: string;
4003
4019
  };
4020
+ notFound: {
4021
+ type: string;
4022
+ const: boolean;
4023
+ };
4004
4024
  };
4005
4025
  };
4006
4026
  viewBlocked: {
@@ -4011,6 +4031,14 @@ export declare const schemaDict: {
4011
4031
  type: string;
4012
4032
  format: string;
4013
4033
  };
4034
+ blocked: {
4035
+ type: string;
4036
+ const: boolean;
4037
+ };
4038
+ author: {
4039
+ type: string;
4040
+ ref: string;
4041
+ };
4014
4042
  };
4015
4043
  };
4016
4044
  };
@@ -39,12 +39,15 @@ export declare function isViewRecord(v: unknown): v is ViewRecord;
39
39
  export declare function validateViewRecord(v: unknown): ValidationResult;
40
40
  export interface ViewNotFound {
41
41
  uri: string;
42
+ notFound: true;
42
43
  [k: string]: unknown;
43
44
  }
44
45
  export declare function isViewNotFound(v: unknown): v is ViewNotFound;
45
46
  export declare function validateViewNotFound(v: unknown): ValidationResult;
46
47
  export interface ViewBlocked {
47
48
  uri: string;
49
+ blocked: true;
50
+ author: AppBskyFeedDefs.BlockedAuthor;
48
51
  [k: string]: unknown;
49
52
  }
50
53
  export declare function isViewBlocked(v: unknown): v is ViewBlocked;
@@ -6,6 +6,7 @@ import * as ComAtprotoLabelDefs from '../label/defs';
6
6
  export interface ActionView {
7
7
  id: number;
8
8
  action: ActionType;
9
+ durationInHours?: number;
9
10
  subject: RepoRef | ComAtprotoRepoStrongRef.Main | {
10
11
  $type: string;
11
12
  [k: string]: unknown;
@@ -25,6 +26,7 @@ export declare function validateActionView(v: unknown): ValidationResult;
25
26
  export interface ActionViewDetail {
26
27
  id: number;
27
28
  action: ActionType;
29
+ durationInHours?: number;
28
30
  subject: RepoView | RepoViewNotFound | RecordView | RecordViewNotFound | {
29
31
  $type: string;
30
32
  [k: string]: unknown;
@@ -44,6 +46,7 @@ export declare function validateActionViewDetail(v: unknown): ValidationResult;
44
46
  export interface ActionViewCurrent {
45
47
  id: number;
46
48
  action: ActionType;
49
+ durationInHours?: number;
47
50
  [k: string]: unknown;
48
51
  }
49
52
  export declare function isActionViewCurrent(v: unknown): v is ActionViewCurrent;
@@ -13,6 +13,7 @@ export interface InputSchema {
13
13
  createLabelVals?: string[];
14
14
  negateLabelVals?: string[];
15
15
  reason: string;
16
+ durationInHours?: number;
16
17
  createdBy: string;
17
18
  [k: string]: unknown;
18
19
  }
package/dist/index.js CHANGED
@@ -15740,6 +15740,10 @@ var schemaDict = {
15740
15740
  type: "ref",
15741
15741
  ref: "lex:com.atproto.admin.defs#actionType"
15742
15742
  },
15743
+ durationInHours: {
15744
+ type: "integer",
15745
+ description: "Indicates how long this action was meant to be in effect before automatically expiring."
15746
+ },
15743
15747
  subject: {
15744
15748
  type: "union",
15745
15749
  refs: [
@@ -15808,6 +15812,10 @@ var schemaDict = {
15808
15812
  type: "ref",
15809
15813
  ref: "lex:com.atproto.admin.defs#actionType"
15810
15814
  },
15815
+ durationInHours: {
15816
+ type: "integer",
15817
+ description: "Indicates how long this action was meant to be in effect before automatically expiring."
15818
+ },
15811
15819
  subject: {
15812
15820
  type: "union",
15813
15821
  refs: [
@@ -15870,6 +15878,10 @@ var schemaDict = {
15870
15878
  action: {
15871
15879
  type: "ref",
15872
15880
  ref: "lex:com.atproto.admin.defs#actionType"
15881
+ },
15882
+ durationInHours: {
15883
+ type: "integer",
15884
+ description: "Indicates how long this action was meant to be in effect before automatically expiring."
15873
15885
  }
15874
15886
  }
15875
15887
  },
@@ -16965,6 +16977,10 @@ var schemaDict = {
16965
16977
  reason: {
16966
16978
  type: "string"
16967
16979
  },
16980
+ durationInHours: {
16981
+ type: "integer",
16982
+ description: "Indicates how long this action was meant to be in effect before automatically expiring."
16983
+ },
16968
16984
  createdBy: {
16969
16985
  type: "string",
16970
16986
  format: "did"
@@ -19952,21 +19968,33 @@ var schemaDict = {
19952
19968
  },
19953
19969
  viewNotFound: {
19954
19970
  type: "object",
19955
- required: ["uri"],
19971
+ required: ["uri", "notFound"],
19956
19972
  properties: {
19957
19973
  uri: {
19958
19974
  type: "string",
19959
19975
  format: "at-uri"
19976
+ },
19977
+ notFound: {
19978
+ type: "boolean",
19979
+ const: true
19960
19980
  }
19961
19981
  }
19962
19982
  },
19963
19983
  viewBlocked: {
19964
19984
  type: "object",
19965
- required: ["uri"],
19985
+ required: ["uri", "blocked", "author"],
19966
19986
  properties: {
19967
19987
  uri: {
19968
19988
  type: "string",
19969
19989
  format: "at-uri"
19990
+ },
19991
+ blocked: {
19992
+ type: "boolean",
19993
+ const: true
19994
+ },
19995
+ author: {
19996
+ type: "ref",
19997
+ ref: "lex:app.bsky.feed.defs#blockedAuthor"
19970
19998
  }
19971
19999
  }
19972
20000
  }
@@ -28231,6 +28259,15 @@ var ModerationCauseAccumulator = class {
28231
28259
  });
28232
28260
  }
28233
28261
  }
28262
+ addBlockOther(blockOther) {
28263
+ if (blockOther) {
28264
+ this.causes.push({
28265
+ type: "block-other",
28266
+ source: { type: "user" },
28267
+ priority: 4
28268
+ });
28269
+ }
28270
+ }
28234
28271
  addLabel(label, opts) {
28235
28272
  const labelDef = LABELS[label.val];
28236
28273
  if (!labelDef) {
@@ -28299,7 +28336,7 @@ var ModerationCauseAccumulator = class {
28299
28336
  this.causes.sort((a, b) => a.priority - b.priority);
28300
28337
  mod.cause = this.causes[0];
28301
28338
  mod.additionalCauses = this.causes.slice(1);
28302
- if (mod.cause.type === "blocking" || mod.cause.type === "blocked-by") {
28339
+ if (mod.cause.type === "blocking" || mod.cause.type === "blocked-by" || mod.cause.type === "block-other") {
28303
28340
  mod.filter = true;
28304
28341
  mod.blur = true;
28305
28342
  mod.noOverride = true;
@@ -28400,6 +28437,15 @@ function decideQuotedPost(subject, opts) {
28400
28437
  acc.addLabel(label, opts);
28401
28438
  }
28402
28439
  }
28440
+ } else if (record_exports.isViewBlocked(subject.record)) {
28441
+ acc.setDid(subject.record.author.did);
28442
+ if (subject.record.author.viewer?.blocking) {
28443
+ acc.addBlocking(subject.record.author.viewer?.blocking);
28444
+ } else if (subject.record.author.viewer?.blockedBy) {
28445
+ acc.addBlockedBy(subject.record.author.viewer?.blockedBy);
28446
+ } else {
28447
+ acc.addBlockOther(true);
28448
+ }
28403
28449
  }
28404
28450
  return acc.finalizeDecision(opts);
28405
28451
  }
@@ -28418,6 +28464,15 @@ function decideQuotedPostWithMedia(subject, opts) {
28418
28464
  acc.addLabel(label, opts);
28419
28465
  }
28420
28466
  }
28467
+ } else if (record_exports.isViewBlocked(subject.record.record)) {
28468
+ acc.setDid(subject.record.record.author.did);
28469
+ if (subject.record.record.author.viewer?.blocking) {
28470
+ acc.addBlocking(subject.record.record.author.viewer?.blocking);
28471
+ } else if (subject.record.record.author.viewer?.blockedBy) {
28472
+ acc.addBlockedBy(subject.record.record.author.viewer?.blockedBy);
28473
+ } else {
28474
+ acc.addBlockOther(true);
28475
+ }
28421
28476
  }
28422
28477
  return acc.finalizeDecision(opts);
28423
28478
  }
@@ -28488,14 +28543,10 @@ function isModerationDecisionNoop(decision, { ignoreFilter } = { ignoreFilter: f
28488
28543
  return true;
28489
28544
  }
28490
28545
  function isQuotedPost(embed) {
28491
- return Boolean(
28492
- embed && record_exports.isView(embed) && record_exports.isViewRecord(embed.record) && post_exports.isRecord(embed.record.value) && post_exports.validateRecord(embed.record.value).success
28493
- );
28546
+ return Boolean(embed && record_exports.isView(embed));
28494
28547
  }
28495
28548
  function isQuotedPostWithMedia(embed) {
28496
- return Boolean(
28497
- embed && recordWithMedia_exports.isView(embed) && record_exports.isViewRecord(embed.record.record) && post_exports.isRecord(embed.record.record.value) && post_exports.validateRecord(embed.record.record.value).success
28498
- );
28549
+ return Boolean(embed && recordWithMedia_exports.isView(embed));
28499
28550
  }
28500
28551
  function toModerationUI(decision) {
28501
28552
  return {