@atproto/bsky 0.0.159 → 0.0.161
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 +17 -0
- package/dist/api/app/bsky/notification/util.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/util.js +8 -8
- package/dist/api/app/bsky/notification/util.js.map +1 -1
- package/dist/api/blob-resolver.js +1 -1
- package/dist/api/blob-resolver.js.map +1 -1
- package/dist/data-plane/server/routes/private-data.js +6 -6
- package/dist/data-plane/server/routes/private-data.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +8 -8
- package/dist/lexicon/lexicons.js +4 -4
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/defs.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/notification/defs.d.ts.map +1 -1
- package/dist/proto/bsky_pb.d.ts +14 -14
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +41 -41
- package/dist/proto/bsky_pb.js.map +1 -1
- package/package.json +6 -6
- package/proto/bsky.proto +10 -10
- package/src/api/app/bsky/notification/util.ts +13 -12
- package/src/api/blob-resolver.ts +1 -1
- package/src/data-plane/server/routes/private-data.ts +10 -10
- package/src/lexicon/lexicons.ts +4 -4
- package/src/lexicon/types/app/bsky/notification/defs.ts +2 -2
- package/src/proto/bsky_pb.ts +33 -29
- package/tests/views/notifications.test.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsky",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.161",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Reference implementation of app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
"undici": "^6.19.8",
|
|
50
50
|
"@atproto-labs/fetch-node": "0.1.9",
|
|
51
51
|
"@atproto-labs/xrpc-utils": "0.0.16",
|
|
52
|
-
"@atproto/api": "^0.15.
|
|
52
|
+
"@atproto/api": "^0.15.16",
|
|
53
53
|
"@atproto/common": "^0.4.11",
|
|
54
54
|
"@atproto/crypto": "^0.4.4",
|
|
55
55
|
"@atproto/did": "^0.1.5",
|
|
56
56
|
"@atproto/identity": "^0.4.8",
|
|
57
57
|
"@atproto/lexicon": "^0.4.11",
|
|
58
|
-
"@atproto/repo": "^0.8.
|
|
59
|
-
"@atproto/sync": "^0.1.
|
|
58
|
+
"@atproto/repo": "^0.8.2",
|
|
59
|
+
"@atproto/sync": "^0.1.26",
|
|
60
60
|
"@atproto/syntax": "^0.4.0",
|
|
61
61
|
"@atproto/xrpc-server": "^0.8.0"
|
|
62
62
|
},
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"jest": "^28.1.2",
|
|
74
74
|
"ts-node": "^10.8.2",
|
|
75
75
|
"typescript": "^5.6.3",
|
|
76
|
-
"@atproto/api": "^0.15.
|
|
76
|
+
"@atproto/api": "^0.15.16",
|
|
77
77
|
"@atproto/lex-cli": "^0.8.2",
|
|
78
|
-
"@atproto/pds": "^0.4.
|
|
78
|
+
"@atproto/pds": "^0.4.150",
|
|
79
79
|
"@atproto/xrpc": "^0.7.0"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
package/proto/bsky.proto
CHANGED
|
@@ -765,14 +765,14 @@ message NotificationChannelPush {
|
|
|
765
765
|
bool enabled = 1;
|
|
766
766
|
}
|
|
767
767
|
|
|
768
|
-
enum
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
768
|
+
enum NotificationInclude {
|
|
769
|
+
NOTIFICATION_INCLUDE_UNSPECIFIED = 0;
|
|
770
|
+
NOTIFICATION_INCLUDE_ALL = 1;
|
|
771
|
+
NOTIFICATION_INCLUDE_FOLLOWS = 2;
|
|
772
772
|
}
|
|
773
773
|
|
|
774
774
|
message FilterableNotificationPreference {
|
|
775
|
-
|
|
775
|
+
NotificationInclude include = 1;
|
|
776
776
|
NotificationChannelList list = 2;
|
|
777
777
|
NotificationChannelPush push = 3;
|
|
778
778
|
}
|
|
@@ -782,14 +782,14 @@ message NotificationPreference {
|
|
|
782
782
|
NotificationChannelPush push = 2;
|
|
783
783
|
}
|
|
784
784
|
|
|
785
|
-
enum
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
785
|
+
enum ChatNotificationInclude {
|
|
786
|
+
CHAT_NOTIFICATION_INCLUDE_UNSPECIFIED = 0;
|
|
787
|
+
CHAT_NOTIFICATION_INCLUDE_ALL = 1;
|
|
788
|
+
CHAT_NOTIFICATION_INCLUDE_ACCEPTED = 2;
|
|
789
789
|
}
|
|
790
790
|
|
|
791
791
|
message ChatNotificationPreference {
|
|
792
|
-
|
|
792
|
+
ChatNotificationInclude include = 1;
|
|
793
793
|
NotificationChannelPush push = 2;
|
|
794
794
|
}
|
|
795
795
|
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
Preferences,
|
|
7
7
|
} from '../../../../lexicon/types/app/bsky/notification/defs'
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
ChatNotificationInclude,
|
|
10
10
|
ChatNotificationPreference,
|
|
11
11
|
FilterableNotificationPreference,
|
|
12
|
-
|
|
12
|
+
NotificationInclude,
|
|
13
13
|
NotificationPreference,
|
|
14
14
|
NotificationPreferences,
|
|
15
15
|
} from '../../../../proto/bsky_pb'
|
|
@@ -23,11 +23,11 @@ type DeepPartial<T> = T extends object
|
|
|
23
23
|
const ensureChatPreference = (
|
|
24
24
|
p?: DeepPartial<ChatPreference>,
|
|
25
25
|
): ChatPreference => {
|
|
26
|
-
const
|
|
26
|
+
const includeValues = ['all', 'accepted']
|
|
27
27
|
return {
|
|
28
|
-
|
|
29
|
-
typeof p?.
|
|
30
|
-
? p.
|
|
28
|
+
include:
|
|
29
|
+
typeof p?.include === 'string' && includeValues.includes(p.include)
|
|
30
|
+
? p.include
|
|
31
31
|
: 'all',
|
|
32
32
|
push: p?.push ?? true,
|
|
33
33
|
}
|
|
@@ -36,11 +36,11 @@ const ensureChatPreference = (
|
|
|
36
36
|
const ensureFilterablePreference = (
|
|
37
37
|
p?: DeepPartial<FilterablePreference>,
|
|
38
38
|
): FilterablePreference => {
|
|
39
|
-
const
|
|
39
|
+
const includeValues = ['all', 'follows']
|
|
40
40
|
return {
|
|
41
|
-
|
|
42
|
-
typeof p?.
|
|
43
|
-
? p.
|
|
41
|
+
include:
|
|
42
|
+
typeof p?.include === 'string' && includeValues.includes(p.include)
|
|
43
|
+
? p.include
|
|
44
44
|
: 'all',
|
|
45
45
|
list: p?.list ?? true,
|
|
46
46
|
push: p?.push ?? true,
|
|
@@ -78,7 +78,8 @@ const protobufChatPreferenceToLex = (
|
|
|
78
78
|
p?: DeepPartial<ChatNotificationPreference>,
|
|
79
79
|
): DeepPartial<ChatPreference> => {
|
|
80
80
|
return {
|
|
81
|
-
|
|
81
|
+
include:
|
|
82
|
+
p?.include === ChatNotificationInclude.ACCEPTED ? 'accepted' : 'all',
|
|
82
83
|
push: p?.push?.enabled,
|
|
83
84
|
}
|
|
84
85
|
}
|
|
@@ -87,7 +88,7 @@ const protobufFilterablePreferenceToLex = (
|
|
|
87
88
|
p?: DeepPartial<FilterableNotificationPreference>,
|
|
88
89
|
): DeepPartial<FilterablePreference> => {
|
|
89
90
|
return {
|
|
90
|
-
|
|
91
|
+
include: p?.include === NotificationInclude.FOLLOWS ? 'follows' : 'all',
|
|
91
92
|
list: p?.list?.enabled,
|
|
92
93
|
push: p?.push?.enabled,
|
|
93
94
|
}
|
package/src/api/blob-resolver.ts
CHANGED
|
@@ -116,7 +116,7 @@ export function createMiddleware(ctx: AppContext): Middleware {
|
|
|
116
116
|
|
|
117
117
|
// From this point on, triggering the next middleware (including any
|
|
118
118
|
// error handler) can be problematic because content-type,
|
|
119
|
-
// content-
|
|
119
|
+
// content-encoding, etc. headers have already been set. Because of
|
|
120
120
|
// this, we make sure that res.headersSent is set to true, preventing
|
|
121
121
|
// another error handler middleware from being called (from the catch
|
|
122
122
|
// block bellow). Not flushing the headers here would require to
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
} from '../../../lexicon/types/app/bsky/notification/defs'
|
|
9
9
|
import { Service } from '../../../proto/bsky_connect'
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
ChatNotificationInclude,
|
|
12
12
|
ChatNotificationPreference,
|
|
13
13
|
FilterableNotificationPreference,
|
|
14
|
-
|
|
14
|
+
NotificationInclude,
|
|
15
15
|
NotificationPreference,
|
|
16
16
|
NotificationPreferences,
|
|
17
17
|
} from '../../../proto/bsky_pb'
|
|
@@ -68,10 +68,10 @@ const lexChatPreferenceToProtobuf = (
|
|
|
68
68
|
p: ChatPreference,
|
|
69
69
|
): ChatNotificationPreference =>
|
|
70
70
|
new ChatNotificationPreference({
|
|
71
|
-
|
|
72
|
-
p.
|
|
73
|
-
?
|
|
74
|
-
:
|
|
71
|
+
include:
|
|
72
|
+
p.include === 'accepted'
|
|
73
|
+
? ChatNotificationInclude.ACCEPTED
|
|
74
|
+
: ChatNotificationInclude.ALL,
|
|
75
75
|
push: { enabled: p.push ?? true },
|
|
76
76
|
})
|
|
77
77
|
|
|
@@ -79,10 +79,10 @@ const lexFilterablePreferenceToProtobuf = (
|
|
|
79
79
|
p: FilterablePreference,
|
|
80
80
|
): FilterableNotificationPreference =>
|
|
81
81
|
new FilterableNotificationPreference({
|
|
82
|
-
|
|
83
|
-
p.
|
|
84
|
-
?
|
|
85
|
-
:
|
|
82
|
+
include:
|
|
83
|
+
p.include === 'follows'
|
|
84
|
+
? NotificationInclude.FOLLOWS
|
|
85
|
+
: NotificationInclude.ALL,
|
|
86
86
|
list: { enabled: p.list ?? true },
|
|
87
87
|
push: { enabled: p.push ?? true },
|
|
88
88
|
})
|
package/src/lexicon/lexicons.ts
CHANGED
|
@@ -9734,9 +9734,9 @@ export const schemaDict = {
|
|
|
9734
9734
|
},
|
|
9735
9735
|
chatPreference: {
|
|
9736
9736
|
type: 'object',
|
|
9737
|
-
required: ['
|
|
9737
|
+
required: ['include', 'push'],
|
|
9738
9738
|
properties: {
|
|
9739
|
-
|
|
9739
|
+
include: {
|
|
9740
9740
|
type: 'string',
|
|
9741
9741
|
knownValues: ['all', 'accepted'],
|
|
9742
9742
|
},
|
|
@@ -9747,9 +9747,9 @@ export const schemaDict = {
|
|
|
9747
9747
|
},
|
|
9748
9748
|
filterablePreference: {
|
|
9749
9749
|
type: 'object',
|
|
9750
|
-
required: ['
|
|
9750
|
+
required: ['include', 'list', 'push'],
|
|
9751
9751
|
properties: {
|
|
9752
|
-
|
|
9752
|
+
include: {
|
|
9753
9753
|
type: 'string',
|
|
9754
9754
|
knownValues: ['all', 'follows'],
|
|
9755
9755
|
},
|
|
@@ -30,7 +30,7 @@ export function validateRecordDeleted<V>(v: V) {
|
|
|
30
30
|
|
|
31
31
|
export interface ChatPreference {
|
|
32
32
|
$type?: 'app.bsky.notification.defs#chatPreference'
|
|
33
|
-
|
|
33
|
+
include: 'all' | 'accepted' | (string & {})
|
|
34
34
|
push: boolean
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -46,7 +46,7 @@ export function validateChatPreference<V>(v: V) {
|
|
|
46
46
|
|
|
47
47
|
export interface FilterablePreference {
|
|
48
48
|
$type?: 'app.bsky.notification.defs#filterablePreference'
|
|
49
|
-
|
|
49
|
+
include: 'all' | 'follows' | (string & {})
|
|
50
50
|
list: boolean
|
|
51
51
|
push: boolean
|
|
52
52
|
}
|
package/src/proto/bsky_pb.ts
CHANGED
|
@@ -14,56 +14,60 @@ import type {
|
|
|
14
14
|
import { Message, proto3, protoInt64, Timestamp } from '@bufbuild/protobuf'
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* @generated from enum bsky.
|
|
17
|
+
* @generated from enum bsky.NotificationInclude
|
|
18
18
|
*/
|
|
19
|
-
export enum
|
|
19
|
+
export enum NotificationInclude {
|
|
20
20
|
/**
|
|
21
|
-
* @generated from enum value:
|
|
21
|
+
* @generated from enum value: NOTIFICATION_INCLUDE_UNSPECIFIED = 0;
|
|
22
22
|
*/
|
|
23
23
|
UNSPECIFIED = 0,
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* @generated from enum value:
|
|
26
|
+
* @generated from enum value: NOTIFICATION_INCLUDE_ALL = 1;
|
|
27
27
|
*/
|
|
28
28
|
ALL = 1,
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* @generated from enum value:
|
|
31
|
+
* @generated from enum value: NOTIFICATION_INCLUDE_FOLLOWS = 2;
|
|
32
32
|
*/
|
|
33
33
|
FOLLOWS = 2,
|
|
34
34
|
}
|
|
35
|
-
// Retrieve enum metadata with: proto3.getEnumType(
|
|
36
|
-
proto3.util.setEnumType(
|
|
37
|
-
{ no: 0, name: '
|
|
38
|
-
{ no: 1, name: '
|
|
39
|
-
{ no: 2, name: '
|
|
35
|
+
// Retrieve enum metadata with: proto3.getEnumType(NotificationInclude)
|
|
36
|
+
proto3.util.setEnumType(NotificationInclude, 'bsky.NotificationInclude', [
|
|
37
|
+
{ no: 0, name: 'NOTIFICATION_INCLUDE_UNSPECIFIED' },
|
|
38
|
+
{ no: 1, name: 'NOTIFICATION_INCLUDE_ALL' },
|
|
39
|
+
{ no: 2, name: 'NOTIFICATION_INCLUDE_FOLLOWS' },
|
|
40
40
|
])
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* @generated from enum bsky.
|
|
43
|
+
* @generated from enum bsky.ChatNotificationInclude
|
|
44
44
|
*/
|
|
45
|
-
export enum
|
|
45
|
+
export enum ChatNotificationInclude {
|
|
46
46
|
/**
|
|
47
|
-
* @generated from enum value:
|
|
47
|
+
* @generated from enum value: CHAT_NOTIFICATION_INCLUDE_UNSPECIFIED = 0;
|
|
48
48
|
*/
|
|
49
49
|
UNSPECIFIED = 0,
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
* @generated from enum value:
|
|
52
|
+
* @generated from enum value: CHAT_NOTIFICATION_INCLUDE_ALL = 1;
|
|
53
53
|
*/
|
|
54
54
|
ALL = 1,
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* @generated from enum value:
|
|
57
|
+
* @generated from enum value: CHAT_NOTIFICATION_INCLUDE_ACCEPTED = 2;
|
|
58
58
|
*/
|
|
59
59
|
ACCEPTED = 2,
|
|
60
60
|
}
|
|
61
|
-
// Retrieve enum metadata with: proto3.getEnumType(
|
|
62
|
-
proto3.util.setEnumType(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
// Retrieve enum metadata with: proto3.getEnumType(ChatNotificationInclude)
|
|
62
|
+
proto3.util.setEnumType(
|
|
63
|
+
ChatNotificationInclude,
|
|
64
|
+
'bsky.ChatNotificationInclude',
|
|
65
|
+
[
|
|
66
|
+
{ no: 0, name: 'CHAT_NOTIFICATION_INCLUDE_UNSPECIFIED' },
|
|
67
|
+
{ no: 1, name: 'CHAT_NOTIFICATION_INCLUDE_ALL' },
|
|
68
|
+
{ no: 2, name: 'CHAT_NOTIFICATION_INCLUDE_ACCEPTED' },
|
|
69
|
+
],
|
|
70
|
+
)
|
|
67
71
|
|
|
68
72
|
/**
|
|
69
73
|
* @generated from enum bsky.FeedType
|
|
@@ -8411,9 +8415,9 @@ export class NotificationChannelPush extends Message<NotificationChannelPush> {
|
|
|
8411
8415
|
*/
|
|
8412
8416
|
export class FilterableNotificationPreference extends Message<FilterableNotificationPreference> {
|
|
8413
8417
|
/**
|
|
8414
|
-
* @generated from field: bsky.
|
|
8418
|
+
* @generated from field: bsky.NotificationInclude include = 1;
|
|
8415
8419
|
*/
|
|
8416
|
-
|
|
8420
|
+
include = NotificationInclude.UNSPECIFIED
|
|
8417
8421
|
|
|
8418
8422
|
/**
|
|
8419
8423
|
* @generated from field: bsky.NotificationChannelList list = 2;
|
|
@@ -8435,9 +8439,9 @@ export class FilterableNotificationPreference extends Message<FilterableNotifica
|
|
|
8435
8439
|
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
8436
8440
|
{
|
|
8437
8441
|
no: 1,
|
|
8438
|
-
name: '
|
|
8442
|
+
name: 'include',
|
|
8439
8443
|
kind: 'enum',
|
|
8440
|
-
T: proto3.getEnumType(
|
|
8444
|
+
T: proto3.getEnumType(NotificationInclude),
|
|
8441
8445
|
},
|
|
8442
8446
|
{ no: 2, name: 'list', kind: 'message', T: NotificationChannelList },
|
|
8443
8447
|
{ no: 3, name: 'push', kind: 'message', T: NotificationChannelPush },
|
|
@@ -8547,9 +8551,9 @@ export class NotificationPreference extends Message<NotificationPreference> {
|
|
|
8547
8551
|
*/
|
|
8548
8552
|
export class ChatNotificationPreference extends Message<ChatNotificationPreference> {
|
|
8549
8553
|
/**
|
|
8550
|
-
* @generated from field: bsky.
|
|
8554
|
+
* @generated from field: bsky.ChatNotificationInclude include = 1;
|
|
8551
8555
|
*/
|
|
8552
|
-
|
|
8556
|
+
include = ChatNotificationInclude.UNSPECIFIED
|
|
8553
8557
|
|
|
8554
8558
|
/**
|
|
8555
8559
|
* @generated from field: bsky.NotificationChannelPush push = 2;
|
|
@@ -8566,9 +8570,9 @@ export class ChatNotificationPreference extends Message<ChatNotificationPreferen
|
|
|
8566
8570
|
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
8567
8571
|
{
|
|
8568
8572
|
no: 1,
|
|
8569
|
-
name: '
|
|
8573
|
+
name: 'include',
|
|
8570
8574
|
kind: 'enum',
|
|
8571
|
-
T: proto3.getEnumType(
|
|
8575
|
+
T: proto3.getEnumType(ChatNotificationInclude),
|
|
8572
8576
|
},
|
|
8573
8577
|
{ no: 2, name: 'push', kind: 'message', T: NotificationChannelPush },
|
|
8574
8578
|
])
|
|
@@ -925,7 +925,7 @@ describe('notification views', () => {
|
|
|
925
925
|
|
|
926
926
|
// Defaults
|
|
927
927
|
const fp: FilterablePreference = {
|
|
928
|
-
|
|
928
|
+
include: 'all',
|
|
929
929
|
list: true,
|
|
930
930
|
push: true,
|
|
931
931
|
}
|
|
@@ -934,7 +934,7 @@ describe('notification views', () => {
|
|
|
934
934
|
push: true,
|
|
935
935
|
}
|
|
936
936
|
const cp: ChatPreference = {
|
|
937
|
-
|
|
937
|
+
include: 'all',
|
|
938
938
|
push: true,
|
|
939
939
|
}
|
|
940
940
|
|
|
@@ -1076,7 +1076,7 @@ describe('notification views', () => {
|
|
|
1076
1076
|
const input0 = {
|
|
1077
1077
|
chat: {
|
|
1078
1078
|
push: false,
|
|
1079
|
-
|
|
1079
|
+
include: 'accepted',
|
|
1080
1080
|
},
|
|
1081
1081
|
}
|
|
1082
1082
|
const expected0: Preferences = {
|
|
@@ -1100,7 +1100,7 @@ describe('notification views', () => {
|
|
|
1100
1100
|
mention: {
|
|
1101
1101
|
list: false,
|
|
1102
1102
|
push: false,
|
|
1103
|
-
|
|
1103
|
+
include: 'follows',
|
|
1104
1104
|
},
|
|
1105
1105
|
}
|
|
1106
1106
|
const expected1: Preferences = {
|