@atproto/pds 0.4.186 → 0.4.187

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.
Files changed (110) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/account-manager/account-manager.d.ts +1 -1
  3. package/dist/account-manager/account-manager.d.ts.map +1 -1
  4. package/dist/account-manager/account-manager.js +1 -0
  5. package/dist/account-manager/account-manager.js.map +1 -1
  6. package/dist/account-manager/helpers/email-token.js +1 -1
  7. package/dist/account-manager/helpers/email-token.js.map +1 -1
  8. package/dist/account-manager/oauth-store.d.ts +2 -2
  9. package/dist/account-manager/oauth-store.d.ts.map +1 -1
  10. package/dist/account-manager/oauth-store.js +9 -3
  11. package/dist/account-manager/oauth-store.js.map +1 -1
  12. package/dist/lexicon/types/app/bsky/actor/profile.d.ts +4 -3
  13. package/dist/lexicon/types/app/bsky/actor/profile.d.ts.map +1 -1
  14. package/dist/lexicon/types/app/bsky/actor/profile.js +9 -7
  15. package/dist/lexicon/types/app/bsky/actor/profile.js.map +1 -1
  16. package/dist/lexicon/types/app/bsky/actor/status.d.ts +4 -3
  17. package/dist/lexicon/types/app/bsky/actor/status.d.ts.map +1 -1
  18. package/dist/lexicon/types/app/bsky/actor/status.js +9 -7
  19. package/dist/lexicon/types/app/bsky/actor/status.js.map +1 -1
  20. package/dist/lexicon/types/app/bsky/feed/generator.d.ts +4 -3
  21. package/dist/lexicon/types/app/bsky/feed/generator.d.ts.map +1 -1
  22. package/dist/lexicon/types/app/bsky/feed/generator.js +9 -7
  23. package/dist/lexicon/types/app/bsky/feed/generator.js.map +1 -1
  24. package/dist/lexicon/types/app/bsky/feed/like.d.ts +4 -3
  25. package/dist/lexicon/types/app/bsky/feed/like.d.ts.map +1 -1
  26. package/dist/lexicon/types/app/bsky/feed/like.js +9 -7
  27. package/dist/lexicon/types/app/bsky/feed/like.js.map +1 -1
  28. package/dist/lexicon/types/app/bsky/feed/post.d.ts +4 -3
  29. package/dist/lexicon/types/app/bsky/feed/post.d.ts.map +1 -1
  30. package/dist/lexicon/types/app/bsky/feed/post.js +9 -7
  31. package/dist/lexicon/types/app/bsky/feed/post.js.map +1 -1
  32. package/dist/lexicon/types/app/bsky/feed/postgate.d.ts +4 -3
  33. package/dist/lexicon/types/app/bsky/feed/postgate.d.ts.map +1 -1
  34. package/dist/lexicon/types/app/bsky/feed/postgate.js +9 -7
  35. package/dist/lexicon/types/app/bsky/feed/postgate.js.map +1 -1
  36. package/dist/lexicon/types/app/bsky/feed/repost.d.ts +4 -3
  37. package/dist/lexicon/types/app/bsky/feed/repost.d.ts.map +1 -1
  38. package/dist/lexicon/types/app/bsky/feed/repost.js +9 -7
  39. package/dist/lexicon/types/app/bsky/feed/repost.js.map +1 -1
  40. package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts +4 -3
  41. package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts.map +1 -1
  42. package/dist/lexicon/types/app/bsky/feed/threadgate.js +9 -7
  43. package/dist/lexicon/types/app/bsky/feed/threadgate.js.map +1 -1
  44. package/dist/lexicon/types/app/bsky/graph/block.d.ts +4 -3
  45. package/dist/lexicon/types/app/bsky/graph/block.d.ts.map +1 -1
  46. package/dist/lexicon/types/app/bsky/graph/block.js +9 -7
  47. package/dist/lexicon/types/app/bsky/graph/block.js.map +1 -1
  48. package/dist/lexicon/types/app/bsky/graph/follow.d.ts +4 -3
  49. package/dist/lexicon/types/app/bsky/graph/follow.d.ts.map +1 -1
  50. package/dist/lexicon/types/app/bsky/graph/follow.js +9 -7
  51. package/dist/lexicon/types/app/bsky/graph/follow.js.map +1 -1
  52. package/dist/lexicon/types/app/bsky/graph/list.d.ts +4 -3
  53. package/dist/lexicon/types/app/bsky/graph/list.d.ts.map +1 -1
  54. package/dist/lexicon/types/app/bsky/graph/list.js +9 -7
  55. package/dist/lexicon/types/app/bsky/graph/list.js.map +1 -1
  56. package/dist/lexicon/types/app/bsky/graph/listblock.d.ts +4 -3
  57. package/dist/lexicon/types/app/bsky/graph/listblock.d.ts.map +1 -1
  58. package/dist/lexicon/types/app/bsky/graph/listblock.js +9 -7
  59. package/dist/lexicon/types/app/bsky/graph/listblock.js.map +1 -1
  60. package/dist/lexicon/types/app/bsky/graph/listitem.d.ts +4 -3
  61. package/dist/lexicon/types/app/bsky/graph/listitem.d.ts.map +1 -1
  62. package/dist/lexicon/types/app/bsky/graph/listitem.js +9 -7
  63. package/dist/lexicon/types/app/bsky/graph/listitem.js.map +1 -1
  64. package/dist/lexicon/types/app/bsky/graph/starterpack.d.ts +4 -3
  65. package/dist/lexicon/types/app/bsky/graph/starterpack.d.ts.map +1 -1
  66. package/dist/lexicon/types/app/bsky/graph/starterpack.js +9 -7
  67. package/dist/lexicon/types/app/bsky/graph/starterpack.js.map +1 -1
  68. package/dist/lexicon/types/app/bsky/graph/verification.d.ts +4 -3
  69. package/dist/lexicon/types/app/bsky/graph/verification.d.ts.map +1 -1
  70. package/dist/lexicon/types/app/bsky/graph/verification.js +9 -7
  71. package/dist/lexicon/types/app/bsky/graph/verification.js.map +1 -1
  72. package/dist/lexicon/types/app/bsky/labeler/service.d.ts +4 -3
  73. package/dist/lexicon/types/app/bsky/labeler/service.d.ts.map +1 -1
  74. package/dist/lexicon/types/app/bsky/labeler/service.js +9 -7
  75. package/dist/lexicon/types/app/bsky/labeler/service.js.map +1 -1
  76. package/dist/lexicon/types/app/bsky/notification/declaration.d.ts +4 -3
  77. package/dist/lexicon/types/app/bsky/notification/declaration.d.ts.map +1 -1
  78. package/dist/lexicon/types/app/bsky/notification/declaration.js +9 -7
  79. package/dist/lexicon/types/app/bsky/notification/declaration.js.map +1 -1
  80. package/dist/lexicon/types/chat/bsky/actor/declaration.d.ts +4 -3
  81. package/dist/lexicon/types/chat/bsky/actor/declaration.d.ts.map +1 -1
  82. package/dist/lexicon/types/chat/bsky/actor/declaration.js +9 -7
  83. package/dist/lexicon/types/chat/bsky/actor/declaration.js.map +1 -1
  84. package/dist/lexicon/types/com/atproto/lexicon/schema.d.ts +4 -3
  85. package/dist/lexicon/types/com/atproto/lexicon/schema.d.ts.map +1 -1
  86. package/dist/lexicon/types/com/atproto/lexicon/schema.js +9 -7
  87. package/dist/lexicon/types/com/atproto/lexicon/schema.js.map +1 -1
  88. package/package.json +8 -8
  89. package/src/account-manager/account-manager.ts +2 -0
  90. package/src/account-manager/helpers/email-token.ts +1 -1
  91. package/src/account-manager/oauth-store.ts +15 -5
  92. package/src/lexicon/types/app/bsky/actor/profile.ts +12 -6
  93. package/src/lexicon/types/app/bsky/actor/status.ts +12 -6
  94. package/src/lexicon/types/app/bsky/feed/generator.ts +12 -6
  95. package/src/lexicon/types/app/bsky/feed/like.ts +12 -6
  96. package/src/lexicon/types/app/bsky/feed/post.ts +12 -6
  97. package/src/lexicon/types/app/bsky/feed/postgate.ts +12 -6
  98. package/src/lexicon/types/app/bsky/feed/repost.ts +12 -6
  99. package/src/lexicon/types/app/bsky/feed/threadgate.ts +12 -6
  100. package/src/lexicon/types/app/bsky/graph/block.ts +12 -6
  101. package/src/lexicon/types/app/bsky/graph/follow.ts +12 -6
  102. package/src/lexicon/types/app/bsky/graph/list.ts +12 -6
  103. package/src/lexicon/types/app/bsky/graph/listblock.ts +12 -6
  104. package/src/lexicon/types/app/bsky/graph/listitem.ts +12 -6
  105. package/src/lexicon/types/app/bsky/graph/starterpack.ts +12 -6
  106. package/src/lexicon/types/app/bsky/graph/verification.ts +12 -6
  107. package/src/lexicon/types/app/bsky/labeler/service.ts +12 -6
  108. package/src/lexicon/types/app/bsky/notification/declaration.ts +12 -6
  109. package/src/lexicon/types/chat/bsky/actor/declaration.ts +12 -6
  110. package/src/lexicon/types/com/atproto/lexicon/schema.ts +12 -6
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/lexicon/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAajE,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,4BAA4B,CAAA;IACnC,kHAAkH;IAClH,OAAO,EAAE,MAAM,CAAA;IACf,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAID,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,yFAE/B;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,gCAErC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/lexicon/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAajE,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,4BAA4B,CAAA;IACnC,kHAAkH;IAClH,OAAO,EAAE,MAAM,CAAA;IACf,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAID,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,yFAE7B;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,8BAEnC;AAED,OAAO,EACL,KAAK,IAAI,IAAI,MAAM,EACnB,MAAM,IAAI,QAAQ,EAClB,YAAY,IAAI,cAAc,GAC/B,CAAA"}
@@ -1,16 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isRecord = isRecord;
4
- exports.validateRecord = validateRecord;
3
+ exports.isMain = isMain;
4
+ exports.isRecord = isMain;
5
+ exports.validateMain = validateMain;
6
+ exports.validateRecord = validateMain;
5
7
  const lexicons_1 = require("../../../../lexicons");
