@atproto/api 0.6.22 → 0.6.24-next.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/client/index.d.ts +23 -25
  3. package/dist/client/lexicons.d.ts +441 -364
  4. package/dist/client/types/com/atproto/admin/defs.d.ts +114 -48
  5. package/dist/client/types/com/atproto/admin/{takeModerationAction.d.ts → emitModerationEvent.d.ts} +5 -6
  6. package/dist/client/types/com/atproto/admin/{getModerationAction.d.ts → getModerationEvent.d.ts} +1 -1
  7. package/dist/client/types/com/atproto/admin/{getModerationActions.d.ts → queryModerationEvents.d.ts} +5 -1
  8. package/dist/client/types/com/atproto/admin/{getModerationReports.d.ts → queryModerationStatuses.d.ts} +12 -6
  9. package/dist/client/types/com/atproto/admin/sendEmail.d.ts +1 -0
  10. package/dist/client/types/com/atproto/server/getSession.d.ts +1 -0
  11. package/dist/client/types/com/atproto/{admin/getModerationReport.d.ts → temp/fetchLabels.d.ts} +7 -3
  12. package/dist/index.js +1182 -1041
  13. package/dist/index.js.map +3 -3
  14. package/package.json +20 -17
  15. package/src/agent.ts +1 -0
  16. package/src/client/index.ts +68 -80
  17. package/src/client/lexicons.ts +664 -567
  18. package/src/client/types/app/bsky/actor/defs.ts +2 -2
  19. package/src/client/types/app/bsky/actor/searchActors.ts +2 -2
  20. package/src/client/types/app/bsky/actor/searchActorsTypeahead.ts +2 -2
  21. package/src/client/types/app/bsky/feed/searchPosts.ts +3 -3
  22. package/src/client/types/app/bsky/graph/defs.ts +2 -2
  23. package/src/client/types/app/bsky/unspecced/searchActorsSkeleton.ts +4 -4
  24. package/src/client/types/app/bsky/unspecced/searchPostsSkeleton.ts +3 -3
  25. package/src/client/types/com/atproto/admin/defs.ts +276 -84
  26. package/src/client/types/com/atproto/admin/disableAccountInvites.ts +1 -1
  27. package/src/client/types/com/atproto/admin/{takeModerationAction.ts → emitModerationEvent.ts} +13 -11
  28. package/src/client/types/com/atproto/admin/enableAccountInvites.ts +1 -1
  29. package/src/client/types/com/atproto/admin/{getModerationReport.ts → getModerationEvent.ts} +1 -1
  30. package/src/client/types/com/atproto/admin/{getModerationReports.ts → queryModerationEvents.ts} +8 -15
  31. package/src/client/types/com/atproto/admin/queryModerationStatuses.ts +60 -0
  32. package/src/client/types/com/atproto/admin/sendEmail.ts +1 -0
  33. package/src/client/types/com/atproto/label/defs.ts +9 -9
  34. package/src/client/types/com/atproto/label/queryLabels.ts +2 -2
  35. package/src/client/types/com/atproto/repo/applyWrites.ts +1 -1
  36. package/src/client/types/com/atproto/repo/createRecord.ts +2 -2
  37. package/src/client/types/com/atproto/repo/deleteRecord.ts +2 -2
  38. package/src/client/types/com/atproto/repo/listRecords.ts +1 -1
  39. package/src/client/types/com/atproto/repo/putRecord.ts +3 -3
  40. package/src/client/types/com/atproto/server/getSession.ts +1 -0
  41. package/src/client/types/com/atproto/sync/listBlobs.ts +1 -1
  42. package/src/client/types/com/atproto/sync/subscribeRepos.ts +4 -4
  43. package/src/client/types/com/atproto/{admin/getModerationActions.ts → temp/fetchLabels.ts} +3 -5
  44. package/src/moderation/accumulator.ts +0 -1
  45. package/tests/agent.test.ts +14 -3
  46. package/tests/rich-text-detection.test.ts +6 -0
  47. package/LICENSE.txt +0 -7
  48. package/dist/client/types/com/atproto/admin/resolveModerationReports.d.ts +0 -22
  49. package/dist/client/types/com/atproto/admin/reverseModerationAction.d.ts +0 -22
  50. package/src/client/types/com/atproto/admin/getModerationAction.ts +0 -32
  51. package/src/client/types/com/atproto/admin/resolveModerationReports.ts +0 -38
  52. package/src/client/types/com/atproto/admin/reverseModerationAction.ts +0 -38
