techne-sdk 0.3.2 → 0.3.4
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 +83 -0
- package/README.md +5 -4
- package/dist/auth/app-key.js +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/auth/placement.gen.d.ts +1 -1
- package/dist/auth/placement.gen.js +2 -0
- package/dist/catalog/catalog.gen.d.ts +6 -33
- package/dist/catalog/catalog.gen.js +528 -6
- package/dist/connect.d.ts +96 -12
- package/dist/connect.js +83 -12
- package/dist/generated/index.d.ts +56 -0
- package/dist/generated/index.js +72 -0
- package/dist/generated/lexicons.d.ts +328 -6
- package/dist/generated/lexicons.js +201 -3
- package/dist/generated/nsid.d.ts +7 -0
- package/dist/generated/nsid.js +7 -0
- package/dist/generated/nsid.json +7 -0
- package/dist/generated/records.d.ts +48 -44
- package/dist/generated/types/pub/techne/draft/collective.d.ts +2 -0
- package/dist/generated/types/pub/techne/draft/placeResearch.d.ts +47 -0
- package/dist/generated/types/pub/techne/draft/placeResearch.js +26 -0
- package/dist/generated/types/pub/techne/draft/questionSet.d.ts +3 -0
- package/dist/generated/types/pub/techne/draft/summary.d.ts +16 -0
- package/dist/generated/types/pub/techne/draft/summary.js +12 -0
- package/dist/item.d.ts +130 -0
- package/dist/item.js +74 -0
- package/dist/links/index.d.ts +15 -8
- package/dist/links/index.js +18 -0
- package/dist/put/contacts.d.ts +2 -2
- package/dist/put/index.d.ts +6 -9
- package/dist/put/index.js +8 -166
- package/dist/put/put.d.ts +14 -0
- package/dist/put/put.js +206 -0
- package/dist/query/compose.d.ts +246 -0
- package/dist/query/compose.js +572 -0
- package/dist/query/hosts.d.ts +98 -1
- package/dist/query/hosts.js +143 -2
- package/dist/query/index.d.ts +60 -29
- package/dist/query/index.js +55 -26
- package/dist/react/context.d.ts +18 -0
- package/dist/react/context.js +19 -0
- package/dist/react/index.d.ts +14 -0
- package/dist/react/index.js +14 -0
- package/dist/react/query.d.ts +75 -0
- package/dist/react/query.js +116 -0
- package/dist/read/index.d.ts +60 -0
- package/dist/read/index.js +107 -0
- package/dist/resend.d.ts +25 -0
- package/dist/resend.js +52 -0
- package/dist/versions/entities.gen.d.ts +8 -0
- package/dist/versions/entities.gen.js +9 -0
- package/dist/versions/index.d.ts +59 -17
- package/dist/versions/index.js +156 -22
- package/dist/versions/react.d.ts +1 -1
- package/dist/versions/react.js +1 -1
- package/dist/versions/text.d.ts +19 -0
- package/dist/versions/text.js +73 -0
- package/dist/wasm/techne-wasm.gen.js +1 -1
- package/dist/wasm/techne-wasm2js.gen.js +22469 -21460
- package/package.json +17 -5
package/dist/connect.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* techne-sdk/connect — the SDK's
|
|
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 one write (`put`).
|
|
3
4
|
*
|
|
4
5
|
* Everything goes through the user's own PDS with the user's own session (an atproto OAuth session's
|
|
5
6
|
* `did` and `fetchHandler`, or anything shaped like it). `pds` calls the PDS itself (the user's repo).
|
|
@@ -8,34 +9,117 @@
|
|
|
8
9
|
* (iss = the user, aud = the platform, lxm = the method), and the platform authenticates that (Lane B).
|
|
9
10
|
* So every read carries its viewer, and the app holds no credential for the platform.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
+
* `platform` defaults to {@link TECHNE_PLATFORM_DID} (`src/platform.ts`, the one place the name is
|
|
13
|
+
* spelled); staging passes its own DID.
|
|
14
|
+
*
|
|
15
|
+
* An app that holds only a platform session uses {@link connectHosted} instead. A page nobody has signed
|
|
16
|
+
* in to yet uses {@link connectAnonymous}: public reads straight from the platform, no write.
|
|
12
17
|
*/
|
|
13
18
|
import type { FetchHandler } from '@atproto/xrpc';
|
|
14
19
|
import { AtpBaseClient } from './generated/index.js';
|
|
20
|
+
import type { IncludeOf, ItemFor, RecordOfQuery, RecordOfUri } from './item.js';
|
|
21
|
+
import type { Query } from './query/index.js';
|
|
22
|
+
import type { PutRecord, PutResult } from './put/index.js';
|
|
23
|
+
import { type PutOptions } from './put/put.js';
|
|
24
|
+
import { type GetOpts, type Page, type QueryOpts, type Versions } from './read/index.js';
|
|
25
|
+
import type { Claims } from './wasm/index.js';
|
|
26
|
+
import { TECHNE_PLATFORM_DID } from './platform.js';
|
|
27
|
+
import { IDEMPOTENCY_KEY, resendingOnce } from './resend.js';
|
|
28
|
+
export type { GetOpts, Page, QueryOpts, Versions };
|
|
29
|
+
export { IDEMPOTENCY_KEY, resendingOnce, TECHNE_PLATFORM_DID };
|
|
15
30
|
/** A signed-in session: an atproto OAuth session satisfies it. */
|
|
16
31
|
export interface Session {
|
|
17
32
|
did: string;
|
|
18
33
|
fetchHandler: FetchHandler;
|
|
19
34
|
}
|
|
20
|
-
/**
|
|
21
|
-
export interface
|
|
35
|
+
/** What `connect` and `connectHosted` take beside the session. */
|
|
36
|
+
export interface ConnectOptions {
|
|
37
|
+
/**
|
|
38
|
+
* The claims the app holds (the commons root, the credentials and declarations it has read): every
|
|
39
|
+
* read's verdict is checked over them. Without them a record whose trust needs the chain (a commons
|
|
40
|
+
* sidecar about others' records) comes back invalid, "untrusted: … the root does not endorse".
|
|
41
|
+
*/
|
|
42
|
+
claims?: Claims;
|
|
43
|
+
}
|
|
44
|
+
/** The clients for one signed-in user, and the claims its reads are checked over. */
|
|
45
|
+
export interface Clients {
|
|
22
46
|
/** The signed-in user's DID: the repo every write goes to. */
|
|
23
47
|
did: string;
|
|
24
48
|
/** The user's PDS. */
|
|
25
49
|
pds: AtpBaseClient;
|
|
26
50
|
/** The platform, reached through the user's PDS (`atproto-proxy`). */
|
|
27
51
|
platform: AtpBaseClient;
|
|
52
|
+
/** The claims the app holds ({@link ConnectOptions.claims}). */
|
|
53
|
+
claims?: Claims;
|
|
54
|
+
}
|
|
55
|
+
/** One read as TanStack Query takes it. */
|
|
56
|
+
export interface ReadOptions<K extends readonly unknown[], R> {
|
|
57
|
+
queryKey: K;
|
|
58
|
+
queryFn: () => Promise<R>;
|
|
28
59
|
}
|
|
29
|
-
/** The
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
60
|
+
/** The SDK's client for one signed-in user: its clients, its reads and its one write. */
|
|
61
|
+
export interface Techne extends Clients {
|
|
62
|
+
/** One page of a query document; a list across authors answers curated records. Valid items by default
|
|
63
|
+
* (`ValidItem<T>`); `{ include: 'all' }` any verdict (`Item<T>`). */
|
|
64
|
+
query<Q extends Query, O extends QueryOpts = {}>(q: Q, opts?: O): Promise<Page<RecordOfQuery<Q>, IncludeOf<O>>>;
|
|
65
|
+
/** One record: the curated view by default, `{ prefer: 'mine' }` the user's own version, `{ exact: true }`
|
|
66
|
+
* exactly that record. `null` when there is nothing to read there, or (unless `{ include: 'all' }`) when
|
|
67
|
+
* it is not valid. */
|
|
68
|
+
get<U extends string, O extends GetOpts = {}>(uri: U, opts?: O): Promise<ItemFor<RecordOfUri<U>, IncludeOf<O>> | null>;
|
|
69
|
+
/** The record as its versions (ranked and grouped) and its conflicts. `null` when there is nothing there. */
|
|
70
|
+
versions<U extends string>(uri: U): Promise<Versions<RecordOfUri<U>> | null>;
|
|
71
|
+
/** Write records, and with `deletes` delete some (`techne-sdk/put` says how). */
|
|
72
|
+
put(records: PutRecord[], options?: PutOptions): Promise<PutResult>;
|
|
73
|
+
/** The options forms (TanStack Query's `{ queryKey, queryFn }`). Each key ends with the viewer's DID, so
|
|
74
|
+
* one viewer's reads are never another's, and a prefix (`['techne', 'versions']`) still names them all. */
|
|
75
|
+
queryOptions<Q extends Query, O extends QueryOpts = {}>(q: Q, opts?: O): ReadOptions<readonly ['techne', 'query', Q, QueryOpts, string], Page<RecordOfQuery<Q>, IncludeOf<O>>>;
|
|
76
|
+
getOptions<U extends string, O extends GetOpts = {}>(uri: U, opts?: O): ReadOptions<readonly ['techne', 'record', U, GetOpts, string], ItemFor<RecordOfUri<U>, IncludeOf<O>> | null>;
|
|
77
|
+
versionsOptions<U extends string>(uri: U): ReadOptions<readonly ['techne', 'versions', U, string], Versions<RecordOfUri<U>> | null>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The client over clients made elsewhere: `clients` with the reads and the write bound to them. `connect`
|
|
81
|
+
* and `connectHosted` are this over the clients they make; an app that holds its own (or a test's stand-ins
|
|
82
|
+
* for them) binds them here.
|
|
83
|
+
*/
|
|
84
|
+
export declare function bind(clients: Clients): Techne;
|
|
85
|
+
/** The client for `session`, with `platform` the platform's service DID (its document names the
|
|
86
|
+
* `#atproto_appview` endpoint, so a host move changes nothing here). The session's `fetchHandler` is
|
|
87
|
+
* called on the session, so an OAuthSession (whose `fetchHandler` is a method) works as it comes. A POST
|
|
88
|
+
* that got no response is not resent here: the PDS may not pass the `Idempotency-Key` on, so only `put`
|
|
89
|
+
* runs again (it re-reads first). */
|
|
90
|
+
export declare function connect(session: Session, platform?: string, options?: ConnectOptions): Techne;
|
|
91
|
+
/** What `connectAnonymous` takes beside the platform. */
|
|
92
|
+
export interface AnonymousOptions extends ConnectOptions {
|
|
93
|
+
/** The fetch every request goes through (the DID document and the reads); `globalThis.fetch` by default. */
|
|
94
|
+
fetch?: typeof globalThis.fetch;
|
|
95
|
+
/** The PLC directory a did:plc platform is resolved at; {@link PLC_DIRECTORY} by default. Staging's
|
|
96
|
+
* platform DID lives on staging's own PLC, so staging passes that one's URL. */
|
|
97
|
+
plcUrl?: string;
|
|
98
|
+
}
|
|
99
|
+
/** The public PLC directory: where a did:plc is resolved unless a `plcUrl` names another. */
|
|
100
|
+
export declare const PLC_DIRECTORY = "https://plc.directory";
|
|
101
|
+
/** Where `did`'s document is: `<plcUrl>/<did>` for a did:plc (`https://plc.directory` by default),
|
|
102
|
+
* `https://<host>/.well-known/did.json` (or `https://<host>/<path>/did.json`) for a did:web. */
|
|
103
|
+
export declare function didDocumentUrl(did: string, plcUrl?: string): string;
|
|
104
|
+
/** The `#atproto_appview` service endpoint `did`'s document names. The reads are sent to `/xrpc/…` on it,
|
|
105
|
+
* so it is taken as an origin: a path on it is dropped (`new URL('/xrpc/…', endpoint)`), as atproto does
|
|
106
|
+
* for a service endpoint. */
|
|
107
|
+
export declare function resolveAppview(did: string, fetch?: typeof globalThis.fetch, plcUrl?: string): Promise<string>;
|
|
108
|
+
/**
|
|
109
|
+
* The client for nobody signed in: the platform reached directly, with no session and no PDS, so it reads
|
|
110
|
+
* only what anyone may read. The platform's endpoint is its DID document's `#atproto_appview` service
|
|
111
|
+
* (an origin: {@link resolveAppview}), resolved on the first read and kept (a failed resolution is not
|
|
112
|
+
* kept: the next read tries again). A did:plc platform is resolved at `plcUrl` ({@link PLC_DIRECTORY} by
|
|
113
|
+
* default). `did` is `''`, so its query keys never meet a viewer's; `put` rejects, asking to sign in. A
|
|
114
|
+
* POST that got no response is sent once more with the same `Idempotency-Key` ({@link resendingOnce}).
|
|
115
|
+
*/
|
|
116
|
+
export declare function connectAnonymous(platform?: string, options?: AnonymousOptions): Techne;
|
|
34
117
|
/**
|
|
35
|
-
* The
|
|
118
|
+
* The client for an app that holds only a platform session (techne P19.1, option (a)): the platform is
|
|
36
119
|
* the OAuth client and holds the write credential, so both clients call the platform. `pds` reaches the
|
|
37
120
|
* platform's `com.atproto.repo.applyWrites` and `getRecord`, which it relays to the repo's PDS with the
|
|
38
121
|
* credential it holds; `put` runs unchanged. `fetchHandler` carries the platform session (its cookie or
|
|
39
|
-
* device token) to the platform's origin.
|
|
122
|
+
* device token) to the platform's origin. A POST that got no response is sent once more with the same
|
|
123
|
+
* `Idempotency-Key` ({@link resendingOnce}), so the platform runs it once.
|
|
40
124
|
*/
|
|
41
|
-
export declare function connectHosted(did: string, fetchHandler: FetchHandler): Techne;
|
|
125
|
+
export declare function connectHosted(did: string, fetchHandler: FetchHandler, options?: ConnectOptions): Techne;
|
package/dist/connect.js
CHANGED
|
@@ -1,23 +1,94 @@
|
|
|
1
1
|
import { AtpBaseClient } from './generated/index.js';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { put } from './put/put.js';
|
|
3
|
+
import { get, query, versions } from './read/index.js';
|
|
4
|
+
import { appviewRef, APPVIEW_SERVICE_ID, TECHNE_PLATFORM_DID } from './platform.js';
|
|
5
|
+
import { IDEMPOTENCY_KEY, resendingOnce } from './resend.js';
|
|
6
|
+
export { IDEMPOTENCY_KEY, resendingOnce, TECHNE_PLATFORM_DID };
|
|
7
|
+
/**
|
|
8
|
+
* The client over clients made elsewhere: `clients` with the reads and the write bound to them. `connect`
|
|
9
|
+
* and `connectHosted` are this over the clients they make; an app that holds its own (or a test's stand-ins
|
|
10
|
+
* for them) binds them here.
|
|
11
|
+
*/
|
|
12
|
+
export function bind(clients) {
|
|
13
|
+
const techne = {
|
|
14
|
+
...clients,
|
|
15
|
+
query: (q, opts) => query(techne, q, opts),
|
|
16
|
+
get: (uri, opts) => get(techne, uri, opts),
|
|
17
|
+
versions: (uri) => versions(techne, uri),
|
|
18
|
+
put: (records, options) => put(techne, records, options),
|
|
19
|
+
queryOptions: (q, opts) => ({ queryKey: ['techne', 'query', q, opts ?? {}, clients.did], queryFn: () => query(techne, q, opts) }),
|
|
20
|
+
getOptions: (uri, opts) => ({ queryKey: ['techne', 'record', uri, opts ?? {}, clients.did], queryFn: () => get(techne, uri, opts) }),
|
|
21
|
+
versionsOptions: (uri) => ({ queryKey: ['techne', 'versions', uri, clients.did], queryFn: () => versions(techne, uri) }),
|
|
22
|
+
};
|
|
23
|
+
return techne;
|
|
24
|
+
}
|
|
25
|
+
/** The client for `session`, with `platform` the platform's service DID (its document names the
|
|
26
|
+
* `#atproto_appview` endpoint, so a host move changes nothing here). The session's `fetchHandler` is
|
|
27
|
+
* called on the session, so an OAuthSession (whose `fetchHandler` is a method) works as it comes. A POST
|
|
28
|
+
* that got no response is not resent here: the PDS may not pass the `Idempotency-Key` on, so only `put`
|
|
29
|
+
* runs again (it re-reads first). */
|
|
30
|
+
export function connect(session, platform = TECHNE_PLATFORM_DID, options = {}) {
|
|
8
31
|
const fetchHandler = (url, init) => session.fetchHandler(url, init);
|
|
9
32
|
const proxied = new AtpBaseClient(fetchHandler);
|
|
10
33
|
proxied.setHeader('atproto-proxy', appviewRef(platform));
|
|
11
|
-
return { did: session.did, pds: new AtpBaseClient(fetchHandler), platform: proxied };
|
|
34
|
+
return bind({ did: session.did, pds: new AtpBaseClient(fetchHandler), platform: proxied, claims: options.claims });
|
|
35
|
+
}
|
|
36
|
+
/** The public PLC directory: where a did:plc is resolved unless a `plcUrl` names another. */
|
|
37
|
+
export const PLC_DIRECTORY = 'https://plc.directory';
|
|
38
|
+
const SIGN_IN_TO_WRITE = 'techne-sdk/connect: sign in to write (this client is anonymous: public reads only)';
|
|
39
|
+
/** Where `did`'s document is: `<plcUrl>/<did>` for a did:plc (`https://plc.directory` by default),
|
|
40
|
+
* `https://<host>/.well-known/did.json` (or `https://<host>/<path>/did.json`) for a did:web. */
|
|
41
|
+
export function didDocumentUrl(did, plcUrl = PLC_DIRECTORY) {
|
|
42
|
+
if (did.startsWith('did:plc:'))
|
|
43
|
+
return `${plcUrl.replace(/\/+$/, '')}/${did}`;
|
|
44
|
+
if (did.startsWith('did:web:')) {
|
|
45
|
+
const [host, ...path] = did.slice('did:web:'.length).split(':').map(decodeURIComponent);
|
|
46
|
+
return path.length ? `https://${host}/${path.join('/')}/did.json` : `https://${host}/.well-known/did.json`;
|
|
47
|
+
}
|
|
48
|
+
throw new Error(`techne-sdk/connect: cannot resolve ${did} (only did:web and did:plc)`);
|
|
49
|
+
}
|
|
50
|
+
/** The `#atproto_appview` service endpoint `did`'s document names. The reads are sent to `/xrpc/…` on it,
|
|
51
|
+
* so it is taken as an origin: a path on it is dropped (`new URL('/xrpc/…', endpoint)`), as atproto does
|
|
52
|
+
* for a service endpoint. */
|
|
53
|
+
export async function resolveAppview(did, fetch = globalThis.fetch, plcUrl) {
|
|
54
|
+
const url = didDocumentUrl(did, plcUrl);
|
|
55
|
+
const res = await fetch(url);
|
|
56
|
+
if (!res.ok)
|
|
57
|
+
throw new Error(`techne-sdk/connect: ${url} answered ${res.status}`);
|
|
58
|
+
const doc = (await res.json());
|
|
59
|
+
const services = Array.isArray(doc?.service) ? doc.service : [];
|
|
60
|
+
const service = services.find((s) => s?.id === APPVIEW_SERVICE_ID || s?.id === appviewRef(did));
|
|
61
|
+
if (typeof service?.serviceEndpoint !== 'string')
|
|
62
|
+
throw new Error(`techne-sdk/connect: ${did} names no ${APPVIEW_SERVICE_ID} service`);
|
|
63
|
+
return service.serviceEndpoint;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The client for nobody signed in: the platform reached directly, with no session and no PDS, so it reads
|
|
67
|
+
* only what anyone may read. The platform's endpoint is its DID document's `#atproto_appview` service
|
|
68
|
+
* (an origin: {@link resolveAppview}), resolved on the first read and kept (a failed resolution is not
|
|
69
|
+
* kept: the next read tries again). A did:plc platform is resolved at `plcUrl` ({@link PLC_DIRECTORY} by
|
|
70
|
+
* default). `did` is `''`, so its query keys never meet a viewer's; `put` rejects, asking to sign in. A
|
|
71
|
+
* POST that got no response is sent once more with the same `Idempotency-Key` ({@link resendingOnce}).
|
|
72
|
+
*/
|
|
73
|
+
export function connectAnonymous(platform = TECHNE_PLATFORM_DID, options = {}) {
|
|
74
|
+
const fetch = (input, init) => (options.fetch ?? globalThis.fetch)(input, init);
|
|
75
|
+
let endpoint;
|
|
76
|
+
const resolve = () => (endpoint ??= resolveAppview(platform, fetch, options.plcUrl).catch((e) => ((endpoint = undefined), Promise.reject(e))));
|
|
77
|
+
const direct = resendingOnce(async (url, init) => fetch(new URL(url, await resolve()), init));
|
|
78
|
+
const nowhere = async () => Promise.reject(new Error(SIGN_IN_TO_WRITE));
|
|
79
|
+
const techne = bind({ did: '', pds: new AtpBaseClient(nowhere), platform: new AtpBaseClient(direct), claims: options.claims });
|
|
80
|
+
techne.put = async () => Promise.reject(new Error(SIGN_IN_TO_WRITE));
|
|
81
|
+
return techne;
|
|
12
82
|
}
|
|
13
83
|
/**
|
|
14
|
-
* The
|
|
84
|
+
* The client for an app that holds only a platform session (techne P19.1, option (a)): the platform is
|
|
15
85
|
* the OAuth client and holds the write credential, so both clients call the platform. `pds` reaches the
|
|
16
86
|
* platform's `com.atproto.repo.applyWrites` and `getRecord`, which it relays to the repo's PDS with the
|
|
17
87
|
* credential it holds; `put` runs unchanged. `fetchHandler` carries the platform session (its cookie or
|
|
18
|
-
* device token) to the platform's origin.
|
|
88
|
+
* device token) to the platform's origin. A POST that got no response is sent once more with the same
|
|
89
|
+
* `Idempotency-Key` ({@link resendingOnce}), so the platform runs it once.
|
|
19
90
|
*/
|
|
20
|
-
export function connectHosted(did, fetchHandler) {
|
|
21
|
-
const platform = new AtpBaseClient(fetchHandler);
|
|
22
|
-
return { did, pds: platform, platform };
|
|
91
|
+
export function connectHosted(did, fetchHandler, options = {}) {
|
|
92
|
+
const platform = new AtpBaseClient(resendingOnce(fetchHandler));
|
|
93
|
+
return bind({ did, pds: platform, platform, claims: options.claims });
|
|
23
94
|
}
|
|
@@ -88,6 +88,7 @@ import * as PubTechneDraftPermissionedListRecords from './types/pub/techne/draft
|
|
|
88
88
|
import * as PubTechneDraftPermissionedPutRecord from './types/pub/techne/draft/permissioned/putRecord.js';
|
|
89
89
|
import * as PubTechneDraftPermissionedPutRecords from './types/pub/techne/draft/permissioned/putRecords.js';
|
|
90
90
|
import * as PubTechneDraftPlace from './types/pub/techne/draft/place.js';
|
|
91
|
+
import * as PubTechneDraftPlaceResearch from './types/pub/techne/draft/placeResearch.js';
|
|
91
92
|
import * as PubTechneDraftPost from './types/pub/techne/draft/post.js';
|
|
92
93
|
import * as PubTechneDraftPresence from './types/pub/techne/draft/presence.js';
|
|
93
94
|
import * as PubTechneDraftProfile from './types/pub/techne/draft/profile.js';
|
|
@@ -120,6 +121,7 @@ import * as PubTechneDraftSource from './types/pub/techne/draft/source.js';
|
|
|
120
121
|
import * as PubTechneDraftSourceAttribution from './types/pub/techne/draft/sourceAttribution.js';
|
|
121
122
|
import * as PubTechneDraftSourceRef from './types/pub/techne/draft/sourceRef.js';
|
|
122
123
|
import * as PubTechneDraftSubjectPrefs from './types/pub/techne/draft/subjectPrefs.js';
|
|
124
|
+
import * as PubTechneDraftSummary from './types/pub/techne/draft/summary.js';
|
|
123
125
|
import * as PubTechneDraftSyncIndexRecord from './types/pub/techne/draft/sync/indexRecord.js';
|
|
124
126
|
import * as PubTechneDraftVerdict from './types/pub/techne/draft/verdict.js';
|
|
125
127
|
import * as PubTechneDraftVerification from './types/pub/techne/draft/verification.js';
|
|
@@ -240,6 +242,7 @@ export * as PubTechneDraftPermissionedListRecords from './types/pub/techne/draft
|
|
|
240
242
|
export * as PubTechneDraftPermissionedPutRecord from './types/pub/techne/draft/permissioned/putRecord.js';
|
|
241
243
|
export * as PubTechneDraftPermissionedPutRecords from './types/pub/techne/draft/permissioned/putRecords.js';
|
|
242
244
|
export * as PubTechneDraftPlace from './types/pub/techne/draft/place.js';
|
|
245
|
+
export * as PubTechneDraftPlaceResearch from './types/pub/techne/draft/placeResearch.js';
|
|
243
246
|
export * as PubTechneDraftPost from './types/pub/techne/draft/post.js';
|
|
244
247
|
export * as PubTechneDraftPresence from './types/pub/techne/draft/presence.js';
|
|
245
248
|
export * as PubTechneDraftProfile from './types/pub/techne/draft/profile.js';
|
|
@@ -273,6 +276,7 @@ export * as PubTechneDraftSource from './types/pub/techne/draft/source.js';
|
|
|
273
276
|
export * as PubTechneDraftSourceAttribution from './types/pub/techne/draft/sourceAttribution.js';
|
|
274
277
|
export * as PubTechneDraftSourceRef from './types/pub/techne/draft/sourceRef.js';
|
|
275
278
|
export * as PubTechneDraftSubjectPrefs from './types/pub/techne/draft/subjectPrefs.js';
|
|
279
|
+
export * as PubTechneDraftSummary from './types/pub/techne/draft/summary.js';
|
|
276
280
|
export * as PubTechneDraftSyncIndexRecord from './types/pub/techne/draft/sync/indexRecord.js';
|
|
277
281
|
export * as PubTechneDraftVerdict from './types/pub/techne/draft/verdict.js';
|
|
278
282
|
export * as PubTechneDraftVerification from './types/pub/techne/draft/verification.js';
|
|
@@ -496,6 +500,7 @@ export declare class PubTechneDraftNS {
|
|
|
496
500
|
passage: PubTechneDraftPassageRecord;
|
|
497
501
|
pendingBeaconSpot: PubTechneDraftPendingBeaconSpotRecord;
|
|
498
502
|
place: PubTechneDraftPlaceRecord;
|
|
503
|
+
placeResearch: PubTechneDraftPlaceResearchRecord;
|
|
499
504
|
post: PubTechneDraftPostRecord;
|
|
500
505
|
presence: PubTechneDraftPresenceRecord;
|
|
501
506
|
profile: PubTechneDraftProfileRecord;
|
|
@@ -512,6 +517,7 @@ export declare class PubTechneDraftNS {
|
|
|
512
517
|
sourceAttribution: PubTechneDraftSourceAttributionRecord;
|
|
513
518
|
sourceRef: PubTechneDraftSourceRefRecord;
|
|
514
519
|
subjectPrefs: PubTechneDraftSubjectPrefsRecord;
|
|
520
|
+
summary: PubTechneDraftSummaryRecord;
|
|
515
521
|
verdict: PubTechneDraftVerdictRecord;
|
|
516
522
|
verification: PubTechneDraftVerificationRecord;
|
|
517
523
|
weeklyCheckIn: PubTechneDraftWeeklyCheckInRecord;
|
|
@@ -1855,6 +1861,31 @@ export declare class PubTechneDraftPlaceRecord {
|
|
|
1855
1861
|
}>;
|
|
1856
1862
|
delete(params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
1857
1863
|
}
|
|
1864
|
+
export declare class PubTechneDraftPlaceResearchRecord {
|
|
1865
|
+
_client: XrpcClient;
|
|
1866
|
+
constructor(client: XrpcClient);
|
|
1867
|
+
list(params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
1868
|
+
cursor?: string;
|
|
1869
|
+
records: {
|
|
1870
|
+
uri: string;
|
|
1871
|
+
value: PubTechneDraftPlaceResearch.Record;
|
|
1872
|
+
}[];
|
|
1873
|
+
}>;
|
|
1874
|
+
get(params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>): Promise<{
|
|
1875
|
+
uri: string;
|
|
1876
|
+
cid: string;
|
|
1877
|
+
value: PubTechneDraftPlaceResearch.Record;
|
|
1878
|
+
}>;
|
|
1879
|
+
create(params: OmitKey<ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record'>, record: Un$Typed<PubTechneDraftPlaceResearch.Record>, headers?: Record<string, string>): Promise<{
|
|
1880
|
+
uri: string;
|
|
1881
|
+
cid: string;
|
|
1882
|
+
}>;
|
|
1883
|
+
put(params: OmitKey<ComAtprotoRepoPutRecord.InputSchema, 'collection' | 'record'>, record: Un$Typed<PubTechneDraftPlaceResearch.Record>, headers?: Record<string, string>): Promise<{
|
|
1884
|
+
uri: string;
|
|
1885
|
+
cid: string;
|
|
1886
|
+
}>;
|
|
1887
|
+
delete(params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
1888
|
+
}
|
|
1858
1889
|
export declare class PubTechneDraftPostRecord {
|
|
1859
1890
|
_client: XrpcClient;
|
|
1860
1891
|
constructor(client: XrpcClient);
|
|
@@ -2255,6 +2286,31 @@ export declare class PubTechneDraftSubjectPrefsRecord {
|
|
|
2255
2286
|
}>;
|
|
2256
2287
|
delete(params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
2257
2288
|
}
|
|
2289
|
+
export declare class PubTechneDraftSummaryRecord {
|
|
2290
|
+
_client: XrpcClient;
|
|
2291
|
+
constructor(client: XrpcClient);
|
|
2292
|
+
list(params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
2293
|
+
cursor?: string;
|
|
2294
|
+
records: {
|
|
2295
|
+
uri: string;
|
|
2296
|
+
value: PubTechneDraftSummary.Record;
|
|
2297
|
+
}[];
|
|
2298
|
+
}>;
|
|
2299
|
+
get(params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>): Promise<{
|
|
2300
|
+
uri: string;
|
|
2301
|
+
cid: string;
|
|
2302
|
+
value: PubTechneDraftSummary.Record;
|
|
2303
|
+
}>;
|
|
2304
|
+
create(params: OmitKey<ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record'>, record: Un$Typed<PubTechneDraftSummary.Record>, headers?: Record<string, string>): Promise<{
|
|
2305
|
+
uri: string;
|
|
2306
|
+
cid: string;
|
|
2307
|
+
}>;
|
|
2308
|
+
put(params: OmitKey<ComAtprotoRepoPutRecord.InputSchema, 'collection' | 'record'>, record: Un$Typed<PubTechneDraftSummary.Record>, headers?: Record<string, string>): Promise<{
|
|
2309
|
+
uri: string;
|
|
2310
|
+
cid: string;
|
|
2311
|
+
}>;
|
|
2312
|
+
delete(params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
2313
|
+
}
|
|
2258
2314
|
export declare class PubTechneDraftVerdictRecord {
|
|
2259
2315
|
_client: XrpcClient;
|
|
2260
2316
|
constructor(client: XrpcClient);
|
package/dist/generated/index.js
CHANGED
|
@@ -165,6 +165,7 @@ export * as PubTechneDraftPermissionedListRecords from './types/pub/techne/draft
|
|
|
165
165
|
export * as PubTechneDraftPermissionedPutRecord from './types/pub/techne/draft/permissioned/putRecord.js';
|
|
166
166
|
export * as PubTechneDraftPermissionedPutRecords from './types/pub/techne/draft/permissioned/putRecords.js';
|
|
167
167
|
export * as PubTechneDraftPlace from './types/pub/techne/draft/place.js';
|
|
168
|
+
export * as PubTechneDraftPlaceResearch from './types/pub/techne/draft/placeResearch.js';
|
|
168
169
|
export * as PubTechneDraftPost from './types/pub/techne/draft/post.js';
|
|
169
170
|
export * as PubTechneDraftPresence from './types/pub/techne/draft/presence.js';
|
|
170
171
|
export * as PubTechneDraftProfile from './types/pub/techne/draft/profile.js';
|
|
@@ -198,6 +199,7 @@ export * as PubTechneDraftSource from './types/pub/techne/draft/source.js';
|
|
|
198
199
|
export * as PubTechneDraftSourceAttribution from './types/pub/techne/draft/sourceAttribution.js';
|
|
199
200
|
export * as PubTechneDraftSourceRef from './types/pub/techne/draft/sourceRef.js';
|
|
200
201
|
export * as PubTechneDraftSubjectPrefs from './types/pub/techne/draft/subjectPrefs.js';
|
|
202
|
+
export * as PubTechneDraftSummary from './types/pub/techne/draft/summary.js';
|
|
201
203
|
export * as PubTechneDraftSyncIndexRecord from './types/pub/techne/draft/sync/indexRecord.js';
|
|
202
204
|
export * as PubTechneDraftVerdict from './types/pub/techne/draft/verdict.js';
|
|
203
205
|
export * as PubTechneDraftVerification from './types/pub/techne/draft/verification.js';
|
|
@@ -527,6 +529,7 @@ export class PubTechneDraftNS {
|
|
|
527
529
|
passage;
|
|
528
530
|
pendingBeaconSpot;
|
|
529
531
|
place;
|
|
532
|
+
placeResearch;
|
|
530
533
|
post;
|
|
531
534
|
presence;
|
|
532
535
|
profile;
|
|
@@ -543,6 +546,7 @@ export class PubTechneDraftNS {
|
|
|
543
546
|
sourceAttribution;
|
|
544
547
|
sourceRef;
|
|
545
548
|
subjectPrefs;
|
|
549
|
+
summary;
|
|
546
550
|
verdict;
|
|
547
551
|
verification;
|
|
548
552
|
weeklyCheckIn;
|
|
@@ -608,6 +612,7 @@ export class PubTechneDraftNS {
|
|
|
608
612
|
this.passage = new PubTechneDraftPassageRecord(client);
|
|
609
613
|
this.pendingBeaconSpot = new PubTechneDraftPendingBeaconSpotRecord(client);
|
|
610
614
|
this.place = new PubTechneDraftPlaceRecord(client);
|
|
615
|
+
this.placeResearch = new PubTechneDraftPlaceResearchRecord(client);
|
|
611
616
|
this.post = new PubTechneDraftPostRecord(client);
|
|
612
617
|
this.presence = new PubTechneDraftPresenceRecord(client);
|
|
613
618
|
this.profile = new PubTechneDraftProfileRecord(client);
|
|
@@ -624,6 +629,7 @@ export class PubTechneDraftNS {
|
|
|
624
629
|
this.sourceAttribution = new PubTechneDraftSourceAttributionRecord(client);
|
|
625
630
|
this.sourceRef = new PubTechneDraftSourceRefRecord(client);
|
|
626
631
|
this.subjectPrefs = new PubTechneDraftSubjectPrefsRecord(client);
|
|
632
|
+
this.summary = new PubTechneDraftSummaryRecord(client);
|
|
627
633
|
this.verdict = new PubTechneDraftVerdictRecord(client);
|
|
628
634
|
this.verification = new PubTechneDraftVerificationRecord(client);
|
|
629
635
|
this.weeklyCheckIn = new PubTechneDraftWeeklyCheckInRecord(client);
|
|
@@ -2680,6 +2686,39 @@ export class PubTechneDraftPlaceRecord {
|
|
|
2680
2686
|
await this._client.call('com.atproto.repo.deleteRecord', undefined, { collection: 'pub.techne.draft.place', ...params }, { headers });
|
|
2681
2687
|
}
|
|
2682
2688
|
}
|
|
2689
|
+
export class PubTechneDraftPlaceResearchRecord {
|
|
2690
|
+
_client;
|
|
2691
|
+
constructor(client) {
|
|
2692
|
+
this._client = client;
|
|
2693
|
+
}
|
|
2694
|
+
async list(params) {
|
|
2695
|
+
const res = await this._client.call('com.atproto.repo.listRecords', {
|
|
2696
|
+
collection: 'pub.techne.draft.placeResearch',
|
|
2697
|
+
...params,
|
|
2698
|
+
});
|
|
2699
|
+
return res.data;
|
|
2700
|
+
}
|
|
2701
|
+
async get(params) {
|
|
2702
|
+
const res = await this._client.call('com.atproto.repo.getRecord', {
|
|
2703
|
+
collection: 'pub.techne.draft.placeResearch',
|
|
2704
|
+
...params,
|
|
2705
|
+
});
|
|
2706
|
+
return res.data;
|
|
2707
|
+
}
|
|
2708
|
+
async create(params, record, headers) {
|
|
2709
|
+
const collection = 'pub.techne.draft.placeResearch';
|
|
2710
|
+
const res = await this._client.call('com.atproto.repo.createRecord', undefined, { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers });
|
|
2711
|
+
return res.data;
|
|
2712
|
+
}
|
|
2713
|
+
async put(params, record, headers) {
|
|
2714
|
+
const collection = 'pub.techne.draft.placeResearch';
|
|
2715
|
+
const res = await this._client.call('com.atproto.repo.putRecord', undefined, { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers });
|
|
2716
|
+
return res.data;
|
|
2717
|
+
}
|
|
2718
|
+
async delete(params, headers) {
|
|
2719
|
+
await this._client.call('com.atproto.repo.deleteRecord', undefined, { collection: 'pub.techne.draft.placeResearch', ...params }, { headers });
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2683
2722
|
export class PubTechneDraftPostRecord {
|
|
2684
2723
|
_client;
|
|
2685
2724
|
constructor(client) {
|
|
@@ -3213,6 +3252,39 @@ export class PubTechneDraftSubjectPrefsRecord {
|
|
|
3213
3252
|
await this._client.call('com.atproto.repo.deleteRecord', undefined, { collection: 'pub.techne.draft.subjectPrefs', ...params }, { headers });
|
|
3214
3253
|
}
|
|
3215
3254
|
}
|
|
3255
|
+
export class PubTechneDraftSummaryRecord {
|
|
3256
|
+
_client;
|
|
3257
|
+
constructor(client) {
|
|
3258
|
+
this._client = client;
|
|
3259
|
+
}
|
|
3260
|
+
async list(params) {
|
|
3261
|
+
const res = await this._client.call('com.atproto.repo.listRecords', {
|
|
3262
|
+
collection: 'pub.techne.draft.summary',
|
|
3263
|
+
...params,
|
|
3264
|
+
});
|
|
3265
|
+
return res.data;
|
|
3266
|
+
}
|
|
3267
|
+
async get(params) {
|
|
3268
|
+
const res = await this._client.call('com.atproto.repo.getRecord', {
|
|
3269
|
+
collection: 'pub.techne.draft.summary',
|
|
3270
|
+
...params,
|
|
3271
|
+
});
|
|
3272
|
+
return res.data;
|
|
3273
|
+
}
|
|
3274
|
+
async create(params, record, headers) {
|
|
3275
|
+
const collection = 'pub.techne.draft.summary';
|
|
3276
|
+
const res = await this._client.call('com.atproto.repo.createRecord', undefined, { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers });
|
|
3277
|
+
return res.data;
|
|
3278
|
+
}
|
|
3279
|
+
async put(params, record, headers) {
|
|
3280
|
+
const collection = 'pub.techne.draft.summary';
|
|
3281
|
+
const res = await this._client.call('com.atproto.repo.putRecord', undefined, { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers });
|
|
3282
|
+
return res.data;
|
|
3283
|
+
}
|
|
3284
|
+
async delete(params, headers) {
|
|
3285
|
+
await this._client.call('com.atproto.repo.deleteRecord', undefined, { collection: 'pub.techne.draft.summary', ...params }, { headers });
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3216
3288
|
export class PubTechneDraftVerdictRecord {
|
|
3217
3289
|
_client;
|
|
3218
3290
|
constructor(client) {
|