techne-sdk 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +78 -2
- package/dist/auth/app-key.d.ts +2 -1
- package/dist/auth/app-key.js +2 -1
- package/dist/auth/placement.gen.d.ts +1 -1
- package/dist/auth/placement.gen.js +3 -0
- package/dist/catalog/catalog.gen.d.ts +22 -0
- package/dist/catalog/catalog.gen.js +1839 -66
- package/dist/connect.d.ts +5 -2
- package/dist/generated/index.d.ts +141 -0
- package/dist/generated/index.js +186 -0
- package/dist/generated/lexicons.d.ts +910 -70
- package/dist/generated/lexicons.js +506 -26
- package/dist/generated/nsid.d.ts +46 -0
- package/dist/generated/nsid.js +46 -0
- package/dist/generated/nsid.json +46 -0
- package/dist/generated/records.d.ts +134 -124
- package/dist/generated/types/pub/techne/draft/beaconSpotV2.d.ts +23 -0
- package/dist/generated/types/pub/techne/draft/beaconSpotV2.js +12 -0
- package/dist/generated/types/pub/techne/draft/collectiveV2.d.ts +31 -0
- package/dist/generated/types/pub/techne/draft/collectiveV2.js +12 -0
- package/dist/generated/types/pub/techne/draft/identity/createCollective.d.ts +4 -1
- package/dist/generated/types/pub/techne/draft/identity/createCollective.js +7 -0
- package/dist/generated/types/pub/techne/draft/locationEntry.d.ts +23 -0
- package/dist/generated/types/pub/techne/draft/locationEntry.js +11 -0
- package/dist/generated/types/pub/techne/draft/org.d.ts +6 -4
- package/dist/generated/types/pub/techne/draft/orgAtPlace.d.ts +2 -2
- package/dist/generated/types/pub/techne/draft/pendingBeaconSpotV2.d.ts +24 -0
- package/dist/generated/types/pub/techne/draft/pendingBeaconSpotV2.js +12 -0
- package/dist/generated/types/pub/techne/draft/place.d.ts +4 -0
- package/dist/generated/types/pub/techne/draft/placeV2.d.ts +42 -0
- package/dist/generated/types/pub/techne/draft/placeV2.js +12 -0
- package/dist/generated/types/pub/techne/draft/query/composeRecords.d.ts +8 -4
- package/dist/generated/types/pub/techne/draft/query/countRecords.d.ts +8 -0
- package/dist/generated/types/pub/techne/draft/query/countRecords.js +14 -0
- package/dist/generated/types/pub/techne/draft/query/listRecords.d.ts +41 -1
- package/dist/generated/types/pub/techne/draft/query/listRecords.js +28 -0
- package/dist/generated/types/pub/techne/draft/region.d.ts +20 -0
- package/dist/generated/types/pub/techne/draft/region.js +12 -0
- package/dist/generated/types/pub/techne/draft/statement.d.ts +15 -1
- package/dist/generated/types/pub/techne/draft/statement.js +7 -0
- package/dist/item.d.ts +3 -1
- package/dist/item.js +1 -1
- package/dist/query/compose.d.ts +2 -2
- package/dist/query/compose.js +1 -1
- package/dist/query/hosts.d.ts +1 -1
- package/dist/query/hosts.js +5 -3
- package/dist/query/index.d.ts +51 -6
- package/dist/query/index.js +2 -0
- package/dist/read/index.js +5 -4
- package/dist/wasm/techne-wasm.gen.js +1 -1
- package/dist/wasm/techne-wasm2js.gen.js +8576 -8578
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { HeadersMap, XRPCError } from '@atproto/xrpc';
|
|
5
5
|
import { type ValidationResult } from '@atproto/lexicon';
|
|
6
|
+
import type * as PubTechneDraftQueryListRecords from './listRecords.js';
|
|
6
7
|
import type * as PubTechneDraftQueryGetRecords from './getRecords.js';
|
|
7
8
|
export type QueryParams = {};
|
|
8
9
|
export interface InputSchema {
|
|
@@ -74,8 +75,8 @@ export interface Step {
|
|
|
74
75
|
return: boolean;
|
|
75
76
|
/** Value paths (`a`, `a.b`, `a[].b`): each answered record's `value` keeps only these. Bindings read the whole value, before this selection. The record's other fields come back as `envelope` says, and its `uri` as `uri` says. */
|
|
76
77
|
fields?: string[];
|
|
77
|
-
/** The record fields (#record) each answered record keeps besides `uri` (kept unless `uri` is false) and `value` (always kept): any of cid, author, collection, time, space, source, curated, held, measures, signals and nothing else: the list is closed to these known values, and another name refuses the call as InvalidRequest. Without it every field comes back; `[]` keeps only `value` and, unless `uri` is false, `uri`. A field left out is absent, so a flag left out (`curated`, `held`) reads as false. Bindings read every field, before this selection. */
|
|
78
|
-
envelope?: ('cid' | 'author' | 'collection' | 'time' | 'space' | 'source' | 'curated' | 'held' | 'measures' | 'signals' | (string & {}))[];
|
|
78
|
+
/** The record fields (#record) each answered record keeps besides `uri` (kept unless `uri` is false) and `value` (always kept): any of cid, author, collection, time, space, source, curated, held, measures, signals, matched and nothing else: the list is closed to these known values, and another name refuses the call as InvalidRequest. Without it every field comes back; `[]` keeps only `value` and, unless `uri` is false, `uri`. A field left out is absent, so a flag left out (`curated`, `held`) reads as false. Bindings read every field, before this selection. */
|
|
79
|
+
envelope?: ('cid' | 'author' | 'collection' | 'time' | 'space' | 'source' | 'curated' | 'held' | 'measures' | 'signals' | 'matched' | (string & {}))[];
|
|
79
80
|
/** False: each answered record comes back without its `uri`, for a step whose records nobody reads by URI. Bindings read it, before this cut: `$<step>.uri` stands for the step's records' URIs either way. A get step's `resolved`, `curation` and `defaults` still name records by URI, so with `uri: false` they cannot be matched to the records answered. */
|
|
80
81
|
uri: boolean;
|
|
81
82
|
}
|
|
@@ -92,6 +93,7 @@ export interface StepResult {
|
|
|
92
93
|
count?: number;
|
|
93
94
|
/** List step, asked with `count`: as listRecords' `capped`. */
|
|
94
95
|
capped?: boolean;
|
|
96
|
+
notServedHere?: PubTechneDraftQueryListRecords.NotServedHere;
|
|
95
97
|
/** Get step: as getRecords' `withheld`. */
|
|
96
98
|
withheld?: string[];
|
|
97
99
|
/** Asked with `handles`: as getRecords' `handles`. */
|
|
@@ -123,7 +125,7 @@ export interface Record {
|
|
|
123
125
|
space?: string;
|
|
124
126
|
/** Whether the record is public (on the firehose) or permissioned. */
|
|
125
127
|
source?: 'public' | 'permissioned' | (string & {});
|
|
126
|
-
/** A public record that is a live curated record: a curator the commons root trusts merged it from its sources, and it is not superseded. Its `pub.techne.draft.provenance` (same author, subject this record) names who it is from.
|
|
128
|
+
/** A public record that is a live curated record: a curator the commons root trusts merged it from its sources, and it is not superseded. Its `pub.techne.draft.provenance` (same author, subject this record) names who it is from. Always answered when the step's `envelope` includes it (or names none): false for every other record. */
|
|
127
129
|
curated?: boolean;
|
|
128
130
|
/** 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. */
|
|
129
131
|
held?: boolean;
|
|
@@ -135,13 +137,15 @@ export interface Record {
|
|
|
135
137
|
signals?: {
|
|
136
138
|
[_ in string]: unknown;
|
|
137
139
|
};
|
|
140
|
+
/** As listRecords#record has it: with a `location` `in` or `covers` condition, the stated locations that matched, at most 8. */
|
|
141
|
+
matched?: PubTechneDraftQueryListRecords.MatchedLocation[];
|
|
138
142
|
}
|
|
139
143
|
export declare function isRecord<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.composeRecords", "record">;
|
|
140
144
|
export declare function validateRecord<V>(v: V): ValidationResult<Record & V>;
|
|
141
145
|
/** Why a step has no result: what its method refused (as that method would answer it), `Skipped` (424) for a step that binds to a failed one (it may already have run; its answer is dropped), or InvalidRequest (400) for a step past a call limit: its bindings fill a get step's `uris` past 500 or a bound list past 2000 values, or its records would take the call past 3000 answered across the steps read in one page, counted in step order, or it is a list step asked `return: false` whose query matches more than 50000 records, or a page it read took the records read by the call's steps read past one page past 50000; or InternalError (500) for a step read past one page whose pages stop advancing (a cursor that comes back twice). */
|
|
142
146
|
export interface StepError {
|
|
143
147
|
$type?: 'pub.techne.draft.query.composeRecords#stepError';
|
|
144
|
-
/** The error name the step's method would answer (InvalidRequest, NotFound, ...); InvalidRequest for a step past a call limit (#stepError); or `Skipped`: a step it binds to failed. */
|
|
148
|
+
/** The error name the step's method would answer (InvalidRequest, NotFound, ViewRequired and NotCurated for a list step, ...); InvalidRequest for a step past a call limit (#stepError); or `Skipped`: a step it binds to failed. */
|
|
145
149
|
error: string;
|
|
146
150
|
/** What went wrong, naming the step; for `Skipped`, `step <name>: skipped because <failed step> failed`, naming the step that failed itself (the root of the chain). */
|
|
147
151
|
message: string;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { HeadersMap, XRPCError } from '@atproto/xrpc';
|
|
5
5
|
import { type ValidationResult } from '@atproto/lexicon';
|
|
6
|
+
import type * as PubTechneDraftQueryListRecords from './listRecords.js';
|
|
6
7
|
export type QueryParams = {
|
|
7
8
|
/** A pub.techne.draft.query object, as JSON. Give this or `queryUri`. */
|
|
8
9
|
query?: string;
|
|
@@ -21,6 +22,7 @@ export interface OutputSchema {
|
|
|
21
22
|
capped: boolean;
|
|
22
23
|
/** With groupBy: the count per key, largest first. */
|
|
23
24
|
groups?: Group[];
|
|
25
|
+
notServedHere?: PubTechneDraftQueryListRecords.NotServedHere;
|
|
24
26
|
}
|
|
25
27
|
export interface CallOptions {
|
|
26
28
|
signal?: AbortSignal;
|
|
@@ -34,6 +36,12 @@ export interface Response {
|
|
|
34
36
|
export declare class InvalidRequestError extends XRPCError {
|
|
35
37
|
constructor(src: XRPCError);
|
|
36
38
|
}
|
|
39
|
+
export declare class ViewRequiredError extends XRPCError {
|
|
40
|
+
constructor(src: XRPCError);
|
|
41
|
+
}
|
|
42
|
+
export declare class NotCuratedError extends XRPCError {
|
|
43
|
+
constructor(src: XRPCError);
|
|
44
|
+
}
|
|
37
45
|
export declare class NotFoundError extends XRPCError {
|
|
38
46
|
constructor(src: XRPCError);
|
|
39
47
|
}
|
|
@@ -11,6 +11,16 @@ export class InvalidRequestError extends XRPCError {
|
|
|
11
11
|
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
export class ViewRequiredError extends XRPCError {
|
|
15
|
+
constructor(src) {
|
|
16
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class NotCuratedError extends XRPCError {
|
|
20
|
+
constructor(src) {
|
|
21
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
14
24
|
export class NotFoundError extends XRPCError {
|
|
15
25
|
constructor(src) {
|
|
16
26
|
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
@@ -20,6 +30,10 @@ export function toKnownErr(e) {
|
|
|
20
30
|
if (e instanceof XRPCError) {
|
|
21
31
|
if (e.error === 'InvalidRequest')
|
|
22
32
|
return new InvalidRequestError(e);
|
|
33
|
+
if (e.error === 'ViewRequired')
|
|
34
|
+
return new ViewRequiredError(e);
|
|
35
|
+
if (e.error === 'NotCurated')
|
|
36
|
+
return new NotCuratedError(e);
|
|
23
37
|
if (e.error === 'NotFound')
|
|
24
38
|
return new NotFoundError(e);
|
|
25
39
|
}
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { HeadersMap, XRPCError } from '@atproto/xrpc';
|
|
5
5
|
import { type ValidationResult } from '@atproto/lexicon';
|
|
6
|
+
import { type $Typed } from '../../../../../util.js';
|
|
7
|
+
import type * as CommunityLexiconLocationGeo from '../../../../community/lexicon/location/geo.js';
|
|
8
|
+
import type * as CommunityLexiconLocationHthree from '../../../../community/lexicon/location/hthree.js';
|
|
9
|
+
import type * as CommunityLexiconLocationAddress from '../../../../community/lexicon/location/address.js';
|
|
10
|
+
import type * as ComAtprotoRepoStrongRef from '../../../../com/atproto/repo/strongRef.js';
|
|
11
|
+
import type * as PubTechneDraftLocationEntry from '../locationEntry.js';
|
|
6
12
|
export type QueryParams = {
|
|
7
13
|
/** A pub.techne.draft.query object, as JSON. Give this or `queryUri`. */
|
|
8
14
|
query?: string;
|
|
@@ -27,6 +33,7 @@ export interface OutputSchema {
|
|
|
27
33
|
count?: number;
|
|
28
34
|
/** Only when asked with `count=true`: true when there are more than `count` (countRecords' `capped`). */
|
|
29
35
|
capped?: boolean;
|
|
36
|
+
notServedHere?: NotServedHere;
|
|
30
37
|
}
|
|
31
38
|
export interface CallOptions {
|
|
32
39
|
signal?: AbortSignal;
|
|
@@ -40,6 +47,12 @@ export interface Response {
|
|
|
40
47
|
export declare class InvalidRequestError extends XRPCError {
|
|
41
48
|
constructor(src: XRPCError);
|
|
42
49
|
}
|
|
50
|
+
export declare class ViewRequiredError extends XRPCError {
|
|
51
|
+
constructor(src: XRPCError);
|
|
52
|
+
}
|
|
53
|
+
export declare class NotCuratedError extends XRPCError {
|
|
54
|
+
constructor(src: XRPCError);
|
|
55
|
+
}
|
|
43
56
|
export declare class NotFoundError extends XRPCError {
|
|
44
57
|
constructor(src: XRPCError);
|
|
45
58
|
}
|
|
@@ -62,7 +75,7 @@ export interface Record {
|
|
|
62
75
|
space?: string;
|
|
63
76
|
/** Whether the record is public (on the firehose) or permissioned. */
|
|
64
77
|
source: 'public' | 'permissioned' | (string & {});
|
|
65
|
-
/** A public record that is a live curated record: a curator the commons root trusts merged it from its sources, and it is not superseded. Its `pub.techne.draft.provenance` (same author, subject this record) names who it is from.
|
|
78
|
+
/** A public record that is a live curated record: a curator the commons root trusts merged it from its sources, and it is not superseded. Its `pub.techne.draft.provenance` (same author, subject this record) names who it is from. Always answered: false for every other record (a source copy, a superseded one, a permissioned one). */
|
|
66
79
|
curated?: boolean;
|
|
67
80
|
/** 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. */
|
|
68
81
|
held?: boolean;
|
|
@@ -74,6 +87,33 @@ export interface Record {
|
|
|
74
87
|
signals?: {
|
|
75
88
|
[_ in string]: unknown;
|
|
76
89
|
};
|
|
90
|
+
/** With a `location` `in` or `covers` condition: the stated locations that matched (with `followed`, its subject's), at most 8. */
|
|
91
|
+
matched?: MatchedLocation[];
|
|
77
92
|
}
|
|
78
93
|
export declare function isRecord<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.listRecords", "record">;
|
|
79
94
|
export declare function validateRecord<V>(v: V): ValidationResult<Record & V>;
|
|
95
|
+
/** One stated location that matched. */
|
|
96
|
+
export interface MatchedLocation {
|
|
97
|
+
$type?: 'pub.techne.draft.query.listRecords#matchedLocation';
|
|
98
|
+
entry?: $Typed<CommunityLexiconLocationGeo.Main> | $Typed<CommunityLexiconLocationHthree.Main> | $Typed<CommunityLexiconLocationAddress.Main> | $Typed<ComAtprotoRepoStrongRef.Main> | $Typed<PubTechneDraftLocationEntry.Main> | {
|
|
99
|
+
$type: string;
|
|
100
|
+
};
|
|
101
|
+
/** How the thing relates to the place (`at`, `serves`, `registered`, ...). */
|
|
102
|
+
kind: string;
|
|
103
|
+
/** Who stated it: the record's author, or a claim's writer. */
|
|
104
|
+
asserter: string;
|
|
105
|
+
/** The record that stated it (the record itself, or a claim about it). */
|
|
106
|
+
source: string;
|
|
107
|
+
}
|
|
108
|
+
export declare function isMatchedLocation<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.listRecords", "matchedLocation">;
|
|
109
|
+
export declare function validateMatchedLocation<V>(v: V): ValidationResult<MatchedLocation & V>;
|
|
110
|
+
/** Why the answer is not the whole answer: this operator does not serve the place asked about. An empty list (or a zero count) with this set means "not served here", not "nothing there". */
|
|
111
|
+
export interface NotServedHere {
|
|
112
|
+
$type?: 'pub.techne.draft.query.listRecords#notServedHere';
|
|
113
|
+
/** `outsideCoverage`: a `near` or `covers` point lies outside the areas this operator serves. `areaNotHeld`: an `in` area is one this operator does not hold, or lies outside the areas it serves. */
|
|
114
|
+
reason: 'outsideCoverage' | 'areaNotHeld' | (string & {});
|
|
115
|
+
/** The reason, in words, for a person to read. */
|
|
116
|
+
message: string;
|
|
117
|
+
}
|
|
118
|
+
export declare function isNotServedHere<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.listRecords", "notServedHere">;
|
|
119
|
+
export declare function validateNotServedHere<V>(v: V): ValidationResult<NotServedHere & V>;
|
|
@@ -11,6 +11,16 @@ export class InvalidRequestError extends XRPCError {
|
|
|
11
11
|
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
export class ViewRequiredError extends XRPCError {
|
|
15
|
+
constructor(src) {
|
|
16
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class NotCuratedError extends XRPCError {
|
|
20
|
+
constructor(src) {
|
|
21
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
14
24
|
export class NotFoundError extends XRPCError {
|
|
15
25
|
constructor(src) {
|
|
16
26
|
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
@@ -20,6 +30,10 @@ export function toKnownErr(e) {
|
|
|
20
30
|
if (e instanceof XRPCError) {
|
|
21
31
|
if (e.error === 'InvalidRequest')
|
|
22
32
|
return new InvalidRequestError(e);
|
|
33
|
+
if (e.error === 'ViewRequired')
|
|
34
|
+
return new ViewRequiredError(e);
|
|
35
|
+
if (e.error === 'NotCurated')
|
|
36
|
+
return new NotCuratedError(e);
|
|
23
37
|
if (e.error === 'NotFound')
|
|
24
38
|
return new NotFoundError(e);
|
|
25
39
|
}
|
|
@@ -32,3 +46,17 @@ export function isRecord(v) {
|
|
|
32
46
|
export function validateRecord(v) {
|
|
33
47
|
return validate(v, id, hashRecord);
|
|
34
48
|
}
|
|
49
|
+
const hashMatchedLocation = 'matchedLocation';
|
|
50
|
+
export function isMatchedLocation(v) {
|
|
51
|
+
return is$typed(v, id, hashMatchedLocation);
|
|
52
|
+
}
|
|
53
|
+
export function validateMatchedLocation(v) {
|
|
54
|
+
return validate(v, id, hashMatchedLocation);
|
|
55
|
+
}
|
|
56
|
+
const hashNotServedHere = 'notServedHere';
|
|
57
|
+
export function isNotServedHere(v) {
|
|
58
|
+
return is$typed(v, id, hashNotServedHere);
|
|
59
|
+
}
|
|
60
|
+
export function validateNotServedHere(v) {
|
|
61
|
+
return validate(v, id, hashNotServedHere);
|
|
62
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult } from '@atproto/lexicon';
|
|
5
|
+
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js';
|
|
6
|
+
export interface Main {
|
|
7
|
+
$type: 'pub.techne.draft.region';
|
|
8
|
+
area: ComAtprotoRepoStrongRef.Main;
|
|
9
|
+
/** The operator that holds the region: the DID of the account that runs its AppView. Its endpoint is a fact about the operator and is not stored here. */
|
|
10
|
+
operator: string;
|
|
11
|
+
/** When the period starts. Absent: from always. */
|
|
12
|
+
validFrom?: string;
|
|
13
|
+
/** When the period ends (exclusive). Absent: it has not ended. */
|
|
14
|
+
validUntil?: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
[k: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare function isMain<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.region", "main">;
|
|
19
|
+
export declare function validateMain<V>(v: V): ValidationResult<Main & V>;
|
|
20
|
+
export { type Main as Record, isMain as isRecord, validateMain as validateRecord, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { validate as _validate } from '../../../../lexicons.js';
|
|
2
|
+
import { is$typed as _is$typed, } from '../../../../util.js';
|
|
3
|
+
const is$typed = _is$typed, validate = _validate;
|
|
4
|
+
const id = 'pub.techne.draft.region';
|
|
5
|
+
const hashMain = 'main';
|
|
6
|
+
export function isMain(v) {
|
|
7
|
+
return is$typed(v, id, hashMain);
|
|
8
|
+
}
|
|
9
|
+
export function validateMain(v) {
|
|
10
|
+
return validate(v, id, hashMain, true);
|
|
11
|
+
}
|
|
12
|
+
export { isMain as isRecord, validateMain as validateRecord, };
|
|
@@ -5,10 +5,14 @@ import { type ValidationResult } from '@atproto/lexicon';
|
|
|
5
5
|
import { type $Typed } from '../../../../util.js';
|
|
6
6
|
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js';
|
|
7
7
|
import type * as PubTechneDraftOrg from './org.js';
|
|
8
|
+
import type * as CommunityLexiconLocationGeo from '../../../community/lexicon/location/geo.js';
|
|
9
|
+
import type * as CommunityLexiconLocationHthree from '../../../community/lexicon/location/hthree.js';
|
|
10
|
+
import type * as CommunityLexiconLocationAddress from '../../../community/lexicon/location/address.js';
|
|
11
|
+
import type * as PubTechneDraftLocationEntry from './locationEntry.js';
|
|
8
12
|
export interface Main {
|
|
9
13
|
$type: 'pub.techne.draft.statement';
|
|
10
14
|
subject: ComAtprotoRepoStrongRef.Main;
|
|
11
|
-
fields: $Typed<PubTechneDraftOrg.Fields> | {
|
|
15
|
+
fields: $Typed<PubTechneDraftOrg.Fields> | $Typed<Locations> | {
|
|
12
16
|
$type: string;
|
|
13
17
|
};
|
|
14
18
|
createdAt: string;
|
|
@@ -17,3 +21,13 @@ export interface Main {
|
|
|
17
21
|
export declare function isMain<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.statement", "main">;
|
|
18
22
|
export declare function validateMain<V>(v: V): ValidationResult<Main & V>;
|
|
19
23
|
export { type Main as Record, isMain as isRecord, validateMain as validateRecord, };
|
|
24
|
+
/** Where the subject is, as the writer of the statement says, for a subject of any type. It counts only as the view decides: the subject's own locations win, and a statement fills in only where the subject states no location of that kind, or (with `basis`) gives a position to a subject's entry that has none. A statement the subject's own author writes counts as the subject's own locations. A `basis` equal to the subject record's CID (a legacy claim) counts for any own entry of that kind with no position, while the subject is still that version. When several claims compete for one slot (the same kind, and the same `basis` or none), one counts: the finest grain wins, then the newest, then the lowest source URI; the others are conflicts. Read as written, every writer's claim is weighed; curated, only the subject's author's and those of writers the commons root endorses. */
|
|
25
|
+
export interface Locations {
|
|
26
|
+
$type?: 'pub.techne.draft.statement#locations';
|
|
27
|
+
/** Entries as in the subject's own `locations` field (lexicon naming register). */
|
|
28
|
+
locations: ($Typed<CommunityLexiconLocationGeo.Main> | $Typed<CommunityLexiconLocationHthree.Main> | $Typed<CommunityLexiconLocationAddress.Main> | $Typed<ComAtprotoRepoStrongRef.Main> | $Typed<PubTechneDraftLocationEntry.Main> | {
|
|
29
|
+
$type: string;
|
|
30
|
+
})[];
|
|
31
|
+
}
|
|
32
|
+
export declare function isLocations<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.statement", "locations">;
|
|
33
|
+
export declare function validateLocations<V>(v: V): ValidationResult<Locations & V>;
|
|
@@ -10,3 +10,10 @@ export function validateMain(v) {
|
|
|
10
10
|
return validate(v, id, hashMain, true);
|
|
11
11
|
}
|
|
12
12
|
export { isMain as isRecord, validateMain as validateRecord, };
|
|
13
|
+
const hashLocations = 'locations';
|
|
14
|
+
export function isLocations(v) {
|
|
15
|
+
return is$typed(v, id, hashLocations);
|
|
16
|
+
}
|
|
17
|
+
export function validateLocations(v) {
|
|
18
|
+
return validate(v, id, hashLocations);
|
|
19
|
+
}
|
package/dist/item.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* the one shape every read answers (`Item<T>`), typed URIs, and the check that
|
|
4
4
|
* gives each item its verdict.
|
|
5
5
|
*
|
|
6
|
-
* An item is `{ uri, cid, record, verdict, problems, curated, byline }`:
|
|
6
|
+
* An item is `{ uri, cid, author, record, verdict, problems, curated, byline }`:
|
|
7
7
|
*
|
|
8
8
|
* - `uri` is typed (`Uri<Place>`), so a hook handed `item.uri` comes back typed. A bare string is no
|
|
9
9
|
* `Uri<Place>` (only an item, or `Place.uri(s)`, makes one); a read taking a bare string answers
|
|
@@ -59,6 +59,8 @@ export interface Byline extends BylineRef {
|
|
|
59
59
|
interface ItemBase<T> {
|
|
60
60
|
uri: Uri<T>;
|
|
61
61
|
cid: string;
|
|
62
|
+
/** The DID whose repo holds the record: its author (a curated record's is the curator's). */
|
|
63
|
+
author: string;
|
|
62
64
|
/** Why it is not valid: the check's reasons when invalid, what it waits for when pending. */
|
|
63
65
|
problems: string[];
|
|
64
66
|
/** A live curated record (the commons composed it from versions). */
|
package/dist/item.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* the one shape every read answers (`Item<T>`), typed URIs, and the check that
|
|
4
4
|
* gives each item its verdict.
|
|
5
5
|
*
|
|
6
|
-
* An item is `{ uri, cid, record, verdict, problems, curated, byline }`:
|
|
6
|
+
* An item is `{ uri, cid, author, record, verdict, problems, curated, byline }`:
|
|
7
7
|
*
|
|
8
8
|
* - `uri` is typed (`Uri<Place>`), so a hook handed `item.uri` comes back typed. A bare string is no
|
|
9
9
|
* `Uri<Place>` (only an item, or `Place.uri(s)`, makes one); a read taking a bare string answers
|
package/dist/query/compose.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export declare const COMPOSE_RETRIES = 2;
|
|
|
75
75
|
export declare const ENVELOPE_ONLY: readonly string[];
|
|
76
76
|
/** The record fields a step's `envelope` may keep besides `uri` (kept unless the step asks `uri: false`) and
|
|
77
77
|
* `value` (always kept). */
|
|
78
|
-
export declare const ENVELOPE_FIELDS: readonly ["cid", "author", "collection", "time", "space", "source", "curated", "held", "measures", "signals"];
|
|
78
|
+
export declare const ENVELOPE_FIELDS: readonly ["cid", "author", "collection", "time", "space", "source", "curated", "held", "measures", "signals", "matched"];
|
|
79
79
|
export type EnvelopeField = (typeof ENVELOPE_FIELDS)[number];
|
|
80
80
|
declare const envelopeOf: unique symbol;
|
|
81
81
|
declare const uriOf: unique symbol;
|
|
@@ -87,7 +87,7 @@ type KeptUri<U extends boolean> = [U] extends [true] ? 'uri' : never;
|
|
|
87
87
|
* `E` is every field: listRecords' record.
|
|
88
88
|
* It carries the same marker as {@link StepRef}: a record kept with more fields stands in for one needing fewer,
|
|
89
89
|
* never the other way, even when the field left out is optional (`space`, `curated`, `held`, `measures`,
|
|
90
|
-
* `signals`), which `Pick` alone would let through. A whole {@link QueryRecord} (no marker) stands in for any. */
|
|
90
|
+
* `signals`, `matched`), which `Pick` alone would let through. A whole {@link QueryRecord} (no marker) stands in for any. */
|
|
91
91
|
export type StepRecord<V = Record<string, unknown>, E extends EnvelopeField = EnvelopeField, U extends boolean = true> = Pick<QueryRecord<V>, KeptUri<U> | 'value' | E> & {
|
|
92
92
|
/** Type only, never set: the record fields the step kept. */
|
|
93
93
|
readonly [envelopeOf]?: (field: E) => void;
|
package/dist/query/compose.js
CHANGED
|
@@ -70,7 +70,7 @@ export const COMPOSE_RETRIES = 2;
|
|
|
70
70
|
export const ENVELOPE_ONLY = ['_'];
|
|
71
71
|
/** The record fields a step's `envelope` may keep besides `uri` (kept unless the step asks `uri: false`) and
|
|
72
72
|
* `value` (always kept). */
|
|
73
|
-
export const ENVELOPE_FIELDS = ['cid', 'author', 'collection', 'time', 'space', 'source', 'curated', 'held', 'measures', 'signals'];
|
|
73
|
+
export const ENVELOPE_FIELDS = ['cid', 'author', 'collection', 'time', 'space', 'source', 'curated', 'held', 'measures', 'signals', 'matched'];
|
|
74
74
|
const isRecord = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
75
75
|
/** `e` as a {@link StepError} when it is one; `undefined` otherwise. */
|
|
76
76
|
function stepErrorOf(e) {
|
package/dist/query/hosts.d.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { type Binding, type EnvelopeField, type Composed, type Composition, type Reader, type StepRecord, type StepRef } from './compose.js';
|
|
25
25
|
import { type Query, type QueryReader, type QueryRecord } from './index.js';
|
|
26
|
-
/** The provenance records written about `$uris` (as written
|
|
26
|
+
/** The provenance records written about `$uris` (as written). */
|
|
27
27
|
export declare const PROVENANCE_OF_QUERY: Query;
|
|
28
28
|
/** The mirror sidecars written about `$uris` (`source`, and the frozen old-Almanac `sourceRef`). */
|
|
29
29
|
export declare const MIRROR_SIDECARS_QUERY: Query;
|
package/dist/query/hosts.js
CHANGED
|
@@ -24,12 +24,14 @@
|
|
|
24
24
|
import { NSID } from '../generated/nsid.js';
|
|
25
25
|
import { compose, ENVELOPE_ONLY, MAX_STEP_LIMIT } from './compose.js';
|
|
26
26
|
import { getRecords, listAllRecordsFor } from './index.js';
|
|
27
|
-
/** The provenance records written about `$uris` (as written
|
|
27
|
+
/** The provenance records written about `$uris` (as written). */
|
|
28
28
|
export const PROVENANCE_OF_QUERY = {
|
|
29
|
+
view: 'asWritten',
|
|
29
30
|
where: { all: [{ type: { is: NSID.PROVENANCE } }, { subject: { in: ['$uris'] } }] },
|
|
30
31
|
};
|
|
31
32
|
/** The mirror sidecars written about `$uris` (`source`, and the frozen old-Almanac `sourceRef`). */
|
|
32
33
|
export const MIRROR_SIDECARS_QUERY = {
|
|
34
|
+
view: 'asWritten',
|
|
33
35
|
where: { all: [{ type: { in: [NSID.SOURCE, NSID.SOURCE_REF] } }, { subject: { in: ['$uris'] } }] },
|
|
34
36
|
};
|
|
35
37
|
const authority = (uri) => uri.split('/')[2] ?? '';
|
|
@@ -130,7 +132,7 @@ export const HOST_SOURCES_QUERY = {
|
|
|
130
132
|
{ not: [{ has: { via: 'subject', by: 'author', where: { type: { in: [NSID.SOURCE, NSID.SOURCE_REF] } } } }] },
|
|
131
133
|
],
|
|
132
134
|
},
|
|
133
|
-
|
|
135
|
+
view: 'asWritten',
|
|
134
136
|
};
|
|
135
137
|
/** The record fields {@link hostsFrom} reads of the host steps' records: a page that hands the provenances to no
|
|
136
138
|
* other rule asks {@link hostSteps} for exactly these. */
|
|
@@ -285,8 +287,8 @@ export async function listedOnOf(read, record) {
|
|
|
285
287
|
/** The provenances naming any of `$uris` among their sources (the `references` role): a source copy finds
|
|
286
288
|
* the curated record made from it. As written, so a provenance is found whatever lists. */
|
|
287
289
|
export const CURATED_FROM_QUERY = {
|
|
290
|
+
view: 'asWritten',
|
|
288
291
|
where: { all: [{ type: { is: NSID.PROVENANCE } }, { references: { in: ['$uris'] } }] },
|
|
289
|
-
curated: false,
|
|
290
292
|
};
|
|
291
293
|
/**
|
|
292
294
|
* The live curated record that stands for `uri` now, when `uri` itself is not one a reader is shown (the
|
package/dist/query/index.d.ts
CHANGED
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
* `get(nsid, params)` over whatever session it has. What a record means stays the app's.
|
|
14
14
|
*/
|
|
15
15
|
import type * as GetRecords from '../generated/types/pub/techne/draft/query/getRecords.js';
|
|
16
|
+
import type * as ListRecords from '../generated/types/pub/techne/draft/query/listRecords.js';
|
|
16
17
|
/** A `$param` value: a string, or a list of strings where the query says `in`. */
|
|
17
18
|
export type Param = string | readonly string[];
|
|
18
19
|
/** The one call this module makes: a GET of a platform method. A list value is sent repeated. */
|
|
19
20
|
export type QueryReader = <T>(nsid: string, params: Record<string, string | number | readonly string[] | undefined>) => Promise<T>;
|
|
20
|
-
/** One condition on a role (`{ "is": … }`, `{ "near": { point, within }, "as": … }`, …).
|
|
21
|
+
/** One condition on a role (`{ "is": … }`, `{ "near": { point, within }, "as": … }`, …). On `location`, `in` (a list
|
|
22
|
+
* of area URIs) and `covers` (a point), each with `kind` and `followed`, answer each record's
|
|
23
|
+
* {@link QueryRecord.matched}. */
|
|
21
24
|
export type Condition = Readonly<Record<string, unknown>>;
|
|
22
25
|
/** `has`: some public record the caller may read names this one through the role `via` (`subject`), by this
|
|
23
26
|
* record's own author when `by: 'author'`, and matches `where` (type and author conditions, `is`/`in`, alone or
|
|
@@ -39,19 +42,45 @@ export type QueryNode = {
|
|
|
39
42
|
} | {
|
|
40
43
|
readonly [role: string]: Condition | readonly QueryNode[];
|
|
41
44
|
};
|
|
42
|
-
/**
|
|
43
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Which public records a branch reads; every list names one, there is no default (the `view` property of `pub.techne.draft.query` and its `#branch`):
|
|
47
|
+
* - `curated`: the commons' listed records, one curated record per thing (merged from its sources by a curator
|
|
48
|
+
* the commons root trusts), moderated, not hidden; an event only inside the supported areas. A type no curator
|
|
49
|
+
* covers is refused with `NotCurated`, naming the type, never answered as an empty list.
|
|
50
|
+
* - `asWritten`: every public record as its author wrote it, each source copy and the curated record, not hidden,
|
|
51
|
+
* not superseded. Totals in this view count both copies of a curated thing.
|
|
52
|
+
* A permissioned record reads the same in both (it is never curated).
|
|
53
|
+
*/
|
|
54
|
+
export type View = 'curated' | 'asWritten';
|
|
55
|
+
/** One branch of a query in the `any` form: its own view and `where`. */
|
|
56
|
+
export interface QueryBranch {
|
|
57
|
+
readonly view: View;
|
|
44
58
|
readonly where: QueryNode;
|
|
45
|
-
|
|
59
|
+
}
|
|
60
|
+
/** What every query document carries besides its branches. */
|
|
61
|
+
export interface QueryOptions {
|
|
62
|
+
/** A role, a measure's `as` name, or `shuffle` (one deterministic order per `seed`). */
|
|
46
63
|
readonly order?: string;
|
|
47
64
|
/** The seed of `order: "shuffle"`: a literal or a `$param`; required with it, refused without it. */
|
|
48
65
|
readonly seed?: string;
|
|
49
66
|
readonly limit?: number;
|
|
50
67
|
readonly signals?: readonly Readonly<Record<string, unknown>>[];
|
|
51
|
-
readonly curated?: boolean;
|
|
52
68
|
/** Only the caller's own permissioned records the reach limit is holding back (each marked `held`). */
|
|
53
69
|
readonly held?: boolean;
|
|
54
70
|
}
|
|
71
|
+
/** A `pub.techne.draft.query`, as data (the platform validates it). Every branch names its {@link View}: `view`
|
|
72
|
+
* beside `where` names it for every branch of the `where` (each child of a top-level `any` too), and the `any`
|
|
73
|
+
* form, `{ any: [{ view, where }, …] }`, one per branch (an app's feed: curated events and its own records as
|
|
74
|
+
* written, in one list). A query naming no view is refused with `ViewRequired`. */
|
|
75
|
+
export type Query = QueryOptions & ({
|
|
76
|
+
readonly view: View;
|
|
77
|
+
readonly where: QueryNode;
|
|
78
|
+
readonly any?: never;
|
|
79
|
+
} | {
|
|
80
|
+
readonly any: readonly [QueryBranch, ...QueryBranch[]];
|
|
81
|
+
readonly view?: never;
|
|
82
|
+
readonly where?: never;
|
|
83
|
+
});
|
|
55
84
|
/** One record a query answered (`pub.techne.draft.query.listRecords#record`). */
|
|
56
85
|
export interface QueryRecord<V = Record<string, unknown>> {
|
|
57
86
|
uri: string;
|
|
@@ -65,7 +94,8 @@ export interface QueryRecord<V = Record<string, unknown>> {
|
|
|
65
94
|
space?: string;
|
|
66
95
|
source: 'public' | 'permissioned';
|
|
67
96
|
/** A public record that is a live curated record (a curator the commons root trusts merged it); its
|
|
68
|
-
* provenance names who it is from ({@link hostsOf}).
|
|
97
|
+
* provenance names who it is from ({@link hostsOf}). Always answered, false otherwise (a platform from before
|
|
98
|
+
* views left it out when false). */
|
|
69
99
|
curated?: boolean;
|
|
70
100
|
/** The caller's own permissioned record the reach limit holds back from the people it would reach:
|
|
71
101
|
* answered to its author alone (anyone else does not see it) until the limit admits it. */
|
|
@@ -73,7 +103,16 @@ export interface QueryRecord<V = Record<string, unknown>> {
|
|
|
73
103
|
/** The numbers the query's operators produced, by name (a `near` distance in metres). */
|
|
74
104
|
measures?: Record<string, number>;
|
|
75
105
|
signals?: Record<string, number>;
|
|
106
|
+
/** With a `location` `in` or `covers` condition: the stated locations that matched (with `followed`, its
|
|
107
|
+
* subject's), at most 8. */
|
|
108
|
+
matched?: MatchedLocation[];
|
|
76
109
|
}
|
|
110
|
+
/** One stated location a `location` `in` or `covers` condition matched (`listRecords#matchedLocation`). */
|
|
111
|
+
export type MatchedLocation = Omit<ListRecords.MatchedLocation, '$type'>;
|
|
112
|
+
/** The query asked about a place this platform does not serve (`listRecords#notServedHere`): an empty list or a
|
|
113
|
+
* zero count with it means "not served here", not "nothing there". `reason` is `outsideCoverage` (a `near` or
|
|
114
|
+
* `covers` point outside the areas served) or `areaNotHeld` (an `in` area not held, or outside them). */
|
|
115
|
+
export type NotServedHere = Omit<ListRecords.NotServedHere, '$type'>;
|
|
77
116
|
export interface ListPage<V = Record<string, unknown>> {
|
|
78
117
|
records: QueryRecord<V>[];
|
|
79
118
|
cursor?: string;
|
|
@@ -81,6 +120,8 @@ export interface ListPage<V = Record<string, unknown>> {
|
|
|
81
120
|
count?: number;
|
|
82
121
|
/** Asked with `count`: counting stopped at the platform's cap. */
|
|
83
122
|
capped?: boolean;
|
|
123
|
+
/** The query asked about a place this platform does not serve. */
|
|
124
|
+
notServedHere?: NotServedHere;
|
|
84
125
|
}
|
|
85
126
|
/** The most records one `listRecords` page carries (the lexicon's `limit` maximum). */
|
|
86
127
|
export declare const MAX_PAGE = 500;
|
|
@@ -129,6 +170,8 @@ export declare function batches<T>(list: readonly T[], fixed?: number): T[][];
|
|
|
129
170
|
* Every page of `query`, in its order. The query is the bound (the platform proves each branch
|
|
130
171
|
* index-driven); {@link MAX_PAGES} is only a guard. A page can hold fewer records than its limit and still carry
|
|
131
172
|
* a cursor (the platform's read rule drops some after reading), so paging stops only when none comes back.
|
|
173
|
+
* Records only: a page's `notServedHere` is not carried, so read a location query that may fall outside this
|
|
174
|
+
* platform's areas with {@link listRecords}.
|
|
132
175
|
*/
|
|
133
176
|
export declare function listAllRecords<V = Record<string, unknown>>(read: QueryReader, query: Query, call?: Omit<ListCall, 'cursor'>): Promise<QueryRecord<V>[]>;
|
|
134
177
|
/**
|
|
@@ -145,6 +188,8 @@ export interface CountAnswer {
|
|
|
145
188
|
key: string;
|
|
146
189
|
count: number;
|
|
147
190
|
}[];
|
|
191
|
+
/** The query asked about a place this platform does not serve: a zero count means not served, not none. */
|
|
192
|
+
notServedHere?: NotServedHere;
|
|
148
193
|
}
|
|
149
194
|
/** How many records `listRecords` would answer for `query`, optionally per type or author. */
|
|
150
195
|
export declare function countRecords(read: QueryReader, query: Query, call?: {
|
package/dist/query/index.js
CHANGED
|
@@ -96,6 +96,8 @@ export function batches(list, fixed = 0) {
|
|
|
96
96
|
* Every page of `query`, in its order. The query is the bound (the platform proves each branch
|
|
97
97
|
* index-driven); {@link MAX_PAGES} is only a guard. A page can hold fewer records than its limit and still carry
|
|
98
98
|
* a cursor (the platform's read rule drops some after reading), so paging stops only when none comes back.
|
|
99
|
+
* Records only: a page's `notServedHere` is not carried, so read a location query that may fall outside this
|
|
100
|
+
* platform's areas with {@link listRecords}.
|
|
99
101
|
*/
|
|
100
102
|
export async function listAllRecords(read, query, call = {}) {
|
|
101
103
|
const out = [];
|
package/dist/read/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* {@link Item}s, and their options forms (`{ queryKey, queryFn }`, for TanStack Query). Internal: an app
|
|
4
4
|
* calls them on what `connect` returns, which binds them to its session and the claims it holds.
|
|
5
5
|
*
|
|
6
|
-
* - `query(q, opts)`: one page of a query document (`pub.techne.draft.query.listRecords`).
|
|
7
|
-
*
|
|
6
|
+
* - `query(q, opts)`: one page of a query document (`pub.techne.draft.query.listRecords`). Every list reads
|
|
7
|
+
* the view the query names (`view`: `curated` or `asWritten`, on the platform). `count` is a read option
|
|
8
8
|
* (the document has no count field); the page's `count` is what the platform counted, before `include`.
|
|
9
9
|
* - `get(uri, opts)`: one record. By default the curated view: `commons.getVersions` resolves any copy to
|
|
10
10
|
* its curated record, and a type nobody curates answers the record itself. `prefer: 'mine'` answers the
|
|
@@ -28,9 +28,10 @@ export const readerOf = (techne) => async (nsid, params) => (await techne.platfo
|
|
|
28
28
|
export const posterOf = (techne) => async (nsid, body) => (await techne.platform.call(nsid, {}, body, { encoding: 'application/json' })).data;
|
|
29
29
|
/** `r` as an item, with `byline` from its curated record's composition. */
|
|
30
30
|
function itemOf(techne, r, curated, composition) {
|
|
31
|
-
const
|
|
31
|
+
const author = r.author ?? authorOf(r.uri);
|
|
32
|
+
const { verdict, problems } = check({ uri: r.uri, collection: r.collection ?? collectionOf(r.uri), author, value: r.value, space: r.space, time: r.time, held: r.held }, techne.claims);
|
|
32
33
|
// The check is what makes the record a `T`: valid and pending records passed its lexicon check.
|
|
33
|
-
return { uri: r.uri, cid: r.cid, record: r.value, verdict, problems, curated, byline: curated ? bylineOf(composition) : null };
|
|
34
|
+
return { uri: r.uri, cid: r.cid, author, record: r.value, verdict, problems, curated, byline: curated ? bylineOf(composition) : null };
|
|
34
35
|
}
|
|
35
36
|
const fromQueryRecord = (techne, r, composition) => itemOf(techne, r, r.curated === true, composition);
|
|
36
37
|
export async function query(techne, q, opts = {}) {
|