@atproto/api 0.20.23 → 0.20.26

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 (74) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/agent.d.ts +4 -0
  3. package/dist/agent.d.ts.map +1 -1
  4. package/dist/agent.js +17 -0
  5. package/dist/agent.js.map +1 -1
  6. package/dist/client/lexicons.d.ts +8 -0
  7. package/dist/client/lexicons.d.ts.map +1 -1
  8. package/dist/client/lexicons.js +4 -0
  9. package/dist/client/lexicons.js.map +1 -1
  10. package/dist/client/types/app/bsky/actor/defs.d.ts +2 -0
  11. package/dist/client/types/app/bsky/actor/defs.d.ts.map +1 -1
  12. package/dist/client/types/app/bsky/actor/defs.js.map +1 -1
  13. package/dist/rich-text/detection.d.ts.map +1 -1
  14. package/dist/rich-text/detection.js +4 -1
  15. package/dist/rich-text/detection.js.map +1 -1
  16. package/dist/types.d.ts +1 -0
  17. package/dist/types.d.ts.map +1 -1
  18. package/dist/types.js.map +1 -1
  19. package/package.json +22 -16
  20. package/definitions/labels.json +0 -170
  21. package/docs/moderation.md +0 -260
  22. package/jest.config.cjs +0 -23
  23. package/jest.d.ts +0 -20
  24. package/jest.setup.ts +0 -97
  25. package/scripts/code/labels.mjs +0 -77
  26. package/scripts/generate-code.mjs +0 -4
  27. package/src/age-assurance.test.ts +0 -218
  28. package/src/age-assurance.ts +0 -137
  29. package/src/agent.ts +0 -1645
  30. package/src/atp-agent.ts +0 -570
  31. package/src/bsky-agent.ts +0 -14
  32. package/src/const.ts +0 -1
  33. package/src/index.ts +0 -44
  34. package/src/mocker.ts +0 -220
  35. package/src/moderation/decision.ts +0 -389
  36. package/src/moderation/index.ts +0 -69
  37. package/src/moderation/mutewords.ts +0 -170
  38. package/src/moderation/subjects/account.ts +0 -44
  39. package/src/moderation/subjects/feed-generator.ts +0 -24
  40. package/src/moderation/subjects/notification.ts +0 -25
  41. package/src/moderation/subjects/post.ts +0 -433
  42. package/src/moderation/subjects/profile.ts +0 -26
  43. package/src/moderation/subjects/status.ts +0 -27
  44. package/src/moderation/subjects/user-list.ts +0 -48
  45. package/src/moderation/types.ts +0 -191
  46. package/src/moderation/ui.ts +0 -21
  47. package/src/moderation/util.ts +0 -111
  48. package/src/predicate.ts +0 -52
  49. package/src/rich-text/detection.ts +0 -146
  50. package/src/rich-text/rich-text.ts +0 -418
  51. package/src/rich-text/sanitization.ts +0 -42
  52. package/src/rich-text/unicode.ts +0 -47
  53. package/src/rich-text/util.ts +0 -15
  54. package/src/session-manager.ts +0 -5
  55. package/src/types.ts +0 -165
  56. package/src/util.ts +0 -96
  57. package/tests/atp-agent.test.ts +0 -3863
  58. package/tests/dispatcher.test.ts +0 -527
  59. package/tests/errors.test.ts +0 -29
  60. package/tests/moderation-behaviors.test.ts +0 -951
  61. package/tests/moderation-custom-labels.test.ts +0 -334
  62. package/tests/moderation-mutewords.test.ts +0 -1299
  63. package/tests/moderation-prefs.test.ts +0 -402
  64. package/tests/moderation-quoteposts.test.ts +0 -277
  65. package/tests/moderation.test.ts +0 -739
  66. package/tests/rich-text-detection.test.ts +0 -456
  67. package/tests/rich-text-sanitization.test.ts +0 -216
  68. package/tests/rich-text.test.ts +0 -705
  69. package/tests/util/echo-server.ts +0 -37
  70. package/tests/util/moderation-behavior.ts +0 -268
  71. package/tsconfig.build.json +0 -9
  72. package/tsconfig.build.tsbuildinfo +0 -1
  73. package/tsconfig.json +0 -7
  74. package/tsconfig.tests.json +0 -10
