techne-sdk 0.1.0 → 0.3.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 +139 -0
- package/README.md +48 -2
- package/dist/auth/app-key.d.ts +8 -0
- package/dist/auth/app-key.js +95 -0
- package/dist/auth/index.d.ts +192 -0
- package/dist/auth/index.js +230 -0
- package/dist/auth/placement.gen.d.ts +1 -0
- package/dist/auth/placement.gen.js +50 -0
- package/dist/catalog/catalog.gen.js +2161 -681
- package/dist/connect.js +2 -1
- package/dist/generated/index.d.ts +61 -0
- package/dist/generated/index.js +116 -0
- package/dist/generated/lexicons.d.ts +3689 -1449
- package/dist/generated/lexicons.js +1237 -42
- package/dist/generated/nsid.d.ts +23 -1
- package/dist/generated/nsid.js +23 -19
- package/dist/generated/nsid.json +23 -19
- package/dist/generated/records.d.ts +28 -26
- package/dist/generated/types/pub/techne/draft/commons/getVersions.d.ts +3 -3
- package/dist/generated/types/pub/techne/draft/commons/runChain.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/credential.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/credentialRevocation.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/permissioned/deleteRecord.d.ts +5 -0
- package/dist/generated/types/pub/techne/draft/permissioned/deleteRecord.js +7 -0
- package/dist/generated/types/pub/techne/draft/permissioned/getRecord.d.ts +2 -1
- package/dist/generated/types/pub/techne/draft/permissioned/listChanges.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/permissioned/putRecord.d.ts +2 -2
- package/dist/generated/types/pub/techne/draft/provenance.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/publisher.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/query/composeRecords.d.ts +152 -0
- package/dist/generated/types/pub/techne/draft/query/composeRecords.js +55 -0
- package/dist/generated/types/pub/techne/draft/query/getRecords.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/query/listRecords.d.ts +0 -4
- package/dist/generated/types/pub/techne/draft/query/listRejections.d.ts +2 -2
- package/dist/generated/types/pub/techne/draft/registry/blockIndex.d.ts +42 -0
- package/dist/generated/types/pub/techne/draft/registry/blockIndex.js +34 -0
- package/dist/generated/types/pub/techne/draft/registry/defs.d.ts +112 -0
- package/dist/generated/types/pub/techne/draft/registry/defs.js +32 -0
- package/dist/generated/types/pub/techne/draft/registry/getType.d.ts +23 -0
- package/dist/generated/types/pub/techne/draft/registry/getType.js +20 -0
- package/dist/generated/types/pub/techne/draft/registry/getTypeRequest.d.ts +23 -0
- package/dist/generated/types/pub/techne/draft/registry/getTypeRequest.js +20 -0
- package/dist/generated/types/pub/techne/draft/registry/listTypeRequests.d.ts +27 -0
- package/dist/generated/types/pub/techne/draft/registry/listTypeRequests.js +7 -0
- package/dist/generated/types/pub/techne/draft/registry/listTypes.d.ts +34 -0
- package/dist/generated/types/pub/techne/draft/registry/listTypes.js +7 -0
- package/dist/generated/types/pub/techne/draft/registry/publishType.d.ts +77 -0
- package/dist/generated/types/pub/techne/draft/registry/publishType.js +83 -0
- package/dist/generated/types/pub/techne/draft/registry/purgeType.d.ts +39 -0
- package/dist/generated/types/pub/techne/draft/registry/purgeType.js +34 -0
- package/dist/generated/types/pub/techne/draft/registry/requestType.d.ts +53 -0
- package/dist/generated/types/pub/techne/draft/registry/requestType.js +76 -0
- package/dist/generated/types/pub/techne/draft/registry/typeRequest.d.ts +22 -0
- package/dist/generated/types/pub/techne/draft/registry/typeRequest.js +12 -0
- package/dist/generated/types/pub/techne/draft/sync/indexRecord.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/verdict.d.ts +2 -2
- package/dist/platform.d.ts +14 -0
- package/dist/platform.js +16 -0
- package/dist/put/index.js +17 -7
- package/dist/query/index.d.ts +1 -10
- package/dist/query/index.js +1 -1
- package/dist/types-cli/emit.d.ts +20 -0
- package/dist/types-cli/emit.js +217 -0
- package/dist/types-cli/main.d.ts +5 -0
- package/dist/types-cli/main.js +63 -0
- package/dist/types-cli/resolve.d.ts +26 -0
- package/dist/types-cli/resolve.js +99 -0
- package/dist/wasm/index.d.ts +20 -3
- package/dist/wasm/index.js +6 -1
- package/dist/wasm/techne-wasm.gen.js +1 -1
- package/dist/wasm/techne-wasm2js.gen.js +26425 -25985
- package/package.json +23 -6
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { HeadersMap, XRPCError } from '@atproto/xrpc';
|
|
5
|
+
import { type ValidationResult } from '@atproto/lexicon';
|
|
6
|
+
import type * as PubTechneDraftQueryGetRecords from './getRecords.js';
|
|
7
|
+
export type QueryParams = {};
|
|
8
|
+
export interface InputSchema {
|
|
9
|
+
/** The steps. A binding names only an earlier step. A step runs as soon as the steps it binds to have answered, at most 4 at once, so the steps do not run in this order; the 3000-record cap is counted in this order. */
|
|
10
|
+
steps: Step[];
|
|
11
|
+
}
|
|
12
|
+
export interface OutputSchema {
|
|
13
|
+
/** An object keyed by step name, each a #stepResult: one for every step whose `return` is not false. */
|
|
14
|
+
steps: {
|
|
15
|
+
[_ in string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
/** An object keyed by step name, each a #stepError: one for every step that failed or was skipped, returned or not. Absent when every step answered. */
|
|
18
|
+
errors?: {
|
|
19
|
+
[_ in string]: unknown;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface CallOptions {
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
headers?: HeadersMap;
|
|
25
|
+
qp?: QueryParams;
|
|
26
|
+
encoding?: 'application/json';
|
|
27
|
+
}
|
|
28
|
+
export interface Response {
|
|
29
|
+
success: boolean;
|
|
30
|
+
headers: HeadersMap;
|
|
31
|
+
data: OutputSchema;
|
|
32
|
+
}
|
|
33
|
+
export declare class InvalidRequestError extends XRPCError {
|
|
34
|
+
constructor(src: XRPCError);
|
|
35
|
+
}
|
|
36
|
+
export declare class RateLimitExceededError extends XRPCError {
|
|
37
|
+
constructor(src: XRPCError);
|
|
38
|
+
}
|
|
39
|
+
export declare function toKnownErr(e: any): any;
|
|
40
|
+
/** One read. A list step has `query` or `queryUri` (and may have `params`, `limit`, `cursor`, `count`, `handles`, `curation`), as listRecords takes them; a get step has `uris` (and may have `curated`, `handles`, `curation`, `defaults`, `includeBlockedByMe`), as getRecords takes them. Exactly one of the two. */
|
|
41
|
+
export interface Step {
|
|
42
|
+
$type?: 'pub.techne.draft.query.composeRecords#step';
|
|
43
|
+
/** The step's name, unique in the call: a letter, then up to 31 letters, digits or `_` (^[A-Za-z][A-Za-z0-9_]{0,31}$). The key of its result and the `<step>` of a binding to it. */
|
|
44
|
+
name: string;
|
|
45
|
+
/** List step: an inline pub.techne.draft.query object (not JSON in a string, as listRecords takes it). Give this or `queryUri`. */
|
|
46
|
+
query?: {
|
|
47
|
+
[_ in string]: unknown;
|
|
48
|
+
};
|
|
49
|
+
/** List step: a published pub.techne.draft.query record to run. Give this or `query`. */
|
|
50
|
+
queryUri?: string;
|
|
51
|
+
/** List step: the query's parameters, an object of strings or lists of strings, as listRecords' `params` (an object here, not JSON in a string). A string `$<step>.<output>` is a binding and becomes a list; a list may mix literal strings and several bindings, and is their deduplicated union. */
|
|
52
|
+
params?: {
|
|
53
|
+
[_ in string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
/** List step: how many records, as listRecords' `limit`, up to 50000: past 500 (one listRecords page) the server reads listRecords' pages one after another on the same read path and answers them as one, with the `cursor` after the last record answered. Not allowed on a `return: false` step. The steps read past one page read at most 50000 records in all per call; the step whose page crosses that fails (InvalidRequest), and so does any such step that reads a page after it. */
|
|
56
|
+
limit?: number;
|
|
57
|
+
/** List step: the cursor of a previous page of this step, as listRecords' `cursor`. Not allowed on a `return: false` step. */
|
|
58
|
+
cursor?: string;
|
|
59
|
+
/** List step: also count, as listRecords' `count`. */
|
|
60
|
+
count: boolean;
|
|
61
|
+
/** Get step: the URIs to read, as getRecords' `uris`; each entry an AT-URI or a binding, which is replaced by its list. At most 500 after binding. */
|
|
62
|
+
uris?: string[];
|
|
63
|
+
/** Get step: as getRecords' `curated`. */
|
|
64
|
+
curated?: boolean;
|
|
65
|
+
/** As getRecords' `handles`: in a get step for its URIs, in a list step for the URIs of the records it answered. */
|
|
66
|
+
handles?: boolean;
|
|
67
|
+
/** As getRecords' `curation`: in a get step for its URIs, in a list step for the URIs of the records it answered. */
|
|
68
|
+
curation?: boolean;
|
|
69
|
+
/** Get step: as getRecords' `defaults`. */
|
|
70
|
+
defaults?: boolean;
|
|
71
|
+
/** Get step: as getRecords' `includeBlockedByMe`. */
|
|
72
|
+
includeBlockedByMe?: boolean;
|
|
73
|
+
/** False: the step's records only feed later bindings and are not in the output. A list step asked `return: false` is read in full on the server (every record its query matches for the caller, page after page on listRecords' read path), so a later step binds to all of it; it takes no `limit` or `cursor`, and a query that matches more than 50000 records fails the step (InvalidRequest naming the step and the ceiling), never answered in part. */
|
|
74
|
+
return: boolean;
|
|
75
|
+
/** 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
|
+
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 & {}))[];
|
|
79
|
+
/** 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
|
+
uri: boolean;
|
|
81
|
+
}
|
|
82
|
+
export declare function isStep<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.composeRecords", "step">;
|
|
83
|
+
export declare function validateStep<V>(v: V): ValidationResult<Step & V>;
|
|
84
|
+
/** What the step's method answered: a list step's fields are listRecords' output, a get step's are getRecords' output. */
|
|
85
|
+
export interface StepResult {
|
|
86
|
+
$type?: 'pub.techne.draft.query.composeRecords#stepResult';
|
|
87
|
+
/** As the step's method answers them, as #record: `value` always, `uri` unless the step's `uri` is false, every other record field unless the step's `envelope` left it out, and `value` cut to `fields` when given. */
|
|
88
|
+
records: Record[];
|
|
89
|
+
/** List step: as listRecords' `cursor`. */
|
|
90
|
+
cursor?: string;
|
|
91
|
+
/** List step, asked with `count`: as listRecords' `count`. */
|
|
92
|
+
count?: number;
|
|
93
|
+
/** List step, asked with `count`: as listRecords' `capped`. */
|
|
94
|
+
capped?: boolean;
|
|
95
|
+
/** Get step: as getRecords' `withheld`. */
|
|
96
|
+
withheld?: string[];
|
|
97
|
+
/** Asked with `handles`: as getRecords' `handles`. */
|
|
98
|
+
handles?: PubTechneDraftQueryGetRecords.Handle[];
|
|
99
|
+
/** Get step, asked with `curated`: as getRecords' `resolved`. */
|
|
100
|
+
resolved?: PubTechneDraftQueryGetRecords.Resolved[];
|
|
101
|
+
/** Asked with `curation`: as getRecords' `curation`. */
|
|
102
|
+
curation?: PubTechneDraftQueryGetRecords.Curation[];
|
|
103
|
+
/** Get step, asked with `defaults`: as getRecords' `defaults`. */
|
|
104
|
+
defaults?: PubTechneDraftQueryGetRecords.Default[];
|
|
105
|
+
}
|
|
106
|
+
export declare function isStepResult<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.composeRecords", "stepResult">;
|
|
107
|
+
export declare function validateStepResult<V>(v: V): ValidationResult<StepResult & V>;
|
|
108
|
+
/** One answered record of a step: pub.techne.draft.query.listRecords#record with only `value` required. `uri` is present unless the step's `uri` is false; every other field is present as listRecords#record has it unless the step's `envelope` left it out; `fields` cuts `value`. */
|
|
109
|
+
export interface Record {
|
|
110
|
+
$type?: 'pub.techne.draft.query.composeRecords#record';
|
|
111
|
+
uri?: string;
|
|
112
|
+
cid?: string;
|
|
113
|
+
/** The DID whose repo holds the record. */
|
|
114
|
+
author?: string;
|
|
115
|
+
collection?: string;
|
|
116
|
+
/** The record body. */
|
|
117
|
+
value: {
|
|
118
|
+
[_ in string]: unknown;
|
|
119
|
+
};
|
|
120
|
+
/** The record's indexed time (the `written` role). */
|
|
121
|
+
time?: string;
|
|
122
|
+
/** The space a permissioned record counts in. Absent for a public record, and for a caller's own record that counts in none. */
|
|
123
|
+
space?: string;
|
|
124
|
+
/** Whether the record is public (on the firehose) or permissioned. */
|
|
125
|
+
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. Absent otherwise. */
|
|
127
|
+
curated?: boolean;
|
|
128
|
+
/** The caller's own permissioned record that the reach limit holds back from the people it would reach: a held share, 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
|
+
held?: boolean;
|
|
130
|
+
/** The numbers the query's operators produced for this record, by name (a `near` distance in metres, a `matches` rank). */
|
|
131
|
+
measures?: {
|
|
132
|
+
[_ in string]: unknown;
|
|
133
|
+
};
|
|
134
|
+
/** The server-side signals the query asked for, by name; a signal with no value for this record is absent. */
|
|
135
|
+
signals?: {
|
|
136
|
+
[_ in string]: unknown;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export declare function isRecord<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.composeRecords", "record">;
|
|
140
|
+
export declare function validateRecord<V>(v: V): ValidationResult<Record & V>;
|
|
141
|
+
/** 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
|
+
export interface StepError {
|
|
143
|
+
$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. */
|
|
145
|
+
error: string;
|
|
146
|
+
/** 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
|
+
message: string;
|
|
148
|
+
/** The HTTP status the step's method would answer alone; 400 for a step past a call limit (a get step's bound `uris` past 500, a bound list past 2000 values, the one-page steps' records past 3000, a `return: false` step matching past 50000, the call's paged reads past 50000); 424 for `Skipped`. */
|
|
149
|
+
status: number;
|
|
150
|
+
}
|
|
151
|
+
export declare function isStepError<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.composeRecords", "stepError">;
|
|
152
|
+
export declare function validateStepError<V>(v: V): ValidationResult<StepError & V>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { XRPCError } from '@atproto/xrpc';
|
|
5
|
+
import { validate as _validate } from '../../../../../lexicons.js';
|
|
6
|
+
import { is$typed as _is$typed, } from '../../../../../util.js';
|
|
7
|
+
const is$typed = _is$typed, validate = _validate;
|
|
8
|
+
const id = 'pub.techne.draft.query.composeRecords';
|
|
9
|
+
export class InvalidRequestError extends XRPCError {
|
|
10
|
+
constructor(src) {
|
|
11
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class RateLimitExceededError extends XRPCError {
|
|
15
|
+
constructor(src) {
|
|
16
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function toKnownErr(e) {
|
|
20
|
+
if (e instanceof XRPCError) {
|
|
21
|
+
if (e.error === 'InvalidRequest')
|
|
22
|
+
return new InvalidRequestError(e);
|
|
23
|
+
if (e.error === 'RateLimitExceeded')
|
|
24
|
+
return new RateLimitExceededError(e);
|
|
25
|
+
}
|
|
26
|
+
return e;
|
|
27
|
+
}
|
|
28
|
+
const hashStep = 'step';
|
|
29
|
+
export function isStep(v) {
|
|
30
|
+
return is$typed(v, id, hashStep);
|
|
31
|
+
}
|
|
32
|
+
export function validateStep(v) {
|
|
33
|
+
return validate(v, id, hashStep);
|
|
34
|
+
}
|
|
35
|
+
const hashStepResult = 'stepResult';
|
|
36
|
+
export function isStepResult(v) {
|
|
37
|
+
return is$typed(v, id, hashStepResult);
|
|
38
|
+
}
|
|
39
|
+
export function validateStepResult(v) {
|
|
40
|
+
return validate(v, id, hashStepResult);
|
|
41
|
+
}
|
|
42
|
+
const hashRecord = 'record';
|
|
43
|
+
export function isRecord(v) {
|
|
44
|
+
return is$typed(v, id, hashRecord);
|
|
45
|
+
}
|
|
46
|
+
export function validateRecord(v) {
|
|
47
|
+
return validate(v, id, hashRecord);
|
|
48
|
+
}
|
|
49
|
+
const hashStepError = 'stepError';
|
|
50
|
+
export function isStepError(v) {
|
|
51
|
+
return is$typed(v, id, hashStepError);
|
|
52
|
+
}
|
|
53
|
+
export function validateStepError(v) {
|
|
54
|
+
return validate(v, id, hashStepError);
|
|
55
|
+
}
|
|
@@ -68,7 +68,7 @@ export interface Curation {
|
|
|
68
68
|
status: 'pending' | 'curated' | 'notCurated' | (string & {});
|
|
69
69
|
/** With `curated`: the curated record listed for it (itself when it is that record). */
|
|
70
70
|
curated?: string;
|
|
71
|
-
/** With `notCurated`: why, in words for people (a moderation
|
|
71
|
+
/** With `notCurated`: why, in words for people (a moderation verdict value such as `spam`, `obscene` or `!takedown`, the index's refusal, or `not curated: no lexicon` / `not curated: no curator`). */
|
|
72
72
|
reason?: string;
|
|
73
73
|
}
|
|
74
74
|
export declare function isCuration<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.getRecords", "curation">;
|
|
@@ -74,10 +74,6 @@ export interface Record {
|
|
|
74
74
|
signals?: {
|
|
75
75
|
[_ in string]: unknown;
|
|
76
76
|
};
|
|
77
|
-
/** The records the query's `include` attached, by key (`author`, `subject`), each a #record; absent when there is none the caller may read. */
|
|
78
|
-
included?: {
|
|
79
|
-
[_ in string]: unknown;
|
|
80
|
-
};
|
|
81
77
|
}
|
|
82
78
|
export declare function isRecord<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.listRecords", "record">;
|
|
83
79
|
export declare function validateRecord<V>(v: V): ValidationResult<Record & V>;
|
|
@@ -39,8 +39,8 @@ export interface Rejection {
|
|
|
39
39
|
cid: string;
|
|
40
40
|
author: string;
|
|
41
41
|
collection: string;
|
|
42
|
-
/** `invalid`: the body does not satisfy its lexicon. `placement`: the record has no public home (its collection is private-only, or a credential that is not its issuer's own unsigned one). */
|
|
43
|
-
reason: 'invalid' | 'placement' | (string & {});
|
|
42
|
+
/** `invalid`: the body does not satisfy its lexicon. `placement`: the record has no public home (its collection is private-only, or a credential that is not its issuer's own unsigned one). `budget`: a record of a runtime (community or requested) type skipped because its author, or the type, had used the day's indexing budget; a later version may be indexed on another day. */
|
|
43
|
+
reason: 'invalid' | 'placement' | 'budget' | (string & {});
|
|
44
44
|
/** The refusal's own words, for people; not a stable value. */
|
|
45
45
|
message: string;
|
|
46
46
|
/** When this AppView first saw this version refused. */
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { HeadersMap, XRPCError } from '@atproto/xrpc';
|
|
5
|
+
export type QueryParams = {};
|
|
6
|
+
export interface InputSchema {
|
|
7
|
+
/** The runtime type (a community draft or a requested type). */
|
|
8
|
+
nsid: string;
|
|
9
|
+
/** The author whose records of the type are blocked. */
|
|
10
|
+
author: string;
|
|
11
|
+
/** Why, kept with the block. */
|
|
12
|
+
reason: string;
|
|
13
|
+
}
|
|
14
|
+
export interface OutputSchema {
|
|
15
|
+
nsid: string;
|
|
16
|
+
author: string;
|
|
17
|
+
/** How many of the author's indexed records of the type were removed. */
|
|
18
|
+
purged: number;
|
|
19
|
+
/** The type's page on techne.pub. */
|
|
20
|
+
page: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CallOptions {
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
headers?: HeadersMap;
|
|
25
|
+
qp?: QueryParams;
|
|
26
|
+
encoding?: 'application/json';
|
|
27
|
+
}
|
|
28
|
+
export interface Response {
|
|
29
|
+
success: boolean;
|
|
30
|
+
headers: HeadersMap;
|
|
31
|
+
data: OutputSchema;
|
|
32
|
+
}
|
|
33
|
+
export declare class AuthenticationRequiredError extends XRPCError {
|
|
34
|
+
constructor(src: XRPCError);
|
|
35
|
+
}
|
|
36
|
+
export declare class ForbiddenError extends XRPCError {
|
|
37
|
+
constructor(src: XRPCError);
|
|
38
|
+
}
|
|
39
|
+
export declare class UnknownTypeError extends XRPCError {
|
|
40
|
+
constructor(src: XRPCError);
|
|
41
|
+
}
|
|
42
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { XRPCError } from '@atproto/xrpc';
|
|
5
|
+
import { validate as _validate } from '../../../../../lexicons.js';
|
|
6
|
+
import { is$typed as _is$typed, } from '../../../../../util.js';
|
|
7
|
+
const is$typed = _is$typed, validate = _validate;
|
|
8
|
+
const id = 'pub.techne.draft.registry.blockIndex';
|
|
9
|
+
export class AuthenticationRequiredError extends XRPCError {
|
|
10
|
+
constructor(src) {
|
|
11
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class ForbiddenError extends XRPCError {
|
|
15
|
+
constructor(src) {
|
|
16
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class UnknownTypeError extends XRPCError {
|
|
20
|
+
constructor(src) {
|
|
21
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function toKnownErr(e) {
|
|
25
|
+
if (e instanceof XRPCError) {
|
|
26
|
+
if (e.error === 'AuthenticationRequired')
|
|
27
|
+
return new AuthenticationRequiredError(e);
|
|
28
|
+
if (e.error === 'Forbidden')
|
|
29
|
+
return new ForbiddenError(e);
|
|
30
|
+
if (e.error === 'UnknownType')
|
|
31
|
+
return new UnknownTypeError(e);
|
|
32
|
+
}
|
|
33
|
+
return e;
|
|
34
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
/** One type in a list. */
|
|
7
|
+
export interface TypeSummary {
|
|
8
|
+
$type?: 'pub.techne.draft.registry.defs#typeSummary';
|
|
9
|
+
nsid: string;
|
|
10
|
+
/** The NSID's last segment, which is how the type reads. */
|
|
11
|
+
name: string;
|
|
12
|
+
/** The lexicon's own description of its main def (else of the document), as written: its length is the lexicon's. */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** `platform`: a type the platform ships. `community`: a draft someone published, `pub.techne.draft.c.<id>.<name>`. `requested`: a type defined elsewhere on the network that someone asked the platform to index. */
|
|
15
|
+
origin: 'platform' | 'community' | 'requested' | (string & {});
|
|
16
|
+
/** `indexed`: a platform or community type, or an approved request. An approved request's existing records are read from the network (a walk of its history) from the approval on; its new writes on the network reach the platform once a release adds the type to what the platform subscribes to, and until then only those written through the platform arrive. `pending`: a request not yet decided; only records written through the platform are indexed. `declined`: an operator declined the request; it stays as pending does. `blocked`: an operator stopped indexing it. */
|
|
17
|
+
state: 'indexed' | 'pending' | 'declined' | 'blocked' | (string & {});
|
|
18
|
+
/** Who published a community type, or who requested a foreign one. Only the creator may change a community type. */
|
|
19
|
+
creator?: string;
|
|
20
|
+
/** The type this one extends: its records carry a `subject` naming a record of that type. */
|
|
21
|
+
sidecarOf?: string;
|
|
22
|
+
/** The community type this one was forked from. */
|
|
23
|
+
forkOf?: string;
|
|
24
|
+
/** Public records of this type the platform holds now. */
|
|
25
|
+
recordCount: number;
|
|
26
|
+
/** The type's page on techne.pub. Share it with the person you are working with. */
|
|
27
|
+
page: string;
|
|
28
|
+
updatedAt?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function isTypeSummary<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.registry.defs", "typeSummary">;
|
|
31
|
+
export declare function validateTypeSummary<V>(v: V): ValidationResult<TypeSummary & V>;
|
|
32
|
+
/** One type in full. */
|
|
33
|
+
export interface TypeView {
|
|
34
|
+
$type?: 'pub.techne.draft.registry.defs#typeView';
|
|
35
|
+
nsid: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
origin: 'platform' | 'community' | 'requested' | (string & {});
|
|
39
|
+
state: 'indexed' | 'pending' | 'declined' | 'blocked' | (string & {});
|
|
40
|
+
creator?: string;
|
|
41
|
+
sidecarOf?: string;
|
|
42
|
+
forkOf?: string;
|
|
43
|
+
recordCount: number;
|
|
44
|
+
page: string;
|
|
45
|
+
/** The type's current lexicon document. */
|
|
46
|
+
lexicon: {
|
|
47
|
+
[_ in string]: unknown;
|
|
48
|
+
};
|
|
49
|
+
/** The type's `{nsid}.query` document: which fields fill the shared query roles (the time, the place, the text, the references). Absent when the type has none; its records can then only be got and listed. */
|
|
50
|
+
query?: {
|
|
51
|
+
[_ in string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
/** A community or requested type's version. A community type's is 1 at its first publish and one more at each additive change; a requested type's is 1. Absent for a platform type. */
|
|
54
|
+
version?: number;
|
|
55
|
+
schema?: ComAtprotoRepoStrongRef.Main;
|
|
56
|
+
/** Types that extend this one, most used first. */
|
|
57
|
+
sidecars?: string[];
|
|
58
|
+
request?: RequestView;
|
|
59
|
+
createdAt?: string;
|
|
60
|
+
updatedAt?: string;
|
|
61
|
+
}
|
|
62
|
+
export declare function isTypeView<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.registry.defs", "typeView">;
|
|
63
|
+
export declare function validateTypeView<V>(v: V): ValidationResult<TypeView & V>;
|
|
64
|
+
/** A request to index a type defined elsewhere on the network. */
|
|
65
|
+
export interface RequestView {
|
|
66
|
+
$type?: 'pub.techne.draft.registry.defs#requestView';
|
|
67
|
+
nsid: string;
|
|
68
|
+
requester: string;
|
|
69
|
+
/** `pending` until an operator decides. `approved`: an operator's live commons credential pinned this request's CID when the platform read it; the approval stands after that, even if the credential is later withdrawn (only a block, registry.purgeType, ends it). Approval starts a walk of the type's existing records on the network; its new writes there reach the platform once a release adds the type to what the platform subscribes to. `declined`: an operator declined it; records written through the platform are still indexed. `blocked`: an operator stopped indexing the type (registry.purgeType); nothing of it is indexed, and an approval or a decline no longer changes that. */
|
|
70
|
+
state: 'pending' | 'approved' | 'declined' | 'blocked' | (string & {});
|
|
71
|
+
/** The pub.techne.draft.registry.typeRequest record, in the registry's repo. */
|
|
72
|
+
uri: string;
|
|
73
|
+
/** Its CID, which an approval pins. */
|
|
74
|
+
cid: string;
|
|
75
|
+
/** The query roles the requester mapped, as a `{nsid}.query` document. */
|
|
76
|
+
query?: {
|
|
77
|
+
[_ in string]: unknown;
|
|
78
|
+
};
|
|
79
|
+
preview?: Preview;
|
|
80
|
+
/** The operator who approved or declined it. */
|
|
81
|
+
decidedBy?: string;
|
|
82
|
+
decidedAt?: string;
|
|
83
|
+
/** The record that decided it: the approving credential or the declining verdict. */
|
|
84
|
+
decision?: string;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
/** The type's page on techne.pub. */
|
|
87
|
+
page: string;
|
|
88
|
+
}
|
|
89
|
+
export declare function isRequestView<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.registry.defs", "requestView">;
|
|
90
|
+
export declare function validateRequestView<V>(v: V): ValidationResult<RequestView & V>;
|
|
91
|
+
/** What indexing a foreign type would take on, read when it was requested: where its schema is published and how big it is on the network. */
|
|
92
|
+
export interface Preview {
|
|
93
|
+
$type?: 'pub.techne.draft.registry.defs#preview';
|
|
94
|
+
schema: ComAtprotoRepoStrongRef.Main;
|
|
95
|
+
/** When that schema record was first written, as far as the platform can tell. */
|
|
96
|
+
schemaCreatedAt?: string;
|
|
97
|
+
/** The main record's top-level fields, each as `name: type`. */
|
|
98
|
+
fields: string[];
|
|
99
|
+
/** Accounts the relay lists as holding records of it (`com.atproto.sync.listReposByCollection`), counted up to a ceiling. */
|
|
100
|
+
repos?: number;
|
|
101
|
+
/** Whether `repos` stopped at the ceiling. */
|
|
102
|
+
reposCapped?: boolean;
|
|
103
|
+
/** Records read from a sample of those accounts. */
|
|
104
|
+
sampledRecords?: number;
|
|
105
|
+
/** How many of the sampled records satisfy the schema. */
|
|
106
|
+
sampledValid?: number;
|
|
107
|
+
/** Records of it on the network, estimated from the sample. */
|
|
108
|
+
estimatedRecords?: number;
|
|
109
|
+
readAt?: string;
|
|
110
|
+
}
|
|
111
|
+
export declare function isPreview<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.registry.defs", "preview">;
|
|
112
|
+
export declare function validatePreview<V>(v: V): ValidationResult<Preview & V>;
|
|
@@ -0,0 +1,32 @@
|
|
|
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.registry.defs';
|
|
5
|
+
const hashTypeSummary = 'typeSummary';
|
|
6
|
+
export function isTypeSummary(v) {
|
|
7
|
+
return is$typed(v, id, hashTypeSummary);
|
|
8
|
+
}
|
|
9
|
+
export function validateTypeSummary(v) {
|
|
10
|
+
return validate(v, id, hashTypeSummary);
|
|
11
|
+
}
|
|
12
|
+
const hashTypeView = 'typeView';
|
|
13
|
+
export function isTypeView(v) {
|
|
14
|
+
return is$typed(v, id, hashTypeView);
|
|
15
|
+
}
|
|
16
|
+
export function validateTypeView(v) {
|
|
17
|
+
return validate(v, id, hashTypeView);
|
|
18
|
+
}
|
|
19
|
+
const hashRequestView = 'requestView';
|
|
20
|
+
export function isRequestView(v) {
|
|
21
|
+
return is$typed(v, id, hashRequestView);
|
|
22
|
+
}
|
|
23
|
+
export function validateRequestView(v) {
|
|
24
|
+
return validate(v, id, hashRequestView);
|
|
25
|
+
}
|
|
26
|
+
const hashPreview = 'preview';
|
|
27
|
+
export function isPreview(v) {
|
|
28
|
+
return is$typed(v, id, hashPreview);
|
|
29
|
+
}
|
|
30
|
+
export function validatePreview(v) {
|
|
31
|
+
return validate(v, id, hashPreview);
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { HeadersMap, XRPCError } from '@atproto/xrpc';
|
|
5
|
+
import type * as PubTechneDraftRegistryDefs from './defs.js';
|
|
6
|
+
export type QueryParams = {
|
|
7
|
+
nsid: string;
|
|
8
|
+
};
|
|
9
|
+
export type InputSchema = undefined;
|
|
10
|
+
export type OutputSchema = PubTechneDraftRegistryDefs.TypeView;
|
|
11
|
+
export interface CallOptions {
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
headers?: HeadersMap;
|
|
14
|
+
}
|
|
15
|
+
export interface Response {
|
|
16
|
+
success: boolean;
|
|
17
|
+
headers: HeadersMap;
|
|
18
|
+
data: OutputSchema;
|
|
19
|
+
}
|
|
20
|
+
export declare class UnknownTypeError extends XRPCError {
|
|
21
|
+
constructor(src: XRPCError);
|
|
22
|
+
}
|
|
23
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { XRPCError } from '@atproto/xrpc';
|
|
5
|
+
import { validate as _validate } from '../../../../../lexicons.js';
|
|
6
|
+
import { is$typed as _is$typed, } from '../../../../../util.js';
|
|
7
|
+
const is$typed = _is$typed, validate = _validate;
|
|
8
|
+
const id = 'pub.techne.draft.registry.getType';
|
|
9
|
+
export class UnknownTypeError extends XRPCError {
|
|
10
|
+
constructor(src) {
|
|
11
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function toKnownErr(e) {
|
|
15
|
+
if (e instanceof XRPCError) {
|
|
16
|
+
if (e.error === 'UnknownType')
|
|
17
|
+
return new UnknownTypeError(e);
|
|
18
|
+
}
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { HeadersMap, XRPCError } from '@atproto/xrpc';
|
|
5
|
+
import type * as PubTechneDraftRegistryDefs from './defs.js';
|
|
6
|
+
export type QueryParams = {
|
|
7
|
+
nsid: string;
|
|
8
|
+
};
|
|
9
|
+
export type InputSchema = undefined;
|
|
10
|
+
export type OutputSchema = PubTechneDraftRegistryDefs.RequestView;
|
|
11
|
+
export interface CallOptions {
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
headers?: HeadersMap;
|
|
14
|
+
}
|
|
15
|
+
export interface Response {
|
|
16
|
+
success: boolean;
|
|
17
|
+
headers: HeadersMap;
|
|
18
|
+
data: OutputSchema;
|
|
19
|
+
}
|
|
20
|
+
export declare class NotFoundError extends XRPCError {
|
|
21
|
+
constructor(src: XRPCError);
|
|
22
|
+
}
|
|
23
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { XRPCError } from '@atproto/xrpc';
|
|
5
|
+
import { validate as _validate } from '../../../../../lexicons.js';
|
|
6
|
+
import { is$typed as _is$typed, } from '../../../../../util.js';
|
|
7
|
+
const is$typed = _is$typed, validate = _validate;
|
|
8
|
+
const id = 'pub.techne.draft.registry.getTypeRequest';
|
|
9
|
+
export class NotFoundError extends XRPCError {
|
|
10
|
+
constructor(src) {
|
|
11
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function toKnownErr(e) {
|
|
15
|
+
if (e instanceof XRPCError) {
|
|
16
|
+
if (e.error === 'NotFound')
|
|
17
|
+
return new NotFoundError(e);
|
|
18
|
+
}
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { HeadersMap } from '@atproto/xrpc';
|
|
5
|
+
import type * as PubTechneDraftRegistryDefs from './defs.js';
|
|
6
|
+
export type QueryParams = {
|
|
7
|
+
/** Only requests in this state. */
|
|
8
|
+
state?: 'pending' | 'approved' | 'declined' | 'blocked' | (string & {});
|
|
9
|
+
requester?: string;
|
|
10
|
+
limit?: number;
|
|
11
|
+
cursor?: string;
|
|
12
|
+
};
|
|
13
|
+
export type InputSchema = undefined;
|
|
14
|
+
export interface OutputSchema {
|
|
15
|
+
requests: PubTechneDraftRegistryDefs.RequestView[];
|
|
16
|
+
cursor?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CallOptions {
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
headers?: HeadersMap;
|
|
21
|
+
}
|
|
22
|
+
export interface Response {
|
|
23
|
+
success: boolean;
|
|
24
|
+
headers: HeadersMap;
|
|
25
|
+
data: OutputSchema;
|
|
26
|
+
}
|
|
27
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,7 @@
|
|
|
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.registry.listTypeRequests';
|
|
5
|
+
export function toKnownErr(e) {
|
|
6
|
+
return e;
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { HeadersMap } from '@atproto/xrpc';
|
|
5
|
+
import type * as PubTechneDraftRegistryDefs from './defs.js';
|
|
6
|
+
export type QueryParams = {
|
|
7
|
+
/** Words matched against each type's name, field names and descriptions. */
|
|
8
|
+
q?: string;
|
|
9
|
+
/** Only types this account published or requested. */
|
|
10
|
+
creator?: string;
|
|
11
|
+
origin?: 'platform' | 'community' | 'requested' | (string & {});
|
|
12
|
+
/** Only types that extend this one. */
|
|
13
|
+
sidecarOf?: string;
|
|
14
|
+
includeEmpty?: boolean;
|
|
15
|
+
/** The order of the list, or, when `q` is given, the order within equally good matches (a search ranks by how well each type matches first). `records`: most used first (the default). `name`: A to Z. `updated`: most recently changed first. */
|
|
16
|
+
sort?: 'records' | 'name' | 'updated' | (string & {});
|
|
17
|
+
limit?: number;
|
|
18
|
+
cursor?: string;
|
|
19
|
+
};
|
|
20
|
+
export type InputSchema = undefined;
|
|
21
|
+
export interface OutputSchema {
|
|
22
|
+
types: PubTechneDraftRegistryDefs.TypeSummary[];
|
|
23
|
+
cursor?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CallOptions {
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
headers?: HeadersMap;
|
|
28
|
+
}
|
|
29
|
+
export interface Response {
|
|
30
|
+
success: boolean;
|
|
31
|
+
headers: HeadersMap;
|
|
32
|
+
data: OutputSchema;
|
|
33
|
+
}
|
|
34
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,7 @@
|
|
|
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.registry.listTypes';
|
|
5
|
+
export function toKnownErr(e) {
|
|
6
|
+
return e;
|
|
7
|
+
}
|