@atproto/bsky 0.0.71 → 0.0.73

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 (45) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/auth-verifier.d.ts.map +1 -1
  3. package/dist/auth-verifier.js +1 -1
  4. package/dist/auth-verifier.js.map +1 -1
  5. package/dist/context.d.ts +0 -1
  6. package/dist/context.d.ts.map +1 -1
  7. package/dist/context.js +0 -9
  8. package/dist/context.js.map +1 -1
  9. package/dist/hydration/hydrator.js +1 -1
  10. package/dist/hydration/hydrator.js.map +1 -1
  11. package/dist/lexicon/lexicons.d.ts +13 -36
  12. package/dist/lexicon/lexicons.d.ts.map +1 -1
  13. package/dist/lexicon/lexicons.js +17 -38
  14. package/dist/lexicon/lexicons.js.map +1 -1
  15. package/dist/lexicon/types/app/bsky/feed/defs.d.ts +1 -1
  16. package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
  17. package/dist/lexicon/types/com/atproto/label/defs.d.ts +1 -1
  18. package/dist/lexicon/types/com/atproto/server/getServiceAuth.d.ts +5 -0
  19. package/dist/lexicon/types/com/atproto/server/getServiceAuth.d.ts.map +1 -1
  20. package/dist/proto/bsky_connect.d.ts +1 -10
  21. package/dist/proto/bsky_connect.d.ts.map +1 -1
  22. package/dist/proto/bsky_connect.js +0 -9
  23. package/dist/proto/bsky_connect.js.map +1 -1
  24. package/dist/proto/bsky_pb.d.ts +0 -34
  25. package/dist/proto/bsky_pb.d.ts.map +1 -1
  26. package/dist/proto/bsky_pb.js +4 -112
  27. package/dist/proto/bsky_pb.js.map +1 -1
  28. package/package.json +6 -6
  29. package/proto/bsky.proto +0 -9
  30. package/src/auth-verifier.ts +6 -1
  31. package/src/context.ts +0 -10
  32. package/src/hydration/hydrator.ts +1 -1
  33. package/src/lexicon/lexicons.ts +20 -39
  34. package/src/lexicon/types/app/bsky/feed/defs.ts +1 -1
  35. package/src/lexicon/types/com/atproto/label/defs.ts +1 -1
  36. package/src/lexicon/types/com/atproto/server/getServiceAuth.ts +5 -0
  37. package/src/proto/bsky_connect.ts +0 -11
  38. package/src/proto/bsky_pb.ts +0 -116
  39. package/tests/admin/admin-auth.test.ts +5 -0
  40. package/tests/auth.test.ts +1 -0
  41. package/dist/lexicon/types/app/bsky/feed/detach.d.ts +0 -15
  42. package/dist/lexicon/types/app/bsky/feed/detach.d.ts.map +0 -1
  43. package/dist/lexicon/types/app/bsky/feed/detach.js +0 -17
  44. package/dist/lexicon/types/app/bsky/feed/detach.js.map +0 -1
  45. package/src/lexicon/types/app/bsky/feed/detach.ts +0 -29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/bsky",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
4
4
  "license": "MIT",
5
5
  "description": "Reference implementation of app.bsky App View (Bluesky API)",
6
6
  "keywords": [
@@ -40,14 +40,14 @@
40
40
  "structured-headers": "^1.0.1",
41
41
  "typed-emitter": "^2.1.0",
42
42
  "uint8arrays": "3.0.0",
43
- "@atproto/api": "^0.12.27",
43
+ "@atproto/api": "^0.12.29",
44
44
  "@atproto/common": "^0.4.1",
45
45
  "@atproto/crypto": "^0.4.0",
46
46
  "@atproto/identity": "^0.4.0",
47
47
  "@atproto/lexicon": "^0.4.0",
48
48
  "@atproto/repo": "^0.4.1",
49
49
  "@atproto/syntax": "^0.3.0",
50
- "@atproto/xrpc-server": "^0.5.3"
50
+ "@atproto/xrpc-server": "^0.6.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@bufbuild/buf": "^1.28.1",
@@ -62,9 +62,9 @@
62
62
  "axios": "^0.27.2",
63
63
  "jest": "^28.1.2",
64
64
  "ts-node": "^10.8.2",
65
- "@atproto/api": "^0.12.27",
65
+ "@atproto/api": "^0.12.29",
66
66
  "@atproto/lex-cli": "^0.4.0",
67
- "@atproto/pds": "^0.4.44",
67
+ "@atproto/pds": "^0.4.46",
68
68
  "@atproto/xrpc": "^0.5.0"
69
69
  },
