@atproto/bsky 0.0.201 → 0.0.202
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/CHANGELOG.md +6 -0
- package/dist/api/app/bsky/ageassurance/begin.d.ts.map +1 -1
- package/dist/api/app/bsky/ageassurance/begin.js +15 -8
- package/dist/api/app/bsky/ageassurance/begin.js.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/sitemap.d.ts +4 -0
- package/dist/api/sitemap.d.ts.map +1 -0
- package/dist/api/sitemap.js +67 -0
- package/dist/api/sitemap.js.map +1 -0
- package/dist/data-plane/server/routes/index.d.ts.map +1 -1
- package/dist/data-plane/server/routes/index.js +2 -0
- package/dist/data-plane/server/routes/index.js.map +1 -1
- package/dist/data-plane/server/routes/profile.d.ts.map +1 -1
- package/dist/data-plane/server/routes/profile.js +10 -8
- package/dist/data-plane/server/routes/profile.js.map +1 -1
- package/dist/data-plane/server/routes/sitemap.d.ts +5 -0
- package/dist/data-plane/server/routes/sitemap.d.ts.map +1 -0
- package/dist/data-plane/server/routes/sitemap.js +38 -0
- package/dist/data-plane/server/routes/sitemap.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +2 -2
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +1 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/proto/bsky_connect.d.ts +21 -1
- package/dist/proto/bsky_connect.d.ts.map +1 -1
- package/dist/proto/bsky_connect.js +20 -0
- package/dist/proto/bsky_connect.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +97 -0
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +256 -5
- package/dist/proto/bsky_pb.js.map +1 -1
- package/package.json +6 -6
- package/proto/bsky.proto +31 -0
- package/src/api/app/bsky/ageassurance/begin.ts +21 -11
- package/src/api/index.ts +2 -0
- package/src/api/sitemap.ts +76 -0
- package/src/data-plane/server/routes/index.ts +2 -0
- package/src/data-plane/server/routes/profile.ts +8 -6
- package/src/data-plane/server/routes/sitemap.ts +43 -0
- package/src/index.ts +6 -1
- package/src/lexicon/lexicons.ts +1 -0
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +1 -0
- package/src/proto/bsky_connect.ts +21 -1
- package/src/proto/bsky_pb.ts +188 -0
- package/tests/sitemap.test.ts +75 -0
- package/tests/views/age-assurance-v2.test.ts +51 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atproto/bsky
|
|
2
2
|
|
|
3
|
+
## 0.0.202
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4441](https://github.com/bluesky-social/atproto/pull/4441) [`45928bf`](https://github.com/bluesky-social/atproto/commit/45928bfcd6d220216078d5106f134fc3a81f564b) Thanks [@estrattonbailey](https://github.com/estrattonbailey)! - Fix optimistic response from `ageassurance.begin()`, retain existing `status` and `access` values if they exist.
|
|
8
|
+
|
|
3
9
|
## 0.0.201
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"begin.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/ageassurance/begin.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAkB5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"begin.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/ageassurance/begin.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAkB5C,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAkHvD"}
|
|
@@ -25,10 +25,10 @@ function default_1(server, ctx) {
|
|
|
25
25
|
}
|
|
26
26
|
const actorDid = auth.credentials.iss;
|
|
27
27
|
const actorInfo = await getAgeVerificationState(ctx, actorDid);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
28
|
+
const existingStatus = actorInfo?.ageAssuranceStatus?.status;
|
|
29
|
+
const existingAccess = actorInfo?.ageAssuranceStatus?.access;
|
|
30
|
+
if (existingStatus === 'blocked') {
|
|
31
|
+
throw new xrpc_server_1.InvalidRequestError(`Cannot initiate age assurance flow from current state: ${existingStatus}`, 'InvalidInitiation');
|
|
32
32
|
}
|
|
33
33
|
const attemptId = node_crypto_1.default.randomUUID();
|
|
34
34
|
const { email, language, countryCode, regionCode } = validateInput(input.body);
|
|
@@ -82,14 +82,21 @@ function default_1(server, ctx) {
|
|
|
82
82
|
language,
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
+
// If we have existing status/access for this region, retain it.
|
|
86
|
+
const nextStatus = existingStatus && existingStatus !== 'unknown'
|
|
87
|
+
? existingStatus
|
|
88
|
+
: 'pending';
|
|
89
|
+
const nextAccess = existingAccess && existingAccess !== 'unknown'
|
|
90
|
+
? existingAccess
|
|
91
|
+
: 'unknown';
|
|
85
92
|
const event = await (0, stash_1.createEvent)(ctx, actorDid, {
|
|
86
93
|
attemptId,
|
|
87
94
|
email,
|
|
88
95
|
// Assumes `app.set('trust proxy', ...)` configured with `true` or specific values.
|
|
89
96
|
initIp: req.ip,
|
|
90
97
|
initUa: (0, util_2.getClientUa)(req),
|
|
91
|
-
status:
|
|
92
|
-
access:
|
|
98
|
+
status: nextStatus,
|
|
99
|
+
access: nextAccess,
|
|
93
100
|
countryCode,
|
|
94
101
|
regionCode,
|
|
95
102
|
});
|
|
@@ -97,8 +104,8 @@ function default_1(server, ctx) {
|
|
|
97
104
|
encoding: 'application/json',
|
|
98
105
|
body: {
|
|
99
106
|
lastInitiatedAt: event.createdAt,
|
|
100
|
-
status:
|
|
101
|
-
access:
|
|
107
|
+
status: nextStatus,
|
|
108
|
+
access: nextAccess,
|
|
102
109
|
},
|
|
103
110
|
};
|
|
104
111
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"begin.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/ageassurance/begin.ts"],"names":[],"mappings":";;;;;AA2BA,
|
|
1
|
+
{"version":3,"file":"begin.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/ageassurance/begin.ts"],"names":[],"mappings":";;;;;AA2BA,4BAkHC;AA7ID,8DAAgC;AAChC,2CAA4C;AAC5C,6EAA+D;AAC/D,sCAA0D;AAC1D,sDAG6B;AAI7B,+CAAsD;AAEtD,wDAAmE;AACnE,4DAGyC;AACzC,kFAIoD;AACpD,wDAA0D;AAC1D,sDAAkE;AAClE,4CAA+C;AAE/C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QACjC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,QAAQ;QAC/B,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACtC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;gBACnB,MAAM,IAAI,uCAAyB,CACjC,0DAA0D,CA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AAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE;oBACJ,eAAe,EAAE,KAAK,CAAC,SAAS;oBAChC,MAAM,EAAE,UAAU;oBAClB,MAAM,EAAE,UAAU;iBACnB;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAe;IAC9D,IAAI,CAAC,IAAA,sBAAY,EAAC,KAAK,CAAC,IAAI,IAAA,+CAAiB,EAAC,KAAK,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,iCAAmB,CAC3B,oEAAoE,EACpE,cAAc,CACf,CAAA;IACH,CAAC;IAED,OAAO;QACL,KAAK;QACL,QAAQ,EAAE,+BAAuB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;QACjE,GAAG,IAAI;KACR,CAAA;AACH,CAAC;AAED,KAAK,UAAU,uBAAuB,CACpC,GAAe,EACf,QAAgB;IAEhB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC;YACxC,IAAI,EAAE,CAAC,QAAQ,CAAC;YAChB,yBAAyB,EAAE,CAAC,QAAQ,CAAC;YACrC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;SAC7B,CAAC,CAAA;QAEF,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC","sourcesContent":["import crypto from 'node:crypto'\nimport { isEmailValid } from '@hapi/address'\nimport { isDisposableEmail } from 'disposable-email-domains-js'\nimport { getAgeAssuranceRegionConfig } from '@atproto/api'\nimport {\n InvalidRequestError,\n MethodNotImplementedError,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context'\nimport { Server } from '../../../../lexicon'\nimport { InputSchema } from '../../../../lexicon/types/app/bsky/ageassurance/begin'\nimport { httpLogger as log } from '../../../../logger'\nimport { ActorInfo } from '../../../../proto/bsky_pb'\nimport { AGE_ASSURANCE_CONFIG } from '../../../age-assurance/const'\nimport {\n KWS_SUPPORTED_LANGUAGES,\n KWS_V2_COUNTRIES,\n} from '../../../age-assurance/kws/const'\nimport {\n KWSExternalPayloadTooLargeError,\n KWSExternalPayloadVersion,\n serializeKWSExternalPayloadV2,\n} from '../../../age-assurance/kws/external-payload'\nimport { createEvent } from '../../../age-assurance/stash'\nimport { createLocationString } from '../../../age-assurance/util'\nimport { getClientUa } from '../../../kws/util'\n\nexport default function (server: Server, ctx: AppContext) {\n server.app.bsky.ageassurance.begin({\n auth: ctx.authVerifier.standard,\n handler: async ({ auth, input, req }) => {\n if (!ctx.kwsClient) {\n throw new MethodNotImplementedError(\n 'This service is not configured to support age assurance.',\n )\n }\n\n const actorDid = auth.credentials.iss\n const actorInfo = await getAgeVerificationState(ctx, actorDid)\n const existingStatus = actorInfo?.ageAssuranceStatus?.status\n const existingAccess = actorInfo?.ageAssuranceStatus?.access\n\n if (existingStatus === 'blocked') {\n throw new InvalidRequestError(\n `Cannot initiate age assurance flow from current state: ${existingStatus}`,\n 'InvalidInitiation',\n )\n }\n\n const attemptId = crypto.randomUUID()\n const { email, language, countryCode, regionCode } = validateInput(\n input.body,\n )\n\n let externalPayload: string\n try {\n externalPayload = serializeKWSExternalPayloadV2({\n version: KWSExternalPayloadVersion.V2,\n actorDid,\n attemptId,\n countryCode,\n regionCode,\n })\n } catch (err) {\n if (err instanceof KWSExternalPayloadTooLargeError) {\n log.error({ err, actorDid }, err.message)\n throw new InvalidRequestError(\n 'Age Assurance flow failed because DID is too long',\n 'DidTooLong',\n )\n }\n throw err\n }\n\n /*\n * Determine if age assurance config exists for this region. The calling\n * application should already have checked for this, so this is just a\n * safeguard.\n */\n const region = getAgeAssuranceRegionConfig(AGE_ASSURANCE_CONFIG, {\n countryCode,\n regionCode,\n })\n if (!region) {\n const message = 'Age Assurance is not required in this region'\n log.error({ actorDid, countryCode, regionCode }, message)\n throw new InvalidRequestError(message, 'RegionNotSupported')\n }\n\n const location = createLocationString(countryCode, regionCode)\n\n if (KWS_V2_COUNTRIES.has(region.countryCode)) {\n // `age-verified` flow\n await ctx.kwsClient.sendAgeVerifiedFlowEmail({\n location,\n email,\n externalPayload,\n language,\n })\n } else {\n // `adult-verified` flow is what we've been using prior to `age-verified`\n await ctx.kwsClient.sendAdultVerifiedFlowEmail({\n location,\n email,\n externalPayload,\n language,\n })\n }\n\n // If we have existing status/access for this region, retain it.\n const nextStatus =\n existingStatus && existingStatus !== 'unknown'\n ? existingStatus\n : 'pending'\n const nextAccess =\n existingAccess && existingAccess !== 'unknown'\n ? existingAccess\n : 'unknown'\n\n const event = await createEvent(ctx, actorDid, {\n attemptId,\n email,\n // Assumes `app.set('trust proxy', ...)` configured with `true` or specific values.\n initIp: req.ip,\n initUa: getClientUa(req),\n status: nextStatus,\n access: nextAccess,\n countryCode,\n regionCode,\n })\n\n return {\n encoding: 'application/json',\n body: {\n lastInitiatedAt: event.createdAt,\n status: nextStatus,\n access: nextAccess,\n },\n }\n },\n })\n}\n\nfunction validateInput({ email, language, ...rest }: InputSchema): InputSchema {\n if (!isEmailValid(email) || isDisposableEmail(email)) {\n throw new InvalidRequestError(\n 'This email address is not supported, please use a different email.',\n 'InvalidEmail',\n )\n }\n\n return {\n email,\n language: KWS_SUPPORTED_LANGUAGES.has(language) ? language : 'en',\n ...rest,\n }\n}\n\nasync function getAgeVerificationState(\n ctx: AppContext,\n actorDid: string,\n): Promise<ActorInfo | undefined> {\n try {\n const res = await ctx.dataplane.getActors({\n dids: [actorDid],\n returnAgeAssuranceForDids: [actorDid],\n skipCacheForDids: [actorDid],\n })\n\n return res.actors[0]\n } catch (err) {\n return undefined\n }\n}\n"]}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export * as health from './health';
|
|
|
4
4
|
export * as wellKnown from './well-known';
|
|
5
5
|
export * as blobResolver from './blob-resolver';
|
|
6
6
|
export * as external from './external';
|
|
7
|
+
export * as sitemap from './sitemap';
|
|
7
8
|
export default function (server: Server, ctx: AppContext): Server;
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAwFnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAElC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAA;AAEzC,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;AAE/C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAA;AAEtC,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,UA0FvD"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAwFnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAElC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAA;AAEzC,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;AAE/C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAA;AAEtC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AAEpC,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,UA0FvD"}
|
package/dist/api/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.external = exports.blobResolver = exports.wellKnown = exports.health = void 0;
|
|
39
|
+
exports.sitemap = exports.external = exports.blobResolver = exports.wellKnown = exports.health = void 0;
|
|
40
40
|
exports.default = default_1;
|
|
41
41
|
const getProfile_1 = __importDefault(require("./app/bsky/actor/getProfile"));
|
|
42
42
|
const getProfiles_1 = __importDefault(require("./app/bsky/actor/getProfiles"));
|
|
@@ -128,6 +128,7 @@ exports.health = __importStar(require("./health"));
|
|
|
128
128
|
exports.wellKnown = __importStar(require("./well-known"));
|
|
129
129
|
exports.blobResolver = __importStar(require("./blob-resolver"));
|
|
130
130
|
exports.external = __importStar(require("./external"));
|
|
131
|
+
exports.sitemap = __importStar(require("./sitemap"));
|
|
131
132
|
function default_1(server, ctx) {
|
|
132
133
|
// app.bsky
|
|
133
134
|
(0, getTimeline_1.default)(server, ctx);
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiGA,4BA0FC;AAzLD,6EAAoD;AACpD,+EAAsD;AACtD,qFAA4D;AAC5D,iFAAwD;AACxD,mGAA0E;AAC1E,0EAAmD;AACnD,kFAA2D;AAC3D,gFAAyD;AACzD,wFAA+D;AAC/D,wFAA+D;AAC/D,oFAA2D;AAC3D,mFAA0D;AAC1D,+EAAsD;AACtD,qFAA4D;AAC5D,uFAA8D;AAC9D,+EAAsD;AACtD,uGAA8E;AAC9E,iFAAwD;AACxD,kFAAyD;AACzD,kFAAyD;AACzD,kFAAyD;AACzD,sEAA6C;AAC7C,wFAA+D;AAC/D,0FAAiE;AACjE,wEAA+C;AAC/C,8EAAqD;AACrD,kFAAyD;AACzD,wEAA+C;AAC/C,0EAA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AE,GAAG,CAAC,CAAA;IACzB,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,kCAAwB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrC,IAAA,8BAAoB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,IAAA,8BAAoB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,IAAA,0BAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAA,mBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,kBAAU,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,IAAA,eAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpB,cAAc;IACd,IAAA,0BAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAA,6BAAmB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAChC,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,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { AppContext } from '../context'\nimport { Server } from '../lexicon'\nimport getProfile from './app/bsky/actor/getProfile'\nimport getProfiles from './app/bsky/actor/getProfiles'\nimport getSuggestions from './app/bsky/actor/getSuggestions'\nimport searchActors from './app/bsky/actor/searchActors'\nimport searchActorsTypeahead from './app/bsky/actor/searchActorsTypeahead'\nimport aaBegin from './app/bsky/ageassurance/begin'\nimport aaGetConfig from './app/bsky/ageassurance/getConfig'\nimport aaGetState from './app/bsky/ageassurance/getState'\nimport createBookmark from './app/bsky/bookmark/createBookmark'\nimport deleteBookmark from './app/bsky/bookmark/deleteBookmark'\nimport getBookmarks from './app/bsky/bookmark/getBookmarks'\nimport dismissMatch from './app/bsky/contact/dismissMatch'\nimport getMatches from './app/bsky/contact/getMatches'\nimport getSyncStatus from './app/bsky/contact/getSyncStatus'\nimport importContacts from './app/bsky/contact/importContacts'\nimport removeData from './app/bsky/contact/removeData'\nimport startPhoneVerification from './app/bsky/contact/startPhoneVerification'\nimport verifyPhone from './app/bsky/contact/verifyPhone'\nimport getActorFeeds from './app/bsky/feed/getActorFeeds'\nimport getActorLikes from './app/bsky/feed/getActorLikes'\nimport getAuthorFeed from './app/bsky/feed/getAuthorFeed'\nimport getFeed from './app/bsky/feed/getFeed'\nimport getFeedGenerator from './app/bsky/feed/getFeedGenerator'\nimport getFeedGenerators from './app/bsky/feed/getFeedGenerators'\nimport getLikes from './app/bsky/feed/getLikes'\nimport getListFeed from './app/bsky/feed/getListFeed'\nimport getPostThread from './app/bsky/feed/getPostThread'\nimport getPosts from './app/bsky/feed/getPosts'\nimport getQuotes from './app/bsky/feed/getQuotes'\nimport getRepostedBy from './app/bsky/feed/getRepostedBy'\nimport getSuggestedFeeds from './app/bsky/feed/getSuggestedFeeds'\nimport getTimeline from './app/bsky/feed/getTimeline'\nimport searchPosts from './app/bsky/feed/searchPosts'\nimport getActorStarterPacks from './app/bsky/graph/getActorStarterPacks'\nimport getBlocks from './app/bsky/graph/getBlocks'\nimport getFollowers from './app/bsky/graph/getFollowers'\nimport getFollows from './app/bsky/graph/getFollows'\nimport getKnownFollowers from './app/bsky/graph/getKnownFollowers'\nimport getList from './app/bsky/graph/getList'\nimport getListBlocks from './app/bsky/graph/getListBlocks'\nimport getListMutes from './app/bsky/graph/getListMutes'\nimport getLists from './app/bsky/graph/getLists'\nimport getListsWithMembership from './app/bsky/graph/getListsWithMembership'\nimport getMutes from './app/bsky/graph/getMutes'\nimport getRelationships from './app/bsky/graph/getRelationships'\nimport getStarterPack from './app/bsky/graph/getStarterPack'\nimport getStarterPacks from './app/bsky/graph/getStarterPacks'\nimport getStarterPacksWithMembership from './app/bsky/graph/getStarterPacksWithMembership'\nimport getSuggestedFollowsByActor from './app/bsky/graph/getSuggestedFollowsByActor'\nimport muteActor from './app/bsky/graph/muteActor'\nimport muteActorList from './app/bsky/graph/muteActorList'\nimport muteThread from './app/bsky/graph/muteThread'\nimport searchStarterPacks from './app/bsky/graph/searchStarterPacks'\nimport unmuteActor from './app/bsky/graph/unmuteActor'\nimport unmuteActorList from './app/bsky/graph/unmuteActorList'\nimport unmuteThread from './app/bsky/graph/unmuteThread'\nimport getLabelerServices from './app/bsky/labeler/getServices'\nimport getPreferences from './app/bsky/notification/getPreferences'\nimport getUnreadCount from './app/bsky/notification/getUnreadCount'\nimport listActivitySubscriptions from './app/bsky/notification/listActivitySubscriptions'\nimport listNotifications from './app/bsky/notification/listNotifications'\nimport putActivitySubscription from './app/bsky/notification/putActivitySubscription'\nimport putPreferences from './app/bsky/notification/putPreferences'\nimport putPreferencesV2 from './app/bsky/notification/putPreferencesV2'\nimport registerPush from './app/bsky/notification/registerPush'\nimport updateSeen from './app/bsky/notification/updateSeen'\nimport getAgeAssuranceState from './app/bsky/unspecced/getAgeAssuranceState'\nimport getConfig from './app/bsky/unspecced/getConfig'\nimport getOnboardingSuggestedStarterPacks from './app/bsky/unspecced/getOnboardingSuggestedStarterPacks'\nimport getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators'\nimport getPostThreadOtherV2 from './app/bsky/unspecced/getPostThreadOtherV2'\nimport getPostThreadV2 from './app/bsky/unspecced/getPostThreadV2'\nimport getUnspeccedSuggestedFeeds from './app/bsky/unspecced/getSuggestedFeeds'\nimport getSuggestedStarterPacks from './app/bsky/unspecced/getSuggestedStarterPacks'\nimport getSuggestedUsers from './app/bsky/unspecced/getSuggestedUsers'\nimport getTaggedSuggestions from './app/bsky/unspecced/getTaggedSuggestions'\nimport getTrendingTopics from './app/bsky/unspecced/getTrendingTopics'\nimport getTrends from './app/bsky/unspecced/getTrends'\nimport initAgeAssurance from './app/bsky/unspecced/initAgeAssurance'\nimport getAccountInfos from './com/atproto/admin/getAccountInfos'\nimport getSubjectStatus from './com/atproto/admin/getSubjectStatus'\nimport updateSubjectStatus from './com/atproto/admin/updateSubjectStatus'\nimport resolveHandle from './com/atproto/identity/resolveHandle'\nimport queryLabels from './com/atproto/label/queryLabels'\nimport getRecord from './com/atproto/repo/getRecord'\nimport fetchLabels from './com/atproto/temp/fetchLabels'\n\nexport * as health from './health'\n\nexport * as wellKnown from './well-known'\n\nexport * as blobResolver from './blob-resolver'\n\nexport * as external from './external'\n\nexport default function (server: Server, ctx: AppContext) {\n // app.bsky\n getTimeline(server, ctx)\n createBookmark(server, ctx)\n deleteBookmark(server, ctx)\n getBookmarks(server, ctx)\n dismissMatch(server, ctx)\n getMatches(server, ctx)\n getSyncStatus(server, ctx)\n importContacts(server, ctx)\n removeData(server, ctx)\n startPhoneVerification(server, ctx)\n verifyPhone(server, ctx)\n getActorFeeds(server, ctx)\n getSuggestedFeeds(server, ctx)\n getAuthorFeed(server, ctx)\n getFeed(server, ctx)\n getFeedGenerator(server, ctx)\n getFeedGenerators(server, ctx)\n getLikes(server, ctx)\n getListFeed(server, ctx)\n getQuotes(server, ctx)\n getPostThread(server, ctx)\n getPostThreadOtherV2(server, ctx)\n getPostThreadV2(server, ctx)\n getPosts(server, ctx)\n searchPosts(server, ctx)\n getActorLikes(server, ctx)\n getProfile(server, ctx)\n getProfiles(server, ctx)\n getRepostedBy(server, ctx)\n getActorStarterPacks(server, ctx)\n getBlocks(server, ctx)\n getListBlocks(server, ctx)\n getFollowers(server, ctx)\n getKnownFollowers(server, ctx)\n getFollows(server, ctx)\n getList(server, ctx)\n getLists(server, ctx)\n getListsWithMembership(server, ctx)\n getListMutes(server, ctx)\n getMutes(server, ctx)\n getRelationships(server, ctx)\n getStarterPack(server, ctx)\n getStarterPacks(server, ctx)\n getStarterPacksWithMembership(server, ctx)\n searchStarterPacks(server, ctx)\n muteActor(server, ctx)\n unmuteActor(server, ctx)\n muteActorList(server, ctx)\n unmuteActorList(server, ctx)\n muteThread(server, ctx)\n unmuteThread(server, ctx)\n getSuggestedFollowsByActor(server, ctx)\n getTrendingTopics(server, ctx)\n getTrends(server, ctx)\n getOnboardingSuggestedStarterPacks(server, ctx)\n getSuggestedStarterPacks(server, ctx)\n getSuggestedUsers(server, ctx)\n getUnspeccedSuggestedFeeds(server, ctx)\n getLabelerServices(server, ctx)\n searchActors(server, ctx)\n searchActorsTypeahead(server, ctx)\n getSuggestions(server, ctx)\n getPreferences(server, ctx)\n getUnreadCount(server, ctx)\n listActivitySubscriptions(server, ctx)\n listNotifications(server, ctx)\n putActivitySubscription(server, ctx)\n updateSeen(server, ctx)\n putPreferences(server, ctx)\n putPreferencesV2(server, ctx)\n registerPush(server, ctx)\n getConfig(server, ctx)\n getPopularFeedGenerators(server, ctx)\n getTaggedSuggestions(server, ctx)\n getAgeAssuranceState(server, ctx)\n initAgeAssurance(server, ctx)\n aaGetConfig(server, ctx)\n aaGetState(server, ctx)\n aaBegin(server, ctx)\n // com.atproto\n getSubjectStatus(server, ctx)\n updateSubjectStatus(server, ctx)\n getAccountInfos(server, ctx)\n resolveHandle(server, ctx)\n getRecord(server, ctx)\n fetchLabels(server, ctx)\n queryLabels(server, ctx)\n return server\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,4BA0FC;AA3LD,6EAAoD;AACpD,+EAAsD;AACtD,qFAA4D;AAC5D,iFAAwD;AACxD,mGAA0E;AAC1E,0EAAmD;AACnD,kFAA2D;AAC3D,gFAAyD;AACzD,wFAA+D;AAC/D,wFAA+D;AAC/D,oFAA2D;AAC3D,mFAA0D;AAC1D,+EAAsD;AACtD,qFAA4D;AAC5D,uFAA8D;AAC9D,+EAAsD;AACtD,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C,IAAA,oBAAU,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,IAAA,wBAAc,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,IAAA,0BAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAA,sBAAY,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,kCAAwB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrC,IAAA,8BAAoB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,IAAA,8BAAoB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,IAAA,0BAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAA,mBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,kBAAU,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,IAAA,eAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpB,cAAc;IACd,IAAA,0BAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAA,6BAAmB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAChC,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,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { AppContext } from '../context'\nimport { Server } from '../lexicon'\nimport getProfile from './app/bsky/actor/getProfile'\nimport getProfiles from './app/bsky/actor/getProfiles'\nimport getSuggestions from './app/bsky/actor/getSuggestions'\nimport searchActors from './app/bsky/actor/searchActors'\nimport searchActorsTypeahead from './app/bsky/actor/searchActorsTypeahead'\nimport aaBegin from './app/bsky/ageassurance/begin'\nimport aaGetConfig from './app/bsky/ageassurance/getConfig'\nimport aaGetState from './app/bsky/ageassurance/getState'\nimport createBookmark from './app/bsky/bookmark/createBookmark'\nimport deleteBookmark from './app/bsky/bookmark/deleteBookmark'\nimport getBookmarks from './app/bsky/bookmark/getBookmarks'\nimport dismissMatch from './app/bsky/contact/dismissMatch'\nimport getMatches from './app/bsky/contact/getMatches'\nimport getSyncStatus from './app/bsky/contact/getSyncStatus'\nimport importContacts from './app/bsky/contact/importContacts'\nimport removeData from './app/bsky/contact/removeData'\nimport startPhoneVerification from './app/bsky/contact/startPhoneVerification'\nimport verifyPhone from './app/bsky/contact/verifyPhone'\nimport getActorFeeds from './app/bsky/feed/getActorFeeds'\nimport getActorLikes from './app/bsky/feed/getActorLikes'\nimport getAuthorFeed from './app/bsky/feed/getAuthorFeed'\nimport getFeed from './app/bsky/feed/getFeed'\nimport getFeedGenerator from './app/bsky/feed/getFeedGenerator'\nimport getFeedGenerators from './app/bsky/feed/getFeedGenerators'\nimport getLikes from './app/bsky/feed/getLikes'\nimport getListFeed from './app/bsky/feed/getListFeed'\nimport getPostThread from './app/bsky/feed/getPostThread'\nimport getPosts from './app/bsky/feed/getPosts'\nimport getQuotes from './app/bsky/feed/getQuotes'\nimport getRepostedBy from './app/bsky/feed/getRepostedBy'\nimport getSuggestedFeeds from './app/bsky/feed/getSuggestedFeeds'\nimport getTimeline from './app/bsky/feed/getTimeline'\nimport searchPosts from './app/bsky/feed/searchPosts'\nimport getActorStarterPacks from './app/bsky/graph/getActorStarterPacks'\nimport getBlocks from './app/bsky/graph/getBlocks'\nimport getFollowers from './app/bsky/graph/getFollowers'\nimport getFollows from './app/bsky/graph/getFollows'\nimport getKnownFollowers from './app/bsky/graph/getKnownFollowers'\nimport getList from './app/bsky/graph/getList'\nimport getListBlocks from './app/bsky/graph/getListBlocks'\nimport getListMutes from './app/bsky/graph/getListMutes'\nimport getLists from './app/bsky/graph/getLists'\nimport getListsWithMembership from './app/bsky/graph/getListsWithMembership'\nimport getMutes from './app/bsky/graph/getMutes'\nimport getRelationships from './app/bsky/graph/getRelationships'\nimport getStarterPack from './app/bsky/graph/getStarterPack'\nimport getStarterPacks from './app/bsky/graph/getStarterPacks'\nimport getStarterPacksWithMembership from './app/bsky/graph/getStarterPacksWithMembership'\nimport getSuggestedFollowsByActor from './app/bsky/graph/getSuggestedFollowsByActor'\nimport muteActor from './app/bsky/graph/muteActor'\nimport muteActorList from './app/bsky/graph/muteActorList'\nimport muteThread from './app/bsky/graph/muteThread'\nimport searchStarterPacks from './app/bsky/graph/searchStarterPacks'\nimport unmuteActor from './app/bsky/graph/unmuteActor'\nimport unmuteActorList from './app/bsky/graph/unmuteActorList'\nimport unmuteThread from './app/bsky/graph/unmuteThread'\nimport getLabelerServices from './app/bsky/labeler/getServices'\nimport getPreferences from './app/bsky/notification/getPreferences'\nimport getUnreadCount from './app/bsky/notification/getUnreadCount'\nimport listActivitySubscriptions from './app/bsky/notification/listActivitySubscriptions'\nimport listNotifications from './app/bsky/notification/listNotifications'\nimport putActivitySubscription from './app/bsky/notification/putActivitySubscription'\nimport putPreferences from './app/bsky/notification/putPreferences'\nimport putPreferencesV2 from './app/bsky/notification/putPreferencesV2'\nimport registerPush from './app/bsky/notification/registerPush'\nimport updateSeen from './app/bsky/notification/updateSeen'\nimport getAgeAssuranceState from './app/bsky/unspecced/getAgeAssuranceState'\nimport getConfig from './app/bsky/unspecced/getConfig'\nimport getOnboardingSuggestedStarterPacks from './app/bsky/unspecced/getOnboardingSuggestedStarterPacks'\nimport getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators'\nimport getPostThreadOtherV2 from './app/bsky/unspecced/getPostThreadOtherV2'\nimport getPostThreadV2 from './app/bsky/unspecced/getPostThreadV2'\nimport getUnspeccedSuggestedFeeds from './app/bsky/unspecced/getSuggestedFeeds'\nimport getSuggestedStarterPacks from './app/bsky/unspecced/getSuggestedStarterPacks'\nimport getSuggestedUsers from './app/bsky/unspecced/getSuggestedUsers'\nimport getTaggedSuggestions from './app/bsky/unspecced/getTaggedSuggestions'\nimport getTrendingTopics from './app/bsky/unspecced/getTrendingTopics'\nimport getTrends from './app/bsky/unspecced/getTrends'\nimport initAgeAssurance from './app/bsky/unspecced/initAgeAssurance'\nimport getAccountInfos from './com/atproto/admin/getAccountInfos'\nimport getSubjectStatus from './com/atproto/admin/getSubjectStatus'\nimport updateSubjectStatus from './com/atproto/admin/updateSubjectStatus'\nimport resolveHandle from './com/atproto/identity/resolveHandle'\nimport queryLabels from './com/atproto/label/queryLabels'\nimport getRecord from './com/atproto/repo/getRecord'\nimport fetchLabels from './com/atproto/temp/fetchLabels'\n\nexport * as health from './health'\n\nexport * as wellKnown from './well-known'\n\nexport * as blobResolver from './blob-resolver'\n\nexport * as external from './external'\n\nexport * as sitemap from './sitemap'\n\nexport default function (server: Server, ctx: AppContext) {\n // app.bsky\n getTimeline(server, ctx)\n createBookmark(server, ctx)\n deleteBookmark(server, ctx)\n getBookmarks(server, ctx)\n dismissMatch(server, ctx)\n getMatches(server, ctx)\n getSyncStatus(server, ctx)\n importContacts(server, ctx)\n removeData(server, ctx)\n startPhoneVerification(server, ctx)\n verifyPhone(server, ctx)\n getActorFeeds(server, ctx)\n getSuggestedFeeds(server, ctx)\n getAuthorFeed(server, ctx)\n getFeed(server, ctx)\n getFeedGenerator(server, ctx)\n getFeedGenerators(server, ctx)\n getLikes(server, ctx)\n getListFeed(server, ctx)\n getQuotes(server, ctx)\n getPostThread(server, ctx)\n getPostThreadOtherV2(server, ctx)\n getPostThreadV2(server, ctx)\n getPosts(server, ctx)\n searchPosts(server, ctx)\n getActorLikes(server, ctx)\n getProfile(server, ctx)\n getProfiles(server, ctx)\n getRepostedBy(server, ctx)\n getActorStarterPacks(server, ctx)\n getBlocks(server, ctx)\n getListBlocks(server, ctx)\n getFollowers(server, ctx)\n getKnownFollowers(server, ctx)\n getFollows(server, ctx)\n getList(server, ctx)\n getLists(server, ctx)\n getListsWithMembership(server, ctx)\n getListMutes(server, ctx)\n getMutes(server, ctx)\n getRelationships(server, ctx)\n getStarterPack(server, ctx)\n getStarterPacks(server, ctx)\n getStarterPacksWithMembership(server, ctx)\n searchStarterPacks(server, ctx)\n muteActor(server, ctx)\n unmuteActor(server, ctx)\n muteActorList(server, ctx)\n unmuteActorList(server, ctx)\n muteThread(server, ctx)\n unmuteThread(server, ctx)\n getSuggestedFollowsByActor(server, ctx)\n getTrendingTopics(server, ctx)\n getTrends(server, ctx)\n getOnboardingSuggestedStarterPacks(server, ctx)\n getSuggestedStarterPacks(server, ctx)\n getSuggestedUsers(server, ctx)\n getUnspeccedSuggestedFeeds(server, ctx)\n getLabelerServices(server, ctx)\n searchActors(server, ctx)\n searchActorsTypeahead(server, ctx)\n getSuggestions(server, ctx)\n getPreferences(server, ctx)\n getUnreadCount(server, ctx)\n listActivitySubscriptions(server, ctx)\n listNotifications(server, ctx)\n putActivitySubscription(server, ctx)\n updateSeen(server, ctx)\n putPreferences(server, ctx)\n putPreferencesV2(server, ctx)\n registerPush(server, ctx)\n getConfig(server, ctx)\n getPopularFeedGenerators(server, ctx)\n getTaggedSuggestions(server, ctx)\n getAgeAssuranceState(server, ctx)\n initAgeAssurance(server, ctx)\n aaGetConfig(server, ctx)\n aaGetState(server, ctx)\n aaBegin(server, ctx)\n // com.atproto\n getSubjectStatus(server, ctx)\n updateSubjectStatus(server, ctx)\n getAccountInfos(server, ctx)\n resolveHandle(server, ctx)\n getRecord(server, ctx)\n fetchLabels(server, ctx)\n queryLabels(server, ctx)\n return server\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../src/api/sitemap.ts"],"names":[],"mappings":"AAGA,OAAgB,EAAkB,MAAM,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAIvC,eAAO,MAAM,YAAY,GAAI,KAAK,UAAU,KAAG,MAQ9C,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRouter = void 0;
|
|
4
|
+
const node_stream_1 = require("node:stream");
|
|
5
|
+
const protobuf_1 = require("@bufbuild/protobuf");
|
|
6
|
+
const connect_1 = require("@connectrpc/connect");
|
|
7
|
+
const express_1 = require("express");
|
|
8
|
+
const logger_1 = require("../logger");
|
|
9
|
+
const bsky_pb_1 = require("../proto/bsky_pb");
|
|
10
|
+
const createRouter = (ctx) => {
|
|
11
|
+
const router = (0, express_1.Router)();
|
|
12
|
+
router.get('/external/sitemap/users.xml.gz', userIndexHandler(ctx));
|
|
13
|
+
router.get('/external/sitemap/users/:date/:bucket.xml.gz', userPageHandler(ctx));
|
|
14
|
+
return router;
|
|
15
|
+
};
|
|
16
|
+
exports.createRouter = createRouter;
|
|
17
|
+
const userIndexHandler = (ctx) => async (_req, res) => {
|
|
18
|
+
try {
|
|
19
|
+
const result = await ctx.dataplane.getSitemapIndex({
|
|
20
|
+
type: bsky_pb_1.SitemapPageType.USER,
|
|
21
|
+
});
|
|
22
|
+
res.set('Content-Type', 'application/gzip');
|
|
23
|
+
res.set('Content-Encoding', 'gzip');
|
|
24
|
+
node_stream_1.Readable.from(Buffer.from(result.sitemap)).pipe(res);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
logger_1.httpLogger.error({ err }, 'failed to get sitemap index');
|
|
28
|
+
return res.status(500).send('Internal Server Error');
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const userPageHandler = (ctx) => async (req, res) => {
|
|
32
|
+
const { date, bucket } = req.params;
|
|
33
|
+
// Parse date (YYYY-MM-DD format)
|
|
34
|
+
const dateParts = date.split('-');
|
|
35
|
+
if (dateParts.length !== 3) {
|
|
36
|
+
return res.status(400).send('Invalid date format. Expected YYYY-MM-DD');
|
|
37
|
+
}
|
|
38
|
+
const year = parseInt(dateParts[0], 10);
|
|
39
|
+
const month = parseInt(dateParts[1], 10);
|
|
40
|
+
const day = parseInt(dateParts[2], 10);
|
|
41
|
+
if (isNaN(year) || isNaN(month) || isNaN(day)) {
|
|
42
|
+
return res.status(400).send('Invalid date format. Expected YYYY-MM-DD');
|
|
43
|
+
}
|
|
44
|
+
// Parse bucket (1-indexed)
|
|
45
|
+
const bucketNum = parseInt(bucket, 10);
|
|
46
|
+
if (isNaN(bucketNum) || bucketNum < 1) {
|
|
47
|
+
return res.status(400).send('Invalid bucket number');
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const result = await ctx.dataplane.getSitemapPage({
|
|
51
|
+
type: bsky_pb_1.SitemapPageType.USER,
|
|
52
|
+
date: protobuf_1.Timestamp.fromDate(new Date(year, month - 1, day)),
|
|
53
|
+
bucket: bucketNum,
|
|
54
|
+
});
|
|
55
|
+
res.set('Content-Type', 'application/gzip');
|
|
56
|
+
res.set('Content-Encoding', 'gzip');
|
|
57
|
+
node_stream_1.Readable.from(Buffer.from(result.sitemap)).pipe(res);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
if (err instanceof connect_1.ConnectError && err.code === connect_1.Code.NotFound) {
|
|
61
|
+
return res.status(404).send('Sitemap page not found');
|
|
62
|
+
}
|
|
63
|
+
logger_1.httpLogger.error({ err }, 'failed to get sitemap page');
|
|
64
|
+
return res.status(500).send('Internal Server Error');
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=sitemap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.js","sourceRoot":"","sources":["../../src/api/sitemap.ts"],"names":[],"mappings":";;;AAAA,6CAAsC;AACtC,iDAA8C;AAC9C,iDAAwD;AACxD,qCAAyD;AAEzD,sCAA6C;AAC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QACF,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAA;QAC3C,GAAG,CAAC,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;QACnC,sBAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACtD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,sBAAY,IAAI,GAAG,CAAC,IAAI,KAAK,cAAI,CAAC,QAAQ,EAAE,CAAC;YAC9D,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;QACvD,CAAC;QACD,mBAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,4BAA4B,CAAC,CAAA;QAChD,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;IACtD,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { Readable } from 'node:stream'\nimport { Timestamp } from '@bufbuild/protobuf'\nimport { Code, ConnectError } from '@connectrpc/connect'\nimport express, { RequestHandler, Router } from 'express'\nimport { AppContext } from '../context'\nimport { httpLogger as log } from '../logger'\nimport { SitemapPageType } from '../proto/bsky_pb'\n\nexport const createRouter = (ctx: AppContext): Router => {\n const router = Router()\n router.get('/external/sitemap/users.xml.gz', userIndexHandler(ctx))\n router.get(\n '/external/sitemap/users/:date/:bucket.xml.gz',\n userPageHandler(ctx),\n )\n return router\n}\n\nconst userIndexHandler =\n (ctx: AppContext): RequestHandler =>\n async (_req: express.Request, res: express.Response) => {\n try {\n const result = await ctx.dataplane.getSitemapIndex({\n type: SitemapPageType.USER,\n })\n res.set('Content-Type', 'application/gzip')\n res.set('Content-Encoding', 'gzip')\n Readable.from(Buffer.from(result.sitemap)).pipe(res)\n } catch (err) {\n log.error({ err }, 'failed to get sitemap index')\n return res.status(500).send('Internal Server Error')\n }\n }\n\nconst userPageHandler =\n (ctx: AppContext): RequestHandler =>\n async (req: express.Request, res: express.Response) => {\n const { date, bucket } = req.params\n\n // Parse date (YYYY-MM-DD format)\n const dateParts = date.split('-')\n if (dateParts.length !== 3) {\n return res.status(400).send('Invalid date format. Expected YYYY-MM-DD')\n }\n\n const year = parseInt(dateParts[0], 10)\n const month = parseInt(dateParts[1], 10)\n const day = parseInt(dateParts[2], 10)\n\n if (isNaN(year) || isNaN(month) || isNaN(day)) {\n return res.status(400).send('Invalid date format. Expected YYYY-MM-DD')\n }\n\n // Parse bucket (1-indexed)\n const bucketNum = parseInt(bucket, 10)\n if (isNaN(bucketNum) || bucketNum < 1) {\n return res.status(400).send('Invalid bucket number')\n }\n\n try {\n const result = await ctx.dataplane.getSitemapPage({\n type: SitemapPageType.USER,\n date: Timestamp.fromDate(new Date(year, month - 1, day)),\n bucket: bucketNum,\n })\n res.set('Content-Type', 'application/gzip')\n res.set('Content-Encoding', 'gzip')\n Readable.from(Buffer.from(result.sitemap)).pipe(res)\n } catch (err) {\n if (err instanceof ConnectError && err.code === Code.NotFound) {\n return res.status(404).send('Sitemap page not found')\n }\n log.error({ err }, 'failed to get sitemap page')\n return res.status(500).send('Internal Server Error')\n }\n }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;yBA2BhB,IAAI,QAAQ,EAAE,YAAY,UAAU,MACjD,QAAQ,aAAa;AADxB,wBAgCM"}
|
|
@@ -24,6 +24,7 @@ const records_1 = __importDefault(require("./records"));
|
|
|
24
24
|
const relationships_1 = __importDefault(require("./relationships"));
|
|
25
25
|
const reposts_1 = __importDefault(require("./reposts"));
|
|
26
26
|
const search_1 = __importDefault(require("./search"));
|
|
27
|
+
const sitemap_1 = __importDefault(require("./sitemap"));
|
|
27
28
|
const starter_packs_1 = __importDefault(require("./starter-packs"));
|
|
28
29
|
const suggestions_1 = __importDefault(require("./suggestions"));
|
|
29
30
|
const sync_1 = __importDefault(require("./sync"));
|
|
@@ -49,6 +50,7 @@ exports.default = (db, idResolver) => (router) => router.service(bsky_connect_1.
|
|
|
49
50
|
...(0, relationships_1.default)(db),
|
|
50
51
|
...(0, reposts_1.default)(db),
|
|
51
52
|
...(0, search_1.default)(db),
|
|
53
|
+
...(0, sitemap_1.default)(),
|
|
52
54
|
...(0, suggestions_1.default)(db),
|
|
53
55
|
...(0, sync_1.default)(db),
|
|
54
56
|
...(0, threads_1.default)(db),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/index.ts"],"names":[],"mappings":";;;;;AAEA,8DAAqD;AAErD,oFAA0D;AAC1D,sDAA6B;AAC7B,4DAAmC;AACnC,4DAAkC;AAClC,oDAA2B;AAC3B,wDAA+B;AAC/B,0DAAiC;AACjC,kEAAyC;AACzC,sDAA6B;AAC7B,oDAA2B;AAC3B,oDAA2B;AAC3B,8DAAqC;AACrC,oDAA2B;AAC3B,sDAA6B;AAC7B,wDAA+B;AAC/B,sDAA6B;AAC7B,wDAA+B;AAC/B,oEAA2C;AAC3C,wDAA+B;AAC/B,sDAA6B;AAC7B,oEAA0C;AAC1C,gEAA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EAAE,CAAA;IACX,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { ConnectRouter } from '@connectrpc/connect'\nimport { IdResolver } from '@atproto/identity'\nimport { Service } from '../../../proto/bsky_connect'\nimport { Database } from '../db'\nimport activitySubscription from './activity-subscription'\nimport blocks from './blocks'\nimport bookmarks from './bookmarks'\nimport feedGens from './feed-gens'\nimport feeds from './feeds'\nimport follows from './follows'\nimport identity from './identity'\nimport interactions from './interactions'\nimport labels from './labels'\nimport likes from './likes'\nimport lists from './lists'\nimport moderation from './moderation'\nimport mutes from './mutes'\nimport notifs from './notifs'\nimport profile from './profile'\nimport quotes from './quotes'\nimport records from './records'\nimport relationships from './relationships'\nimport reposts from './reposts'\nimport search from './search'\nimport starterPacks from './starter-packs'\nimport suggestions from './suggestions'\nimport sync from './sync'\nimport threads from './threads'\n\nexport default (db: Database, idResolver: IdResolver) =>\n (router: ConnectRouter) =>\n router.service(Service, {\n ...activitySubscription(db),\n ...blocks(db),\n ...bookmarks(db),\n ...feedGens(db),\n ...feeds(db),\n ...follows(db),\n ...identity(db, idResolver),\n ...interactions(db),\n ...labels(db),\n ...likes(db),\n ...lists(db),\n ...moderation(db),\n ...mutes(db),\n ...notifs(db),\n ...profile(db),\n ...quotes(db),\n ...records(db),\n ...relationships(db),\n ...reposts(db),\n ...search(db),\n ...suggestions(db),\n ...sync(db),\n ...threads(db),\n ...starterPacks(db),\n\n async ping() {\n return {}\n },\n })\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/index.ts"],"names":[],"mappings":";;;;;AAEA,8DAAqD;AAErD,oFAA0D;AAC1D,sDAA6B;AAC7B,4DAAmC;AACnC,4DAAkC;AAClC,oDAA2B;AAC3B,wDAA+B;AAC/B,0DAAiC;AACjC,kEAAyC;AACzC,sDAA6B;AAC7B,oDAA2B;AAC3B,oDAA2B;AAC3B,8DAAqC;AACrC,oDAA2B;AAC3B,sDAA6B;AAC7B,wDAA+B;AAC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AAA,cAAI,EAAC,EAAE,CAAC;IACX,GAAG,IAAA,iBAAO,EAAC,EAAE,CAAC;IACd,GAAG,IAAA,uBAAY,EAAC,EAAE,CAAC;IAEnB,KAAK,CAAC,IAAI;QACR,OAAO,EAAE,CAAA;IACX,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { ConnectRouter } from '@connectrpc/connect'\nimport { IdResolver } from '@atproto/identity'\nimport { Service } from '../../../proto/bsky_connect'\nimport { Database } from '../db'\nimport activitySubscription from './activity-subscription'\nimport blocks from './blocks'\nimport bookmarks from './bookmarks'\nimport feedGens from './feed-gens'\nimport feeds from './feeds'\nimport follows from './follows'\nimport identity from './identity'\nimport interactions from './interactions'\nimport labels from './labels'\nimport likes from './likes'\nimport lists from './lists'\nimport moderation from './moderation'\nimport mutes from './mutes'\nimport notifs from './notifs'\nimport profile from './profile'\nimport quotes from './quotes'\nimport records from './records'\nimport relationships from './relationships'\nimport reposts from './reposts'\nimport search from './search'\nimport sitemap from './sitemap'\nimport starterPacks from './starter-packs'\nimport suggestions from './suggestions'\nimport sync from './sync'\nimport threads from './threads'\n\nexport default (db: Database, idResolver: IdResolver) =>\n (router: ConnectRouter) =>\n router.service(Service, {\n ...activitySubscription(db),\n ...blocks(db),\n ...bookmarks(db),\n ...feedGens(db),\n ...feeds(db),\n ...follows(db),\n ...identity(db, idResolver),\n ...interactions(db),\n ...labels(db),\n ...likes(db),\n ...lists(db),\n ...moderation(db),\n ...mutes(db),\n ...notifs(db),\n ...profile(db),\n ...quotes(db),\n ...records(db),\n ...relationships(db),\n ...reposts(db),\n ...search(db),\n ...sitemap(),\n ...suggestions(db),\n ...sync(db),\n ...threads(db),\n ...starterPacks(db),\n\n async ping() {\n return {}\n },\n })\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/profile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAQjD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;yBAWhB,IAAI,QAAQ,KAAG,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC;AAAnE,
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/profile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAQjD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;yBAWhB,IAAI,QAAQ,KAAG,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC;AAAnE,wBA0LE"}
|
|
@@ -88,14 +88,16 @@ exports.default = (db) => ({
|
|
|
88
88
|
}
|
|
89
89
|
const status = row?.ageAssuranceStatus ?? 'unknown';
|
|
90
90
|
let access = row?.ageAssuranceAccess;
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
if (!access || access === 'unknown') {
|
|
92
|
+
if (status === 'assured') {
|
|
93
|
+
access = 'full';
|
|
94
|
+
}
|
|
95
|
+
else if (status === 'blocked') {
|
|
96
|
+
access = 'none';
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
access = 'unknown';
|
|
100
|
+
}
|
|
99
101
|
}
|
|
100
102
|
return {
|
|
101
103
|
lastInitiatedAt: row?.ageAssuranceLastInitiatedAt
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/profile.ts"],"names":[],"mappings":";;AAAA,iDAA8C;AAE9C,mCAAwC;AAKxC,4CAAuC;AACvC,kDAA0D;AAK1D,uCAAsC;AAStC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AC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAA;QACrE,OAAO,EAAE,IAAI,EAAE,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,yBAAyB,CAAC,GAAG;QACjC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;QACxC,MAAM,EAAE,CAAC,EAAE;aACR,WAAW,CAAC,OAAO,CAAC;aACpB,GAAG,CAAC,EAAE,cAAc,EAAE,CAAC;aACvB,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC;aAC3B,OAAO,EAAE,CAAA;IACd,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { Timestamp } from '@bufbuild/protobuf'\nimport { ServiceImpl } from '@connectrpc/connect'\nimport { Selectable, sql } from 'kysely'\nimport {\n AppBskyNotificationDeclaration,\n ChatBskyActorDeclaration,\n} from '@atproto/api'\nimport { keyBy } from '@atproto/common'\nimport { parseRecordBytes } from '../../../hydration/util'\nimport { Service } from '../../../proto/bsky_connect'\nimport { VerificationMeta } from '../../../proto/bsky_pb'\nimport { Database } from '../db'\nimport { Verification } from '../db/tables/verification'\nimport { getRecords } from './records'\n\ntype VerifiedBy = {\n [handle: string]: Pick<\n VerificationMeta,\n 'rkey' | 'handle' | 'displayName' | 'sortedAt'\n >\n}\n\nexport default (db: Database): Partial<ServiceImpl<typeof Service>> => ({\n async getActors(req) {\n const { dids, returnAgeAssuranceForDids } = req\n if (dids.length === 0) {\n return { actors: [] }\n }\n const profileUris = dids.map(\n (did) => `at://${did}/app.bsky.actor.profile/self`,\n )\n const statusUris = dids.map(\n (did) => `at://${did}/app.bsky.actor.status/self`,\n )\n const chatDeclarationUris = dids.map(\n (did) => `at://${did}/chat.bsky.actor.declaration/self`,\n )\n const notifDeclarationUris = dids.map(\n (did) => `at://${did}/app.bsky.notification.declaration/self`,\n )\n const { ref } = db.db.dynamic\n const [\n handlesRes,\n verificationsReceived,\n profiles,\n statuses,\n chatDeclarations,\n notifDeclarations,\n ] = await Promise.all([\n db.db\n .selectFrom('actor')\n .leftJoin('actor_state', 'actor_state.did', 'actor.did')\n .where('actor.did', 'in', dids)\n .selectAll('actor')\n .select('actor_state.priorityNotifs')\n .select([\n db.db\n .selectFrom('labeler')\n .whereRef('creator', '=', ref('actor.did'))\n .select(sql<true>`${true}`.as('val'))\n .as('isLabeler'),\n ])\n .execute(),\n db.db\n .selectFrom('verification')\n .selectAll('verification')\n .innerJoin('actor', 'actor.did', 'verification.creator')\n .where('verification.subject', 'in', dids)\n .where('actor.trustedVerifier', '=', true)\n .orderBy('sortedAt', 'asc')\n .execute(),\n getRecords(db)({ uris: profileUris }),\n getRecords(db)({ uris: statusUris }),\n getRecords(db)({ uris: chatDeclarationUris }),\n getRecords(db)({ uris: notifDeclarationUris }),\n ])\n\n const verificationsBySubjectDid = verificationsReceived.reduce(\n (acc, cur) => {\n const list = acc.get(cur.subject) ?? []\n list.push(cur)\n acc.set(cur.subject, list)\n return acc\n },\n new Map<string, Selectable<Verification>[]>(),\n )\n\n const byDid = keyBy(handlesRes, 'did')\n const actors = dids.map((did, i) => {\n const row = byDid.get(did)\n\n const status = statuses.records[i]\n\n const chatDeclaration = parseRecordBytes<ChatBskyActorDeclaration.Record>(\n chatDeclarations.records[i].record,\n )\n\n const verifications = verificationsBySubjectDid.get(did) ?? []\n const verifiedBy: VerifiedBy = verifications.reduce((acc, cur) => {\n acc[cur.creator] = {\n rkey: cur.rkey,\n handle: cur.handle,\n displayName: cur.displayName,\n sortedAt: Timestamp.fromDate(new Date(cur.sortedAt)),\n }\n return acc\n }, {} as VerifiedBy)\n const ageAssuranceForDids = new Set(returnAgeAssuranceForDids)\n\n const activitySubscription = () => {\n const record = parseRecordBytes<AppBskyNotificationDeclaration.Record>(\n notifDeclarations.records[i].record,\n )\n\n // The dataplane is responsible for setting the default of \"followers\" (default according to the lexicon).\n const defaultVal = 'followers'\n\n if (typeof record?.allowSubscriptions !== 'string') {\n return defaultVal\n }\n\n switch (record.allowSubscriptions) {\n case 'followers':\n case 'mutuals':\n case 'none':\n return record.allowSubscriptions\n default:\n return defaultVal\n }\n }\n\n const ageAssuranceStatus = () => {\n if (!ageAssuranceForDids.has(did)) {\n return undefined\n }\n\n const status = row?.ageAssuranceStatus ?? 'unknown'\n let access = row?.ageAssuranceAccess\n if (status === 'assured') {\n access = 'full'\n } else if (status === 'blocked') {\n access = 'none'\n } else {\n access = 'unknown'\n }\n\n return {\n lastInitiatedAt: row?.ageAssuranceLastInitiatedAt\n ? Timestamp.fromDate(new Date(row?.ageAssuranceLastInitiatedAt))\n : undefined,\n status,\n access,\n }\n }\n\n return {\n exists: !!row,\n handle: row?.handle ?? undefined,\n profile: profiles.records[i],\n takenDown: !!row?.takedownRef,\n takedownRef: row?.takedownRef || undefined,\n tombstonedAt: undefined, // in current implementation, tombstoned actors are deleted\n labeler: row?.isLabeler ?? false,\n allowIncomingChatsFrom:\n typeof chatDeclaration?.['allowIncoming'] === 'string'\n ? chatDeclaration['allowIncoming']\n : undefined,\n upstreamStatus: row?.upstreamStatus ?? '',\n createdAt: profiles.records[i].createdAt, // @NOTE profile creation date not trusted in production\n priorityNotifications: row?.priorityNotifs ?? false,\n trustedVerifier: row?.trustedVerifier ?? false,\n verifiedBy,\n statusRecord: status,\n tags: [],\n profileTags: [],\n allowActivitySubscriptionsFrom: activitySubscription(),\n ageAssuranceStatus: ageAssuranceStatus(),\n }\n })\n return { actors }\n },\n\n // @TODO handle req.lookupUnidirectional w/ networked handle resolution\n async getDidsByHandles(req) {\n const { handles } = req\n if (handles.length === 0) {\n return { dids: [] }\n }\n const res = await db.db\n .selectFrom('actor')\n .where('handle', 'in', handles)\n .selectAll()\n .execute()\n const byHandle = keyBy(res, 'handle')\n const dids = handles.map((handle) => byHandle.get(handle)?.did ?? '')\n return { dids }\n },\n\n async updateActorUpstreamStatus(req) {\n const { actorDid, upstreamStatus } = req\n await db.db\n .updateTable('actor')\n .set({ upstreamStatus })\n .where('did', '=', actorDid)\n .execute()\n },\n})\n"]}
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/profile.ts"],"names":[],"mappings":";;AAAA,iDAA8C;AAE9C,mCAAwC;AAKxC,4CAAuC;AACvC,kDAA0D;AAK1D,uCAAsC;AAStC,kBAAe,CAAC,EAAY,EAAwC,EAAE,CAAC,CAAC;IACtE,KAAK,CAAC,SAAS,CAAC,GAAG;QACjB,MAAM,EAAE,IAAI,EAAE,yBAAyB,EAAE,GAAG,GAAG,CAAA;QAC/C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;QACvB,CAAC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAC1B,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,GAAG,8BAA8B,CACnD,CAAA;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CACzB,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,GAAG,6BAA6B,CAClD,CAAA;QACD,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAClC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,GAAG,mCAAmC,CACxD,CAAA;QACD,MAAM,oBAAoB,GAAG,IAAI,CAAC,GAAG,CACnC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,GAAG,yCAAyC,CAC9D,CAAA;QACD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,OAAO,CAAA;QAC7B,MAAM,CACJ,UAAU,EACV,qBAAqB,EACrB,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EAClB,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACpB,EAAE,CAAC,EAAE;iBACF,UAAU,CAAC,OAAO,CAAC;iBACnB,QAAQ,CAAC,aAAa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QACrB,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,EAAE;aACpB,UAAU,CAAC,OAAO,CAAC;aACnB,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC;aAC9B,SAAS,EAAE;aACX,OAAO,EAAE,CAAA;QACZ,MAAM,QAAQ,GAAG,IAAA,cAAK,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QACrC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAA;QACrE,OAAO,EAAE,IAAI,EAAE,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,yBAAyB,CAAC,GAAG;QACjC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;QACxC,MAAM,EAAE,CAAC,EAAE;aACR,WAAW,CAAC,OAAO,CAAC;aACpB,GAAG,CAAC,EAAE,cAAc,EAAE,CAAC;aACvB,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC;aAC3B,OAAO,EAAE,CAAA;IACd,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { Timestamp } from '@bufbuild/protobuf'\nimport { ServiceImpl } from '@connectrpc/connect'\nimport { Selectable, sql } from 'kysely'\nimport {\n AppBskyNotificationDeclaration,\n ChatBskyActorDeclaration,\n} from '@atproto/api'\nimport { keyBy } from '@atproto/common'\nimport { parseRecordBytes } from '../../../hydration/util'\nimport { Service } from '../../../proto/bsky_connect'\nimport { VerificationMeta } from '../../../proto/bsky_pb'\nimport { Database } from '../db'\nimport { Verification } from '../db/tables/verification'\nimport { getRecords } from './records'\n\ntype VerifiedBy = {\n [handle: string]: Pick<\n VerificationMeta,\n 'rkey' | 'handle' | 'displayName' | 'sortedAt'\n >\n}\n\nexport default (db: Database): Partial<ServiceImpl<typeof Service>> => ({\n async getActors(req) {\n const { dids, returnAgeAssuranceForDids } = req\n if (dids.length === 0) {\n return { actors: [] }\n }\n const profileUris = dids.map(\n (did) => `at://${did}/app.bsky.actor.profile/self`,\n )\n const statusUris = dids.map(\n (did) => `at://${did}/app.bsky.actor.status/self`,\n )\n const chatDeclarationUris = dids.map(\n (did) => `at://${did}/chat.bsky.actor.declaration/self`,\n )\n const notifDeclarationUris = dids.map(\n (did) => `at://${did}/app.bsky.notification.declaration/self`,\n )\n const { ref } = db.db.dynamic\n const [\n handlesRes,\n verificationsReceived,\n profiles,\n statuses,\n chatDeclarations,\n notifDeclarations,\n ] = await Promise.all([\n db.db\n .selectFrom('actor')\n .leftJoin('actor_state', 'actor_state.did', 'actor.did')\n .where('actor.did', 'in', dids)\n .selectAll('actor')\n .select('actor_state.priorityNotifs')\n .select([\n db.db\n .selectFrom('labeler')\n .whereRef('creator', '=', ref('actor.did'))\n .select(sql<true>`${true}`.as('val'))\n .as('isLabeler'),\n ])\n .execute(),\n db.db\n .selectFrom('verification')\n .selectAll('verification')\n .innerJoin('actor', 'actor.did', 'verification.creator')\n .where('verification.subject', 'in', dids)\n .where('actor.trustedVerifier', '=', true)\n .orderBy('sortedAt', 'asc')\n .execute(),\n getRecords(db)({ uris: profileUris }),\n getRecords(db)({ uris: statusUris }),\n getRecords(db)({ uris: chatDeclarationUris }),\n getRecords(db)({ uris: notifDeclarationUris }),\n ])\n\n const verificationsBySubjectDid = verificationsReceived.reduce(\n (acc, cur) => {\n const list = acc.get(cur.subject) ?? []\n list.push(cur)\n acc.set(cur.subject, list)\n return acc\n },\n new Map<string, Selectable<Verification>[]>(),\n )\n\n const byDid = keyBy(handlesRes, 'did')\n const actors = dids.map((did, i) => {\n const row = byDid.get(did)\n\n const status = statuses.records[i]\n\n const chatDeclaration = parseRecordBytes<ChatBskyActorDeclaration.Record>(\n chatDeclarations.records[i].record,\n )\n\n const verifications = verificationsBySubjectDid.get(did) ?? []\n const verifiedBy: VerifiedBy = verifications.reduce((acc, cur) => {\n acc[cur.creator] = {\n rkey: cur.rkey,\n handle: cur.handle,\n displayName: cur.displayName,\n sortedAt: Timestamp.fromDate(new Date(cur.sortedAt)),\n }\n return acc\n }, {} as VerifiedBy)\n const ageAssuranceForDids = new Set(returnAgeAssuranceForDids)\n\n const activitySubscription = () => {\n const record = parseRecordBytes<AppBskyNotificationDeclaration.Record>(\n notifDeclarations.records[i].record,\n )\n\n // The dataplane is responsible for setting the default of \"followers\" (default according to the lexicon).\n const defaultVal = 'followers'\n\n if (typeof record?.allowSubscriptions !== 'string') {\n return defaultVal\n }\n\n switch (record.allowSubscriptions) {\n case 'followers':\n case 'mutuals':\n case 'none':\n return record.allowSubscriptions\n default:\n return defaultVal\n }\n }\n\n const ageAssuranceStatus = () => {\n if (!ageAssuranceForDids.has(did)) {\n return undefined\n }\n\n const status = row?.ageAssuranceStatus ?? 'unknown'\n let access = row?.ageAssuranceAccess\n if (!access || access === 'unknown') {\n if (status === 'assured') {\n access = 'full'\n } else if (status === 'blocked') {\n access = 'none'\n } else {\n access = 'unknown'\n }\n }\n\n return {\n lastInitiatedAt: row?.ageAssuranceLastInitiatedAt\n ? Timestamp.fromDate(new Date(row?.ageAssuranceLastInitiatedAt))\n : undefined,\n status,\n access,\n }\n }\n\n return {\n exists: !!row,\n handle: row?.handle ?? undefined,\n profile: profiles.records[i],\n takenDown: !!row?.takedownRef,\n takedownRef: row?.takedownRef || undefined,\n tombstonedAt: undefined, // in current implementation, tombstoned actors are deleted\n labeler: row?.isLabeler ?? false,\n allowIncomingChatsFrom:\n typeof chatDeclaration?.['allowIncoming'] === 'string'\n ? chatDeclaration['allowIncoming']\n : undefined,\n upstreamStatus: row?.upstreamStatus ?? '',\n createdAt: profiles.records[i].createdAt, // @NOTE profile creation date not trusted in production\n priorityNotifications: row?.priorityNotifs ?? false,\n trustedVerifier: row?.trustedVerifier ?? false,\n verifiedBy,\n statusRecord: status,\n tags: [],\n profileTags: [],\n allowActivitySubscriptionsFrom: activitySubscription(),\n ageAssuranceStatus: ageAssuranceStatus(),\n }\n })\n return { actors }\n },\n\n // @TODO handle req.lookupUnidirectional w/ networked handle resolution\n async getDidsByHandles(req) {\n const { handles } = req\n if (handles.length === 0) {\n return { dids: [] }\n }\n const res = await db.db\n .selectFrom('actor')\n .where('handle', 'in', handles)\n .selectAll()\n .execute()\n const byHandle = keyBy(res, 'handle')\n const dids = handles.map((handle) => byHandle.get(handle)?.did ?? '')\n return { dids }\n },\n\n async updateActorUpstreamStatus(req) {\n const { actorDid, upstreamStatus } = req\n await db.db\n .updateTable('actor')\n .set({ upstreamStatus })\n .where('did', '=', actorDid)\n .execute()\n },\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/sitemap.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;8BAiBlC,OAAO,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAC;AAAvD,wBAuBE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_zlib_1 = require("node:zlib");
|
|
4
|
+
const connect_1 = require("@connectrpc/connect");
|
|
5
|
+
const MOCK_SITEMAP_INDEX = `<?xml version="1.0" encoding="UTF-8"?>
|
|
6
|
+
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
7
|
+
<sitemap>
|
|
8
|
+
<loc>https://bsky.app/sitemap/users/2025-01-01/1.xml.gz</loc>
|
|
9
|
+
</sitemap>
|
|
10
|
+
</sitemapindex>`;
|
|
11
|
+
const MOCK_SITEMAP_PAGE = `<?xml version="1.0" encoding="UTF-8"?>
|
|
12
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
13
|
+
<url>
|
|
14
|
+
<loc>https://bsky.app/profile/test.bsky.social</loc>
|
|
15
|
+
</url>
|
|
16
|
+
</urlset>`;
|
|
17
|
+
exports.default = () => ({
|
|
18
|
+
async getSitemapIndex() {
|
|
19
|
+
return {
|
|
20
|
+
sitemap: (0, node_zlib_1.gzipSync)(Buffer.from(MOCK_SITEMAP_INDEX)),
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
async getSitemapPage(req) {
|
|
24
|
+
const date = req.date?.toDate();
|
|
25
|
+
const isExpectedDate = date &&
|
|
26
|
+
date.getFullYear() === 2025 &&
|
|
27
|
+
date.getMonth() === 0 &&
|
|
28
|
+
date.getDate() === 1;
|
|
29
|
+
const isExpectedBucket = req.bucket === 1;
|
|
30
|
+
if (!isExpectedDate || !isExpectedBucket) {
|
|
31
|
+
throw new connect_1.ConnectError('Sitemap page not found', connect_1.Code.NotFound);
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
sitemap: (0, node_zlib_1.gzipSync)(Buffer.from(MOCK_SITEMAP_PAGE)),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=sitemap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.js","sourceRoot":"","sources":["../../../../src/data-plane/server/routes/sitemap.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AACpC,iDAAqE;AAIrE,MAAM,kBAAkB,GAAG;;;;;gBAKX,CAAA;AAEhB,MAAM,iBAAiB,GAAG;;;;;UAKhB,CAAA;AAEV,kBAAe,GAAyC,EAAE,CAAC,CAAC;IAC1D,KAAK,CAAC,eAAe;QACnB,OAAO;YACL,OAAO,EAAE,IAAA,oBAAQ,EAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;SACnD,CAAA;IACH,CAAC;IACD,KAAK,CAAC,cAAc,CAAC,GAA0B;QAC7C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,CAAA;QAC/B,MAAM,cAAc,GAClB,IAAI;YACJ,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI;YAC3B,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;YACrB,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACtB,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,KAAK,CAAC,CAAA;QAEzC,IAAI,CAAC,cAAc,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACzC,MAAM,IAAI,sBAAY,CAAC,wBAAwB,EAAE,cAAI,CAAC,QAAQ,CAAC,CAAA;QACjE,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAA,oBAAQ,EAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;SAClD,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { gzipSync } from 'node:zlib'\nimport { Code, ConnectError, ServiceImpl } from '@connectrpc/connect'\nimport { Service } from '../../../proto/bsky_connect'\nimport { GetSitemapPageRequest } from '../../../proto/bsky_pb'\n\nconst MOCK_SITEMAP_INDEX = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n <sitemap>\n <loc>https://bsky.app/sitemap/users/2025-01-01/1.xml.gz</loc>\n </sitemap>\n</sitemapindex>`\n\nconst MOCK_SITEMAP_PAGE = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n <url>\n <loc>https://bsky.app/profile/test.bsky.social</loc>\n </url>\n</urlset>`\n\nexport default (): Partial<ServiceImpl<typeof Service>> => ({\n async getSitemapIndex() {\n return {\n sitemap: gzipSync(Buffer.from(MOCK_SITEMAP_INDEX)),\n }\n },\n async getSitemapPage(req: GetSitemapPageRequest) {\n const date = req.date?.toDate()\n const isExpectedDate =\n date &&\n date.getFullYear() === 2025 &&\n date.getMonth() === 0 &&\n date.getDate() === 1\n const isExpectedBucket = req.bucket === 1\n\n if (!isExpectedDate || !isExpectedBucket) {\n throw new ConnectError('Sitemap page not found', Code.NotFound)\n }\n\n return {\n sitemap: gzipSync(Buffer.from(MOCK_SITEMAP_PAGE)),\n }\n },\n})\n"]}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,WAAW,CAAA;AAK5B,OAAO,OAAO,MAAM,SAAS,CAAA;AAI7B,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAMzC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAoBtC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,qBAAa,WAAW;IACf,GAAG,EAAE,UAAU,CAAA;IACf,GAAG,EAAE,OAAO,CAAC,WAAW,CAAA;IACxB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAA;IAC3B,OAAO,CAAC,UAAU,CAAC,CAAgB;gBAEvB,IAAI,EAAE;QAAE,GAAG,EAAE,UAAU,CAAC;QAAC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAA;KAAE;IAK/D,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QAClB,MAAM,EAAE,YAAY,CAAA;QACpB,UAAU,EAAE,OAAO,CAAA;KAC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.use(api_2.wellKnown.createRouter(ctx));
|
|
242
242
|
app.use(api_2.blobResolver.createMiddleware(ctx));
|
|
243
243
|
app.use(imageServer.createMiddleware(ctx, { prefix: '/img/' }));
|
|
244
|
+
if (config.dataplaneUrls.length > 0 || config.dataplaneUrlsEtcdKeyPrefix) {
|
|
245
|
+
app.use(api_2.sitemap.createRouter(ctx));
|
|
246
|
+
}
|
|
244
247
|
app.use(server.xrpc.router);
|
|
245
248
|
app.use(error.handler);
|
|
246
249
|
app.use('/external', api_2.external.createRouter(ctx));
|