@atcute/client 2.0.7 → 2.0.8
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.
- package/dist/lexicons.d.ts +59 -19
- package/lib/lexicons.ts +81 -19
- package/package.json +3 -3
package/dist/lexicons.d.ts
CHANGED
|
@@ -512,7 +512,7 @@ export declare namespace ComAtprotoRepoApplyWrites {
|
|
|
512
512
|
[Brand.Type]?: 'com.atproto.repo.applyWrites#create';
|
|
513
513
|
collection: string;
|
|
514
514
|
value: unknown;
|
|
515
|
-
/**
|
|
515
|
+
/** NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility. */
|
|
516
516
|
rkey?: string;
|
|
517
517
|
}
|
|
518
518
|
interface CreateResult {
|
|
@@ -555,10 +555,7 @@ export declare namespace ComAtprotoRepoCreateRecord {
|
|
|
555
555
|
record: unknown;
|
|
556
556
|
/** The handle or DID of the repo (aka, current account). */
|
|
557
557
|
repo: string;
|
|
558
|
-
/**
|
|
559
|
-
* The Record Key. \
|
|
560
|
-
* Maximum string length: 512
|
|
561
|
-
*/
|
|
558
|
+
/** The Record Key. */
|
|
562
559
|
rkey?: string;
|
|
563
560
|
/** Compare and swap with the previous commit by CID. */
|
|
564
561
|
swapCommit?: At.CID;
|
|
@@ -725,10 +722,7 @@ export declare namespace ComAtprotoRepoPutRecord {
|
|
|
725
722
|
record: unknown;
|
|
726
723
|
/** The handle or DID of the repo (aka, current account). */
|
|
727
724
|
repo: string;
|
|
728
|
-
/**
|
|
729
|
-
* The Record Key. \
|
|
730
|
-
* Maximum string length: 512
|
|
731
|
-
*/
|
|
725
|
+
/** The Record Key. */
|
|
732
726
|
rkey: string;
|
|
733
727
|
/** Compare and swap with the previous commit by CID. */
|
|
734
728
|
swapCommit?: At.CID;
|
|
@@ -1315,7 +1309,7 @@ export declare namespace ComAtprotoSyncGetRepoStatus {
|
|
|
1315
1309
|
/** Optional field, the current rev of the repo, if active=true */
|
|
1316
1310
|
rev?: string;
|
|
1317
1311
|
/** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
|
|
1318
|
-
status?: 'deactivated' | 'suspended' | 'takendown' | (string & {});
|
|
1312
|
+
status?: 'deactivated' | 'deleted' | 'desynchronized' | 'suspended' | 'takendown' | 'throttled' | (string & {});
|
|
1319
1313
|
}
|
|
1320
1314
|
interface Errors {
|
|
1321
1315
|
RepoNotFound: {};
|
|
@@ -1372,7 +1366,30 @@ export declare namespace ComAtprotoSyncListRepos {
|
|
|
1372
1366
|
rev: string;
|
|
1373
1367
|
active?: boolean;
|
|
1374
1368
|
/** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
|
|
1375
|
-
status?: 'deactivated' | 'suspended' | 'takendown' | (string & {});
|
|
1369
|
+
status?: 'deactivated' | 'deleted' | 'desynchronized' | 'suspended' | 'takendown' | 'throttled' | (string & {});
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
/** Enumerates all the DIDs which have records with the given collection NSID. */
|
|
1373
|
+
export declare namespace ComAtprotoSyncListReposByCollection {
|
|
1374
|
+
interface Params {
|
|
1375
|
+
collection: string;
|
|
1376
|
+
cursor?: string;
|
|
1377
|
+
/**
|
|
1378
|
+
* Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists. \
|
|
1379
|
+
* Minimum: 1 \
|
|
1380
|
+
* Maximum: 2000
|
|
1381
|
+
* @default 500
|
|
1382
|
+
*/
|
|
1383
|
+
limit?: number;
|
|
1384
|
+
}
|
|
1385
|
+
type Input = undefined;
|
|
1386
|
+
interface Output {
|
|
1387
|
+
repos: Repo[];
|
|
1388
|
+
cursor?: string;
|
|
1389
|
+
}
|
|
1390
|
+
interface Repo {
|
|
1391
|
+
[Brand.Type]?: 'com.atproto.sync.listReposByCollection#repo';
|
|
1392
|
+
did: At.DID;
|
|
1376
1393
|
}
|
|
1377
1394
|
}
|
|
1378
1395
|
/** Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay. */
|
|
@@ -1405,14 +1422,17 @@ export declare namespace ComAtprotoSyncSubscribeRepos {
|
|
|
1405
1422
|
seq: number;
|
|
1406
1423
|
time: string;
|
|
1407
1424
|
/** If active=false, this optional field indicates a reason for why the account is not active. */
|
|
1408
|
-
status?: 'deactivated' | 'deleted' | 'suspended' | 'takendown' | (string & {});
|
|
1425
|
+
status?: 'deactivated' | 'deleted' | 'desynchronized' | 'suspended' | 'takendown' | 'throttled' | (string & {});
|
|
1409
1426
|
}
|
|
1410
1427
|
/** Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. */
|
|
1411
1428
|
interface Commit {
|
|
1412
1429
|
[Brand.Type]?: 'com.atproto.sync.subscribeRepos#commit';
|
|
1413
|
-
/**
|
|
1430
|
+
/**
|
|
1431
|
+
* DEPRECATED -- will soon always be empty. List of new blobs (by CID) referenced by records in this commit.
|
|
1432
|
+
* @deprecated
|
|
1433
|
+
*/
|
|
1414
1434
|
blobs: At.CIDLink[];
|
|
1415
|
-
/** CAR file containing relevant blocks, as a diff since the previous repo state. */
|
|
1435
|
+
/** CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list. */
|
|
1416
1436
|
blocks: At.Bytes;
|
|
1417
1437
|
/** Repo commit object CID. */
|
|
1418
1438
|
commit: At.CIDLink;
|
|
@@ -1426,7 +1446,7 @@ export declare namespace ComAtprotoSyncSubscribeRepos {
|
|
|
1426
1446
|
* @deprecated
|
|
1427
1447
|
*/
|
|
1428
1448
|
rebase: boolean;
|
|
1429
|
-
/** The repo this event comes from. */
|
|
1449
|
+
/** The repo this event comes from. Note that all other message types name this field 'did'. */
|
|
1430
1450
|
repo: At.DID;
|
|
1431
1451
|
/** The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event. */
|
|
1432
1452
|
rev: string;
|
|
@@ -1436,13 +1456,13 @@ export declare namespace ComAtprotoSyncSubscribeRepos {
|
|
|
1436
1456
|
since: string | null;
|
|
1437
1457
|
/** Timestamp of when this message was originally broadcast. */
|
|
1438
1458
|
time: string;
|
|
1439
|
-
/** Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. */
|
|
1440
|
-
tooBig: boolean;
|
|
1441
1459
|
/**
|
|
1442
|
-
* DEPRECATED --
|
|
1460
|
+
* DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data.
|
|
1443
1461
|
* @deprecated
|
|
1444
1462
|
*/
|
|
1445
|
-
|
|
1463
|
+
tooBig: boolean;
|
|
1464
|
+
/** The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose. */
|
|
1465
|
+
prevData?: At.CIDLink;
|
|
1446
1466
|
}
|
|
1447
1467
|
/**
|
|
1448
1468
|
* DEPRECATED -- Use #identity event instead
|
|
@@ -1487,6 +1507,22 @@ export declare namespace ComAtprotoSyncSubscribeRepos {
|
|
|
1487
1507
|
/** For creates and updates, the new record CID. For deletions, null. */
|
|
1488
1508
|
cid: At.CIDLink | null;
|
|
1489
1509
|
path: string;
|
|
1510
|
+
/** For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. */
|
|
1511
|
+
prev?: At.CIDLink;
|
|
1512
|
+
}
|
|
1513
|
+
/** Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository. */
|
|
1514
|
+
interface Sync {
|
|
1515
|
+
[Brand.Type]?: 'com.atproto.sync.subscribeRepos#sync';
|
|
1516
|
+
/** CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. */
|
|
1517
|
+
blocks: At.Bytes;
|
|
1518
|
+
/** The account this repo event corresponds to. Must match that in the commit object. */
|
|
1519
|
+
did: At.DID;
|
|
1520
|
+
/** The rev of the commit. This value must match that in the commit object. */
|
|
1521
|
+
rev: string;
|
|
1522
|
+
/** The stream sequence number of this message. */
|
|
1523
|
+
seq: number;
|
|
1524
|
+
/** Timestamp of when this message was originally broadcast. */
|
|
1525
|
+
time: string;
|
|
1490
1526
|
}
|
|
1491
1527
|
/**
|
|
1492
1528
|
* DEPRECATED -- Use #account event instead
|
|
@@ -1659,6 +1695,10 @@ export declare interface Queries {
|
|
|
1659
1695
|
params: ComAtprotoSyncListRepos.Params;
|
|
1660
1696
|
output: ComAtprotoSyncListRepos.Output;
|
|
1661
1697
|
};
|
|
1698
|
+
'com.atproto.sync.listReposByCollection': {
|
|
1699
|
+
params: ComAtprotoSyncListReposByCollection.Params;
|
|
1700
|
+
output: ComAtprotoSyncListReposByCollection.Output;
|
|
1701
|
+
};
|
|
1662
1702
|
'com.atproto.temp.checkSignupQueue': {
|
|
1663
1703
|
output: ComAtprotoTempCheckSignupQueue.Output;
|
|
1664
1704
|
};
|
package/lib/lexicons.ts
CHANGED
|
@@ -556,7 +556,7 @@ export declare namespace ComAtprotoRepoApplyWrites {
|
|
|
556
556
|
[Brand.Type]?: 'com.atproto.repo.applyWrites#create';
|
|
557
557
|
collection: string;
|
|
558
558
|
value: unknown;
|
|
559
|
-
/**
|
|
559
|
+
/** NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility. */
|
|
560
560
|
rkey?: string;
|
|
561
561
|
}
|
|
562
562
|
interface CreateResult {
|
|
@@ -599,10 +599,7 @@ export declare namespace ComAtprotoRepoCreateRecord {
|
|
|
599
599
|
record: unknown;
|
|
600
600
|
/** The handle or DID of the repo (aka, current account). */
|
|
601
601
|
repo: string;
|
|
602
|
-
/**
|
|
603
|
-
* The Record Key. \
|
|
604
|
-
* Maximum string length: 512
|
|
605
|
-
*/
|
|
602
|
+
/** The Record Key. */
|
|
606
603
|
rkey?: string;
|
|
607
604
|
/** Compare and swap with the previous commit by CID. */
|
|
608
605
|
swapCommit?: At.CID;
|
|
@@ -774,10 +771,7 @@ export declare namespace ComAtprotoRepoPutRecord {
|
|
|
774
771
|
record: unknown;
|
|
775
772
|
/** The handle or DID of the repo (aka, current account). */
|
|
776
773
|
repo: string;
|
|
777
|
-
/**
|
|
778
|
-
* The Record Key. \
|
|
779
|
-
* Maximum string length: 512
|
|
780
|
-
*/
|
|
774
|
+
/** The Record Key. */
|
|
781
775
|
rkey: string;
|
|
782
776
|
/** Compare and swap with the previous commit by CID. */
|
|
783
777
|
swapCommit?: At.CID;
|
|
@@ -1376,7 +1370,14 @@ export declare namespace ComAtprotoSyncGetRepoStatus {
|
|
|
1376
1370
|
/** Optional field, the current rev of the repo, if active=true */
|
|
1377
1371
|
rev?: string;
|
|
1378
1372
|
/** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
|
|
1379
|
-
status?:
|
|
1373
|
+
status?:
|
|
1374
|
+
| 'deactivated'
|
|
1375
|
+
| 'deleted'
|
|
1376
|
+
| 'desynchronized'
|
|
1377
|
+
| 'suspended'
|
|
1378
|
+
| 'takendown'
|
|
1379
|
+
| 'throttled'
|
|
1380
|
+
| (string & {});
|
|
1380
1381
|
}
|
|
1381
1382
|
interface Errors {
|
|
1382
1383
|
RepoNotFound: {};
|
|
@@ -1435,7 +1436,38 @@ export declare namespace ComAtprotoSyncListRepos {
|
|
|
1435
1436
|
rev: string;
|
|
1436
1437
|
active?: boolean;
|
|
1437
1438
|
/** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
|
|
1438
|
-
status?:
|
|
1439
|
+
status?:
|
|
1440
|
+
| 'deactivated'
|
|
1441
|
+
| 'deleted'
|
|
1442
|
+
| 'desynchronized'
|
|
1443
|
+
| 'suspended'
|
|
1444
|
+
| 'takendown'
|
|
1445
|
+
| 'throttled'
|
|
1446
|
+
| (string & {});
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
/** Enumerates all the DIDs which have records with the given collection NSID. */
|
|
1451
|
+
export declare namespace ComAtprotoSyncListReposByCollection {
|
|
1452
|
+
interface Params {
|
|
1453
|
+
collection: string;
|
|
1454
|
+
cursor?: string;
|
|
1455
|
+
/**
|
|
1456
|
+
* Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists. \
|
|
1457
|
+
* Minimum: 1 \
|
|
1458
|
+
* Maximum: 2000
|
|
1459
|
+
* @default 500
|
|
1460
|
+
*/
|
|
1461
|
+
limit?: number;
|
|
1462
|
+
}
|
|
1463
|
+
type Input = undefined;
|
|
1464
|
+
interface Output {
|
|
1465
|
+
repos: Repo[];
|
|
1466
|
+
cursor?: string;
|
|
1467
|
+
}
|
|
1468
|
+
interface Repo {
|
|
1469
|
+
[Brand.Type]?: 'com.atproto.sync.listReposByCollection#repo';
|
|
1470
|
+
did: At.DID;
|
|
1439
1471
|
}
|
|
1440
1472
|
}
|
|
1441
1473
|
|
|
@@ -1469,14 +1501,24 @@ export declare namespace ComAtprotoSyncSubscribeRepos {
|
|
|
1469
1501
|
seq: number;
|
|
1470
1502
|
time: string;
|
|
1471
1503
|
/** If active=false, this optional field indicates a reason for why the account is not active. */
|
|
1472
|
-
status?:
|
|
1504
|
+
status?:
|
|
1505
|
+
| 'deactivated'
|
|
1506
|
+
| 'deleted'
|
|
1507
|
+
| 'desynchronized'
|
|
1508
|
+
| 'suspended'
|
|
1509
|
+
| 'takendown'
|
|
1510
|
+
| 'throttled'
|
|
1511
|
+
| (string & {});
|
|
1473
1512
|
}
|
|
1474
1513
|
/** Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. */
|
|
1475
1514
|
interface Commit {
|
|
1476
1515
|
[Brand.Type]?: 'com.atproto.sync.subscribeRepos#commit';
|
|
1477
|
-
/**
|
|
1516
|
+
/**
|
|
1517
|
+
* DEPRECATED -- will soon always be empty. List of new blobs (by CID) referenced by records in this commit.
|
|
1518
|
+
* @deprecated
|
|
1519
|
+
*/
|
|
1478
1520
|
blobs: At.CIDLink[];
|
|
1479
|
-
/** CAR file containing relevant blocks, as a diff since the previous repo state. */
|
|
1521
|
+
/** CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list. */
|
|
1480
1522
|
blocks: At.Bytes;
|
|
1481
1523
|
/** Repo commit object CID. */
|
|
1482
1524
|
commit: At.CIDLink;
|
|
@@ -1490,7 +1532,7 @@ export declare namespace ComAtprotoSyncSubscribeRepos {
|
|
|
1490
1532
|
* @deprecated
|
|
1491
1533
|
*/
|
|
1492
1534
|
rebase: boolean;
|
|
1493
|
-
/** The repo this event comes from. */
|
|
1535
|
+
/** The repo this event comes from. Note that all other message types name this field 'did'. */
|
|
1494
1536
|
repo: At.DID;
|
|
1495
1537
|
/** The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event. */
|
|
1496
1538
|
rev: string;
|
|
@@ -1500,13 +1542,13 @@ export declare namespace ComAtprotoSyncSubscribeRepos {
|
|
|
1500
1542
|
since: string | null;
|
|
1501
1543
|
/** Timestamp of when this message was originally broadcast. */
|
|
1502
1544
|
time: string;
|
|
1503
|
-
/** Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. */
|
|
1504
|
-
tooBig: boolean;
|
|
1505
1545
|
/**
|
|
1506
|
-
* DEPRECATED --
|
|
1546
|
+
* DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data.
|
|
1507
1547
|
* @deprecated
|
|
1508
1548
|
*/
|
|
1509
|
-
|
|
1549
|
+
tooBig: boolean;
|
|
1550
|
+
/** The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose. */
|
|
1551
|
+
prevData?: At.CIDLink;
|
|
1510
1552
|
}
|
|
1511
1553
|
/**
|
|
1512
1554
|
* DEPRECATED -- Use #identity event instead
|
|
@@ -1551,6 +1593,22 @@ export declare namespace ComAtprotoSyncSubscribeRepos {
|
|
|
1551
1593
|
/** For creates and updates, the new record CID. For deletions, null. */
|
|
1552
1594
|
cid: At.CIDLink | null;
|
|
1553
1595
|
path: string;
|
|
1596
|
+
/** For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. */
|
|
1597
|
+
prev?: At.CIDLink;
|
|
1598
|
+
}
|
|
1599
|
+
/** Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository. */
|
|
1600
|
+
interface Sync {
|
|
1601
|
+
[Brand.Type]?: 'com.atproto.sync.subscribeRepos#sync';
|
|
1602
|
+
/** CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. */
|
|
1603
|
+
blocks: At.Bytes;
|
|
1604
|
+
/** The account this repo event corresponds to. Must match that in the commit object. */
|
|
1605
|
+
did: At.DID;
|
|
1606
|
+
/** The rev of the commit. This value must match that in the commit object. */
|
|
1607
|
+
rev: string;
|
|
1608
|
+
/** The stream sequence number of this message. */
|
|
1609
|
+
seq: number;
|
|
1610
|
+
/** Timestamp of when this message was originally broadcast. */
|
|
1611
|
+
time: string;
|
|
1554
1612
|
}
|
|
1555
1613
|
/**
|
|
1556
1614
|
* DEPRECATED -- Use #account event instead
|
|
@@ -1725,6 +1783,10 @@ export declare interface Queries {
|
|
|
1725
1783
|
params: ComAtprotoSyncListRepos.Params;
|
|
1726
1784
|
output: ComAtprotoSyncListRepos.Output;
|
|
1727
1785
|
};
|
|
1786
|
+
'com.atproto.sync.listReposByCollection': {
|
|
1787
|
+
params: ComAtprotoSyncListReposByCollection.Params;
|
|
1788
|
+
output: ComAtprotoSyncListReposByCollection.Output;
|
|
1789
|
+
};
|
|
1728
1790
|
'com.atproto.temp.checkSignupQueue': {
|
|
1729
1791
|
output: ComAtprotoTempCheckSignupQueue.Output;
|
|
1730
1792
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@atcute/client",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.8",
|
|
5
5
|
"description": "lightweight and cute API client for AT Protocol",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"./utils/jwt": "./dist/utils/jwt.js"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@vitest/coverage-v8": "^
|
|
26
|
-
"vitest": "^
|
|
25
|
+
"@vitest/coverage-v8": "^3.0.4",
|
|
26
|
+
"vitest": "^3.0.4",
|
|
27
27
|
"@atcute/internal-dev-env": "^1.0.1",
|
|
28
28
|
"@atcute/lex-cli": "^1.0.4"
|
|
29
29
|
},
|