70
70
  "scripts": {
@@ -73,7 +73,7 @@
73
73
  "start": "node --enable-source-maps dist/bin.js",
74
74
  "test": "../dev-infra/with-test-redis-and-db.sh jest",
75
75
  "test:log": "tail -50 test.log | pino-pretty",
76
- "test:updateSnapshot": "jest --updateSnapshot",
76
+ "test:updateSnapshot": "../dev-infra/with-test-redis-and-db.sh jest --updateSnapshot",
77
77
  "migration:create": "ts-node ./bin/migration-create.ts",
78
78
  "buf:gen": "buf generate ../bsync/proto && buf generate ./proto"
79
79
  }
package/proto/bsky.proto CHANGED
@@ -122,14 +122,6 @@ message GetThreadGateRecordsResponse {
122
122
  repeated Record records = 1;
123
123
  }
124
124
 
125
- message GetDetachRecordsRequest {
126
- repeated string uris = 1;
127
- }
128
-
129
- message GetDetachRecordsResponse {
130
- repeated Record records = 1;
131
- }
132
-
133
125
  message GetLabelerRecordsRequest {
134
126
  repeated string uris = 1;
135
127
  }
@@ -1076,7 +1068,6 @@ service Service {
1076
1068
  rpc GetActorChatDeclarationRecords(GetActorChatDeclarationRecordsRequest) returns (GetActorChatDeclarationRecordsResponse);
1077
1069
  rpc GetRepostRecords(GetRepostRecordsRequest) returns (GetRepostRecordsResponse);
1078
1070
  rpc GetThreadGateRecords(GetThreadGateRecordsRequest) returns (GetThreadGateRecordsResponse);
1079
- rpc GetDetachRecords(GetDetachRecordsRequest) returns (GetDetachRecordsResponse);
1080
1071
  rpc GetLabelerRecords(GetLabelerRecordsRequest) returns (GetLabelerRecordsResponse);
1081
1072
  rpc GetStarterPackRecords(GetStarterPackRecordsRequest) returns (GetStarterPackRecordsResponse);
1082
1073
 
@@ -248,7 +248,12 @@ export class AuthVerifier {
248
248
  if (!jwtStr) {
249
249
  throw new AuthRequiredError('missing jwt', 'MissingJwt')
250
250
  }
251
- const payload = await verifyServiceJwt(jwtStr, opts.aud, getSigningKey)
251
+ const payload = await verifyServiceJwt(
252
+ jwtStr,
253
+ opts.aud,
254
+ null,
255
+ getSigningKey,
256
+ )
252
257
  return { iss: payload.iss, aud: payload.aud }
253
258
  }
254
259
 
package/src/context.ts CHANGED
@@ -3,7 +3,6 @@ import * as plc from '@did-plc/lib'
3
3
  import { IdResolver } from '@atproto/identity'
4
4
  import AtpAgent from '@atproto/api'
5
5
  import { Keypair } from '@atproto/crypto'
6
- import { createServiceJwt } from '@atproto/xrpc-server'
7
6
  import { ServerConfig } from './config'
8
7
  import { DataPlaneClient } from './data-plane/client'
9
8
  import { Hydrator } from './hydration/hydrator'
@@ -89,15 +88,6 @@ export class AppContext {
89
88
  return this.opts.featureGates
90
89
  }
91
90
 
92
- async serviceAuthJwt(aud: string) {
93
- const iss = this.cfg.serverDid
94
- return createServiceJwt({
95
- iss,
96
- aud,
97
- keypair: this.signingKey,
98
- })
99
- }
100
-
101
91
  reqLabelers(req: express.Request): ParsedLabelers {
102
92
  const val = req.header('atproto-accept-labelers')
103
93
  let parsed: ParsedLabelers | null
@@ -738,7 +738,7 @@ export class Hydrator {
738
738
  })
739
739
  }
740
740
 