@@ -10,71 +10,46 @@ export interface StatusAttr {
10
10
  }
11
11
  export declare function isStatusAttr(v: unknown): v is StatusAttr;
12
12
  export declare function validateStatusAttr(v: unknown): ValidationResult;
13
- export interface ActionView {
13
+ export interface ModEventView {
14
14
  id: number;
15
- action: ActionType;
16
- durationInHours?: number;
15
+ event: ModEventTakedown | ModEventReverseTakedown | ModEventComment | ModEventReport | ModEventLabel | ModEventAcknowledge | ModEventEscalate | ModEventMute | ModEventEmail | {
16
+ $type: string;
17
+ [k: string]: unknown;
18
+ };
17
19
  subject: RepoRef | ComAtprotoRepoStrongRef.Main | {
18
20
  $type: string;
19
21
  [k: string]: unknown;
20
22
  };
21
23
  subjectBlobCids: string[];
22
- createLabelVals?: string[];
23
- negateLabelVals?: string[];
24
- reason: string;
25
24
  createdBy: string;
26
25
  createdAt: string;
27
- reversal?: ActionReversal;
28
- resolvedReportIds: number[];
26
+ creatorHandle?: string;
27
+ subjectHandle?: string;
29
28
  [k: string]: unknown;
30
29
  }
31
- export declare function isActionView(v: unknown): v is ActionView;
32
- export declare function validateActionView(v: unknown): ValidationResult;
33
- export interface ActionViewDetail {
30
+ export declare function isModEventView(v: unknown): v is ModEventView;
31
+ export declare function validateModEventView(v: unknown): ValidationResult;
32
+ export interface ModEventViewDetail {
34
33
  id: number;
35
- action: ActionType;
36
- durationInHours?: number;
34
+ event: ModEventTakedown | ModEventReverseTakedown | ModEventComment | ModEventReport | ModEventLabel | ModEventAcknowledge | ModEventEscalate | ModEventMute | {
35
+ $type: string;
36
+ [k: string]: unknown;
37
+ };
37
38
  subject: RepoView | RepoViewNotFound | RecordView | RecordViewNotFound | {
38
39
  $type: string;
39
40
  [k: string]: unknown;
40
41
  };
41
42
  subjectBlobs: BlobView[];
42
- createLabelVals?: string[];
43
- negateLabelVals?: string[];
44
- reason: string;
45
43
  createdBy: string;
46
44
  createdAt: string;
47
- reversal?: ActionReversal;
48
- resolvedReports: ReportView[];
49
- [k: string]: unknown;
50
- }
51
- export declare function isActionViewDetail(v: unknown): v is ActionViewDetail;
52
- export declare function validateActionViewDetail(v: unknown): ValidationResult;
53
- export interface ActionViewCurrent {
54
- id: number;
55
- action: ActionType;
56
- durationInHours?: number;
57
45
  [k: string]: unknown;
58
46
  }
59
- export declare function isActionViewCurrent(v: unknown): v is ActionViewCurrent;
60
- export declare function validateActionViewCurrent(v: unknown): ValidationResult;
61
- export interface ActionReversal {
62
- reason: string;
63
- createdBy: string;
64
- createdAt: string;
65
- [k: string]: unknown;
66
- }
67
- export declare function isActionReversal(v: unknown): v is ActionReversal;
68
- export declare function validateActionReversal(v: unknown): ValidationResult;
69
- export declare type ActionType = 'lex:com.atproto.admin.defs#takedown' | 'lex:com.atproto.admin.defs#flag' | 'lex:com.atproto.admin.defs#acknowledge' | 'lex:com.atproto.admin.defs#escalate' | (string & {});
70
- export declare const TAKEDOWN = "com.atproto.admin.defs#takedown";
71
- export declare const FLAG = "com.atproto.admin.defs#flag";
72
- export declare const ACKNOWLEDGE = "com.atproto.admin.defs#acknowledge";
73
- export declare const ESCALATE = "com.atproto.admin.defs#escalate";
47
+ export declare function isModEventViewDetail(v: unknown): v is ModEventViewDetail;
48
+ export declare function validateModEventViewDetail(v: unknown): ValidationResult;
74
49
  export interface ReportView {
75
50
  id: number;
76
51
  reasonType: ComAtprotoModerationDefs.ReasonType;
77
- reason?: string;
52
+ comment?: string;
78
53
  subjectRepoHandle?: string;
79
54
  subject: RepoRef | ComAtprotoRepoStrongRef.Main | {
80
55
  $type: string;
@@ -87,17 +62,40 @@ export interface ReportView {
87
62
  }
88
63
  export declare function isReportView(v: unknown): v is ReportView;
89
64
  export declare function validateReportView(v: unknown): ValidationResult;
65
+ export interface SubjectStatusView {
66
+ id: number;
67
+ subject: RepoRef | ComAtprotoRepoStrongRef.Main | {
68
+ $type: string;
69
+ [k: string]: unknown;
70
+ };
71
+ subjectBlobCids?: string[];
72
+ subjectRepoHandle?: string;
73
+ updatedAt: string;
74
+ createdAt: string;
75
+ reviewState: SubjectReviewState;
76
+ comment?: string;
77
+ muteUntil?: string;
78
+ lastReviewedBy?: string;
79
+ lastReviewedAt?: string;
80
+ lastReportedAt?: string;
81
+ takendown?: boolean;
82
+ suspendUntil?: string;
83
+ [k: string]: unknown;
84
+ }
85
+ export declare function isSubjectStatusView(v: unknown): v is SubjectStatusView;
86
+ export declare function validateSubjectStatusView(v: unknown): ValidationResult;
90
87
  export interface ReportViewDetail {
91
88
  id: number;
92
89
  reasonType: ComAtprotoModerationDefs.ReasonType;
93
- reason?: string;
90
+ comment?: string;
94
91
  subject: RepoView | RepoViewNotFound | RecordView | RecordViewNotFound | {
95
92
  $type: string;
96
93
  [k: string]: unknown;
97
94
  };
95
+ subjectStatus?: SubjectStatusView;
98
96
  reportedBy: string;
99
97
  createdAt: string;
100
- resolvedByActions: ActionView[];
98
+ resolvedByActions: ModEventView[];
101
99
  [k: string]: unknown;
102
100
  }
103
101
  export declare function isReportViewDetail(v: unknown): v is ReportViewDetail;
@@ -128,6 +126,7 @@ export interface RepoViewDetail {
128
126
  invites?: ComAtprotoServerDefs.InviteCode[];
129
127
  invitesDisabled?: boolean;
130
128
  inviteNote?: string;
129
+ emailConfirmedAt?: string;
131
130
  [k: string]: unknown;
132
131
  }
133
132
  export declare function isRepoViewDetail(v: unknown): v is RepoViewDetail;
@@ -140,6 +139,7 @@ export interface AccountView {
140
139
  invitedBy?: ComAtprotoServerDefs.InviteCode;
141
140
  invites?: ComAtprotoServerDefs.InviteCode[];
142
141
  invitesDisabled?: boolean;
142
+ emailConfirmedAt?: string;
143
143
  inviteNote?: string;
144
144
  [k: string]: unknown;
145
145
  }
@@ -197,15 +197,13 @@ export interface RecordViewNotFound {
197
197
  export declare function isRecordViewNotFound(v: unknown): v is RecordViewNotFound;
198
198
  export declare function validateRecordViewNotFound(v: unknown): ValidationResult;
199
199
  export interface Moderation {
200
- currentAction?: ActionViewCurrent;
200
+ subjectStatus?: SubjectStatusView;
201
201
  [k: string]: unknown;
202
202
  }
203
203
  export declare function isModeration(v: unknown): v is Moderation;
204
204
  export declare function validateModeration(v: unknown): ValidationResult;
205
205
  export interface ModerationDetail {
206
- currentAction?: ActionViewCurrent;
207
- actions: ActionView[];
208
- reports: ReportView[];
206
+ subjectStatus?: SubjectStatusView;
209
207
  [k: string]: unknown;
210
208
  }
211
209
  export declare function isModerationDetail(v: unknown): v is ModerationDetail;
@@ -239,3 +237,71 @@ export interface VideoDetails {
239
237
  }
240
238
  export declare function isVideoDetails(v: unknown): v is VideoDetails;
241
239
  export declare function validateVideoDetails(v: unknown): ValidationResult;
240
+ export declare type SubjectReviewState = 'lex:com.atproto.admin.defs#reviewOpen' | 'lex:com.atproto.admin.defs#reviewEscalated' | 'lex:com.atproto.admin.defs#reviewClosed' | (string & {});
241
+ export declare const REVIEWOPEN = "com.atproto.admin.defs#reviewOpen";
242
+ export declare const REVIEWESCALATED = "com.atproto.admin.defs#reviewEscalated";
243
+ export declare const REVIEWCLOSED = "com.atproto.admin.defs#reviewClosed";
244
+ export interface ModEventTakedown {
245
+ durationInHours?: number;
246
+ [k: string]: unknown;
247
+ }
248
+ export declare function isModEventTakedown(v: unknown): v is ModEventTakedown;
249
+ export declare function validateModEventTakedown(v: unknown): ValidationResult;
250
+ export interface ModEventReverseTakedown {
251
+ comment?: string;
252
+ [k: string]: unknown;
253
+ }
254
+ export declare function isModEventReverseTakedown(v: unknown): v is ModEventReverseTakedown;
255
+ export declare function validateModEventReverseTakedown(v: unknown): ValidationResult;
256
+ export interface ModEventComment {
257
+ comment: string;
258
+ sticky?: boolean;
259
+ [k: string]: unknown;
260
+ }
261
+ export declare function isModEventComment(v: unknown): v is ModEventComment;
262
+ export declare function validateModEventComment(v: unknown): ValidationResult;
263
+ export interface ModEventReport {
264
+ comment?: string;
265
+ reportType: ComAtprotoModerationDefs.ReasonType;
266
+ [k: string]: unknown;
267
+ }
268
+ export declare function isModEventReport(v: unknown): v is ModEventReport;
269
+ export declare function validateModEventReport(v: unknown): ValidationResult;
270
+ export interface ModEventLabel {
271
+ createLabelVals: string[];
272
+ negateLabelVals: string[];
273
+ [k: string]: unknown;
274
+ }
275
+ export declare function isModEventLabel(v: unknown): v is ModEventLabel;
276
+ export declare function validateModEventLabel(v: unknown): ValidationResult;
277
+ export interface ModEventAcknowledge {
278
+ comment?: string;
279
+ [k: string]: unknown;
280
+ }
281
+ export declare function isModEventAcknowledge(v: unknown): v is ModEventAcknowledge;
282
+ export declare function validateModEventAcknowledge(v: unknown): ValidationResult;
283
+ export interface ModEventEscalate {
284
+ comment?: string;
285
+ [k: string]: unknown;
286
+ }
287
+ export declare function isModEventEscalate(v: unknown): v is ModEventEscalate;
288
+ export declare function validateModEventEscalate(v: unknown): ValidationResult;
289
+ export interface ModEventMute {
290
+ comment?: string;
291
+ durationInHours: number;
292
+ [k: string]: unknown;
293
+ }
294
+ export declare function isModEventMute(v: unknown): v is ModEventMute;
295
+ export declare function validateModEventMute(v: unknown): ValidationResult;
296
+ export interface ModEventUnmute {
297
+ comment?: string;
298
+ [k: string]: unknown;
299
+ }
300
+ export declare function isModEventUnmute(v: unknown): v is ModEventUnmute;
301
+ export declare function validateModEventUnmute(v: unknown): ValidationResult;
302
+ export interface ModEventEmail {
303
+ subjectLine: string;
304
+ [k: string]: unknown;
305
+ }
306
+ export declare function isModEventEmail(v: unknown): v is ModEventEmail;
307
+ export declare function validateModEventEmail(v: unknown): ValidationResult;
@@ -4,20 +4,19 @@ import * as ComAtprotoRepoStrongRef from '../repo/strongRef';
4
4
  export interface QueryParams {
5
5
  }
6
6
  export interface InputSchema {
7
- action: 'com.atproto.admin.defs#takedown' | 'com.atproto.admin.defs#flag' | 'com.atproto.admin.defs#acknowledge' | (string & {});
7
+ event: ComAtprotoAdminDefs.ModEventTakedown | ComAtprotoAdminDefs.ModEventAcknowledge | ComAtprotoAdminDefs.ModEventEscalate | ComAtprotoAdminDefs.ModEventComment | ComAtprotoAdminDefs.ModEventLabel | ComAtprotoAdminDefs.ModEventReport | ComAtprotoAdminDefs.ModEventMute | ComAtprotoAdminDefs.ModEventReverseTakedown | ComAtprotoAdminDefs.ModEventUnmute | ComAtprotoAdminDefs.ModEventEmail | {
8
+ $type: string;
9
+ [k: string]: unknown;
10
+ };
8
11
  subject: ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main | {
9
12
  $type: string;
10
13
  [k: string]: unknown;
11
14
  };
12
15
  subjectBlobCids?: string[];
13
- createLabelVals?: string[];
14
- negateLabelVals?: string[];
15
- reason: string;
16
- durationInHours?: number;
17
16
  createdBy: string;
18
17
  [k: string]: unknown;
19
18
  }
20
- export declare type OutputSchema = ComAtprotoAdminDefs.ActionView;
19
+ export declare type OutputSchema = ComAtprotoAdminDefs.ModEventView;
21
20
  export interface CallOptions {
22
21
  headers?: Headers;
23
22
  qp?: QueryParams;
@@ -4,7 +4,7 @@ export interface QueryParams {
4
4
  id: number;
5
5
  }
6
6
  export declare type InputSchema = undefined;
7
- export declare type OutputSchema = ComAtprotoAdminDefs.ActionViewDetail;
7
+ export declare type OutputSchema = ComAtprotoAdminDefs.ModEventViewDetail;
8
8
  export interface CallOptions {
9
9
  headers?: Headers;
10
10
  }
@@ -1,14 +1,18 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
2
  import * as ComAtprotoAdminDefs from './defs';
3
3
  export interface QueryParams {
4
+ types?: string[];
5
+ createdBy?: string;
6
+ sortDirection?: 'asc' | 'desc';
4
7
  subject?: string;
8
+ includeAllUserRecords?: boolean;
5
9
  limit?: number;
6
10
  cursor?: string;
7
11
  }
8
12
  export declare type InputSchema = undefined;
9
13
  export interface OutputSchema {
10
14
  cursor?: string;
11
- actions: ComAtprotoAdminDefs.ActionView[];
15
+ events: ComAtprotoAdminDefs.ModEventView[];
12
16
  [k: string]: unknown;
13
17
  }
14
18
  export interface CallOptions {
@@ -2,19 +2,25 @@ import { Headers } from '@atproto/xrpc';
2
2
  import * as ComAtprotoAdminDefs from './defs';
3
3
  export interface QueryParams {
4
4
  subject?: string;
5
+ comment?: string;
6
+ reportedAfter?: string;
7
+ reportedBefore?: string;
8
+ reviewedAfter?: string;
9
+ reviewedBefore?: string;
10
+ includeMuted?: boolean;
11
+ reviewState?: string;
5
12
  ignoreSubjects?: string[];
6
- actionedBy?: string;
7
- reporters?: string[];
8
- resolved?: boolean;
9
- actionType?: 'com.atproto.admin.defs#takedown' | 'com.atproto.admin.defs#flag' | 'com.atproto.admin.defs#acknowledge' | 'com.atproto.admin.defs#escalate' | (string & {});
13
+ lastReviewedBy?: string;
14
+ sortField?: 'lastReviewedAt' | 'lastReportedAt';
15
+ sortDirection?: 'asc' | 'desc';
16
+ takendown?: boolean;
10
17
  limit?: number;
11
18
  cursor?: string;
12
- reverse?: boolean;
13
19
  }
14
20
  export declare type InputSchema = undefined;
15
21
  export interface OutputSchema {
16
22
  cursor?: string;
17
- reports: ComAtprotoAdminDefs.ReportView[];
23
+ subjectStatuses: ComAtprotoAdminDefs.SubjectStatusView[];
18
24
  [k: string]: unknown;
19
25
  }
20
26
  export interface CallOptions {
@@ -5,6 +5,7 @@ export interface InputSchema {
5
5
  recipientDid: string;
6
6
  content: string;
7
7
  subject?: string;
8
+ senderDid: string;
8
9
  [k: string]: unknown;
9
10
  }
10
11
  export interface OutputSchema {
@@ -7,6 +7,7 @@ export interface OutputSchema {
7
7
  did: string;
8
8
  email?: string;
9
9
  emailConfirmed?: boolean;
10
+ didDoc?: {};
10
11
  [k: string]: unknown;
11
12
  }
12
13
  export interface CallOptions {
@@ -1,10 +1,14 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
- import * as ComAtprotoAdminDefs from './defs';
2
+ import * as ComAtprotoLabelDefs from '../label/defs';
3
3
  export interface QueryParams {
4
- id: number;
4
+ since?: number;
5
+ limit?: number;
5
6
  }
6
7
  export declare type InputSchema = undefined;
7
- export declare type OutputSchema = ComAtprotoAdminDefs.ReportViewDetail;
8
+ export interface OutputSchema {
9
+ labels: ComAtprotoLabelDefs.Label[];
10
+ [k: string]: unknown;
11
+ }
8
12
  export interface CallOptions {
9
13
  headers?: Headers;
10
14
  }