techne-sdk 0.3.0 → 0.3.2
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 +38 -0
- package/README.md +7 -16
- package/dist/auth/index.d.ts +7 -0
- package/dist/auth/index.js +3 -1
- package/dist/catalog/catalog.gen.js +34 -28
- package/dist/connect.d.ts +4 -1
- package/dist/connect.js +7 -3
- package/dist/generated/lexicons.d.ts +44 -36
- package/dist/generated/lexicons.js +22 -18
- package/dist/generated/types/pub/techne/draft/identity/listPhoneHolds.d.ts +2 -0
- package/dist/generated/types/pub/techne/draft/permissioned/putRecord.d.ts +3 -3
- package/dist/generated/types/pub/techne/draft/permissioned/putRecords.d.ts +2 -2
- package/dist/generated/types/pub/techne/draft/query/composeRecords.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/query/listRecords.d.ts +1 -1
- package/dist/put/index.d.ts +5 -1
- package/dist/put/index.js +16 -3
- package/dist/wasm/techne-wasm.gen.js +1 -1
- package/dist/wasm/techne-wasm2js.gen.js +20713 -20449
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
`techne-sdk` on npm and the `techne-sdk` crate share a version. Each entry names what changes for an app or
|
|
4
4
|
a crate user.
|
|
5
5
|
|
|
6
|
+
## 0.3.2 (2026-11-10)
|
|
7
|
+
|
|
8
|
+
Built on lexicons `v0.1.22-techne.63` (693f27ce) and the platform's published API at regenOS main `d3f224e6a`
|
|
9
|
+
(`inputs.pin.json`). The crate depends on `techne-lexicon-check` 0.3.2 from crates.io, packaged from that
|
|
10
|
+
lexicons tag.
|
|
11
|
+
|
|
12
|
+
- **A private record must name its space.** The platform now refuses a `permissioned.putRecord(s)` write
|
|
13
|
+
with no `space` (400 `InvalidRequest`; lucian 2026-11-09). `put` checks first: a record that is written
|
|
14
|
+
privately (a type with no public home) and names no `space` throws `PutError` with `InvalidRequest`, and
|
|
15
|
+
nothing is written. A record only the person reads goes in their own `space.personal`
|
|
16
|
+
(`at://{did}/pub.techne.draft.space.personal/self`). Public records are unchanged. The generated types say so too: `space` is now
|
|
17
|
+
required on `pub.techne.draft.permissioned.putRecord`'s input and on each `putRecords` write (a type error
|
|
18
|
+
for code that builds those calls by hand without one).
|
|
19
|
+
- **`put` knows a community draft by the registry's own rule.** A community draft is now a name the
|
|
20
|
+
pinned check's `community::is_community` accepts: `pub.techne.draft.c.<id>.<name>` with an id the
|
|
21
|
+
registry mints (6 to 26 lower-case base32, starting with a letter), in lower case. 0.3.1 matched any
|
|
22
|
+
name under that prefix, without case, so a malformed one (`pub.techne.draft.c.r8fd.toolListing`,
|
|
23
|
+
`Pub.Techne.Draft.C.…`) went to the user's public repo. Such a name is a typo under the platform's
|
|
24
|
+
namespace and now stays private, like any other.
|
|
25
|
+
- **`listPhoneHolds` holds carry `name`.** On a hold the caller asked for, the `name` of the caller's own
|
|
26
|
+
active contact on that number (optional `HoldView.name`). Lexicon description texts are updated
|
|
27
|
+
throughout (the generated doc comments and the WebAssembly's embedded lexicons follow).
|
|
28
|
+
|
|
29
|
+
## 0.3.1
|
|
30
|
+
|
|
31
|
+
Fixes found by a developer building on 0.3.0 from the public docs alone (techne.computer, 2026-11-09).
|
|
32
|
+
|
|
33
|
+
- **`connect(session, platform)` works with an atproto `OAuthSession`.** It passed `session.fetchHandler`
|
|
34
|
+
on unbound, and an `OAuthSession`'s is a method that reads its own token set, so the first call threw
|
|
35
|
+
`Cannot read properties of undefined (reading 'getTokenSet')`. It now calls it on the session. The doc
|
|
36
|
+
comment names the platform DID as `did:web:techne.computer` (`TECHNE_PLATFORM_DID`).
|
|
37
|
+
- **`put` writes a community draft (`pub.techne.draft.c.*`) to the user's repo.** It counted the community
|
|
38
|
+
namespace as the platform's own and sent those records to the private batch write. A community draft
|
|
39
|
+
record is public now, like another app's own type; with a `space` it is private, as any record.
|
|
40
|
+
- **`scopes({ publish: true })`** (and `signIn`, `clientMetadata`): adds
|
|
41
|
+
`rpc:pub.techne.draft.registry.publishType` at the platform, so an app can publish its own community
|
|
42
|
+
type as the signed-in person. Off by default.
|
|
43
|
+
|
|
6
44
|
## 0.3.0
|
|
7
45
|
|
|
8
46
|
Built on lexicons `agent/devplatform` b10ae5d and the platform's published API at regenOS `e3814f0f6`
|
package/README.md
CHANGED
|
@@ -91,8 +91,9 @@ else {
|
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
- **Who:** with no `handle`, the sign-in starts at the default PDS (techne.town), which asks who you are. A bare name (`alice`) is a handle on the default handle domain. A full handle, a DID or a PDS URL from any PDS is used as given. `signUp({ clientId })` opens the PDS's create-account screen.
|
|
94
|
-
- **Scopes:** `scopes({ clientId })` is what it asks for by default, least privilege: `atproto`; the platform's `authPermissioned` permission set with the platform as its audience (the `permissioned.*` calls: private writes, reads and deletes); the app's own private space, `space:pub.techne.draft.space.private?skey=<appKey>`; and an `rpc:<nsid>?aud=<platform>%23atproto_appview` scope for each generic read the SDK makes signed in: `query.listRecords`, `query.countRecords` and `query.getRecords` (`techne-sdk/query`, `put`'s curation answer) and `registry.getType` and `registry.listTypes`. The platform narrows those reads by the token's space scopes, so they reach public data and the app's own space. An app passes the types it writes as `types: [nsid, ...]`, and each adds a `repo:<nsid>` scope (create, update, delete), as the platform's own least-privilege list does, plus `rpc:pub.techne.draft.sync.indexRecord` so `put` can hint the platform what it wrote (a pending type's records are indexed no other way); without `types` the app writes no public record. `query.composeRecords` is not in the default (the SDK makes no such call); an app that calls it asks for `everything: 'read'`. Everything the person can reach (their personal space, their circles, beacons shared with them) is an opt-in: `everything: 'read'` adds the `authRead` set, `everything: 'write'` adds `authRead`, `authWrite` and a `repo:` scope for the public `community.lexicon.*` records (then our own public types need no `types` entry). The consent page shows those with a large warning; ask only if the app needs them. Pass the same `types` and `everything` to `signIn` and `clientMetadata`, since the PDS refuses a request beyond what the metadata declares. Pass `scope` to ask for other scopes, and pass it to both.
|
|
95
|
-
- **
|
|
94
|
+
- **Scopes:** `scopes({ clientId })` is what it asks for by default, least privilege: `atproto`; the platform's `authPermissioned` permission set with the platform as its audience (the `permissioned.*` calls: private writes, reads and deletes); the app's own private space, `space:pub.techne.draft.space.private?skey=<appKey>`; and an `rpc:<nsid>?aud=<platform>%23atproto_appview` scope for each generic read the SDK makes signed in: `query.listRecords`, `query.countRecords` and `query.getRecords` (`techne-sdk/query`, `put`'s curation answer) and `registry.getType` and `registry.listTypes`. The platform narrows those reads by the token's space scopes, so they reach public data and the app's own space. An app passes the types it writes as `types: [nsid, ...]`, and each adds a `repo:<nsid>` scope (create, update, delete), as the platform's own least-privilege list does, plus `rpc:pub.techne.draft.sync.indexRecord` so `put` can hint the platform what it wrote (a pending type's records are indexed no other way); without `types` the app writes no public record. `query.composeRecords` is not in the default (the SDK makes no such call); an app that calls it asks for `everything: 'read'`. Everything the person can reach (their personal space, their circles, beacons shared with them) is an opt-in: `everything: 'read'` adds the `authRead` set, `everything: 'write'` adds `authRead`, `authWrite` and a `repo:` scope for the public `community.lexicon.*` records (then our own public types need no `types` entry). The consent page shows those with a large warning; ask only if the app needs them. Pass the same `types` and `everything` to `signIn` and `clientMetadata`, since the PDS refuses a request beyond what the metadata declares. Pass `scope` to ask for other scopes, and pass it to both. An app that publishes its own community type (`pub.techne.draft.c.*`) as the signed-in person passes `publish: true`, which adds `rpc:pub.techne.draft.registry.publishType` (publishing a type is a public act). The type's NSID is the registry's answer, so its `repo:` scope can be asked for only after publishing: publish once (a setup sign-in with `publish: true`), then sign in with the published NSID in `types`.
|
|
95
|
+
- **A private record names its space:** a record of a type with no public home is written privately, and it must name the `space` it is for; `put` throws `PutError` (`InvalidRequest`) with nothing written when one does not, as the platform's `permissioned.putRecords` refuses it. A record only the person reads goes in their own `space.personal`: `` { record, space: `at://${did}/pub.techne.draft.space.personal/self` } ``. Public records name no space and go to the person's PDS.
|
|
96
|
+
- **The app's private space:** `appSpace(session.did, clientId)` is `at://{did}/pub.techne.draft.space.private/{appKey}`, where `appKey(clientId)` is the client id hashed (base32, lowercase, no padding, of its SHA-256; the platform's `sidecar_rkey`). Write there with `put(techne, [{ record, space: appSpace(did, clientId) }])` and read with `permissioned.listRecords({ space })`. Only that person reads it, and only through this app. In development the client id is the loopback client's, `resolveClientId(options)` with the same options `signIn` took: it carries the scope, so it changes with the port, `types` and `everything`, and so does the space. Its scope names the space type without a key (an id cannot carry its own hash); Techne's PDS reads that keyless scope from a loopback client as its own space, adds the key when it calls the platform, and shows the own-space line on the consent page. The browser keeps one stored session per origin, so a page that switches between client ids (other `types`, another port's id) signs out first; `restore` hands back whichever session the origin holds.
|
|
96
97
|
- **Development:** on `localhost` or `127.0.0.1` you can leave `clientId` out. The SDK then uses atproto's loopback client, so you don't need to host anything.
|
|
97
98
|
- **Sessions:** the library refreshes tokens itself. `restore` returns the session, `null` when nobody is signed in, and rejects when a sign-in or refresh failed. `signOut({ clientId, session })` revokes the session. `onSessionDeleted` tells you when the library drops a session. A `state` passed to `signIn` comes back from `redirectState({ clientId })` on the page the redirect lands on.
|
|
98
99
|
- **Another deployment:** `platform` names the platform's DID (`TECHNE_PLATFORM_DID` by default). `pds`, `plcUrl` and `handleDomain` name the PDS people sign in at, its PLC directory and its handle domain. Pass them the same way to every call.
|
|
@@ -113,20 +114,10 @@ else {
|
|
|
113
114
|
|
|
114
115
|
## Changing it
|
|
115
116
|
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
`npm run codegen` needs the pinned Rust toolchain (`rust-toolchain.toml`) with the `wasm32-unknown-unknown` target, and `npx` for binaryen. The build is reproducible, so the gate can diff it against the committed one.
|
|
121
|
-
|
|
122
|
-
## The gate
|
|
123
|
-
|
|
124
|
-
```sh
|
|
125
|
-
bash scripts/gate.sh # inputs, codegen (no drift), typecheck, test, package, rust
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
`package` builds `dist/`, then loads every subpath through `exports` in plain Node and runs the fixtures through the built WebAssembly and wasm2js modules. It also checks the `npm pack` file list with a dry run. `rust` runs the same fixtures through the crate.
|
|
117
|
+
Re-pinning a lexicon or platform API change, rebuilding the generated code and WebAssembly, and the gate
|
|
118
|
+
are in [wiki/development/inputs-and-codegen.md](https://github.com/technefoundation/sdk/blob/main/wiki/development/inputs-and-codegen.md) and
|
|
119
|
+
[wiki/development/gate-and-tests.md](https://github.com/technefoundation/sdk/blob/main/wiki/development/gate-and-tests.md).
|
|
129
120
|
|
|
130
121
|
## Releasing
|
|
131
122
|
|
|
132
|
-
See [RELEASING.md](RELEASING.md).
|
|
123
|
+
See [RELEASING.md](https://github.com/technefoundation/sdk/blob/main/RELEASING.md).
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -106,6 +106,8 @@ export interface ClientOptions {
|
|
|
106
106
|
types?: readonly string[];
|
|
107
107
|
/** Ask for everything the person can reach, for the default {@link scopes} (ignored with `scope`). */
|
|
108
108
|
everything?: Everything;
|
|
109
|
+
/** Ask to publish community types, for the default {@link scopes} (ignored with `scope`). */
|
|
110
|
+
publish?: boolean;
|
|
109
111
|
/** The page's location; `globalThis.location` by default. */
|
|
110
112
|
location?: Pick<Location, 'protocol' | 'hostname' | 'port'>;
|
|
111
113
|
/** The home PDS: where handles resolve, and where a sign-in with no handle and every sign-up start.
|
|
@@ -134,6 +136,9 @@ export interface ScopesOptions {
|
|
|
134
136
|
types?: readonly string[];
|
|
135
137
|
/** Everything the person can reach, an opt-in (see {@link Everything}); none by default. */
|
|
136
138
|
everything?: Everything;
|
|
139
|
+
/** Ask to publish community types (`registry.publishType`), for an app that publishes its own type
|
|
140
|
+
* (`pub.techne.draft.c.*`) as the signed-in person. Off by default. */
|
|
141
|
+
publish?: boolean;
|
|
137
142
|
}
|
|
138
143
|
/** The scopes signIn asks for by default (see the module doc): least privilege, the permissioned calls,
|
|
139
144
|
* the app's own private space, an `rpc` scope per read in `READ_METHODS` and a `repo` scope per type
|
|
@@ -155,6 +160,8 @@ export interface ClientMetadataOptions {
|
|
|
155
160
|
types?: readonly string[];
|
|
156
161
|
/** As {@link ClientOptions.everything}. */
|
|
157
162
|
everything?: Everything;
|
|
163
|
+
/** As {@link ClientOptions.publish}. */
|
|
164
|
+
publish?: boolean;
|
|
158
165
|
platform?: string;
|
|
159
166
|
}
|
|
160
167
|
/** The client-metadata document an app serves at its client id: a public browser client (no secret,
|
package/dist/auth/index.js
CHANGED
|
@@ -57,7 +57,7 @@ export function scopes(o) {
|
|
|
57
57
|
}
|
|
58
58
|
/** {@link scopes}, with `space` the private-space scope's query: the app's key, or nothing for the
|
|
59
59
|
* loopback client (whose id is built from its scope, so the scope cannot name the id's hash). */
|
|
60
|
-
function scopeList({ platform = TECHNE_PLATFORM_DID, types = [], everything }, space) {
|
|
60
|
+
function scopeList({ platform = TECHNE_PLATFORM_DID, types = [], everything, publish }, space) {
|
|
61
61
|
if (everything !== undefined && everything !== 'read' && everything !== 'write') {
|
|
62
62
|
throw new TypeError(`techne-sdk/auth: everything is 'read' or 'write' (got ${JSON.stringify(everything)})`);
|
|
63
63
|
}
|
|
@@ -82,6 +82,8 @@ function scopeList({ platform = TECHNE_PLATFORM_DID, types = [], everything }, s
|
|
|
82
82
|
// `put` hints each public write to the platform (the only way a pending type's records are indexed);
|
|
83
83
|
// authWrite carries that call, so without it an app that writes public types asks for it alone.
|
|
84
84
|
...(own.length && !write ? [`rpc:${NSID.SYNC_INDEX_RECORD}?aud=${aud}`] : []),
|
|
85
|
+
// Publishing a community type: a public act, asked for only by an app that does it.
|
|
86
|
+
...(publish ? [`rpc:${NSID.REGISTRY_PUBLISH_TYPE}?aud=${aud}`] : []),
|
|
85
87
|
];
|
|
86
88
|
}
|
|
87
89
|
/** A `repo` scope for `collections`, every action (regenOS `regenos_appview::nsid_rewrite::repo_scope`,
|
|
@@ -5585,14 +5585,14 @@ export const catalog = {
|
|
|
5585
5585
|
"name": "draft.identity.createCollective",
|
|
5586
5586
|
"group": "pub.techne",
|
|
5587
5587
|
"kind": "procedure",
|
|
5588
|
-
"description": "Make a collective account: a new DID whose credential the platform holds, with a random handle and no records. Nothing is placed or published: the caller then writes as the collective (permissioned.putRecords or com.atproto.repo.applyWrites, repo = the new DID), deciding where its descriptor and memberships live. Until the collective's first record is placed in a space (and for at most a day), its creator may write as it; from then on, whoever
|
|
5588
|
+
"description": "Make a collective account: a new DID whose credential the platform holds, with a random handle and no records. Nothing is placed or published: the caller then writes as the collective (permissioned.putRecords or com.atproto.repo.applyWrites, repo = the new DID), deciding where its descriptor and memberships live. Until the collective's first record is placed in a space (and for at most a day), its creator may write as it; from then on, only whoever manages its own member space (`pub.techne.draft.space.collective.member/self`) may; managing another of its spaces (an event's invite space, say) gives no pen. So a creator who will manage it writes its own membership in the first batch. Any signed-in DID; one call spends one of the caller's writes. A retried call makes another, empty, collective.",
|
|
5589
5589
|
"doc": ({
|
|
5590
5590
|
"lexicon": 1,
|
|
5591
5591
|
"id": "pub.techne.draft.identity.createCollective",
|
|
5592
5592
|
"defs": {
|
|
5593
5593
|
"main": {
|
|
5594
5594
|
"type": "procedure",
|
|
5595
|
-
"description": "Make a collective account: a new DID whose credential the platform holds, with a random handle and no records. Nothing is placed or published: the caller then writes as the collective (permissioned.putRecords or com.atproto.repo.applyWrites, repo = the new DID), deciding where its descriptor and memberships live. Until the collective's first record is placed in a space (and for at most a day), its creator may write as it; from then on, whoever
|
|
5595
|
+
"description": "Make a collective account: a new DID whose credential the platform holds, with a random handle and no records. Nothing is placed or published: the caller then writes as the collective (permissioned.putRecords or com.atproto.repo.applyWrites, repo = the new DID), deciding where its descriptor and memberships live. Until the collective's first record is placed in a space (and for at most a day), its creator may write as it; from then on, only whoever manages its own member space (`pub.techne.draft.space.collective.member/self`) may; managing another of its spaces (an event's invite space, say) gives no pen. So a creator who will manage it writes its own membership in the first batch. Any signed-in DID; one call spends one of the caller's writes. A retried call makes another, empty, collective.",
|
|
5596
5596
|
"input": {
|
|
5597
5597
|
"encoding": "application/json",
|
|
5598
5598
|
"schema": {
|
|
@@ -6105,14 +6105,14 @@ export const catalog = {
|
|
|
6105
6105
|
"name": "draft.identity.holdForPhone",
|
|
6106
6106
|
"group": "pub.techne",
|
|
6107
6107
|
"kind": "procedure",
|
|
6108
|
-
"description": "Hold a write until someone proves a phone number: when an account proves `phone`, the platform fills every string value exactly \"$subject\" in `write.record` (and \"$subject\" in `write.rkey`) with that account's DID and every value exactly \"$now\" in the record with the time, and writes the record as `actAs` in `write.space` with what it holds for that account. Only the number's keyed hash is kept; the template may not contain the number. Every hold is answered alike, whether or not the number already has an account: one that has is released the next time it is proved (each phone sign-in proves it), never at once, so nothing here says whether a number has an account or whose it is. The caller must be able to write as `actAs` (its own DID, a collective or circle whose space it manages, or a collective it made that has nothing placed yet), now and again when the number is proved; a hold whose caller no longer may, or with a block either way between the new account and the caller or `actAs`, is dropped unwritten, as is one whose record the space does not admit. The record must be one permissioned.putRecord would take with the caller's DID in the slot, and must carry the slot. The nightly sweep deletes a hold 180 days after it was made. Holding again with the same number, `actAs`, `collection`, `space`, `rkey` and record `space` answers the existing hold unchanged (the first template wins; withdraw it with releasePhoneHold and hold again to change it). The template is shown to everyone who may write as `actAs` and read `space` (listPhoneHolds). Identity knows nothing about what the record means. Any signed-in DID; one call spends one of the caller's writes.",
|
|
6108
|
+
"description": "Hold a write until someone proves a phone number: when an account proves `phone`, the platform fills every string value exactly \"$subject\" in `write.record` (and \"$subject\" in `write.rkey`) with that account's DID and every value exactly \"$now\" in the record with the time, and writes the record as `actAs` in `write.space` with what it holds for that account. Only the number's keyed hash is kept; the template may not contain the number. Every hold is answered alike, whether or not the number already has an account: one that has is released the next time it is proved (each phone sign-in proves it), never at once, so nothing here says whether a number has an account or whose it is. The caller must be able to write as `actAs` (its own DID, a collective or circle whose own member space (`space.collective.member/self`) it manages, or a collective it made that has nothing placed yet), now and again when the number is proved; a hold whose caller no longer may, or with a block either way between the new account and the caller or `actAs`, is dropped unwritten, as is one whose record the space does not admit. The record must be one permissioned.putRecord would take with the caller's DID in the slot, and must carry the slot. The nightly sweep deletes a hold 180 days after it was made. Holding again with the same number, `actAs`, `collection`, `space`, `rkey` and record `space` answers the existing hold unchanged (the first template wins; withdraw it with releasePhoneHold and hold again to change it). The template is shown to everyone who may write as `actAs` and read `space` (listPhoneHolds). Identity knows nothing about what the record means. Any signed-in DID; one call spends one of the caller's writes.",
|
|
6109
6109
|
"doc": ({
|
|
6110
6110
|
"lexicon": 1,
|
|
6111
6111
|
"id": "pub.techne.draft.identity.holdForPhone",
|
|
6112
6112
|
"defs": {
|
|
6113
6113
|
"main": {
|
|
6114
6114
|
"type": "procedure",
|
|
6115
|
-
"description": "Hold a write until someone proves a phone number: when an account proves `phone`, the platform fills every string value exactly \"$subject\" in `write.record` (and \"$subject\" in `write.rkey`) with that account's DID and every value exactly \"$now\" in the record with the time, and writes the record as `actAs` in `write.space` with what it holds for that account. Only the number's keyed hash is kept; the template may not contain the number. Every hold is answered alike, whether or not the number already has an account: one that has is released the next time it is proved (each phone sign-in proves it), never at once, so nothing here says whether a number has an account or whose it is. The caller must be able to write as `actAs` (its own DID, a collective or circle whose space it manages, or a collective it made that has nothing placed yet), now and again when the number is proved; a hold whose caller no longer may, or with a block either way between the new account and the caller or `actAs`, is dropped unwritten, as is one whose record the space does not admit. The record must be one permissioned.putRecord would take with the caller's DID in the slot, and must carry the slot. The nightly sweep deletes a hold 180 days after it was made. Holding again with the same number, `actAs`, `collection`, `space`, `rkey` and record `space` answers the existing hold unchanged (the first template wins; withdraw it with releasePhoneHold and hold again to change it). The template is shown to everyone who may write as `actAs` and read `space` (listPhoneHolds). Identity knows nothing about what the record means. Any signed-in DID; one call spends one of the caller's writes.",
|
|
6115
|
+
"description": "Hold a write until someone proves a phone number: when an account proves `phone`, the platform fills every string value exactly \"$subject\" in `write.record` (and \"$subject\" in `write.rkey`) with that account's DID and every value exactly \"$now\" in the record with the time, and writes the record as `actAs` in `write.space` with what it holds for that account. Only the number's keyed hash is kept; the template may not contain the number. Every hold is answered alike, whether or not the number already has an account: one that has is released the next time it is proved (each phone sign-in proves it), never at once, so nothing here says whether a number has an account or whose it is. The caller must be able to write as `actAs` (its own DID, a collective or circle whose own member space (`space.collective.member/self`) it manages, or a collective it made that has nothing placed yet), now and again when the number is proved; a hold whose caller no longer may, or with a block either way between the new account and the caller or `actAs`, is dropped unwritten, as is one whose record the space does not admit. The record must be one permissioned.putRecord would take with the caller's DID in the slot, and must carry the slot. The nightly sweep deletes a hold 180 days after it was made. Holding again with the same number, `actAs`, `collection`, `space`, `rkey` and record `space` answers the existing hold unchanged (the first template wins; withdraw it with releasePhoneHold and hold again to change it). The template is shown to everyone who may write as `actAs` and read `space` (listPhoneHolds). Identity knows nothing about what the record means. Any signed-in DID; one call spends one of the caller's writes.",
|
|
6116
6116
|
"input": {
|
|
6117
6117
|
"encoding": "application/json",
|
|
6118
6118
|
"schema": {
|
|
@@ -6669,14 +6669,14 @@ export const catalog = {
|
|
|
6669
6669
|
"name": "draft.identity.listPhoneHolds",
|
|
6670
6670
|
"group": "pub.techne",
|
|
6671
6671
|
"kind": "query",
|
|
6672
|
-
"description": "The live holds (identity.holdForPhone) that would write as `actAs`, oldest first, for anyone who may write as it, and of those only the holds for a space the caller may read. With `alsoActAs`, the holds of each of those accounts too, in the order first asked (an account asked twice is listed once) (so a client lists every circle's pending members in one call): an account among them the caller may not write as is passed over, and writing as none of them is 403. A hold shows the account it writes as, who asked and the template as written, never the number or its hash (Beacon's circle template carries `addedBy`, so a circle shows \"1 pending, added by <member>\"). Holds are identity state, not records, so they are listed here and not through the generic query.",
|
|
6672
|
+
"description": "The live holds (identity.holdForPhone) that would write as `actAs`, oldest first, for anyone who may write as it, and of those only the holds for a space the caller may read. With `alsoActAs`, the holds of each of those accounts too, in the order first asked (an account asked twice is listed once) (so a client lists every circle's pending members in one call): an account among them the caller may not write as is passed over, and writing as none of them is 403. A hold shows the account it writes as, who asked and the template as written, never the number or its hash (Beacon's circle template carries `addedBy`, so a circle shows \"1 pending, added by <member>\"). A hold the caller asked for also carries `name`, the name the caller saved for the number in their own contacts, when they did. Holds are identity state, not records, so they are listed here and not through the generic query.",
|
|
6673
6673
|
"doc": ({
|
|
6674
6674
|
"lexicon": 1,
|
|
6675
6675
|
"id": "pub.techne.draft.identity.listPhoneHolds",
|
|
6676
6676
|
"defs": {
|
|
6677
6677
|
"main": {
|
|
6678
6678
|
"type": "query",
|
|
6679
|
-
"description": "The live holds (identity.holdForPhone) that would write as `actAs`, oldest first, for anyone who may write as it, and of those only the holds for a space the caller may read. With `alsoActAs`, the holds of each of those accounts too, in the order first asked (an account asked twice is listed once) (so a client lists every circle's pending members in one call): an account among them the caller may not write as is passed over, and writing as none of them is 403. A hold shows the account it writes as, who asked and the template as written, never the number or its hash (Beacon's circle template carries `addedBy`, so a circle shows \"1 pending, added by <member>\"). Holds are identity state, not records, so they are listed here and not through the generic query.",
|
|
6679
|
+
"description": "The live holds (identity.holdForPhone) that would write as `actAs`, oldest first, for anyone who may write as it, and of those only the holds for a space the caller may read. With `alsoActAs`, the holds of each of those accounts too, in the order first asked (an account asked twice is listed once) (so a client lists every circle's pending members in one call): an account among them the caller may not write as is passed over, and writing as none of them is 403. A hold shows the account it writes as, who asked and the template as written, never the number or its hash (Beacon's circle template carries `addedBy`, so a circle shows \"1 pending, added by <member>\"). A hold the caller asked for also carries `name`, the name the caller saved for the number in their own contacts, when they did. Holds are identity state, not records, so they are listed here and not through the generic query.",
|
|
6680
6680
|
"parameters": {
|
|
6681
6681
|
"type": "params",
|
|
6682
6682
|
"required": [
|
|
@@ -6770,6 +6770,10 @@ export const catalog = {
|
|
|
6770
6770
|
"createdAt": {
|
|
6771
6771
|
"type": "string",
|
|
6772
6772
|
"format": "datetime"
|
|
6773
|
+
},
|
|
6774
|
+
"name": {
|
|
6775
|
+
"type": "string",
|
|
6776
|
+
"description": "On a hold the caller asked for, the name the caller saved for its number: the `name` of the caller's own active `contact` on that number (the newest, when there are several), read when the listing is made. Never on a hold someone else asked for, and nothing of it is stored on the hold."
|
|
6773
6777
|
}
|
|
6774
6778
|
}
|
|
6775
6779
|
}
|
|
@@ -8340,15 +8344,15 @@ export const catalog = {
|
|
|
8340
8344
|
"name": "draft.permissioned.deleteRecord",
|
|
8341
8345
|
"group": "pub.techne",
|
|
8342
8346
|
"kind": "procedure",
|
|
8343
|
-
"description": "Delete one of your own permissioned records (or a collective's or circle's whose 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). 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. Draft tier.",
|
|
8347
|
+
"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). 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. Draft tier.",
|
|
8344
8348
|
"doc": ({
|
|
8345
8349
|
"lexicon": 1,
|
|
8346
8350
|
"id": "pub.techne.draft.permissioned.deleteRecord",
|
|
8347
|
-
"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 space the caller manages (
|
|
8351
|
+
"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), 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). 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. Draft tier.",
|
|
8348
8352
|
"defs": {
|
|
8349
8353
|
"main": {
|
|
8350
8354
|
"type": "procedure",
|
|
8351
|
-
"description": "Delete one of your own permissioned records (or a collective's or circle's whose 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). 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. Draft tier.",
|
|
8355
|
+
"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). 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. Draft tier.",
|
|
8352
8356
|
"input": {
|
|
8353
8357
|
"encoding": "application/json",
|
|
8354
8358
|
"schema": {
|
|
@@ -8853,15 +8857,15 @@ export const catalog = {
|
|
|
8853
8857
|
"name": "draft.permissioned.putRecord",
|
|
8854
8858
|
"group": "pub.techne",
|
|
8855
8859
|
"kind": "procedure",
|
|
8856
|
-
"description": "Write one record into your own repo (or a collective's or circle's whose space you manage) as a permissioned record, for the `space` it names. 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 write is never refused for its space. A pub.techne.draft.space.private record counts there only when written by the app its key names; else it counts in no space. The output's `space` says where it counts. Writing the current version again is a no-op. 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.",
|
|
8860
|
+
"description": "Write one record into your own repo (or a collective's or circle's whose own member space you manage) 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 write is never refused for its space. A pub.techne.draft.space.private record counts there only when written by the app its key names; else it counts in no space. The output's `space` says where it counts. Writing the current version again is a no-op. 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.",
|
|
8857
8861
|
"doc": ({
|
|
8858
8862
|
"lexicon": 1,
|
|
8859
8863
|
"id": "pub.techne.draft.permissioned.putRecord",
|
|
8860
|
-
"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 space the caller manages (
|
|
8864
|
+
"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), 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 and no collection check: any collection may be written, for any space. A write is never refused for its space. 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 counts there only when written by the app its key names (the managing app); written by any other app it is stored and counts in no space (the output has no `space`). Otherwise it is stored in the writer's repo, counts in no space, and only its writer reads it; write it again to ask again. 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. 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.",
|
|
8861
8865
|
"defs": {
|
|
8862
8866
|
"main": {
|
|
8863
8867
|
"type": "procedure",
|
|
8864
|
-
"description": "Write one record into your own repo (or a collective's or circle's whose space you manage) as a permissioned record, for the `space` it names. 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 write is never refused for its space. A pub.techne.draft.space.private record counts there only when written by the app its key names; else it counts in no space. The output's `space` says where it counts. Writing the current version again is a no-op. 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.",
|
|
8868
|
+
"description": "Write one record into your own repo (or a collective's or circle's whose own member space you manage) 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 write is never refused for its space. A pub.techne.draft.space.private record counts there only when written by the app its key names; else it counts in no space. The output's `space` says where it counts. Writing the current version again is a no-op. 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.",
|
|
8865
8869
|
"input": {
|
|
8866
8870
|
"encoding": "application/json",
|
|
8867
8871
|
"schema": {
|
|
@@ -8870,7 +8874,8 @@ export const catalog = {
|
|
|
8870
8874
|
"repo",
|
|
8871
8875
|
"collection",
|
|
8872
8876
|
"rkey",
|
|
8873
|
-
"record"
|
|
8877
|
+
"record",
|
|
8878
|
+
"space"
|
|
8874
8879
|
],
|
|
8875
8880
|
"properties": {
|
|
8876
8881
|
"repo": {
|
|
@@ -8900,7 +8905,7 @@ export const catalog = {
|
|
|
8900
8905
|
"space": {
|
|
8901
8906
|
"type": "string",
|
|
8902
8907
|
"format": "at-uri",
|
|
8903
|
-
"description": "The space
|
|
8908
|
+
"description": "The space this record is for. Public records are written with com.atproto.repo.putRecord, not here. Required: at://{authority}/{spaceType}/{skey} (a record only you read goes in your own pub.techne.draft.space.personal, at://{you}/pub.techne.draft.space.personal/self; a source's own records in at://{repo}/pub.techne.draft.space.source/self). A write naming no space is refused as InvalidRequest. The key holds one record per space (the 0016 record address): writing it for another space writes another record and leaves this one; to move a record, delete it and write it again."
|
|
8904
8909
|
}
|
|
8905
8910
|
}
|
|
8906
8911
|
}
|
|
@@ -8941,7 +8946,7 @@ export const catalog = {
|
|
|
8941
8946
|
"space": {
|
|
8942
8947
|
"type": "string",
|
|
8943
8948
|
"format": "at-uri",
|
|
8944
|
-
"description": "The space the record counts in now. Absent when it counts in none (
|
|
8949
|
+
"description": "The space the record counts in now. Absent when it counts in none (the space's write policy does not admit the writer, or a space.private space written by an app other than the one its key names)."
|
|
8945
8950
|
}
|
|
8946
8951
|
}
|
|
8947
8952
|
}
|
|
@@ -8949,7 +8954,7 @@ export const catalog = {
|
|
|
8949
8954
|
"errors": [
|
|
8950
8955
|
{
|
|
8951
8956
|
"name": "InvalidRequest",
|
|
8952
|
-
"description": "HTTP 400. Malformed input (a bad DID, NSID, record key or space address, a record whose $type is not collection, or one with no DAG-CBOR form), or a body that fails its collection's published lexicon. Also HTTP 413, 415, 400 or 422 for a request body that is not the method's input (see the description)."
|
|
8957
|
+
"description": "HTTP 400. Malformed input (no `space`: name one, since public records go through com.atproto.repo.putRecord; a bad DID, NSID, record key or space address, a record whose $type is not collection, or one with no DAG-CBOR form), or a body that fails its collection's published lexicon. Also HTTP 413, 415, 400 or 422 for a request body that is not the method's input (see the description)."
|
|
8953
8958
|
},
|
|
8954
8959
|
{
|
|
8955
8960
|
"name": "Forbidden",
|
|
@@ -8993,15 +8998,15 @@ export const catalog = {
|
|
|
8993
8998
|
"name": "draft.permissioned.putRecords",
|
|
8994
8999
|
"group": "pub.techne",
|
|
8995
9000
|
"kind": "procedure",
|
|
8996
|
-
"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). Send a failed batch again whole: re-putting what landed is a no-op. Space scopes and space.private apply to each write as in putRecord. Draft tier.",
|
|
9001
|
+
"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). Send a failed batch again whole: re-putting what landed is a no-op. Space scopes and space.private apply to each write as in putRecord. Every write names its `space` (a write with none refuses the whole call, InvalidRequest; public records go through com.atproto.repo.putRecord). Draft tier.",
|
|
8997
9002
|
"doc": ({
|
|
8998
9003
|
"lexicon": 1,
|
|
8999
9004
|
"id": "pub.techne.draft.permissioned.putRecords",
|
|
9000
|
-
"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 space the caller manages (
|
|
9005
|
+
"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), 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. 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, 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. `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.",
|
|
9001
9006
|
"defs": {
|
|
9002
9007
|
"main": {
|
|
9003
9008
|
"type": "procedure",
|
|
9004
|
-
"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). Send a failed batch again whole: re-putting what landed is a no-op. Space scopes and space.private apply to each write as in putRecord. Draft tier.",
|
|
9009
|
+
"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). Send a failed batch again whole: re-putting what landed is a no-op. Space scopes and space.private apply to each write as in putRecord. Every write names its `space` (a write with none refuses the whole call, InvalidRequest; public records go through com.atproto.repo.putRecord). Draft tier.",
|
|
9005
9010
|
"input": {
|
|
9006
9011
|
"encoding": "application/json",
|
|
9007
9012
|
"schema": {
|
|
@@ -9055,7 +9060,7 @@ export const catalog = {
|
|
|
9055
9060
|
"errors": [
|
|
9056
9061
|
{
|
|
9057
9062
|
"name": "InvalidRequest",
|
|
9058
|
-
"description": "HTTP 400. Malformed input (a bad repo DID, no writes or more than 200). Also HTTP 413, 415, 400 or 422 for a request body that is not the method's input (see the description). A write that is malformed on its own is reported in its result instead."
|
|
9063
|
+
"description": "HTTP 400. Malformed input (a bad repo DID, no writes or more than 200, or a write with no `space`: name one, since public records go through com.atproto.repo.putRecord; nothing is written). Also HTTP 413, 415, 400 or 422 for a request body that is not the method's input (see the description). A write that is malformed on its own is reported in its result instead."
|
|
9059
9064
|
},
|
|
9060
9065
|
{
|
|
9061
9066
|
"name": "Forbidden",
|
|
@@ -9081,7 +9086,8 @@ export const catalog = {
|
|
|
9081
9086
|
"required": [
|
|
9082
9087
|
"collection",
|
|
9083
9088
|
"rkey",
|
|
9084
|
-
"record"
|
|
9089
|
+
"record",
|
|
9090
|
+
"space"
|
|
9085
9091
|
],
|
|
9086
9092
|
"properties": {
|
|
9087
9093
|
"collection": {
|
|
@@ -9105,7 +9111,7 @@ export const catalog = {
|
|
|
9105
9111
|
"space": {
|
|
9106
9112
|
"type": "string",
|
|
9107
9113
|
"format": "at-uri",
|
|
9108
|
-
"description": "The space
|
|
9114
|
+
"description": "The space this record is for. Public records are written with com.atproto.repo.putRecord, not here. Required: at://{authority}/{spaceType}/{skey} (a record only you read goes in your own pub.techne.draft.space.personal, at://{you}/pub.techne.draft.space.personal/self; a source's own records in at://{repo}/pub.techne.draft.space.source/self). A write naming no space refuses the whole call as InvalidRequest, and nothing is written. The key holds one record per space (the 0016 record address): writing it for another space writes another record and leaves this one; to move a record, delete it and write it again."
|
|
9109
9115
|
}
|
|
9110
9116
|
}
|
|
9111
9117
|
},
|
|
@@ -10285,7 +10291,7 @@ export const catalog = {
|
|
|
10285
10291
|
"group": "pub.techne",
|
|
10286
10292
|
"kind": "record",
|
|
10287
10293
|
"key": "any",
|
|
10288
|
-
"description": "A query over indexed records, as data: sent inline to pub.techne.draft.query.listRecords or countRecords, or published as a record in an app's own repo and run by its URI, so what an app reads is public. The platform runs it only over what the caller may read: every query is scoped to the viewer by the platform (public records not hidden; permissioned records the caller's own, or in a space whose read policy admits the caller now and not
|
|
10294
|
+
"description": "A query over indexed records, as data: sent inline to pub.techne.draft.query.listRecords or countRecords, or published as a record in an app's own repo and run by its URI, so what an app reads is public. The platform runs it only over what the caller may read: every query is scoped to the viewer by the platform (public records not hidden; permissioned records the caller's own, or in a space whose read policy admits the caller now and not an act the reach limit withholds for its author: a held share or circle add), so there is no operator for access. Values that start with `$` are parameters: `$viewer` (the caller's DID) and `$now` (the instant of the call) are filled by the platform, any other the caller passes in `params`; a published query is a template. Each record type declares which of its fields fill the shared roles in its `{collection}.query` document; a type with none is still listable by the roles every record has (`type`, `author`, `space`, `subject`, `written`, `uri`). Before running, the platform checks that every top-level `any` branch is driven by an index and refuses, naming the branch, if not. A feed is a query plus the signals it asks for plus its `weights`, which only the client applies. Draft tier.",
|
|
10289
10295
|
"fields": [
|
|
10290
10296
|
{
|
|
10291
10297
|
"name": "where",
|
|
@@ -10326,7 +10332,7 @@ export const catalog = {
|
|
|
10326
10332
|
"name": "held",
|
|
10327
10333
|
"type": "boolean",
|
|
10328
10334
|
"required": false,
|
|
10329
|
-
"description": "Only the signed-in caller's own permissioned records that the reach limit holds back from the people they would reach (each marked `held`; a held share is answered to its author alone). No public record answers; an anonymous caller gets none."
|
|
10335
|
+
"description": "Only the signed-in caller's own permissioned records that the reach limit holds back from the people they would reach (each marked `held`; a held act, a share or a circle add, is answered to its author alone). No public record answers; an anonymous caller gets none."
|
|
10330
10336
|
},
|
|
10331
10337
|
{
|
|
10332
10338
|
"name": "weights",
|
|
@@ -10343,7 +10349,7 @@ export const catalog = {
|
|
|
10343
10349
|
"doc": ({
|
|
10344
10350
|
"lexicon": 1,
|
|
10345
10351
|
"id": "pub.techne.draft.query",
|
|
10346
|
-
"description": "A query over indexed records, as data: sent inline to pub.techne.draft.query.listRecords or countRecords, or published as a record in an app's own repo and run by its URI, so what an app reads is public. The platform runs it only over what the caller may read: every query is scoped to the viewer by the platform (public records not hidden; permissioned records the caller's own, or in a space whose read policy admits the caller now and not
|
|
10352
|
+
"description": "A query over indexed records, as data: sent inline to pub.techne.draft.query.listRecords or countRecords, or published as a record in an app's own repo and run by its URI, so what an app reads is public. The platform runs it only over what the caller may read: every query is scoped to the viewer by the platform (public records not hidden; permissioned records the caller's own, or in a space whose read policy admits the caller now and not an act the reach limit withholds for its author: a held share or circle add), so there is no operator for access. Values that start with `$` are parameters: `$viewer` (the caller's DID) and `$now` (the instant of the call) are filled by the platform, any other the caller passes in `params`; a published query is a template. Each record type declares which of its fields fill the shared roles in its `{collection}.query` document; a type with none is still listable by the roles every record has (`type`, `author`, `space`, `subject`, `written`, `uri`). Before running, the platform checks that every top-level `any` branch is driven by an index and refuses, naming the branch, if not. A feed is a query plus the signals it asks for plus its `weights`, which only the client applies. Draft tier.",
|
|
10347
10353
|
"defs": {
|
|
10348
10354
|
"main": {
|
|
10349
10355
|
"type": "record",
|
|
@@ -10393,7 +10399,7 @@ export const catalog = {
|
|
|
10393
10399
|
"held": {
|
|
10394
10400
|
"type": "boolean",
|
|
10395
10401
|
"default": false,
|
|
10396
|
-
"description": "Only the signed-in caller's own permissioned records that the reach limit holds back from the people they would reach (each marked `held`; a held share is answered to its author alone). No public record answers; an anonymous caller gets none."
|
|
10402
|
+
"description": "Only the signed-in caller's own permissioned records that the reach limit holds back from the people they would reach (each marked `held`; a held act, a share or a circle add, is answered to its author alone). No public record answers; an anonymous caller gets none."
|
|
10397
10403
|
},
|
|
10398
10404
|
"weights": {
|
|
10399
10405
|
"type": "array",
|
|
@@ -11059,7 +11065,7 @@ export const catalog = {
|
|
|
11059
11065
|
},
|
|
11060
11066
|
"held": {
|
|
11061
11067
|
"type": "boolean",
|
|
11062
|
-
"description": "The caller's own permissioned record that the reach limit holds back from the people it would reach: a
|
|
11068
|
+
"description": "The caller's own permissioned record that the reach limit holds back from the people it would reach: a withheld act (a share or a circle add), answered to its author alone (to anyone else it is not found) until the limit admits it. Absent otherwise. A query with `held: true` answers only these."
|
|
11063
11069
|
},
|
|
11064
11070
|
"measures": {
|
|
11065
11071
|
"type": "unknown",
|
|
@@ -11546,7 +11552,7 @@ export const catalog = {
|
|
|
11546
11552
|
},
|
|
11547
11553
|
"held": {
|
|
11548
11554
|
"type": "boolean",
|
|
11549
|
-
"description": "The caller's own permissioned record that the reach limit holds back from the people it would reach: a
|
|
11555
|
+
"description": "The caller's own permissioned record that the reach limit holds back from the people it would reach: a withheld act (a share or a circle add), answered to its author alone (to anyone else it is not found) until the limit admits it. Absent otherwise. A query with `held: true` answers only these."
|
|
11550
11556
|
},
|
|
11551
11557
|
"measures": {
|
|
11552
11558
|
"type": "unknown",
|
package/dist/connect.d.ts
CHANGED
|
@@ -26,7 +26,10 @@ export interface Techne {
|
|
|
26
26
|
/** The platform, reached through the user's PDS (`atproto-proxy`). */
|
|
27
27
|
platform: AtpBaseClient;
|
|
28
28
|
}
|
|
29
|
-
/** The clients for `session`, with `platform` the platform's service DID
|
|
29
|
+
/** The clients for `session`, with `platform` the platform's service DID (`TECHNE_PLATFORM_DID`,
|
|
30
|
+
* `did:web:techne.computer`, from `techne-sdk/auth`), whose document names the `#atproto_appview` endpoint,
|
|
31
|
+
* so a host move changes nothing here. `session.fetchHandler` is called on `session`: an OAuthSession's is a
|
|
32
|
+
* method that reads its own token set. */
|
|
30
33
|
export declare function connect(session: Session, platform: string): Techne;
|
|
31
34
|
/**
|
|
32
35
|
* The clients for an app that holds only a platform session (techne P19.1, option (a)): the platform is
|
package/dist/connect.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { AtpBaseClient } from './generated/index.js';
|
|
2
2
|
import { appviewRef } from './platform.js';
|
|
3
|
-
/** The clients for `session`, with `platform` the platform's service DID
|
|
3
|
+
/** The clients for `session`, with `platform` the platform's service DID (`TECHNE_PLATFORM_DID`,
|
|
4
|
+
* `did:web:techne.computer`, from `techne-sdk/auth`), whose document names the `#atproto_appview` endpoint,
|
|
5
|
+
* so a host move changes nothing here. `session.fetchHandler` is called on `session`: an OAuthSession's is a
|
|
6
|
+
* method that reads its own token set. */
|
|
4
7
|
export function connect(session, platform) {
|
|
5
|
-
const
|
|
8
|
+
const fetchHandler = (url, init) => session.fetchHandler(url, init);
|
|
9
|
+
const proxied = new AtpBaseClient(fetchHandler);
|
|
6
10
|
proxied.setHeader('atproto-proxy', appviewRef(platform));
|
|
7
|
-
return { did: session.did, pds: new AtpBaseClient(
|
|
11
|
+
return { did: session.did, pds: new AtpBaseClient(fetchHandler), platform: proxied };
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* The clients for an app that holds only a platform session (techne P19.1, option (a)): the platform is
|