741
- // provides partial hydration state withing getFollows / getFollowers, mainly for applying rules
741
+ // provides partial hydration state within getFollows / getFollowers, mainly for applying rules
742
742
  async hydrateFollows(uris: string[]): Promise<HydrationState> {
743
743
  const follows = await this.graph.getFollows(uris)
744
744
  const pairs: RelationshipPair[] = []
@@ -891,7 +891,7 @@ export const schemaDict = {
891
891
  labelValueDefinition: {
892
892
  type: 'object',
893
893
  description:
894
- 'Declares a label value and its expected interpertations and behaviors.',
894
+ 'Declares a label value and its expected interpretations and behaviors.',
895
895
  required: ['identifier', 'severity', 'blurs', 'locales'],
896
896
  properties: {
897
897
  identifier: {
@@ -2607,6 +2607,17 @@ export const schemaDict = {
2607
2607
  description:
2608
2608
  'The DID of the service that the token will be used to authenticate with',
2609
2609
  },
2610
+ exp: {
2611
+ type: 'integer',
2612
+ description:
2613
+ 'The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope.',
2614
+ },
2615
+ lxm: {
2616
+ type: 'string',
2617
+ format: 'nsid',
2618
+ description:
2619
+ 'Lexicon (XRPC) method to bind the requested token to',
2620
+ },
2610
2621
  },
2611
2622
  },
2612
2623
  output: {
@@ -2621,6 +2632,13 @@ export const schemaDict = {
2621
2632
  },
2622
2633
  },
2623
2634
  },
2635
+ errors: [
2636
+ {
2637
+ name: 'BadExpiration',
2638
+ description:
2639
+ 'Indicates that the requested expiration date is not a valid. May be in the past or may be reliant on the requested scopes.',
2640
+ },
2641
+ ],
2624
2642
  },
2625
2643
  },
2626
2644
  },
@@ -5482,7 +5500,7 @@ export const schemaDict = {
5482
5500
  feedContext: {
5483
5501
  type: 'string',
5484
5502
  description:
5485
- 'Context on a feed item that was orginally supplied by the feed generator on getFeedSkeleton.',
5503
+ 'Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.',
5486
5504
  maxLength: 2000,
5487
5505
  },
5488
5506
  },
@@ -5596,42 +5614,6 @@ export const schemaDict = {
5596
5614
  },
5597
5615
  },
5598
5616
  },
