@atproto/api 0.15.26 → 0.16.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.
@@ -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,EAAa,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,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,OAEhC"}
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":";;AA4CA,gCAEC;AAxCD,mDAA4D;AAC5D,2C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AAY,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"}
@@ -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?: 'com.atproto.temp.checkHandleAvailability#resultAvailable';
39
+ }
40
+ export declare function isResultAvailable<V>(v: V): v is import("../../../../util").$TypedObject<V, "com.atproto.temp.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?: 'com.atproto.temp.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, "com.atproto.temp.checkHandleAvailability", "resultUnavailable">;
49
+ export declare function validateResultUnavailable<V>(v: V): ValidationResult<ResultUnavailable & V>;
50
+ export interface Suggestion {
51
+ $type?: 'com.atproto.temp.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, "com.atproto.temp.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/com/atproto/temp/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;IAC3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AAE,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 = 'com.atproto.temp.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/com/atproto/temp/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,0CAA0C,CAAA;AAgCrD,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/api",
3
- "version": "0.15.26",
3
+ "version": "0.16.0",
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
  },
@@ -30,7 +30,7 @@
30
30
  "jest": "^28.1.2",
31
31
  "prettier": "^3.2.5",
32
32
  "typescript": "^5.6.3",
33
- "@atproto/lex-cli": "^0.9.0"
33
+ "@atproto/lex-cli": "^0.9.1"
34
34
  },
35
35
  "scripts": {
36
36
  "codegen": "node ./scripts/generate-code.mjs && lex gen-api --yes ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/* ../../lexicons/chat/bsky/*/* ../../lexicons/tools/ozone/*/*",
@@ -97,6 +97,7 @@ import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOf
97
97
  import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl.js'
98
98
  import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos.js'
99
99
  import * as ComAtprotoTempAddReservedHandle from './types/com/atproto/temp/addReservedHandle.js'
100
+ import * as ComAtprotoTempCheckHandleAvailability from './types/com/atproto/temp/checkHandleAvailability.js'
100
101
  import * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue.js'
101
102
  import * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels.js'
102
103
  import * as ComAtprotoTempRequestPhoneVerification from './types/com/atproto/temp/requestPhoneVerification.js'
@@ -374,6 +375,7 @@ export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOf
374
375
  export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl.js'
375
376
  export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos.js'
376
377
  export * as ComAtprotoTempAddReservedHandle from './types/com/atproto/temp/addReservedHandle.js'
378
+ export * as ComAtprotoTempCheckHandleAvailability from './types/com/atproto/temp/checkHandleAvailability.js'
377
379
  export * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue.js'
378
380
  export * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels.js'
379
381
  export * as ComAtprotoTempRequestPhoneVerification from './types/com/atproto/temp/requestPhoneVerification.js'
@@ -1715,6 +1717,17 @@ export class ComAtprotoTempNS {
1715
1717
  )
1716
1718
  }
1717
1719
 
1720
+ checkHandleAvailability(
1721
+ params?: ComAtprotoTempCheckHandleAvailability.QueryParams,
1722
+ opts?: ComAtprotoTempCheckHandleAvailability.CallOptions,
1723
+ ): Promise<ComAtprotoTempCheckHandleAvailability.Response> {
1724
+ return this._client
1725
+ .call('com.atproto.temp.checkHandleAvailability', params, undefined, opts)
1726
+ .catch((e) => {
1727
+ throw ComAtprotoTempCheckHandleAvailability.toKnownErr(e)
1728
+ })
1729
+ }
1730
+
1718
1731
  checkSignupQueue(
1719
1732
  params?: ComAtprotoTempCheckSignupQueue.QueryParams,
1720
1733
  opts?: ComAtprotoTempCheckSignupQueue.CallOptions,
@@ -4099,12 +4112,11 @@ export class AppBskyUnspeccedNS {
4099
4112
  data?: AppBskyUnspeccedInitAgeAssurance.InputSchema,
4100
4113
  opts?: AppBskyUnspeccedInitAgeAssurance.CallOptions,
4101
4114
  ): Promise<AppBskyUnspeccedInitAgeAssurance.Response> {
4102
- return this._client.call(
4103
- 'app.bsky.unspecced.initAgeAssurance',
4104
- opts?.qp,
4105
- data,
4106
- opts,
4107
- )
4115
+ return this._client
4116
+ .call('app.bsky.unspecced.initAgeAssurance', opts?.qp, data, opts)
4117
+ .catch((e) => {
4118
+ throw AppBskyUnspeccedInitAgeAssurance.toKnownErr(e)
4119
+ })
4108
4120
  }
4109
4121
 
4110
4122
  searchActorsSkeleton(
@@ -4449,6 +4449,104 @@ export const schemaDict = {
4449
4449
  },
4450
4450
  },
4451
4451
  },
