@atproto/api 0.18.7 → 0.18.8

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 (42) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/client/lexicons.d.ts +98 -44
  3. package/dist/client/lexicons.d.ts.map +1 -1
  4. package/dist/client/lexicons.js +66 -22
  5. package/dist/client/lexicons.js.map +1 -1
  6. package/dist/client/types/app/bsky/contact/dismissMatch.d.ts +4 -1
  7. package/dist/client/types/app/bsky/contact/dismissMatch.d.ts.map +1 -1
  8. package/dist/client/types/app/bsky/contact/dismissMatch.js +13 -5
  9. package/dist/client/types/app/bsky/contact/dismissMatch.js.map +1 -1
  10. package/dist/client/types/app/bsky/contact/getMatches.d.ts +10 -1
  11. package/dist/client/types/app/bsky/contact/getMatches.d.ts.map +1 -1
  12. package/dist/client/types/app/bsky/contact/getMatches.js +29 -5
  13. package/dist/client/types/app/bsky/contact/getMatches.js.map +1 -1
  14. package/dist/client/types/app/bsky/contact/getSyncStatus.d.ts +4 -1
  15. package/dist/client/types/app/bsky/contact/getSyncStatus.d.ts.map +1 -1
  16. package/dist/client/types/app/bsky/contact/getSyncStatus.js +13 -5
  17. package/dist/client/types/app/bsky/contact/getSyncStatus.js.map +1 -1
  18. package/dist/client/types/app/bsky/contact/importContacts.d.ts +13 -1
  19. package/dist/client/types/app/bsky/contact/importContacts.d.ts.map +1 -1
  20. package/dist/client/types/app/bsky/contact/importContacts.js +37 -5
  21. package/dist/client/types/app/bsky/contact/importContacts.js.map +1 -1
  22. package/dist/client/types/app/bsky/contact/removeData.d.ts +4 -1
  23. package/dist/client/types/app/bsky/contact/removeData.d.ts.map +1 -1
  24. package/dist/client/types/app/bsky/contact/removeData.js +13 -5
  25. package/dist/client/types/app/bsky/contact/removeData.js.map +1 -1
  26. package/dist/client/types/app/bsky/contact/startPhoneVerification.d.ts +10 -1
  27. package/dist/client/types/app/bsky/contact/startPhoneVerification.d.ts.map +1 -1
  28. package/dist/client/types/app/bsky/contact/startPhoneVerification.js +29 -5
  29. package/dist/client/types/app/bsky/contact/startPhoneVerification.js.map +1 -1
  30. package/dist/client/types/app/bsky/contact/verifyPhone.d.ts +13 -1
  31. package/dist/client/types/app/bsky/contact/verifyPhone.d.ts.map +1 -1
  32. package/dist/client/types/app/bsky/contact/verifyPhone.js +37 -5
  33. package/dist/client/types/app/bsky/contact/verifyPhone.js.map +1 -1
  34. package/package.json +2 -2
  35. package/src/client/lexicons.ts +66 -22
  36. package/src/client/types/app/bsky/contact/dismissMatch.ts +9 -2
  37. package/src/client/types/app/bsky/contact/getMatches.ts +23 -2
  38. package/src/client/types/app/bsky/contact/getSyncStatus.ts +9 -2
  39. package/src/client/types/app/bsky/contact/importContacts.ts +30 -2
  40. package/src/client/types/app/bsky/contact/removeData.ts +9 -2
  41. package/src/client/types/app/bsky/contact/startPhoneVerification.ts +23 -2
  42. package/src/client/types/app/bsky/contact/verifyPhone.ts +30 -2