5599
- AppBskyFeedDetach: {
5600
- lexicon: 1,
5601
- id: 'app.bsky.feed.detach',
5602
- defs: {
5603
- main: {
5604
- type: 'record',
5605
- key: 'tid',
5606
- description:
5607
- 'Record defining post URIs detached from a root post. The record key (rkey) of the detach record must match the record key of the root post in question, and that record must be in the same repository.',
5608
- record: {
5609
- type: 'object',
5610
- required: ['post', 'targets', 'updatedAt'],
5611
- properties: {
5612
- post: {
5613
- type: 'string',
5614
- format: 'at-uri',
5615
- description: 'Reference (AT-URI) to the post record.',
5616
- },
5617
- targets: {
5618
- type: 'array',
5619
- maxLength: 50,
5620
- items: {
5621
- type: 'string',
5622
- format: 'at-uri',
5623
- },
5624
- description: 'List of detached post URIs.',
5625
- },
5626
- updatedAt: {
5627
- type: 'string',
5628
- format: 'datetime',
5629
- },
5630
- },
5631
- },
5632
- },
5633
- },
5634
- },
5635
5617
  AppBskyFeedGenerator: {
5636
5618
  lexicon: 1,
5637
5619
  id: 'app.bsky.feed.generator',
@@ -10080,7 +10062,6 @@ export const ids = {
10080
10062
  AppBskyEmbedRecordWithMedia: 'app.bsky.embed.recordWithMedia',
10081
10063
  AppBskyFeedDefs: 'app.bsky.feed.defs',
10082
10064
  AppBskyFeedDescribeFeedGenerator: 'app.bsky.feed.describeFeedGenerator',
10083
- AppBskyFeedDetach: 'app.bsky.feed.detach',
10084
10065
  AppBskyFeedGenerator: 'app.bsky.feed.generator',
10085
10066
  AppBskyFeedGetActorFeeds: 'app.bsky.feed.getActorFeeds',
10086
10067
  AppBskyFeedGetActorLikes: 'app.bsky.feed.getActorLikes',
@@ -332,7 +332,7 @@ export interface Interaction {
332
332
  | 'app.bsky.feed.defs#interactionQuote'
333
333
  | 'app.bsky.feed.defs#interactionShare'
334
334
  | (string & {})
335
- /** Context on a feed item that was orginally supplied by the feed generator on getFeedSkeleton. */
335
+ /** Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. */
336
336
  feedContext?: string
337
337
  [k: string]: unknown
338
338
  }
@@ -78,7 +78,7 @@ export function validateSelfLabel(v: unknown): ValidationResult {
78
78
  return lexicons.validate('com.atproto.label.defs#selfLabel', v)
79
79
  }
80
80
 
81
- /** Declares a label value and its expected interpertations and behaviors. */
81
+ /** Declares a label value and its expected interpretations and behaviors. */
82
82
  export interface LabelValueDefinition {
83
83
  /** The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). */
84
84
  identifier: string
@@ -11,6 +11,10 @@ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
11
11
  export interface QueryParams {
12
12
  /** The DID of the service that the token will be used to authenticate with */
13
13
  aud: string
14
+ /** The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope. */
15
+ exp?: number
16
+ /** Lexicon (XRPC) method to bind the requested token to */
17
+ lxm?: string
14
18
  }
15
19
 
16
20
  export type InputSchema = undefined
@@ -31,6 +35,7 @@ export interface HandlerSuccess {
31
35
  export interface HandlerError {
32
36
  status: number
33
37
  message?: string
38
+ error?: 'BadExpiration'
34
39
  }
35
40
 
36
41
  export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
@@ -66,8 +66,6 @@ import {
66
66
  GetBlocksResponse,
67
67
  GetCountsForUsersRequest,
68
68
  GetCountsForUsersResponse,
69
- GetDetachRecordsRequest,
70
- GetDetachRecordsResponse,
71
69
  GetDidsByHandlesRequest,
72
70
  GetDidsByHandlesResponse,
73
71
  GetFeedGeneratorRecordsRequest,
@@ -311,15 +309,6 @@ export const Service = {
311
309
  O: GetThreadGateRecordsResponse,
312
310
  kind: MethodKind.Unary,
313
311
  },
314
- /**
315
- * @generated from rpc bsky.Service.GetDetachRecords
316
- */
317
- getDetachRecords: {
318
- name: 'GetDetachRecords',
319
- I: GetDetachRecordsRequest,
320
- O: GetDetachRecordsResponse,
321
- kind: MethodKind.Unary,
322
- },
323
312
  /**
324
313
  * @generated from rpc bsky.Service.GetLabelerRecords
325
314
  */
@@ -1608,122 +1608,6 @@ export class GetThreadGateRecordsResponse extends Message<GetThreadGateRecordsRe
1608
1608
  }
1609
1609
  }
1610
1610
 
1611
- /**
1612
- * @generated from message bsky.GetDetachRecordsRequest
1613
- */
1614
- export class GetDetachRecordsRequest extends Message<GetDetachRecordsRequest> {
1615
- /**
1616
- * @generated from field: repeated string uris = 1;
1617
- */
1618
- uris: string[] = []
1619
-
1620
- constructor(data?: PartialMessage<GetDetachRecordsRequest>) {
1621
- super()
1622
- proto3.util.initPartial(data, this)
1623
- }
1624
-
1625
- static readonly runtime: typeof proto3 = proto3
1626
- static readonly typeName = 'bsky.GetDetachRecordsRequest'
1627
- static readonly fields: FieldList = proto3.util.newFieldList(() => [
1628
- {
1629
- no: 1,
1630
- name: 'uris',
1631
- kind: 'scalar',
1632
- T: 9 /* ScalarType.STRING */,
1633
- repeated: true,
1634
- },
1635
- ])
1636
-
1637
- static fromBinary(
1638
- bytes: Uint8Array,
1639
- options?: Partial<BinaryReadOptions>,
1640
- ): GetDetachRecordsRequest {
1641
- return new GetDetachRecordsRequest().fromBinary(bytes, options)
1642
- }
1643
-
1644
- static fromJson(
1645
- jsonValue: JsonValue,
1646
- options?: Partial<JsonReadOptions>,
1647
- ): GetDetachRecordsRequest {
1648
- return new GetDetachRecordsRequest().fromJson(jsonValue, options)
1649
- }
1650
-
1651
- static fromJsonString(
1652
- jsonString: string,
1653
- options?: Partial<JsonReadOptions>,
1654
- ): GetDetachRecordsRequest {
1655
- return new GetDetachRecordsRequest().fromJsonString(jsonString, options)
1656
- }
1657
-
1658
- static equals(
1659
- a:
1660
- | GetDetachRecordsRequest
1661
- | PlainMessage<GetDetachRecordsRequest>
1662
- | undefined,
1663
- b:
1664
- | GetDetachRecordsRequest
1665
- | PlainMessage<GetDetachRecordsRequest>
1666
- | undefined,
1667
- ): boolean {
1668
- return proto3.util.equals(GetDetachRecordsRequest, a, b)
1669
- }
1670
- }
1671
-
1672
- /**
1673
- * @generated from message bsky.GetDetachRecordsResponse
1674
- */
1675
- export class GetDetachRecordsResponse extends Message<GetDetachRecordsResponse> {
1676
- /**
1677
- * @generated from field: repeated bsky.Record records = 1;
1678
- */
1679
- records: Record[] = []
1680
-
1681
- constructor(data?: PartialMessage<GetDetachRecordsResponse>) {
1682
- super()
1683
- proto3.util.initPartial(data, this)
1684
- }
1685
-
1686
- static readonly runtime: typeof proto3 = proto3
1687
- static readonly typeName = 'bsky.GetDetachRecordsResponse'
1688
- static readonly fields: FieldList = proto3.util.newFieldList(() => [
1689
- { no: 1, name: 'records', kind: 'message', T: Record, repeated: true },
1690
- ])
1691
-
1692
- static fromBinary(
1693
- bytes: Uint8Array,
1694
- options?: Partial<BinaryReadOptions>,
1695
- ): GetDetachRecordsResponse {
1696
- return new GetDetachRecordsResponse().fromBinary(bytes, options)
1697
- }
1698
-
1699
- static fromJson(
1700
- jsonValue: JsonValue,
1701
- options?: Partial<JsonReadOptions>,
1702
- ): GetDetachRecordsResponse {
1703
- return new GetDetachRecordsResponse().fromJson(jsonValue, options)
1704
- }
1705
-
1706
- static fromJsonString(
1707
- jsonString: string,
1708
- options?: Partial<JsonReadOptions>,
1709
- ): GetDetachRecordsResponse {
1710
- return new GetDetachRecordsResponse().fromJsonString(jsonString, options)
1711
- }
1712
-
1713
- static equals(
1714
- a:
1715
- | GetDetachRecordsResponse
1716
- | PlainMessage<GetDetachRecordsResponse>
1717
- | undefined,
1718
- b:
1719
- | GetDetachRecordsResponse
1720
- | PlainMessage<GetDetachRecordsResponse>
1721
- | undefined,
1722
- ): boolean {
1723
- return proto3.util.equals(GetDetachRecordsResponse, a, b)
1724
- }
1725
- }
1726
-
1727
1611
  /**
1728
1612
  * @generated from message bsky.GetLabelerRecordsRequest
1729
1613
  */
@@ -71,6 +71,7 @@ describe('admin auth', () => {
71
71
  const headers = await createServiceAuthHeaders({
72
72
  iss: modServiceDid,
73
73
  aud: bskyDid,
74
+ lxm: null,
74
75
  keypair: modServiceKey,
75
76
  })
76
77
  await agent.api.com.atproto.admin.updateSubjectStatus(
@@ -96,6 +97,7 @@ describe('admin auth', () => {
96
97
  const headers = await createServiceAuthHeaders({
97
98
  iss: altModDid,
98
99
  aud: bskyDid,
100
+ lxm: null,
99
101
  keypair: modServiceKey,
100
102
  })
101
103
  const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
@@ -116,6 +118,7 @@ describe('admin auth', () => {
116
118
  const headers = await createServiceAuthHeaders({
117
119
  iss: sc.dids.alice,
118
120
  aud: bskyDid,
121
+ lxm: null,
119
122
  keypair: aliceKey,
120
123
  })
121
124
  const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
@@ -136,6 +139,7 @@ describe('admin auth', () => {
136
139
  const headers = await createServiceAuthHeaders({
137
140
  iss: modServiceDid,
138
141
  aud: bskyDid,
142
+ lxm: null,
139
143
  keypair: badKey,
140
144
  })
141
145
  const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
@@ -158,6 +162,7 @@ describe('admin auth', () => {
158
162
  const headers = await createServiceAuthHeaders({
159
163
  iss: modServiceDid,
160
164
  aud: sc.dids.alice,
165
+ lxm: null,
161
166
  keypair: modServiceKey,
162
167
  })
163
168
  const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
@@ -29,6 +29,7 @@ describe('auth', () => {
29
29
  const jwt = await createServiceJwt({
30
30
  iss: issuer,
31
31
  aud: network.bsky.ctx.cfg.serverDid,
32
+ lxm: null,
32
33
  keypair,
33
34
  })
34
35
  return agent.api.app.bsky.actor.getProfile(
@@ -1,15 +0,0 @@
1
- /**
2
- * GENERATED CODE - DO NOT MODIFY
3
- */
4
- import { ValidationResult } from '@atproto/lexicon';
5
- export interface Record {
6
- /** Reference (AT-URI) to the post record. */
7
- post: string;
8
- /** List of detached post URIs. */
9
- targets: string[];
10
- updatedAt: string;
11
- [k: string]: unknown;
12
- }
13
- export declare function isRecord(v: unknown): v is Record;
14
- export declare function validateRecord(v: unknown): ValidationResult;
15
- //# sourceMappingURL=detach.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/feed/detach.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAK5D,MAAM,WAAW,MAAM;IACrB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,kCAAkC;IAClC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAOhD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAE3D"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateRecord = exports.isRecord = void 0;
4
- const lexicons_1 = require("../../../../lexicons");
5
- const util_1 = require("../../../../util");
6
- function isRecord(v) {
7
- return ((0, util_1.isObj)(v) &&
8
- (0, util_1.hasProp)(v, '$type') &&
9
- (v.$type === 'app.bsky.feed.detach#main' ||
10
- v.$type === 'app.bsky.feed.detach'));
11
- }
12
- exports.isRecord = isRecord;
13
- function validateRecord(v) {
14
- return lexicons_1.lexicons.validate('app.bsky.feed.detach#main', v);
15
- }
16
- exports.validateRecord = validateRecord;
17
- //# sourceMappingURL=detach.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detach.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/feed/detach.ts"],"names":[],"mappings":";;;AAIA,mDAA+C;AAC/C,2CAAiD;AAYjD,SAAgB,QAAQ,CAAC,CAAU;IACjC,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,CAAC,KAAK,KAAK,2BAA2B;YACtC,CAAC,CAAC,KAAK,KAAK,sBAAsB,CAAC,CACtC,CAAA;AACH,CAAC;AAPD,4BAOC;AAED,SAAgB,cAAc,CAAC,CAAU;IACvC,OAAO,mBAAQ,CAAC,QAAQ,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAA;AAC1D,CAAC;AAFD,wCAEC"}
@@ -1,29 +0,0 @@
1
- /**
2
- * GENERATED CODE - DO NOT MODIFY
3
- */
4
- import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
- import { lexicons } from '../../../../lexicons'
6
- import { isObj, hasProp } from '../../../../util'
7
- import { CID } from 'multiformats/cid'
8
-
9
- export interface Record {
10
- /** Reference (AT-URI) to the post record. */
11
- post: string
12
- /** List of detached post URIs. */
13
- targets: string[]
14
- updatedAt: string
15
- [k: string]: unknown
16
- }
17
-
18
- export function isRecord(v: unknown): v is Record {
19
- return (
20
- isObj(v) &&
21
- hasProp(v, '$type') &&
22
- (v.$type === 'app.bsky.feed.detach#main' ||
23
- v.$type === 'app.bsky.feed.detach')
24
- )
25
- }
26
-
27
- export function validateRecord(v: unknown): ValidationResult {
28
- return lexicons.validate('app.bsky.feed.detach#main', v)
29
- }