6
8
  const util_1 = require("../../../../util");
7
9
  const is$typed = util_1.is$typed, validate = lexicons_1.validate;
8
10
  const id = 'com.atproto.lexicon.schema';
9
- const hashRecord = 'main';
10
- function isRecord(v) {
11
- return is$typed(v, id, hashRecord);
11
+ const hashMain = 'main';
12
+ function isMain(v) {
13
+ return is$typed(v, id, hashMain);
12
14
  }
13
- function validateRecord(v) {
14
- return validate(v, id, hashRecord, true);
15
+ function validateMain(v) {
16
+ return validate(v, id, hashMain, true);
15
17
  }
16
18
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/lexicon/schema.ts"],"names":[],"mappings":";;AAyBA,4BAEC;AAED,wCAEC;AA1BD,mDAA4D;AAC5D,2CAIyB;AAEzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,4BAA4B,CAAA;AASvC,MAAM,UAAU,GAAG,MAAM,CAAA;AAEzB,SAAgB,QAAQ,CAAI,CAAI;IAC9B,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAA;AACpC,CAAC;AAED,SAAgB,cAAc,CAAI,CAAI;IACpC,OAAO,QAAQ,CAAa,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;AACtD,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'com.atproto.lexicon.schema'\n\nexport interface Record {\n $type: 'com.atproto.lexicon.schema'\n /** Indicates the 'version' of the Lexicon language. Must be '1' for the current atproto/Lexicon schema system. */\n lexicon: number\n [k: string]: unknown\n}\n\nconst hashRecord = 'main'\n\nexport function isRecord<V>(v: V) {\n return is$typed(v, id, hashRecord)\n}\n\nexport function validateRecord<V>(v: V) {\n return validate<Record & V>(v, id, hashRecord, true)\n}\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/lexicon/schema.ts"],"names":[],"mappings":";;AAyBA,wBAEC;AAQW,0BAAQ;AANpB,oCAEC;AAKiB,sCAAc;AA/BhC,mDAA4D;AAC5D,2CAIyB;AAEzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,4BAA4B,CAAA;AASvC,MAAM,QAAQ,GAAG,MAAM,CAAA;AAEvB,SAAgB,MAAM,CAAI,CAAI;IAC5B,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;AAClC,CAAC;AAED,SAAgB,YAAY,CAAI,CAAI;IAClC,OAAO,QAAQ,CAAW,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;AAClD,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'com.atproto.lexicon.schema'\n\nexport interface Main {\n $type: 'com.atproto.lexicon.schema'\n /** Indicates the 'version' of the Lexicon language. Must be '1' for the current atproto/Lexicon schema system. */\n lexicon: number\n [k: string]: unknown\n}\n\nconst hashMain = 'main'\n\nexport function isMain<V>(v: V) {\n return is$typed(v, id, hashMain)\n}\n\nexport function validateMain<V>(v: V) {\n return validate<Main & V>(v, id, hashMain, true)\n}\n\nexport {\n type Main as Record,\n isMain as isRecord,\n validateMain as validateRecord,\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/pds",
3
- "version": "0.4.186",
3
+ "version": "0.4.187",
4
4
  "license": "MIT",
5
5
  "description": "Reference implementation of atproto Personal Data Server (PDS)",
6
6
  "keywords": [
@@ -47,20 +47,20 @@
47
47
  "uint8arrays": "3.0.0",
48
48
  "undici": "^6.19.8",
49
49
  "zod": "^3.23.8",
50
- "@atproto-labs/fetch-node": "0.1.10",
50
+ "@atproto-labs/fetch-node": "0.2.0",
51
51
  "@atproto-labs/simple-store": "0.3.0",
52
52
  "@atproto-labs/simple-store-memory": "0.1.4",
53
53
  "@atproto-labs/simple-store-redis": "0.0.1",
54
54
  "@atproto-labs/xrpc-utils": "0.0.22",
55
- "@atproto/api": "^0.17.3",
55
+ "@atproto/api": "^0.17.4",
56
56
  "@atproto/aws": "^0.2.30",
57
57
  "@atproto/common": "^0.4.12",
58
58
  "@atproto/crypto": "^0.4.4",
59
59
  "@atproto/identity": "^0.4.9",
60
60
  "@atproto/lexicon": "^0.5.1",
61
- "@atproto/lexicon-resolver": "^0.2.2",
61
+ "@atproto/lexicon-resolver": "^0.2.3",
62
62
  "@atproto/oauth-scopes": "^0.2.1",
63
- "@atproto/oauth-provider": "^0.13.2",
63
+ "@atproto/oauth-provider": "^0.13.3",
64
64
  "@atproto/repo": "^0.8.10",
65
65
  "@atproto/syntax": "^0.4.1",
66
66
  "@atproto/xrpc": "^0.7.5",
@@ -82,9 +82,9 @@
82
82
  "ts-node": "^10.8.2",
83
83
  "typescript": "^5.6.3",
84
84
  "ws": "^8.12.0",
85
- "@atproto/api": "^0.17.3",
86
- "@atproto/bsky": "^0.0.190",
87
- "@atproto/lex-cli": "^0.9.5",
85
+ "@atproto/api": "^0.17.4",
86
+ "@atproto/bsky": "^0.0.191",
87
+ "@atproto/lex-cli": "^0.9.6",
88
88
  "@atproto/oauth-client-browser-example": "0.0.6"
89
89
  },
90
90
  "scripts": {
@@ -543,6 +543,8 @@ export class AccountManager {
543
543
  opts.token,
544
544
  )
545
545
  await this.updateAccountPassword({ did, password: opts.password })
546
+
547
+ return did
546
548
  }
547
549
 
548
550
  async updateAccountPassword(opts: { did: string; password: string }) {
@@ -71,7 +71,7 @@ export const assertValidTokenAndFindDid = async (
71
71
  ): Promise<string> => {
72
72
  const res = await db.db
73
73
  .selectFrom('email_token')
74
- .selectAll()
74
+ .select(['did', 'requestedAt'])
75
75
  .where('purpose', '=', purpose)
76
76
  .where('token', '=', token.toUpperCase())
77
77
  .executeTakeFirst()
@@ -331,13 +331,13 @@ export class OAuthStore
331
331
  async resetPasswordRequest({
332
332
  locale: _locale,
333
333
  email,
334
- }: ResetPasswordRequestInput): Promise<void> {
334
+ }: ResetPasswordRequestInput): Promise<Account | null> {
335
335
  const account = await this.accountManager.getAccountByEmail(email, {
336
336
  includeDeactivated: true,
337
337
  includeTakenDown: true,
338
338
  })
339
339
 
340
- if (!account?.email || !account?.handle) return
340
+ if (!account?.email || !account?.handle) return null
341
341
 
342
342
  const { handle } = account
343
343
  const token = await this.accountManager.createEmailToken(
@@ -350,14 +350,24 @@ export class OAuthStore
350
350
  { handle, token },
351
351
  { to: account.email },
352
352
  )
353
+
354
+ return this.buildAccount(account)
353
355
  }
354
356
 
355
- async resetPasswordConfirm(data: ResetPasswordConfirmInput): Promise<void> {
357
+ async resetPasswordConfirm(
358
+ data: ResetPasswordConfirmInput,
359
+ ): Promise<Account | null> {
356
360
  try {
357
- await this.accountManager.resetPassword(data)
361
+ const did = await this.accountManager.resetPassword(data)
362
+ const account = await this.accountManager.getAccount(did, {
363
+ includeDeactivated: true,
364
+ includeTakenDown: true,
365
+ })
366
+
367
+ return account ? this.buildAccount(account) : null
358
368
  } catch (err) {
359
369
  if (err instanceof XrpcInvalidRequestError) {
360
- throw new InvalidRequestError(err.message, err)
370
+ return null
361
371
  }
362
372
 
363
373
  throw err
@@ -16,7 +16,7 @@ const is$typed = _is$typed,
16
16
  validate = _validate
17
17
  const id = 'app.bsky.actor.profile'
18
18
 
19
- export interface Record {
19
+ export interface Main {
20
20
  $type: 'app.bsky.actor.profile'
21
21
  displayName?: string
22
22
  /** Free-form profile description text. */
@@ -35,12 +35,18 @@ export interface Record {
35
35
  [k: string]: unknown
36
36
  }
37
37
 
38
- const hashRecord = 'main'
38
+ const hashMain = 'main'
39
39
 
40
- export function isRecord<V>(v: V) {
41
- return is$typed(v, id, hashRecord)
40
+ export function isMain<V>(v: V) {
41
+ return is$typed(v, id, hashMain)
42
42
  }
43
43
 
44
- export function validateRecord<V>(v: V) {
45
- return validate<Record & V>(v, id, hashRecord, true)
44
+ export function validateMain<V>(v: V) {
45
+ return validate<Main & V>(v, id, hashMain, true)
46
+ }
47
+
48
+ export {
49
+ type Main as Record,
50
+ isMain as isRecord,
51
+ validateMain as validateRecord,
46
52
  }
@@ -15,7 +15,7 @@ const is$typed = _is$typed,
15
15
  validate = _validate
16
16
  const id = 'app.bsky.actor.status'
17
17
 
18
- export interface Record {
18
+ export interface Main {
19
19
  $type: 'app.bsky.actor.status'
20
20
  /** The status for the account. */
21
21
  status: 'app.bsky.actor.status#live' | (string & {})
@@ -26,14 +26,20 @@ export interface Record {
26
26
  [k: string]: unknown
27
27
  }
28
28
 
29
- const hashRecord = 'main'
29
+ const hashMain = 'main'
30
30
 
31
- export function isRecord<V>(v: V) {
32
- return is$typed(v, id, hashRecord)
31
+ export function isMain<V>(v: V) {
32
+ return is$typed(v, id, hashMain)
33
33
  }
34
34
 
35
- export function validateRecord<V>(v: V) {
36
- return validate<Record & V>(v, id, hashRecord, true)
35
+ export function validateMain<V>(v: V) {
36
+ return validate<Main & V>(v, id, hashMain, true)
37
+ }
38
+
39
+ export {
40
+ type Main as Record,
41
+ isMain as isRecord,
42
+ validateMain as validateRecord,
37
43
  }
38
44
 
39
45
  /** Advertises an account as currently offering live content. */
@@ -16,7 +16,7 @@ const is$typed = _is$typed,
16
16
  validate = _validate
17
17
  const id = 'app.bsky.feed.generator'
18
18
 
19
- export interface Record {
19
+ export interface Main {
20
20
  $type: 'app.bsky.feed.generator'
21
21
  did: string
22
22
  displayName: string
@@ -34,12 +34,18 @@ export interface Record {
34
34
  [k: string]: unknown
35
35
  }
36
36
 
37
- const hashRecord = 'main'
37
+ const hashMain = 'main'
38
38
 
39
- export function isRecord<V>(v: V) {
40
- return is$typed(v, id, hashRecord)
39
+ export function isMain<V>(v: V) {
40
+ return is$typed(v, id, hashMain)
41
41
  }
42
42
 
43
- export function validateRecord<V>(v: V) {
44
- return validate<Record & V>(v, id, hashRecord, true)
43
+ export function validateMain<V>(v: V) {
44
+ return validate<Main & V>(v, id, hashMain, true)
45
+ }
46
+
47
+ export {
48
+ type Main as Record,
49
+ isMain as isRecord,
50
+ validateMain as validateRecord,
45
51
  }
@@ -15,7 +15,7 @@ const is$typed = _is$typed,
15
15
  validate = _validate
16
16
  const id = 'app.bsky.feed.like'
17
17
 
18
- export interface Record {
18
+ export interface Main {
19
19
  $type: 'app.bsky.feed.like'
20
20
  subject: ComAtprotoRepoStrongRef.Main
21
21
  createdAt: string
@@ -23,12 +23,18 @@ export interface Record {
23
23
  [k: string]: unknown
24
24
  }
25
25
 
26
- const hashRecord = 'main'
26
+ const hashMain = 'main'
27
27
 
28
- export function isRecord<V>(v: V) {
29
- return is$typed(v, id, hashRecord)
28
+ export function isMain<V>(v: V) {
29
+ return is$typed(v, id, hashMain)
30
30
  }
31
31
 
32
- export function validateRecord<V>(v: V) {
33
- return validate<Record & V>(v, id, hashRecord, true)
32
+ export function validateMain<V>(v: V) {
33
+ return validate<Main & V>(v, id, hashMain, true)
34
+ }
35
+
36
+ export {
37
+ type Main as Record,
38
+ isMain as isRecord,
39
+ validateMain as validateRecord,
34
40
  }
@@ -22,7 +22,7 @@ const is$typed = _is$typed,
22
22
  validate = _validate
23
23
  const id = 'app.bsky.feed.post'
24
24
 
25
- export interface Record {
25
+ export interface Main {
26
26
  $type: 'app.bsky.feed.post'
27
27
  /** The primary post content. May be an empty string, if there are embeds. */
28
28
  text: string
@@ -48,14 +48,20 @@ export interface Record {
48
48
  [k: string]: unknown
49
49
  }
50
50
 
51
- const hashRecord = 'main'
51
+ const hashMain = 'main'
52
52
 
53
- export function isRecord<V>(v: V) {
54
- return is$typed(v, id, hashRecord)
53
+ export function isMain<V>(v: V) {
54
+ return is$typed(v, id, hashMain)
55
55
  }
56
56
 
57
- export function validateRecord<V>(v: V) {
58
- return validate<Record & V>(v, id, hashRecord, true)
57
+ export function validateMain<V>(v: V) {
58
+ return validate<Main & V>(v, id, hashMain, true)
59
+ }
60
+
61
+ export {
62
+ type Main as Record,
63
+ isMain as isRecord,
64
+ validateMain as validateRecord,
59
65
  }
60
66
 
61
67
  export interface ReplyRef {
@@ -14,7 +14,7 @@ const is$typed = _is$typed,
14
14
  validate = _validate
15
15
  const id = 'app.bsky.feed.postgate'
16
16
 
17
- export interface Record {
17
+ export interface Main {
18
18
  $type: 'app.bsky.feed.postgate'
19
19
  createdAt: string
20
20
  /** Reference (AT-URI) to the post record. */
@@ -26,14 +26,20 @@ export interface Record {
26
26
  [k: string]: unknown
27
27
  }
28
28
 
29
- const hashRecord = 'main'
29
+ const hashMain = 'main'
30
30
 
31
- export function isRecord<V>(v: V) {
32
- return is$typed(v, id, hashRecord)
31
+ export function isMain<V>(v: V) {
32
+ return is$typed(v, id, hashMain)
33
33
  }
34
34
 
35
- export function validateRecord<V>(v: V) {
36
- return validate<Record & V>(v, id, hashRecord, true)
35
+ export function validateMain<V>(v: V) {
36
+ return validate<Main & V>(v, id, hashMain, true)
37
+ }
38
+
39
+ export {
40
+ type Main as Record,
41
+ isMain as isRecord,
42
+ validateMain as validateRecord,
37
43
  }
38
44
 
39
45
  /** Disables embedding of this post. */
@@ -15,7 +15,7 @@ const is$typed = _is$typed,
15
15
  validate = _validate
16
16
  const id = 'app.bsky.feed.repost'
17
17
 
18
- export interface Record {
18
+ export interface Main {
19
19
  $type: 'app.bsky.feed.repost'
20
20
  subject: ComAtprotoRepoStrongRef.Main
21
21
  createdAt: string
@@ -23,12 +23,18 @@ export interface Record {
23
23
  [k: string]: unknown
24
24
  }
25
25
 
26
- const hashRecord = 'main'
26
+ const hashMain = 'main'
27
27
 
28
- export function isRecord<V>(v: V) {
29
- return is$typed(v, id, hashRecord)
28
+ export function isMain<V>(v: V) {
29
+ return is$typed(v, id, hashMain)
30
30
  }
31
31
 
32
- export function validateRecord<V>(v: V) {
33
- return validate<Record & V>(v, id, hashRecord, true)
32
+ export function validateMain<V>(v: V) {
33
+ return validate<Main & V>(v, id, hashMain, true)
34
+ }
35
+
36
+ export {
37
+ type Main as Record,
38
+ isMain as isRecord,
39
+ validateMain as validateRecord,
34
40
  }
@@ -14,7 +14,7 @@ const is$typed = _is$typed,
14
14
  validate = _validate
15
15
  const id = 'app.bsky.feed.threadgate'
16
16
 
17
- export interface Record {
17
+ export interface Main {
18
18
  $type: 'app.bsky.feed.threadgate'
19
19
  /** Reference (AT-URI) to the post record. */
20
20
  post: string
@@ -32,14 +32,20 @@ export interface Record {
32
32
  [k: string]: unknown
33
33
  }
34
34
 
35
- const hashRecord = 'main'
35
+ const hashMain = 'main'
36
36
 
37
- export function isRecord<V>(v: V) {
38
- return is$typed(v, id, hashRecord)
37
+ export function isMain<V>(v: V) {
38
+ return is$typed(v, id, hashMain)
39
39
  }
40
40
 
41
- export function validateRecord<V>(v: V) {
42
- return validate<Record & V>(v, id, hashRecord, true)
41
+ export function validateMain<V>(v: V) {
42
+ return validate<Main & V>(v, id, hashMain, true)
43
+ }
44
+
45
+ export {
46
+ type Main as Record,
47
+ isMain as isRecord,
48
+ validateMain as validateRecord,
43
49
  }
44
50
 
45
51
  /** Allow replies from actors mentioned in your post. */
@@ -14,7 +14,7 @@ const is$typed = _is$typed,
14
14
  validate = _validate
15
15
  const id = 'app.bsky.graph.block'
16
16
 
17
- export interface Record {
17
+ export interface Main {
18
18
  $type: 'app.bsky.graph.block'
19
19
  /** DID of the account to be blocked. */
20
20
  subject: string
@@ -22,12 +22,18 @@ export interface Record {
22
22
  [k: string]: unknown
23
23
  }
24
24
 
25
- const hashRecord = 'main'
25
+ const hashMain = 'main'
26
26
 
27
- export function isRecord<V>(v: V) {
28
- return is$typed(v, id, hashRecord)
27
+ export function isMain<V>(v: V) {
28
+ return is$typed(v, id, hashMain)
29
29
  }
30
30
 
31
- export function validateRecord<V>(v: V) {
32
- return validate<Record & V>(v, id, hashRecord, true)
31
+ export function validateMain<V>(v: V) {
32
+ return validate<Main & V>(v, id, hashMain, true)
33
+ }
34
+
35
+ export {
36
+ type Main as Record,
37
+ isMain as isRecord,
38
+ validateMain as validateRecord,
33
39
  }
@@ -14,19 +14,25 @@ const is$typed = _is$typed,
14
14
  validate = _validate
15
15
  const id = 'app.bsky.graph.follow'
16
16
 
17
- export interface Record {
17
+ export interface Main {
18
18
  $type: 'app.bsky.graph.follow'
19
19
  subject: string
20
20
  createdAt: string
21
21
  [k: string]: unknown
22
22
  }
23
23
 
24
- const hashRecord = 'main'
24
+ const hashMain = 'main'
25
25
 
26
- export function isRecord<V>(v: V) {
27
- return is$typed(v, id, hashRecord)
26
+ export function isMain<V>(v: V) {
27
+ return is$typed(v, id, hashMain)
28
28
  }
29
29
 
30
- export function validateRecord<V>(v: V) {
31
- return validate<Record & V>(v, id, hashRecord, true)
30
+ export function validateMain<V>(v: V) {
31
+ return validate<Main & V>(v, id, hashMain, true)
32
+ }
33
+
34
+ export {
35
+ type Main as Record,
36
+ isMain as isRecord,
37
+ validateMain as validateRecord,
32
38
  }
@@ -17,7 +17,7 @@ const is$typed = _is$typed,
17
17
  validate = _validate
18
18
  const id = 'app.bsky.graph.list'
19
19
 
20
- export interface Record {
20
+ export interface Main {
21
21
  $type: 'app.bsky.graph.list'
22
22
  purpose: AppBskyGraphDefs.ListPurpose
23
23
  /** Display name for list; can not be empty. */
@@ -30,12 +30,18 @@ export interface Record {
30
30
  [k: string]: unknown
31
31
  }
32
32
 
33
- const hashRecord = 'main'
33
+ const hashMain = 'main'
34
34
 
35
- export function isRecord<V>(v: V) {
36
- return is$typed(v, id, hashRecord)
35
+ export function isMain<V>(v: V) {
36
+ return is$typed(v, id, hashMain)
37
37
  }
38
38
 
39
- export function validateRecord<V>(v: V) {
40
- return validate<Record & V>(v, id, hashRecord, true)
39
+ export function validateMain<V>(v: V) {
40
+ return validate<Main & V>(v, id, hashMain, true)
41
+ }
42
+
43
+ export {
44
+ type Main as Record,
45
+ isMain as isRecord,
46
+ validateMain as validateRecord,
41
47
  }
@@ -14,7 +14,7 @@ const is$typed = _is$typed,
14
14
  validate = _validate
15
15
  const id = 'app.bsky.graph.listblock'
16
16
 
17
- export interface Record {
17
+ export interface Main {
18
18
  $type: 'app.bsky.graph.listblock'
19
19
  /** Reference (AT-URI) to the mod list record. */
20
20
  subject: string
@@ -22,12 +22,18 @@ export interface Record {
22
22
  [k: string]: unknown
23
23
  }
24
24
 
25
- const hashRecord = 'main'
25
+ const hashMain = 'main'
26
26
 
27
- export function isRecord<V>(v: V) {
28
- return is$typed(v, id, hashRecord)
27
+ export function isMain<V>(v: V) {
28
+ return is$typed(v, id, hashMain)
29
29
  }
30
30
 
31
- export function validateRecord<V>(v: V) {
32
- return validate<Record & V>(v, id, hashRecord, true)
31
+ export function validateMain<V>(v: V) {
32
+ return validate<Main & V>(v, id, hashMain, true)
33
+ }
34
+
35
+ export {
36
+ type Main as Record,
37
+ isMain as isRecord,
38
+ validateMain as validateRecord,
33
39
  }
@@ -14,7 +14,7 @@ const is$typed = _is$typed,
14
14
  validate = _validate
15
15
  const id = 'app.bsky.graph.listitem'
16
16
 
17
- export interface Record {
17
+ export interface Main {
18
18
  $type: 'app.bsky.graph.listitem'
19
19
  /** The account which is included on the list. */
20
20
  subject: string
@@ -24,12 +24,18 @@ export interface Record {
24
24
  [k: string]: unknown
25
25
  }
26
26
 
27
- const hashRecord = 'main'
27
+ const hashMain = 'main'
28
28
 
29
- export function isRecord<V>(v: V) {
30
- return is$typed(v, id, hashRecord)
29
+ export function isMain<V>(v: V) {
30
+ return is$typed(v, id, hashMain)
31
31
  }
32
32
 
33
- export function validateRecord<V>(v: V) {
34
- return validate<Record & V>(v, id, hashRecord, true)
33
+ export function validateMain<V>(v: V) {
34
+ return validate<Main & V>(v, id, hashMain, true)
35
+ }
36
+
37
+ export {
38
+ type Main as Record,
39
+ isMain as isRecord,
40
+ validateMain as validateRecord,
35
41
  }
@@ -15,7 +15,7 @@ const is$typed = _is$typed,
15
15
  validate = _validate
16
16
  const id = 'app.bsky.graph.starterpack'
17
17
 
18
- export interface Record {
18
+ export interface Main {
19
19
  $type: 'app.bsky.graph.starterpack'
20
20
  /** Display name for starter pack; can not be empty. */
21
21
  name: string
@@ -28,14 +28,20 @@ export interface Record {
28
28
  [k: string]: unknown
29
29
  }
30
30
 
31
- const hashRecord = 'main'
31
+ const hashMain = 'main'
32
32
 
33
- export function isRecord<V>(v: V) {
34
- return is$typed(v, id, hashRecord)
33
+ export function isMain<V>(v: V) {
34
+ return is$typed(v, id, hashMain)
35
35
  }
36
36
 
37
- export function validateRecord<V>(v: V) {
38
- return validate<Record & V>(v, id, hashRecord, true)
37
+ export function validateMain<V>(v: V) {
38
+ return validate<Main & V>(v, id, hashMain, true)
39
+ }
40
+
41
+ export {
42
+ type Main as Record,
43
+ isMain as isRecord,
44
+ validateMain as validateRecord,
39
45
  }
40
46
 
41
47
  export interface FeedItem {
@@ -14,7 +14,7 @@ const is$typed = _is$typed,
14
14
  validate = _validate
15
15
  const id = 'app.bsky.graph.verification'
16
16
 
17
- export interface Record {
17
+ export interface Main {
18
18
  $type: 'app.bsky.graph.verification'
19
19
  /** DID of the subject the verification applies to. */
20
20
  subject: string
@@ -27,12 +27,18 @@ export interface Record {
27
27
  [k: string]: unknown
28
28
  }
29
29
 
30
- const hashRecord = 'main'
30
+ const hashMain = 'main'
31
31
 
32
- export function isRecord<V>(v: V) {
33
- return is$typed(v, id, hashRecord)
32
+ export function isMain<V>(v: V) {
33
+ return is$typed(v, id, hashMain)
34
34
  }
35
35
 
36
- export function validateRecord<V>(v: V) {
37
- return validate<Record & V>(v, id, hashRecord, true)
36
+ export function validateMain<V>(v: V) {
37
+ return validate<Main & V>(v, id, hashMain, true)
38
+ }
39
+
40
+ export {
41
+ type Main as Record,
42
+ isMain as isRecord,
43
+ validateMain as validateRecord,
38
44
  }