techne-sdk 0.5.0 → 0.6.0
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/CHANGELOG.md +36 -0
- package/README.md +12 -3
- package/dist/auth/app-key.d.ts +5 -0
- package/dist/auth/app-key.js +7 -0
- package/dist/auth/index.d.ts +19 -11
- package/dist/auth/index.js +21 -13
- package/dist/catalog/catalog.gen.js +124 -18
- package/dist/connect.d.ts +18 -3
- package/dist/connect.js +2 -0
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.js +9 -0
- package/dist/generated/lexicons.d.ts +182 -20
- package/dist/generated/lexicons.js +107 -10
- package/dist/generated/nsid.d.ts +1 -0
- package/dist/generated/nsid.js +1 -0
- package/dist/generated/nsid.json +1 -0
- package/dist/generated/types/pub/techne/draft/identity/writeAsCollective.d.ts +51 -0
- package/dist/generated/types/pub/techne/draft/identity/writeAsCollective.js +55 -0
- package/dist/generated/types/pub/techne/draft/permissioned/putRecord.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/permissioned/putRecords.d.ts +1 -1
- package/dist/wasm/techne-wasm.gen.js +1 -1
- package/dist/wasm/techne-wasm2js.gen.js +16118 -16120
- package/package.json +3 -2
|
@@ -8330,6 +8330,112 @@ export const catalog = {
|
|
|
8330
8330
|
}
|
|
8331
8331
|
})
|
|
8332
8332
|
},
|
|
8333
|
+
{
|
|
8334
|
+
"nsid": "pub.techne.draft.identity.writeAsCollective",
|
|
8335
|
+
"name": "draft.identity.writeAsCollective",
|
|
8336
|
+
"group": "pub.techne",
|
|
8337
|
+
"kind": "procedure",
|
|
8338
|
+
"description": "Write as a collective: a batch of creates, updates and deletes applied atomically to the repo of a collective account whose credential this service holds, written with that credential. The same input and output as com.atproto.repo.applyWrites, with `repo` the collective's DID; each write is a com.atproto.repo.applyWrites#create, #update or #delete. The service checks the caller's role in the collective first: whoever manages the collective's own member space (`pub.techne.draft.space.collective.member/self`) writes as it; a member of a circle who only writes there deletes its own membership; a new collective's creator writes its first records; a collective that lets every signed-in account post a type takes one such create. A collective that keeps its memberships and descriptor in its member space (a circle) has them created and updated there with pub.techne.draft.permissioned.putRecords, never here (a delete is applied here), and a `block` is never created or updated as a collective. An app reaches it through the caller's own PDS (`atproto-proxy: <service DID>#atproto_appview`), which forwards it with the caller's service-auth token; the app's OAuth scope needs `rpc:pub.techne.draft.identity.writeAsCollective?aud=<service DID>%23atproto_appview`. An agent's token from this service, or a session with it, calls it directly. Its writes are public records in the collective's repo, and the caller's authority is its role there, so the app's `space:` scopes need not reach them (the `rpc:` scope above is enough). It places nothing in a space: a write that names a `space` is refused, and pub.techne.draft.permissioned.putRecords writes into a collective's space. Your own repo is not written here: write it at your PDS with com.atproto.repo.applyWrites. One call spends one of the caller's writes.",
|
|
8339
|
+
"doc": ({
|
|
8340
|
+
"lexicon": 1,
|
|
8341
|
+
"id": "pub.techne.draft.identity.writeAsCollective",
|
|
8342
|
+
"defs": {
|
|
8343
|
+
"main": {
|
|
8344
|
+
"type": "procedure",
|
|
8345
|
+
"description": "Write as a collective: a batch of creates, updates and deletes applied atomically to the repo of a collective account whose credential this service holds, written with that credential. The same input and output as com.atproto.repo.applyWrites, with `repo` the collective's DID; each write is a com.atproto.repo.applyWrites#create, #update or #delete. The service checks the caller's role in the collective first: whoever manages the collective's own member space (`pub.techne.draft.space.collective.member/self`) writes as it; a member of a circle who only writes there deletes its own membership; a new collective's creator writes its first records; a collective that lets every signed-in account post a type takes one such create. A collective that keeps its memberships and descriptor in its member space (a circle) has them created and updated there with pub.techne.draft.permissioned.putRecords, never here (a delete is applied here), and a `block` is never created or updated as a collective. An app reaches it through the caller's own PDS (`atproto-proxy: <service DID>#atproto_appview`), which forwards it with the caller's service-auth token; the app's OAuth scope needs `rpc:pub.techne.draft.identity.writeAsCollective?aud=<service DID>%23atproto_appview`. An agent's token from this service, or a session with it, calls it directly. Its writes are public records in the collective's repo, and the caller's authority is its role there, so the app's `space:` scopes need not reach them (the `rpc:` scope above is enough). It places nothing in a space: a write that names a `space` is refused, and pub.techne.draft.permissioned.putRecords writes into a collective's space. Your own repo is not written here: write it at your PDS with com.atproto.repo.applyWrites. One call spends one of the caller's writes.",
|
|
8346
|
+
"input": {
|
|
8347
|
+
"encoding": "application/json",
|
|
8348
|
+
"schema": {
|
|
8349
|
+
"type": "object",
|
|
8350
|
+
"required": [
|
|
8351
|
+
"repo",
|
|
8352
|
+
"writes"
|
|
8353
|
+
],
|
|
8354
|
+
"properties": {
|
|
8355
|
+
"repo": {
|
|
8356
|
+
"type": "string",
|
|
8357
|
+
"format": "did",
|
|
8358
|
+
"description": "The collective's DID. Not the caller's own."
|
|
8359
|
+
},
|
|
8360
|
+
"validate": {
|
|
8361
|
+
"type": "boolean",
|
|
8362
|
+
"description": "As com.atproto.repo.applyWrites: passed to the collective's PDS."
|
|
8363
|
+
},
|
|
8364
|
+
"writes": {
|
|
8365
|
+
"type": "array",
|
|
8366
|
+
"items": {
|
|
8367
|
+
"type": "union",
|
|
8368
|
+
"refs": [
|
|
8369
|
+
"com.atproto.repo.applyWrites#create",
|
|
8370
|
+
"com.atproto.repo.applyWrites#update",
|
|
8371
|
+
"com.atproto.repo.applyWrites#delete"
|
|
8372
|
+
],
|
|
8373
|
+
"closed": true
|
|
8374
|
+
}
|
|
8375
|
+
},
|
|
8376
|
+
"swapCommit": {
|
|
8377
|
+
"type": "string",
|
|
8378
|
+
"format": "cid",
|
|
8379
|
+
"description": "As com.atproto.repo.applyWrites: the whole batch fails unless the collective's repo is at this commit."
|
|
8380
|
+
}
|
|
8381
|
+
}
|
|
8382
|
+
}
|
|
8383
|
+
},
|
|
8384
|
+
"output": {
|
|
8385
|
+
"encoding": "application/json",
|
|
8386
|
+
"schema": {
|
|
8387
|
+
"type": "object",
|
|
8388
|
+
"required": [],
|
|
8389
|
+
"properties": {
|
|
8390
|
+
"commit": {
|
|
8391
|
+
"type": "ref",
|
|
8392
|
+
"ref": "com.atproto.repo.defs#commitMeta"
|
|
8393
|
+
},
|
|
8394
|
+
"results": {
|
|
8395
|
+
"type": "array",
|
|
8396
|
+
"items": {
|
|
8397
|
+
"type": "union",
|
|
8398
|
+
"refs": [
|
|
8399
|
+
"com.atproto.repo.applyWrites#createResult",
|
|
8400
|
+
"com.atproto.repo.applyWrites#updateResult",
|
|
8401
|
+
"com.atproto.repo.applyWrites#deleteResult"
|
|
8402
|
+
],
|
|
8403
|
+
"closed": true
|
|
8404
|
+
}
|
|
8405
|
+
}
|
|
8406
|
+
}
|
|
8407
|
+
}
|
|
8408
|
+
},
|
|
8409
|
+
"errors": [
|
|
8410
|
+
{
|
|
8411
|
+
"name": "InvalidRequest",
|
|
8412
|
+
"description": "HTTP 400 (or the body extractor's 413, 415 or 422 for a body that is not JSON). Malformed input; `repo` is the caller's own DID (write your own repo at your PDS); a write names a `space` the app's `space:` scopes cover, or the token carries none (write it there with pub.techne.draft.permissioned.putRecords); or the collective's PDS refused the writes (its reason in the message, e.g. InvalidSwap when `swapCommit` did not match)."
|
|
8413
|
+
},
|
|
8414
|
+
{
|
|
8415
|
+
"name": "Forbidden",
|
|
8416
|
+
"description": "HTTP 403. The caller may not write as `repo`, or not this write: a record above its own role, a `block`, or a membership or descriptor the collective keeps in its member space."
|
|
8417
|
+
},
|
|
8418
|
+
{
|
|
8419
|
+
"name": "NotAuthorized",
|
|
8420
|
+
"description": "HTTP 403. A write names a `space` the app's `space:` scopes do not cover writing to."
|
|
8421
|
+
},
|
|
8422
|
+
{
|
|
8423
|
+
"name": "LastManager",
|
|
8424
|
+
"description": "HTTP 409. The writes would leave a circle's members with no manager."
|
|
8425
|
+
},
|
|
8426
|
+
{
|
|
8427
|
+
"name": "PayloadTooLarge",
|
|
8428
|
+
"description": "HTTP 413, from the collective's PDS."
|
|
8429
|
+
},
|
|
8430
|
+
{
|
|
8431
|
+
"name": "RateLimitExceeded",
|
|
8432
|
+
"description": "HTTP 429. Too many writes from this DID, or the collective's PDS is rate-limiting."
|
|
8433
|
+
}
|
|
8434
|
+
]
|
|
8435
|
+
}
|
|
8436
|
+
}
|
|
8437
|
+
})
|
|
8438
|
+
},
|
|
8333
8439
|
{
|
|
8334
8440
|
"nsid": "pub.techne.draft.interest",
|
|
8335
8441
|
"name": "draft.interest",
|
|
@@ -9385,15 +9491,15 @@ export const catalog = {
|
|
|
9385
9491
|
"name": "draft.permissioned.deleteRecord",
|
|
9386
9492
|
"group": "pub.techne",
|
|
9387
9493
|
"kind": "procedure",
|
|
9388
|
-
"description": "Delete one of your own permissioned records (or a collective's or circle's whose own member space you manage). One key holds one record per space: `space` names which goes; without it, the key's one record, Conflict when there are several. A tombstone stays in listChanges so readers drop their copies. Deleting a missing record is a no-op unless swapCid is given (InvalidSwap), or it names an app's space the caller may not delete in (Forbidden). When the call's token carries space scopes from Techne's ePDS, the delete must name its `space`, and one the scopes do not cover is refused 403 Forbidden. A record written for an app's space is deleted only
|
|
9494
|
+
"description": "Delete one of your own permissioned records (or a collective's or circle's whose own member space you manage). One key holds one record per space: `space` names which goes; without it, the key's one record, Conflict when there are several. A tombstone stays in listChanges so readers drop their copies. Deleting a missing record is a no-op unless swapCid is given (InvalidSwap), or it names an app's space the caller may not delete in (Forbidden). When the call's token carries space scopes from Techne's ePDS, the delete must name its `space`, and one the scopes do not cover is refused 403 Forbidden. A record written for an app's space is deleted only under `space:` scopes covering it or with no `space:` scopes: anyone else is 403 Forbidden. Draft tier.",
|
|
9389
9495
|
"doc": ({
|
|
9390
9496
|
"lexicon": 1,
|
|
9391
9497
|
"id": "pub.techne.draft.permissioned.deleteRecord",
|
|
9392
|
-
"description": "Delete a record from the caller's own repo (a takedown, a mistake, or a `share` the owner withdraws, which stops that reader's future reads, with a 'revoke-read' receipt once no share in its source space names it). The caller authenticates with its own credential: a session from any sign-in lane (OAuth included), or an atproto service-auth JWT (iss = the caller, aud = the AppView's service DID, lxm = this method). repo must be the caller, or a collective or circle the platform holds the credential of whose own member space (`space.collective.member/self`) the caller manages (that space's manage leg alone hands over the authority's pen; managing another of its spaces does not); in a circle (a collective whose descriptor names a circle type) a caller holding only that space's write leg (role 20-29) holds the pen for pub.techne.draft.membership writes alone: an add (a new claim at a key that holds none now, not ending, whose addedBy is the caller or absent) or the caller's own claim (its leave, or a re-put keeping its subject and addedBy); anything else as the circle is Forbidden, or a collective the caller made that has nothing placed yet (for at most a day), else Forbidden; a caller whose account is being deleted, or is deleted, is refused (AccountDeleting). The body is removed; a tombstone receipt stays in listChanges, in the space the record counted in, so readers drop their copies. Deleting a record that does not exist is a no-op unless swapCid is given (then it is InvalidSwap) or the delete names an app's space the caller may not delete in (then it is Forbidden). A request body that is not this method's input is refused as InvalidRequest, with an XRPC error body ({\"error\":\"InvalidRequest\",\"message\":...}): HTTP 413 for a body over 2 MiB (2,097,152 bytes; it is not read past that); 415 for one not sent as application/json; 400 for one that is not JSON; 422 for JSON that is not the input (a field missing or of the wrong type). Such a refused write still spends one of the caller's writes (RateLimitExceeded). When the call's token carries space scopes from Techne's ePDS, the delete must name its `space`, and one the scopes do not cover is refused 403 Forbidden. A record written for an app's space (a pub.techne.draft.space.private space) is deleted only by
|
|
9498
|
+
"description": "Delete a record from the caller's own repo (a takedown, a mistake, or a `share` the owner withdraws, which stops that reader's future reads, with a 'revoke-read' receipt once no share in its source space names it). The caller authenticates with its own credential: a session from any sign-in lane (OAuth included), or an atproto service-auth JWT (iss = the caller, aud = the AppView's service DID, lxm = this method). repo must be the caller, or a collective or circle the platform holds the credential of whose own member space (`space.collective.member/self`) the caller manages (that space's manage leg alone hands over the authority's pen; managing another of its spaces does not); in a circle (a collective whose descriptor names a circle type) a caller holding only that space's write leg (role 20-29) holds the pen for pub.techne.draft.membership writes alone: an add (a new claim at a key that holds none now, not ending, whose addedBy is the caller or absent) or the caller's own claim (its leave, or a re-put keeping its subject and addedBy); anything else as the circle is Forbidden, or a collective the caller made that has nothing placed yet (for at most a day), else Forbidden; a caller whose account is being deleted, or is deleted, is refused (AccountDeleting). The body is removed; a tombstone receipt stays in listChanges, in the space the record counted in, so readers drop their copies. Deleting a record that does not exist is a no-op unless swapCid is given (then it is InvalidSwap) or the delete names an app's space the caller may not delete in (then it is Forbidden). A request body that is not this method's input is refused as InvalidRequest, with an XRPC error body ({\"error\":\"InvalidRequest\",\"message\":...}): HTTP 413 for a body over 2 MiB (2,097,152 bytes; it is not read past that); 415 for one not sent as application/json; 400 for one that is not JSON; 422 for JSON that is not the input (a field missing or of the wrong type). Such a refused write still spends one of the caller's writes (RateLimitExceeded). When the call's token carries space scopes from Techne's ePDS, the delete must name its `space`, and one the scopes do not cover is refused 403 Forbidden. A record written for an app's space (a pub.techne.draft.space.private space) is deleted only by a caller whose `space:` scopes cover a delete there or whose token carries no `space:` scopes; any other caller is refused 403 Forbidden and nothing is deleted, even when nothing is at the key. Draft tier.",
|
|
9393
9499
|
"defs": {
|
|
9394
9500
|
"main": {
|
|
9395
9501
|
"type": "procedure",
|
|
9396
|
-
"description": "Delete one of your own permissioned records (or a collective's or circle's whose own member space you manage). One key holds one record per space: `space` names which goes; without it, the key's one record, Conflict when there are several. A tombstone stays in listChanges so readers drop their copies. Deleting a missing record is a no-op unless swapCid is given (InvalidSwap), or it names an app's space the caller may not delete in (Forbidden). When the call's token carries space scopes from Techne's ePDS, the delete must name its `space`, and one the scopes do not cover is refused 403 Forbidden. A record written for an app's space is deleted only
|
|
9502
|
+
"description": "Delete one of your own permissioned records (or a collective's or circle's whose own member space you manage). One key holds one record per space: `space` names which goes; without it, the key's one record, Conflict when there are several. A tombstone stays in listChanges so readers drop their copies. Deleting a missing record is a no-op unless swapCid is given (InvalidSwap), or it names an app's space the caller may not delete in (Forbidden). When the call's token carries space scopes from Techne's ePDS, the delete must name its `space`, and one the scopes do not cover is refused 403 Forbidden. A record written for an app's space is deleted only under `space:` scopes covering it or with no `space:` scopes: anyone else is 403 Forbidden. Draft tier.",
|
|
9397
9503
|
"input": {
|
|
9398
9504
|
"encoding": "application/json",
|
|
9399
9505
|
"schema": {
|
|
@@ -9451,7 +9557,7 @@ export const catalog = {
|
|
|
9451
9557
|
},
|
|
9452
9558
|
{
|
|
9453
9559
|
"name": "Forbidden",
|
|
9454
|
-
"description": "HTTP 403. repo is not the caller's own (or a collective's or circle's the caller may write as, see the description); or the call's `space:` scopes do not cover the delete; or the record was written for an app's space (pub.techne.draft.space.private)
|
|
9560
|
+
"description": "HTTP 403. repo is not the caller's own (or a collective's or circle's the caller may write as, see the description); or the call's `space:` scopes do not cover the delete; or the record was written for an app's space (pub.techne.draft.space.private) under `space:` scopes that do not cover a delete there. Nothing is deleted."
|
|
9455
9561
|
},
|
|
9456
9562
|
{
|
|
9457
9563
|
"name": "LastManager",
|
|
@@ -9902,15 +10008,15 @@ export const catalog = {
|
|
|
9902
10008
|
"name": "draft.permissioned.putRecord",
|
|
9903
10009
|
"group": "pub.techne",
|
|
9904
10010
|
"kind": "procedure",
|
|
9905
|
-
"description": "Write one record into your own repo (or a collective's or circle's whose own member space you manage; a circle member holding only its write leg writes membership adds and their own claim) as a permissioned record, for the `space` it names (required: no space is InvalidRequest; public records go through com.atproto.repo.putRecord, and a record only you read goes in your space.personal). Any collection; a body of a collection with a published lexicon must satisfy it. It counts in that space only when the space's write policy admits you (and, for one of our own types, the space type declares the collection); otherwise it is stored and only you read it. A first write is never refused
|
|
10011
|
+
"description": "Write one record into your own repo (or a collective's or circle's whose own member space you manage; a circle member holding only its write leg writes membership adds and their own claim) as a permissioned record, for the `space` it names (required: no space is InvalidRequest; public records go through com.atproto.repo.putRecord, and a record only you read goes in your space.personal). Any collection; a body of a collection with a published lexicon must satisfy it. It counts in that space only when the space's write policy admits you (and, for one of our own types, the space type declares the collection); otherwise it is stored and only you read it. A first write is never refused by its space's policy (only by your token's `space:` scopes). A pub.techne.draft.space.private record counts there when written under `space:` scopes covering it or with no `space:` scopes; which app is calling is not asked. Replacing a record already written there needs `space:` scopes covering it, or none; anyone else is 403 Forbidden. The output's `space` says where it counts. Writing the current version again is a no-op (in an app's space, only under covering scopes or with no `space:` scopes; else Forbidden). One write of your rate (RateLimitExceeded). A token with space scopes from Techne's ePDS: a write to a space they do not cover is 403 Forbidden. Draft tier.",
|
|
9906
10012
|
"doc": ({
|
|
9907
10013
|
"lexicon": 1,
|
|
9908
10014
|
"id": "pub.techne.draft.permissioned.putRecord",
|
|
9909
|
-
"description": "Write a record into the caller's own repo, as a permissioned record (the generic private write). The caller authenticates with its own credential: a session from any sign-in lane (OAuth included), or an atproto service-auth JWT (iss = the caller, aud = the AppView's service DID, lxm = this method). repo must be the caller, or a collective or circle the platform holds the credential of whose own member space (`space.collective.member/self`) the caller manages (that space's manage leg alone hands over the authority's pen; managing another of its spaces does not); in a circle (a collective whose descriptor names a circle type) a caller holding only that space's write leg (role 20-29) holds the pen for pub.techne.draft.membership writes alone: an add (a new claim at a key that holds none now, not ending, whose addedBy is the caller or absent) or the caller's own claim (its leave, or a re-put keeping its subject and addedBy); anything else as the circle is Forbidden, or a collective the caller made that has nothing placed yet (for at most a day), else Forbidden: a record is only ever written into its writer's repo. There is no write gate on a first write and no collection check: any collection may be written, for any space, and a first write is never refused
|
|
10015
|
+
"description": "Write a record into the caller's own repo, as a permissioned record (the generic private write). The caller authenticates with its own credential: a session from any sign-in lane (OAuth included), or an atproto service-auth JWT (iss = the caller, aud = the AppView's service DID, lxm = this method). repo must be the caller, or a collective or circle the platform holds the credential of whose own member space (`space.collective.member/self`) the caller manages (that space's manage leg alone hands over the authority's pen; managing another of its spaces does not); in a circle (a collective whose descriptor names a circle type) a caller holding only that space's write leg (role 20-29) holds the pen for pub.techne.draft.membership writes alone: an add (a new claim at a key that holds none now, not ending, whose addedBy is the caller or absent) or the caller's own claim (its leave, or a re-put keeping its subject and addedBy); anything else as the circle is Forbidden, or a collective the caller made that has nothing placed yet (for at most a day), else Forbidden: a record is only ever written into its writer's repo. There is no write gate on a first write and no collection check: any collection may be written, for any space, and a first write is never refused by its space's policy (only by the token's `space:` scopes). Replacing a record already written for an app's space (a pub.techne.draft.space.private space): only a caller whose `space:` scopes cover a put there, or whose token carries no `space:` scopes, may replace it; any other caller is refused 403 Forbidden and nothing is written. One collection is refused there: one of the platform's own record types named for an app's space (pub.techne.draft.space.private) is refused as InvalidRequest, since our own types keep their declared homes (the adopted community.lexicon.calendar.event and .rsvp are not refused there: they are the app's own data, and an RSVP there projects no claim). Otherwise what it counts for is the managing app's admission of the version as it is written: the record counts in the `space` it names only when that space's write policy admits the writer and, for a collection with a published lexicon, the space type declares the collection; it is then read by whoever the space's read policy admits. A record for a pub.techne.draft.space.private space is a space like any other: a write there counts when its owner writes it under `space:` scopes covering it or with no `space:` scopes (which app is calling is not asked); a write under scopes that do not cover it is refused like any write out of scope. Otherwise it is stored in the writer's repo, counts in no space, and only its writer reads it (a record written for an app's space and not admitted there is read by no one); write it again to ask again (for an app's space only the callers that may replace a record there can). A write into a space whose authority's account is being deleted, or is deleted, is stored the same way and counts in no space (the space goes with that account). A caller whose own account is being deleted, or is deleted, is refused (AccountDeleting). The output's `space` says where it counts. A source keeps what it does not publish in its own pub.techne.draft.space.source (at://{source}/pub.techne.draft.space.source/self): its permissioned descriptions, the `share`s naming its readers (writing one admits its subject, who gets a 'granted' receipt; deleting the last one naming a reader gives a 'revoke-read'. A share keeps one space per key, so it is never moved out of the space: writing it for another space is refused as Conflict), and a scraper's raw payloads and crawl state. A body in a collection with a published lexicon must satisfy it (InvalidRequest otherwise); any other collection is stored as written. Writing the current version again for the same space records no new version: if it counts there it is a no-op; if it was not admitted, admission is asked again, and a version admitted now is placed in the space with a receipt. In an app's space this holds only for the callers that may replace a record there; anyone else's write of the same version is refused Forbidden. A request body that is not this method's input is refused as InvalidRequest, with an XRPC error body ({\"error\":\"InvalidRequest\",\"message\":...}): HTTP 413 for a body over 2 MiB (2,097,152 bytes; it is not read past that); 415 for one not sent as application/json; 400 for one that is not JSON; 422 for JSON that is not the input (a field missing or of the wrong type). Such a refused write still spends one of the caller's writes (RateLimitExceeded). When the call's token carries space scopes from Techne's ePDS, a write to a space they do not cover is refused 403 Forbidden. `space` is required: a write that names no space is refused as InvalidRequest (HTTP 400; for putRecords the whole call, and nothing is written), since public records are written with com.atproto.repo.putRecord and a record only the caller reads goes in its own pub.techne.draft.space.personal. Records written before this rule with no space stay stored and readable by their writer. Draft tier.",
|
|
9910
10016
|
"defs": {
|
|
9911
10017
|
"main": {
|
|
9912
10018
|
"type": "procedure",
|
|
9913
|
-
"description": "Write one record into your own repo (or a collective's or circle's whose own member space you manage; a circle member holding only its write leg writes membership adds and their own claim) as a permissioned record, for the `space` it names (required: no space is InvalidRequest; public records go through com.atproto.repo.putRecord, and a record only you read goes in your space.personal). Any collection; a body of a collection with a published lexicon must satisfy it. It counts in that space only when the space's write policy admits you (and, for one of our own types, the space type declares the collection); otherwise it is stored and only you read it. A first write is never refused
|
|
10019
|
+
"description": "Write one record into your own repo (or a collective's or circle's whose own member space you manage; a circle member holding only its write leg writes membership adds and their own claim) as a permissioned record, for the `space` it names (required: no space is InvalidRequest; public records go through com.atproto.repo.putRecord, and a record only you read goes in your space.personal). Any collection; a body of a collection with a published lexicon must satisfy it. It counts in that space only when the space's write policy admits you (and, for one of our own types, the space type declares the collection); otherwise it is stored and only you read it. A first write is never refused by its space's policy (only by your token's `space:` scopes). A pub.techne.draft.space.private record counts there when written under `space:` scopes covering it or with no `space:` scopes; which app is calling is not asked. Replacing a record already written there needs `space:` scopes covering it, or none; anyone else is 403 Forbidden. The output's `space` says where it counts. Writing the current version again is a no-op (in an app's space, only under covering scopes or with no `space:` scopes; else Forbidden). One write of your rate (RateLimitExceeded). A token with space scopes from Techne's ePDS: a write to a space they do not cover is 403 Forbidden. Draft tier.",
|
|
9914
10020
|
"input": {
|
|
9915
10021
|
"encoding": "application/json",
|
|
9916
10022
|
"schema": {
|
|
@@ -9991,7 +10097,7 @@ export const catalog = {
|
|
|
9991
10097
|
"space": {
|
|
9992
10098
|
"type": "string",
|
|
9993
10099
|
"format": "at-uri",
|
|
9994
|
-
"description": "The space the record counts in now. Absent when it counts in none (the space's write policy does not admit the writer
|
|
10100
|
+
"description": "The space the record counts in now. Absent when it counts in none (the space's write policy does not admit the writer)."
|
|
9995
10101
|
}
|
|
9996
10102
|
}
|
|
9997
10103
|
}
|
|
@@ -10003,7 +10109,7 @@ export const catalog = {
|
|
|
10003
10109
|
},
|
|
10004
10110
|
{
|
|
10005
10111
|
"name": "Forbidden",
|
|
10006
|
-
"description": "HTTP 403. repo is not the caller's own (or a collective's or circle's the caller may write as, see the description); or the call's `space:` scopes do not cover the write; or the write replaces a record already written for an app's space (pub.techne.draft.space.private)
|
|
10112
|
+
"description": "HTTP 403. repo is not the caller's own (or a collective's or circle's the caller may write as, see the description); or the call's `space:` scopes do not cover the write; or the write replaces a record already written for an app's space (pub.techne.draft.space.private) under `space:` scopes that do not cover a put there. A first write is never refused by its space's policy (only by the token's `space:` scopes). Nothing is written."
|
|
10007
10113
|
},
|
|
10008
10114
|
{
|
|
10009
10115
|
"name": "LastManager",
|
|
@@ -10047,15 +10153,15 @@ export const catalog = {
|
|
|
10047
10153
|
"name": "draft.permissioned.putRecords",
|
|
10048
10154
|
"group": "pub.techne",
|
|
10049
10155
|
"kind": "procedure",
|
|
10050
|
-
"description": "Up to 200 putRecord writes, applied in order, each in its own transaction, for one write of your rate. Not atomic: each write's result says what happened to it, and a write refused for itself does not stop the others (AccountDeleting or an HTTP 500 stops the rest), except in a roster batch (one with any pub.techne.draft.membership write), which stops at its first refused write and reports each later one as Conflict, not written; as a circle, every prefix of its membership writes must keep the circle a manager. Send a failed batch again whole: re-putting what landed is a no-op (in an app's space, only
|
|
10156
|
+
"description": "Up to 200 putRecord writes, applied in order, each in its own transaction, for one write of your rate. Not atomic: each write's result says what happened to it, and a write refused for itself does not stop the others (AccountDeleting or an HTTP 500 stops the rest), except in a roster batch (one with any pub.techne.draft.membership write), which stops at its first refused write and reports each later one as Conflict, not written; as a circle, every prefix of its membership writes must keep the circle a manager. Send a failed batch again whole: re-putting what landed is a no-op (in an app's space, only under covering scopes or with no `space:` scopes). Space scopes and space.private apply to each write as in putRecord: a first write is never refused by its space's policy (only by the token's `space:` scopes), but replacing a record already written for an app's space needs `space:` scopes covering it or no `space:` scopes, and that write's result is Forbidden. Every write names its `space` (a write with none refuses the whole call, InvalidRequest; public records go through com.atproto.repo.putRecord). Draft tier.",
|
|
10051
10157
|
"doc": ({
|
|
10052
10158
|
"lexicon": 1,
|
|
10053
10159
|
"id": "pub.techne.draft.permissioned.putRecords",
|
|
10054
|
-
"description": "Write up to 200 records into the caller's own repo in one call: each write is applied in order, exactly as putRecord applies it (the same admission, receipts, no-op re-put and swapCid), each in its own transaction. NOT atomic: a write that is refused does not undo the writes before it or stop the ones after it, and each write's result says what happened to it. That is why this is not called applyWrites: atproto's com.atproto.repo.applyWrites commits all of its writes or none, and this does not (each write keeps putRecord's own per-record locking, so a batch never holds more than one record's locks). The caller authenticates with its own credential: a session from any sign-in lane (OAuth included), or an atproto service-auth JWT (iss = the caller, aud = the AppView's service DID, lxm = this method). repo must be the caller, or a collective or circle the platform holds the credential of whose own member space (`space.collective.member/self`) the caller manages (that space's manage leg alone hands over the authority's pen; managing another of its spaces does not); in a circle (a collective whose descriptor names a circle type) a caller holding only that space's write leg (role 20-29) holds the pen for pub.techne.draft.membership writes alone: an add (a new claim at a key that holds none now, not ending, whose addedBy is the caller or absent) or the caller's own claim (its leave, or a re-put keeping its subject and addedBy); anything else as the circle is Forbidden, or a collective the caller made that has nothing placed yet (for at most a day), else Forbidden and nothing is written. A write refused for itself (a malformed or invalid record, a swapCid that does not match, a conflict) is reported in its result as the error putRecord would have answered, and the next write is applied, except in a roster batch: one with any pub.techne.draft.membership write, in whatever repo. A roster batch of more than one write is first checked whole, and a write in it that putRecord would refuse before reading anything (malformed, over 2 MiB, failing its lexicon, or naming a space it cannot be written into) refuses the call as InvalidRequest (HTTP 400) with nothing written; it then stops at its first refused write, and every write after that one is reported as Conflict and not written. Since any prefix of a roster batch may be what is left written, a batch written as a circle that has a manager must keep one after every prefix of its membership writes (see LastManager), not only after the whole batch: to make someone else manager, put their membership at role 30 or above before the caller's own lower one. A refusal that holds for the whole call stops it with that error, and no later write is applied: the caller's account is being deleted, or is deleted (AccountDeleting; what it wrote goes with the account), or a failure inside the AppView (HTTP 500; the writes applied before it stay written, so read them back or send the batch again: writing the current version again for the same space is a no-op). Callers should treat a failed batch as all-or-nothing and send it again whole: re-putting the records that landed is a no-op (in an app's space only
|
|
10160
|
+
"description": "Write up to 200 records into the caller's own repo in one call: each write is applied in order, exactly as putRecord applies it (the same admission, receipts, no-op re-put and swapCid), each in its own transaction. NOT atomic: a write that is refused does not undo the writes before it or stop the ones after it, and each write's result says what happened to it. That is why this is not called applyWrites: atproto's com.atproto.repo.applyWrites commits all of its writes or none, and this does not (each write keeps putRecord's own per-record locking, so a batch never holds more than one record's locks). The caller authenticates with its own credential: a session from any sign-in lane (OAuth included), or an atproto service-auth JWT (iss = the caller, aud = the AppView's service DID, lxm = this method). repo must be the caller, or a collective or circle the platform holds the credential of whose own member space (`space.collective.member/self`) the caller manages (that space's manage leg alone hands over the authority's pen; managing another of its spaces does not); in a circle (a collective whose descriptor names a circle type) a caller holding only that space's write leg (role 20-29) holds the pen for pub.techne.draft.membership writes alone: an add (a new claim at a key that holds none now, not ending, whose addedBy is the caller or absent) or the caller's own claim (its leave, or a re-put keeping its subject and addedBy); anything else as the circle is Forbidden, or a collective the caller made that has nothing placed yet (for at most a day), else Forbidden and nothing is written. A write refused for itself (a malformed or invalid record, a swapCid that does not match, a conflict) is reported in its result as the error putRecord would have answered, and the next write is applied, except in a roster batch: one with any pub.techne.draft.membership write, in whatever repo. A roster batch of more than one write is first checked whole, and a write in it that putRecord would refuse before reading anything (malformed, over 2 MiB, failing its lexicon, or naming a space it cannot be written into) refuses the call as InvalidRequest (HTTP 400) with nothing written; it then stops at its first refused write, and every write after that one is reported as Conflict and not written. Since any prefix of a roster batch may be what is left written, a batch written as a circle that has a manager must keep one after every prefix of its membership writes (see LastManager), not only after the whole batch: to make someone else manager, put their membership at role 30 or above before the caller's own lower one. A refusal that holds for the whole call stops it with that error, and no later write is applied: the caller's account is being deleted, or is deleted (AccountDeleting; what it wrote goes with the account), or a failure inside the AppView (HTTP 500; the writes applied before it stay written, so read them back or send the batch again: writing the current version again for the same space is a no-op). Callers should treat a failed batch as all-or-nothing and send it again whole: re-putting the records that landed is a no-op (in an app's space only under `space:` scopes covering it or with no `space:` scopes; anyone else's re-put there is Forbidden), and at the move to atproto's permissioned data this method becomes the owner's own PDS com.atproto.repo.applyWrites, which is atomic. One call spends one of the caller's writes (RateLimitExceeded), whatever the number of writes it carries. A request body that is not this method's input is refused as InvalidRequest, with an XRPC error body ({\"error\":\"InvalidRequest\",\"message\":...}): HTTP 413 for a body over 8 MiB (8,388,608 bytes; it is not read past that); 415 for one not sent as application/json; 400 for one that is not JSON or carries no writes or more than 200; 422 for JSON that is not the input (a field missing or of the wrong type). Such a refused call still spends one of the caller's writes. Each write is checked against the token's space scopes as putRecord checks it, and a write that replaces a record already written for an app's space (a pub.techne.draft.space.private space) under `space:` scopes that do not cover a put there is refused as putRecord refuses it; either refusal is that write's result (Forbidden), and the next write is applied (in a roster batch, the writes after it are Conflict, not written). A first write is never refused by its space's policy (only by the token's `space:` scopes). `space` is required: a write that names no space is refused as InvalidRequest (HTTP 400; for putRecords the whole call, and nothing is written), since public records are written with com.atproto.repo.putRecord and a record only the caller reads goes in its own pub.techne.draft.space.personal. Records written before this rule with no space stay stored and readable by their writer. Draft tier.",
|
|
10055
10161
|
"defs": {
|
|
10056
10162
|
"main": {
|
|
10057
10163
|
"type": "procedure",
|
|
10058
|
-
"description": "Up to 200 putRecord writes, applied in order, each in its own transaction, for one write of your rate. Not atomic: each write's result says what happened to it, and a write refused for itself does not stop the others (AccountDeleting or an HTTP 500 stops the rest), except in a roster batch (one with any pub.techne.draft.membership write), which stops at its first refused write and reports each later one as Conflict, not written; as a circle, every prefix of its membership writes must keep the circle a manager. Send a failed batch again whole: re-putting what landed is a no-op (in an app's space, only
|
|
10164
|
+
"description": "Up to 200 putRecord writes, applied in order, each in its own transaction, for one write of your rate. Not atomic: each write's result says what happened to it, and a write refused for itself does not stop the others (AccountDeleting or an HTTP 500 stops the rest), except in a roster batch (one with any pub.techne.draft.membership write), which stops at its first refused write and reports each later one as Conflict, not written; as a circle, every prefix of its membership writes must keep the circle a manager. Send a failed batch again whole: re-putting what landed is a no-op (in an app's space, only under covering scopes or with no `space:` scopes). Space scopes and space.private apply to each write as in putRecord: a first write is never refused by its space's policy (only by the token's `space:` scopes), but replacing a record already written for an app's space needs `space:` scopes covering it or no `space:` scopes, and that write's result is Forbidden. Every write names its `space` (a write with none refuses the whole call, InvalidRequest; public records go through com.atproto.repo.putRecord). Draft tier.",
|
|
10059
10165
|
"input": {
|
|
10060
10166
|
"encoding": "application/json",
|
|
10061
10167
|
"schema": {
|
|
@@ -10217,7 +10323,7 @@ export const catalog = {
|
|
|
10217
10323
|
"properties": {
|
|
10218
10324
|
"error": {
|
|
10219
10325
|
"type": "string",
|
|
10220
|
-
"description": "InvalidRequest (malformed, a body that fails its collection's published lexicon, or a record over 2 MiB, more than a putRecord body may be), InvalidSwap (swapCid did not match the current version), Conflict (the same key holds a public record in the caller's repo, or a concurrent write replaced this version before it was recorded), IdentityConflict (the write would change a contact's identity, which writing again never fixes; see putRecord), DuplicatePhone (a contact write introduces a number another of the caller's active contacts carries; see putRecord), RateLimitExceeded (a contact write that binds a number to an account found the caller's phone lookups spent; retry it in a minute) or Forbidden (the call's `space:` scopes do not cover the write, or it replaces a record already written for an app's space
|
|
10326
|
+
"description": "InvalidRequest (malformed, a body that fails its collection's published lexicon, or a record over 2 MiB, more than a putRecord body may be), InvalidSwap (swapCid did not match the current version), Conflict (the same key holds a public record in the caller's repo, or a concurrent write replaced this version before it was recorded), IdentityConflict (the write would change a contact's identity, which writing again never fixes; see putRecord), DuplicatePhone (a contact write introduces a number another of the caller's active contacts carries; see putRecord), RateLimitExceeded (a contact write that binds a number to an account found the caller's phone lookups spent; retry it in a minute) or Forbidden (the call's `space:` scopes do not cover the write, or it replaces a record already written for an app's space under `space:` scopes that do not cover it; see putRecord).",
|
|
10221
10327
|
"knownValues": [
|
|
10222
10328
|
"InvalidRequest",
|
|
10223
10329
|
"InvalidSwap",
|
|
@@ -16833,7 +16939,7 @@ export const catalog = {
|
|
|
16833
16939
|
"name": "App private space",
|
|
16834
16940
|
"kind": "space",
|
|
16835
16941
|
"key": "any",
|
|
16836
|
-
"description": "An app's private space for one person: owner-only, one instance per app, keyed by the app (at://{owner}/pub.techne.draft.space.private/{appKey}, appKey = sidecar_rkey(client_id)). An ordinary space type: apps use it through the permissioned.* methods, naming it as the space. It holds records of any type that is not one of the platform's own, community drafts included (0016: every space may contain records of any type), so it declares no collections and is on the placement manifest's `open` list; the platform's own record types keep their declared homes, and a write of one here is refused. The adopted calendar types (community.lexicon.calendar.event and .rsvp) are held here as the app's own data: an RSVP here projects no claim, and neither counts as the platform's event or RSVP at its key. The
|
|
16942
|
+
"description": "An app's private space for one person: owner-only, one instance per app, keyed by the app (at://{owner}/pub.techne.draft.space.private/{appKey}, appKey = sidecar_rkey(client_id)). An ordinary space type: apps use it through the permissioned.* methods, naming it as the space. It holds records of any type that is not one of the platform's own, community drafts included (0016: every space may contain records of any type), so it declares no collections and is on the placement manifest's `open` list; the platform's own record types keep their declared homes, and a write of one here is refused. The adopted calendar types (community.lexicon.calendar.event and .rsvp) are held here as the app's own data: an RSVP here projects no claim, and neither counts as the platform's event or RSVP at its key. The key names the app the space is for, but which app is calling is not asked: like any space, an instance is reached by a caller whose 0016 `space:` scopes cover it, and by one whose token carries no `space:` scopes (the owner's own sessions included); a write under scopes that do not cover it is refused. An app asks for narrow access with the scope space:pub.techne.draft.space.private?skey={appKey}.",
|
|
16837
16943
|
"collections": [],
|
|
16838
16944
|
"policy": {
|
|
16839
16945
|
"read": {
|
|
@@ -16852,7 +16958,7 @@ export const catalog = {
|
|
|
16852
16958
|
"defs": {
|
|
16853
16959
|
"main": {
|
|
16854
16960
|
"type": "space",
|
|
16855
|
-
"description": "An app's private space for one person: owner-only, one instance per app, keyed by the app (at://{owner}/pub.techne.draft.space.private/{appKey}, appKey = sidecar_rkey(client_id)). An ordinary space type: apps use it through the permissioned.* methods, naming it as the space. It holds records of any type that is not one of the platform's own, community drafts included (0016: every space may contain records of any type), so it declares no collections and is on the placement manifest's `open` list; the platform's own record types keep their declared homes, and a write of one here is refused. The adopted calendar types (community.lexicon.calendar.event and .rsvp) are held here as the app's own data: an RSVP here projects no claim, and neither counts as the platform's event or RSVP at its key. The
|
|
16961
|
+
"description": "An app's private space for one person: owner-only, one instance per app, keyed by the app (at://{owner}/pub.techne.draft.space.private/{appKey}, appKey = sidecar_rkey(client_id)). An ordinary space type: apps use it through the permissioned.* methods, naming it as the space. It holds records of any type that is not one of the platform's own, community drafts included (0016: every space may contain records of any type), so it declares no collections and is on the placement manifest's `open` list; the platform's own record types keep their declared homes, and a write of one here is refused. The adopted calendar types (community.lexicon.calendar.event and .rsvp) are held here as the app's own data: an RSVP here projects no claim, and neither counts as the platform's event or RSVP at its key. The key names the app the space is for, but which app is calling is not asked: like any space, an instance is reached by a caller whose 0016 `space:` scopes cover it, and by one whose token carries no `space:` scopes (the owner's own sessions included); a write under scopes that do not cover it is refused. An app asks for narrow access with the scope space:pub.techne.draft.space.private?skey={appKey}.",
|
|
16856
16962
|
"key": "any",
|
|
16857
16963
|
"name": "App private space",
|
|
16858
16964
|
"collections": []
|
|
@@ -16860,14 +16966,14 @@ export const catalog = {
|
|
|
16860
16966
|
}
|
|
16861
16967
|
}),
|
|
16862
16968
|
"policyNsid": "pub.techne.draft.space.private.policy",
|
|
16863
|
-
"policyDescription": "Access policy for pub.techne.draft.space.private: owner only, all capabilities. Which
|
|
16969
|
+
"policyDescription": "Access policy for pub.techne.draft.space.private: owner only, all capabilities. Which of the owner's apps reach an instance follows from the call's `space:` scopes (a caller with none reaches every one), not from this policy.",
|
|
16864
16970
|
"policyDoc": ({
|
|
16865
16971
|
"lexicon": 1,
|
|
16866
16972
|
"id": "pub.techne.draft.space.private.policy",
|
|
16867
16973
|
"defs": {
|
|
16868
16974
|
"main": {
|
|
16869
16975
|
"type": "spacePolicy",
|
|
16870
|
-
"description": "Access policy for pub.techne.draft.space.private: owner only, all capabilities. Which
|
|
16976
|
+
"description": "Access policy for pub.techne.draft.space.private: owner only, all capabilities. Which of the owner's apps reach an instance follows from the call's `space:` scopes (a caller with none reaches every one), not from this policy.",
|
|
16871
16977
|
"policy": {
|
|
16872
16978
|
"read": {
|
|
16873
16979
|
"$type": "pub.techne.draft.policy#authorityOnly"
|
|
@@ -33121,7 +33227,7 @@ export const catalog = {
|
|
|
33121
33227
|
}
|
|
33122
33228
|
],
|
|
33123
33229
|
"counts": {
|
|
33124
|
-
"records":
|
|
33230
|
+
"records": 153,
|
|
33125
33231
|
"spaces": 13,
|
|
33126
33232
|
"predicates": 9,
|
|
33127
33233
|
"methods": 127
|
package/dist/connect.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* techne-sdk/connect — the SDK's client over one signed-in session (techne P13.3): two clients, the
|
|
3
|
-
* reads (`query`, `get`, `versions` and their options forms, SDK1) and the
|
|
3
|
+
* reads (`query`, `get`, `versions` and their options forms, SDK1) and the writes (`put`, and
|
|
4
|
+
* `writeAsCollective` for writing as a collective the user may write as).
|
|
4
5
|
*
|
|
5
6
|
* Everything goes through the user's own PDS with the user's own session (an atproto OAuth session's
|
|
6
7
|
* `did` and `fetchHandler`, or anything shaped like it). `pds` calls the PDS itself (the user's repo).
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
* in to yet uses {@link connectAnonymous}: public reads straight from the platform, no write.
|
|
17
18
|
*/
|
|
18
19
|
import type { FetchHandler } from '@atproto/xrpc';
|
|
19
|
-
import { AtpBaseClient } from './generated/index.js';
|
|
20
|
+
import { AtpBaseClient, type PubTechneDraftIdentityWriteAsCollective } from './generated/index.js';
|
|
20
21
|
import type { IncludeOf, ItemFor, RecordOfQuery, RecordOfUri } from './item.js';
|
|
21
22
|
import type { Query } from './query/index.js';
|
|
22
23
|
import type { PutRecord, PutResult } from './put/index.js';
|
|
@@ -57,7 +58,11 @@ export interface ReadOptions<K extends readonly unknown[], R> {
|
|
|
57
58
|
queryKey: K;
|
|
58
59
|
queryFn: () => Promise<R>;
|
|
59
60
|
}
|
|
60
|
-
/**
|
|
61
|
+
/** {@link Techne.writeAsCollective}'s input: com.atproto.repo.applyWrites's, with `repo` the collective's DID. */
|
|
62
|
+
export type WriteAsCollectiveInput = PubTechneDraftIdentityWriteAsCollective.InputSchema;
|
|
63
|
+
/** {@link Techne.writeAsCollective}'s answer: com.atproto.repo.applyWrites's (`commit`, `results`). */
|
|
64
|
+
export type WriteAsCollectiveOutput = PubTechneDraftIdentityWriteAsCollective.OutputSchema;
|
|
65
|
+
/** The SDK's client for one signed-in user: its clients, its reads and its writes. */
|
|
61
66
|
export interface Techne extends Clients {
|
|
62
67
|
/** One page of a query document; a list across authors answers curated records. Valid items by default
|
|
63
68
|
* (`ValidItem<T>`); `{ include: 'all' }` any verdict (`Item<T>`). */
|
|
@@ -70,6 +75,16 @@ export interface Techne extends Clients {
|
|
|
70
75
|
versions<U extends string>(uri: U): Promise<Versions<RecordOfUri<U>> | null>;
|
|
71
76
|
/** Write records, and with `deletes` delete some (`techne-sdk/put` says how). */
|
|
72
77
|
put(records: PutRecord[], options?: PutOptions): Promise<PutResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Write as a collective the user may write as (`pub.techne.draft.identity.writeAsCollective`): the
|
|
80
|
+
* writes are applied atomically to the collective's repo by the platform, with the credential it holds
|
|
81
|
+
* for the collective, after it checks the user's role there (403 `Forbidden` when the user may not).
|
|
82
|
+
* `input` is com.atproto.repo.applyWrites's, `repo` the collective's DID (never the user's own: that is
|
|
83
|
+
* `put`, or the PDS's applyWrites). Under {@link connect} it goes through the user's PDS like every
|
|
84
|
+
* platform call, so the app's OAuth scope needs
|
|
85
|
+
* `rpc:pub.techne.draft.identity.writeAsCollective?aud=<platform DID>%23atproto_appview`.
|
|
86
|
+
*/
|
|
87
|
+
writeAsCollective(input: WriteAsCollectiveInput): Promise<WriteAsCollectiveOutput>;
|
|
73
88
|
/** The options forms (TanStack Query's `{ queryKey, queryFn }`). Each key ends with the viewer's DID, so
|
|
74
89
|
* one viewer's reads are never another's, and a prefix (`['techne', 'versions']`) still names them all. */
|
|
75
90
|
queryOptions<Q extends Query, O extends QueryOpts = {}>(q: Q, opts?: O): ReadOptions<readonly ['techne', 'query', Q, QueryOpts, string], Page<RecordOfQuery<Q>, IncludeOf<O>>>;
|
package/dist/connect.js
CHANGED
|
@@ -16,6 +16,7 @@ export function bind(clients) {
|
|
|
16
16
|
get: (uri, opts) => get(techne, uri, opts),
|
|
17
17
|
versions: (uri) => versions(techne, uri),
|
|
18
18
|
put: (records, options) => put(techne, records, options),
|
|
19
|
+
writeAsCollective: async (input) => (await clients.platform.pub.techne.draft.identity.writeAsCollective(input)).data,
|
|
19
20
|
queryOptions: (q, opts) => ({ queryKey: ['techne', 'query', q, opts ?? {}, clients.did], queryFn: () => query(techne, q, opts) }),
|
|
20
21
|
getOptions: (uri, opts) => ({ queryKey: ['techne', 'record', uri, opts ?? {}, clients.did], queryFn: () => get(techne, uri, opts) }),
|
|
21
22
|
versionsOptions: (uri) => ({ queryKey: ['techne', 'versions', uri, clients.did], queryFn: () => versions(techne, uri) }),
|
|
@@ -78,6 +79,7 @@ export function connectAnonymous(platform = TECHNE_PLATFORM_DID, options = {}) {
|
|
|
78
79
|
const nowhere = async () => Promise.reject(new Error(SIGN_IN_TO_WRITE));
|
|
79
80
|
const techne = bind({ did: '', pds: new AtpBaseClient(nowhere), platform: new AtpBaseClient(direct), claims: options.claims });
|
|
80
81
|
techne.put = async () => Promise.reject(new Error(SIGN_IN_TO_WRITE));
|
|
82
|
+
techne.writeAsCollective = async () => Promise.reject(new Error(SIGN_IN_TO_WRITE));
|
|
81
83
|
return techne;
|
|
82
84
|
}
|
|
83
85
|
/**
|
|
@@ -72,6 +72,7 @@ import * as PubTechneDraftIdentityResolve from './types/pub/techne/draft/identit
|
|
|
72
72
|
import * as PubTechneDraftIdentityRevokeLinkToken from './types/pub/techne/draft/identity/revokeLinkToken.js';
|
|
73
73
|
import * as PubTechneDraftIdentityUnlinkAccount from './types/pub/techne/draft/identity/unlinkAccount.js';
|
|
74
74
|
import * as PubTechneDraftIdentityUnlinkMethod from './types/pub/techne/draft/identity/unlinkMethod.js';
|
|
75
|
+
import * as PubTechneDraftIdentityWriteAsCollective from './types/pub/techne/draft/identity/writeAsCollective.js';
|
|
75
76
|
import * as PubTechneDraftInterest from './types/pub/techne/draft/interest.js';
|
|
76
77
|
import * as PubTechneDraftIntroProposal from './types/pub/techne/draft/introProposal.js';
|
|
77
78
|
import * as PubTechneDraftInvite from './types/pub/techne/draft/invite.js';
|
|
@@ -229,6 +230,7 @@ export * as PubTechneDraftIdentityResolve from './types/pub/techne/draft/identit
|
|
|
229
230
|
export * as PubTechneDraftIdentityRevokeLinkToken from './types/pub/techne/draft/identity/revokeLinkToken.js';
|
|
230
231
|
export * as PubTechneDraftIdentityUnlinkAccount from './types/pub/techne/draft/identity/unlinkAccount.js';
|
|
231
232
|
export * as PubTechneDraftIdentityUnlinkMethod from './types/pub/techne/draft/identity/unlinkMethod.js';
|
|
233
|
+
export * as PubTechneDraftIdentityWriteAsCollective from './types/pub/techne/draft/identity/writeAsCollective.js';
|
|
232
234
|
export * as PubTechneDraftInterest from './types/pub/techne/draft/interest.js';
|
|
233
235
|
export * as PubTechneDraftIntroProposal from './types/pub/techne/draft/introProposal.js';
|
|
234
236
|
export * as PubTechneDraftInvite from './types/pub/techne/draft/invite.js';
|
|
@@ -719,6 +721,7 @@ export declare class PubTechneDraftIdentityNS {
|
|
|
719
721
|
revokeLinkToken(data?: PubTechneDraftIdentityRevokeLinkToken.InputSchema, opts?: PubTechneDraftIdentityRevokeLinkToken.CallOptions): Promise<PubTechneDraftIdentityRevokeLinkToken.Response>;
|
|
720
722
|
unlinkAccount(data?: PubTechneDraftIdentityUnlinkAccount.InputSchema, opts?: PubTechneDraftIdentityUnlinkAccount.CallOptions): Promise<PubTechneDraftIdentityUnlinkAccount.Response>;
|
|
721
723
|
unlinkMethod(data?: PubTechneDraftIdentityUnlinkMethod.InputSchema, opts?: PubTechneDraftIdentityUnlinkMethod.CallOptions): Promise<PubTechneDraftIdentityUnlinkMethod.Response>;
|
|
724
|
+
writeAsCollective(data?: PubTechneDraftIdentityWriteAsCollective.InputSchema, opts?: PubTechneDraftIdentityWriteAsCollective.CallOptions): Promise<PubTechneDraftIdentityWriteAsCollective.Response>;
|
|
722
725
|
}
|
|
723
726
|
export declare class PubTechneDraftIdentityLinkRedemptionRecord {
|
|
724
727
|
_client: XrpcClient;
|
package/dist/generated/index.js
CHANGED
|
@@ -35,6 +35,7 @@ import * as PubTechneDraftIdentityResolve from './types/pub/techne/draft/identit
|
|
|
35
35
|
import * as PubTechneDraftIdentityRevokeLinkToken from './types/pub/techne/draft/identity/revokeLinkToken.js';
|
|
36
36
|
import * as PubTechneDraftIdentityUnlinkAccount from './types/pub/techne/draft/identity/unlinkAccount.js';
|
|
37
37
|
import * as PubTechneDraftIdentityUnlinkMethod from './types/pub/techne/draft/identity/unlinkMethod.js';
|
|
38
|
+
import * as PubTechneDraftIdentityWriteAsCollective from './types/pub/techne/draft/identity/writeAsCollective.js';
|
|
38
39
|
import * as PubTechneDraftPermissionedDeleteRecord from './types/pub/techne/draft/permissioned/deleteRecord.js';
|
|
39
40
|
import * as PubTechneDraftPermissionedGetGrants from './types/pub/techne/draft/permissioned/getGrants.js';
|
|
40
41
|
import * as PubTechneDraftPermissionedGetRecord from './types/pub/techne/draft/permissioned/getRecord.js';
|
|
@@ -152,6 +153,7 @@ export * as PubTechneDraftIdentityResolve from './types/pub/techne/draft/identit
|
|
|
152
153
|
export * as PubTechneDraftIdentityRevokeLinkToken from './types/pub/techne/draft/identity/revokeLinkToken.js';
|
|
153
154
|
export * as PubTechneDraftIdentityUnlinkAccount from './types/pub/techne/draft/identity/unlinkAccount.js';
|
|
154
155
|
export * as PubTechneDraftIdentityUnlinkMethod from './types/pub/techne/draft/identity/unlinkMethod.js';
|
|
156
|
+
export * as PubTechneDraftIdentityWriteAsCollective from './types/pub/techne/draft/identity/writeAsCollective.js';
|
|
155
157
|
export * as PubTechneDraftInterest from './types/pub/techne/draft/interest.js';
|
|
156
158
|
export * as PubTechneDraftIntroProposal from './types/pub/techne/draft/introProposal.js';
|
|
157
159
|
export * as PubTechneDraftInvite from './types/pub/techne/draft/invite.js';
|
|
@@ -1050,6 +1052,13 @@ export class PubTechneDraftIdentityNS {
|
|
|
1050
1052
|
throw PubTechneDraftIdentityUnlinkMethod.toKnownErr(e);
|
|
1051
1053
|
});
|
|
1052
1054
|
}
|
|
1055
|
+
writeAsCollective(data, opts) {
|
|
1056
|
+
return this._client
|
|
1057
|
+
.call('pub.techne.draft.identity.writeAsCollective', opts?.qp, data, opts)
|
|
1058
|
+
.catch((e) => {
|
|
1059
|
+
throw PubTechneDraftIdentityWriteAsCollective.toKnownErr(e);
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1053
1062
|
}
|
|
1054
1063
|
export class PubTechneDraftIdentityLinkRedemptionRecord {
|
|
1055
1064
|
_client;
|