@atproto/pds 0.4.28 → 0.4.29
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/dist/account-manager/helpers/account.d.ts +7 -0
- package/dist/account-manager/helpers/account.d.ts.map +1 -1
- package/dist/account-manager/helpers/account.js +9 -1
- package/dist/account-manager/helpers/account.js.map +1 -1
- package/dist/account-manager/index.d.ts +3 -1
- package/dist/account-manager/index.d.ts.map +1 -1
- package/dist/account-manager/index.js +22 -6
- package/dist/account-manager/index.js.map +1 -1
- package/dist/api/com/atproto/admin/deleteAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/deleteAccount.js +4 -2
- package/dist/api/com/atproto/admin/deleteAccount.js.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountHandle.js +1 -1
- package/dist/api/com/atproto/admin/updateAccountHandle.js.map +1 -1
- package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateSubjectStatus.js +2 -0
- package/dist/api/com/atproto/admin/updateSubjectStatus.js.map +1 -1
- package/dist/api/com/atproto/identity/submitPlcOperation.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/submitPlcOperation.js.map +1 -1
- package/dist/api/com/atproto/identity/updateHandle.js +1 -1
- package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
- package/dist/api/com/atproto/repo/describeRepo.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/describeRepo.js +2 -4
- package/dist/api/com/atproto/repo/describeRepo.js.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.js +2 -1
- package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/createAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createAccount.js +4 -2
- package/dist/api/com/atproto/server/createAccount.js.map +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.js +2 -0
- package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/deleteAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deleteAccount.js +4 -3
- package/dist/api/com/atproto/server/deleteAccount.js.map +1 -1
- package/dist/api/com/atproto/server/util.d.ts +1 -0
- package/dist/api/com/atproto/server/util.d.ts.map +1 -1
- package/dist/api/com/atproto/server/util.js +9 -6
- package/dist/api/com/atproto/server/util.js.map +1 -1
- package/dist/api/com/atproto/sync/deprecated/getCheckout.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/deprecated/getCheckout.js +2 -8
- package/dist/api/com/atproto/sync/deprecated/getCheckout.js.map +1 -1
- package/dist/api/com/atproto/sync/deprecated/getHead.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/deprecated/getHead.js +2 -7
- package/dist/api/com/atproto/sync/deprecated/getHead.js.map +1 -1
- package/dist/api/com/atproto/sync/getBlob.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getBlob.js +3 -6
- package/dist/api/com/atproto/sync/getBlob.js.map +1 -1
- package/dist/api/com/atproto/sync/getBlocks.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getBlocks.js +2 -7
- package/dist/api/com/atproto/sync/getBlocks.js.map +1 -1
- package/dist/api/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getLatestCommit.js +2 -7
- package/dist/api/com/atproto/sync/getLatestCommit.js.map +1 -1
- package/dist/api/com/atproto/sync/getRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getRecord.js +2 -7
- package/dist/api/com/atproto/sync/getRecord.js.map +1 -1
- package/dist/api/com/atproto/sync/getRepo.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getRepo.js +2 -7
- package/dist/api/com/atproto/sync/getRepo.js.map +1 -1
- package/dist/api/com/atproto/sync/getRepoStatus.d.ts +4 -0
- package/dist/api/com/atproto/sync/getRepoStatus.d.ts.map +1 -0
- package/dist/api/com/atproto/sync/getRepoStatus.js +28 -0
- package/dist/api/com/atproto/sync/getRepoStatus.js.map +1 -0
- package/dist/api/com/atproto/sync/index.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/index.js +2 -0
- package/dist/api/com/atproto/sync/index.js.map +1 -1
- package/dist/api/com/atproto/sync/listBlobs.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/listBlobs.js +2 -8
- package/dist/api/com/atproto/sync/listBlobs.js.map +1 -1
- package/dist/api/com/atproto/sync/listRepos.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/listRepos.js +13 -8
- package/dist/api/com/atproto/sync/listRepos.js.map +1 -1
- package/dist/api/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/subscribeRepos.js +8 -0
- package/dist/api/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/api/com/atproto/sync/util.d.ts +11 -0
- package/dist/api/com/atproto/sync/util.d.ts.map +1 -0
- package/dist/api/com/atproto/sync/util.js +41 -0
- package/dist/api/com/atproto/sync/util.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lexicon/index.d.ts +2 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +4 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +105 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +185 -4
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/defs.d.ts +1 -1
- package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts +1 -1
- package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts +42 -0
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.js +3 -0
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.js.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +3 -0
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/listRepos.js.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts +19 -4
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js +11 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/scripts/index.d.ts +4 -0
- package/dist/scripts/index.d.ts.map +1 -0
- package/dist/scripts/index.js +8 -0
- package/dist/scripts/index.js.map +1 -0
- package/dist/scripts/rebuild-repo.d.ts +3 -0
- package/dist/scripts/rebuild-repo.d.ts.map +1 -0
- package/dist/scripts/rebuild-repo.js +121 -0
- package/dist/scripts/rebuild-repo.js.map +1 -0
- package/dist/sequencer/db/schema.d.ts +1 -1
- package/dist/sequencer/db/schema.d.ts.map +1 -1
- package/dist/sequencer/events.d.ts +27 -2
- package/dist/sequencer/events.d.ts.map +1 -1
- package/dist/sequencer/events.js +35 -2
- package/dist/sequencer/events.js.map +1 -1
- package/dist/sequencer/sequencer.d.ts +8 -6
- package/dist/sequencer/sequencer.d.ts.map +1 -1
- package/dist/sequencer/sequencer.js +22 -9
- package/dist/sequencer/sequencer.js.map +1 -1
- package/package.json +4 -4
- package/src/account-manager/helpers/account.ts +8 -0
- package/src/account-manager/index.ts +19 -6
- package/src/api/com/atproto/admin/deleteAccount.ts +7 -2
- package/src/api/com/atproto/admin/updateAccountHandle.ts +1 -1
- package/src/api/com/atproto/admin/updateSubjectStatus.ts +2 -0
- package/src/api/com/atproto/identity/submitPlcOperation.ts +1 -0
- package/src/api/com/atproto/identity/updateHandle.ts +1 -1
- package/src/api/com/atproto/repo/describeRepo.ts +2 -4
- package/src/api/com/atproto/server/activateAccount.ts +2 -1
- package/src/api/com/atproto/server/createAccount.ts +6 -3
- package/src/api/com/atproto/server/deactivateAccount.ts +2 -0
- package/src/api/com/atproto/server/deleteAccount.ts +7 -3
- package/src/api/com/atproto/server/util.ts +12 -5
- package/src/api/com/atproto/sync/deprecated/getCheckout.ts +6 -8
- package/src/api/com/atproto/sync/deprecated/getHead.ts +7 -10
- package/src/api/com/atproto/sync/getBlob.ts +8 -6
- package/src/api/com/atproto/sync/getBlocks.ts +6 -7
- package/src/api/com/atproto/sync/getLatestCommit.ts +7 -10
- package/src/api/com/atproto/sync/getRecord.ts +7 -7
- package/src/api/com/atproto/sync/getRepo.ts +6 -7
- package/src/api/com/atproto/sync/getRepoStatus.ts +31 -0
- package/src/api/com/atproto/sync/index.ts +2 -0
- package/src/api/com/atproto/sync/listBlobs.ts +6 -8
- package/src/api/com/atproto/sync/listRepos.ts +13 -8
- package/src/api/com/atproto/sync/subscribeRepos.ts +7 -0
- package/src/api/com/atproto/sync/util.ts +59 -0
- package/src/index.ts +1 -0
- package/src/lexicon/index.ts +12 -0
- package/src/lexicon/lexicons.ts +193 -7
- package/src/lexicon/types/chat/bsky/convo/defs.ts +1 -1
- package/src/lexicon/types/com/atproto/sync/getBlob.ts +6 -0
- package/src/lexicon/types/com/atproto/sync/getBlocks.ts +6 -0
- package/src/lexicon/types/com/atproto/sync/getLatestCommit.ts +1 -1
- package/src/lexicon/types/com/atproto/sync/getRecord.ts +6 -0
- package/src/lexicon/types/com/atproto/sync/getRepo.ts +1 -0
- package/src/lexicon/types/com/atproto/sync/getRepoStatus.ts +52 -0
- package/src/lexicon/types/com/atproto/sync/listBlobs.ts +1 -0
- package/src/lexicon/types/com/atproto/sync/listRepos.ts +3 -0
- package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +30 -3
- package/src/scripts/index.ts +5 -0
- package/src/scripts/rebuild-repo.ts +143 -0
- package/src/sequencer/db/schema.ts +1 -0
- package/src/sequencer/events.ts +47 -0
- package/src/sequencer/sequencer.ts +35 -14
- package/tests/account-deactivation.test.ts +36 -10
- package/tests/account-deletion.test.ts +10 -2
- package/tests/moderation.test.ts +2 -2
- package/tests/proxied/notif.test.ts +1 -0
- package/tests/sequencer.test.ts +2 -2
- package/tests/sync/list.test.ts +1 -0
- package/tests/sync/subscribe-repos.test.ts +224 -40
- package/tests/sync/sync.test.ts +48 -4
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.assertValidDidDocumentForService = exports.isValidDidDocForService = exports.didDocForSession = exports.getRandomToken = exports.genInvCodes = exports.genInvCode = void 0;
|
26
|
+
exports.assertValidDidDocumentForService = exports.isValidDidDocForService = exports.didDocForSession = exports.safeResolveDidDoc = exports.getRandomToken = exports.genInvCodes = exports.genInvCode = void 0;
|
27
27
|
const crypto = __importStar(require("@atproto/crypto"));
|
28
28
|
const logger_1 = require("../../../../logger");
|
29
29
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
@@ -50,18 +50,21 @@ const getRandomToken = () => {
|
|
50
50
|
return token.slice(0, 5) + '-' + token.slice(5, 10);
|
51
51
|
};
|
52
52
|
exports.getRandomToken = getRandomToken;
|
53
|
-
|
54
|
-
const didDocForSession = async (ctx, did, forceRefresh) => {
|
55
|
-
if (!ctx.cfg.identity.enableDidDocWithSession)
|
56
|
-
return;
|
53
|
+
const safeResolveDidDoc = async (ctx, did, forceRefresh) => {
|
57
54
|
try {
|
58
55
|
const didDoc = await ctx.idResolver.did.resolve(did, forceRefresh);
|
59
56
|
return didDoc ?? undefined;
|
60
57
|
}
|
61
58
|
catch (err) {
|
62
|
-
logger_1.
|
59
|
+
logger_1.httpLogger.warn({ err, did }, 'failed to resolve did doc');
|
63
60
|
}
|
64
61
|
};
|
62
|
+
exports.safeResolveDidDoc = safeResolveDidDoc;
|
63
|
+
const didDocForSession = async (ctx, did, forceRefresh) => {
|
64
|
+
if (!ctx.cfg.identity.enableDidDocWithSession)
|
65
|
+
return;
|
66
|
+
return (0, exports.safeResolveDidDoc)(ctx, did, forceRefresh);
|
67
|
+
};
|
65
68
|
exports.didDocForSession = didDocForSession;
|
66
69
|
const isValidDidDocForService = async (ctx, did) => {
|
67
70
|
try {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAyC;AAIzC,+
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAyC;AAIzC,+CAA+C;AAC/C,sDAA0D;AAC1D,4CAAkE;AAElE,mDAAmD;AACnD,gEAAgE;AAChE,4BAA4B;AAC5B,0CAA0C;AACnC,MAAM,UAAU,GAAG,CAAC,GAAiB,EAAU,EAAE;IACtD,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,IAAA,sBAAc,GAAE,CAAA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,IAAA,uBAAc,EAAC,QAAQ,CAAC;YACrC,UAAU,EAAE,IAAA,yBAAgB,EAAC,QAAQ,CAAC;SACvC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAA;AArBY,QAAA,gCAAgC,oCAqB5C;AAED,MAAM,sBAAsB,GAAG,KAAK,EAClC,GAAe,EACf,GAAW,EACX,QAIC,EACD,EAAE;IACF,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAA;IAE1D,MAAM,cAAc,GAClB,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,cAAc,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,EAAE,CAAA;IAC9D,IAAI,YAAY,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,iCAAmB,CAC3B,kDAAkD,CACnD,CAAA;IACH,CAAC;IAED,IAAI,CAAC,WAAW,IAAI,WAAW,KAAK,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QAC9D,MAAM,IAAI,iCAAmB,CAC3B,yEAAyE,CAC1E,CAAA;IACH,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACjD,IAAI,CAAC,UAAU,IAAI,UAAU,KAAK,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;QAChD,MAAM,IAAI,iCAAmB,CAC3B,sEAAsE,CACvE,CAAA;IACH,CAAC;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getCheckout.d.ts","sourceRoot":"","sources":["../../../../../../src/api/com/atproto/sync/deprecated/getCheckout.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"getCheckout.d.ts","sourceRoot":"","sources":["../../../../../../src/api/com/atproto/sync/deprecated/getCheckout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAI/C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAmBvD"}
|
@@ -1,19 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const xrpc_server_1 = require("@atproto/xrpc-server");
|
4
3
|
const getRepo_1 = require("../getRepo");
|
4
|
+
const util_1 = require("../util");
|
5
5
|
function default_1(server, ctx) {
|
6
6
|
server.com.atproto.sync.getCheckout({
|
7
7
|
auth: ctx.authVerifier.optionalAccessOrAdminToken,
|
8
8
|
handler: async ({ params, auth }) => {
|
9
9
|
const { did } = params;
|
10
|
-
|
11
|
-
if (!ctx.authVerifier.isUserOrAdmin(auth, did)) {
|
12
|
-
const available = await ctx.accountManager.isRepoAvailable(did);
|
13
|
-
if (!available) {
|
14
|
-
throw new xrpc_server_1.InvalidRequestError(`Could not find repo for DID: ${did}`);
|
15
|
-
}
|
16
|
-
}
|
10
|
+
await (0, util_1.assertRepoAvailability)(ctx, did, ctx.authVerifier.isUserOrAdmin(auth, did));
|
17
11
|
const carStream = await (0, getRepo_1.getCarStream)(ctx, did);
|
18
12
|
return {
|
19
13
|
encoding: 'application/vnd.ipld.car',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getCheckout.js","sourceRoot":"","sources":["../../../../../../src/api/com/atproto/sync/deprecated/getCheckout.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"getCheckout.js","sourceRoot":"","sources":["../../../../../../src/api/com/atproto/sync/deprecated/getCheckout.ts"],"names":[],"mappings":";;AAEA,wCAAyC;AACzC,kCAAgD;AAEhD,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;QAClC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,0BAA0B;QACjD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;YACtB,MAAM,IAAA,6BAAsB,EAC1B,GAAG,EACH,GAAG,EACH,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAC1C,CAAA;YAED,MAAM,SAAS,GAAG,MAAM,IAAA,sBAAY,EAAC,GAAG,EAAE,GAAG,CAAC,CAAA;YAE9C,OAAO;gBACL,QAAQ,EAAE,0BAA0B;gBACpC,IAAI,EAAE,SAAS;aAChB,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAnBD,4BAmBC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getHead.d.ts","sourceRoot":"","sources":["../../../../../../src/api/com/atproto/sync/deprecated/getHead.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,UAAU,MAAM,wBAAwB,CAAA;
|
1
|
+
{"version":3,"file":"getHead.d.ts","sourceRoot":"","sources":["../../../../../../src/api/com/atproto/sync/deprecated/getHead.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAG/C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0BvD"}
|
@@ -1,18 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
4
|
+
const util_1 = require("../util");
|
4
5
|
function default_1(server, ctx) {
|
5
6
|
server.com.atproto.sync.getHead({
|
6
7
|
auth: ctx.authVerifier.optionalAccessOrAdminToken,
|
7
8
|
handler: async ({ params, auth }) => {
|
8
9
|
const { did } = params;
|
9
|
-
|
10
|
-
if (!ctx.authVerifier.isUserOrAdmin(auth, did)) {
|
11
|
-
const available = await ctx.accountManager.isRepoAvailable(did);
|
12
|
-
if (!available) {
|
13
|
-
throw new xrpc_server_1.InvalidRequestError(`Could not find root for DID: ${did}`, 'HeadNotFound');
|
14
|
-
}
|
15
|
-
}
|
10
|
+
await (0, util_1.assertRepoAvailability)(ctx, did, ctx.authVerifier.isUserOrAdmin(auth, did));
|
16
11
|
const root = await ctx.actorStore.read(did, (store) => store.repo.storage.getRoot());
|
17
12
|
if (root === null) {
|
18
13
|
throw new xrpc_server_1.InvalidRequestError(`Could not find root for DID: ${did}`, 'HeadNotFound');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getHead.js","sourceRoot":"","sources":["../../../../../../src/api/com/atproto/sync/deprecated/getHead.ts"],"names":[],"mappings":";;AAAA,sDAA0D;
|
1
|
+
{"version":3,"file":"getHead.js","sourceRoot":"","sources":["../../../../../../src/api/com/atproto/sync/deprecated/getHead.ts"],"names":[],"mappings":";;AAAA,sDAA0D;AAG1D,kCAAgD;AAEhD,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9B,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,0BAA0B;QACjD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;YACtB,MAAM,IAAA,6BAAsB,EAC1B,GAAG,EACH,GAAG,EACH,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAC1C,CAAA;YAED,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACpD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAC7B,CAAA;YACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBAClB,MAAM,IAAI,iCAAmB,CAC3B,gCAAgC,GAAG,EAAE,EACrC,cAAc,CACf,CAAA;YACH,CAAC;YACD,OAAO;gBACL,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE;aAChC,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AA1BD,4BA0BC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getBlob.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getBlob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;
|
1
|
+
{"version":3,"file":"getBlob.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getBlob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAK5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAoCvD"}
|
@@ -3,16 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const cid_1 = require("multiformats/cid");
|
4
4
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
5
5
|
const repo_1 = require("@atproto/repo");
|
6
|
+
const util_1 = require("./util");
|
6
7
|
function default_1(server, ctx) {
|
7
8
|
server.com.atproto.sync.getBlob({
|
8
9
|
auth: ctx.authVerifier.optionalAccessOrAdminToken,
|
9
10
|
handler: async ({ params, res, auth }) => {
|
10
|
-
|
11
|
-
|
12
|
-
if (!available) {
|
13
|
-
throw new xrpc_server_1.InvalidRequestError('Blob not found');
|
14
|
-
}
|
15
|
-
}
|
11
|
+
const { did } = params;
|
12
|
+
await (0, util_1.assertRepoAvailability)(ctx, did, ctx.authVerifier.isUserOrAdmin(auth, did));
|
16
13
|
const cid = cid_1.CID.parse(params.cid);
|
17
14
|
const found = await ctx.actorStore.read(params.did, async (store) => {
|
18
15
|
try {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getBlob.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getBlob.ts"],"names":[],"mappings":";;AAAA,0CAAsC;AAGtC,sDAA0D;AAC1D,wCAAiD;
|
1
|
+
{"version":3,"file":"getBlob.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getBlob.ts"],"names":[],"mappings":";;AAAA,0CAAsC;AAGtC,sDAA0D;AAC1D,wCAAiD;AACjD,iCAA+C;AAE/C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9B,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,0BAA0B;QACjD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE;YACvC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;YACtB,MAAM,IAAA,6BAAsB,EAC1B,GAAG,EACH,GAAG,EACH,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAC1C,CAAA;YAED,MAAM,GAAG,GAAG,SAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACjC,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;gBAClE,IAAI,CAAC;oBACH,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;gBAC3C,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,IAAI,GAAG,YAAY,wBAAiB,EAAE,CAAC;wBACrC,MAAM,IAAI,iCAAmB,CAAC,gBAAgB,CAAC,CAAA;oBACjD,CAAC;yBAAM,CAAC;wBACN,MAAM,GAAG,CAAA;oBACX,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI,iCAAmB,CAAC,gBAAgB,CAAC,CAAA;YACjD,CAAC;YACD,GAAG,CAAC,SAAS,CAAC,gBAAgB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;YAC3C,GAAG,CAAC,SAAS,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAA;YAClD,GAAG,CAAC,SAAS,CAAC,yBAAyB,EAAE,6BAA6B,CAAC,CAAA;YACvE,OAAO;gBACL,wCAAwC;gBACxC,QAAQ,EAAE,CAAC,KAAK,CAAC,QAAQ,IAAI,0BAA0B,CAAU;gBACjE,IAAI,EAAE,KAAK,CAAC,MAAM;aACnB,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AApCD,4BAoCC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getBlocks.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getBlocks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;
|
1
|
+
{"version":3,"file":"getBlocks.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getBlocks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAG5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA2BvD"}
|
@@ -4,18 +4,13 @@ const cid_1 = require("multiformats/cid");
|
|
4
4
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
5
5
|
const common_1 = require("@atproto/common");
|
6
6
|
const repo_1 = require("@atproto/repo");
|
7
|
+
const util_1 = require("./util");
|
7
8
|
function default_1(server, ctx) {
|
8
9
|
server.com.atproto.sync.getBlocks({
|
9
10
|
auth: ctx.authVerifier.optionalAccessOrAdminToken,
|
10
11
|
handler: async ({ params, auth }) => {
|
11
12
|
const { did } = params;
|
12
|
-
|
13
|
-
if (!ctx.authVerifier.isUserOrAdmin(auth, did)) {
|
14
|
-
const available = await ctx.accountManager.isRepoAvailable(did);
|
15
|
-
if (!available) {
|
16
|
-
throw new xrpc_server_1.InvalidRequestError(`Could not find repo for DID: ${did}`);
|
17
|
-
}
|
18
|
-
}
|
13
|
+
await (0, util_1.assertRepoAvailability)(ctx, did, ctx.authVerifier.isUserOrAdmin(auth, did));
|
19
14
|
const cids = params.cids.map((c) => cid_1.CID.parse(c));
|
20
15
|
const got = await ctx.actorStore.read(did, (store) => store.repo.storage.getBlocks(cids));
|
21
16
|
if (got.missing.length > 0) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getBlocks.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getBlocks.ts"],"names":[],"mappings":";;AAAA,0CAAsC;AACtC,sDAA0D;AAC1D,4CAAsD;AACtD,wCAAiD;
|
1
|
+
{"version":3,"file":"getBlocks.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getBlocks.ts"],"names":[],"mappings":";;AAAA,0CAAsC;AACtC,sDAA0D;AAC1D,4CAAsD;AACtD,wCAAiD;AAGjD,iCAA+C;AAE/C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,0BAA0B;QACjD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,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
|
1
|
+
{"version":3,"file":"getLatestCommit.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getLatestCommit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAG5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0BvD"}
|
@@ -1,18 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
4
|
+
const util_1 = require("./util");
|
4
5
|
function default_1(server, ctx) {
|
5
6
|
server.com.atproto.sync.getLatestCommit({
|
6
7
|
auth: ctx.authVerifier.optionalAccessOrAdminToken,
|
7
8
|
handler: async ({ params, auth }) => {
|
8
9
|
const { did } = params;
|
9
|
-
|
10
|
-
if (!ctx.authVerifier.isUserOrAdmin(auth, did)) {
|
11
|
-
const available = await ctx.accountManager.isRepoAvailable(did);
|
12
|
-
if (!available) {
|
13
|
-
throw new xrpc_server_1.InvalidRequestError(`Could not find root for DID: ${did}`, 'RepoNotFound');
|
14
|
-
}
|
15
|
-
}
|
10
|
+
await (0, util_1.assertRepoAvailability)(ctx, did, ctx.authVerifier.isUserOrAdmin(auth, did));
|
16
11
|
const root = await ctx.actorStore.read(did, (store) => store.repo.storage.getRootDetailed());
|
17
12
|
if (root === null) {
|
18
13
|
throw new xrpc_server_1.InvalidRequestError(`Could not find root for DID: ${did}`, 'RepoNotFound');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getLatestCommit.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getLatestCommit.ts"],"names":[],"mappings":";;AAAA,sDAA0D;
|
1
|
+
{"version":3,"file":"getLatestCommit.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getLatestCommit.ts"],"names":[],"mappings":";;AAAA,sDAA0D;AAG1D,iCAA+C;AAE/C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC;QACtC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,0BAA0B;QACjD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;YACtB,MAAM,IAAA,6BAAsB,EAC1B,GAAG,EACH,GAAG,EACH,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAC1C,CAAA;YAED,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACpD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CACrC,CAAA;YACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBAClB,MAAM,IAAI,iCAAmB,CAC3B,gCAAgC,GAAG,EAAE,EACrC,cAAc,CACf,CAAA;YACH,CAAC;YACD,OAAO;gBACL,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;aAClD,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AA1BD,4BA0BC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getRecord.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;
|
1
|
+
{"version":3,"file":"getRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getRecord.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAK5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwCvD"}
|
@@ -28,18 +28,13 @@ const repo = __importStar(require("@atproto/repo"));
|
|
28
28
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
29
29
|
const common_1 = require("@atproto/common");
|
30
30
|
const sql_repo_reader_1 = require("../../../../actor-store/repo/sql-repo-reader");
|
31
|
+
const util_1 = require("./util");
|
31
32
|
function default_1(server, ctx) {
|
32
33
|
server.com.atproto.sync.getRecord({
|
33
34
|
auth: ctx.authVerifier.optionalAccessOrAdminToken,
|
34
35
|
handler: async ({ params, auth }) => {
|
35
36
|
const { did, collection, rkey } = params;
|
36
|
-
|
37
|
-
if (!ctx.authVerifier.isUserOrAdmin(auth, did)) {
|
38
|
-
const available = await ctx.accountManager.isRepoAvailable(did);
|
39
|
-
if (!available) {
|
40
|
-
throw new xrpc_server_1.InvalidRequestError(`Could not find repo for DID: ${did}`);
|
41
|
-
}
|
42
|
-
}
|
37
|
+
await (0, util_1.assertRepoAvailability)(ctx, did, ctx.authVerifier.isUserOrAdmin(auth, did));
|
43
38
|
// must open up the db outside of store interface so that we can close the file handle after finished streaming
|
44
39
|
const actorDb = await ctx.actorStore.openDb(did);
|
45
40
|
let carStream;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getRecord.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAsC;AACtC,oDAAqC;AACrC,sDAA0D;AAG1D,4CAAsD;AACtD,kFAA4E;
|
1
|
+
{"version":3,"file":"getRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getRecord.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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CAAC;gBACb,OAAO,CAAC,KAAK,EAAE,CAAA;gBACf,MAAM,GAAG,CAAA;YACX,CAAC;YACD,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;YACrC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YAC9B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YAE9B,OAAO;gBACL,QAAQ,EAAE,0BAA0B;gBACpC,IAAI,EAAE,SAAS;aAChB,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAxCD,4BAwCC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getRepo.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;
|
1
|
+
{"version":3,"file":"getRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getRepo.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAO5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAmBvD;AAED,eAAO,MAAM,YAAY,QAClB,UAAU,OACV,MAAM,UACH,MAAM,KACb,QAAQ,OAAO,QAAQ,CAiBzB,CAAA"}
|
@@ -3,18 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCarStream = void 0;
|
4
4
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
5
5
|
const sql_repo_reader_1 = require("../../../../actor-store/repo/sql-repo-reader");
|
6
|
+
const util_1 = require("./util");
|
6
7
|
function default_1(server, ctx) {
|
7
8
|
server.com.atproto.sync.getRepo({
|
8
9
|
auth: ctx.authVerifier.optionalAccessOrAdminToken,
|
9
10
|
handler: async ({ params, auth }) => {
|
10
11
|
const { did, since } = params;
|
11
|
-
|
12
|
-
if (!ctx.authVerifier.isUserOrAdmin(auth, did)) {
|
13
|
-
const available = await ctx.accountManager.isRepoAvailable(did);
|
14
|
-
if (!available) {
|
15
|
-
throw new xrpc_server_1.InvalidRequestError(`Could not find repo for DID: ${did}`);
|
16
|
-
}
|
17
|
-
}
|
12
|
+
await (0, util_1.assertRepoAvailability)(ctx, did, ctx.authVerifier.isUserOrAdmin(auth, did));
|
18
13
|
const carStream = await (0, exports.getCarStream)(ctx, did, since);
|
19
14
|
return {
|
20
15
|
encoding: 'application/vnd.ipld.car',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getRepo.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getRepo.ts"],"names":[],"mappings":";;;AACA,sDAA0D;AAG1D,kFAGqD;
|
1
|
+
{"version":3,"file":"getRepo.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getRepo.ts"],"names":[],"mappings":";;;AACA,sDAA0D;AAG1D,kFAGqD;AACrD,iCAA+C;AAE/C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9B,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,0BAA0B;QACjD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;YAC7B,MAAM,IAAA,6BAAsB,EAC1B,GAAG,EACH,GAAG,EACH,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAC1C,CAAA;YAED,MAAM,SA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AO,UAAU,MAAM,qBAAqB,CAAA;AAG5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0BvD"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const util_1 = require("./util");
|
4
|
+
function default_1(server, ctx) {
|
5
|
+
server.com.atproto.sync.getRepoStatus({
|
6
|
+
handler: async ({ params }) => {
|
7
|
+
const { did } = params;
|
8
|
+
const account = await (0, util_1.assertRepoAvailability)(ctx, did, true);
|
9
|
+
const { active, status } = (0, util_1.formatAccountStatus)(account);
|
10
|
+
let rev = undefined;
|
11
|
+
if (active) {
|
12
|
+
const root = await ctx.actorStore.read(did, (store) => store.repo.storage.getRootDetailed());
|
13
|
+
rev = root.rev;
|
14
|
+
}
|
15
|
+
return {
|
16
|
+
encoding: 'application/json',
|
17
|
+
body: {
|
18
|
+
did,
|
19
|
+
active,
|
20
|
+
status,
|
21
|
+
rev,
|
22
|
+
},
|
23
|
+
};
|
24
|
+
},
|
25
|
+
});
|
26
|
+
}
|
27
|
+
exports.default = default_1;
|
28
|
+
//# sourceMappingURL=getRepoStatus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getRepoStatus.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/getRepoStatus.ts"],"names":[],"mappings":";;AAEA,iCAAoE;AAEpE,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC;QACpC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5B,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;YACtB,MAAM,OAAO,GAAG,MAAM,IAAA,6BAAsB,EAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;YAC5D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAA;YAEvD,IAAI,GAAG,GAAuB,SAAS,CAAA;YACvC,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACpD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CACrC,CAAA;gBACD,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;YAChB,CAAC;YAED,OAAO;gBACL,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE;oBACJ,GAAG;oBACH,MAAM;oBACN,MAAM;oBACN,GAAG;iBACJ;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AA1BD,4BA0BC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAa5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAYvD"}
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const getBlob_1 = __importDefault(require("./getBlob"));
|
7
7
|
const getBlocks_1 = __importDefault(require("./getBlocks"));
|
8
8
|
const getLatestCommit_1 = __importDefault(require("./getLatestCommit"));
|
9
|
+
const getRepoStatus_1 = __importDefault(require("./getRepoStatus"));
|
9
10
|
const getRecord_1 = __importDefault(require("./getRecord"));
|
10
11
|
const getRepo_1 = __importDefault(require("./getRepo"));
|
11
12
|
const subscribeRepos_1 = __importDefault(require("./subscribeRepos"));
|
@@ -17,6 +18,7 @@ function default_1(server, ctx) {
|
|
17
18
|
(0, getBlob_1.default)(server, ctx);
|
18
19
|
(0, getBlocks_1.default)(server, ctx);
|
19
20
|
(0, getLatestCommit_1.default)(server, ctx);
|
21
|
+
(0, getRepoStatus_1.default)(server, ctx);
|
20
22
|
(0, getRecord_1.default)(server, ctx);
|
21
23
|
(0, getRepo_1.default)(server, ctx);
|
22
24
|
(0, subscribeRepos_1.default)(server, ctx);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAA+B;AAC/B,4DAAmC;AACnC,wEAA+C;AAC/C,4DAAmC;AACnC,wDAA+B;AAC/B,sEAA6C;AAC7C,4DAAmC;AACnC,4DAAmC;AACnC,2EAAkD;AAClD,mEAA0C;AAE1C,mBAAyB,MAAc,EAAE,GAAe;IACtD,IAAA,iBAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpB,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,yBAAe,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,iBAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpB,IAAA,wBAAc,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,iBAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACtB,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAA+B;AAC/B,4DAAmC;AACnC,wEAA+C;AAC/C,oEAA2C;AAC3C,4DAAmC;AACnC,wDAA+B;AAC/B,sEAA6C;AAC7C,4DAAmC;AACnC,4DAAmC;AACnC,2EAAkD;AAClD,mEAA0C;AAE1C,mBAAyB,MAAc,EAAE,GAAe;IACtD,IAAA,iBAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpB,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,yBAAe,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,IAAA,uBAAa,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,iBAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpB,IAAA,wBAAc,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,iBAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACtB,CAAC;AAZD,4BAYC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"listBlobs.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/listBlobs.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"listBlobs.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/listBlobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAG5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwBvD"}
|
@@ -1,18 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const
|
3
|
+
const util_1 = require("./util");
|
4
4
|
function default_1(server, ctx) {
|
5
5
|
server.com.atproto.sync.listBlobs({
|
6
6
|
auth: ctx.authVerifier.optionalAccessOrAdminToken,
|
7
7
|
handler: async ({ params, auth }) => {
|
8
8
|
const { did, since, limit, cursor } = params;
|
9
|
-
|
10
|
-
if (!ctx.authVerifier.isUserOrAdmin(auth, did)) {
|
11
|
-
const available = await ctx.accountManager.isRepoAvailable(did);
|
12
|
-
if (!available) {
|
13
|
-
throw new xrpc_server_1.InvalidRequestError(`Could not find root for DID: ${did}`);
|
14
|
-
}
|
15
|
-
}
|
9
|
+
await (0, util_1.assertRepoAvailability)(ctx, did, ctx.authVerifier.isUserOrAdmin(auth, did));
|
16
10
|
const blobCids = await ctx.actorStore.read(did, (store) => store.repo.blob.listBlobs({ since, limit, cursor }));
|
17
11
|
return {
|
18
12
|
encoding: 'application/json',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"listBlobs.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/listBlobs.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"listBlobs.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/listBlobs.ts"],"names":[],"mappings":";;AAEA,iCAA+C;AAE/C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,0BAA0B;QACjD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;YAC5C,MAAM,IAAA,6BAAsB,EAC1B,GAAG,EACH,GAAG,EACH,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAC1C,CAAA;YAED,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACxD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CACpD,CAAA;YAED,OAAO;gBACL,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE;oBACJ,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;oBACvB,IAAI,EAAE,QAAQ;iBACf;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAxBD,4BAwBC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"listRepos.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/listRepos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAY,MAAM,2BAA2B,CAAA;AAG3E,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,
|
1
|
+
{"version":3,"file":"listRepos.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/listRepos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAY,MAAM,2BAA2B,CAAA;AAG3E,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA2CvD;AAED,KAAK,aAAa,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvD,qBAAa,aAAc,SAAQ,aAAa,CAAC,aAAa,EAAE,MAAM,CAAC;IACrE,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM;IAG1C,qBAAqB,CAAC,OAAO,EAAE,MAAM;;;;IAMrC,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;;CAUrC"}
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimeDidKeyset = void 0;
|
4
4
|
const xrpc_server_1 = require("@atproto/xrpc-server");
|
5
5
|
const pagination_1 = require("../../../../db/pagination");
|
6
|
-
const util_1 = require("
|
6
|
+
const util_1 = require("./util");
|
7
7
|
function default_1(server, ctx) {
|
8
8
|
server.com.atproto.sync.listRepos(async ({ params }) => {
|
9
9
|
const { limit, cursor } = params;
|
@@ -12,13 +12,13 @@ function default_1(server, ctx) {
|
|
12
12
|
let builder = db.db
|
13
13
|
.selectFrom('actor')
|
14
14
|
.innerJoin('repo_root', 'repo_root.did', 'actor.did')
|
15
|
-
.where((0, util_1.notSoftDeletedClause)(ref('actor')))
|
16
|
-
.where('actor.deactivatedAt', 'is', null)
|
17
15
|
.select([
|
18
16
|
'actor.did as did',
|
19
17
|
'repo_root.cid as head',
|
20
18
|
'repo_root.rev as rev',
|
21
19
|
'actor.createdAt as createdAt',
|
20
|
+
'actor.deactivatedAt as deactivatedAt',
|
21
|
+
'actor.takedownRef as takedownRef',
|
22
22
|
]);
|
23
23
|
const keyset = new TimeDidKeyset(ref('actor.createdAt'), ref('actor.did'));
|
24
24
|
builder = (0, pagination_1.paginate)(builder, {
|
@@ -29,11 +29,16 @@ function default_1(server, ctx) {
|
|
29
29
|
tryIndex: true,
|
30
30
|
});
|
31
31
|
const res = await builder.execute();
|
32
|
-
const repos = res.map((row) =>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
const repos = res.map((row) => {
|
33
|
+
const { active, status } = (0, util_1.formatAccountStatus)(row);
|
34
|
+
return {
|
35
|
+
did: row.did,
|
36
|
+
head: row.head,
|
37
|
+
rev: row.rev ?? '',
|
38
|
+
active,
|
39
|
+
status,
|
40
|
+
};
|
41
|
+
});
|
37
42
|
return {
|
38
43
|
encoding: 'application/json',
|
39
44
|
body: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"listRepos.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/listRepos.ts"],"names":[],"mappings":";;;AAAA,sDAA0D;AAG1D,0DAA2E;AAC3E,
|
1
|
+
{"version":3,"file":"listRepos.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/listRepos.ts"],"names":[],"mappings":";;;AAAA,sDAA0D;AAG1D,0DAA2E;AAC3E,iCAA4C;AAE5C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACrD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;QAChC,MAAM,EAAE,GAAG,GAAG,CAAC,cAAc,CAAC,EAAE,CAAA;QAChC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,OAAO,CAAA;QAC7B,IAAI,OAAO,GAAG,EAAE,CAAC,EAAE;aAChB,UAAU,CAAC,OAAO,CAAC;aACnB,SAAS,CAAC,WAAW,EAAE,eAAe,EAAE,WAAW,CAAC;aACpD,MAAM,CAAC;YACN,kBAAkB;YAClB,uBAAuB;YACvB,sBAAsB;YACtB,8BAA8B;YAC9B,sCAAsC;YACtC,kCAAkC;SACnC,CAAC,CAAA;QACJ,MAAM,MAAM,GAAG,IAAI,aAAa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AW,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;QAC1D,IAAI,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,iCAAmB,CAAC,kBAAkB,CAAC,CAAA;QACnD,CAAC;QACD,OAAO;YACL,OAAO,EAAE,WAAW,CAAC,WAAW,EAAE;YAClC,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAA;IACH,CAAC;CACF;AApBD,sCAoBC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subscribeRepos.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/subscribeRepos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAI5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,
|
1
|
+
{"version":3,"file":"subscribeRepos.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/subscribeRepos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAI5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwEvD"}
|
@@ -62,6 +62,14 @@ function default_1(server, ctx) {
|
|
62
62
|
...evt.evt,
|
63
63
|
};
|
64
64
|
}
|
65
|
+
else if (evt.type === 'account') {
|
66
|
+
yield {
|
67
|
+
$type: '#account',
|
68
|
+
seq: evt.seq,
|
69
|
+
time: evt.time,
|
70
|
+
...evt.evt,
|
71
|
+
};
|
72
|
+
}
|
65
73
|
else if (evt.type === 'tombstone') {
|
66
74
|
yield {
|
67
75
|
$type: '#tombstone',
|
@@ -1 +1 @@
|
|
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CAAC,GAAG;oBACZ,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,GAAG,GAAG,CAAC,GAAG;iBACX,CAAA;YACH,CAAC;iBAAM,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAClC,MAAM;oBACJ,KAAK,EAAE,UAAU;oBACjB,GAAG,EAAE,GAAG,CAAC,GAAG;oBACZ,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,GAAG,GAAG,CAAC,GAAG;iBACX,CAAA;YACH,CAAC;iBAAM,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBACpC,MAAM;oBACJ,KAAK,EAAE,YAAY;oBACnB,GAAG,EAAE,GAAG,CAAC,GAAG;oBACZ,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,GAAG,GAAG,CAAC,GAAG;iBACX,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAxED,4BAwEC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { AccountStatus, ActorAccount } from '../../../../account-manager/helpers/account';
|
2
|
+
import AppContext from '../../../../context';
|
3
|
+
export declare const assertRepoAvailability: (ctx: AppContext, did: string, isAdminOrSelf: boolean) => Promise<ActorAccount>;
|
4
|
+
export declare const formatAccountStatus: (account: {
|
5
|
+
takedownRef: string | null;
|
6
|
+
deactivatedAt: string | null;
|
7
|
+
}) => {
|
8
|
+
active: boolean;
|
9
|
+
status?: AccountStatus;
|
10
|
+
};
|
11
|
+
//# sourceMappingURL=util.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/sync/util.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,YAAY,EACb,MAAM,6CAA6C,CAAA;AACpD,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAE5C,eAAO,MAAM,sBAAsB,QAC5B,UAAU,OACV,MAAM,iBACI,OAAO,KACrB,QAAQ,YAAY,CA2BtB,CAAA;AAED,eAAO,MAAM,mBAAmB,YAAa;IAC3C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B,KAAG;IACF,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,aAAa,CAAA;CAavB,CAAA"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.formatAccountStatus = exports.assertRepoAvailability = void 0;
|
4
|
+
const xrpc_server_1 = require("@atproto/xrpc-server");
|
5
|
+
const account_1 = require("../../../../account-manager/helpers/account");
|
6
|
+
const assertRepoAvailability = async (ctx, did, isAdminOrSelf) => {
|
7
|
+
const account = await ctx.accountManager.getAccount(did, {
|
8
|
+
includeDeactivated: true,
|
9
|
+
includeTakenDown: true,
|
10
|
+
});
|
11
|
+
if (!account) {
|
12
|
+
throw new xrpc_server_1.InvalidRequestError(`Could not find repo for DID: ${did}`, 'RepoNotFound');
|
13
|
+
}
|
14
|
+
if (isAdminOrSelf) {
|
15
|
+
return account;
|
16
|
+
}
|
17
|
+
if (account.takedownRef) {
|
18
|
+
throw new xrpc_server_1.InvalidRequestError(`Repo has been takendown: ${did}`, 'RepoTakendown');
|
19
|
+
}
|
20
|
+
if (account.deactivatedAt) {
|
21
|
+
throw new xrpc_server_1.InvalidRequestError(`Repo has been deactivated: ${did}`, 'RepoDeactivated');
|
22
|
+
}
|
23
|
+
return account;
|
24
|
+
};
|
25
|
+
exports.assertRepoAvailability = assertRepoAvailability;
|
26
|
+
const formatAccountStatus = (account) => {
|
27
|
+
let status = undefined;
|
28
|
+
if (account.takedownRef) {
|
29
|
+
status = account_1.AccountStatus.Takendown;
|
30
|
+
}
|
31
|
+
else if (account.deactivatedAt) {
|
32
|
+
status = account_1.AccountStatus.Deactivated;
|
33
|
+
}
|
34
|
+
const active = !status;
|
35
|
+
return {
|
36
|
+
active,
|
37
|
+
status,
|
38
|
+
};
|
39
|
+
};
|
40
|
+
exports.formatAccountStatus = formatAccountStatus;
|
41
|
+
//# sourceMappingURL=util.js.map
|