@atproto/bsky 0.0.277 → 0.0.279
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 +65 -0
- package/dist/api/app/bsky/actor/getSuggestions.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getSuggestions.js +5 -5
- package/dist/api/app/bsky/actor/getSuggestions.js.map +1 -1
- package/dist/api/app/bsky/actor/searchActors.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/searchActors.js +3 -2
- package/dist/api/app/bsky/actor/searchActors.js.map +1 -1
- package/dist/api/app/bsky/actor/searchActorsTypeahead.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js +3 -2
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.js +2 -4
- package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.js +10 -10
- package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.js +2 -4
- package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.js +3 -2
- package/dist/api/app/bsky/feed/searchPosts.js.map +1 -1
- package/dist/api/app/bsky/graph/getList.js +4 -1
- package/dist/api/app/bsky/graph/getList.js.map +1 -1
- package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.js +5 -5
- package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.js.map +1 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.js +3 -2
- package/dist/api/app/bsky/graph/searchStarterPacks.js.map +1 -1
- package/dist/api/app/bsky/notification/getUnreadCount.js +0 -8
- package/dist/api/app/bsky/notification/getUnreadCount.js.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.js +22 -20
- package/dist/api/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/api/app/bsky/notification/updateSeen.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/updateSeen.js +2 -11
- package/dist/api/app/bsky/notification/updateSeen.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getOnboardingSuggestedStarterPacks.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getOnboardingSuggestedStarterPacks.js +5 -5
- package/dist/api/app/bsky/unspecced/getOnboardingSuggestedStarterPacks.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedFeeds.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedFeeds.js +5 -4
- package/dist/api/app/bsky/unspecced/getSuggestedFeeds.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedOnboardingUsers.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedOnboardingUsers.js +5 -4
- package/dist/api/app/bsky/unspecced/getSuggestedOnboardingUsers.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedStarterPacks.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedStarterPacks.js +5 -4
- package/dist/api/app/bsky/unspecced/getSuggestedStarterPacks.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsers.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsers.js +6 -4
- package/dist/api/app/bsky/unspecced/getSuggestedUsers.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.js +4 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.js +4 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.js +4 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getTrendingTopics.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getTrendingTopics.js +3 -1
- package/dist/api/app/bsky/unspecced/getTrendingTopics.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getTrends.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getTrends.js +5 -4
- package/dist/api/app/bsky/unspecced/getTrends.js.map +1 -1
- package/dist/api/blob-dispatcher.d.ts.map +1 -1
- package/dist/api/blob-dispatcher.js +1 -0
- package/dist/api/blob-dispatcher.js.map +1 -1
- package/dist/api/util.d.ts.map +1 -1
- package/dist/api/util.js +4 -1
- package/dist/api/util.js.map +1 -1
- package/dist/bsync.d.ts.map +1 -1
- package/dist/bsync.js +18 -1
- package/dist/bsync.js.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -1
- package/dist/config.js.map +1 -1
- package/dist/data-plane/client/index.d.ts.map +1 -1
- package/dist/data-plane/client/index.js +3 -2
- package/dist/data-plane/client/index.js.map +1 -1
- package/dist/data-plane/client/util.d.ts +0 -1
- package/dist/data-plane/client/util.d.ts.map +1 -1
- package/dist/data-plane/client/util.js +0 -45
- package/dist/data-plane/client/util.js.map +1 -1
- package/dist/data-plane/server/db/database-schema.d.ts +2 -1
- package/dist/data-plane/server/db/database-schema.d.ts.map +1 -1
- package/dist/data-plane/server/db/database-schema.js.map +1 -1
- package/dist/data-plane/server/db/migrations/20260827T200000000Z-reference-list-opt-outs.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20260827T200000000Z-reference-list-opt-outs.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20260827T200000000Z-reference-list-opt-outs.js +24 -0
- package/dist/data-plane/server/db/migrations/20260827T200000000Z-reference-list-opt-outs.js.map +1 -0
- package/dist/data-plane/server/db/migrations/20260904T130000000Z-remove-last-seen-priority-notifs.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20260904T130000000Z-remove-last-seen-priority-notifs.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20260904T130000000Z-remove-last-seen-priority-notifs.js +13 -0
- package/dist/data-plane/server/db/migrations/20260904T130000000Z-remove-last-seen-priority-notifs.js.map +1 -0
- package/dist/data-plane/server/db/migrations/index.d.ts +2 -0
- package/dist/data-plane/server/db/migrations/index.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/index.js +2 -0
- package/dist/data-plane/server/db/migrations/index.js.map +1 -1
- package/dist/data-plane/server/db/tables/actor-state.d.ts +0 -1
- package/dist/data-plane/server/db/tables/actor-state.d.ts.map +1 -1
- package/dist/data-plane/server/db/tables/actor-state.js.map +1 -1
- package/dist/data-plane/server/db/tables/reference-list-opt-out.d.ts +15 -0
- package/dist/data-plane/server/db/tables/reference-list-opt-out.d.ts.map +1 -0
- package/dist/data-plane/server/db/tables/reference-list-opt-out.js +2 -0
- package/dist/data-plane/server/db/tables/reference-list-opt-out.js.map +1 -0
- package/dist/data-plane/server/indexing/index.d.ts +10 -0
- package/dist/data-plane/server/indexing/index.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/index.js +6 -0
- package/dist/data-plane/server/indexing/index.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/reference-list-opt-out.d.ts +16 -0
- package/dist/data-plane/server/indexing/plugins/reference-list-opt-out.d.ts.map +1 -0
- package/dist/data-plane/server/indexing/plugins/reference-list-opt-out.js +73 -0
- package/dist/data-plane/server/indexing/plugins/reference-list-opt-out.js.map +1 -0
- package/dist/data-plane/server/indexing/processor.d.ts +1 -0
- package/dist/data-plane/server/indexing/processor.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/processor.js +3 -0
- package/dist/data-plane/server/indexing/processor.js.map +1 -1
- package/dist/data-plane/server/routes/feeds.d.ts.map +1 -1
- package/dist/data-plane/server/routes/feeds.js +13 -0
- package/dist/data-plane/server/routes/feeds.js.map +1 -1
- package/dist/data-plane/server/routes/lists.d.ts.map +1 -1
- package/dist/data-plane/server/routes/lists.js +45 -1
- package/dist/data-plane/server/routes/lists.js.map +1 -1
- package/dist/data-plane/server/routes/notifs.d.ts.map +1 -1
- package/dist/data-plane/server/routes/notifs.js +10 -32
- package/dist/data-plane/server/routes/notifs.js.map +1 -1
- package/dist/data-plane/server/util.d.ts +4 -4
- package/dist/hydration/actor.d.ts.map +1 -1
- package/dist/hydration/actor.js +7 -4
- package/dist/hydration/actor.js.map +1 -1
- package/dist/hydration/graph.d.ts +1 -0
- package/dist/hydration/graph.d.ts.map +1 -1
- package/dist/hydration/graph.js +12 -5
- package/dist/hydration/graph.js.map +1 -1
- package/dist/hydration/hydrator.d.ts +9 -1
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +28 -3
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +6 -0
- package/dist/lexicons/app/bsky/actor/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/actor/defs.defs.js +2 -0
- package/dist/lexicons/app/bsky/actor/defs.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/authFullApp.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/authFullApp.defs.js +1 -0
- package/dist/lexicons/app/bsky/authFullApp.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/graph/defs.defs.d.ts +8 -0
- package/dist/lexicons/app/bsky/graph/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/defs.defs.js +3 -0
- package/dist/lexicons/app/bsky/graph/defs.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/graph/referencelistoptout.d.ts +3 -0
- package/dist/lexicons/app/bsky/graph/referencelistoptout.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/graph/referencelistoptout.defs.d.ts +77 -0
- package/dist/lexicons/app/bsky/graph/referencelistoptout.defs.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/graph/referencelistoptout.defs.js +27 -0
- package/dist/lexicons/app/bsky/graph/referencelistoptout.defs.js.map +1 -0
- package/dist/lexicons/app/bsky/graph/referencelistoptout.js +6 -0
- package/dist/lexicons/app/bsky/graph/referencelistoptout.js.map +1 -0
- package/dist/lexicons/app/bsky/graph.d.ts +1 -0
- package/dist/lexicons/app/bsky/graph.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph.js +1 -0
- package/dist/lexicons/app/bsky/graph.js.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/getAccountPreferences.d.ts +3 -0
- package/dist/lexicons/tools/ozone/moderation/getAccountPreferences.d.ts.map +1 -0
- package/dist/lexicons/tools/ozone/moderation/getAccountPreferences.defs.d.ts +29 -0
- package/dist/lexicons/tools/ozone/moderation/getAccountPreferences.defs.d.ts.map +1 -0
- package/dist/lexicons/tools/ozone/moderation/getAccountPreferences.defs.js +19 -0
- package/dist/lexicons/tools/ozone/moderation/getAccountPreferences.defs.js.map +1 -0
- package/dist/lexicons/tools/ozone/moderation/getAccountPreferences.js +6 -0
- package/dist/lexicons/tools/ozone/moderation/getAccountPreferences.js.map +1 -0
- package/dist/lexicons/tools/ozone/moderation.d.ts +1 -0
- package/dist/lexicons/tools/ozone/moderation.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/moderation.js +1 -0
- package/dist/lexicons/tools/ozone/moderation.js.map +1 -1
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +1 -0
- package/dist/logger.js.map +1 -1
- package/dist/proto/bsky_connect.d.ts +10 -1
- package/dist/proto/bsky_connect.d.ts.map +1 -1
- package/dist/proto/bsky_connect.js +11 -2
- package/dist/proto/bsky_connect.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +46 -12
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +75 -15
- package/dist/proto/bsky_pb.js.map +1 -1
- package/dist/proto/bsync_connect.d.ts +10 -1
- package/dist/proto/bsync_connect.d.ts.map +1 -1
- package/dist/proto/bsync_connect.js +11 -2
- package/dist/proto/bsync_connect.js.map +1 -1
- package/dist/proto/bsync_pb.d.ts +35 -1
- package/dist/proto/bsync_pb.d.ts.map +1 -1
- package/dist/proto/bsync_pb.js +56 -1
- package/dist/proto/bsync_pb.js.map +1 -1
- package/dist/proto/courier_connect.js +1 -1
- package/dist/proto/courier_connect.js.map +1 -1
- package/dist/proto/dataplane_connect.d.ts +20 -0
- package/dist/proto/dataplane_connect.d.ts.map +1 -0
- package/dist/proto/dataplane_connect.js +24 -0
- package/dist/proto/dataplane_connect.js.map +1 -0
- package/dist/proto/dataplane_pb.d.ts +37 -0
- package/dist/proto/dataplane_pb.d.ts.map +1 -0
- package/dist/proto/dataplane_pb.js +61 -0
- package/dist/proto/dataplane_pb.js.map +1 -0
- package/dist/proto/rolodex_connect.js +1 -1
- package/dist/proto/rolodex_connect.js.map +1 -1
- package/dist/telemetry/events.d.ts +31 -0
- package/dist/telemetry/events.d.ts.map +1 -0
- package/dist/telemetry/events.js +65 -0
- package/dist/telemetry/events.js.map +1 -0
- package/dist/telemetry/rpc.d.ts +21 -0
- package/dist/telemetry/rpc.d.ts.map +1 -0
- package/dist/telemetry/rpc.js +70 -0
- package/dist/telemetry/rpc.js.map +1 -0
- package/dist/{telemetry.d.ts.map → telemetry/telemetry.d.ts.map} +1 -1
- package/dist/{telemetry.js → telemetry/telemetry.js} +1 -1
- package/dist/telemetry/telemetry.js.map +1 -0
- package/dist/telemetry/util.d.ts +14 -0
- package/dist/telemetry/util.d.ts.map +1 -0
- package/dist/telemetry/util.js +23 -0
- package/dist/telemetry/util.js.map +1 -0
- package/dist/undici.d.ts +29 -0
- package/dist/undici.d.ts.map +1 -0
- package/dist/undici.js +43 -0
- package/dist/undici.js.map +1 -0
- package/dist/util/headers.d.ts +5 -0
- package/dist/util/headers.d.ts.map +1 -0
- package/dist/util/headers.js +19 -0
- package/dist/util/headers.js.map +1 -0
- package/dist/util/uris.js +1 -1
- package/dist/util/uris.js.map +1 -1
- package/dist/views/index.d.ts +4 -2
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +24 -11
- package/dist/views/index.js.map +1 -1
- package/package.json +24 -19
- package/dist/telemetry.js.map +0 -1
- /package/dist/{telemetry.d.ts → telemetry/telemetry.d.ts} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UpdateNotificationSeenRequest, UpdateNotificationSeenResponse } from "./dataplane_pb.js";
|
|
2
|
+
import { MethodKind } from "@bufbuild/protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* @generated from service bsky.Service
|
|
5
|
+
*/
|
|
6
|
+
export declare const Service: {
|
|
7
|
+
readonly typeName: "bsky.Service";
|
|
8
|
+
readonly methods: {
|
|
9
|
+
/**
|
|
10
|
+
* @generated from rpc bsky.Service.UpdateNotificationSeen
|
|
11
|
+
*/
|
|
12
|
+
readonly updateNotificationSeen: {
|
|
13
|
+
readonly name: "UpdateNotificationSeen";
|
|
14
|
+
readonly I: typeof UpdateNotificationSeenRequest;
|
|
15
|
+
readonly O: typeof UpdateNotificationSeenResponse;
|
|
16
|
+
readonly kind: MethodKind.Unary;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=dataplane_connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataplane_connect.d.ts","sourceRoot":"","sources":["../../src/proto/dataplane_connect.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,OAAO;aAClB,QAAQ,EAAE,cAAc;aACxB,OAAO;QACL;;WAEG;iBACH,sBAAsB;qBACpB,IAAI,EAAE,wBAAwB;qBAC9B,CAAC;qBACD,CAAC;qBACD,IAAI;;;CAGA,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts,import_extension=.js"
|
|
2
|
+
// @generated from file dataplane.proto (package bsky, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
import { UpdateNotificationSeenRequest, UpdateNotificationSeenResponse } from "./dataplane_pb.js";
|
|
6
|
+
import { MethodKind } from "@bufbuild/protobuf";
|
|
7
|
+
/**
|
|
8
|
+
* @generated from service bsky.Service
|
|
9
|
+
*/
|
|
10
|
+
export const Service = {
|
|
11
|
+
typeName: "bsky.Service",
|
|
12
|
+
methods: {
|
|
13
|
+
/**
|
|
14
|
+
* @generated from rpc bsky.Service.UpdateNotificationSeen
|
|
15
|
+
*/
|
|
16
|
+
updateNotificationSeen: {
|
|
17
|
+
name: "UpdateNotificationSeen",
|
|
18
|
+
I: UpdateNotificationSeenRequest,
|
|
19
|
+
O: UpdateNotificationSeenResponse,
|
|
20
|
+
kind: MethodKind.Unary,
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=dataplane_connect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataplane_connect.js","sourceRoot":"","sources":["../../src/proto/dataplane_connect.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,qEAAqE;AACrE,oBAAoB;AACpB,cAAc;AAEd,OAAO,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE;QACP;;WAEG;QACH,sBAAsB,EAAE;YACtB,IAAI,EAAE,wBAAwB;YAC9B,CAAC,EAAE,6BAA6B;YAChC,CAAC,EAAE,8BAA8B;YACjC,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;KACF;CACO,CAAC","sourcesContent":["// @generated by protoc-gen-connect-es v1.7.0 with parameter \"target=ts,import_extension=.js\"\n// @generated from file dataplane.proto (package bsky, syntax proto3)\n/* eslint-disable */\n// @ts-nocheck\n\nimport { UpdateNotificationSeenRequest, UpdateNotificationSeenResponse } from \"./dataplane_pb.js\";\nimport { MethodKind } from \"@bufbuild/protobuf\";\n\n/**\n * @generated from service bsky.Service\n */\nexport const Service = {\n typeName: \"bsky.Service\",\n methods: {\n /**\n * @generated from rpc bsky.Service.UpdateNotificationSeen\n */\n updateNotificationSeen: {\n name: \"UpdateNotificationSeen\",\n I: UpdateNotificationSeenRequest,\n O: UpdateNotificationSeenResponse,\n kind: MethodKind.Unary,\n },\n }\n} as const;\n\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
|
|
2
|
+
import { Message, proto3, Timestamp } from "@bufbuild/protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* @generated from message bsky.UpdateNotificationSeenRequest
|
|
5
|
+
*/
|
|
6
|
+
export declare class UpdateNotificationSeenRequest extends Message<UpdateNotificationSeenRequest> {
|
|
7
|
+
/**
|
|
8
|
+
* @generated from field: string actor_did = 1;
|
|
9
|
+
*/
|
|
10
|
+
actorDid: string;
|
|
11
|
+
/**
|
|
12
|
+
* @generated from field: google.protobuf.Timestamp timestamp = 2;
|
|
13
|
+
*/
|
|
14
|
+
timestamp?: Timestamp;
|
|
15
|
+
constructor(data?: PartialMessage<UpdateNotificationSeenRequest>);
|
|
16
|
+
static readonly runtime: typeof proto3;
|
|
17
|
+
static readonly typeName = "bsky.UpdateNotificationSeenRequest";
|
|
18
|
+
static readonly fields: FieldList;
|
|
19
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UpdateNotificationSeenRequest;
|
|
20
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UpdateNotificationSeenRequest;
|
|
21
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UpdateNotificationSeenRequest;
|
|
22
|
+
static equals(a: UpdateNotificationSeenRequest | PlainMessage<UpdateNotificationSeenRequest> | undefined, b: UpdateNotificationSeenRequest | PlainMessage<UpdateNotificationSeenRequest> | undefined): boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @generated from message bsky.UpdateNotificationSeenResponse
|
|
26
|
+
*/
|
|
27
|
+
export declare class UpdateNotificationSeenResponse extends Message<UpdateNotificationSeenResponse> {
|
|
28
|
+
constructor(data?: PartialMessage<UpdateNotificationSeenResponse>);
|
|
29
|
+
static readonly runtime: typeof proto3;
|
|
30
|
+
static readonly typeName = "bsky.UpdateNotificationSeenResponse";
|
|
31
|
+
static readonly fields: FieldList;
|
|
32
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UpdateNotificationSeenResponse;
|
|
33
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UpdateNotificationSeenResponse;
|
|
34
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UpdateNotificationSeenResponse;
|
|
35
|
+
static equals(a: UpdateNotificationSeenResponse | PlainMessage<UpdateNotificationSeenResponse> | undefined, b: UpdateNotificationSeenResponse | PlainMessage<UpdateNotificationSeenResponse> | undefined): boolean;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=dataplane_pb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataplane_pb.d.ts","sourceRoot":"","sources":["../../src/proto/dataplane_pb.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjI,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEhE;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,OAAO,CAAC,6BAA6B,CAAC;IACvF;;OAEG;IACH,QAAQ,SAAM;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,YAAY,IAAI,CAAC,EAAE,cAAc,CAAC,6BAA6B,CAAC,EAG/D;IAED,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAU;IAChD,MAAM,CAAC,QAAQ,CAAC,QAAQ,wCAAwC;IAChE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAG9B;IAEH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,6BAA6B,CAExG;IAED,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,6BAA6B,CAEvG;IAED,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,6BAA6B,CAE3G;IAED,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,6BAA6B,GAAG,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,6BAA6B,GAAG,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,GAAG,OAAO,CAE7M;CACF;AAED;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,8BAA8B,CAAC;IACzF,YAAY,IAAI,CAAC,EAAE,cAAc,CAAC,8BAA8B,CAAC,EAGhE;IAED,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAU;IAChD,MAAM,CAAC,QAAQ,CAAC,QAAQ,yCAAyC;IACjE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAC9B;IAEH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,8BAA8B,CAEzG;IAED,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,8BAA8B,CAExG;IAED,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,8BAA8B,CAE5G;IAED,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,8BAA8B,GAAG,YAAY,CAAC,8BAA8B,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,8BAA8B,GAAG,YAAY,CAAC,8BAA8B,CAAC,GAAG,SAAS,GAAG,OAAO,CAEjN;CACF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v1.6.0 with parameter "target=ts,import_extension="
|
|
2
|
+
// @generated from file dataplane.proto (package bsky, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
import { Message, proto3, Timestamp } from "@bufbuild/protobuf";
|
|
6
|
+
/**
|
|
7
|
+
* @generated from message bsky.UpdateNotificationSeenRequest
|
|
8
|
+
*/
|
|
9
|
+
export class UpdateNotificationSeenRequest extends Message {
|
|
10
|
+
constructor(data) {
|
|
11
|
+
super();
|
|
12
|
+
/**
|
|
13
|
+
* @generated from field: string actor_did = 1;
|
|
14
|
+
*/
|
|
15
|
+
this.actorDid = "";
|
|
16
|
+
proto3.util.initPartial(data, this);
|
|
17
|
+
}
|
|
18
|
+
static { this.runtime = proto3; }
|
|
19
|
+
static { this.typeName = "bsky.UpdateNotificationSeenRequest"; }
|
|
20
|
+
static { this.fields = proto3.util.newFieldList(() => [
|
|
21
|
+
{ no: 1, name: "actor_did", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
22
|
+
{ no: 2, name: "timestamp", kind: "message", T: Timestamp },
|
|
23
|
+
]); }
|
|
24
|
+
static fromBinary(bytes, options) {
|
|
25
|
+
return new UpdateNotificationSeenRequest().fromBinary(bytes, options);
|
|
26
|
+
}
|
|
27
|
+
static fromJson(jsonValue, options) {
|
|
28
|
+
return new UpdateNotificationSeenRequest().fromJson(jsonValue, options);
|
|
29
|
+
}
|
|
30
|
+
static fromJsonString(jsonString, options) {
|
|
31
|
+
return new UpdateNotificationSeenRequest().fromJsonString(jsonString, options);
|
|
32
|
+
}
|
|
33
|
+
static equals(a, b) {
|
|
34
|
+
return proto3.util.equals(UpdateNotificationSeenRequest, a, b);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @generated from message bsky.UpdateNotificationSeenResponse
|
|
39
|
+
*/
|
|
40
|
+
export class UpdateNotificationSeenResponse extends Message {
|
|
41
|
+
constructor(data) {
|
|
42
|
+
super();
|
|
43
|
+
proto3.util.initPartial(data, this);
|
|
44
|
+
}
|
|
45
|
+
static { this.runtime = proto3; }
|
|
46
|
+
static { this.typeName = "bsky.UpdateNotificationSeenResponse"; }
|
|
47
|
+
static { this.fields = proto3.util.newFieldList(() => []); }
|
|
48
|
+
static fromBinary(bytes, options) {
|
|
49
|
+
return new UpdateNotificationSeenResponse().fromBinary(bytes, options);
|
|
50
|
+
}
|
|
51
|
+
static fromJson(jsonValue, options) {
|
|
52
|
+
return new UpdateNotificationSeenResponse().fromJson(jsonValue, options);
|
|
53
|
+
}
|
|
54
|
+
static fromJsonString(jsonString, options) {
|
|
55
|
+
return new UpdateNotificationSeenResponse().fromJsonString(jsonString, options);
|
|
56
|
+
}
|
|
57
|
+
static equals(a, b) {
|
|
58
|
+
return proto3.util.equals(UpdateNotificationSeenResponse, a, b);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=dataplane_pb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataplane_pb.js","sourceRoot":"","sources":["../../src/proto/dataplane_pb.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,qEAAqE;AACrE,oBAAoB;AACpB,cAAc;AAGd,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,OAAsC;IAWvF,YAAY,IAAoD;QAC9D,KAAK,EAAE,CAAC;QAXV;;WAEG;QACH,aAAQ,GAAG,EAAE,CAAC;QASZ,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;aAEe,YAAO,GAAkB,MAAM,AAAxB,CAAyB;aAChC,aAAQ,GAAG,oCAAoC,AAAvC,CAAwC;aAChD,WAAM,GAAc,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QACjE,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,uBAAuB,EAAE;QAC1E,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE;KAC5D,CAAC,AAHoB,CAGnB;IAEH,MAAM,CAAC,UAAU,CAAC,KAAiB,EAAE,OAAoC;QACvE,OAAO,IAAI,6BAA6B,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,SAAoB,EAAE,OAAkC;QACtE,OAAO,IAAI,6BAA6B,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,UAAkB,EAAE,OAAkC;QAC1E,OAAO,IAAI,6BAA6B,EAAE,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,CAA0F,EAAE,CAA0F;QAClM,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,OAAuC;IACzF,YAAY,IAAqD;QAC/D,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;aAEe,YAAO,GAAkB,MAAM,CAAC;aAChC,aAAQ,GAAG,qCAAqC,CAAC;aACjD,WAAM,GAAc,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,EAClE,CAAC,CAAC;IAEH,MAAM,CAAC,UAAU,CAAC,KAAiB,EAAE,OAAoC;QACvE,OAAO,IAAI,8BAA8B,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,SAAoB,EAAE,OAAkC;QACtE,OAAO,IAAI,8BAA8B,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,UAAkB,EAAE,OAAkC;QAC1E,OAAO,IAAI,8BAA8B,EAAE,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,CAA4F,EAAE,CAA4F;QACtM,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,8BAA8B,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;CACF","sourcesContent":["// @generated by protoc-gen-es v1.6.0 with parameter \"target=ts,import_extension=\"\n// @generated from file dataplane.proto (package bsky, syntax proto3)\n/* eslint-disable */\n// @ts-nocheck\n\nimport type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from \"@bufbuild/protobuf\";\nimport { Message, proto3, Timestamp } from \"@bufbuild/protobuf\";\n\n/**\n * @generated from message bsky.UpdateNotificationSeenRequest\n */\nexport class UpdateNotificationSeenRequest extends Message<UpdateNotificationSeenRequest> {\n /**\n * @generated from field: string actor_did = 1;\n */\n actorDid = \"\";\n\n /**\n * @generated from field: google.protobuf.Timestamp timestamp = 2;\n */\n timestamp?: Timestamp;\n\n constructor(data?: PartialMessage<UpdateNotificationSeenRequest>) {\n super();\n proto3.util.initPartial(data, this);\n }\n\n static readonly runtime: typeof proto3 = proto3;\n static readonly typeName = \"bsky.UpdateNotificationSeenRequest\";\n static readonly fields: FieldList = proto3.util.newFieldList(() => [\n { no: 1, name: \"actor_did\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 2, name: \"timestamp\", kind: \"message\", T: Timestamp },\n ]);\n\n static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UpdateNotificationSeenRequest {\n return new UpdateNotificationSeenRequest().fromBinary(bytes, options);\n }\n\n static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UpdateNotificationSeenRequest {\n return new UpdateNotificationSeenRequest().fromJson(jsonValue, options);\n }\n\n static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UpdateNotificationSeenRequest {\n return new UpdateNotificationSeenRequest().fromJsonString(jsonString, options);\n }\n\n static equals(a: UpdateNotificationSeenRequest | PlainMessage<UpdateNotificationSeenRequest> | undefined, b: UpdateNotificationSeenRequest | PlainMessage<UpdateNotificationSeenRequest> | undefined): boolean {\n return proto3.util.equals(UpdateNotificationSeenRequest, a, b);\n }\n}\n\n/**\n * @generated from message bsky.UpdateNotificationSeenResponse\n */\nexport class UpdateNotificationSeenResponse extends Message<UpdateNotificationSeenResponse> {\n constructor(data?: PartialMessage<UpdateNotificationSeenResponse>) {\n super();\n proto3.util.initPartial(data, this);\n }\n\n static readonly runtime: typeof proto3 = proto3;\n static readonly typeName = \"bsky.UpdateNotificationSeenResponse\";\n static readonly fields: FieldList = proto3.util.newFieldList(() => [\n ]);\n\n static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UpdateNotificationSeenResponse {\n return new UpdateNotificationSeenResponse().fromBinary(bytes, options);\n }\n\n static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UpdateNotificationSeenResponse {\n return new UpdateNotificationSeenResponse().fromJson(jsonValue, options);\n }\n\n static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UpdateNotificationSeenResponse {\n return new UpdateNotificationSeenResponse().fromJsonString(jsonString, options);\n }\n\n static equals(a: UpdateNotificationSeenResponse | PlainMessage<UpdateNotificationSeenResponse> | undefined, b: UpdateNotificationSeenResponse | PlainMessage<UpdateNotificationSeenResponse> | undefined): boolean {\n return proto3.util.equals(UpdateNotificationSeenResponse, a, b);\n }\n}\n\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts,import_extension=.js"
|
|
2
2
|
// @generated from file rolodex.proto (package rolodex, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rolodex_connect.js","sourceRoot":"","sources":["../../src/proto/rolodex_connect.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,sEAAsE;AACtE,oBAAoB;AACpB,cAAc;AAEd,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACzX,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,QAAQ,EAAE,wBAAwB;IAClC,OAAO,EAAE;QACP;;WAEG;QACH,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,CAAC,EAAE,WAAW;YACd,CAAC,EAAE,YAAY;YACf,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,aAAa,EAAE;YACb,IAAI,EAAE,eAAe;YACrB,CAAC,EAAE,oBAAoB;YACvB,CAAC,EAAE,qBAAqB;YACxB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,sBAAsB,EAAE;YACtB,IAAI,EAAE,wBAAwB;YAC9B,CAAC,EAAE,6BAA6B;YAChC,CAAC,EAAE,8BAA8B;YACjC,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,WAAW,EAAE;YACX,IAAI,EAAE,aAAa;YACnB,CAAC,EAAE,kBAAkB;YACrB,CAAC,EAAE,mBAAmB;YACtB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,cAAc,EAAE;YACd,IAAI,EAAE,gBAAgB;YACtB,CAAC,EAAE,qBAAqB;YACxB,CAAC,EAAE,sBAAsB;YACzB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,UAAU,EAAE;YACV,IAAI,EAAE,YAAY;YAClB,CAAC,EAAE,iBAAiB;YACpB,CAAC,EAAE,kBAAkB;YACrB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,YAAY,EAAE;YACZ,IAAI,EAAE,cAAc;YACpB,CAAC,EAAE,mBAAmB;YACtB,CAAC,EAAE,oBAAoB;YACvB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,UAAU,EAAE;YACV,IAAI,EAAE,YAAY;YAClB,CAAC,EAAE,iBAAiB;YACpB,CAAC,EAAE,kBAAkB;YACrB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;KACF;CACO,CAAC","sourcesContent":["// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
{"version":3,"file":"rolodex_connect.js","sourceRoot":"","sources":["../../src/proto/rolodex_connect.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,sEAAsE;AACtE,oBAAoB;AACpB,cAAc;AAEd,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACzX,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,QAAQ,EAAE,wBAAwB;IAClC,OAAO,EAAE;QACP;;WAEG;QACH,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,CAAC,EAAE,WAAW;YACd,CAAC,EAAE,YAAY;YACf,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,aAAa,EAAE;YACb,IAAI,EAAE,eAAe;YACrB,CAAC,EAAE,oBAAoB;YACvB,CAAC,EAAE,qBAAqB;YACxB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,sBAAsB,EAAE;YACtB,IAAI,EAAE,wBAAwB;YAC9B,CAAC,EAAE,6BAA6B;YAChC,CAAC,EAAE,8BAA8B;YACjC,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,WAAW,EAAE;YACX,IAAI,EAAE,aAAa;YACnB,CAAC,EAAE,kBAAkB;YACrB,CAAC,EAAE,mBAAmB;YACtB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,cAAc,EAAE;YACd,IAAI,EAAE,gBAAgB;YACtB,CAAC,EAAE,qBAAqB;YACxB,CAAC,EAAE,sBAAsB;YACzB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,UAAU,EAAE;YACV,IAAI,EAAE,YAAY;YAClB,CAAC,EAAE,iBAAiB;YACpB,CAAC,EAAE,kBAAkB;YACrB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,YAAY,EAAE;YACZ,IAAI,EAAE,cAAc;YACpB,CAAC,EAAE,mBAAmB;YACtB,CAAC,EAAE,oBAAoB;YACvB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;WAEG;QACH,UAAU,EAAE;YACV,IAAI,EAAE,YAAY;YAClB,CAAC,EAAE,iBAAiB;YACpB,CAAC,EAAE,kBAAkB;YACrB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;KACF;CACO,CAAC","sourcesContent":["// @generated by protoc-gen-connect-es v1.7.0 with parameter \"target=ts,import_extension=.js\"\n// @generated from file rolodex.proto (package rolodex, syntax proto3)\n/* eslint-disable */\n// @ts-nocheck\n\nimport { DismissMatchRequest, DismissMatchResponse, GetMatchesRequest, GetMatchesResponse, GetSyncStatusRequest, GetSyncStatusResponse, ImportContactsRequest, ImportContactsResponse, PingRequest, PingResponse, RemoveDataRequest, RemoveDataResponse, StartPhoneVerificationRequest, StartPhoneVerificationResponse, VerifyPhoneRequest, VerifyPhoneResponse } from \"./rolodex_pb.js\";\nimport { MethodKind } from \"@bufbuild/protobuf\";\n\n/**\n * @generated from service rolodex.RolodexService\n */\nexport const RolodexService = {\n typeName: \"rolodex.RolodexService\",\n methods: {\n /**\n * @generated from rpc rolodex.RolodexService.Ping\n */\n ping: {\n name: \"Ping\",\n I: PingRequest,\n O: PingResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc rolodex.RolodexService.GetSyncStatus\n */\n getSyncStatus: {\n name: \"GetSyncStatus\",\n I: GetSyncStatusRequest,\n O: GetSyncStatusResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc rolodex.RolodexService.StartPhoneVerification\n */\n startPhoneVerification: {\n name: \"StartPhoneVerification\",\n I: StartPhoneVerificationRequest,\n O: StartPhoneVerificationResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc rolodex.RolodexService.VerifyPhone\n */\n verifyPhone: {\n name: \"VerifyPhone\",\n I: VerifyPhoneRequest,\n O: VerifyPhoneResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc rolodex.RolodexService.ImportContacts\n */\n importContacts: {\n name: \"ImportContacts\",\n I: ImportContactsRequest,\n O: ImportContactsResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc rolodex.RolodexService.GetMatches\n */\n getMatches: {\n name: \"GetMatches\",\n I: GetMatchesRequest,\n O: GetMatchesResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc rolodex.RolodexService.DismissMatch\n */\n dismissMatch: {\n name: \"DismissMatch\",\n I: DismissMatchRequest,\n O: DismissMatchResponse,\n kind: MethodKind.Unary,\n },\n /**\n * @generated from rpc rolodex.RolodexService.RemoveData\n */\n removeData: {\n name: \"RemoveData\",\n I: RemoveDataRequest,\n O: RemoveDataResponse,\n kind: MethodKind.Unary,\n },\n }\n} as const;\n\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type HydrationSource = 'known_likers' | 'known_followers' | 'activity_subscriptions';
|
|
2
|
+
/**
|
|
3
|
+
* Central hub for reporting AppView events. Each method reports a
|
|
4
|
+
* single event to every relevant sink in one call:
|
|
5
|
+
*
|
|
6
|
+
* 1. a pino logger → stdout/stderr (docker logs)
|
|
7
|
+
* 2. an OTEL counter → aggregated metric (low-cardinality dimensions only)
|
|
8
|
+
* 3. the OTEL Logs SDK → structured, trace-correlated log record (full detail)
|
|
9
|
+
*
|
|
10
|
+
* This keeps the three concerns in sync: there is exactly one call site per
|
|
11
|
+
* event, and the counter / log / attribute definitions live together here
|
|
12
|
+
* rather than being duplicated and drifting across handlers.
|
|
13
|
+
*
|
|
14
|
+
* @note High-cardinality attributes (e.g. `did`, `uri`) belong in the pino and
|
|
15
|
+
* OTEL log records but must stay OUT of the counters, whose attributes must
|
|
16
|
+
* remain low-cardinality to avoid a metric-series explosion.
|
|
17
|
+
*
|
|
18
|
+
* @note The OTEL counters and log records are no-ops unless the corresponding
|
|
19
|
+
* OTEL exporter is configured, so calling these methods is always safe and
|
|
20
|
+
* essentially free when telemetry is disabled.
|
|
21
|
+
*/
|
|
22
|
+
declare class EventReporter {
|
|
23
|
+
#private;
|
|
24
|
+
hydrationFailed({ source, err }: {
|
|
25
|
+
source: HydrationSource;
|
|
26
|
+
err: unknown;
|
|
27
|
+
}): void;
|
|
28
|
+
}
|
|
29
|
+
export declare const events: EventReporter;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/telemetry/events.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,eAAe,GACzB,cAAc,GAAG,iBAAiB,GAAG,wBAAwB,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,cAAM,aAAa;;IAoCjB,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,GAAG,EAAE,OAAO,CAAA;KAAE,QAQzE;CACF;AAED,eAAO,MAAM,MAAM,EAAE,aAAmC,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ValueType, diag, metrics } from '@opentelemetry/api';
|
|
2
|
+
import { SeverityNumber, logs } from '@opentelemetry/api-logs';
|
|
3
|
+
import { eventsLogger } from '../logger.js';
|
|
4
|
+
import { isAbortError, isTimeoutError } from './util.js';
|
|
5
|
+
const meter = metrics.getMeter('@atproto/bsky');
|
|
6
|
+
const logger = logs.getLogger('@atproto/bsky');
|
|
7
|
+
/**
|
|
8
|
+
* Central hub for reporting AppView events. Each method reports a
|
|
9
|
+
* single event to every relevant sink in one call:
|
|
10
|
+
*
|
|
11
|
+
* 1. a pino logger → stdout/stderr (docker logs)
|
|
12
|
+
* 2. an OTEL counter → aggregated metric (low-cardinality dimensions only)
|
|
13
|
+
* 3. the OTEL Logs SDK → structured, trace-correlated log record (full detail)
|
|
14
|
+
*
|
|
15
|
+
* This keeps the three concerns in sync: there is exactly one call site per
|
|
16
|
+
* event, and the counter / log / attribute definitions live together here
|
|
17
|
+
* rather than being duplicated and drifting across handlers.
|
|
18
|
+
*
|
|
19
|
+
* @note High-cardinality attributes (e.g. `did`, `uri`) belong in the pino and
|
|
20
|
+
* OTEL log records but must stay OUT of the counters, whose attributes must
|
|
21
|
+
* remain low-cardinality to avoid a metric-series explosion.
|
|
22
|
+
*
|
|
23
|
+
* @note The OTEL counters and log records are no-ops unless the corresponding
|
|
24
|
+
* OTEL exporter is configured, so calling these methods is always safe and
|
|
25
|
+
* essentially free when telemetry is disabled.
|
|
26
|
+
*/
|
|
27
|
+
class EventReporter {
|
|
28
|
+
#hydrationFailedCounter = meter.createCounter('hydration.failed', {
|
|
29
|
+
description: 'Number of fail-open hydration steps that did not produce a result',
|
|
30
|
+
valueType: ValueType.INT,
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Fans a single event out to both the pino logger (stdout/stderr) and the
|
|
34
|
+
* OTEL Logs SDK (structured record).
|
|
35
|
+
*
|
|
36
|
+
* @note this method should never throw
|
|
37
|
+
*/
|
|
38
|
+
#log(eventName, attributes) {
|
|
39
|
+
try {
|
|
40
|
+
// Emits an OTEL log for the event (goes to collector).
|
|
41
|
+
logger.emit({
|
|
42
|
+
eventName,
|
|
43
|
+
severityNumber: SeverityNumber.INFO,
|
|
44
|
+
attributes,
|
|
45
|
+
});
|
|
46
|
+
// Emits a Pino log for the event (goes to stdout).
|
|
47
|
+
// NOTE: We'll probably migrate towards only using OTEL.
|
|
48
|
+
eventsLogger.info({ eventName, ...attributes });
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
diag.error(`Failed to log event ${eventName}:`, err);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
hydrationFailed({ source, err }) {
|
|
55
|
+
const reason = isAbortError(err)
|
|
56
|
+
? 'abort'
|
|
57
|
+
: isTimeoutError(err)
|
|
58
|
+
? 'timeout'
|
|
59
|
+
: 'error';
|
|
60
|
+
this.#log('hydration_failed', { source, reason });
|
|
61
|
+
this.#hydrationFailedCounter.add(1, { source, reason });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export const events = new EventReporter();
|
|
65
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/telemetry/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACzE,OAAO,EAAe,cAAc,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAExD,MAAM,KAAK,GAAU,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;AACtD,MAAM,MAAM,GAAW,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;AAKtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,aAAa;IACjB,uBAAuB,GAAG,KAAK,CAAC,aAAa,CAG1C,kBAAkB,EAAE;QACrB,WAAW,EACT,mEAAmE;QACrE,SAAS,EAAE,SAAS,CAAC,GAAG;KACzB,CAAC,CAAA;IAEF;;;;;OAKG;IACH,IAAI,CACF,SAAiB,EACjB,UAAiE;QAEjE,IAAI,CAAC;YACH,uDAAuD;YACvD,MAAM,CAAC,IAAI,CAAC;gBACV,SAAS;gBACT,cAAc,EAAE,cAAc,CAAC,IAAI;gBACnC,UAAU;aACX,CAAC,CAAA;YAEF,mDAAmD;YACnD,wDAAwD;YACxD,YAAY,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,CAAC,CAAA;QACjD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,KAAK,CAAC,uBAAuB,SAAS,GAAG,EAAE,GAAG,CAAC,CAAA;QACtD,CAAC;IACH,CAAC;IAED,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,EAA6C;QACxE,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC;YAC9B,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC;gBACnB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,OAAO,CAAA;QACb,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;QACjD,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IACzD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,MAAM,GAAkB,IAAI,aAAa,EAAE,CAAA","sourcesContent":["import { type Meter, ValueType, diag, metrics } from '@opentelemetry/api'\nimport { type Logger, SeverityNumber, logs } from '@opentelemetry/api-logs'\nimport { eventsLogger } from '../logger.js'\nimport { isAbortError, isTimeoutError } from './util.js'\n\nconst meter: Meter = metrics.getMeter('@atproto/bsky')\nconst logger: Logger = logs.getLogger('@atproto/bsky')\n\nexport type HydrationSource =\n 'known_likers' | 'known_followers' | 'activity_subscriptions'\n\n/**\n * Central hub for reporting AppView events. Each method reports a\n * single event to every relevant sink in one call:\n *\n * 1. a pino logger → stdout/stderr (docker logs)\n * 2. an OTEL counter → aggregated metric (low-cardinality dimensions only)\n * 3. the OTEL Logs SDK → structured, trace-correlated log record (full detail)\n *\n * This keeps the three concerns in sync: there is exactly one call site per\n * event, and the counter / log / attribute definitions live together here\n * rather than being duplicated and drifting across handlers.\n *\n * @note High-cardinality attributes (e.g. `did`, `uri`) belong in the pino and\n * OTEL log records but must stay OUT of the counters, whose attributes must\n * remain low-cardinality to avoid a metric-series explosion.\n *\n * @note The OTEL counters and log records are no-ops unless the corresponding\n * OTEL exporter is configured, so calling these methods is always safe and\n * essentially free when telemetry is disabled.\n */\nclass EventReporter {\n #hydrationFailedCounter = meter.createCounter<{\n source: HydrationSource\n reason: 'abort' | 'timeout' | 'error'\n }>('hydration.failed', {\n description:\n 'Number of fail-open hydration steps that did not produce a result',\n valueType: ValueType.INT,\n })\n\n /**\n * Fans a single event out to both the pino logger (stdout/stderr) and the\n * OTEL Logs SDK (structured record).\n *\n * @note this method should never throw\n */\n #log(\n eventName: string,\n attributes: Record<string, string | number | boolean | undefined>,\n ) {\n try {\n // Emits an OTEL log for the event (goes to collector).\n logger.emit({\n eventName,\n severityNumber: SeverityNumber.INFO,\n attributes,\n })\n\n // Emits a Pino log for the event (goes to stdout).\n // NOTE: We'll probably migrate towards only using OTEL.\n eventsLogger.info({ eventName, ...attributes })\n } catch (err) {\n diag.error(`Failed to log event ${eventName}:`, err)\n }\n }\n\n hydrationFailed({ source, err }: { source: HydrationSource; err: unknown }) {\n const reason = isAbortError(err)\n ? 'abort'\n : isTimeoutError(err)\n ? 'timeout'\n : 'error'\n this.#log('hydration_failed', { source, reason })\n this.#hydrationFailedCounter.add(1, { source, reason })\n }\n}\n\nexport const events: EventReporter = new EventReporter()\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Interceptor, type StreamRequest, type UnaryRequest } from '@connectrpc/connect';
|
|
2
|
+
import { type Attributes } from '@opentelemetry/api';
|
|
3
|
+
type RpcRequest = UnaryRequest | StreamRequest;
|
|
4
|
+
/**
|
|
5
|
+
* Derives extra attributes from a request. The returned attributes land on both
|
|
6
|
+
* the duration histogram and the client span, so they must stay
|
|
7
|
+
* low-cardinality: no DIDs, keys or URIs, which would explode the metric series.
|
|
8
|
+
*/
|
|
9
|
+
type GetAttributes = (request: RpcRequest) => Attributes;
|
|
10
|
+
/**
|
|
11
|
+
* Records client-side telemetry for every outbound Connect RPC: an
|
|
12
|
+
* `rpc.client.call.duration` histogram and a CLIENT span, with the trace
|
|
13
|
+
* context injected into the request headers so the callee's spans join this
|
|
14
|
+
* trace.
|
|
15
|
+
*
|
|
16
|
+
* The server half of a bsync call is recorded by `@atproto/bsync`'s
|
|
17
|
+
* `withRpcServerTelemetry`, using the same attribute keys.
|
|
18
|
+
*/
|
|
19
|
+
export declare const createRpcClientInterceptor: (getAttributes?: GetAttributes) => Interceptor;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/telemetry/rpc.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,KAAK,UAAU,EAShB,MAAM,oBAAoB,CAAA;AAY3B,KAAK,UAAU,GAAG,YAAY,GAAG,aAAa,CAAA;AAE9C;;;;GAIG;AACH,KAAK,aAAa,GAAG,CAAC,OAAO,EAAE,UAAU,KAAK,UAAU,CAAA;AAoBxD;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,mBACrB,aAAa,KAC5B,WA6CF,CAAA"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { performance } from 'node:perf_hooks';
|
|
2
|
+
import { Code, ConnectError, } from '@connectrpc/connect';
|
|
3
|
+
import { SpanKind, SpanStatusCode, ValueType, context, metrics, propagation, trace, } from '@opentelemetry/api';
|
|
4
|
+
import { ATTR_ERROR_TYPE } from '@opentelemetry/semantic-conventions';
|
|
5
|
+
import { ATTR_RPC_METHOD, ATTR_RPC_RESPONSE_STATUS_CODE, ATTR_RPC_SYSTEM_NAME, METRIC_RPC_CLIENT_CALL_DURATION, RPC_SYSTEM_NAME_VALUE_CONNECTRPC, } from '@opentelemetry/semantic-conventions/incubating';
|
|
6
|
+
import { RPC_CALL_DURATION_BUCKETS } from '@atproto-labs/opentelemetry-node/conventions';
|
|
7
|
+
import { statusCodeToString } from '@atproto-labs/opentelemetry-node/util';
|
|
8
|
+
const tracer = trace.getTracer('@atproto/bsky');
|
|
9
|
+
const meter = metrics.getMeter('@atproto/bsky');
|
|
10
|
+
const rpcClientDuration = meter.createHistogram(METRIC_RPC_CLIENT_CALL_DURATION, {
|
|
11
|
+
description: 'Measures the duration of an outgoing Remote Procedure Call',
|
|
12
|
+
unit: 's',
|
|
13
|
+
valueType: ValueType.DOUBLE,
|
|
14
|
+
advice: { explicitBucketBoundaries: RPC_CALL_DURATION_BUCKETS },
|
|
15
|
+
});
|
|
16
|
+
const headersSetter = {
|
|
17
|
+
set(carrier, key, value) {
|
|
18
|
+
carrier.set(key, value);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Records client-side telemetry for every outbound Connect RPC: an
|
|
23
|
+
* `rpc.client.call.duration` histogram and a CLIENT span, with the trace
|
|
24
|
+
* context injected into the request headers so the callee's spans join this
|
|
25
|
+
* trace.
|
|
26
|
+
*
|
|
27
|
+
* The server half of a bsync call is recorded by `@atproto/bsync`'s
|
|
28
|
+
* `withRpcServerTelemetry`, using the same attribute keys.
|
|
29
|
+
*/
|
|
30
|
+
export const createRpcClientInterceptor = (getAttributes) => {
|
|
31
|
+
return (next) => async (req) => {
|
|
32
|
+
// @NOTE The RPC convention requires `rpc.method` to be the fully-qualified
|
|
33
|
+
// method name, so the service name is part of it rather than an attribute
|
|
34
|
+
// of its own.
|
|
35
|
+
const method = `${req.service.typeName}/${req.method.name}`;
|
|
36
|
+
const attributes = {
|
|
37
|
+
[ATTR_RPC_SYSTEM_NAME]: RPC_SYSTEM_NAME_VALUE_CONNECTRPC,
|
|
38
|
+
[ATTR_RPC_METHOD]: method,
|
|
39
|
+
...getAttributes?.(req),
|
|
40
|
+
};
|
|
41
|
+
const start = performance.now();
|
|
42
|
+
return tracer.startActiveSpan(method, { kind: SpanKind.CLIENT, attributes }, async (span) => {
|
|
43
|
+
propagation.inject(context.active(), req.header, headersSetter);
|
|
44
|
+
let code;
|
|
45
|
+
try {
|
|
46
|
+
return await next(req);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
code = err instanceof ConnectError ? err.code : Code.Unknown;
|
|
50
|
+
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
51
|
+
span.recordException(err instanceof Error ? err : String(err));
|
|
52
|
+
throw err;
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
const statusCode = statusCodeToString(code);
|
|
56
|
+
const completedAttributes = {
|
|
57
|
+
...attributes,
|
|
58
|
+
[ATTR_RPC_RESPONSE_STATUS_CODE]: statusCode,
|
|
59
|
+
// @NOTE The convention requires `error.type` to be unset on
|
|
60
|
+
// success, and to carry the status code on failure.
|
|
61
|
+
...(code !== undefined && { [ATTR_ERROR_TYPE]: statusCode }),
|
|
62
|
+
};
|
|
63
|
+
span.setAttributes(completedAttributes);
|
|
64
|
+
rpcClientDuration.record((performance.now() - start) / 1000, completedAttributes);
|
|
65
|
+
span.end();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../src/telemetry/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EACL,IAAI,EACJ,YAAY,GAIb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,QAAQ,EACR,cAAc,EAEd,SAAS,EACT,OAAO,EACP,OAAO,EACP,WAAW,EACX,KAAK,GACN,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EACL,eAAe,EACf,6BAA6B,EAC7B,oBAAoB,EACpB,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,gDAAgD,CAAA;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAA;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAA;AAW1E,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;AAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;AAC/C,MAAM,iBAAiB,GAAG,KAAK,CAAC,eAAe,CAC7C,+BAA+B,EAC/B;IACE,WAAW,EAAE,4DAA4D;IACzE,IAAI,EAAE,GAAG;IACT,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,MAAM,EAAE,EAAE,wBAAwB,EAAE,yBAAyB,EAAE;CAChE,CACF,CAAA;AAED,MAAM,aAAa,GAA2B;IAC5C,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK;QACrB,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACzB,CAAC;CACF,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,aAA6B,EAChB,EAAE;IACf,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAC7B,2EAA2E;QAC3E,0EAA0E;QAC1E,cAAc;QACd,MAAM,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;QAC3D,MAAM,UAAU,GAAe;YAC7B,CAAC,oBAAoB,CAAC,EAAE,gCAAgC;YACxD,CAAC,eAAe,CAAC,EAAE,MAAM;YACzB,GAAG,aAAa,EAAE,CAAC,GAAG,CAAC;SACxB,CAAA;QACD,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAA;QAE/B,OAAO,MAAM,CAAC,eAAe,CAC3B,MAAM,EACN,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,EACrC,KAAK,EAAE,IAAI,EAAE,EAAE;YACb,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;YAC/D,IAAI,IAAsB,CAAA;YAC1B,IAAI,CAAC;gBACH,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,CAAA;YACxB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,GAAG,GAAG,YAAY,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAA;gBAC5D,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC,CAAA;gBAC9C,IAAI,CAAC,eAAe,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;gBAC9D,MAAM,GAAG,CAAA;YACX,CAAC;oBAAS,CAAC;gBACT,MAAM,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;gBAC3C,MAAM,mBAAmB,GAAe;oBACtC,GAAG,UAAU;oBACb,CAAC,6BAA6B,CAAC,EAAE,UAAU;oBAC3C,4DAA4D;oBAC5D,oDAAoD;oBACpD,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,CAAC,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC;iBAC7D,CAAA;gBACD,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAA;gBACvC,iBAAiB,CAAC,MAAM,CACtB,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,IAAI,EAClC,mBAAmB,CACpB,CAAA;gBACD,IAAI,CAAC,GAAG,EAAE,CAAA;YACZ,CAAC;QACH,CAAC,CACF,CAAA;IACH,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { performance } from 'node:perf_hooks'\nimport {\n Code,\n ConnectError,\n type Interceptor,\n type StreamRequest,\n type UnaryRequest,\n} from '@connectrpc/connect'\nimport {\n type Attributes,\n SpanKind,\n SpanStatusCode,\n type TextMapSetter,\n ValueType,\n context,\n metrics,\n propagation,\n trace,\n} from '@opentelemetry/api'\nimport { ATTR_ERROR_TYPE } from '@opentelemetry/semantic-conventions'\nimport {\n ATTR_RPC_METHOD,\n ATTR_RPC_RESPONSE_STATUS_CODE,\n ATTR_RPC_SYSTEM_NAME,\n METRIC_RPC_CLIENT_CALL_DURATION,\n RPC_SYSTEM_NAME_VALUE_CONNECTRPC,\n} from '@opentelemetry/semantic-conventions/incubating'\nimport { RPC_CALL_DURATION_BUCKETS } from '@atproto-labs/opentelemetry-node/conventions'\nimport { statusCodeToString } from '@atproto-labs/opentelemetry-node/util'\n\ntype RpcRequest = UnaryRequest | StreamRequest\n\n/**\n * Derives extra attributes from a request. The returned attributes land on both\n * the duration histogram and the client span, so they must stay\n * low-cardinality: no DIDs, keys or URIs, which would explode the metric series.\n */\ntype GetAttributes = (request: RpcRequest) => Attributes\n\nconst tracer = trace.getTracer('@atproto/bsky')\nconst meter = metrics.getMeter('@atproto/bsky')\nconst rpcClientDuration = meter.createHistogram(\n METRIC_RPC_CLIENT_CALL_DURATION,\n {\n description: 'Measures the duration of an outgoing Remote Procedure Call',\n unit: 's',\n valueType: ValueType.DOUBLE,\n advice: { explicitBucketBoundaries: RPC_CALL_DURATION_BUCKETS },\n },\n)\n\nconst headersSetter: TextMapSetter<Headers> = {\n set(carrier, key, value) {\n carrier.set(key, value)\n },\n}\n\n/**\n * Records client-side telemetry for every outbound Connect RPC: an\n * `rpc.client.call.duration` histogram and a CLIENT span, with the trace\n * context injected into the request headers so the callee's spans join this\n * trace.\n *\n * The server half of a bsync call is recorded by `@atproto/bsync`'s\n * `withRpcServerTelemetry`, using the same attribute keys.\n */\nexport const createRpcClientInterceptor = (\n getAttributes?: GetAttributes,\n): Interceptor => {\n return (next) => async (req) => {\n // @NOTE The RPC convention requires `rpc.method` to be the fully-qualified\n // method name, so the service name is part of it rather than an attribute\n // of its own.\n const method = `${req.service.typeName}/${req.method.name}`\n const attributes: Attributes = {\n [ATTR_RPC_SYSTEM_NAME]: RPC_SYSTEM_NAME_VALUE_CONNECTRPC,\n [ATTR_RPC_METHOD]: method,\n ...getAttributes?.(req),\n }\n const start = performance.now()\n\n return tracer.startActiveSpan(\n method,\n { kind: SpanKind.CLIENT, attributes },\n async (span) => {\n propagation.inject(context.active(), req.header, headersSetter)\n let code: Code | undefined\n try {\n return await next(req)\n } catch (err) {\n code = err instanceof ConnectError ? err.code : Code.Unknown\n span.setStatus({ code: SpanStatusCode.ERROR })\n span.recordException(err instanceof Error ? err : String(err))\n throw err\n } finally {\n const statusCode = statusCodeToString(code)\n const completedAttributes: Attributes = {\n ...attributes,\n [ATTR_RPC_RESPONSE_STATUS_CODE]: statusCode,\n // @NOTE The convention requires `error.type` to be unset on\n // success, and to carry the status code on failure.\n ...(code !== undefined && { [ATTR_ERROR_TYPE]: statusCode }),\n }\n span.setAttributes(completedAttributes)\n rpcClientDuration.record(\n (performance.now() - start) / 1000,\n completedAttributes,\n )\n span.end()\n }\n },\n )\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/telemetry/telemetry.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/telemetry/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAExD,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;IACjB,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,OAAO,EAAE,GAAG,CAAC,OAAO;CACrB,CAAC,CAAC,CAAA","sourcesContent":["import pkg from '@atproto/bsky/package.json' with { type: 'json' }\nimport { setup } from '@atproto-labs/opentelemetry-node'\n\nawait setup(() => ({\n name: pkg.name,\n version: pkg.version,\n}))\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether we gave up on the call: an `AbortSignal.timeout()` of ours elapsed,
|
|
3
|
+
* which rejects with a `DOMException` named `TimeoutError` (per the DOM spec).
|
|
4
|
+
*
|
|
5
|
+
* @note Connect wraps that exception in a `ConnectError`, so it is only
|
|
6
|
+
* reachable through `cause`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isAbortError(err: unknown): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the dataplane gave up on the call, reported as the gRPC
|
|
11
|
+
* `DeadlineExceeded` status.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isTimeoutError(err: unknown): boolean;
|
|
14
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/telemetry/util.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAIlD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEpD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Code, ConnectError } from '@connectrpc/connect';
|
|
2
|
+
/**
|
|
3
|
+
* Whether we gave up on the call: an `AbortSignal.timeout()` of ours elapsed,
|
|
4
|
+
* which rejects with a `DOMException` named `TimeoutError` (per the DOM spec).
|
|
5
|
+
*
|
|
6
|
+
* @note Connect wraps that exception in a `ConnectError`, so it is only
|
|
7
|
+
* reachable through `cause`.
|
|
8
|
+
*/
|
|
9
|
+
export function isAbortError(err) {
|
|
10
|
+
if (!(err instanceof Error))
|
|
11
|
+
return false;
|
|
12
|
+
if (err instanceof DOMException && err.name === 'TimeoutError')
|
|
13
|
+
return true;
|
|
14
|
+
return isAbortError(err.cause);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Whether the dataplane gave up on the call, reported as the gRPC
|
|
18
|
+
* `DeadlineExceeded` status.
|
|
19
|
+
*/
|
|
20
|
+
export function isTimeoutError(err) {
|
|
21
|
+
return err instanceof ConnectError && err.code === Code.DeadlineExceeded;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/telemetry/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,IAAI,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IACzC,IAAI,GAAG,YAAY,YAAY,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc;QAAE,OAAO,IAAI,CAAA;IAC3E,OAAO,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,GAAY;IACzC,OAAO,GAAG,YAAY,YAAY,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,gBAAgB,CAAA;AAC1E,CAAC","sourcesContent":["import { Code, ConnectError } from '@connectrpc/connect'\n\n/**\n * Whether we gave up on the call: an `AbortSignal.timeout()` of ours elapsed,\n * which rejects with a `DOMException` named `TimeoutError` (per the DOM spec).\n *\n * @note Connect wraps that exception in a `ConnectError`, so it is only\n * reachable through `cause`.\n */\nexport function isAbortError(err: unknown): boolean {\n if (!(err instanceof Error)) return false\n if (err instanceof DOMException && err.name === 'TimeoutError') return true\n return isAbortError(err.cause)\n}\n\n/**\n * Whether the dataplane gave up on the call, reported as the gRPC\n * `DeadlineExceeded` status.\n */\nexport function isTimeoutError(err: unknown): boolean {\n return err instanceof ConnectError && err.code === Code.DeadlineExceeded\n}\n"]}
|
package/dist/undici.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Agent as Undici6Agent } from 'undici_v6';
|
|
2
|
+
import { Agent as Undici7Agent } from 'undici_v7';
|
|
3
|
+
import { Agent as Undici8Agent } from 'undici_v8';
|
|
4
|
+
export type UndiciAgent = Undici6Agent | Undici7Agent | Undici8Agent;
|
|
5
|
+
/**
|
|
6
|
+
* The subset of undici's `Agent.Options` that is stable across the undici major
|
|
7
|
+
* versions supported here.
|
|
8
|
+
*/
|
|
9
|
+
export type UndiciAgentOptions = {
|
|
10
|
+
/** Milliseconds allowed for the connection phase (TCP + TLS). */
|
|
11
|
+
connectTimeout?: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Builds an undici {@link UndiciAgent} from the same major version of undici as
|
|
15
|
+
* the one embedded in the running NodeJS.
|
|
16
|
+
*
|
|
17
|
+
* @note Major versions of undici are not guaranteed to be backwards compatible,
|
|
18
|
+
* so a dispatcher can only be passed to a `fetch()` backed by the same major
|
|
19
|
+
* version. Since `globalThis.fetch` is backed by the undici NodeJS embeds, the
|
|
20
|
+
* dispatcher must be built from that same major version, which is not
|
|
21
|
+
* necessarily the version this package depends on.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createUndiciAgent(options?: UndiciAgentOptions): UndiciAgent;
|
|
24
|
+
/**
|
|
25
|
+
* Wraps the global fetch so that every request is issued through the given
|
|
26
|
+
* undici dispatcher.
|
|
27
|
+
*/
|
|
28
|
+
export declare function dispatcherFetch(dispatcher: UndiciAgent): typeof globalThis.fetch;
|
|
29
|
+
//# sourceMappingURL=undici.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undici.d.ts","sourceRoot":"","sources":["../src/undici.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AAEjD,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAA;AAEpE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,WAAW,CAiB3E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,WAAW,GACtB,OAAO,UAAU,CAAC,KAAK,CAUzB"}
|
package/dist/undici.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Agent as Undici6Agent } from 'undici_v6'; // NodeJS 22
|
|
2
|
+
import { Agent as Undici7Agent } from 'undici_v7'; // NodeJS 24
|
|
3
|
+
import { Agent as Undici8Agent } from 'undici_v8'; // NodeJS 26
|
|
4
|
+
/**
|
|
5
|
+
* Builds an undici {@link UndiciAgent} from the same major version of undici as
|
|
6
|
+
* the one embedded in the running NodeJS.
|
|
7
|
+
*
|
|
8
|
+
* @note Major versions of undici are not guaranteed to be backwards compatible,
|
|
9
|
+
* so a dispatcher can only be passed to a `fetch()` backed by the same major
|
|
10
|
+
* version. Since `globalThis.fetch` is backed by the undici NodeJS embeds, the
|
|
11
|
+
* dispatcher must be built from that same major version, which is not
|
|
12
|
+
* necessarily the version this package depends on.
|
|
13
|
+
*/
|
|
14
|
+
export function createUndiciAgent(options) {
|
|
15
|
+
const major = Number(process.versions.undici?.split('.')[0]);
|
|
16
|
+
// @NOTE We deliberately do not fall back to the most recent Agent for unknown
|
|
17
|
+
// versions: a mismatched dispatcher interface would fail at runtime.
|
|
18
|
+
switch (major) {
|
|
19
|
+
case 6:
|
|
20
|
+
return new Undici6Agent(options);
|
|
21
|
+
case 7:
|
|
22
|
+
return new Undici7Agent(options);
|
|
23
|
+
case 8:
|
|
24
|
+
return new Undici8Agent(options);
|
|
25
|
+
default:
|
|
26
|
+
throw new Error(`Unsupported undici version: ${process.versions.undici}. Expected NodeJS to embed undici 6, 7, or 8.`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Wraps the global fetch so that every request is issued through the given
|
|
31
|
+
* undici dispatcher.
|
|
32
|
+
*/
|
|
33
|
+
export function dispatcherFetch(dispatcher) {
|
|
34
|
+
return (input, init) => globalThis.fetch(input, {
|
|
35
|
+
...init,
|
|
36
|
+
// @ts-ignore `dispatcher` is not part of the WHATWG `RequestInit`, but
|
|
37
|
+
// undici (which backs `globalThis.fetch` in NodeJS) does honor it. The
|
|
38
|
+
// dispatcher comes from `createUndiciAgent`, so its interface matches the
|
|
39
|
+
// undici backing that fetch.
|
|
40
|
+
dispatcher,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=undici.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undici.js","sourceRoot":"","sources":["../src/undici.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA,CAAC,YAAY;AAC9D,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA,CAAC,YAAY;AAC9D,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA,CAAC,YAAY;AAa9D;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA4B;IAC5D,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAE5D,8EAA8E;IAC9E,qEAAqE;IACrE,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,CAAC;YACJ,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAA;QAClC,KAAK,CAAC;YACJ,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAA;QAClC,KAAK,CAAC;YACJ,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAA;QAClC;YACE,MAAM,IAAI,KAAK,CACb,+BAA+B,OAAO,CAAC,QAAQ,CAAC,MAAM,+CAA+C,CACtG,CAAA;IACL,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,UAAuB;IAEvB,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CACrB,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE;QACtB,GAAG,IAAI;QACP,uEAAuE;QACvE,uEAAuE;QACvE,0EAA0E;QAC1E,6BAA6B;QAC7B,UAAU;KACX,CAAC,CAAA;AACN,CAAC","sourcesContent":["import { Agent as Undici6Agent } from 'undici_v6' // NodeJS 22\nimport { Agent as Undici7Agent } from 'undici_v7' // NodeJS 24\nimport { Agent as Undici8Agent } from 'undici_v8' // NodeJS 26\n\nexport type UndiciAgent = Undici6Agent | Undici7Agent | Undici8Agent\n\n/**\n * The subset of undici's `Agent.Options` that is stable across the undici major\n * versions supported here.\n */\nexport type UndiciAgentOptions = {\n /** Milliseconds allowed for the connection phase (TCP + TLS). */\n connectTimeout?: number\n}\n\n/**\n * Builds an undici {@link UndiciAgent} from the same major version of undici as\n * the one embedded in the running NodeJS.\n *\n * @note Major versions of undici are not guaranteed to be backwards compatible,\n * so a dispatcher can only be passed to a `fetch()` backed by the same major\n * version. Since `globalThis.fetch` is backed by the undici NodeJS embeds, the\n * dispatcher must be built from that same major version, which is not\n * necessarily the version this package depends on.\n */\nexport function createUndiciAgent(options?: UndiciAgentOptions): UndiciAgent {\n const major = Number(process.versions.undici?.split('.')[0])\n\n // @NOTE We deliberately do not fall back to the most recent Agent for unknown\n // versions: a mismatched dispatcher interface would fail at runtime.\n switch (major) {\n case 6:\n return new Undici6Agent(options)\n case 7:\n return new Undici7Agent(options)\n case 8:\n return new Undici8Agent(options)\n default:\n throw new Error(\n `Unsupported undici version: ${process.versions.undici}. Expected NodeJS to embed undici 6, 7, or 8.`,\n )\n }\n}\n\n/**\n * Wraps the global fetch so that every request is issued through the given\n * undici dispatcher.\n */\nexport function dispatcherFetch(\n dispatcher: UndiciAgent,\n): typeof globalThis.fetch {\n return (input, init) =>\n globalThis.fetch(input, {\n ...init,\n // @ts-ignore `dispatcher` is not part of the WHATWG `RequestInit`, but\n // undici (which backs `globalThis.fetch` in NodeJS) does honor it. The\n // dispatcher comes from `createUndiciAgent`, so its interface matches the\n // undici backing that fetch.\n dispatcher,\n })\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../src/util/headers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAKpD,wBAAgB,4BAA4B,CAAC,GAAG,EAAE;IAChD,OAAO,EAAE,mBAAmB,CAAA;CAC7B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBzB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @NOTE `x-bsky-topics` is deprecated; use `x-atproto-bsky-topics`.
|
|
2
|
+
const LEGACY_TOPIC_HEADER = 'x-bsky-topics';
|
|
3
|
+
export function getAtprotoPassthroughHeaders(req) {
|
|
4
|
+
const headers = {};
|
|
5
|
+
for (const [name, value] of Object.entries(req.headers)) {
|
|
6
|
+
if ((name.startsWith('x-atproto-') || name === LEGACY_TOPIC_HEADER) &&
|
|
7
|
+
value != null) {
|
|
8
|
+
headers[name] = Array.isArray(value) ? value.join(',') : value;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const topics = req.headers['x-atproto-bsky-topics'] ?? req.headers[LEGACY_TOPIC_HEADER];
|
|
12
|
+
if (topics != null) {
|
|
13
|
+
headers['x-atproto-bsky-topics'] = Array.isArray(topics)
|
|
14
|
+
? topics.join(',')
|
|
15
|
+
: topics;
|
|
16
|
+
}
|
|
17
|
+
return headers;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=headers.js.map
|