4452
+ ComAtprotoTempCheckHandleAvailability: {
4453
+ lexicon: 1,
4454
+ id: 'com.atproto.temp.checkHandleAvailability',
4455
+ defs: {
4456
+ main: {
4457
+ type: 'query',
4458
+ description:
4459
+ '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.',
4460
+ parameters: {
4461
+ type: 'params',
4462
+ required: ['handle'],
4463
+ properties: {
4464
+ handle: {
4465
+ type: 'string',
4466
+ format: 'handle',
4467
+ description:
4468
+ 'Tentative handle. Will be checked for availability or used to build handle suggestions.',
4469
+ },
4470
+ email: {
4471
+ type: 'string',
4472
+ description:
4473
+ 'User-provided email. Might be used to build handle suggestions.',
4474
+ },
4475
+ birthDate: {
4476
+ type: 'string',
4477
+ format: 'datetime',
4478
+ description:
4479
+ 'User-provided birth date. Might be used to build handle suggestions.',
4480
+ },
4481
+ },
4482
+ },
4483
+ output: {
4484
+ encoding: 'application/json',
4485
+ schema: {
4486
+ type: 'object',
4487
+ required: ['handle', 'result'],
4488
+ properties: {
4489
+ handle: {
4490
+ type: 'string',
4491
+ format: 'handle',
4492
+ description: 'Echo of the input handle.',
4493
+ },
4494
+ result: {
4495
+ type: 'union',
4496
+ refs: [
4497
+ 'lex:com.atproto.temp.checkHandleAvailability#resultAvailable',
4498
+ 'lex:com.atproto.temp.checkHandleAvailability#resultUnavailable',
4499
+ ],
4500
+ },
4501
+ },
4502
+ },
4503
+ },
4504
+ errors: [
4505
+ {
4506
+ name: 'InvalidEmail',
4507
+ description: 'An invalid email was provided.',
4508
+ },
4509
+ ],
4510
+ },
4511
+ resultAvailable: {
4512
+ type: 'object',
4513
+ description: 'Indicates the provided handle is available.',
4514
+ properties: {},
4515
+ },
4516
+ resultUnavailable: {
4517
+ type: 'object',
4518
+ description:
4519
+ 'Indicates the provided handle is unavailable and gives suggestions of available handles.',
4520
+ required: ['suggestions'],
4521
+ properties: {
4522
+ suggestions: {
4523
+ type: 'array',
4524
+ description:
4525
+ 'List of suggested handles based on the provided inputs.',
4526
+ items: {
4527
+ type: 'ref',
4528
+ ref: 'lex:com.atproto.temp.checkHandleAvailability#suggestion',
4529
+ },
4530
+ },
4531
+ },
4532
+ },
4533
+ suggestion: {
4534
+ type: 'object',
4535
+ required: ['handle', 'method'],
4536
+ properties: {
4537
+ handle: {
4538
+ type: 'string',
4539
+ format: 'handle',
4540
+ },
4541
+ method: {
4542
+ type: 'string',
4543
+ description:
4544
+ 'Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics.',
4545
+ },
4546
+ },
4547
+ },
4548
+ },
4549
+ },
4452
4550
  ComAtprotoTempCheckSignupQueue: {
4453
4551
  lexicon: 1,
4454
4552
  id: 'com.atproto.temp.checkSignupQueue',
@@ -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
  },
@@ -17636,6 +17745,8 @@ export const ids = {
17636
17745
  ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
17637
17746
  ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
17638
17747
  ComAtprotoTempAddReservedHandle: 'com.atproto.temp.addReservedHandle',
17748
+ ComAtprotoTempCheckHandleAvailability:
17749
+ 'com.atproto.temp.checkHandleAvailability',
17639
17750
  ComAtprotoTempCheckSignupQueue: 'com.atproto.temp.checkSignupQueue',
17640
17751
  ComAtprotoTempFetchLabels: 'com.atproto.temp.fetchLabels',
17641
17752
  ComAtprotoTempRequestPhoneVerification:
@@ -42,6 +42,30 @@ export interface Response {
42
42
  data: OutputSchema
43
43
  }
44
44
 
45
+ export class InvalidEmailError extends XRPCError {
46
+ constructor(src: XRPCError) {
47
+ super(src.status, src.error, src.message, src.headers, { cause: src })
48
+ }
49
+ }
50
+
51
+ export class DidTooLongError extends XRPCError {
52
+ constructor(src: XRPCError) {
53
+ super(src.status, src.error, src.message, src.headers, { cause: src })
54
+ }
55
+ }
56
+
57
+ export class InvalidInitiationError extends XRPCError {
58
+ constructor(src: XRPCError) {
59
+ super(src.status, src.error, src.message, src.headers, { cause: src })
60
+ }
61
+ }
62
+
45
63
  export function toKnownErr(e: any) {
64
+ if (e instanceof XRPCError) {
65
+ if (e.error === 'InvalidEmail') return new InvalidEmailError(e)
66
+ if (e.error === 'DidTooLong') return new DidTooLongError(e)
67
+ if (e.error === 'InvalidInitiation') return new InvalidInitiationError(e)
68
+ }
69
+
46
70
  return e
47
71
  }
@@ -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 = 'com.atproto.temp.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?: 'com.atproto.temp.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?: 'com.atproto.temp.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?: 'com.atproto.temp.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
+ }