@atproto/bsky 0.0.202 → 0.0.204

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/api/age-assurance/const.d.ts.map +1 -1
  3. package/dist/api/age-assurance/const.js +40 -0
  4. package/dist/api/age-assurance/const.js.map +1 -1
  5. package/dist/api/app/bsky/contact/dismissMatch.d.ts.map +1 -1
  6. package/dist/api/app/bsky/contact/dismissMatch.js +2 -3
  7. package/dist/api/app/bsky/contact/dismissMatch.js.map +1 -1
  8. package/dist/api/app/bsky/contact/getMatches.js +2 -3
  9. package/dist/api/app/bsky/contact/getMatches.js.map +1 -1
  10. package/dist/api/app/bsky/contact/getSyncStatus.d.ts.map +1 -1
  11. package/dist/api/app/bsky/contact/getSyncStatus.js +2 -3
  12. package/dist/api/app/bsky/contact/getSyncStatus.js.map +1 -1
  13. package/dist/api/app/bsky/contact/importContacts.js +2 -3
  14. package/dist/api/app/bsky/contact/importContacts.js.map +1 -1
  15. package/dist/api/app/bsky/contact/removeData.d.ts.map +1 -1
  16. package/dist/api/app/bsky/contact/removeData.js +2 -3
  17. package/dist/api/app/bsky/contact/removeData.js.map +1 -1
  18. package/dist/api/app/bsky/contact/sendNotification.d.ts.map +1 -1
  19. package/dist/api/app/bsky/contact/sendNotification.js.map +1 -1
  20. package/dist/api/app/bsky/contact/startPhoneVerification.d.ts.map +1 -1
  21. package/dist/api/app/bsky/contact/startPhoneVerification.js +2 -3
  22. package/dist/api/app/bsky/contact/startPhoneVerification.js.map +1 -1
  23. package/dist/api/app/bsky/contact/util.d.ts +7 -0
  24. package/dist/api/app/bsky/contact/util.d.ts.map +1 -1
  25. package/dist/api/app/bsky/contact/util.js +68 -0
  26. package/dist/api/app/bsky/contact/util.js.map +1 -1
  27. package/dist/api/app/bsky/contact/verifyPhone.d.ts.map +1 -1
  28. package/dist/api/app/bsky/contact/verifyPhone.js +2 -3
  29. package/dist/api/app/bsky/contact/verifyPhone.js.map +1 -1
  30. package/dist/api/index.d.ts.map +1 -1
  31. package/dist/api/index.js +2 -0
  32. package/dist/api/index.js.map +1 -1
  33. package/dist/hydration/actor.js +1 -1
  34. package/dist/hydration/actor.js.map +1 -1
  35. package/dist/lexicon/lexicons.d.ts +142 -52
  36. package/dist/lexicon/lexicons.d.ts.map +1 -1
  37. package/dist/lexicon/lexicons.js +93 -26
  38. package/dist/lexicon/lexicons.js.map +1 -1
  39. package/dist/lexicon/types/app/bsky/contact/dismissMatch.d.ts +1 -1
  40. package/dist/lexicon/types/app/bsky/contact/dismissMatch.d.ts.map +1 -1
  41. package/dist/lexicon/types/app/bsky/contact/dismissMatch.js.map +1 -1
  42. package/dist/lexicon/types/app/bsky/contact/getMatches.d.ts +1 -1
  43. package/dist/lexicon/types/app/bsky/contact/getMatches.d.ts.map +1 -1
  44. package/dist/lexicon/types/app/bsky/contact/getMatches.js.map +1 -1
  45. package/dist/lexicon/types/app/bsky/contact/getSyncStatus.d.ts +1 -1
  46. package/dist/lexicon/types/app/bsky/contact/getSyncStatus.d.ts.map +1 -1
  47. package/dist/lexicon/types/app/bsky/contact/getSyncStatus.js.map +1 -1
  48. package/dist/lexicon/types/app/bsky/contact/importContacts.d.ts +1 -1
  49. package/dist/lexicon/types/app/bsky/contact/importContacts.d.ts.map +1 -1
  50. package/dist/lexicon/types/app/bsky/contact/importContacts.js.map +1 -1
  51. package/dist/lexicon/types/app/bsky/contact/removeData.d.ts +1 -1
  52. package/dist/lexicon/types/app/bsky/contact/removeData.d.ts.map +1 -1
  53. package/dist/lexicon/types/app/bsky/contact/removeData.js.map +1 -1
  54. package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.d.ts +1 -1
  55. package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.d.ts.map +1 -1
  56. package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.js.map +1 -1
  57. package/dist/lexicon/types/app/bsky/contact/verifyPhone.d.ts +1 -1
  58. package/dist/lexicon/types/app/bsky/contact/verifyPhone.d.ts.map +1 -1
  59. package/dist/lexicon/types/app/bsky/contact/verifyPhone.js.map +1 -1
  60. package/dist/lexicon/types/com/atproto/server/deleteSession.d.ts +1 -0
  61. package/dist/lexicon/types/com/atproto/server/deleteSession.d.ts.map +1 -1
  62. package/dist/lexicon/types/com/atproto/server/deleteSession.js.map +1 -1
  63. package/dist/lexicon/types/com/atproto/server/getSession.d.ts +3 -3
  64. package/dist/lexicon/types/com/atproto/server/getSession.d.ts.map +1 -1
  65. package/dist/lexicon/types/com/atproto/server/getSession.js.map +1 -1
  66. package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +4 -1
  67. package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts.map +1 -1
  68. package/dist/lexicon/types/com/atproto/server/refreshSession.js.map +1 -1
  69. package/package.json +8 -8
  70. package/proto/bsky.proto +1 -0
  71. package/src/api/age-assurance/const.ts +40 -0
  72. package/src/api/app/bsky/contact/dismissMatch.ts +7 -6
  73. package/src/api/app/bsky/contact/getMatches.ts +8 -7
  74. package/src/api/app/bsky/contact/getSyncStatus.ts +6 -5
  75. package/src/api/app/bsky/contact/importContacts.ts +8 -7
  76. package/src/api/app/bsky/contact/removeData.ts +6 -5
  77. package/src/api/app/bsky/contact/sendNotification.ts +2 -1
  78. package/src/api/app/bsky/contact/startPhoneVerification.ts +7 -6
  79. package/src/api/app/bsky/contact/util.ts +80 -1
  80. package/src/api/app/bsky/contact/verifyPhone.ts +8 -7
  81. package/src/api/index.ts +2 -0
  82. package/src/hydration/actor.ts +1 -1
  83. package/src/lexicon/lexicons.ts +94 -26
  84. package/src/lexicon/types/app/bsky/contact/dismissMatch.ts +1 -1
  85. package/src/lexicon/types/app/bsky/contact/getMatches.ts +1 -1
  86. package/src/lexicon/types/app/bsky/contact/getSyncStatus.ts +1 -1
  87. package/src/lexicon/types/app/bsky/contact/importContacts.ts +6 -1
  88. package/src/lexicon/types/app/bsky/contact/removeData.ts +1 -1
  89. package/src/lexicon/types/app/bsky/contact/startPhoneVerification.ts +1 -1
  90. package/src/lexicon/types/app/bsky/contact/verifyPhone.ts +6 -1
  91. package/src/lexicon/types/com/atproto/server/deleteSession.ts +1 -0
  92. package/src/lexicon/types/com/atproto/server/getSession.ts +1 -1
  93. package/src/lexicon/types/com/atproto/server/refreshSession.ts +4 -1
