@atproto/api 0.3.10 → 0.3.12

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.
@@ -182,6 +182,9 @@ export declare const schemaDict: {
182
182
  reason: {
183
183
  type: string;
184
184
  };
185
+ subjectRepoHandle: {
186
+ type: string;
187
+ };
185
188
  subject: {
186
189
  type: string;
187
190
  refs: string[];
@@ -768,6 +771,13 @@ export declare const schemaDict: {
768
771
  type: string;
769
772
  };
770
773
  };
774
+ reporters: {
775
+ type: string;
776
+ items: {
777
+ type: string;
778
+ };
779
+ description: string;
780
+ };
771
781
  resolved: {
772
782
  type: string;
773
783
  };
@@ -65,6 +65,7 @@ export interface ReportView {
65
65
  id: number;
66
66
  reasonType: ComAtprotoModerationDefs.ReasonType;
67
67
  reason?: string;
68
+ subjectRepoHandle?: string;
68
69
  subject: RepoRef | ComAtprotoRepoStrongRef.Main | {
69
70
  $type: string;
70
71
  [k: string]: unknown;
@@ -3,6 +3,7 @@ import * as ComAtprotoAdminDefs from './defs';
3
3
  export interface QueryParams {
4
4
  subject?: string;
5
5
  ignoreSubjects?: string[];
6
+ reporters?: string[];
6
7
  resolved?: boolean;
7
8
  actionType?: 'com.atproto.admin.defs#takedown' | 'com.atproto.admin.defs#flag' | 'com.atproto.admin.defs#acknowledge' | 'com.atproto.admin.defs#escalate' | (string & {});
8
9
  limit?: number;
package/dist/index.js CHANGED
@@ -10142,8 +10142,8 @@ var ensureValidDid = (did2) => {
10142
10142
  if (did2.endsWith(":") || did2.endsWith("%")) {
10143
10143
  throw new InvalidDidError('DID can not end with ":" or "%"');
10144
10144
  }
10145
- if (did2.length > 8 * 1024) {
10146
- throw new InvalidDidError("DID is far too long");
10145
+ if (did2.length > 2 * 1024) {
10146
+ throw new InvalidDidError("DID is too long (2048 chars max)");
10147
10147
  }
10148
10148
  };
10149
10149
  var InvalidDidError = class extends Error {
@@ -10182,18 +10182,17 @@ var NSID = class {
10182
10182
  }
10183
10183
  };
10184
10184
  var ensureValidNsid = (nsid2) => {
10185
- const split = nsid2.split(".");
10186
- const toCheck = split.at(-1) === "*" ? split.slice(0, -1).join(".") : split.join(".");
10185
+ const toCheck = nsid2;
10187
10186
  if (!/^[a-zA-Z0-9.-]*$/.test(toCheck)) {
10188
10187
  throw new InvalidNsidError(
10189
10188
  "Disallowed characters in NSID (ASCII letters, digits, dashes, periods only)"
10190
10189
  );
10191
10190
  }
10192
- if (toCheck.length > 253 + 1 + 128) {
10193
- throw new InvalidNsidError("NSID is too long (382 chars max)");
10191
+ if (toCheck.length > 253 + 1 + 63) {
10192
+ throw new InvalidNsidError("NSID is too long (317 chars max)");
10194
10193
  }
10195
10194
  const labels = toCheck.split(".");
10196
- if (split.length < 3) {
10195
+ if (labels.length < 3) {
10197
10196
  throw new InvalidNsidError("NSID needs at least three parts");
10198
10197
  }
10199
10198
  for (let i = 0; i < labels.length; i++) {
@@ -10201,17 +10200,17 @@ var ensureValidNsid = (nsid2) => {
10201
10200
  if (l.length < 1) {
10202
10201
  throw new InvalidNsidError("NSID parts can not be empty");
10203
10202
  }
10204
- if (l.length > 63 && i + 1 < labels.length) {
10205
- throw new InvalidNsidError("NSID domain part too long (max 63 chars)");
10203
+ if (l.length > 63) {
10204
+ throw new InvalidNsidError("NSID part too long (max 63 chars)");
10206
10205
  }
10207
- if (l.length > 128 && i + 1 == labels.length) {
10208
- throw new InvalidNsidError("NSID name part too long (max 128 chars)");
10206
+ if (l.endsWith("-") || l.startsWith("-")) {
10207
+ throw new InvalidNsidError("NSID parts can not start or end with hyphen");
10209
10208
  }
10210
- if (l.endsWith("-")) {
10211
- throw new InvalidNsidError("NSID parts can not end with hyphen");
10209
+ if (/^[0-9]/.test(l) && i == 0) {
10210
+ throw new InvalidNsidError("NSID first part may not start with a digit");
10212
10211
  }
10213
- if (!/^[a-zA-Z]/.test(l)) {
10214
- throw new InvalidNsidError("NSID parts must start with ASCII letter");
10212
+ if (!/^[a-zA-Z]+$/.test(l) && i + 1 == labels.length) {
10213
+ throw new InvalidNsidError("NSID name part must be only letters");
10215
10214
  }
10216
10215
  }
10217
10216
  };
@@ -16934,6 +16933,9 @@ var schemaDict = {
16934
16933
  reason: {
16935
16934
  type: "string"
16936
16935
  },
16936
+ subjectRepoHandle: {
16937
+ type: "string"
16938
+ },
16937
16939
  subject: {
16938
16940
  type: "union",
16939
16941
  refs: [
@@ -17566,6 +17568,13 @@ var schemaDict = {
17566
17568
  type: "string"
17567
17569
  }
17568
17570
  },
17571
+ reporters: {
17572
+ type: "array",
17573
+ items: {
17574
+ type: "string"
17575
+ },
17576
+ description: "Filter reports made by one or more DIDs"
17577
+ },
17569
17578
  resolved: {
17570
17579
  type: "boolean"
17571
17580
  },
@@ -19978,6 +19987,9 @@ var schemaDict = {
19978
19987
  errors: [
19979
19988
  {
19980
19989
  name: "FutureCursor"
19990
+ },
19991
+ {
19992
+ name: "ConsumerTooSlow"
19981
19993
  }
19982
19994
  ]
19983
19995
  },