@@ -1 +1 @@
1
- {"version":3,"file":"verifyPhone.js","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/contact/verifyPhone.ts"],"names":[],"mappings":";;;AAkDA,gCAMC;AAxDD;;GAEG;AACH,wCAAqD;AAGrD,mDAA4D;AAC5D,2CAIyB;AAEzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,8BAA8B,CAAA;AA6BzC,MAAa,SAAU,SAAQ,gBAAS;IACtC,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,8BAIC;AAED,SAAgB,UAAU,CAAC,CAAM;IAC/B,IAAI,CAAC,YAAY,gBAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;YAAE,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,CAAA;IACjD,CAAC;IAED,OAAO,CAAC,CAAA;AACV,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { HeadersMap, XRPCError } from '@atproto/xrpc'\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'app.bsky.contact.verifyPhone'\n\nexport type QueryParams = {}\n\nexport interface InputSchema {\n /** The phone number to verify. Should be the same as the one passed to `app.bsky.contact.startPhoneVerification`. */\n phone: string\n /** The code received via SMS as a result of the call to `app.bsky.contact.startPhoneVerification`. */\n code: string\n}\n\nexport interface OutputSchema {\n /** JWT to be used in a call to `app.bsky.contact.importContacts`. It is only valid for a single call. */\n token: string\n}\n\nexport interface CallOptions {\n signal?: AbortSignal\n headers?: HeadersMap\n qp?: QueryParams\n encoding?: 'application/json'\n}\n\nexport interface Response {\n success: boolean\n headers: HeadersMap\n data: OutputSchema\n}\n\nexport class TODOError extends XRPCError {\n constructor(src: XRPCError) {\n super(src.status, src.error, src.message, src.headers, { cause: src })\n }\n}\n\nexport function toKnownErr(e: any) {\n if (e instanceof XRPCError) {\n if (e.error === 'TODO') return new TODOError(e)\n }\n\n return e\n}\n"]}
1
+ {"version":3,"file":"verifyPhone.js","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/contact/verifyPhone.ts"],"names":[],"mappings":";;;AA0EA,gCAUC;AApFD;;GAEG;AACH,wCAAqD;AAGrD,mDAA4D;AAC5D,2CAIyB;AAEzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,8BAA8B,CAAA;AA6BzC,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,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,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,gBAAiB,SAAQ,gBAAS;IAC7C,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,4CAIC;AAED,MAAa,aAAc,SAAQ,gBAAS;IAC1C,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,sCAIC;AAED,SAAgB,UAAU,CAAC,CAAM;IAC/B,IAAI,CAAC,YAAY,gBAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,KAAK,KAAK,mBAAmB;YAAE,OAAO,IAAI,sBAAsB,CAAC,CAAC,CAAC,CAAA;QACzE,IAAI,CAAC,CAAC,KAAK,KAAK,YAAY;YAAE,OAAO,IAAI,eAAe,CAAC,CAAC,CAAC,CAAA;QAC3D,IAAI,CAAC,CAAC,KAAK,KAAK,cAAc;YAAE,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAA;QAC/D,IAAI,CAAC,CAAC,KAAK,KAAK,aAAa;YAAE,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAA;QAC7D,IAAI,CAAC,CAAC,KAAK,KAAK,eAAe;YAAE,OAAO,IAAI,aAAa,CAAC,CAAC,CAAC,CAAA;IAC9D,CAAC;IAED,OAAO,CAAC,CAAA;AACV,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { HeadersMap, XRPCError } from '@atproto/xrpc'\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'app.bsky.contact.verifyPhone'\n\nexport type QueryParams = {}\n\nexport interface InputSchema {\n /** The phone number to verify. Should be the same as the one passed to `app.bsky.contact.startPhoneVerification`. */\n phone: string\n /** The code received via SMS as a result of the call to `app.bsky.contact.startPhoneVerification`. */\n code: string\n}\n\nexport interface OutputSchema {\n /** JWT to be used in a call to `app.bsky.contact.importContacts`. It is only valid for a single call. */\n token: string\n}\n\nexport interface CallOptions {\n signal?: AbortSignal\n headers?: HeadersMap\n qp?: QueryParams\n encoding?: 'application/json'\n}\n\nexport interface Response {\n success: boolean\n headers: HeadersMap\n data: OutputSchema\n}\n\nexport class RateLimitExceededError extends XRPCError {\n constructor(src: XRPCError) {\n super(src.status, src.error, src.message, src.headers, { cause: src })\n }\n}\n\nexport class InvalidDidError extends XRPCError {\n constructor(src: XRPCError) {\n super(src.status, src.error, src.message, src.headers, { cause: src })\n }\n}\n\nexport class InvalidPhoneError extends XRPCError {\n constructor(src: XRPCError) {\n super(src.status, src.error, src.message, src.headers, { cause: src })\n }\n}\n\nexport class InvalidCodeError extends XRPCError {\n constructor(src: XRPCError) {\n super(src.status, src.error, src.message, src.headers, { cause: src })\n }\n}\n\nexport class InternalError extends XRPCError {\n constructor(src: XRPCError) {\n super(src.status, src.error, src.message, src.headers, { cause: src })\n }\n}\n\nexport function toKnownErr(e: any) {\n if (e instanceof XRPCError) {\n if (e.error === 'RateLimitExceeded') return new RateLimitExceededError(e)\n if (e.error === 'InvalidDid') return new InvalidDidError(e)\n if (e.error === 'InvalidPhone') return new InvalidPhoneError(e)\n if (e.error === 'InvalidCode') return new InvalidCodeError(e)\n if (e.error === 'InternalError') return new InternalError(e)\n }\n\n return e\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/api",
3
- "version": "0.18.7",
3
+ "version": "0.18.8",
4
4
  "license": "MIT",