@@ -1,4 +1,9 @@
1
- import { MethodNotImplementedError } from '@atproto/xrpc-server'
1
+ import { ConnectError } from '@connectrpc/connect'
2
+ import {
3
+ InternalServerError,
4
+ InvalidRequestError,
5
+ MethodNotImplementedError,
6
+ } from '@atproto/xrpc-server'
2
7
  import { AppContext } from '../../../..'
3
8
  import { RolodexClient } from '../../../../rolodex'
4
9
 
@@ -11,3 +16,77 @@ export function assertRolodexOrThrowUnimplemented(
11
16
  )
12
17
  }
13
18
  }
19
+
20
+ /**
21
+ * Converts UPPERCASE_ERROR from Rolodex to PascalCase for XRPC.
22
+ */
23
+ function convertErrorName(reason: string): string {
24
+ switch (reason) {
25
+ case 'INVALID_DID':
26
+ return 'InvalidDid'
27
+ case 'INVALID_LIMIT':
28
+ return 'InvalidLimit'
29
+ case 'INVALID_CURSOR':
30
+ return 'InvalidCursor'
31
+ case 'INVALID_CONTACTS':
32
+ return 'InvalidContacts'
33
+ case 'TOO_MANY_CONTACTS':
34
+ return 'TooManyContacts'
35
+ case 'INVALID_TOKEN':
36
+ return 'InvalidToken'
37
+ case 'RATE_LIMIT_EXCEEDED':
38
+ return 'RateLimitExceeded'
39
+ case 'INVALID_PHONE':
40
+ return 'InvalidPhone'
41
+ case 'INVALID_CODE':
42
+ return 'InvalidCode'
43
+ case 'INTERNAL_ERROR':
44
+ return 'InternalError'
45
+ default:
46
+ return reason
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Helper to call Rolodex client methods and translate RPC errors to XRPC
52
+ * errors.
53
+ *
54
+ * These `reason` values need to stay in sync with the Rolodex service
55
+ */
56
+ export async function callRolodexClient<T>(caller: T) {
57
+ try {
58
+ return await caller
59
+ } catch (e) {
60
+ // might be something we want to handle
61
+ if (e instanceof ConnectError) {
62
+ /**
63
+ * https://connectrpc.com/docs/protocol#error-end-stream
64
+ */
65
+ const details = e.details?.at(0) as
66
+ | {
67
+ debug: {
68
+ reason: string
69
+ message: string
70
+ }
71
+ }
72
+ | undefined
73
+ const reason = details?.debug?.reason // e.g. INVALID_DID
74
+ // Handle known error reasons
75
+ if (reason) {
76
+ const errorName = convertErrorName(reason)
77
+ // NOTE: Don't leak e.message to the response.
78
+
79
+ if (reason === 'INTERNAL_ERROR') {
80
+ throw new InternalServerError('Upstream error', errorName, {
81
+ cause: e,
82
+ })
83
+ } else {
84
+ throw new InvalidRequestError('An error occurred', errorName, {
85
+ cause: e,
86
+ })
87
+ }
88
+ }
89
+ }
90
+ throw e
91
+ }
92
+ }
@@ -1,6 +1,6 @@
1
1
  import { AppContext } from '../../../../context'
2
2
  import { Server } from '../../../../lexicon'
3
- import { assertRolodexOrThrowUnimplemented } from './util'
3
+ import { assertRolodexOrThrowUnimplemented, callRolodexClient } from './util'
4
4
 
5
5
  export default function (server: Server, ctx: AppContext) {
6
6
  server.app.bsky.contact.verifyPhone({
@@ -9,12 +9,13 @@ export default function (server: Server, ctx: AppContext) {
9
9
  assertRolodexOrThrowUnimplemented(ctx)
10
10
 
11
11
  const actor = auth.credentials.iss
12
- // TODO: Error handling.
13
- const res = await ctx.rolodexClient.verifyPhone({
14
- actor,
15
- verificationCode: input.body.code,
16
- phone: input.body.phone,
17
- })
12
+ const res = await callRolodexClient(
13
+ ctx.rolodexClient.verifyPhone({
14
+ actor,
15
+ verificationCode: input.body.code,
16
+ phone: input.body.phone,
17
+ }),
18
+ )
18
19
 
19
20
  return {
20
21
  encoding: 'application/json',
package/src/api/index.ts CHANGED
@@ -16,6 +16,7 @@ import getMatches from './app/bsky/contact/getMatches'
16
16
  import getSyncStatus from './app/bsky/contact/getSyncStatus'
17
17
  import importContacts from './app/bsky/contact/importContacts'
18
18
  import removeData from './app/bsky/contact/removeData'
19
+ import sendNotification from './app/bsky/contact/sendNotification'
19
20
  import startPhoneVerification from './app/bsky/contact/startPhoneVerification'
20
21
  import verifyPhone from './app/bsky/contact/verifyPhone'
21
22
  import getActorFeeds from './app/bsky/feed/getActorFeeds'
@@ -108,6 +109,7 @@ export default function (server: Server, ctx: AppContext) {
108
109
  getSyncStatus(server, ctx)
109
110
  importContacts(server, ctx)
110
111
  removeData(server, ctx)
112
+ sendNotification(server, ctx)
111
113
  startPhoneVerification(server, ctx)
112
114
  verifyPhone(server, ctx)
113
115
  getActorFeeds(server, ctx)
@@ -273,7 +273,7 @@ export class ActorHydrator {
273
273
  includeTakedowns = false,
274
274
  ): Promise<NotificationDeclarations> {
275
275
  if (!uris.length) return new HydrationMap<NotificationDeclaration>()
276
- const res = await this.dataplane.getActorChatDeclarationRecords({ uris })
276
+ const res = await this.dataplane.getNotificationDeclarationRecords({ uris })
277
277
  return uris.reduce((acc, uri, i) => {
278
278
  const record = parseRecord<NotificationDeclarationRecord>(
279
279
  res.records[i],
@@ -1826,7 +1826,7 @@ export const schemaDict = {
1826
1826
  main: {
1827
1827
  type: 'procedure',
1828
1828
  description:
1829
- "WARNING: This is unstable and under active development, don't use it while this warning is here. Removes a match that was found via contact import. It shouldn't appear again if the same contact is re-imported. Requires authentication.",
1829
+ "Removes a match that was found via contact import. It shouldn't appear again if the same contact is re-imported. Requires authentication.",
1830
1830
  input: {
1831
1831
  encoding: 'application/json',
1832
1832
  schema: {
@@ -1850,8 +1850,10 @@ export const schemaDict = {
1850
1850
  },
1851
1851
  errors: [
1852
1852
  {
1853
- name: 'TODO',
1854
- description: 'TODO',
1853
+ name: 'InvalidDid',
1854
+ },
1855
+ {
1856
+ name: 'InternalError',
1855
1857
  },
1856
1858
  ],
1857
1859
  },
@@ -1864,7 +1866,7 @@ export const schemaDict = {
1864
1866
  main: {
1865
1867
  type: 'query',
1866
1868
  description:
1867
- "WARNING: This is unstable and under active development, don't use it while this warning is here. Returns the matched contacts (contacts that were mutually imported). Excludes dismissed matches. Requires authentication.",
1869
+ 'Returns the matched contacts (contacts that were mutually imported). Excludes dismissed matches. Requires authentication.',
1868
1870
  parameters: {
1869
1871
  type: 'params',
1870
1872
  properties: {
@@ -1900,8 +1902,16 @@ export const schemaDict = {
1900
1902
  },
1901
1903
  errors: [
1902
1904
  {
1903
- name: 'TODO',
1904
- description: 'TODO',
1905
+ name: 'InvalidDid',
1906
+ },
1907
+ {
1908
+ name: 'InvalidLimit',
1909
+ },
1910
+ {
1911
+ name: 'InvalidCursor',
1912
+ },
1913
+ {
1914
+ name: 'InternalError',
1905
1915
  },
1906
1916
  ],
1907
1917
  },
@@ -1914,7 +1924,7 @@ export const schemaDict = {
1914
1924
  main: {
1915
1925
  type: 'query',
1916
1926
  description:
1917
- "WARNING: This is unstable and under active development, don't use it while this warning is here. Gets the user's current contact import status. Requires authentication.",
1927
+ "Gets the user's current contact import status. Requires authentication.",
1918
1928
  parameters: {
1919
1929
  type: 'params',
1920
1930
  properties: {},
@@ -1935,8 +1945,10 @@ export const schemaDict = {
1935
1945
  },
1936
1946
  errors: [
1937
1947
  {
1938
- name: 'TODO',
1939
- description: 'TODO',
1948
+ name: 'InvalidDid',
1949
+ },
1950
+ {
1951
+ name: 'InternalError',
1940
1952
  },
1941
1953
  ],
1942
1954
  },
@@ -1949,7 +1961,7 @@ export const schemaDict = {
1949
1961
  main: {
1950
1962
  type: 'procedure',
1951
1963
  description:
1952
- "WARNING: This is unstable and under active development, don't use it while this warning is here. Import contacts for securely matching with other users. This follows the protocol explained in https://docs.bsky.app/blog/contact-import-rfc. Requires authentication.",
1964
+ 'Import contacts for securely matching with other users. This follows the protocol explained in https://docs.bsky.app/blog/contact-import-rfc. Requires authentication.',
1953
1965
  input: {
1954
1966
  encoding: 'application/json',
1955
1967
  schema: {
@@ -1994,8 +2006,19 @@ export const schemaDict = {
1994
2006
  },
1995
2007
  errors: [
1996
2008
  {
1997
- name: 'TODO',
1998
- description: 'TODO',
2009
+ name: 'InvalidDid',
2010
+ },
2011
+ {
2012
+ name: 'InvalidContacts',
2013
+ },
2014
+ {
2015
+ name: 'TooManyContacts',
2016
+ },
2017
+ {
2018
+ name: 'InvalidToken',
2019
+ },
2020
+ {
2021
+ name: 'InternalError',
1999
2022
  },
2000
2023
  ],
2001
2024
  },
@@ -2008,7 +2031,7 @@ export const schemaDict = {
2008
2031
  main: {
2009
2032
  type: 'procedure',
2010
2033
  description:
2011
- "WARNING: This is unstable and under active development, don't use it while this warning is here. Removes all stored hashes used for contact matching, existing matches, and sync status. Requires authentication.",
2034
+ 'Removes all stored hashes used for contact matching, existing matches, and sync status. Requires authentication.',
2012
2035
  input: {
2013
2036
  encoding: 'application/json',
2014
2037
  schema: {
@@ -2025,8 +2048,10 @@ export const schemaDict = {
2025
2048
  },
2026
2049
  errors: [
2027
2050
  {
2028
- name: 'TODO',
2029
- description: 'TODO',
2051
+ name: 'InvalidDid',
2052
+ },
2053
+ {
2054
+ name: 'InternalError',
2030
2055
  },
2031
2056
  ],
2032
2057
  },
@@ -2039,7 +2064,7 @@ export const schemaDict = {
2039
2064
  main: {
2040
2065
  type: 'procedure',
2041
2066
  description:
2042
- "WARNING: This is unstable and under active development, don't use it while this warning is here. System endpoint to send notifications related to contact imports. Requires role authentication.",
2067
+ 'System endpoint to send notifications related to contact imports. Requires role authentication.',
2043
2068
  input: {
2044
2069
  encoding: 'application/json',
2045
2070
  schema: {
@@ -2076,7 +2101,7 @@ export const schemaDict = {
2076
2101
  main: {
2077
2102
  type: 'procedure',
2078
2103
  description:
2079
- "WARNING: This is unstable and under active development, don't use it while this warning is here. Starts a phone verification flow. The phone passed will receive a code via SMS that should be passed to `app.bsky.contact.verifyPhone`. Requires authentication.",
2104
+ 'Starts a phone verification flow. The phone passed will receive a code via SMS that should be passed to `app.bsky.contact.verifyPhone`. Requires authentication.',
2080
2105
  input: {
2081
2106
  encoding: 'application/json',
2082
2107
  schema: {
@@ -2099,8 +2124,16 @@ export const schemaDict = {
2099
2124
  },
2100
2125
  errors: [
2101
2126
  {
2102
- name: 'TODO',
2103
- description: 'TODO',
2127
+ name: 'RateLimitExceeded',
2128
+ },
2129
+ {
2130
+ name: 'InvalidDid',
2131
+ },
2132
+ {
2133
+ name: 'InvalidPhone',
2134
+ },
2135
+ {
2136
+ name: 'InternalError',
2104
2137
  },
2105
2138
  ],
2106
2139
  },
@@ -2113,7 +2146,7 @@ export const schemaDict = {
2113
2146
  main: {
2114
2147
  type: 'procedure',
2115
2148
  description:
2116
- "WARNING: This is unstable and under active development, don't use it while this warning is here. Verifies control over a phone number with a code received via SMS and starts a contact import session. Requires authentication.",
2149
+ 'Verifies control over a phone number with a code received via SMS and starts a contact import session. Requires authentication.',
2117
2150
  input: {
2118
2151
  encoding: 'application/json',
2119
2152
  schema: {
@@ -2149,8 +2182,19 @@ export const schemaDict = {
2149
2182
  },
2150
2183
  errors: [
2151
2184
  {
2152
- name: 'TODO',
2153
- description: 'TODO',
2185
+ name: 'RateLimitExceeded',
2186
+ },
2187
+ {
2188
+ name: 'InvalidDid',
2189
+ },
2190
+ {
2191
+ name: 'InvalidPhone',
2192
+ },
2193
+ {
2194
+ name: 'InvalidCode',
2195
+ },
2196
+ {
2197
+ name: 'InternalError',
2154
2198
  },
2155
2199
  ],
2156
2200
  },
@@ -12975,7 +13019,16 @@ export const schemaDict = {
12975
13019
  defs: {
12976
13020
  main: {
12977
13021
  type: 'procedure',
12978
- description: 'Delete the current session. Requires auth.',
13022
+ description:
13023
+ "Delete the current session. Requires auth using the 'refreshJwt' (not the 'accessJwt').",
13024
+ errors: [
13025
+ {
13026
+ name: 'InvalidToken',
13027
+ },
13028
+ {
13029
+ name: 'ExpiredToken',
13030
+ },
13031
+ ],
12979
13032
  },
12980
13033
  },
12981
13034
  },
@@ -13174,6 +13227,9 @@ export const schemaDict = {
13174
13227
  type: 'string',
13175
13228
  format: 'did',
13176
13229
  },
13230
+ didDoc: {
13231
+ type: 'unknown',
13232
+ },
13177
13233
  email: {
13178
13234
  type: 'string',
13179
13235
  },
@@ -13183,9 +13239,6 @@ export const schemaDict = {
13183
13239
  emailAuthFactor: {
13184
13240
  type: 'boolean',
13185
13241
  },
13186
- didDoc: {
13187
- type: 'unknown',
13188
- },
13189
13242
  active: {
13190
13243
  type: 'boolean',
13191
13244
  },
@@ -13279,6 +13332,15 @@ export const schemaDict = {
13279
13332
  didDoc: {
13280
13333
  type: 'unknown',
13281
13334
  },
13335
+ email: {
13336
+ type: 'string',
13337
+ },
13338
+ emailConfirmed: {
13339
+ type: 'boolean',
13340
+ },
13341
+ emailAuthFactor: {
13342
+ type: 'boolean',
13343
+ },
13282
13344
  active: {
13283
13345
  type: 'boolean',
13284
13346
  },
@@ -13295,6 +13357,12 @@ export const schemaDict = {
13295
13357
  {
13296
13358
  name: 'AccountTakedown',
13297
13359
  },
13360
+ {
13361
+ name: 'InvalidToken',
13362
+ },
13363
+ {
13364
+ name: 'ExpiredToken',
13365
+ },
13298
13366
  ],
13299
13367
  },
13300
13368
  },
@@ -37,7 +37,7 @@ export interface HandlerSuccess {
37
37
  export interface HandlerError {
38
38
  status: number
39
39
  message?: string
40
- error?: 'TODO'
40
+ error?: 'InvalidDid' | 'InternalError'
41
41
  }
42
42
 
43
43
  export type HandlerOutput = HandlerError | HandlerSuccess
@@ -37,7 +37,7 @@ export interface HandlerSuccess {
37
37
  export interface HandlerError {
38
38
  status: number
39
39
  message?: string
40
- error?: 'TODO'
40
+ error?: 'InvalidDid' | 'InvalidLimit' | 'InvalidCursor' | 'InternalError'
41
41
  }
42
42
 
43
43
  export type HandlerOutput = HandlerError | HandlerSuccess
@@ -33,7 +33,7 @@ export interface HandlerSuccess {
33
33
  export interface HandlerError {
34
34
  status: number
35
35
  message?: string
36
- error?: 'TODO'
36
+ error?: 'InvalidDid' | 'InternalError'
37
37
  }
38
38
 
39
39
  export type HandlerOutput = HandlerError | HandlerSuccess
@@ -43,7 +43,12 @@ export interface HandlerSuccess {
43
43
  export interface HandlerError {
44
44
  status: number
45
45
  message?: string
46
- error?: 'TODO'
46
+ error?:
47
+ | 'InvalidDid'
48
+ | 'InvalidContacts'
49
+ | 'TooManyContacts'
50
+ | 'InvalidToken'
51
+ | 'InternalError'
47
52
  }
48
53
 
49
54
  export type HandlerOutput = HandlerError | HandlerSuccess
@@ -34,7 +34,7 @@ export interface HandlerSuccess {
34
34
  export interface HandlerError {
35
35
  status: number
36
36
  message?: string
37
- error?: 'TODO'
37
+ error?: 'InvalidDid' | 'InternalError'
38
38
  }
39
39
 
40
40
  export type HandlerOutput = HandlerError | HandlerSuccess
@@ -37,7 +37,7 @@ export interface HandlerSuccess {
37
37
  export interface HandlerError {
38
38
  status: number
39
39
  message?: string
40
- error?: 'TODO'
40
+ error?: 'RateLimitExceeded' | 'InvalidDid' | 'InvalidPhone' | 'InternalError'
41
41
  }
42
42
 
43
43
  export type HandlerOutput = HandlerError | HandlerSuccess
@@ -42,7 +42,12 @@ export interface HandlerSuccess {
42
42
  export interface HandlerError {
43
43
  status: number
44
44
  message?: string
45
- error?: 'TODO'
45
+ error?:
46
+ | 'RateLimitExceeded'
47
+ | 'InvalidDid'
48
+ | 'InvalidPhone'
49
+ | 'InvalidCode'
50
+ | 'InternalError'
46
51
  }
47
52
 
48
53
  export type HandlerOutput = HandlerError | HandlerSuccess
@@ -21,6 +21,7 @@ export type HandlerInput = void
21
21
  export interface HandlerError {
22
22
  status: number
23
23
  message?: string
24
+ error?: 'InvalidToken' | 'ExpiredToken'
24
25
  }
25
26
 
26
27
  export type HandlerOutput = HandlerError | void
@@ -20,10 +20,10 @@ export type InputSchema = undefined
20
20
  export interface OutputSchema {
21
21
  handle: string
22
22
  did: string
23
+ didDoc?: { [_ in string]: unknown }
23
24
  email?: string
24
25
  emailConfirmed?: boolean
25
26
  emailAuthFactor?: boolean
26
- didDoc?: { [_ in string]: unknown }
27
27
  active?: boolean
28
28
  /** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
29
29
  status?: 'takendown' | 'suspended' | 'deactivated' | (string & {})
@@ -23,6 +23,9 @@ export interface OutputSchema {
23
23
  handle: string
24
24
  did: string
25
25
  didDoc?: { [_ in string]: unknown }
26
+ email?: string
27
+ emailConfirmed?: boolean
28
+ emailAuthFactor?: boolean
26
29
  active?: boolean
27
30
  /** Hosting status of the account. If not specified, then assume 'active'. */
28
31
  status?: 'takendown' | 'suspended' | 'deactivated' | (string & {})
@@ -39,7 +42,7 @@ export interface HandlerSuccess {
39
42
  export interface HandlerError {
40
43
  status: number
41
44
  message?: string
42
- error?: 'AccountTakedown'
45
+ error?: 'AccountTakedown' | 'InvalidToken' | 'ExpiredToken'
43
46
  }
44
47
 
45
48
  export type HandlerOutput = HandlerError | HandlerSuccess