@atproto/api 0.3.10 → 0.3.11
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/dist/client/lexicons.d.ts +3 -0
- package/dist/client/types/com/atproto/admin/defs.d.ts +1 -0
- package/dist/index.js +20 -15
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/client/lexicons.ts +6 -0
- package/src/client/types/com/atproto/admin/defs.ts +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
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 >
|
|
10146
|
-
throw new InvalidDidError("DID is
|
|
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
|
|
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 +
|
|
10193
|
-
throw new InvalidNsidError("NSID is too long (
|
|
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 (
|
|
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
|
|
10205
|
-
throw new InvalidNsidError("NSID
|
|
10203
|
+
if (l.length > 63) {
|
|
10204
|
+
throw new InvalidNsidError("NSID part too long (max 63 chars)");
|
|
10206
10205
|
}
|
|
10207
|
-
if (l.
|
|
10208
|
-
throw new InvalidNsidError("NSID
|
|
10206
|
+
if (l.endsWith("-") || l.startsWith("-")) {
|
|
10207
|
+
throw new InvalidNsidError("NSID parts can not start or end with hyphen");
|
|
10209
10208
|
}
|
|
10210
|
-
if (l
|
|
10211
|
-
throw new InvalidNsidError("NSID
|
|
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]
|
|
10214
|
-
throw new InvalidNsidError("NSID
|
|
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: [
|
|
@@ -19978,6 +19980,9 @@ var schemaDict = {
|
|
|
19978
19980
|
errors: [
|
|
19979
19981
|
{
|
|
19980
19982
|
name: "FutureCursor"
|
|
19983
|
+
},
|
|
19984
|
+
{
|
|
19985
|
+
name: "ConsumerTooSlow"
|
|
19981
19986
|
}
|
|
19982
19987
|
]
|
|
19983
19988
|
},
|