@atproto/api 0.15.26 → 0.15.27
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 +8 -0
- package/dist/client/index.d.ts +6 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +24 -10
- package/dist/client/index.js.map +1 -1
- package/dist/client/lexicons.d.ts +268 -82
- package/dist/client/lexicons.d.ts.map +1 -1
- package/dist/client/lexicons.js +145 -42
- package/dist/client/lexicons.js.map +1 -1
- package/dist/client/types/app/bsky/unspecced/checkHandleAvailability.d.ts +58 -0
- package/dist/client/types/app/bsky/unspecced/checkHandleAvailability.d.ts.map +1 -0
- package/dist/client/types/app/bsky/unspecced/checkHandleAvailability.js +53 -0
- package/dist/client/types/app/bsky/unspecced/checkHandleAvailability.js.map +1 -0
- package/dist/client/types/app/bsky/unspecced/initAgeAssurance.d.ts +10 -1
- package/dist/client/types/app/bsky/unspecced/initAgeAssurance.d.ts.map +1 -1
- package/dist/client/types/app/bsky/unspecced/initAgeAssurance.js +31 -0
- package/dist/client/types/app/bsky/unspecced/initAgeAssurance.js.map +1 -1
- package/package.json +2 -2
- package/src/client/index.ts +32 -15
- package/src/client/lexicons.ts +154 -43
- package/src/client/types/app/bsky/unspecced/checkHandleAvailability.ts +109 -0
- package/src/client/types/app/bsky/unspecced/initAgeAssurance.ts +24 -0
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
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 $Typed } from '../../../../util';
|
|
7
|
+
export type QueryParams = {
|
|
8
|
+
/** Tentative handle. Will be checked for availability or used to build handle suggestions. */
|
|
9
|
+
handle: string;
|
|
10
|
+
/** User-provided email. Might be used to build handle suggestions. */
|
|
11
|
+
email?: string;
|
|
12
|
+
/** User-provided birth date. Might be used to build handle suggestions. */
|
|
13
|
+
birthDate?: string;
|
|
14
|
+
};
|
|
15
|
+
export type InputSchema = undefined;
|
|
16
|
+
export interface OutputSchema {
|
|
17
|
+
/** Echo of the input handle. */
|
|
18
|
+
handle: string;
|
|
19
|
+
result: $Typed<ResultAvailable> | $Typed<ResultUnavailable> | {
|
|
20
|
+
$type: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface CallOptions {
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
headers?: HeadersMap;
|
|
26
|
+
}
|
|
27
|
+
export interface Response {
|
|
28
|
+
success: boolean;
|
|
29
|
+
headers: HeadersMap;
|
|
30
|
+
data: OutputSchema;
|
|
31
|
+
}
|
|
32
|
+
export declare class InvalidEmailError extends XRPCError {
|
|
33
|
+
constructor(src: XRPCError);
|
|
34
|
+
}
|
|
35
|
+
export declare function toKnownErr(e: any): any;
|
|
36
|
+
/** Indicates the provided handle is available. */
|
|
37
|
+
export interface ResultAvailable {
|
|
38
|
+
$type?: 'app.bsky.unspecced.checkHandleAvailability#resultAvailable';
|
|
39
|
+
}
|
|
40
|
+
export declare function isResultAvailable<V>(v: V): v is import("../../../../util").$TypedObject<V, "app.bsky.unspecced.checkHandleAvailability", "resultAvailable">;
|
|
41
|
+
export declare function validateResultAvailable<V>(v: V): ValidationResult<ResultAvailable & V>;
|
|
42
|
+
/** Indicates the provided handle is unavailable and gives suggestions of available handles. */
|
|
43
|
+
export interface ResultUnavailable {
|
|
44
|
+
$type?: 'app.bsky.unspecced.checkHandleAvailability#resultUnavailable';
|
|
45
|
+
/** List of suggested handles based on the provided inputs. */
|
|
46
|
+
suggestions: Suggestion[];
|
|
47
|
+
}
|
|
48
|
+
export declare function isResultUnavailable<V>(v: V): v is import("../../../../util").$TypedObject<V, "app.bsky.unspecced.checkHandleAvailability", "resultUnavailable">;
|
|
49
|
+
export declare function validateResultUnavailable<V>(v: V): ValidationResult<ResultUnavailable & V>;
|
|
50
|
+
export interface Suggestion {
|
|
51
|
+
$type?: 'app.bsky.unspecced.checkHandleAvailability#suggestion';
|
|
52
|
+
handle: string;
|
|
53
|
+
/** Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics. */
|
|
54
|
+
method: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function isSuggestion<V>(v: V): v is import("../../../../util").$TypedObject<V, "app.bsky.unspecced.checkHandleAvailability", "suggestion">;
|
|
57
|
+
export declare function validateSuggestion<V>(v: V): ValidationResult<Suggestion & V>;
|
|
58
|
+
//# sourceMappingURL=checkHandleAvailability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkHandleAvailability.d.ts","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/unspecced/checkHandleAvailability.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAGjE,OAAO,EACL,KAAK,MAAM,EAGZ,MAAM,kBAAkB,CAAA;AAMzB,MAAM,MAAM,WAAW,GAAG;IACxB,8FAA8F;IAC9F,MAAM,EAAE,MAAM,CAAA;IACd,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AACD,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EACF,MAAM,CAAC,eAAe,CAAC,GACvB,MAAM,CAAC,iBAAiB,CAAC,GACzB;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,UAAU,CAAA;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,UAAU,CAAA;IACnB,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,GAAG,EAAE,SAAS;CAG3B;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,OAMhC;AAED,kDAAkD;AAClD,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,4DAA4D,CAAA;CACrE;AAID,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,oHAExC;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,yCAE9C;AAED,+FAA+F;AAC/F,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,8DAA8D,CAAA;IACtE,8DAA8D;IAC9D,WAAW,EAAE,UAAU,EAAE,CAAA;CAC1B;AAID,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,sHAE1C;AAED,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,2CAEhD;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,uDAAuD,CAAA;IAC/D,MAAM,EAAE,MAAM,CAAA;IACd,6GAA6G;IAC7G,MAAM,EAAE,MAAM,CAAA;CACf;AAID,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,+GAEnC;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,oCAEzC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidEmailError = void 0;
|
|
4
|
+
exports.toKnownErr = toKnownErr;
|
|
5
|
+
exports.isResultAvailable = isResultAvailable;
|
|
6
|
+
exports.validateResultAvailable = validateResultAvailable;
|
|
7
|
+
exports.isResultUnavailable = isResultUnavailable;
|
|
8
|
+
exports.validateResultUnavailable = validateResultUnavailable;
|
|
9
|
+
exports.isSuggestion = isSuggestion;
|
|
10
|
+
exports.validateSuggestion = validateSuggestion;
|
|
11
|
+
/**
|
|
12
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
13
|
+
*/
|
|
14
|
+
const xrpc_1 = require("@atproto/xrpc");
|
|
15
|
+
const lexicons_1 = require("../../../../lexicons");
|
|
16
|
+
const util_1 = require("../../../../util");
|
|
17
|
+
const is$typed = util_1.is$typed, validate = lexicons_1.validate;
|
|
18
|
+
const id = 'app.bsky.unspecced.checkHandleAvailability';
|
|
19
|
+
class InvalidEmailError extends xrpc_1.XRPCError {
|
|
20
|
+
constructor(src) {
|
|
21
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.InvalidEmailError = InvalidEmailError;
|
|
25
|
+
function toKnownErr(e) {
|
|
26
|
+
if (e instanceof xrpc_1.XRPCError) {
|
|
27
|
+
if (e.error === 'InvalidEmail')
|
|
28
|
+
return new InvalidEmailError(e);
|
|
29
|
+
}
|
|
30
|
+
return e;
|
|
31
|
+
}
|
|
32
|
+
const hashResultAvailable = 'resultAvailable';
|
|
33
|
+
function isResultAvailable(v) {
|
|
34
|
+
return is$typed(v, id, hashResultAvailable);
|
|
35
|
+
}
|
|
36
|
+
function validateResultAvailable(v) {
|
|
37
|
+
return validate(v, id, hashResultAvailable);
|
|
38
|
+
}
|
|
39
|
+
const hashResultUnavailable = 'resultUnavailable';
|
|
40
|
+
function isResultUnavailable(v) {
|
|
41
|
+
return is$typed(v, id, hashResultUnavailable);
|
|
42
|
+
}
|
|
43
|
+
function validateResultUnavailable(v) {
|
|
44
|
+
return validate(v, id, hashResultUnavailable);
|
|
45
|
+
}
|
|
46
|
+
const hashSuggestion = 'suggestion';
|
|
47
|
+
function isSuggestion(v) {
|
|
48
|
+
return is$typed(v, id, hashSuggestion);
|
|
49
|
+
}
|
|
50
|
+
function validateSuggestion(v) {
|
|
51
|
+
return validate(v, id, hashSuggestion);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=checkHandleAvailability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkHandleAvailability.js","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/unspecced/checkHandleAvailability.ts"],"names":[],"mappings":";;;AAqDA,gCAMC;AASD,8CAEC;AAED,0DAEC;AAWD,kDAEC;AAED,8DAEC;AAWD,oCAEC;AAED,gDAEC;AA5GD;;GAEG;AACH,wCAAqD;AAGrD,mDAA4D;AAC5D,2CAIyB;AAEzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,4CAA4C,CAAA;AAgCvD,MAAa,iBAAkB,SAAQ,gBAAS;IAC9C,YAAY,GAAc;QACxB,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;IACxE,CAAC;CACF;AAJD,8CAIC;AAED,SAAgB,UAAU,CAAC,CAAM;IAC/B,IAAI,CAAC,YAAY,gBAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,KAAK,KAAK,cAAc;YAAE,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAA;IACjE,CAAC;IAED,OAAO,CAAC,CAAA;AACV,CAAC;AAOD,MAAM,mBAAmB,GAAG,iBAAiB,CAAA;AAE7C,SAAgB,iBAAiB,CAAI,CAAI;IACvC,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAA;AAC7C,CAAC;AAED,SAAgB,uBAAuB,CAAI,CAAI;IAC7C,OAAO,QAAQ,CAAsB,CAAC,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAA;AAClE,CAAC;AASD,MAAM,qBAAqB,GAAG,mBAAmB,CAAA;AAEjD,SAAgB,mBAAmB,CAAI,CAAI;IACzC,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAA;AAC/C,CAAC;AAED,SAAgB,yBAAyB,CAAI,CAAI;IAC/C,OAAO,QAAQ,CAAwB,CAAC,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAA;AACtE,CAAC;AASD,MAAM,cAAc,GAAG,YAAY,CAAA;AAEnC,SAAgB,YAAY,CAAI,CAAI;IAClC,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,cAAc,CAAC,CAAA;AACxC,CAAC;AAED,SAAgB,kBAAkB,CAAI,CAAI;IACxC,OAAO,QAAQ,CAAiB,CAAC,EAAE,EAAE,EAAE,cAAc,CAAC,CAAA;AACxD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
|
-
import { HeadersMap } from '@atproto/xrpc';
|
|
4
|
+
import { HeadersMap, XRPCError } from '@atproto/xrpc';
|
|
5
5
|
import type * as AppBskyUnspeccedDefs from './defs.js';
|
|
6
6
|
export type QueryParams = {};
|
|
7
7
|
export interface InputSchema {
|
|
@@ -24,5 +24,14 @@ export interface Response {
|
|
|
24
24
|
headers: HeadersMap;
|
|
25
25
|
data: OutputSchema;
|
|
26
26
|
}
|
|
27
|
+
export declare class InvalidEmailError extends XRPCError {
|
|
28
|
+
constructor(src: XRPCError);
|
|
29
|
+
}
|
|
30
|
+
export declare class DidTooLongError extends XRPCError {
|
|
31
|
+
constructor(src: XRPCError);
|
|
32
|
+
}
|
|
33
|
+
export declare class InvalidInitiationError extends XRPCError {
|
|
34
|
+
constructor(src: XRPCError);
|
|
35
|
+
}
|
|
27
36
|
export declare function toKnownErr(e: any): any;
|
|
28
37
|
//# sourceMappingURL=initAgeAssurance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initAgeAssurance.d.ts","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/unspecced/initAgeAssurance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"initAgeAssurance.d.ts","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/unspecced/initAgeAssurance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AASrD,OAAO,KAAK,KAAK,oBAAoB,MAAM,WAAW,CAAA;AAMtD,MAAM,MAAM,WAAW,GAAG,EAAE,CAAA;AAE5B,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAA;IAChB,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,CAAA;AAEjE,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,EAAE,CAAC,EAAE,WAAW,CAAA;IAChB,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,UAAU,CAAA;IACnB,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,GAAG,EAAE,SAAS;CAG3B;AAED,qBAAa,eAAgB,SAAQ,SAAS;gBAChC,GAAG,EAAE,SAAS;CAG3B;AAED,qBAAa,sBAAuB,SAAQ,SAAS;gBACvC,GAAG,EAAE,SAAS;CAG3B;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,OAQhC"}
|
|
@@ -1,11 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidInitiationError = exports.DidTooLongError = exports.InvalidEmailError = void 0;
|
|
3
4
|
exports.toKnownErr = toKnownErr;
|
|
5
|
+
/**
|
|
6
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
7
|
+
*/
|
|
8
|
+
const xrpc_1 = require("@atproto/xrpc");
|
|
4
9
|
const lexicons_1 = require("../../../../lexicons");
|
|
5
10
|
const util_1 = require("../../../../util");
|
|
6
11
|
const is$typed = util_1.is$typed, validate = lexicons_1.validate;
|
|
7
12
|
const id = 'app.bsky.unspecced.initAgeAssurance';
|
|
13
|
+
class InvalidEmailError extends xrpc_1.XRPCError {
|
|
14
|
+
constructor(src) {
|
|
15
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.InvalidEmailError = InvalidEmailError;
|
|
19
|
+
class DidTooLongError extends xrpc_1.XRPCError {
|
|
20
|
+
constructor(src) {
|
|
21
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.DidTooLongError = DidTooLongError;
|
|
25
|
+
class InvalidInitiationError extends xrpc_1.XRPCError {
|
|
26
|
+
constructor(src) {
|
|
27
|
+
super(src.status, src.error, src.message, src.headers, { cause: src });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.InvalidInitiationError = InvalidInitiationError;
|
|
8
31
|
function toKnownErr(e) {
|
|
32
|
+
if (e instanceof xrpc_1.XRPCError) {
|
|
33
|
+
if (e.error === 'InvalidEmail')
|
|
34
|
+
return new InvalidEmailError(e);
|
|
35
|
+
if (e.error === 'DidTooLong')
|
|
36
|
+
return new DidTooLongError(e);
|
|
37
|
+
if (e.error === 'InvalidInitiation')
|
|
38
|
+
return new InvalidInitiationError(e);
|
|
39
|
+
}
|
|
9
40
|
return e;
|
|
10
41
|
}
|
|
11
42
|
//# sourceMappingURL=initAgeAssurance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initAgeAssurance.js","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/unspecced/initAgeAssurance.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"initAgeAssurance.js","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/unspecced/initAgeAssurance.ts"],"names":[],"mappings":";;;AA8DA,gCAQC;AAtED;;GAEG;AACH,wCAAqD;AAGrD,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,qCAAqC,CAAA;AA4BhD,MAAa,iBAAkB,SAAQ,gBAAS;IAC9C,YAAY,GAAc;QACxB,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;IACxE,CAAC;CACF;AAJD,8CAIC;AAED,MAAa,eAAgB,SAAQ,gBAAS;IAC5C,YAAY,GAAc;QACxB,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;IACxE,CAAC;CACF;AAJD,0CAIC;AAED,MAAa,sBAAuB,SAAQ,gBAAS;IACnD,YAAY,GAAc;QACxB,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;IACxE,CAAC;CACF;AAJD,wDAIC;AAED,SAAgB,UAAU,CAAC,CAAM;IAC/B,IAAI,CAAC,YAAY,gBAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,KAAK,KAAK,cAAc;YAAE,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAA;QAC/D,IAAI,CAAC,CAAC,KAAK,KAAK,YAAY;YAAE,OAAO,IAAI,eAAe,CAAC,CAAC,CAAC,CAAA;QAC3D,IAAI,CAAC,CAAC,KAAK,KAAK,mBAAmB;YAAE,OAAO,IAAI,sBAAsB,CAAC,CAAC,CAAC,CAAA;IAC3E,CAAC;IAED,OAAO,CAAC,CAAA;AACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/api",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.27",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Client library for atproto and Bluesky",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"multiformats": "^9.9.0",
|
|
22
22
|
"tlds": "^1.234.0",
|
|
23
23
|
"zod": "^3.23.8",
|
|
24
|
-
"@atproto/lexicon": "^0.4.12",
|
|
25
24
|
"@atproto/common-web": "^0.4.2",
|
|
25
|
+
"@atproto/lexicon": "^0.4.12",
|
|
26
26
|
"@atproto/syntax": "^0.4.0",
|
|
27
27
|
"@atproto/xrpc": "^0.7.1"
|
|
28
28
|
},
|
package/src/client/index.ts
CHANGED
|
@@ -128,8 +128,8 @@ import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGene
|
|
|
128
128
|
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
|
129
129
|
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
|
130
130
|
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
|
131
|
-
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
|
132
131
|
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
|
132
|
+
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
|
133
133
|
import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
|
134
134
|
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
|
135
135
|
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
|
@@ -186,6 +186,7 @@ import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/
|
|
|
186
186
|
import * as AppBskyNotificationUnregisterPush from './types/app/bsky/notification/unregisterPush.js'
|
|
187
187
|
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js'
|
|
188
188
|
import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet.js'
|
|
189
|
+
import * as AppBskyUnspeccedCheckHandleAvailability from './types/app/bsky/unspecced/checkHandleAvailability.js'
|
|
189
190
|
import * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs.js'
|
|
190
191
|
import * as AppBskyUnspeccedGetAgeAssuranceState from './types/app/bsky/unspecced/getAgeAssuranceState.js'
|
|
191
192
|
import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
|
@@ -405,8 +406,8 @@ export * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGene
|
|
|
405
406
|
export * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
|
406
407
|
export * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
|
407
408
|
export * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
|
408
|
-
export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
|
409
409
|
export * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
|
410
|
+
export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
|
410
411
|
export * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
|
411
412
|
export * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
|
412
413
|
export * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
|
@@ -463,6 +464,7 @@ export * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/
|
|
|
463
464
|
export * as AppBskyNotificationUnregisterPush from './types/app/bsky/notification/unregisterPush.js'
|
|
464
465
|
export * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js'
|
|
465
466
|
export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet.js'
|
|
467
|
+
export * as AppBskyUnspeccedCheckHandleAvailability from './types/app/bsky/unspecced/checkHandleAvailability.js'
|
|
466
468
|
export * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs.js'
|
|
467
469
|
export * as AppBskyUnspeccedGetAgeAssuranceState from './types/app/bsky/unspecced/getAgeAssuranceState.js'
|
|
468
470
|
export * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
|
@@ -2189,6 +2191,13 @@ export class AppBskyFeedNS {
|
|
|
2189
2191
|
})
|
|
2190
2192
|
}
|
|
2191
2193
|
|
|
2194
|
+
getPosts(
|
|
2195
|
+
params?: AppBskyFeedGetPosts.QueryParams,
|
|
2196
|
+
opts?: AppBskyFeedGetPosts.CallOptions,
|
|
2197
|
+
): Promise<AppBskyFeedGetPosts.Response> {
|
|
2198
|
+
return this._client.call('app.bsky.feed.getPosts', params, undefined, opts)
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2192
2201
|
getPostThread(
|
|
2193
2202
|
params?: AppBskyFeedGetPostThread.QueryParams,
|
|
2194
2203
|
opts?: AppBskyFeedGetPostThread.CallOptions,
|
|
@@ -2200,13 +2209,6 @@ export class AppBskyFeedNS {
|
|
|
2200
2209
|
})
|
|
2201
2210
|
}
|
|
2202
2211
|
|
|
2203
|
-
getPosts(
|
|
2204
|
-
params?: AppBskyFeedGetPosts.QueryParams,
|
|
2205
|
-
opts?: AppBskyFeedGetPosts.CallOptions,
|
|
2206
|
-
): Promise<AppBskyFeedGetPosts.Response> {
|
|
2207
|
-
return this._client.call('app.bsky.feed.getPosts', params, undefined, opts)
|
|
2208
|
-
}
|
|
2209
|
-
|
|
2210
2212
|
getQuotes(
|
|
2211
2213
|
params?: AppBskyFeedGetQuotes.QueryParams,
|
|
2212
2214
|
opts?: AppBskyFeedGetQuotes.CallOptions,
|
|
@@ -3903,6 +3905,22 @@ export class AppBskyUnspeccedNS {
|
|
|
3903
3905
|
this._client = client
|
|
3904
3906
|
}
|
|
3905
3907
|
|
|
3908
|
+
checkHandleAvailability(
|
|
3909
|
+
params?: AppBskyUnspeccedCheckHandleAvailability.QueryParams,
|
|
3910
|
+
opts?: AppBskyUnspeccedCheckHandleAvailability.CallOptions,
|
|
3911
|
+
): Promise<AppBskyUnspeccedCheckHandleAvailability.Response> {
|
|
3912
|
+
return this._client
|
|
3913
|
+
.call(
|
|
3914
|
+
'app.bsky.unspecced.checkHandleAvailability',
|
|
3915
|
+
params,
|
|
3916
|
+
undefined,
|
|
3917
|
+
opts,
|
|
3918
|
+
)
|
|
3919
|
+
.catch((e) => {
|
|
3920
|
+
throw AppBskyUnspeccedCheckHandleAvailability.toKnownErr(e)
|
|
3921
|
+
})
|
|
3922
|
+
}
|
|
3923
|
+
|
|
3906
3924
|
getAgeAssuranceState(
|
|
3907
3925
|
params?: AppBskyUnspeccedGetAgeAssuranceState.QueryParams,
|
|
3908
3926
|
opts?: AppBskyUnspeccedGetAgeAssuranceState.CallOptions,
|
|
@@ -4099,12 +4117,11 @@ export class AppBskyUnspeccedNS {
|
|
|
4099
4117
|
data?: AppBskyUnspeccedInitAgeAssurance.InputSchema,
|
|
4100
4118
|
opts?: AppBskyUnspeccedInitAgeAssurance.CallOptions,
|
|
4101
4119
|
): Promise<AppBskyUnspeccedInitAgeAssurance.Response> {
|
|
4102
|
-
return this._client
|
|
4103
|
-
'app.bsky.unspecced.initAgeAssurance',
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
)
|
|
4120
|
+
return this._client
|
|
4121
|
+
.call('app.bsky.unspecced.initAgeAssurance', opts?.qp, data, opts)
|
|
4122
|
+
.catch((e) => {
|
|
4123
|
+
throw AppBskyUnspeccedInitAgeAssurance.toKnownErr(e)
|
|
4124
|
+
})
|
|
4108
4125
|
}
|
|
4109
4126
|
|
|
4110
4127
|
searchActorsSkeleton(
|
package/src/client/lexicons.ts
CHANGED
|
@@ -7282,6 +7282,48 @@ export const schemaDict = {
|
|
|
7282
7282
|
},
|
|
7283
7283
|
},
|
|
7284
7284
|
},
|
|
7285
|
+
AppBskyFeedGetPosts: {
|
|
7286
|
+
lexicon: 1,
|
|
7287
|
+
id: 'app.bsky.feed.getPosts',
|
|
7288
|
+
defs: {
|
|
7289
|
+
main: {
|
|
7290
|
+
type: 'query',
|
|
7291
|
+
description:
|
|
7292
|
+
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
|
7293
|
+
parameters: {
|
|
7294
|
+
type: 'params',
|
|
7295
|
+
required: ['uris'],
|
|
7296
|
+
properties: {
|
|
7297
|
+
uris: {
|
|
7298
|
+
type: 'array',
|
|
7299
|
+
description: 'List of post AT-URIs to return hydrated views for.',
|
|
7300
|
+
items: {
|
|
7301
|
+
type: 'string',
|
|
7302
|
+
format: 'at-uri',
|
|
7303
|
+
},
|
|
7304
|
+
maxLength: 25,
|
|
7305
|
+
},
|
|
7306
|
+
},
|
|
7307
|
+
},
|
|
7308
|
+
output: {
|
|
7309
|
+
encoding: 'application/json',
|
|
7310
|
+
schema: {
|
|
7311
|
+
type: 'object',
|
|
7312
|
+
required: ['posts'],
|
|
7313
|
+
properties: {
|
|
7314
|
+
posts: {
|
|
7315
|
+
type: 'array',
|
|
7316
|
+
items: {
|
|
7317
|
+
type: 'ref',
|
|
7318
|
+
ref: 'lex:app.bsky.feed.defs#postView',
|
|
7319
|
+
},
|
|
7320
|
+
},
|
|
7321
|
+
},
|
|
7322
|
+
},
|
|
7323
|
+
},
|
|
7324
|
+
},
|
|
7325
|
+
},
|
|
7326
|
+
},
|
|
7285
7327
|
AppBskyFeedGetPostThread: {
|
|
7286
7328
|
lexicon: 1,
|
|
7287
7329
|
id: 'app.bsky.feed.getPostThread',
|
|
@@ -7346,48 +7388,6 @@ export const schemaDict = {
|
|
|
7346
7388
|
},
|
|
7347
7389
|
},
|
|
7348
7390
|
},
|
|
7349
|
-
AppBskyFeedGetPosts: {
|
|
7350
|
-
lexicon: 1,
|
|
7351
|
-
id: 'app.bsky.feed.getPosts',
|
|
7352
|
-
defs: {
|
|
7353
|
-
main: {
|
|
7354
|
-
type: 'query',
|
|
7355
|
-
description:
|
|
7356
|
-
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
|
7357
|
-
parameters: {
|
|
7358
|
-
type: 'params',
|
|
7359
|
-
required: ['uris'],
|
|
7360
|
-
properties: {
|
|
7361
|
-
uris: {
|
|
7362
|
-
type: 'array',
|
|
7363
|
-
description: 'List of post AT-URIs to return hydrated views for.',
|
|
7364
|
-
items: {
|
|
7365
|
-
type: 'string',
|
|
7366
|
-
format: 'at-uri',
|
|
7367
|
-
},
|
|
7368
|
-
maxLength: 25,
|
|
7369
|
-
},
|
|
7370
|
-
},
|
|
7371
|
-
},
|
|
7372
|
-
output: {
|
|
7373
|
-
encoding: 'application/json',
|
|
7374
|
-
schema: {
|
|
7375
|
-
type: 'object',
|
|
7376
|
-
required: ['posts'],
|
|
7377
|
-
properties: {
|
|
7378
|
-
posts: {
|
|
7379
|
-
type: 'array',
|
|
7380
|
-
items: {
|
|
7381
|
-
type: 'ref',
|
|
7382
|
-
ref: 'lex:app.bsky.feed.defs#postView',
|
|
7383
|
-
},
|
|
7384
|
-
},
|
|
7385
|
-
},
|
|
7386
|
-
},
|
|
7387
|
-
},
|
|
7388
|
-
},
|
|
7389
|
-
},
|
|
7390
|
-
},
|
|
7391
7391
|
AppBskyFeedGetQuotes: {
|
|
7392
7392
|
lexicon: 1,
|
|
7393
7393
|
id: 'app.bsky.feed.getQuotes',
|
|
@@ -10511,6 +10511,104 @@ export const schemaDict = {
|
|
|
10511
10511
|
},
|
|
10512
10512
|
},
|
|
10513
10513
|
},
|
|
10514
|
+
AppBskyUnspeccedCheckHandleAvailability: {
|
|
10515
|
+
lexicon: 1,
|
|
10516
|
+
id: 'app.bsky.unspecced.checkHandleAvailability',
|
|
10517
|
+
defs: {
|
|
10518
|
+
main: {
|
|
10519
|
+
type: 'query',
|
|
10520
|
+
description:
|
|
10521
|
+
'Checks whether the provided handle is available. If the handle is not available, available suggestions will be returned. Optional inputs will be used to generate suggestions.',
|
|
10522
|
+
parameters: {
|
|
10523
|
+
type: 'params',
|
|
10524
|
+
required: ['handle'],
|
|
10525
|
+
properties: {
|
|
10526
|
+
handle: {
|
|
10527
|
+
type: 'string',
|
|
10528
|
+
format: 'handle',
|
|
10529
|
+
description:
|
|
10530
|
+
'Tentative handle. Will be checked for availability or used to build handle suggestions.',
|
|
10531
|
+
},
|
|
10532
|
+
email: {
|
|
10533
|
+
type: 'string',
|
|
10534
|
+
description:
|
|
10535
|
+
'User-provided email. Might be used to build handle suggestions.',
|
|
10536
|
+
},
|
|
10537
|
+
birthDate: {
|
|
10538
|
+
type: 'string',
|
|
10539
|
+
format: 'datetime',
|
|
10540
|
+
description:
|
|
10541
|
+
'User-provided birth date. Might be used to build handle suggestions.',
|
|
10542
|
+
},
|
|
10543
|
+
},
|
|
10544
|
+
},
|
|
10545
|
+
output: {
|
|
10546
|
+
encoding: 'application/json',
|
|
10547
|
+
schema: {
|
|
10548
|
+
type: 'object',
|
|
10549
|
+
required: ['handle', 'result'],
|
|
10550
|
+
properties: {
|
|
10551
|
+
handle: {
|
|
10552
|
+
type: 'string',
|
|
10553
|
+
format: 'handle',
|
|
10554
|
+
description: 'Echo of the input handle.',
|
|
10555
|
+
},
|
|
10556
|
+
result: {
|
|
10557
|
+
type: 'union',
|
|
10558
|
+
refs: [
|
|
10559
|
+
'lex:app.bsky.unspecced.checkHandleAvailability#resultAvailable',
|
|
10560
|
+
'lex:app.bsky.unspecced.checkHandleAvailability#resultUnavailable',
|
|
10561
|
+
],
|
|
10562
|
+
},
|
|
10563
|
+
},
|
|
10564
|
+
},
|
|
10565
|
+
},
|
|
10566
|
+
errors: [
|
|
10567
|
+
{
|
|
10568
|
+
name: 'InvalidEmail',
|
|
10569
|
+
description: 'An invalid email was provided.',
|
|
10570
|
+
},
|
|
10571
|
+
],
|
|
10572
|
+
},
|
|
10573
|
+
resultAvailable: {
|
|
10574
|
+
type: 'object',
|
|
10575
|
+
description: 'Indicates the provided handle is available.',
|
|
10576
|
+
properties: {},
|
|
10577
|
+
},
|
|
10578
|
+
resultUnavailable: {
|
|
10579
|
+
type: 'object',
|
|
10580
|
+
description:
|
|
10581
|
+
'Indicates the provided handle is unavailable and gives suggestions of available handles.',
|
|
10582
|
+
required: ['suggestions'],
|
|
10583
|
+
properties: {
|
|
10584
|
+
suggestions: {
|
|
10585
|
+
type: 'array',
|
|
10586
|
+
description:
|
|
10587
|
+
'List of suggested handles based on the provided inputs.',
|
|
10588
|
+
items: {
|
|
10589
|
+
type: 'ref',
|
|
10590
|
+
ref: 'lex:app.bsky.unspecced.checkHandleAvailability#suggestion',
|
|
10591
|
+
},
|
|
10592
|
+
},
|
|
10593
|
+
},
|
|
10594
|
+
},
|
|
10595
|
+
suggestion: {
|
|
10596
|
+
type: 'object',
|
|
10597
|
+
required: ['handle', 'method'],
|
|
10598
|
+
properties: {
|
|
10599
|
+
handle: {
|
|
10600
|
+
type: 'string',
|
|
10601
|
+
format: 'handle',
|
|
10602
|
+
},
|
|
10603
|
+
method: {
|
|
10604
|
+
type: 'string',
|
|
10605
|
+
description:
|
|
10606
|
+
'Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics.',
|
|
10607
|
+
},
|
|
10608
|
+
},
|
|
10609
|
+
},
|
|
10610
|
+
},
|
|
10611
|
+
},
|
|
10514
10612
|
AppBskyUnspeccedDefs: {
|
|
10515
10613
|
lexicon: 1,
|
|
10516
10614
|
id: 'app.bsky.unspecced.defs',
|
|
@@ -11589,6 +11687,17 @@ export const schemaDict = {
|
|
|
11589
11687
|
ref: 'lex:app.bsky.unspecced.defs#ageAssuranceState',
|
|
11590
11688
|
},
|
|
11591
11689
|
},
|
|
11690
|
+
errors: [
|
|
11691
|
+
{
|
|
11692
|
+
name: 'InvalidEmail',
|
|
11693
|
+
},
|
|
11694
|
+
{
|
|
11695
|
+
name: 'DidTooLong',
|
|
11696
|
+
},
|
|
11697
|
+
{
|
|
11698
|
+
name: 'InvalidInitiation',
|
|
11699
|
+
},
|
|
11700
|
+
],
|
|
11592
11701
|
},
|
|
11593
11702
|
},
|
|
11594
11703
|
},
|
|
@@ -17668,8 +17777,8 @@ export const ids = {
|
|
|
17668
17777
|
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
|
17669
17778
|
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
|
17670
17779
|
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
|
17671
|
-
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
|
17672
17780
|
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
|
17781
|
+
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
|
17673
17782
|
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
|
17674
17783
|
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
|
17675
17784
|
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
|
@@ -17730,6 +17839,8 @@ export const ids = {
|
|
|
17730
17839
|
AppBskyNotificationUnregisterPush: 'app.bsky.notification.unregisterPush',
|
|
17731
17840
|
AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen',
|
|
17732
17841
|
AppBskyRichtextFacet: 'app.bsky.richtext.facet',
|
|
17842
|
+
AppBskyUnspeccedCheckHandleAvailability:
|
|
17843
|
+
'app.bsky.unspecced.checkHandleAvailability',
|
|
17733
17844
|
AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs',
|
|
17734
17845
|
AppBskyUnspeccedGetAgeAssuranceState:
|
|
17735
17846
|
'app.bsky.unspecced.getAgeAssuranceState',
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { HeadersMap, XRPCError } from '@atproto/xrpc'
|
|
5
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { CID } from 'multiformats/cid'
|
|
7
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
8
|
+
import {
|
|
9
|
+
type $Typed,
|
|
10
|
+
is$typed as _is$typed,
|
|
11
|
+
type OmitKey,
|
|
12
|
+
} from '../../../../util'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'app.bsky.unspecced.checkHandleAvailability'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {
|
|
19
|
+
/** Tentative handle. Will be checked for availability or used to build handle suggestions. */
|
|
20
|
+
handle: string
|
|
21
|
+
/** User-provided email. Might be used to build handle suggestions. */
|
|
22
|
+
email?: string
|
|
23
|
+
/** User-provided birth date. Might be used to build handle suggestions. */
|
|
24
|
+
birthDate?: string
|
|
25
|
+
}
|
|
26
|
+
export type InputSchema = undefined
|
|
27
|
+
|
|
28
|
+
export interface OutputSchema {
|
|
29
|
+
/** Echo of the input handle. */
|
|
30
|
+
handle: string
|
|
31
|
+
result:
|
|
32
|
+
| $Typed<ResultAvailable>
|
|
33
|
+
| $Typed<ResultUnavailable>
|
|
34
|
+
| { $type: string }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface CallOptions {
|
|
38
|
+
signal?: AbortSignal
|
|
39
|
+
headers?: HeadersMap
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface Response {
|
|
43
|
+
success: boolean
|
|
44
|
+
headers: HeadersMap
|
|
45
|
+
data: OutputSchema
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export class InvalidEmailError extends XRPCError {
|
|
49
|
+
constructor(src: XRPCError) {
|
|
50
|
+
super(src.status, src.error, src.message, src.headers, { cause: src })
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function toKnownErr(e: any) {
|
|
55
|
+
if (e instanceof XRPCError) {
|
|
56
|
+
if (e.error === 'InvalidEmail') return new InvalidEmailError(e)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return e
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Indicates the provided handle is available. */
|
|
63
|
+
export interface ResultAvailable {
|
|
64
|
+
$type?: 'app.bsky.unspecced.checkHandleAvailability#resultAvailable'
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const hashResultAvailable = 'resultAvailable'
|
|
68
|
+
|
|
69
|
+
export function isResultAvailable<V>(v: V) {
|
|
70
|
+
return is$typed(v, id, hashResultAvailable)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function validateResultAvailable<V>(v: V) {
|
|
74
|
+
return validate<ResultAvailable & V>(v, id, hashResultAvailable)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Indicates the provided handle is unavailable and gives suggestions of available handles. */
|
|
78
|
+
export interface ResultUnavailable {
|
|
79
|
+
$type?: 'app.bsky.unspecced.checkHandleAvailability#resultUnavailable'
|
|
80
|
+
/** List of suggested handles based on the provided inputs. */
|
|
81
|
+
suggestions: Suggestion[]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const hashResultUnavailable = 'resultUnavailable'
|
|
85
|
+
|
|
86
|
+
export function isResultUnavailable<V>(v: V) {
|
|
87
|
+
return is$typed(v, id, hashResultUnavailable)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function validateResultUnavailable<V>(v: V) {
|
|
91
|
+
return validate<ResultUnavailable & V>(v, id, hashResultUnavailable)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface Suggestion {
|
|
95
|
+
$type?: 'app.bsky.unspecced.checkHandleAvailability#suggestion'
|
|
96
|
+
handle: string
|
|
97
|
+
/** Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics. */
|
|
98
|
+
method: string
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const hashSuggestion = 'suggestion'
|
|
102
|
+
|
|
103
|
+
export function isSuggestion<V>(v: V) {
|
|
104
|
+
return is$typed(v, id, hashSuggestion)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function validateSuggestion<V>(v: V) {
|
|
108
|
+
return validate<Suggestion & V>(v, id, hashSuggestion)
|
|
109
|
+
}
|