@atproto/bsky 0.0.197 → 0.0.198

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 (44) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/lexicon/index.d.ts +11 -0
  3. package/dist/lexicon/index.d.ts.map +1 -1
  4. package/dist/lexicon/index.js +32 -1
  5. package/dist/lexicon/index.js.map +1 -1
  6. package/dist/lexicon/lexicons.d.ts +700 -0
  7. package/dist/lexicon/lexicons.d.ts.map +1 -1
  8. package/dist/lexicon/lexicons.js +367 -0
  9. package/dist/lexicon/lexicons.js.map +1 -1
  10. package/dist/lexicon/types/app/bsky/ageassurance/begin.d.ts +31 -0
  11. package/dist/lexicon/types/app/bsky/ageassurance/begin.d.ts.map +1 -0
  12. package/dist/lexicon/types/app/bsky/ageassurance/begin.js +7 -0
  13. package/dist/lexicon/types/app/bsky/ageassurance/begin.js.map +1 -0
  14. package/dist/lexicon/types/app/bsky/ageassurance/defs.d.ts +138 -0
  15. package/dist/lexicon/types/app/bsky/ageassurance/defs.d.ts.map +1 -0
  16. package/dist/lexicon/types/app/bsky/ageassurance/defs.js +115 -0
  17. package/dist/lexicon/types/app/bsky/ageassurance/defs.js.map +1 -0
  18. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.d.ts +18 -0
  19. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.d.ts.map +1 -0
  20. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.js +7 -0
  21. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.js.map +1 -0
  22. package/dist/lexicon/types/app/bsky/ageassurance/getState.d.ts +24 -0
  23. package/dist/lexicon/types/app/bsky/ageassurance/getState.d.ts.map +1 -0
  24. package/dist/lexicon/types/app/bsky/ageassurance/getState.js +7 -0
  25. package/dist/lexicon/types/app/bsky/ageassurance/getState.js.map +1 -0
  26. package/dist/stash.d.ts.map +1 -1
  27. package/dist/stash.js +1 -0
  28. package/dist/stash.js.map +1 -1
  29. package/package.json +14 -14
  30. package/src/lexicon/index.ts +49 -0
  31. package/src/lexicon/lexicons.ts +392 -0
  32. package/src/lexicon/types/app/bsky/ageassurance/begin.ts +54 -0
  33. package/src/lexicon/types/app/bsky/ageassurance/defs.ts +301 -0
  34. package/src/lexicon/types/app/bsky/ageassurance/getConfig.ts +34 -0
  35. package/src/lexicon/types/app/bsky/ageassurance/getState.ts +42 -0
  36. package/src/stash.ts +2 -0
  37. package/tests/blob-resolver.test.ts +2 -0
  38. package/tests/data-plane/duplicate-records.test.ts +2 -0
  39. package/tests/data-plane/indexing.test.ts +2 -0
  40. package/tests/data-plane/subscription.test.ts +2 -0
  41. package/tests/image/server.test.ts +2 -0
  42. package/tests/image/uri.test.ts +2 -0
  43. package/tests/views/posts.test.ts +96 -0
  44. package/tsconfig.build.tsbuildinfo +1 -1
@@ -1196,6 +1196,394 @@ export const schemaDict = {
1196
1196
  },
1197
1197
  },
1198
1198
  },