5
5
  "description": "Client library for atproto and Bluesky",
6
6
  "keywords": [
@@ -22,8 +22,8 @@
22
22
  "tlds": "^1.234.0",
23
23
  "zod": "^3.23.8",
24
24
  "@atproto/common-web": "^0.4.7",
25
- "@atproto/syntax": "^0.4.2",
26
25
  "@atproto/lexicon": "^0.6.0",
26
+ "@atproto/syntax": "^0.4.2",
27
27
  "@atproto/xrpc": "^0.7.7"
28
28
  },
29
29
  "devDependencies": {
@@ -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
  },
@@ -37,7 +37,13 @@ export interface Response {
37
37
  data: OutputSchema
38
38
  }
39
39
 
40
- export class TODOError extends XRPCError {
40
+ export class InvalidDidError extends XRPCError {
41
+ constructor(src: XRPCError) {
42
+ super(src.status, src.error, src.message, src.headers, { cause: src })
43
+ }
44
+ }
45
+
46
+ export class InternalError extends XRPCError {
41
47
  constructor(src: XRPCError) {
42
48
  super(src.status, src.error, src.message, src.headers, { cause: src })
43
49
  }
@@ -45,7 +51,8 @@ export class TODOError extends XRPCError {
45
51
 
46
52
  export function toKnownErr(e: any) {
47
53
  if (e instanceof XRPCError) {
48
- if (e.error === 'TODO') return new TODOError(e)
54
+ if (e.error === 'InvalidDid') return new InvalidDidError(e)
55
+ if (e.error === 'InternalError') return new InternalError(e)
49
56
  }
50
57
 
51
58
  return e
@@ -38,7 +38,25 @@ export interface Response {
38
38
  data: OutputSchema
39
39
  }
40
40
 
41
- export class TODOError extends XRPCError {
41
+ export class InvalidDidError extends XRPCError {
42
+ constructor(src: XRPCError) {
43
+ super(src.status, src.error, src.message, src.headers, { cause: src })
44
+ }
45
+ }
46
+
47
+ export class InvalidLimitError extends XRPCError {
48
+ constructor(src: XRPCError) {
49
+ super(src.status, src.error, src.message, src.headers, { cause: src })
50
+ }
51
+ }
52
+
53
+ export class InvalidCursorError extends XRPCError {
54
+ constructor(src: XRPCError) {
55
+ super(src.status, src.error, src.message, src.headers, { cause: src })
56
+ }
57
+ }
58
+
59
+ export class InternalError extends XRPCError {
42
60
  constructor(src: XRPCError) {
43
61
  super(src.status, src.error, src.message, src.headers, { cause: src })
44
62
  }
@@ -46,7 +64,10 @@ export class TODOError extends XRPCError {
46
64
 
47
65
  export function toKnownErr(e: any) {
48
66
  if (e instanceof XRPCError) {
49
- if (e.error === 'TODO') return new TODOError(e)
67
+ if (e.error === 'InvalidDid') return new InvalidDidError(e)
68
+ if (e.error === 'InvalidLimit') return new InvalidLimitError(e)
69
+ if (e.error === 'InvalidCursor') return new InvalidCursorError(e)
70
+ if (e.error === 'InternalError') return new InternalError(e)
50
71
  }
51
72
 
52
73
  return e
@@ -34,7 +34,13 @@ export interface Response {
34
34
  data: OutputSchema
35
35
  }
36
36
 
37
- export class TODOError extends XRPCError {
37
+ export class InvalidDidError extends XRPCError {
38
+ constructor(src: XRPCError) {
39
+ super(src.status, src.error, src.message, src.headers, { cause: src })
40
+ }
41
+ }
42
+
43
+ export class InternalError extends XRPCError {
38
44
  constructor(src: XRPCError) {
39
45
  super(src.status, src.error, src.message, src.headers, { cause: src })
40
46
  }
@@ -42,7 +48,8 @@ export class TODOError extends XRPCError {
42
48
 
43
49
  export function toKnownErr(e: any) {
44
50
  if (e instanceof XRPCError) {
45
- if (e.error === 'TODO') return new TODOError(e)
51
+ if (e.error === 'InvalidDid') return new InvalidDidError(e)
52
+ if (e.error === 'InternalError') return new InternalError(e)
46
53
  }
47
54
 
48
55
  return e
@@ -43,7 +43,31 @@ export interface Response {
43
43
  data: OutputSchema
44
44
  }
45
45
 
46
- export class TODOError extends XRPCError {
46
+ export class InvalidDidError extends XRPCError {
47
+ constructor(src: XRPCError) {
48
+ super(src.status, src.error, src.message, src.headers, { cause: src })
49
+ }
50
+ }
51
+
52
+ export class InvalidContactsError extends XRPCError {
53
+ constructor(src: XRPCError) {
54
+ super(src.status, src.error, src.message, src.headers, { cause: src })
55
+ }
56
+ }
57
+
58
+ export class TooManyContactsError extends XRPCError {
59
+ constructor(src: XRPCError) {
60
+ super(src.status, src.error, src.message, src.headers, { cause: src })
61
+ }
62
+ }
63
+
64
+ export class InvalidTokenError extends XRPCError {
65
+ constructor(src: XRPCError) {
66
+ super(src.status, src.error, src.message, src.headers, { cause: src })
67
+ }
68
+ }
69
+
70
+ export class InternalError extends XRPCError {
47
71
  constructor(src: XRPCError) {
48
72
  super(src.status, src.error, src.message, src.headers, { cause: src })
49
73
  }
@@ -51,7 +75,11 @@ export class TODOError extends XRPCError {
51
75
 
52
76
  export function toKnownErr(e: any) {
53
77
  if (e instanceof XRPCError) {
54
- if (e.error === 'TODO') return new TODOError(e)
78
+ if (e.error === 'InvalidDid') return new InvalidDidError(e)
79
+ if (e.error === 'InvalidContacts') return new InvalidContactsError(e)
80
+ if (e.error === 'TooManyContacts') return new TooManyContactsError(e)
81
+ if (e.error === 'InvalidToken') return new InvalidTokenError(e)
82
+ if (e.error === 'InternalError') return new InternalError(e)
55
83
  }
56
84
 
57
85
  return e
@@ -34,7 +34,13 @@ export interface Response {
34
34
  data: OutputSchema
35
35
  }
36
36
 
37
- export class TODOError extends XRPCError {
37
+ export class InvalidDidError extends XRPCError {
38
+ constructor(src: XRPCError) {
39
+ super(src.status, src.error, src.message, src.headers, { cause: src })
40
+ }
41
+ }
42
+
43
+ export class InternalError extends XRPCError {
38
44
  constructor(src: XRPCError) {
39
45
  super(src.status, src.error, src.message, src.headers, { cause: src })
40
46
  }
@@ -42,7 +48,8 @@ export class TODOError extends XRPCError {
42
48
 
43
49
  export function toKnownErr(e: any) {
44
50
  if (e instanceof XRPCError) {
45
- if (e.error === 'TODO') return new TODOError(e)
51
+ if (e.error === 'InvalidDid') return new InvalidDidError(e)
52
+ if (e.error === 'InternalError') return new InternalError(e)
46
53
  }
47
54
 
48
55
  return e
@@ -37,7 +37,25 @@ export interface Response {
37
37
  data: OutputSchema
38
38
  }
39
39
 
40
- export class TODOError extends XRPCError {
40
+ export class RateLimitExceededError extends XRPCError {
41
+ constructor(src: XRPCError) {
42
+ super(src.status, src.error, src.message, src.headers, { cause: src })
43
+ }
44
+ }
45
+
46
+ export class InvalidDidError extends XRPCError {
47
+ constructor(src: XRPCError) {
48
+ super(src.status, src.error, src.message, src.headers, { cause: src })
49
+ }
50
+ }
51
+
52
+ export class InvalidPhoneError extends XRPCError {
53
+ constructor(src: XRPCError) {
54
+ super(src.status, src.error, src.message, src.headers, { cause: src })
55
+ }
56
+ }
57
+
58
+ export class InternalError extends XRPCError {
41
59
  constructor(src: XRPCError) {
42
60
  super(src.status, src.error, src.message, src.headers, { cause: src })
43
61
  }
@@ -45,7 +63,10 @@ export class TODOError extends XRPCError {
45
63
 
46
64
  export function toKnownErr(e: any) {
47
65
  if (e instanceof XRPCError) {
48
- if (e.error === 'TODO') return new TODOError(e)
66
+ if (e.error === 'RateLimitExceeded') return new RateLimitExceededError(e)
67
+ if (e.error === 'InvalidDid') return new InvalidDidError(e)
68
+ if (e.error === 'InvalidPhone') return new InvalidPhoneError(e)
69
+ if (e.error === 'InternalError') return new InternalError(e)
49
70
  }
50
71
 
51
72
  return e
@@ -42,7 +42,31 @@ export interface Response {
42
42
  data: OutputSchema
43
43
  }
44
44
 
45
- export class TODOError extends XRPCError {
45
+ export class RateLimitExceededError extends XRPCError {
46
+ constructor(src: XRPCError) {
47
+ super(src.status, src.error, src.message, src.headers, { cause: src })
48
+ }
49
+ }
50
+
51
+ export class InvalidDidError extends XRPCError {
52
+ constructor(src: XRPCError) {
53
+ super(src.status, src.error, src.message, src.headers, { cause: src })
54
+ }
55
+ }
56
+
57
+ export class InvalidPhoneError extends XRPCError {
58
+ constructor(src: XRPCError) {
59
+ super(src.status, src.error, src.message, src.headers, { cause: src })
60
+ }
61
+ }
62
+
63
+ export class InvalidCodeError extends XRPCError {
64
+ constructor(src: XRPCError) {
65
+ super(src.status, src.error, src.message, src.headers, { cause: src })
66
+ }
67
+ }
68
+
69
+ export class InternalError extends XRPCError {
46
70
  constructor(src: XRPCError) {
47
71
  super(src.status, src.error, src.message, src.headers, { cause: src })
48
72
  }
@@ -50,7 +74,11 @@ export class TODOError extends XRPCError {
50
74
 
51
75
  export function toKnownErr(e: any) {
52
76
  if (e instanceof XRPCError) {
53
- if (e.error === 'TODO') return new TODOError(e)
77
+ if (e.error === 'RateLimitExceeded') return new RateLimitExceededError(e)
78
+ if (e.error === 'InvalidDid') return new InvalidDidError(e)
79
+ if (e.error === 'InvalidPhone') return new InvalidPhoneError(e)
80
+ if (e.error === 'InvalidCode') return new InvalidCodeError(e)
81
+ if (e.error === 'InternalError') return new InternalError(e)
54
82
  }
55
83
 
56
84
  return e