@atproto/api 0.15.15 → 0.15.17
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 +12 -0
- package/dist/client/index.d.ts +33 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +64 -9
- package/dist/client/index.js.map +1 -1
- package/dist/client/lexicons.d.ts +398 -90
- package/dist/client/lexicons.d.ts.map +1 -1
- package/dist/client/lexicons.js +203 -46
- package/dist/client/lexicons.js.map +1 -1
- package/dist/client/types/app/bsky/actor/defs.d.ts +9 -0
- package/dist/client/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/client/types/app/bsky/actor/defs.js +9 -0
- package/dist/client/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/client/types/app/bsky/notification/declaration.d.ts +13 -0
- package/dist/client/types/app/bsky/notification/declaration.d.ts.map +1 -0
- package/dist/client/types/app/bsky/notification/declaration.js +16 -0
- package/dist/client/types/app/bsky/notification/declaration.js.map +1 -0
- package/dist/client/types/app/bsky/notification/defs.d.ts +17 -2
- package/dist/client/types/app/bsky/notification/defs.d.ts.map +1 -1
- package/dist/client/types/app/bsky/notification/defs.js +18 -0
- package/dist/client/types/app/bsky/notification/defs.js.map +1 -1
- package/dist/client/types/app/bsky/notification/listActivitySubscriptions.d.ts +25 -0
- package/dist/client/types/app/bsky/notification/listActivitySubscriptions.d.ts.map +1 -0
- package/dist/client/types/app/bsky/notification/listActivitySubscriptions.js +11 -0
- package/dist/client/types/app/bsky/notification/listActivitySubscriptions.js.map +1 -0
- package/dist/client/types/app/bsky/notification/putActivitySubscription.d.ts +28 -0
- package/dist/client/types/app/bsky/notification/putActivitySubscription.d.ts.map +1 -0
- package/dist/client/types/app/bsky/notification/putActivitySubscription.js +11 -0
- package/dist/client/types/app/bsky/notification/putActivitySubscription.js.map +1 -0
- package/package.json +1 -1
- package/src/client/index.ts +111 -9
- package/src/client/lexicons.ts +211 -47
- package/src/client/types/app/bsky/actor/defs.ts +23 -0
- package/src/client/types/app/bsky/notification/declaration.ts +32 -0
- package/src/client/types/app/bsky/notification/defs.ts +39 -2
- package/src/client/types/app/bsky/notification/listActivitySubscriptions.ts +44 -0
- package/src/client/types/app/bsky/notification/putActivitySubscription.ts +46 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/src/client/lexicons.ts
CHANGED
|
@@ -4732,6 +4732,10 @@ export const schemaDict = {
|
|
|
4732
4732
|
type: 'ref',
|
|
4733
4733
|
ref: 'lex:app.bsky.actor.defs#profileAssociatedChat',
|
|
4734
4734
|
},
|
|
4735
|
+
activitySubscription: {
|
|
4736
|
+
type: 'ref',
|
|
4737
|
+
ref: 'lex:app.bsky.actor.defs#profileAssociatedActivitySubscription',
|
|
4738
|
+
},
|
|
4735
4739
|
},
|
|
4736
4740
|
},
|
|
4737
4741
|
profileAssociatedChat: {
|
|
@@ -4744,6 +4748,16 @@ export const schemaDict = {
|
|
|
4744
4748
|
},
|
|
4745
4749
|
},
|
|
4746
4750
|
},
|
|
4751
|
+
profileAssociatedActivitySubscription: {
|
|
4752
|
+
type: 'object',
|
|
4753
|
+
required: ['allowSubscriptions'],
|
|
4754
|
+
properties: {
|
|
4755
|
+
allowSubscriptions: {
|
|
4756
|
+
type: 'string',
|
|
4757
|
+
knownValues: ['followers', 'mutuals', 'none'],
|
|
4758
|
+
},
|
|
4759
|
+
},
|
|
4760
|
+
},
|
|
4747
4761
|
viewerState: {
|
|
4748
4762
|
type: 'object',
|
|
4749
4763
|
description:
|
|
@@ -4779,6 +4793,10 @@ export const schemaDict = {
|
|
|
4779
4793
|
type: 'ref',
|
|
4780
4794
|
ref: 'lex:app.bsky.actor.defs#knownFollowers',
|
|
4781
4795
|
},
|
|
4796
|
+
activitySubscription: {
|
|
4797
|
+
type: 'ref',
|
|
4798
|
+
ref: 'lex:app.bsky.notification.defs#activitySubscription',
|
|
4799
|
+
},
|
|
4782
4800
|
},
|
|
4783
4801
|
},
|
|
4784
4802
|
knownFollowers: {
|
|
@@ -7239,48 +7257,6 @@ export const schemaDict = {
|
|
|
7239
7257
|
},
|
|
7240
7258
|
},
|
|
7241
7259
|
},
|
|
7242
|
-
AppBskyFeedGetPosts: {
|
|
7243
|
-
lexicon: 1,
|
|
7244
|
-
id: 'app.bsky.feed.getPosts',
|
|
7245
|
-
defs: {
|
|
7246
|
-
main: {
|
|
7247
|
-
type: 'query',
|
|
7248
|
-
description:
|
|
7249
|
-
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
|
7250
|
-
parameters: {
|
|
7251
|
-
type: 'params',
|
|
7252
|
-
required: ['uris'],
|
|
7253
|
-
properties: {
|
|
7254
|
-
uris: {
|
|
7255
|
-
type: 'array',
|
|
7256
|
-
description: 'List of post AT-URIs to return hydrated views for.',
|
|
7257
|
-
items: {
|
|
7258
|
-
type: 'string',
|
|
7259
|
-
format: 'at-uri',
|
|
7260
|
-
},
|
|
7261
|
-
maxLength: 25,
|
|
7262
|
-
},
|
|
7263
|
-
},
|
|
7264
|
-
},
|
|
7265
|
-
output: {
|
|
7266
|
-
encoding: 'application/json',
|
|
7267
|
-
schema: {
|
|
7268
|
-
type: 'object',
|
|
7269
|
-
required: ['posts'],
|
|
7270
|
-
properties: {
|
|
7271
|
-
posts: {
|
|
7272
|
-
type: 'array',
|
|
7273
|
-
items: {
|
|
7274
|
-
type: 'ref',
|
|
7275
|
-
ref: 'lex:app.bsky.feed.defs#postView',
|
|
7276
|
-
},
|
|
7277
|
-
},
|
|
7278
|
-
},
|
|
7279
|
-
},
|
|
7280
|
-
},
|
|
7281
|
-
},
|
|
7282
|
-
},
|
|
7283
|
-
},
|
|
7284
7260
|
AppBskyFeedGetPostThread: {
|
|
7285
7261
|
lexicon: 1,
|
|
7286
7262
|
id: 'app.bsky.feed.getPostThread',
|
|
@@ -7345,6 +7321,48 @@ export const schemaDict = {
|
|
|
7345
7321
|
},
|
|
7346
7322
|
},
|
|
7347
7323
|
},
|
|
7324
|
+
AppBskyFeedGetPosts: {
|
|
7325
|
+
lexicon: 1,
|
|
7326
|
+
id: 'app.bsky.feed.getPosts',
|
|
7327
|
+
defs: {
|
|
7328
|
+
main: {
|
|
7329
|
+
type: 'query',
|
|
7330
|
+
description:
|
|
7331
|
+
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
|
7332
|
+
parameters: {
|
|
7333
|
+
type: 'params',
|
|
7334
|
+
required: ['uris'],
|
|
7335
|
+
properties: {
|
|
7336
|
+
uris: {
|
|
7337
|
+
type: 'array',
|
|
7338
|
+
description: 'List of post AT-URIs to return hydrated views for.',
|
|
7339
|
+
items: {
|
|
7340
|
+
type: 'string',
|
|
7341
|
+
format: 'at-uri',
|
|
7342
|
+
},
|
|
7343
|
+
maxLength: 25,
|
|
7344
|
+
},
|
|
7345
|
+
},
|
|
7346
|
+
},
|
|
7347
|
+
output: {
|
|
7348
|
+
encoding: 'application/json',
|
|
7349
|
+
schema: {
|
|
7350
|
+
type: 'object',
|
|
7351
|
+
required: ['posts'],
|
|
7352
|
+
properties: {
|
|
7353
|
+
posts: {
|
|
7354
|
+
type: 'array',
|
|
7355
|
+
items: {
|
|
7356
|
+
type: 'ref',
|
|
7357
|
+
ref: 'lex:app.bsky.feed.defs#postView',
|
|
7358
|
+
},
|
|
7359
|
+
},
|
|
7360
|
+
},
|
|
7361
|
+
},
|
|
7362
|
+
},
|
|
7363
|
+
},
|
|
7364
|
+
},
|
|
7365
|
+
},
|
|
7348
7366
|
AppBskyFeedGetQuotes: {
|
|
7349
7367
|
lexicon: 1,
|
|
7350
7368
|
id: 'app.bsky.feed.getQuotes',
|
|
@@ -9724,6 +9742,30 @@ export const schemaDict = {
|
|
|
9724
9742
|
},
|
|
9725
9743
|
},
|
|
9726
9744
|
},
|
|
9745
|
+
AppBskyNotificationDeclaration: {
|
|
9746
|
+
lexicon: 1,
|
|
9747
|
+
id: 'app.bsky.notification.declaration',
|
|
9748
|
+
defs: {
|
|
9749
|
+
main: {
|
|
9750
|
+
type: 'record',
|
|
9751
|
+
description:
|
|
9752
|
+
"A declaration of the user's choices related to notifications that can be produced by them.",
|
|
9753
|
+
key: 'literal:self',
|
|
9754
|
+
record: {
|
|
9755
|
+
type: 'object',
|
|
9756
|
+
required: ['allowSubscriptions'],
|
|
9757
|
+
properties: {
|
|
9758
|
+
allowSubscriptions: {
|
|
9759
|
+
type: 'string',
|
|
9760
|
+
description:
|
|
9761
|
+
"A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'.",
|
|
9762
|
+
knownValues: ['followers', 'mutuals', 'none'],
|
|
9763
|
+
},
|
|
9764
|
+
},
|
|
9765
|
+
},
|
|
9766
|
+
},
|
|
9767
|
+
},
|
|
9768
|
+
},
|
|
9727
9769
|
AppBskyNotificationDefs: {
|
|
9728
9770
|
lexicon: 1,
|
|
9729
9771
|
id: 'app.bsky.notification.defs',
|
|
@@ -9734,9 +9776,9 @@ export const schemaDict = {
|
|
|
9734
9776
|
},
|
|
9735
9777
|
chatPreference: {
|
|
9736
9778
|
type: 'object',
|
|
9737
|
-
required: ['
|
|
9779
|
+
required: ['include', 'push'],
|
|
9738
9780
|
properties: {
|
|
9739
|
-
|
|
9781
|
+
include: {
|
|
9740
9782
|
type: 'string',
|
|
9741
9783
|
knownValues: ['all', 'accepted'],
|
|
9742
9784
|
},
|
|
@@ -9747,9 +9789,9 @@ export const schemaDict = {
|
|
|
9747
9789
|
},
|
|
9748
9790
|
filterablePreference: {
|
|
9749
9791
|
type: 'object',
|
|
9750
|
-
required: ['
|
|
9792
|
+
required: ['include', 'list', 'push'],
|
|
9751
9793
|
properties: {
|
|
9752
|
-
|
|
9794
|
+
include: {
|
|
9753
9795
|
type: 'string',
|
|
9754
9796
|
knownValues: ['all', 'follows'],
|
|
9755
9797
|
},
|
|
@@ -9845,6 +9887,34 @@ export const schemaDict = {
|
|
|
9845
9887
|
},
|
|
9846
9888
|
},
|
|
9847
9889
|
},
|
|
9890
|
+
activitySubscription: {
|
|
9891
|
+
type: 'object',
|
|
9892
|
+
required: ['post', 'reply'],
|
|
9893
|
+
properties: {
|
|
9894
|
+
post: {
|
|
9895
|
+
type: 'boolean',
|
|
9896
|
+
},
|
|
9897
|
+
reply: {
|
|
9898
|
+
type: 'boolean',
|
|
9899
|
+
},
|
|
9900
|
+
},
|
|
9901
|
+
},
|
|
9902
|
+
subjectActivitySubscription: {
|
|
9903
|
+
description:
|
|
9904
|
+
'Object used to store activity subscription data in stash.',
|
|
9905
|
+
type: 'object',
|
|
9906
|
+
required: ['subject', 'activitySubscription'],
|
|
9907
|
+
properties: {
|
|
9908
|
+
subject: {
|
|
9909
|
+
type: 'string',
|
|
9910
|
+
format: 'did',
|
|
9911
|
+
},
|
|
9912
|
+
activitySubscription: {
|
|
9913
|
+
type: 'ref',
|
|
9914
|
+
ref: 'lex:app.bsky.notification.defs#activitySubscription',
|
|
9915
|
+
},
|
|
9916
|
+
},
|
|
9917
|
+
},
|
|
9848
9918
|
},
|
|
9849
9919
|
},
|
|
9850
9920
|
AppBskyNotificationGetPreferences: {
|
|
@@ -9910,6 +9980,50 @@ export const schemaDict = {
|
|
|
9910
9980
|
},
|
|
9911
9981
|
},
|
|
9912
9982
|
},
|
|
9983
|
+
AppBskyNotificationListActivitySubscriptions: {
|
|
9984
|
+
lexicon: 1,
|
|
9985
|
+
id: 'app.bsky.notification.listActivitySubscriptions',
|
|
9986
|
+
defs: {
|
|
9987
|
+
main: {
|
|
9988
|
+
type: 'query',
|
|
9989
|
+
description:
|
|
9990
|
+
'Enumerate all accounts to which the requesting account is subscribed to receive notifications for. Requires auth.',
|
|
9991
|
+
parameters: {
|
|
9992
|
+
type: 'params',
|
|
9993
|
+
properties: {
|
|
9994
|
+
limit: {
|
|
9995
|
+
type: 'integer',
|
|
9996
|
+
minimum: 1,
|
|
9997
|
+
maximum: 100,
|
|
9998
|
+
default: 50,
|
|
9999
|
+
},
|
|
10000
|
+
cursor: {
|
|
10001
|
+
type: 'string',
|
|
10002
|
+
},
|
|
10003
|
+
},
|
|
10004
|
+
},
|
|
10005
|
+
output: {
|
|
10006
|
+
encoding: 'application/json',
|
|
10007
|
+
schema: {
|
|
10008
|
+
type: 'object',
|
|
10009
|
+
required: ['subscriptions'],
|
|
10010
|
+
properties: {
|
|
10011
|
+
cursor: {
|
|
10012
|
+
type: 'string',
|
|
10013
|
+
},
|
|
10014
|
+
subscriptions: {
|
|
10015
|
+
type: 'array',
|
|
10016
|
+
items: {
|
|
10017
|
+
type: 'ref',
|
|
10018
|
+
ref: 'lex:app.bsky.actor.defs#profileView',
|
|
10019
|
+
},
|
|
10020
|
+
},
|
|
10021
|
+
},
|
|
10022
|
+
},
|
|
10023
|
+
},
|
|
10024
|
+
},
|
|
10025
|
+
},
|
|
10026
|
+
},
|
|
9913
10027
|
AppBskyNotificationListNotifications: {
|
|
9914
10028
|
lexicon: 1,
|
|
9915
10029
|
id: 'app.bsky.notification.listNotifications',
|
|
@@ -10042,6 +10156,51 @@ export const schemaDict = {
|
|
|
10042
10156
|
},
|
|
10043
10157
|
},
|
|
10044
10158
|
},
|
|
10159
|
+
AppBskyNotificationPutActivitySubscription: {
|
|
10160
|
+
lexicon: 1,
|
|
10161
|
+
id: 'app.bsky.notification.putActivitySubscription',
|
|
10162
|
+
defs: {
|
|
10163
|
+
main: {
|
|
10164
|
+
type: 'procedure',
|
|
10165
|
+
description:
|
|
10166
|
+
'Puts an activity subscription entry. The key should be omitted for creation and provided for updates. Requires auth.',
|
|
10167
|
+
input: {
|
|
10168
|
+
encoding: 'application/json',
|
|
10169
|
+
schema: {
|
|
10170
|
+
type: 'object',
|
|
10171
|
+
required: ['subject', 'activitySubscription'],
|
|
10172
|
+
properties: {
|
|
10173
|
+
subject: {
|
|
10174
|
+
type: 'string',
|
|
10175
|
+
format: 'did',
|
|
10176
|
+
},
|
|
10177
|
+
activitySubscription: {
|
|
10178
|
+
type: 'ref',
|
|
10179
|
+
ref: 'lex:app.bsky.notification.defs#activitySubscription',
|
|
10180
|
+
},
|
|
10181
|
+
},
|
|
10182
|
+
},
|
|
10183
|
+
},
|
|
10184
|
+
output: {
|
|
10185
|
+
encoding: 'application/json',
|
|
10186
|
+
schema: {
|
|
10187
|
+
type: 'object',
|
|
10188
|
+
required: ['subject'],
|
|
10189
|
+
properties: {
|
|
10190
|
+
subject: {
|
|
10191
|
+
type: 'string',
|
|
10192
|
+
format: 'did',
|
|
10193
|
+
},
|
|
10194
|
+
activitySubscription: {
|
|
10195
|
+
type: 'ref',
|
|
10196
|
+
ref: 'lex:app.bsky.notification.defs#activitySubscription',
|
|
10197
|
+
},
|
|
10198
|
+
},
|
|
10199
|
+
},
|
|
10200
|
+
},
|
|
10201
|
+
},
|
|
10202
|
+
},
|
|
10203
|
+
},
|
|
10045
10204
|
AppBskyNotificationPutPreferences: {
|
|
10046
10205
|
lexicon: 1,
|
|
10047
10206
|
id: 'app.bsky.notification.putPreferences',
|
|
@@ -16735,8 +16894,8 @@ export const ids = {
|
|
|
16735
16894
|
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
|
16736
16895
|
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
|
16737
16896
|
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
|
16738
|
-
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
|
16739
16897
|
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
|
16898
|
+
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
|
16740
16899
|
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
|
16741
16900
|
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
|
16742
16901
|
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
|
@@ -16781,11 +16940,16 @@ export const ids = {
|
|
|
16781
16940
|
AppBskyLabelerDefs: 'app.bsky.labeler.defs',
|
|
16782
16941
|
AppBskyLabelerGetServices: 'app.bsky.labeler.getServices',
|
|
16783
16942
|
AppBskyLabelerService: 'app.bsky.labeler.service',
|
|
16943
|
+
AppBskyNotificationDeclaration: 'app.bsky.notification.declaration',
|
|
16784
16944
|
AppBskyNotificationDefs: 'app.bsky.notification.defs',
|
|
16785
16945
|
AppBskyNotificationGetPreferences: 'app.bsky.notification.getPreferences',
|
|
16786
16946
|
AppBskyNotificationGetUnreadCount: 'app.bsky.notification.getUnreadCount',
|
|
16947
|
+
AppBskyNotificationListActivitySubscriptions:
|
|
16948
|
+
'app.bsky.notification.listActivitySubscriptions',
|
|
16787
16949
|
AppBskyNotificationListNotifications:
|
|
16788
16950
|
'app.bsky.notification.listNotifications',
|
|
16951
|
+
AppBskyNotificationPutActivitySubscription:
|
|
16952
|
+
'app.bsky.notification.putActivitySubscription',
|
|
16789
16953
|
AppBskyNotificationPutPreferences: 'app.bsky.notification.putPreferences',
|
|
16790
16954
|
AppBskyNotificationPutPreferencesV2: 'app.bsky.notification.putPreferencesV2',
|
|
16791
16955
|
AppBskyNotificationRegisterPush: 'app.bsky.notification.registerPush',
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
|
|
13
13
|
import type * as AppBskyGraphDefs from '../graph/defs.js'
|
|
14
14
|
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'
|
|
15
|
+
import type * as AppBskyNotificationDefs from '../notification/defs.js'
|
|
15
16
|
import type * as AppBskyFeedThreadgate from '../feed/threadgate.js'
|
|
16
17
|
import type * as AppBskyFeedPostgate from '../feed/postgate.js'
|
|
17
18
|
import type * as AppBskyEmbedExternal from '../embed/external.js'
|
|
@@ -109,6 +110,7 @@ export interface ProfileAssociated {
|
|
|
109
110
|
starterPacks?: number
|
|
110
111
|
labeler?: boolean
|
|
111
112
|
chat?: ProfileAssociatedChat
|
|
113
|
+
activitySubscription?: ProfileAssociatedActivitySubscription
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
const hashProfileAssociated = 'profileAssociated'
|
|
@@ -136,6 +138,26 @@ export function validateProfileAssociatedChat<V>(v: V) {
|
|
|
136
138
|
return validate<ProfileAssociatedChat & V>(v, id, hashProfileAssociatedChat)
|
|
137
139
|
}
|
|
138
140
|
|
|
141
|
+
export interface ProfileAssociatedActivitySubscription {
|
|
142
|
+
$type?: 'app.bsky.actor.defs#profileAssociatedActivitySubscription'
|
|
143
|
+
allowSubscriptions: 'followers' | 'mutuals' | 'none' | (string & {})
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const hashProfileAssociatedActivitySubscription =
|
|
147
|
+
'profileAssociatedActivitySubscription'
|
|
148
|
+
|
|
149
|
+
export function isProfileAssociatedActivitySubscription<V>(v: V) {
|
|
150
|
+
return is$typed(v, id, hashProfileAssociatedActivitySubscription)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function validateProfileAssociatedActivitySubscription<V>(v: V) {
|
|
154
|
+
return validate<ProfileAssociatedActivitySubscription & V>(
|
|
155
|
+
v,
|
|
156
|
+
id,
|
|
157
|
+
hashProfileAssociatedActivitySubscription,
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
139
161
|
/** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */
|
|
140
162
|
export interface ViewerState {
|
|
141
163
|
$type?: 'app.bsky.actor.defs#viewerState'
|
|
@@ -147,6 +169,7 @@ export interface ViewerState {
|
|
|
147
169
|
following?: string
|
|
148
170
|
followedBy?: string
|
|
149
171
|
knownFollowers?: KnownFollowers
|
|
172
|
+
activitySubscription?: AppBskyNotificationDefs.ActivitySubscription
|
|
150
173
|
}
|
|
151
174
|
|
|
152
175
|
const hashViewerState = 'viewerState'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
|
|
13
|
+
const is$typed = _is$typed,
|
|
14
|
+
validate = _validate
|
|
15
|
+
const id = 'app.bsky.notification.declaration'
|
|
16
|
+
|
|
17
|
+
export interface Record {
|
|
18
|
+
$type: 'app.bsky.notification.declaration'
|
|
19
|
+
/** A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'. */
|
|
20
|
+
allowSubscriptions: 'followers' | 'mutuals' | 'none' | (string & {})
|
|
21
|
+
[k: string]: unknown
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const hashRecord = 'main'
|
|
25
|
+
|
|
26
|
+
export function isRecord<V>(v: V) {
|
|
27
|
+
return is$typed(v, id, hashRecord)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function validateRecord<V>(v: V) {
|
|
31
|
+
return validate<Record & V>(v, id, hashRecord, true)
|
|
32
|
+
}
|
|
@@ -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
|
}
|
|
@@ -103,3 +103,40 @@ export function isPreferences<V>(v: V) {
|
|
|
103
103
|
export function validatePreferences<V>(v: V) {
|
|
104
104
|
return validate<Preferences & V>(v, id, hashPreferences)
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
export interface ActivitySubscription {
|
|
108
|
+
$type?: 'app.bsky.notification.defs#activitySubscription'
|
|
109
|
+
post: boolean
|
|
110
|
+
reply: boolean
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const hashActivitySubscription = 'activitySubscription'
|
|
114
|
+
|
|
115
|
+
export function isActivitySubscription<V>(v: V) {
|
|
116
|
+
return is$typed(v, id, hashActivitySubscription)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function validateActivitySubscription<V>(v: V) {
|
|
120
|
+
return validate<ActivitySubscription & V>(v, id, hashActivitySubscription)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Object used to store activity subscription data in stash. */
|
|
124
|
+
export interface SubjectActivitySubscription {
|
|
125
|
+
$type?: 'app.bsky.notification.defs#subjectActivitySubscription'
|
|
126
|
+
subject: string
|
|
127
|
+
activitySubscription: ActivitySubscription
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const hashSubjectActivitySubscription = 'subjectActivitySubscription'
|
|
131
|
+
|
|
132
|
+
export function isSubjectActivitySubscription<V>(v: V) {
|
|
133
|
+
return is$typed(v, id, hashSubjectActivitySubscription)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function validateSubjectActivitySubscription<V>(v: V) {
|
|
137
|
+
return validate<SubjectActivitySubscription & V>(
|
|
138
|
+
v,
|
|
139
|
+
id,
|
|
140
|
+
hashSubjectActivitySubscription,
|
|
141
|
+
)
|
|
142
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { HeadersMap, XRPCError } from '@atproto/xrpc'
|
|
5
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { CID } from 'multiformats/cid'
|
|
7
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
8
|
+
import {
|
|
9
|
+
type $Typed,
|
|
10
|
+
is$typed as _is$typed,
|
|
11
|
+
type OmitKey,
|
|
12
|
+
} from '../../../../util'
|
|
13
|
+
import type * as AppBskyActorDefs from '../actor/defs.js'
|
|
14
|
+
|
|
15
|
+
const is$typed = _is$typed,
|
|
16
|
+
validate = _validate
|
|
17
|
+
const id = 'app.bsky.notification.listActivitySubscriptions'
|
|
18
|
+
|
|
19
|
+
export interface QueryParams {
|
|
20
|
+
limit?: number
|
|
21
|
+
cursor?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type InputSchema = undefined
|
|
25
|
+
|
|
26
|
+
export interface OutputSchema {
|
|
27
|
+
cursor?: string
|
|
28
|
+
subscriptions: AppBskyActorDefs.ProfileView[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CallOptions {
|
|
32
|
+
signal?: AbortSignal
|
|
33
|
+
headers?: HeadersMap
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface Response {
|
|
37
|
+
success: boolean
|
|
38
|
+
headers: HeadersMap
|
|
39
|
+
data: OutputSchema
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function toKnownErr(e: any) {
|
|
43
|
+
return e
|
|
44
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { HeadersMap, XRPCError } from '@atproto/xrpc'
|
|
5
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { CID } from 'multiformats/cid'
|
|
7
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
8
|
+
import {
|
|
9
|
+
type $Typed,
|
|
10
|
+
is$typed as _is$typed,
|
|
11
|
+
type OmitKey,
|
|
12
|
+
} from '../../../../util'
|
|
13
|
+
import type * as AppBskyNotificationDefs from './defs.js'
|
|
14
|
+
|
|
15
|
+
const is$typed = _is$typed,
|
|
16
|
+
validate = _validate
|
|
17
|
+
const id = 'app.bsky.notification.putActivitySubscription'
|
|
18
|
+
|
|
19
|
+
export interface QueryParams {}
|
|
20
|
+
|
|
21
|
+
export interface InputSchema {
|
|
22
|
+
subject: string
|
|
23
|
+
activitySubscription: AppBskyNotificationDefs.ActivitySubscription
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface OutputSchema {
|
|
27
|
+
subject: string
|
|
28
|
+
activitySubscription?: AppBskyNotificationDefs.ActivitySubscription
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CallOptions {
|
|
32
|
+
signal?: AbortSignal
|
|
33
|
+
headers?: HeadersMap
|
|
34
|
+
qp?: QueryParams
|
|
35
|
+
encoding?: 'application/json'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Response {
|
|
39
|
+
success: boolean
|
|
40
|
+
headers: HeadersMap
|
|
41
|
+
data: OutputSchema
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function toKnownErr(e: any) {
|
|
45
|
+
return e
|
|
46
|
+
}
|