1199
+ AppBskyAgeassuranceBegin: {
1200
+ lexicon: 1,
1201
+ id: 'app.bsky.ageassurance.begin',
1202
+ defs: {
1203
+ main: {
1204
+ type: 'procedure',
1205
+ description: 'Initiate Age Assurance for an account.',
1206
+ input: {
1207
+ encoding: 'application/json',
1208
+ schema: {
1209
+ type: 'object',
1210
+ required: ['email', 'language', 'countryCode'],
1211
+ properties: {
1212
+ email: {
1213
+ type: 'string',
1214
+ description:
1215
+ "The user's email address to receive Age Assurance instructions.",
1216
+ },
1217
+ language: {
1218
+ type: 'string',
1219
+ description:
1220
+ "The user's preferred language for communication during the Age Assurance process.",
1221
+ },
1222
+ countryCode: {
1223
+ type: 'string',
1224
+ description:
1225
+ "An ISO 3166-1 alpha-2 code of the user's location.",
1226
+ },
1227
+ regionCode: {
1228
+ type: 'string',
1229
+ description:
1230
+ "An optional ISO 3166-2 code of the user's region or state within the country.",
1231
+ },
1232
+ },
1233
+ },
1234
+ },
1235
+ output: {
1236
+ encoding: 'application/json',
1237
+ schema: {
1238
+ type: 'ref',
1239
+ ref: 'lex:app.bsky.ageassurance.defs#state',
1240
+ },
1241
+ },
1242
+ errors: [
1243
+ {
1244
+ name: 'InvalidEmail',
1245
+ },
1246
+ {
1247
+ name: 'DidTooLong',
1248
+ },
1249
+ {
1250
+ name: 'InvalidInitiation',
1251
+ },
1252
+ {
1253
+ name: 'RegionNotSupported',
1254
+ },
1255
+ ],
1256
+ },
1257
+ },
1258
+ },
1259
+ AppBskyAgeassuranceDefs: {
1260
+ lexicon: 1,
1261
+ id: 'app.bsky.ageassurance.defs',
1262
+ defs: {
1263
+ access: {
1264
+ description:
1265
+ "The access level granted based on Age Assurance data we've processed.",
1266
+ type: 'string',
1267
+ knownValues: ['unknown', 'none', 'safe', 'full'],
1268
+ },
1269
+ status: {
1270
+ type: 'string',
1271
+ description: 'The status of the Age Assurance process.',
1272
+ knownValues: ['unknown', 'pending', 'assured', 'blocked'],
1273
+ },
1274
+ state: {
1275
+ type: 'object',
1276
+ description: "The user's computed Age Assurance state.",
1277
+ required: ['status', 'access'],
1278
+ properties: {
1279
+ lastInitiatedAt: {
1280
+ type: 'string',
1281
+ format: 'datetime',
1282
+ description: 'The timestamp when this state was last updated.',
1283
+ },
1284
+ status: {
1285
+ type: 'ref',
1286
+ ref: 'lex:app.bsky.ageassurance.defs#status',
1287
+ },
1288
+ access: {
1289
+ type: 'ref',
1290
+ ref: 'lex:app.bsky.ageassurance.defs#access',
1291
+ },
1292
+ },
1293
+ },
1294
+ stateMetadata: {
1295
+ type: 'object',
1296
+ description:
1297
+ 'Additional metadata needed to compute Age Assurance state client-side.',
1298
+ required: [],
1299
+ properties: {
1300
+ accountCreatedAt: {
1301
+ type: 'string',
1302
+ format: 'datetime',
1303
+ description: 'The account creation timestamp.',
1304
+ },
1305
+ },
1306
+ },
1307
+ config: {
1308
+ type: 'object',
1309
+ description: '',
1310
+ required: ['regions'],
1311
+ properties: {
1312
+ regions: {
1313
+ type: 'array',
1314
+ description: 'The per-region Age Assurance configuration.',
1315
+ items: {
1316
+ type: 'ref',
1317
+ ref: 'lex:app.bsky.ageassurance.defs#configRegion',
1318
+ },
1319
+ },
1320
+ },
1321
+ },
1322
+ configRegion: {
1323
+ type: 'object',
1324
+ description: 'The Age Assurance configuration for a specific region.',
1325
+ required: ['countryCode', 'rules'],
1326
+ properties: {
1327
+ countryCode: {
1328
+ type: 'string',
1329
+ description:
1330
+ 'The ISO 3166-1 alpha-2 country code this configuration applies to.',
1331
+ },
1332
+ regionCode: {
1333
+ type: 'string',
1334
+ description:
1335
+ 'The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country.',
1336
+ },
1337
+ rules: {
1338
+ type: 'array',
1339
+ description:
1340
+ 'The ordered list of Age Assurance rules that apply to this region. Rules should be applied in order, and the first matching rule determines the access level granted. The rules array should always include a default rule as the last item.',
1341
+ items: {
1342
+ type: 'union',
1343
+ refs: [
1344
+ 'lex:app.bsky.ageassurance.defs#configRegionRuleDefault',
1345
+ 'lex:app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge',
1346
+ 'lex:app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge',
1347
+ 'lex:app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge',
1348
+ 'lex:app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge',
1349
+ 'lex:app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan',
1350
+ 'lex:app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan',
1351
+ ],
1352
+ },
1353
+ },
1354
+ },
1355
+ },
1356
+ configRegionRuleDefault: {
1357
+ type: 'object',
1358
+ description: 'Age Assurance rule that applies by default.',
1359
+ required: ['access'],
1360
+ properties: {
1361
+ access: {
1362
+ type: 'ref',
1363
+ ref: 'lex:app.bsky.ageassurance.defs#access',
1364
+ },
1365
+ },
1366
+ },
1367
+ configRegionRuleIfDeclaredOverAge: {
1368
+ type: 'object',
1369
+ description:
1370
+ 'Age Assurance rule that applies if the user has declared themselves equal-to or over a certain age.',
1371
+ required: ['age', 'access'],
1372
+ properties: {
1373
+ age: {
1374
+ type: 'integer',
1375
+ description: 'The age threshold as a whole integer.',
1376
+ },
1377
+ access: {
1378
+ type: 'ref',
1379
+ ref: 'lex:app.bsky.ageassurance.defs#access',
1380
+ },
1381
+ },
1382
+ },
1383
+ configRegionRuleIfDeclaredUnderAge: {
1384
+ type: 'object',
1385
+ description:
1386
+ 'Age Assurance rule that applies if the user has declared themselves under a certain age.',
1387
+ required: ['age', 'access'],
1388
+ properties: {
1389
+ age: {
1390
+ type: 'integer',
1391
+ description: 'The age threshold as a whole integer.',
1392
+ },
1393
+ access: {
1394
+ type: 'ref',
1395
+ ref: 'lex:app.bsky.ageassurance.defs#access',
1396
+ },
1397
+ },
1398
+ },
1399
+ configRegionRuleIfAssuredOverAge: {
1400
+ type: 'object',
1401
+ description:
1402
+ 'Age Assurance rule that applies if the user has been assured to be equal-to or over a certain age.',
1403
+ required: ['age', 'access'],
1404
+ properties: {
1405
+ age: {
1406
+ type: 'integer',
1407
+ description: 'The age threshold as a whole integer.',
1408
+ },
1409
+ access: {
1410
+ type: 'ref',
1411
+ ref: 'lex:app.bsky.ageassurance.defs#access',
1412
+ },
1413
+ },
1414
+ },
1415
+ configRegionRuleIfAssuredUnderAge: {
1416
+ type: 'object',
1417
+ description:
1418
+ 'Age Assurance rule that applies if the user has been assured to be under a certain age.',
1419
+ required: ['age', 'access'],
1420
+ properties: {
1421
+ age: {
1422
+ type: 'integer',
1423
+ description: 'The age threshold as a whole integer.',
1424
+ },
1425
+ access: {
1426
+ type: 'ref',
1427
+ ref: 'lex:app.bsky.ageassurance.defs#access',
1428
+ },
1429
+ },
1430
+ },
1431
+ configRegionRuleIfAccountNewerThan: {
1432
+ type: 'object',
1433
+ description:
1434
+ 'Age Assurance rule that applies if the account is equal-to or newer than a certain date.',
1435
+ required: ['date', 'access'],
1436
+ properties: {
1437
+ date: {
1438
+ type: 'string',
1439
+ format: 'datetime',
1440
+ description: 'The date threshold as a datetime string.',
1441
+ },
1442
+ access: {
1443
+ type: 'ref',
1444
+ ref: 'lex:app.bsky.ageassurance.defs#access',
1445
+ },
1446
+ },
1447
+ },
1448
+ configRegionRuleIfAccountOlderThan: {
1449
+ type: 'object',
1450
+ description:
1451
+ 'Age Assurance rule that applies if the account is older than a certain date.',
1452
+ required: ['date', 'access'],
1453
+ properties: {
1454
+ date: {
1455
+ type: 'string',
1456
+ format: 'datetime',
1457
+ description: 'The date threshold as a datetime string.',
1458
+ },
1459
+ access: {
1460
+ type: 'ref',
1461
+ ref: 'lex:app.bsky.ageassurance.defs#access',
1462
+ },
1463
+ },
1464
+ },
1465
+ event: {
1466
+ type: 'object',
1467
+ description: 'Object used to store Age Assurance data in stash.',
1468
+ required: ['createdAt', 'status', 'access', 'attemptId', 'countryCode'],
1469
+ properties: {
1470
+ createdAt: {
1471
+ type: 'string',
1472
+ format: 'datetime',
1473
+ description: 'The date and time of this write operation.',
1474
+ },
1475
+ attemptId: {
1476
+ type: 'string',
1477
+ description:
1478
+ 'The unique identifier for this instance of the Age Assurance flow, in UUID format.',
1479
+ },
1480
+ status: {
1481
+ type: 'string',
1482
+ description: 'The status of the Age Assurance process.',
1483
+ knownValues: ['unknown', 'pending', 'assured', 'blocked'],
1484
+ },
1485
+ access: {
1486
+ description:
1487
+ "The access level granted based on Age Assurance data we've processed.",
1488
+ type: 'string',
1489
+ knownValues: ['unknown', 'none', 'safe', 'full'],
1490
+ },
1491
+ countryCode: {
1492
+ type: 'string',
1493
+ description:
1494
+ 'The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow.',
1495
+ },
1496
+ regionCode: {
1497
+ type: 'string',
1498
+ description:
1499
+ 'The ISO 3166-2 region code provided when beginning the Age Assurance flow.',
1500
+ },
1501
+ email: {
1502
+ type: 'string',
1503
+ description: 'The email used for Age Assurance.',
1504
+ },
1505
+ initIp: {
1506
+ type: 'string',
1507
+ description:
1508
+ 'The IP address used when initiating the Age Assurance flow.',
1509
+ },
1510
+ initUa: {
1511
+ type: 'string',
1512
+ description:
1513
+ 'The user agent used when initiating the Age Assurance flow.',
1514
+ },
1515
+ completeIp: {
1516
+ type: 'string',
1517
+ description:
1518
+ 'The IP address used when completing the Age Assurance flow.',
1519
+ },
1520
+ completeUa: {
1521
+ type: 'string',
1522
+ description:
1523
+ 'The user agent used when completing the Age Assurance flow.',
1524
+ },
1525
+ },
1526
+ },
1527
+ },
1528
+ },
1529
+ AppBskyAgeassuranceGetConfig: {
1530
+ lexicon: 1,
1531
+ id: 'app.bsky.ageassurance.getConfig',
1532
+ defs: {
1533
+ main: {
1534
+ type: 'query',
1535
+ description:
1536
+ 'Returns Age Assurance configuration for use on the client.',
1537
+ output: {
1538
+ encoding: 'application/json',
1539
+ schema: {
1540
+ type: 'ref',
1541
+ ref: 'lex:app.bsky.ageassurance.defs#config',
1542
+ },
1543
+ },
1544
+ },
1545
+ },
1546
+ },
1547
+ AppBskyAgeassuranceGetState: {
1548
+ lexicon: 1,
1549
+ id: 'app.bsky.ageassurance.getState',
1550
+ defs: {
1551
+ main: {
1552
+ type: 'query',
1553
+ description:
1554
+ 'Returns server-computed Age Assurance state, if available, and any additional metadata needed to compute Age Assurance state client-side.',
1555
+ parameters: {
1556
+ type: 'params',
1557
+ required: ['countryCode'],
1558
+ properties: {
1559
+ countryCode: {
1560
+ type: 'string',
1561
+ },
1562
+ regionCode: {
1563
+ type: 'string',
1564
+ },
1565
+ },
1566
+ },
1567
+ output: {
1568
+ encoding: 'application/json',
1569
+ schema: {
1570
+ type: 'object',
1571
+ required: ['state', 'metadata'],
1572
+ properties: {
1573
+ state: {
1574
+ type: 'ref',
1575
+ ref: 'lex:app.bsky.ageassurance.defs#state',
1576
+ },
1577
+ metadata: {
1578
+ type: 'ref',
1579
+ ref: 'lex:app.bsky.ageassurance.defs#stateMetadata',
1580
+ },
1581
+ },
1582
+ },
1583
+ },
1584
+ },
1585
+ },
1586
+ },
1199
1587
  AppBskyBookmarkCreateBookmark: {
1200
1588
  lexicon: 1,
1201
1589
  id: 'app.bsky.bookmark.createBookmark',
@@ -14025,6 +14413,10 @@ export const ids = {
14025
14413
  AppBskyActorSearchActors: 'app.bsky.actor.searchActors',
14026
14414
  AppBskyActorSearchActorsTypeahead: 'app.bsky.actor.searchActorsTypeahead',
14027
14415
  AppBskyActorStatus: 'app.bsky.actor.status',
14416
+ AppBskyAgeassuranceBegin: 'app.bsky.ageassurance.begin',
14417
+ AppBskyAgeassuranceDefs: 'app.bsky.ageassurance.defs',
14418
+ AppBskyAgeassuranceGetConfig: 'app.bsky.ageassurance.getConfig',
14419
+ AppBskyAgeassuranceGetState: 'app.bsky.ageassurance.getState',
14028
14420
  AppBskyBookmarkCreateBookmark: 'app.bsky.bookmark.createBookmark',
14029
14421
  AppBskyBookmarkDefs: 'app.bsky.bookmark.defs',
14030
14422
  AppBskyBookmarkDeleteBookmark: 'app.bsky.bookmark.deleteBookmark',
@@ -0,0 +1,54 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { CID } from 'multiformats/cid'
6
+ import { validate as _validate } from '../../../../lexicons'
7
+ import {
8
+ type $Typed,
9
+ is$typed as _is$typed,
10
+ type OmitKey,
11
+ } from '../../../../util'
12
+ import type * as AppBskyAgeassuranceDefs from './defs.js'
13
+
14
+ const is$typed = _is$typed,
15
+ validate = _validate
16
+ const id = 'app.bsky.ageassurance.begin'
17
+
18
+ export type QueryParams = {}
19
+
20
+ export interface InputSchema {
21
+ /** The user's email address to receive Age Assurance instructions. */
22
+ email: string
23
+ /** The user's preferred language for communication during the Age Assurance process. */
24
+ language: string
25
+ /** An ISO 3166-1 alpha-2 code of the user's location. */
26
+ countryCode: string
27
+ /** An optional ISO 3166-2 code of the user's region or state within the country. */
28
+ regionCode?: string
29
+ }
30
+
31
+ export type OutputSchema = AppBskyAgeassuranceDefs.State
32
+
33
+ export interface HandlerInput {
34
+ encoding: 'application/json'
35
+ body: InputSchema
36
+ }
37
+
38
+ export interface HandlerSuccess {
39
+ encoding: 'application/json'
40
+ body: OutputSchema
41
+ headers?: { [key: string]: string }
42
+ }
43
+
44
+ export interface HandlerError {
45
+ status: number
46
+ message?: string
47
+ error?:
48
+ | 'InvalidEmail'
49
+ | 'DidTooLong'
50
+ | 'InvalidInitiation'
51
+ | 'RegionNotSupported'
52
+ }
53
+
54
+ export type HandlerOutput = HandlerError | HandlerSuccess