package/src/atp-agent.ts DELETED
@@ -1,570 +0,0 @@
1
- import { getPdsEndpoint, isValidDidDoc } from '@atproto/common-web'
2
- import {
3
- ErrorResponseBody,
4
- Gettable,
5
- ResponseType,
6
- XRPCError,
7
- XrpcClient,
8
- errorResponseBody,
9
- } from '@atproto/xrpc'
10
- import { Agent } from './agent.js'
11
- import {
12
- ComAtprotoServerCreateAccount,
13
- ComAtprotoServerCreateSession,
14
- ComAtprotoServerGetSession,
15
- ComAtprotoServerNS,
16
- ComAtprotoServerRefreshSession,
17
- } from './client/index.js'
18
- import { schemas } from './client/lexicons.js'
19
- import { SessionManager } from './session-manager.js'
20
- import {
21
- AtpAgentLoginOpts,
22
- AtpPersistSessionHandler,
23
- AtpSessionData,
24
- } from './types.js'
25
-
26
- const ReadableStream = globalThis.ReadableStream as
27
- | typeof globalThis.ReadableStream
28
- | undefined
29
-
30
- export type AtpAgentOptions = {
31
- service: string | URL
32
- persistSession?: AtpPersistSessionHandler
33
- fetch?: typeof globalThis.fetch
34
- headers?: Iterable<[string, Gettable<null | string>]>
35
- }
36
-
37
- /**
38
- * A wrapper around the {@link Agent} class that uses credential based session
39
- * management. This class also exposes most of the session management methods
40
- * directly.
41
- *
42
- * This class will be deprecated in the near future. Use {@link Agent} directly
43
- * with a {@link CredentialSession} instead:
44
- *
45
- * ```ts
46
- * const session = new CredentialSession({
47
- * service: new URL('https://example.com'),
48
- * })
49
- *
50
- * const agent = new Agent(session)
51
- * ```
52
- */
53
- export class AtpAgent extends Agent {
54
- readonly sessionManager: CredentialSession
55
-
56
- constructor(options: AtpAgentOptions | CredentialSession) {
57
- const sessionManager =
58
- options instanceof CredentialSession
59
- ? options
60
- : new CredentialSession(
61
- new URL(options.service),
62
- options.fetch,
63
- options.persistSession,
64
- )
65
-
66
- super(sessionManager)
67
-
68
- // This assignment is already being done in the super constructor, but we
69
- // need to do it here to make TypeScript happy.
70
- this.sessionManager = sessionManager
71
-
72
- if (!(options instanceof CredentialSession) && options.headers) {
73
- for (const [key, value] of options.headers) {
74
- this.setHeader(key, value)
75
- }
76
- }
77
- }
78
-
79
- clone(): AtpAgent {
80
- return this.copyInto(new AtpAgent(this.sessionManager))
81
- }
82
-
83
- get session() {
84
- return this.sessionManager.session
85
- }
86
-
87
- get hasSession() {
88
- return this.sessionManager.hasSession
89
- }
90
-
91
- get serviceUrl() {
92
- return this.sessionManager.serviceUrl
93
- }
94
-
95
- get pdsUrl() {
96
- return this.sessionManager.pdsUrl
97
- }
98
-
99
- get dispatchUrl() {
100
- return this.sessionManager.dispatchUrl
101
- }
102
-
103
- /** @deprecated use {@link serviceUrl} instead */
104
- get service() {
105
- return this.serviceUrl
106
- }
107
-
108
- get persistSession() {
109
- throw new Error(
110
- 'Cannot set persistSession directly. "persistSession" is defined through the constructor and will be invoked automatically when session data changes.',
111
- )
112
- }
113
-
114
- set persistSession(v: unknown) {
115
- throw new Error(
116
- 'Cannot set persistSession directly. "persistSession" must be defined in the constructor and can no longer be changed.',
117
- )
118
- }
119
-
120
- /** @deprecated use {@link AtpAgent.serviceUrl} instead */
121
- getServiceUrl() {
122
- return this.serviceUrl
123
- }
124
-
125
- async resumeSession(
126
- session: AtpSessionData,
127
- ): Promise<ComAtprotoServerGetSession.Response> {
128
- return this.sessionManager.resumeSession(session)
129
- }
130
-
131
- async createAccount(
132
- data: ComAtprotoServerCreateAccount.InputSchema,
133
- opts?: ComAtprotoServerCreateAccount.CallOptions,
134
- ): Promise<ComAtprotoServerCreateAccount.Response> {
135
- return this.sessionManager.createAccount(data, opts)
136
- }
137
-
138
- async login(
139
- opts: AtpAgentLoginOpts,
140
- ): Promise<ComAtprotoServerCreateSession.Response> {
141
- return this.sessionManager.login(opts)
142
- }
143
-
144
- async logout(): Promise<void> {
145
- return this.sessionManager.logout()
146
- }
147
- }
148
-
149
- /**
150
- * Credentials (username / password) based session manager. Instances of this
151
- * class will typically be used as the session manager for an {@link AtpAgent}.
152
- * They can also be used with an {@link XrpcClient}, if you want to use you
153
- * own Lexicons.
154
- */
155
- export class CredentialSession implements SessionManager {
156
- public pdsUrl?: URL // The PDS URL, driven by the did doc
157
- public session?: AtpSessionData
158
- public refreshSessionPromise?: Promise<ComAtprotoServerRefreshSession.Response>
159
-
160
- /**
161
- * Private {@link ComAtprotoServerNS} used to perform session management API
162
- * calls on the service endpoint. Calls performed by this agent will not be
163
- * authenticated using the user's session to allow proper manual configuration
164
- * of the headers when performing session management operations.
165
- */
166
- protected server = new ComAtprotoServerNS(
167
- // Note that the use of the codegen "schemas" (to instantiate `this.api`),
168
- // as well as the use of `ComAtprotoServerNS` will cause this class to
169
- // reference (way) more code than it actually needs. It is not possible,
170
- // with the current state of the codegen, to generate a client that only
171
- // includes the methods that are actually used by this class. This is a
172
- // known limitation that should be addressed in a future version of the
173
- // codegen.
174
- new XrpcClient((url, init) => {
175
- return (0, this.fetch)(new URL(url, this.serviceUrl), init)
176
- }, schemas),
177
- )
178
-
179
- constructor(
180
- public readonly serviceUrl: URL,
181
- public fetch = globalThis.fetch,
182
- protected readonly persistSession?: AtpPersistSessionHandler,
183
- ) {}
184
-
185
- get did() {
186
- return this.session?.did
187
- }
188
-
189
- get dispatchUrl() {
190
- return this.pdsUrl || this.serviceUrl
191
- }
192
-
193
- get hasSession() {
194
- return !!this.session
195
- }
196
-
197
- /**
198
- * Sets a WhatWG "fetch()" function to be used for making HTTP requests.
199
- */
200
- setFetch(fetch = globalThis.fetch) {
201
- this.fetch = fetch
202
- }
203
-
204
- async fetchHandler(url: string, init?: RequestInit): Promise<Response> {
205
- // wait for any active session-refreshes to finish
206
- await this.refreshSessionPromise
207
-
208
- const initialUri = new URL(url, this.dispatchUrl)
209
- const initialReq = new Request(initialUri, init)
210
-
211
- const initialToken = this.session?.accessJwt
212
- if (!initialToken || initialReq.headers.has('authorization')) {
213
- return (0, this.fetch)(initialReq)
214
- }
215
-
216
- initialReq.headers.set('authorization', `Bearer ${initialToken}`)
217
- const initialRes = await (0, this.fetch)(initialReq)
218
-
219
- if (!this.session?.refreshJwt) {
220
- return initialRes
221
- }
222
- const isExpiredToken =
223
- initialRes.status === 401 ||
224
- (await isErrorResponse(initialRes, [400], ['ExpiredToken']))
225
-
226
- if (!isExpiredToken) {
227
- return initialRes
228
- }
229
-
230
- try {
231
- await this.refreshSession()
232
- } catch {
233
- return initialRes
234
- }
235
-
236
- if (init?.signal?.aborted) {
237
- return initialRes
238
- }
239
-
240
- // The stream was already consumed. We cannot retry the request. A solution
241
- // would be to tee() the input stream but that would bufferize the entire
242
- // stream in memory which can lead to memory starvation. Instead, we will
243
- // return the original response and let the calling code handle retries.
244
- if (ReadableStream && init?.body instanceof ReadableStream) {
245
- return initialRes
246
- }
247
-
248
- // Return initial "ExpiredToken" response if the session was not refreshed.
249
- const updatedToken = this.session?.accessJwt
250
- if (!updatedToken || updatedToken === initialToken) {
251
- return initialRes
252
- }
253
-
254
- // Make sure the initial request is cancelled to avoid leaking resources
255
- // (NodeJS 👀): https://undici.nodejs.org/#/?id=garbage-collection
256
- await initialRes.body?.cancel()
257
-
258
- // We need to re-compute the URI in case the PDS endpoint has changed
259
- const updatedUri = new URL(url, this.dispatchUrl)
260
- const updatedReq = new Request(updatedUri, init)
261
-
262
- updatedReq.headers.set('authorization', `Bearer ${updatedToken}`)
263
-
264
- return await (0, this.fetch)(updatedReq)
265
- }
266
-
267
- /**
268
- * Create a new account and hydrate its session in this agent.
269
- */
270
- async createAccount(
271
- data: ComAtprotoServerCreateAccount.InputSchema,
272
- opts?: ComAtprotoServerCreateAccount.CallOptions,
273
- ): Promise<ComAtprotoServerCreateAccount.Response> {
274
- // Clear any existing session
275
- this.session = undefined
276
- this.refreshSessionPromise = undefined
277
-
278
- try {
279
- const res = await this.server.createAccount(data, opts)
280
- this.session = {
281
- accessJwt: res.data.accessJwt,
282
- refreshJwt: res.data.refreshJwt,
283
- handle: res.data.handle,
284
- did: res.data.did,
285
- email: data.email,
286
- emailConfirmed: false,
287
- emailAuthFactor: false,
288
- active: true,
289
- }
290
- this.persistSession?.('create', this.session)
291
- this._updateApiEndpoint(res.data.didDoc)
292
- return res
293
- } catch (e) {
294
- this.session = undefined
295
- this.persistSession?.('create-failed', undefined)
296
- throw e
297
- }
298
- }
299
-
300
- /**
301
- * Start a new session with this agent.
302
- */
303
- async login(
304
- opts: AtpAgentLoginOpts,
305
- ): Promise<ComAtprotoServerCreateSession.Response> {
306
- // Clear any existing session
307
- this.session = undefined
308
- this.refreshSessionPromise = undefined
309
-
310
- try {
311
- const res = await this.server.createSession({
312
- identifier: opts.identifier,
313
- password: opts.password,
314
- authFactorToken: opts.authFactorToken,
315
- allowTakendown: opts.allowTakendown,
316
- })
317
-
318
- if (this.session) {
319
- throw new Error('Concurrent login detected')
320
- }
321
-
322
- this.session = {
323
- accessJwt: res.data.accessJwt,
324
- refreshJwt: res.data.refreshJwt,
325
- handle: res.data.handle,
326
- did: res.data.did,
327
- email: res.data.email,
328
- emailConfirmed: res.data.emailConfirmed,
329
- emailAuthFactor: res.data.emailAuthFactor,
330
- active: res.data.active ?? true,
331
- status: res.data.status,
332
- }
333
- this._updateApiEndpoint(res.data.didDoc)
334
- this.persistSession?.('create', this.session)
335
- return res
336
- } catch (e) {
337
- this.session = undefined
338
- this.persistSession?.('create-failed', undefined)
339
- throw e
340
- }
341
- }
342
-
343
- async logout(): Promise<void> {
344
- if (this.session) {
345
- try {
346
- await this.server.deleteSession(undefined, {
347
- headers: {
348
- authorization: `Bearer ${this.session.refreshJwt}`,
349
- },
350
- })
351
- } catch {
352
- // Ignore errors
353
- } finally {
354
- this.session = undefined
355
- this.persistSession?.('expired', undefined)
356
- }
357
- }
358
- }
359
-
360
- /**
361
- * Resume a pre-existing session with this agent.
362
- *
363
- * @note that a rejected promise from this method indicates a failure to
364
- * refresh the session after resuming it but does not indicate a failure to
365
- * set the session itself. In case of rejection, check the presence of
366
- * {@link CredentialSession.session} after calling this method to ensure the
367
- * session was set.
368
- */
369
- async resumeSession(
370
- session: AtpSessionData,
371
- ): Promise<ComAtprotoServerRefreshSession.Response> {
372
- // Protect against multiple calls to resumeSession that would trigger a
373
- // refresh for the same session simultaneously.
374
- // Ideally, this check would be based on a session identifier, but since
375
- // we don't have one, we will just check the refresh token.
376
- if (session.refreshJwt !== this.session?.refreshJwt) {
377
- // Set the current session, and discard any pending refresh operation..
378
- this.session = session
379
- this.refreshSessionPromise = undefined
380
- }
381
-
382
- // Ensure that the session is still valid by forcing a refresh. This will
383
- // also ensure that persistSession handler is called.
384
- const result = await this.refreshSession()
385
-
386
- // Fool-proofing: another concurrent operation may have replaced the session
387
- // while we were waiting for the refresh to complete.
388
- if (session.did !== this.session?.did) {
389
- throw new Error('DID mismatch on resumeSession')
390
- }
391
-
392
- return result
393
- }
394
-
395
- /**
396
- * Internal helper to refresh sessions
397
- * - Wraps the actual implementation in a promise-guard to ensure only
398
- * one refresh is attempted at a time.
399
- */
400
- async refreshSession(): Promise<ComAtprotoServerRefreshSession.Response> {
401
- if (!this.session) {
402
- throw new Error('Unexpected state: no session to refresh')
403
- }
404
-
405
- // Do not refresh if we already have a refresh in progress
406
- if (this.refreshSessionPromise) return this.refreshSessionPromise
407
-
408
- const promise = this._refreshSessionInner().finally(() => {
409
- if (this.refreshSessionPromise === promise) {
410
- this.refreshSessionPromise = undefined
411
- }
412
- })
413
-
414
- this.refreshSessionPromise = promise
415
-
416
- return promise
417
- }
418
-
419
- /**
420
- * Internal helper to refresh sessions (actual behavior)
421
- */
422
- private async _refreshSessionInner(): Promise<ComAtprotoServerRefreshSession.Response> {
423
- const { session } = this
424
-
425
- // Should never happen
426
- if (!session) throw new Error('No session to refresh')
427
-
428
- try {
429
- const res = await this.server.refreshSession(undefined, {
430
- headers: { authorization: `Bearer ${session.refreshJwt}` },
431
- })
432
-
433
- const { data } = res
434
-
435
- // Something is very wrong if the DID changes during a refresh
436
- if (data.did !== session.did) {
437
- throw new XRPCError(
438
- ResponseType.InvalidRequest,
439
- 'Invalid session',
440
- 'InvalidDID',
441
- )
442
- }
443
-
444
- // Historically, refreshSession did not return all the fields from
445
- // getSession. In particular, email, emailConfirmed and emailAuthFactor
446
- // were missing. Similarly, some servers might not return the didDoc in
447
- // refreshSession. We fetch them via getSession if missing, allowing to
448
- // ensure that we are always talking with the right PDS.
449
- if (data.emailConfirmed == null || data.didDoc == null) {
450
- try {
451
- const res = await this.server.getSession(undefined, {
452
- headers: { authorization: `Bearer ${data.accessJwt}` },
453
- })
454
-
455
- // Fool proofing (should always match)
456
- if (res.data.did === data.did) {
457
- Object.assign(data, res.data)
458
- }
459
- } catch {
460
- // Noop, we'll keep the current values we have
461
- }
462
- }
463
-
464
- // protect against concurrent session updates
465
- if (this.session !== session) {
466
- return Promise.reject(new Error('Concurrent session update detected'))
467
- }
468
-
469
- // succeeded, update the session
470
- this.session = {
471
- did: data.did,
472
- accessJwt: data.accessJwt,
473
- refreshJwt: data.refreshJwt,
474
- handle: data.handle ?? session.handle,
475
- email: data.email ?? session.email,
476
- emailConfirmed: data.emailConfirmed ?? session.emailConfirmed,
477
- emailAuthFactor: data.emailAuthFactor ?? session.emailAuthFactor,
478
- active: data.active ?? session.active ?? true,
479
- status: data.status,
480
- }
481
-
482
- this._updateApiEndpoint(res.data.didDoc)
483
- this.persistSession?.('update', this.session)
484
-
485
- return res
486
- } catch (err) {
487
- // protect against concurrent session updates
488
- if (this.session === session) {
489
- if (
490
- err instanceof XRPCError &&
491
- (err.status === 401 ||
492
- err.error === 'InvalidDID' ||
493
- ['ExpiredToken', 'InvalidToken'].includes(err.error))
494
- ) {
495
- // failed due to a bad refresh token
496
- this.session = undefined
497
- this.persistSession?.('expired', undefined)
498
- } else {
499
- // Assume the problem is transient and the session can be reused later.
500
- this.session = session
501
- this.persistSession?.('network-error', session)
502
- }
503
- }
504
-
505
- throw err
506
- }
507
- }
508
-
509
- /**
510
- * Helper to update the pds endpoint dynamically.
511
- *
512
- * The session methods (create, resume, refresh) may respond with the user's
513
- * did document which contains the user's canonical PDS endpoint. That endpoint
514
- * may differ from the endpoint used to contact the server. We capture that
515
- * PDS endpoint and update the client to use that given endpoint for future
516
- * requests. (This helps ensure smooth migrations between PDSes, especially
517
- * when the PDSes are operated by a single org.)
518
- */
519
- private _updateApiEndpoint(didDoc: unknown) {
520
- const endpoint = isValidDidDoc(didDoc) ? getPdsEndpoint(didDoc) : undefined
521
- if (endpoint) {
522
- this.pdsUrl = new URL(endpoint)
523
- } else {
524
- // If the did doc is invalid (or missing), we clear the pdsUrl (should
525
- // never happen). This is fine if the auth server and PDS are the same
526
- // service, or if the auth server will proxy requests to the right PDS
527
- // (which is the case for Bluesky's "entryway").
528
- this.pdsUrl = undefined
529
- }
530
- }
531
- }
532
-
533
- function isErrorObject(v: unknown): v is ErrorResponseBody {
534
- return errorResponseBody.safeParse(v).success
535
- }
536
-
537
- async function isErrorResponse(
538
- response: Response,
539
- status: number[],
540
- errorNames: string[],
541
- ): Promise<boolean> {
542
- if (!status.includes(response.status)) return false
543
- // Some engines (react-native 👀) don't expose a response.body property...
544
- // if (!response.body) return false
545
- try {
546
- const json = await peekJson(response, 10 * 1024)
547
- return isErrorObject(json) && (errorNames as any[]).includes(json.error)
548
- } catch (err) {
549
- return false
550
- }
551
- }
552
-
553
- async function peekJson(
554
- response: Response,
555
- maxSize = Infinity,
556
- ): Promise<unknown> {
557
- if (extractType(response) !== 'application/json') throw new Error('Not JSON')
558
- if (extractLength(response) > maxSize) throw new Error('Response too large')
559
- return response.clone().json()
560
- }
561
-
562
- function extractLength({ headers }: Response) {
563
- return headers.get('Content-Length')
564
- ? Number(headers.get('Content-Length'))
565
- : NaN
566
- }
567
-
568
- function extractType({ headers }: Response) {
569
- return headers.get('Content-Type')?.split(';')[0]?.trim()
570
- }
package/src/bsky-agent.ts DELETED
@@ -1,14 +0,0 @@
1
- import { AtpAgent } from './atp-agent.js'
2
-
3
- /** @deprecated use {@link AtpAgent} instead */
4
- export class BskyAgent extends AtpAgent {
5
- clone(): this {
6
- if (this.constructor === BskyAgent) {
7
- const agent = new BskyAgent(this.sessionManager)
8
- return this.copyInto(agent as this)
9
- }
10
-
11
- // sub-classes should override this method
12
- throw new TypeError('Cannot clone a subclass of BskyAgent')
13
- }
14
- }
package/src/const.ts DELETED
@@ -1 +0,0 @@
1
- export const BSKY_LABELER_DID = 'did:plc:ar7c4by46qjdydhdevvrndac'
package/src/index.ts DELETED
@@ -1,44 +0,0 @@
1
- import { Lexicons } from '@atproto/lexicon'
2
- import { lexicons as internalLexicons } from './client/lexicons.js'
3
-
4
- export { AtUri } from '@atproto/syntax'
5
- export {
6
- BlobRef,
7
- jsonStringToLex,
8
- jsonToLex,
9
- lexToJson,
10
- stringifyLex,
11
- } from '@atproto/lexicon'
12
- export { parseLanguage } from '@atproto/common-web'
13
- export { XRPCError } from '@atproto/xrpc'
14
-
15
- export * from './types.js'
16
- export * from './const.js'
17
- export * from './util.js'
18
- export * from './client/index.js'
19
- export { ids, schemas } from './client/lexicons.js'
20
- export type { $Typed, Un$Typed } from './client/util.js'
21
- export { asPredicate } from './client/util.js'
22
- export * from './rich-text/rich-text.js'
23
- export * from './rich-text/sanitization.js'
24
- export * from './rich-text/unicode.js'
25
- export * from './rich-text/util.js'
26
- export * from './moderation/index.js'
27
- export * from './moderation/types.js'
28
- export * from './mocker.js'
29
- export * from './age-assurance.js'
30
- export { DEFAULT_LABEL_SETTINGS, LABELS } from './moderation/const/labels.js'
31
- export { Agent } from './agent.js'
32
-
33
- export { AtpAgent, type AtpAgentOptions } from './atp-agent.js'
34
- export { CredentialSession } from './atp-agent.js'
35
- export { BskyAgent } from './bsky-agent.js'
36
-
37
- export {
38
- /** @deprecated */
39
- AtpAgent as default,
40
- } from './atp-agent.js'
41
-
42
- // Expose a copy to prevent alteration of the internal Lexicon instance used by
43
- // the AtpBaseClient class.
44
- export const lexicons = new Lexicons(internalLexicons)