@atproto/pds 0.4.59 → 0.4.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/account-manager/helpers/account.d.ts +1 -0
  3. package/dist/account-manager/helpers/account.d.ts.map +1 -1
  4. package/dist/account-manager/helpers/account.js +15 -1
  5. package/dist/account-manager/helpers/account.js.map +1 -1
  6. package/dist/account-manager/helpers/invite.d.ts +1 -1
  7. package/dist/account-manager/helpers/invite.d.ts.map +1 -1
  8. package/dist/account-manager/helpers/invite.js +20 -9
  9. package/dist/account-manager/helpers/invite.js.map +1 -1
  10. package/dist/account-manager/index.d.ts +2 -0
  11. package/dist/account-manager/index.d.ts.map +1 -1
  12. package/dist/account-manager/index.js +8 -1
  13. package/dist/account-manager/index.js.map +1 -1
  14. package/dist/api/app/bsky/actor/getProfile.d.ts.map +1 -1
  15. package/dist/api/app/bsky/actor/getProfile.js +2 -9
  16. package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
  17. package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
  18. package/dist/api/app/bsky/actor/getProfiles.js +2 -6
  19. package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
  20. package/dist/api/app/bsky/feed/getActorLikes.d.ts.map +1 -1
  21. package/dist/api/app/bsky/feed/getActorLikes.js +2 -9
  22. package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
  23. package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
  24. package/dist/api/app/bsky/feed/getAuthorFeed.js +2 -9
  25. package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
  26. package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
  27. package/dist/api/app/bsky/feed/getFeed.js +2 -1
  28. package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
  29. package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
  30. package/dist/api/app/bsky/feed/getPostThread.js +12 -14
  31. package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
  32. package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
  33. package/dist/api/app/bsky/feed/getTimeline.js +2 -6
  34. package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
  35. package/dist/api/com/atproto/admin/getAccountInfo.d.ts.map +1 -1
  36. package/dist/api/com/atproto/admin/getAccountInfo.js +6 -14
  37. package/dist/api/com/atproto/admin/getAccountInfo.js.map +1 -1
  38. package/dist/api/com/atproto/admin/getAccountInfos.d.ts +4 -0
  39. package/dist/api/com/atproto/admin/getAccountInfos.d.ts.map +1 -0
  40. package/dist/api/com/atproto/admin/getAccountInfos.js +32 -0
  41. package/dist/api/com/atproto/admin/getAccountInfos.js.map +1 -0
  42. package/dist/api/com/atproto/admin/index.d.ts.map +1 -1
  43. package/dist/api/com/atproto/admin/index.js +2 -0
  44. package/dist/api/com/atproto/admin/index.js.map +1 -1
  45. package/dist/api/com/atproto/admin/util.d.ts +17 -0
  46. package/dist/api/com/atproto/admin/util.d.ts.map +1 -1
  47. package/dist/api/com/atproto/admin/util.js +27 -1
  48. package/dist/api/com/atproto/admin/util.js.map +1 -1
  49. package/dist/api/com/atproto/repo/getRecord.d.ts.map +1 -1
  50. package/dist/api/com/atproto/repo/getRecord.js +2 -2
  51. package/dist/api/com/atproto/repo/getRecord.js.map +1 -1
  52. package/dist/api/com/atproto/server/requestPasswordReset.js +1 -1
  53. package/dist/api/com/atproto/server/requestPasswordReset.js.map +1 -1
  54. package/dist/config/config.d.ts +17 -0
  55. package/dist/config/config.d.ts.map +1 -1
  56. package/dist/config/config.js +11 -1
  57. package/dist/config/config.js.map +1 -1
  58. package/dist/config/env.d.ts +7 -1
  59. package/dist/config/env.d.ts.map +1 -1
  60. package/dist/config/env.js +9 -1
  61. package/dist/config/env.js.map +1 -1
  62. package/dist/context.d.ts +6 -2
  63. package/dist/context.d.ts.map +1 -1
  64. package/dist/context.js +55 -11
  65. package/dist/context.js.map +1 -1
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +1 -0
  68. package/dist/index.js.map +1 -1
  69. package/dist/lexicon/index.d.ts +4 -0
  70. package/dist/lexicon/index.d.ts.map +1 -1
  71. package/dist/lexicon/index.js +8 -0
  72. package/dist/lexicon/index.js.map +1 -1
  73. package/dist/lexicon/lexicons.d.ts +118 -0
  74. package/dist/lexicon/lexicons.d.ts.map +1 -1
  75. package/dist/lexicon/lexicons.js +135 -3
  76. package/dist/lexicon/lexicons.js.map +1 -1
  77. package/dist/lexicon/types/app/bsky/actor/defs.d.ts +2 -0
  78. package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
  79. package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
  80. package/dist/lexicon/types/app/bsky/actor/profile.d.ts +1 -0
  81. package/dist/lexicon/types/app/bsky/actor/profile.d.ts.map +1 -1
  82. package/dist/lexicon/types/app/bsky/actor/profile.js.map +1 -1
  83. package/dist/lexicon/types/app/bsky/feed/defs.d.ts +13 -2
  84. package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
  85. package/dist/lexicon/types/app/bsky/feed/defs.js +21 -1
  86. package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
  87. package/dist/lexicon/types/app/bsky/feed/getAuthorFeed.d.ts +1 -0
  88. package/dist/lexicon/types/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
  89. package/dist/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts +2 -0
  90. package/dist/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts.map +1 -1
  91. package/dist/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.d.ts +2 -0
  92. package/dist/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.d.ts.map +1 -1
  93. package/dist/lexicon/types/com/atproto/repo/getRecord.d.ts +1 -0
  94. package/dist/lexicon/types/com/atproto/repo/getRecord.d.ts.map +1 -1
  95. package/dist/lexicon/types/tools/ozone/moderation/getRecords.d.ts +39 -0
  96. package/dist/lexicon/types/tools/ozone/moderation/getRecords.d.ts.map +1 -0
  97. package/dist/lexicon/types/tools/ozone/moderation/getRecords.js +3 -0
  98. package/dist/lexicon/types/tools/ozone/moderation/getRecords.js.map +1 -0
  99. package/dist/lexicon/types/tools/ozone/moderation/getRepos.d.ts +39 -0
  100. package/dist/lexicon/types/tools/ozone/moderation/getRepos.d.ts.map +1 -0
  101. package/dist/lexicon/types/tools/ozone/moderation/getRepos.js +3 -0
  102. package/dist/lexicon/types/tools/ozone/moderation/getRepos.js.map +1 -0
  103. package/dist/mailer/index.d.ts +1 -1
  104. package/dist/mailer/index.d.ts.map +1 -1
  105. package/dist/mailer/index.js.map +1 -1
  106. package/dist/mailer/templates/confirm-email.js +1 -1
  107. package/dist/mailer/templates/confirm-email.js.map +2 -2
  108. package/dist/mailer/templates/delete-account.js +1 -1
  109. package/dist/mailer/templates/delete-account.js.map +2 -2
  110. package/dist/mailer/templates/plc-operation.js +1 -1
  111. package/dist/mailer/templates/plc-operation.js.map +2 -2
  112. package/dist/mailer/templates/reset-password.js +1 -1
  113. package/dist/mailer/templates/reset-password.js.map +2 -2
  114. package/dist/mailer/templates/update-email.js +1 -1
  115. package/dist/mailer/templates/update-email.js.map +2 -2
  116. package/dist/pipethrough.d.ts +26 -26
  117. package/dist/pipethrough.d.ts.map +1 -1
  118. package/dist/pipethrough.js +360 -228
  119. package/dist/pipethrough.js.map +1 -1
  120. package/dist/read-after-write/util.d.ts +13 -5
  121. package/dist/read-after-write/util.d.ts.map +1 -1
  122. package/dist/read-after-write/util.js +37 -22
  123. package/dist/read-after-write/util.js.map +1 -1
  124. package/package.json +15 -14
  125. package/src/account-manager/helpers/account.ts +22 -0
  126. package/src/account-manager/helpers/invite.ts +19 -9
  127. package/src/account-manager/index.ts +13 -1
  128. package/src/api/app/bsky/actor/getProfile.ts +3 -17
  129. package/src/api/app/bsky/actor/getProfiles.ts +3 -15
  130. package/src/api/app/bsky/feed/getActorLikes.ts +3 -19
  131. package/src/api/app/bsky/feed/getAuthorFeed.ts +3 -17
  132. package/src/api/app/bsky/feed/getFeed.ts +3 -1
  133. package/src/api/app/bsky/feed/getPostThread.ts +16 -23
  134. package/src/api/app/bsky/feed/getTimeline.ts +3 -14
  135. package/src/api/com/atproto/admin/getAccountInfo.ts +6 -13
  136. package/src/api/com/atproto/admin/getAccountInfos.ts +33 -0
  137. package/src/api/com/atproto/admin/index.ts +2 -0
  138. package/src/api/com/atproto/admin/util.ts +38 -0
  139. package/src/api/com/atproto/repo/getRecord.ts +5 -2
  140. package/src/api/com/atproto/server/requestPasswordReset.ts +1 -1
  141. package/src/config/config.ts +31 -1
  142. package/src/config/env.ts +22 -2
  143. package/src/context.ts +62 -17
  144. package/src/index.ts +1 -0
  145. package/src/lexicon/index.ts +24 -0
  146. package/src/lexicon/lexicons.ts +137 -3
  147. package/src/lexicon/types/app/bsky/actor/defs.ts +2 -0
  148. package/src/lexicon/types/app/bsky/actor/profile.ts +1 -0
  149. package/src/lexicon/types/app/bsky/feed/defs.ts +38 -2
  150. package/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts +1 -0
  151. package/src/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.ts +2 -0
  152. package/src/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.ts +2 -0
  153. package/src/lexicon/types/com/atproto/repo/getRecord.ts +1 -0
  154. package/src/lexicon/types/tools/ozone/moderation/getRecords.ts +50 -0
  155. package/src/lexicon/types/tools/ozone/moderation/getRepos.ts +50 -0
  156. package/src/mailer/index.ts +1 -1
  157. package/src/mailer/templates/confirm-email.hbs +106 -336
  158. package/src/mailer/templates/delete-account.hbs +110 -346
  159. package/src/mailer/templates/plc-operation.hbs +107 -338
  160. package/src/mailer/templates/reset-password.d.ts +1 -1
  161. package/src/mailer/templates/reset-password.hbs +108 -344
  162. package/src/mailer/templates/update-email.hbs +107 -337
  163. package/src/pipethrough.ts +528 -233
  164. package/src/read-after-write/util.ts +58 -32
  165. package/tests/account-deletion.test.ts +1 -1
  166. package/tests/account.test.ts +2 -2
  167. package/tests/email-confirmation.test.ts +2 -2
  168. package/tests/plc-operations.test.ts +1 -1
  169. package/tests/proxied/proxy-catchall.test.ts +255 -0
  170. package/tests/proxied/proxy-header.test.ts +31 -1
  171. package/tests/proxied/read-after-write.test.ts +77 -0
