@atproto/pds 0.4.198 → 0.4.200
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 +23 -0
- package/dist/actor-store/preference/reader.d.ts.map +1 -1
- package/dist/actor-store/preference/reader.js +15 -2
- package/dist/actor-store/preference/reader.js.map +1 -1
- package/dist/actor-store/preference/transactor.d.ts.map +1 -1
- package/dist/actor-store/preference/transactor.js +3 -1
- package/dist/actor-store/preference/transactor.js.map +1 -1
- package/dist/actor-store/preference/util.d.ts +4 -0
- package/dist/actor-store/preference/util.d.ts.map +1 -1
- package/dist/actor-store/preference/util.js +20 -3
- package/dist/actor-store/preference/util.js.map +1 -1
- package/dist/api/com/atproto/server/createSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createSession.js +2 -2
- package/dist/api/com/atproto/server/createSession.js.map +1 -1
- package/dist/api/com/atproto/server/getSession.js +2 -2
- package/dist/api/com/atproto/server/getSession.js.map +1 -1
- package/dist/api/com/atproto/server/refreshSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/refreshSession.js +4 -2
- package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
- package/dist/lexicon/index.d.ts +2 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +4 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +286 -54
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +166 -25
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +13 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js +9 -0
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/defs.d.ts +10 -0
- package/dist/lexicon/types/app/bsky/contact/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/defs.js +9 -0
- package/dist/lexicon/types/app/bsky/contact/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/dismissMatch.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/dismissMatch.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/dismissMatch.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/getMatches.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/getMatches.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/getMatches.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/getSyncStatus.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/getSyncStatus.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/getSyncStatus.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/importContacts.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/importContacts.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/importContacts.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/removeData.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/removeData.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/removeData.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/sendNotification.d.ts +26 -0
- package/dist/lexicon/types/app/bsky/contact/sendNotification.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/contact/sendNotification.js +7 -0
- package/dist/lexicon/types/app/bsky/contact/sendNotification.js.map +1 -0
- package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/verifyPhone.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/verifyPhone.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/verifyPhone.js.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/lexicon/types/com/atproto/server/deleteSession.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/server/deleteSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/deleteSession.js.map +1 -1
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts +3 -3
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/getSession.js.map +1 -1
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +4 -1
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/refreshSession.js.map +1 -1
- package/package.json +10 -10
- package/src/actor-store/preference/reader.ts +27 -3
- package/src/actor-store/preference/transactor.ts +9 -7
- package/src/actor-store/preference/util.ts +21 -3
- package/src/api/com/atproto/server/createSession.ts +3 -2
- package/src/api/com/atproto/server/getSession.ts +2 -2
- package/src/api/com/atproto/server/refreshSession.ts +5 -2
- package/src/lexicon/index.ts +13 -0
- package/src/lexicon/lexicons.ts +173 -25
- package/src/lexicon/types/app/bsky/actor/defs.ts +22 -0
- package/src/lexicon/types/app/bsky/contact/defs.ts +19 -0
- package/src/lexicon/types/app/bsky/contact/dismissMatch.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/getMatches.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/getSyncStatus.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/importContacts.ts +6 -1
- package/src/lexicon/types/app/bsky/contact/removeData.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/sendNotification.ts +44 -0
- package/src/lexicon/types/app/bsky/contact/startPhoneVerification.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/verifyPhone.ts +6 -1
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +1 -0
- package/src/lexicon/types/com/atproto/server/deleteSession.ts +1 -0
- package/src/lexicon/types/com/atproto/server/getSession.ts +1 -1
- package/src/lexicon/types/com/atproto/server/refreshSession.ts +4 -1
- package/tests/_puppeteer.ts +87 -0
- package/tests/oauth.test.ts +54 -94
- package/tests/preferences.test.ts +96 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +1 -1
package/src/lexicon/lexicons.ts
CHANGED
|
@@ -401,6 +401,7 @@ export const schemaDict = {
|
|
|
401
401
|
'lex:app.bsky.actor.defs#savedFeedsPref',
|
|
402
402
|
'lex:app.bsky.actor.defs#savedFeedsPrefV2',
|
|
403
403
|
'lex:app.bsky.actor.defs#personalDetailsPref',
|
|
404
|
+
'lex:app.bsky.actor.defs#declaredAgePref',
|
|
404
405
|
'lex:app.bsky.actor.defs#feedViewPref',
|
|
405
406
|
'lex:app.bsky.actor.defs#threadViewPref',
|
|
406
407
|
'lex:app.bsky.actor.defs#interestsPref',
|
|
@@ -507,6 +508,28 @@ export const schemaDict = {
|
|
|
507
508
|
},
|
|
508
509
|
},
|
|
509
510
|
},
|
|
511
|
+
declaredAgePref: {
|
|
512
|
+
type: 'object',
|
|
513
|
+
description:
|
|
514
|
+
"Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration.",
|
|
515
|
+
properties: {
|
|
516
|
+
isOverAge13: {
|
|
517
|
+
type: 'boolean',
|
|
518
|
+
description:
|
|
519
|
+
'Indicates if the user has declared that they are over 13 years of age.',
|
|
520
|
+
},
|
|
521
|
+
isOverAge16: {
|
|
522
|
+
type: 'boolean',
|
|
523
|
+
description:
|
|
524
|
+
'Indicates if the user has declared that they are over 16 years of age.',
|
|
525
|
+
},
|
|
526
|
+
isOverAge18: {
|
|
527
|
+
type: 'boolean',
|
|
528
|
+
description:
|
|
529
|
+
'Indicates if the user has declared that they are over 18 years of age.',
|
|
530
|
+
},
|
|
531
|
+
},
|
|
532
|
+
},
|
|
510
533
|
feedViewPref: {
|
|
511
534
|
type: 'object',
|
|
512
535
|
required: ['feed'],
|
|
@@ -1776,6 +1799,24 @@ export const schemaDict = {
|
|
|
1776
1799
|
},
|
|
1777
1800
|
},
|
|
1778
1801
|
},
|
|
1802
|
+
notification: {
|
|
1803
|
+
description:
|
|
1804
|
+
'A stash object to be sent via bsync representing a notification to be created.',
|
|
1805
|
+
type: 'object',
|
|
1806
|
+
required: ['from', 'to'],
|
|
1807
|
+
properties: {
|
|
1808
|
+
from: {
|
|
1809
|
+
description: 'The DID of who this notification comes from.',
|
|
1810
|
+
type: 'string',
|
|
1811
|
+
format: 'did',
|
|
1812
|
+
},
|
|
1813
|
+
to: {
|
|
1814
|
+
description: 'The DID of who this notification should go to.',
|
|
1815
|
+
type: 'string',
|
|
1816
|
+
format: 'did',
|
|
1817
|
+
},
|
|
1818
|
+
},
|
|
1819
|
+
},
|
|
1779
1820
|
},
|
|
1780
1821
|
},
|
|
1781
1822
|
AppBskyContactDismissMatch: {
|
|
@@ -1785,7 +1826,7 @@ export const schemaDict = {
|
|
|
1785
1826
|
main: {
|
|
1786
1827
|
type: 'procedure',
|
|
1787
1828
|
description:
|
|
1788
|
-
"
|
|
1829
|
+
"Removes a match that was found via contact import. It shouldn't appear again if the same contact is re-imported. Requires authentication.",
|
|
1789
1830
|
input: {
|
|
1790
1831
|
encoding: 'application/json',
|
|
1791
1832
|
schema: {
|
|
@@ -1809,8 +1850,10 @@ export const schemaDict = {
|
|
|
1809
1850
|
},
|
|
1810
1851
|
errors: [
|
|
1811
1852
|
{
|
|
1812
|
-
name: '
|
|
1813
|
-
|
|
1853
|
+
name: 'InvalidDid',
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
name: 'InternalError',
|
|
1814
1857
|
},
|
|
1815
1858
|
],
|
|
1816
1859
|
},
|
|
@@ -1823,7 +1866,7 @@ export const schemaDict = {
|
|
|
1823
1866
|
main: {
|
|
1824
1867
|
type: 'query',
|
|
1825
1868
|
description:
|
|
1826
|
-
|
|
1869
|
+
'Returns the matched contacts (contacts that were mutually imported). Excludes dismissed matches. Requires authentication.',
|
|
1827
1870
|
parameters: {
|
|
1828
1871
|
type: 'params',
|
|
1829
1872
|
properties: {
|
|
@@ -1859,8 +1902,16 @@ export const schemaDict = {
|
|
|
1859
1902
|
},
|
|
1860
1903
|
errors: [
|
|
1861
1904
|
{
|
|
1862
|
-
name: '
|
|
1863
|
-
|
|
1905
|
+
name: 'InvalidDid',
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
name: 'InvalidLimit',
|
|
1909
|
+
},
|
|
1910
|
+
{
|
|
1911
|
+
name: 'InvalidCursor',
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
name: 'InternalError',
|
|
1864
1915
|
},
|
|
1865
1916
|
],
|
|
1866
1917
|
},
|
|
@@ -1873,7 +1924,7 @@ export const schemaDict = {
|
|
|
1873
1924
|
main: {
|
|
1874
1925
|
type: 'query',
|
|
1875
1926
|
description:
|
|
1876
|
-
"
|
|
1927
|
+
"Gets the user's current contact import status. Requires authentication.",
|
|
1877
1928
|
parameters: {
|
|
1878
1929
|
type: 'params',
|
|
1879
1930
|
properties: {},
|
|
@@ -1894,8 +1945,10 @@ export const schemaDict = {
|
|
|
1894
1945
|
},
|
|
1895
1946
|
errors: [
|
|
1896
1947
|
{
|
|
1897
|
-
name: '
|
|
1898
|
-
|
|
1948
|
+
name: 'InvalidDid',
|
|
1949
|
+
},
|
|
1950
|
+
{
|
|
1951
|
+
name: 'InternalError',
|
|
1899
1952
|
},
|
|
1900
1953
|
],
|
|
1901
1954
|
},
|
|
@@ -1908,7 +1961,7 @@ export const schemaDict = {
|
|
|
1908
1961
|
main: {
|
|
1909
1962
|
type: 'procedure',
|
|
1910
1963
|
description:
|
|
1911
|
-
|
|
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.',
|
|
1912
1965
|
input: {
|
|
1913
1966
|
encoding: 'application/json',
|
|
1914
1967
|
schema: {
|
|
@@ -1953,8 +2006,19 @@ export const schemaDict = {
|
|
|
1953
2006
|
},
|
|
1954
2007
|
errors: [
|
|
1955
2008
|
{
|
|
1956
|
-
name: '
|
|
1957
|
-
|
|
2009
|
+
name: 'InvalidDid',
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
name: 'InvalidContacts',
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
name: 'TooManyContacts',
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
name: 'InvalidToken',
|
|
2019
|
+
},
|
|
2020
|
+
{
|
|
2021
|
+
name: 'InternalError',
|
|
1958
2022
|
},
|
|
1959
2023
|
],
|
|
1960
2024
|
},
|
|
@@ -1967,7 +2031,7 @@ export const schemaDict = {
|
|
|
1967
2031
|
main: {
|
|
1968
2032
|
type: 'procedure',
|
|
1969
2033
|
description:
|
|
1970
|
-
|
|
2034
|
+
'Removes all stored hashes used for contact matching, existing matches, and sync status. Requires authentication.',
|
|
1971
2035
|
input: {
|
|
1972
2036
|
encoding: 'application/json',
|
|
1973
2037
|
schema: {
|
|
@@ -1984,13 +2048,52 @@ export const schemaDict = {
|
|
|
1984
2048
|
},
|
|
1985
2049
|
errors: [
|
|
1986
2050
|
{
|
|
1987
|
-
name: '
|
|
1988
|
-
|
|
2051
|
+
name: 'InvalidDid',
|
|
2052
|
+
},
|
|
2053
|
+
{
|
|
2054
|
+
name: 'InternalError',
|
|
1989
2055
|
},
|
|
1990
2056
|
],
|
|
1991
2057
|
},
|
|
1992
2058
|
},
|
|
1993
2059
|
},
|
|
2060
|
+
AppBskyContactSendNotification: {
|
|
2061
|
+
lexicon: 1,
|
|
2062
|
+
id: 'app.bsky.contact.sendNotification',
|
|
2063
|
+
defs: {
|
|
2064
|
+
main: {
|
|
2065
|
+
type: 'procedure',
|
|
2066
|
+
description:
|
|
2067
|
+
'System endpoint to send notifications related to contact imports. Requires role authentication.',
|
|
2068
|
+
input: {
|
|
2069
|
+
encoding: 'application/json',
|
|
2070
|
+
schema: {
|
|
2071
|
+
type: 'object',
|
|
2072
|
+
required: ['from', 'to'],
|
|
2073
|
+
properties: {
|
|
2074
|
+
from: {
|
|
2075
|
+
description: 'The DID of who this notification comes from.',
|
|
2076
|
+
type: 'string',
|
|
2077
|
+
format: 'did',
|
|
2078
|
+
},
|
|
2079
|
+
to: {
|
|
2080
|
+
description: 'The DID of who this notification should go to.',
|
|
2081
|
+
type: 'string',
|
|
2082
|
+
format: 'did',
|
|
2083
|
+
},
|
|
2084
|
+
},
|
|
2085
|
+
},
|
|
2086
|
+
},
|
|
2087
|
+
output: {
|
|
2088
|
+
encoding: 'application/json',
|
|
2089
|
+
schema: {
|
|
2090
|
+
type: 'object',
|
|
2091
|
+
properties: {},
|
|
2092
|
+
},
|
|
2093
|
+
},
|
|
2094
|
+
},
|
|
2095
|
+
},
|
|
2096
|
+
},
|
|
1994
2097
|
AppBskyContactStartPhoneVerification: {
|
|
1995
2098
|
lexicon: 1,
|
|
1996
2099
|
id: 'app.bsky.contact.startPhoneVerification',
|
|
@@ -1998,7 +2101,7 @@ export const schemaDict = {
|
|
|
1998
2101
|
main: {
|
|
1999
2102
|
type: 'procedure',
|
|
2000
2103
|
description:
|
|
2001
|
-
|
|
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.',
|
|
2002
2105
|
input: {
|
|
2003
2106
|
encoding: 'application/json',
|
|
2004
2107
|
schema: {
|
|
@@ -2021,8 +2124,16 @@ export const schemaDict = {
|
|
|
2021
2124
|
},
|
|
2022
2125
|
errors: [
|
|
2023
2126
|
{
|
|
2024
|
-
name: '
|
|
2025
|
-
|
|
2127
|
+
name: 'RateLimitExceeded',
|
|
2128
|
+
},
|
|
2129
|
+
{
|
|
2130
|
+
name: 'InvalidDid',
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
name: 'InvalidPhone',
|
|
2134
|
+
},
|
|
2135
|
+
{
|
|
2136
|
+
name: 'InternalError',
|
|
2026
2137
|
},
|
|
2027
2138
|
],
|
|
2028
2139
|
},
|
|
@@ -2035,7 +2146,7 @@ export const schemaDict = {
|
|
|
2035
2146
|
main: {
|
|
2036
2147
|
type: 'procedure',
|
|
2037
2148
|
description:
|
|
2038
|
-
|
|
2149
|
+
'Verifies control over a phone number with a code received via SMS and starts a contact import session. Requires authentication.',
|
|
2039
2150
|
input: {
|
|
2040
2151
|
encoding: 'application/json',
|
|
2041
2152
|
schema: {
|
|
@@ -2071,8 +2182,19 @@ export const schemaDict = {
|
|
|
2071
2182
|
},
|
|
2072
2183
|
errors: [
|
|
2073
2184
|
{
|
|
2074
|
-
name: '
|
|
2075
|
-
|
|
2185
|
+
name: 'RateLimitExceeded',
|
|
2186
|
+
},
|
|
2187
|
+
{
|
|
2188
|
+
name: 'InvalidDid',
|
|
2189
|
+
},
|
|
2190
|
+
{
|
|
2191
|
+
name: 'InvalidPhone',
|
|
2192
|
+
},
|
|
2193
|
+
{
|
|
2194
|
+
name: 'InvalidCode',
|
|
2195
|
+
},
|
|
2196
|
+
{
|
|
2197
|
+
name: 'InternalError',
|
|
2076
2198
|
},
|
|
2077
2199
|
],
|
|
2078
2200
|
},
|
|
@@ -6725,6 +6847,7 @@ export const schemaDict = {
|
|
|
6725
6847
|
'like-via-repost',
|
|
6726
6848
|
'repost-via-repost',
|
|
6727
6849
|
'subscribed-post',
|
|
6850
|
+
'contact-match',
|
|
6728
6851
|
],
|
|
6729
6852
|
},
|
|
6730
6853
|
reasonSubject: {
|
|
@@ -12896,7 +13019,16 @@ export const schemaDict = {
|
|
|
12896
13019
|
defs: {
|
|
12897
13020
|
main: {
|
|
12898
13021
|
type: 'procedure',
|
|
12899
|
-
description:
|
|
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
|
+
],
|
|
12900
13032
|
},
|
|
12901
13033
|
},
|
|
12902
13034
|
},
|
|
@@ -13095,6 +13227,9 @@ export const schemaDict = {
|
|
|
13095
13227
|
type: 'string',
|
|
13096
13228
|
format: 'did',
|
|
13097
13229
|
},
|
|
13230
|
+
didDoc: {
|
|
13231
|
+
type: 'unknown',
|
|
13232
|
+
},
|
|
13098
13233
|
email: {
|
|
13099
13234
|
type: 'string',
|
|
13100
13235
|
},
|
|
@@ -13104,9 +13239,6 @@ export const schemaDict = {
|
|
|
13104
13239
|
emailAuthFactor: {
|
|
13105
13240
|
type: 'boolean',
|
|
13106
13241
|
},
|
|
13107
|
-
didDoc: {
|
|
13108
|
-
type: 'unknown',
|
|
13109
|
-
},
|
|
13110
13242
|
active: {
|
|
13111
13243
|
type: 'boolean',
|
|
13112
13244
|
},
|
|
@@ -13200,6 +13332,15 @@ export const schemaDict = {
|
|
|
13200
13332
|
didDoc: {
|
|
13201
13333
|
type: 'unknown',
|
|
13202
13334
|
},
|
|
13335
|
+
email: {
|
|
13336
|
+
type: 'string',
|
|
13337
|
+
},
|
|
13338
|
+
emailConfirmed: {
|
|
13339
|
+
type: 'boolean',
|
|
13340
|
+
},
|
|
13341
|
+
emailAuthFactor: {
|
|
13342
|
+
type: 'boolean',
|
|
13343
|
+
},
|
|
13203
13344
|
active: {
|
|
13204
13345
|
type: 'boolean',
|
|
13205
13346
|
},
|
|
@@ -13216,6 +13357,12 @@ export const schemaDict = {
|
|
|
13216
13357
|
{
|
|
13217
13358
|
name: 'AccountTakedown',
|
|
13218
13359
|
},
|
|
13360
|
+
{
|
|
13361
|
+
name: 'InvalidToken',
|
|
13362
|
+
},
|
|
13363
|
+
{
|
|
13364
|
+
name: 'ExpiredToken',
|
|
13365
|
+
},
|
|
13219
13366
|
],
|
|
13220
13367
|
},
|
|
13221
13368
|
},
|
|
@@ -19949,6 +20096,7 @@ export const ids = {
|
|
|
19949
20096
|
AppBskyContactGetSyncStatus: 'app.bsky.contact.getSyncStatus',
|
|
19950
20097
|
AppBskyContactImportContacts: 'app.bsky.contact.importContacts',
|
|
19951
20098
|
AppBskyContactRemoveData: 'app.bsky.contact.removeData',
|
|
20099
|
+
AppBskyContactSendNotification: 'app.bsky.contact.sendNotification',
|
|
19952
20100
|
AppBskyContactStartPhoneVerification:
|
|
19953
20101
|
'app.bsky.contact.startPhoneVerification',
|
|
19954
20102
|
AppBskyContactVerifyPhone: 'app.bsky.contact.verifyPhone',
|
|
@@ -259,6 +259,7 @@ export type Preferences = (
|
|
|
259
259
|
| $Typed<SavedFeedsPref>
|
|
260
260
|
| $Typed<SavedFeedsPrefV2>
|
|
261
261
|
| $Typed<PersonalDetailsPref>
|
|
262
|
+
| $Typed<DeclaredAgePref>
|
|
262
263
|
| $Typed<FeedViewPref>
|
|
263
264
|
| $Typed<ThreadViewPref>
|
|
264
265
|
| $Typed<InterestsPref>
|
|
@@ -370,6 +371,27 @@ export function validatePersonalDetailsPref<V>(v: V) {
|
|
|
370
371
|
return validate<PersonalDetailsPref & V>(v, id, hashPersonalDetailsPref)
|
|
371
372
|
}
|
|
372
373
|
|
|
374
|
+
/** Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration. */
|
|
375
|
+
export interface DeclaredAgePref {
|
|
376
|
+
$type?: 'app.bsky.actor.defs#declaredAgePref'
|
|
377
|
+
/** Indicates if the user has declared that they are over 13 years of age. */
|
|
378
|
+
isOverAge13?: boolean
|
|
379
|
+
/** Indicates if the user has declared that they are over 16 years of age. */
|
|
380
|
+
isOverAge16?: boolean
|
|
381
|
+
/** Indicates if the user has declared that they are over 18 years of age. */
|
|
382
|
+
isOverAge18?: boolean
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const hashDeclaredAgePref = 'declaredAgePref'
|
|
386
|
+
|
|
387
|
+
export function isDeclaredAgePref<V>(v: V) {
|
|
388
|
+
return is$typed(v, id, hashDeclaredAgePref)
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export function validateDeclaredAgePref<V>(v: V) {
|
|
392
|
+
return validate<DeclaredAgePref & V>(v, id, hashDeclaredAgePref)
|
|
393
|
+
}
|
|
394
|
+
|
|
373
395
|
export interface FeedViewPref {
|
|
374
396
|
$type?: 'app.bsky.actor.defs#feedViewPref'
|
|
375
397
|
/** The URI of the feed, or an identifier which describes the feed. */
|
|
@@ -50,3 +50,22 @@ export function isSyncStatus<V>(v: V) {
|
|
|
50
50
|
export function validateSyncStatus<V>(v: V) {
|
|
51
51
|
return validate<SyncStatus & V>(v, id, hashSyncStatus)
|
|
52
52
|
}
|
|
53
|
+
|
|
54
|
+
/** A stash object to be sent via bsync representing a notification to be created. */
|
|
55
|
+
export interface Notification {
|
|
56
|
+
$type?: 'app.bsky.contact.defs#notification'
|
|
57
|
+
/** The DID of who this notification comes from. */
|
|
58
|
+
from: string
|
|
59
|
+
/** The DID of who this notification should go to. */
|
|
60
|
+
to: string
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const hashNotification = 'notification'
|
|
64
|
+
|
|
65
|
+
export function isNotification<V>(v: V) {
|
|
66
|
+
return is$typed(v, id, hashNotification)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function validateNotification<V>(v: V) {
|
|
70
|
+
return validate<Notification & V>(v, id, hashNotification)
|
|
71
|
+
}
|
|
@@ -37,7 +37,7 @@ export interface HandlerSuccess {
|
|
|
37
37
|
export interface HandlerError {
|
|
38
38
|
status: number
|
|
39
39
|
message?: string
|
|
40
|
-
error?: '
|
|
40
|
+
error?: 'InvalidDid' | 'InvalidLimit' | 'InvalidCursor' | 'InternalError'
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
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?:
|
|
46
|
+
error?:
|
|
47
|
+
| 'InvalidDid'
|
|
48
|
+
| 'InvalidContacts'
|
|
49
|
+
| 'TooManyContacts'
|
|
50
|
+
| 'InvalidToken'
|
|
51
|
+
| 'InternalError'
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
|
|
13
|
+
const is$typed = _is$typed,
|
|
14
|
+
validate = _validate
|
|
15
|
+
const id = 'app.bsky.contact.sendNotification'
|
|
16
|
+
|
|
17
|
+
export type QueryParams = {}
|
|
18
|
+
|
|
19
|
+
export interface InputSchema {
|
|
20
|
+
/** The DID of who this notification comes from. */
|
|
21
|
+
from: string
|
|
22
|
+
/** The DID of who this notification should go to. */
|
|
23
|
+
to: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface OutputSchema {}
|
|
27
|
+
|
|
28
|
+
export interface HandlerInput {
|
|
29
|
+
encoding: 'application/json'
|
|
30
|
+
body: InputSchema
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface HandlerSuccess {
|
|
34
|
+
encoding: 'application/json'
|
|
35
|
+
body: OutputSchema
|
|
36
|
+
headers?: { [key: string]: string }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface HandlerError {
|
|
40
|
+
status: number
|
|
41
|
+
message?: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
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?: '
|
|
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?:
|
|
45
|
+
error?:
|
|
46
|
+
| 'RateLimitExceeded'
|
|
47
|
+
| 'InvalidDid'
|
|
48
|
+
| 'InvalidPhone'
|
|
49
|
+
| 'InvalidCode'
|
|
50
|
+
| 'InternalError'
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -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
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import assert from 'node:assert'
|
|
2
|
+
import { type Browser, type Page } from 'puppeteer'
|
|
3
|
+
|
|
4
|
+
export class PageHelper implements AsyncDisposable {
|
|
5
|
+
constructor(protected readonly page: Page) {}
|
|
6
|
+
|
|
7
|
+
async goto(url: string) {
|
|
8
|
+
await this.page.goto(url)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async waitForNetworkIdle() {
|
|
12
|
+
await this.page.waitForNetworkIdle()
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async navigationAction(run: () => Promise<unknown>): Promise<void> {
|
|
16
|
+
const promise = this.page.waitForNavigation()
|
|
17
|
+
await run()
|
|
18
|
+
await promise
|
|
19
|
+
await this.waitForNetworkIdle()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async checkTitle(expected: string) {
|
|
23
|
+
await this.waitForNetworkIdle()
|
|
24
|
+
await expect(this.page.title()).resolves.toBe(expected)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async clickOn(selector: string) {
|
|
28
|
+
const elementHandle = await this.getVisibleElement(selector)
|
|
29
|
+
await elementHandle.click()
|
|
30
|
+
return elementHandle
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async clickOnButton(text: string) {
|
|
34
|
+
return this.clickOn(`button::-p-text(${JSON.stringify(text)})`)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async typeIn(selector: string, text: string) {
|
|
38
|
+
const elementHandle = await this.getVisibleElement(selector)
|
|
39
|
+
elementHandle.focus()
|
|
40
|
+
await elementHandle.type(text)
|
|
41
|
+
return elementHandle
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async typeInInput(name: string, text: string) {
|
|
45
|
+
return this.typeIn(`input[name=${JSON.stringify(name)}]`, text)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async ensureTextVisibility(text: string, tag = 'p') {
|
|
49
|
+
await this.page.waitForSelector(`${tag}::-p-text(${JSON.stringify(text)})`)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
protected async getVisibleElement(selector: string) {
|
|
53
|
+
const elementHandle = await this.page.waitForSelector(selector)
|
|
54
|
+
|
|
55
|
+
expect(elementHandle).not.toBeNull()
|
|
56
|
+
assert(elementHandle)
|
|
57
|
+
|
|
58
|
+
await expect(elementHandle.isVisible()).resolves.toBe(true)
|
|
59
|
+
|
|
60
|
+
return elementHandle
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async [Symbol.asyncDispose]() {
|
|
64
|
+
return this.page.close()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static async from(
|
|
68
|
+
browser: Browser,
|
|
69
|
+
options?: { languages?: readonly string[] },
|
|
70
|
+
) {
|
|
71
|
+
const page = await browser.newPage()
|
|
72
|
+
|
|
73
|
+
if (options?.languages?.length) {
|
|
74
|
+
// Spoof navigator language settings
|
|
75
|
+
await page.evaluateOnNewDocument(`
|
|
76
|
+
Object.defineProperty(navigator, 'languages', {
|
|
77
|
+
get: () => ${JSON.stringify(options.languages)},
|
|
78
|
+
})
|
|
79
|
+
Object.defineProperty(navigator, 'language', {
|
|
80
|
+
get: () => ${JSON.stringify(options.languages[0])},
|
|
81
|
+
})
|
|
82
|
+
`)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return new PageHelper(page)
|
|
86
|
+
}
|
|
87
|
+
}
|