@atproto/api 0.6.18 → 0.6.19

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.
@@ -90,7 +90,7 @@ export function detectFacets(text: UnicodeString): Facet[] | undefined {
90
90
  features: [
91
91
  {
92
92
  $type: 'app.bsky.richtext.facet#tag',
93
- tag,
93
+ tag: tag.replace(/^#/, ''),
94
94
  },
95
95
  ],
96
96
  })
@@ -216,28 +216,28 @@ describe('detectFacets', () => {
216
216
  string[],
217
217
  { byteStart: number; byteEnd: number }[],
218
218
  ][] = [
219
- ['#a', ['#a'], [{ byteStart: 0, byteEnd: 2 }]],
219
+ ['#a', ['a'], [{ byteStart: 0, byteEnd: 2 }]],
220
220
  [
221
221
  '#a #b',
222
- ['#a', '#b'],
222
+ ['a', 'b'],
223
223
  [
224
224
  { byteStart: 0, byteEnd: 2 },
225
225
  { byteStart: 3, byteEnd: 5 },
226
226
  ],
227
227
  ],
228
228
  ['#1', [], []],
229
- ['#tag', ['#tag'], [{ byteStart: 0, byteEnd: 4 }]],
230
- ['body #tag', ['#tag'], [{ byteStart: 5, byteEnd: 9 }]],
231
- ['#tag body', ['#tag'], [{ byteStart: 0, byteEnd: 4 }]],
232
- ['body #tag body', ['#tag'], [{ byteStart: 5, byteEnd: 9 }]],
229
+ ['#tag', ['tag'], [{ byteStart: 0, byteEnd: 4 }]],
230
+ ['body #tag', ['tag'], [{ byteStart: 5, byteEnd: 9 }]],
231
+ ['#tag body', ['tag'], [{ byteStart: 0, byteEnd: 4 }]],
232
+ ['body #tag body', ['tag'], [{ byteStart: 5, byteEnd: 9 }]],
233
233
  ['body #1', [], []],
234
- ['body #a1', ['#a1'], [{ byteStart: 5, byteEnd: 8 }]],
234
+ ['body #a1', ['a1'], [{ byteStart: 5, byteEnd: 8 }]],
235
235
  ['#', [], []],
236
236
  ['text #', [], []],
237
237
  ['text # text', [], []],
238
238
  [
239
239
  'body #thisisa64characterstring_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
240
- ['#thisisa64characterstring_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'],
240
+ ['thisisa64characterstring_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'],
241
241
  [{ byteStart: 5, byteEnd: 71 }],
242
242
  ],
243
243
  [
@@ -247,19 +247,19 @@ describe('detectFacets', () => {
247
247
  ],
248
248
  [
249
249
  'its a #double#rainbow',
250
- ['#double#rainbow'],
250
+ ['double#rainbow'],
251
251
  [{ byteStart: 6, byteEnd: 21 }],
252
252
  ],
253
- ['##hashash', ['##hashash'], [{ byteStart: 0, byteEnd: 9 }]],
254
- ['some #n0n3s@n5e!', ['#n0n3s@n5e'], [{ byteStart: 5, byteEnd: 15 }]],
253
+ ['##hashash', ['#hashash'], [{ byteStart: 0, byteEnd: 9 }]],
254
+ ['some #n0n3s@n5e!', ['n0n3s@n5e'], [{ byteStart: 5, byteEnd: 15 }]],
255
255
  [
256
256
  'works #with,punctuation',
257
- ['#with,punctuation'],
257
+ ['with,punctuation'],
258
258
  [{ byteStart: 6, byteEnd: 23 }],
259
259
  ],
260
260
  [
261
261
  'strips trailing #punctuation, #like. #this!',
262
- ['#punctuation', '#like', '#this'],
262
+ ['punctuation', 'like', 'this'],
263
263
  [
264
264
  { byteStart: 16, byteEnd: 28 },
265
265
  { byteStart: 30, byteEnd: 35 },
@@ -268,12 +268,12 @@ describe('detectFacets', () => {
268
268
  ],
269
269
  [
270
270
  'strips #multi_trailing___...',
271
- ['#multi_trailing'],
271
+ ['multi_trailing'],
272
272
  [{ byteStart: 7, byteEnd: 22 }],
273
273
  ],
274
274
  [
275
275
  'works with #🦋 emoji, and #butter🦋fly',
276
- ['#🦋', '#butter🦋fly'],
276
+ ['🦋', 'butter🦋fly'],
277
277
  [
278
278
  { byteStart: 11, byteEnd: 16 },
279
279
  { byteStart: 28, byteEnd: 42 },
@@ -281,7 +281,7 @@ describe('detectFacets', () => {
281
281
  ],
282
282
  [
283
283
  '#same #same #but #diff',
284
- ['#same', '#same', '#but', '#diff'],
284
+ ['same', 'same', 'but', 'diff'],
285
285
  [
286
286
  { byteStart: 0, byteEnd: 5 },
287
287
  { byteStart: 6, byteEnd: 11 },
@@ -298,7 +298,7 @@ describe('detectFacets', () => {
298
298
  let detectedTags: string[] = []
299
299
  let detectedIndices: { byteStart: number; byteEnd: number }[] = []
300
300
 
301
- for (const { facet } of rt.segments()) {
301
+ for (const { facet, ...rest } of rt.segments()) {
302
302
  if (!facet) continue
303
303
  for (const feature of facet.features) {
304
304
  if (isTag(feature)) {
@@ -1,18 +0,0 @@
1
- import { Headers } from '@atproto/xrpc';
2
- import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
3
- export interface QueryParams {
4
- }
5
- export interface InputSchema {
6
- labels: ComAtprotoLabelDefs.Label[];
7
- [k: string]: unknown;
8
- }
9
- export interface CallOptions {
10
- headers?: Headers;
11
- qp?: QueryParams;
12
- encoding: 'application/json';
13
- }
14
- export interface Response {
15
- success: boolean;
16
- headers: Headers;
17
- }
18
- export declare function toKnownErr(e: any): any;
@@ -1,33 +0,0 @@
1
- /**
2
- * GENERATED CODE - DO NOT MODIFY
3
- */
4
- import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
- import { isObj, hasProp } from '../../../../util'
7
- import { lexicons } from '../../../../lexicons'
8
- import { CID } from 'multiformats/cid'
9
- import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
10
-
11
- export interface QueryParams {}
12
-
13
- export interface InputSchema {
14
- labels: ComAtprotoLabelDefs.Label[]
15
- [k: string]: unknown
16
- }
17
-
18
- export interface CallOptions {
19
- headers?: Headers
20
- qp?: QueryParams
21
- encoding: 'application/json'
22
- }
23
-
24
- export interface Response {
25
- success: boolean
26
- headers: Headers
27
- }
28
-
29
- export function toKnownErr(e: any) {
30
- if (e instanceof XRPCError) {
31
- }
32
- return e
33
- }