@@ -20,6 +20,7 @@ export interface Record {
20
20
  | ComAtprotoLabelDefs.SelfLabels
21
21
  | { $type: string; [k: string]: unknown }
22
22
  joinedViaStarterPack?: ComAtprotoRepoStrongRef.Main
23
+ pinnedPost?: ComAtprotoRepoStrongRef.Main
23
24
  createdAt?: string
24
25
  [k: string]: unknown
25
26
  }
@@ -55,6 +55,7 @@ export interface ViewerState {
55
55
  threadMuted?: boolean
56
56
  replyDisabled?: boolean
57
57
  embeddingDisabled?: boolean
58
+ pinned?: boolean
58
59
  [k: string]: unknown
59
60
  }
60
61
 
@@ -73,7 +74,7 @@ export function validateViewerState(v: unknown): ValidationResult {
73
74
  export interface FeedViewPost {
74
75
  post: PostView
75
76
  reply?: ReplyRef
76
- reason?: ReasonRepost | { $type: string; [k: string]: unknown }
77
+ reason?: ReasonRepost | ReasonPin | { $type: string; [k: string]: unknown }
77
78
  /** Context provided by feed generator that may be passed back alongside interactions. */
78
79
  feedContext?: string
79
80
  [k: string]: unknown
@@ -134,6 +135,22 @@ export function validateReasonRepost(v: unknown): ValidationResult {
134
135
  return lexicons.validate('app.bsky.feed.defs#reasonRepost', v)
135
136
  }
136
137
 
138
+ export interface ReasonPin {
139
+ [k: string]: unknown
140
+ }
141
+
142
+ export function isReasonPin(v: unknown): v is ReasonPin {
143
+ return (
144
+ isObj(v) &&
145
+ hasProp(v, '$type') &&
146
+ v.$type === 'app.bsky.feed.defs#reasonPin'
147
+ )
148
+ }
149
+
150
+ export function validateReasonPin(v: unknown): ValidationResult {
151
+ return lexicons.validate('app.bsky.feed.defs#reasonPin', v)
152
+ }
153
+
137
154
  export interface ThreadViewPost {
138
155
  post: PostView
139
156
  parent?:
@@ -265,7 +282,10 @@ export function validateGeneratorViewerState(v: unknown): ValidationResult {
265
282
 
266
283
  export interface SkeletonFeedPost {
267
284
  post: string
268
- reason?: SkeletonReasonRepost | { $type: string; [k: string]: unknown }
285
+ reason?:
286
+ | SkeletonReasonRepost
287
+ | SkeletonReasonPin
288
+ | { $type: string; [k: string]: unknown }
269
289
  /** Context that will be passed through to client and may be passed to feed generator back alongside interactions. */
270
290
  feedContext?: string
271
291
  [k: string]: unknown
@@ -300,6 +320,22 @@ export function validateSkeletonReasonRepost(v: unknown): ValidationResult {
300
320
  return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v)
301
321
  }
302
322
 
323
+ export interface SkeletonReasonPin {
324
+ [k: string]: unknown
325
+ }
326
+
327
+ export function isSkeletonReasonPin(v: unknown): v is SkeletonReasonPin {
328
+ return (
329
+ isObj(v) &&
330
+ hasProp(v, '$type') &&
331
+ v.$type === 'app.bsky.feed.defs#skeletonReasonPin'
332
+ )
333
+ }
334
+
335
+ export function validateSkeletonReasonPin(v: unknown): ValidationResult {
336
+ return lexicons.validate('app.bsky.feed.defs#skeletonReasonPin', v)
337
+ }
338
+
303
339
  export interface ThreadgateView {
304
340
  uri?: string
305
341
  cid?: string
@@ -20,6 +20,7 @@ export interface QueryParams {
20
20
  | 'posts_with_media'
21
21
  | 'posts_and_author_threads'
22
22
  | (string & {})
23
+ includePins: boolean
23
24
  }
24
25
 
25
26
  export type InputSchema = undefined
@@ -17,6 +17,8 @@ export type InputSchema = undefined
17
17
 
18
18
  export interface OutputSchema {
19
19
  suggestions: AppBskyActorDefs.ProfileView[]
20
+ /** If true, response has fallen-back to generic results, and is not scoped using relativeToDid */
21
+ isFallback?: boolean
20
22
  [k: string]: unknown
21
23
  }
22
24
 
@@ -23,6 +23,8 @@ export type InputSchema = undefined
23
23
  export interface OutputSchema {
24
24
  cursor?: string
25
25
  actors: AppBskyUnspeccedDefs.SkeletonSearchActor[]
26
+ /** DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. */
27
+ relativeToDid?: string
26
28
  [k: string]: unknown
27
29
  }
28
30
 
@@ -39,6 +39,7 @@ export interface HandlerSuccess {
39
39
  export interface HandlerError {
40
40
  status: number
41
41
  message?: string
42
+ error?: 'RecordNotFound'
42
43
  }
43
44
 
44
45
  export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
@@ -0,0 +1,50 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as ToolsOzoneModerationDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ uris: string[]
14
+ }
15
+
16
+ export type InputSchema = undefined
17
+
18
+ export interface OutputSchema {
19
+ records: (
20
+ | ToolsOzoneModerationDefs.RecordViewDetail
21
+ | ToolsOzoneModerationDefs.RecordViewNotFound
22
+ | { $type: string; [k: string]: unknown }
23
+ )[]
24
+ [k: string]: unknown
25
+ }
26
+
27
+ export type HandlerInput = undefined
28
+
29
+ export interface HandlerSuccess {
30
+ encoding: 'application/json'
31
+ body: OutputSchema
32
+ headers?: { [key: string]: string }
33
+ }
34
+
35
+ export interface HandlerError {
36
+ status: number
37
+ message?: string
38
+ }
39
+
40
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
41
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
42
+ auth: HA
43
+ params: QueryParams
44
+ input: HandlerInput
45
+ req: express.Request
46
+ res: express.Response
47
+ }
48
+ export type Handler<HA extends HandlerAuth = never> = (
49
+ ctx: HandlerReqCtx<HA>,
50
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,50 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as ToolsOzoneModerationDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ dids: string[]
14
+ }
15
+
16
+ export type InputSchema = undefined
17
+
18
+ export interface OutputSchema {
19
+ repos: (
20
+ | ToolsOzoneModerationDefs.RepoViewDetail
21
+ | ToolsOzoneModerationDefs.RepoViewNotFound
22
+ | { $type: string; [k: string]: unknown }
23
+ )[]
24
+ [k: string]: unknown
25
+ }
26
+
27
+ export type HandlerInput = undefined
28
+
29
+ export interface HandlerSuccess {
30
+ encoding: 'application/json'
31
+ body: OutputSchema
32
+ headers?: { [key: string]: string }
33
+ }
34
+
35
+ export interface HandlerError {
36
+ status: number
37
+ message?: string
38
+ }
39
+
40
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
41
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
42
+ auth: HA
43
+ params: QueryParams
44
+ input: HandlerInput
45
+ req: express.Request
46
+ res: express.Response
47
+ }
48
+ export type Handler<HA extends HandlerAuth = never> = (
49
+ ctx: HandlerReqCtx<HA>,
50
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -21,7 +21,7 @@ export class ServerMailer {
21
21
  }
22
22
 
23
23
  async sendResetPassword(
24
- params: { identifier: string; token: string },
24
+ params: { handle: string; token: string },
25
25
  mailOpts: Mail.Options,
26
26
  ) {
27
27
  return this.sendTemplate('resetPassword', params, {