@atproto/pds 0.4.77 → 0.4.79

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 (117) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/account-manager/helpers/auth.d.ts +1 -1
  3. package/dist/account-manager/helpers/auth.d.ts.map +1 -1
  4. package/dist/account-manager/helpers/auth.js +3 -1
  5. package/dist/account-manager/helpers/auth.js.map +1 -1
  6. package/dist/account-manager/index.d.ts +2 -1
  7. package/dist/account-manager/index.d.ts.map +1 -1
  8. package/dist/account-manager/index.js +13 -8
  9. package/dist/account-manager/index.js.map +1 -1
  10. package/dist/api/app/bsky/actor/getPreferences.d.ts.map +1 -1
  11. package/dist/api/app/bsky/actor/getPreferences.js +4 -1
  12. package/dist/api/app/bsky/actor/getPreferences.js.map +1 -1
  13. package/dist/api/com/atproto/identity/requestPlcOperationSignature.d.ts.map +1 -1
  14. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js +2 -1
  15. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js.map +1 -1
  16. package/dist/api/com/atproto/index.d.ts.map +1 -1
  17. package/dist/api/com/atproto/index.js +2 -0
  18. package/dist/api/com/atproto/index.js.map +1 -1
  19. package/dist/api/com/atproto/moderation/createReport.d.ts +4 -0
  20. package/dist/api/com/atproto/moderation/createReport.d.ts.map +1 -0
  21. package/dist/api/com/atproto/moderation/createReport.js +28 -0
  22. package/dist/api/com/atproto/moderation/createReport.js.map +1 -0
  23. package/dist/api/com/atproto/moderation/index.d.ts +4 -0
  24. package/dist/api/com/atproto/moderation/index.d.ts.map +1 -0
  25. package/dist/api/com/atproto/moderation/index.js +11 -0
  26. package/dist/api/com/atproto/moderation/index.js.map +1 -0
  27. package/dist/api/com/atproto/server/createSession.d.ts.map +1 -1
  28. package/dist/api/com/atproto/server/createSession.js +6 -2
  29. package/dist/api/com/atproto/server/createSession.js.map +1 -1
  30. package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
  31. package/dist/api/com/atproto/server/deactivateAccount.js +2 -1
  32. package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
  33. package/dist/api/com/atproto/server/getServiceAuth.d.ts.map +1 -1
  34. package/dist/api/com/atproto/server/getServiceAuth.js +10 -1
  35. package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
  36. package/dist/api/com/atproto/sync/deprecated/getCheckout.js +1 -1
  37. package/dist/api/com/atproto/sync/deprecated/getCheckout.js.map +1 -1
  38. package/dist/api/com/atproto/sync/deprecated/getHead.js +1 -1
  39. package/dist/api/com/atproto/sync/deprecated/getHead.js.map +1 -1
  40. package/dist/api/com/atproto/sync/getBlob.d.ts.map +1 -1
  41. package/dist/api/com/atproto/sync/getBlob.js +4 -1
  42. package/dist/api/com/atproto/sync/getBlob.js.map +1 -1
  43. package/dist/api/com/atproto/sync/getBlocks.js +1 -1
  44. package/dist/api/com/atproto/sync/getBlocks.js.map +1 -1
  45. package/dist/api/com/atproto/sync/getLatestCommit.js +1 -1
  46. package/dist/api/com/atproto/sync/getLatestCommit.js.map +1 -1
  47. package/dist/api/com/atproto/sync/getRecord.js +1 -1
  48. package/dist/api/com/atproto/sync/getRecord.js.map +1 -1
  49. package/dist/api/com/atproto/sync/getRepo.d.ts.map +1 -1
  50. package/dist/api/com/atproto/sync/getRepo.js +4 -1
  51. package/dist/api/com/atproto/sync/getRepo.js.map +1 -1
  52. package/dist/api/com/atproto/sync/listBlobs.d.ts.map +1 -1
  53. package/dist/api/com/atproto/sync/listBlobs.js +4 -1
  54. package/dist/api/com/atproto/sync/listBlobs.js.map +1 -1
  55. package/dist/auth-verifier.d.ts +3 -2
  56. package/dist/auth-verifier.d.ts.map +1 -1
  57. package/dist/auth-verifier.js +3 -2
  58. package/dist/auth-verifier.js.map +1 -1
  59. package/dist/basic-routes.d.ts.map +1 -1
  60. package/dist/basic-routes.js +20 -1
  61. package/dist/basic-routes.js.map +1 -1
  62. package/dist/lexicon/index.d.ts +2 -2
  63. package/dist/lexicon/index.d.ts.map +1 -1
  64. package/dist/lexicon/lexicons.d.ts +36 -0
  65. package/dist/lexicon/lexicons.d.ts.map +1 -1
  66. package/dist/lexicon/lexicons.js +18 -0
  67. package/dist/lexicon/lexicons.js.map +1 -1
  68. package/dist/lexicon/types/com/atproto/server/createSession.d.ts +2 -0
  69. package/dist/lexicon/types/com/atproto/server/createSession.d.ts.map +1 -1
  70. package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.d.ts +6 -0
  71. package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.d.ts.map +1 -1
  72. package/dist/pipethrough.d.ts +4 -0
  73. package/dist/pipethrough.d.ts.map +1 -1
  74. package/dist/pipethrough.js +1 -0
  75. package/dist/pipethrough.js.map +1 -1
  76. package/package.json +5 -5
  77. package/src/account-manager/helpers/auth.ts +5 -1
  78. package/src/account-manager/index.ts +14 -11
  79. package/src/api/app/bsky/actor/getPreferences.ts +4 -1
  80. package/src/api/com/atproto/identity/requestPlcOperationSignature.ts +2 -1
  81. package/src/api/com/atproto/index.ts +2 -0
  82. package/src/api/com/atproto/moderation/createReport.ts +36 -0
  83. package/src/api/com/atproto/moderation/index.ts +7 -0
  84. package/src/api/com/atproto/server/createSession.ts +11 -2
  85. package/src/api/com/atproto/server/deactivateAccount.ts +2 -1
  86. package/src/api/com/atproto/server/getServiceAuth.ts +14 -1
  87. package/src/api/com/atproto/sync/deprecated/getCheckout.ts +1 -1
  88. package/src/api/com/atproto/sync/deprecated/getHead.ts +1 -1
  89. package/src/api/com/atproto/sync/getBlob.ts +4 -1
  90. package/src/api/com/atproto/sync/getBlocks.ts +1 -1
  91. package/src/api/com/atproto/sync/getLatestCommit.ts +1 -1
  92. package/src/api/com/atproto/sync/getRecord.ts +1 -1
  93. package/src/api/com/atproto/sync/getRepo.ts +4 -1
  94. package/src/api/com/atproto/sync/listBlobs.ts +4 -1
  95. package/src/auth-verifier.ts +13 -10
  96. package/src/basic-routes.ts +20 -3
  97. package/src/lexicon/index.ts +2 -2
  98. package/src/lexicon/lexicons.ts +22 -0
  99. package/src/lexicon/types/com/atproto/server/createSession.ts +2 -0
  100. package/src/lexicon/types/tools/ozone/moderation/queryStatuses.ts +6 -0
  101. package/src/pipethrough.ts +1 -2
  102. package/tests/__snapshots__/takedown-appeal.test.ts.snap +30 -0
  103. package/tests/account-deactivation.test.ts +1 -1
  104. package/tests/account-migration.test.ts +3 -3
  105. package/tests/auth.test.ts +10 -11
  106. package/tests/blob-deletes.test.ts +8 -8
  107. package/tests/crud.test.ts +4 -12
  108. package/tests/file-uploads.test.ts +5 -11
  109. package/tests/moderation.test.ts +1 -1
  110. package/tests/proxied/__snapshots__/admin.test.ts.snap +32 -7
  111. package/tests/proxied/__snapshots__/feedgen.test.ts.snap +4 -4
  112. package/tests/proxied/__snapshots__/views.test.ts.snap +32 -32
  113. package/tests/proxied/read-after-write.test.ts +2 -2
  114. package/tests/seeds/basic.ts +3 -3
  115. package/tests/takedown-appeal.test.ts +157 -0
  116. package/tsconfig.build.tsbuildinfo +1 -1
  117. package/tsconfig.tests.tsbuildinfo +1 -1
@@ -484,7 +484,7 @@ Object {
484
484
  "$type": "app.bsky.embed.images#view",
485
485
  "images": Array [
486
486
  Object {
487
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
487
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
488
488
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(1)/cids(2)@jpeg",
489
489
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(1)/cids(2)@jpeg",
490
490
  },
@@ -501,7 +501,7 @@ Object {
501
501
  "$type": "app.bsky.embed.images",
502
502
  "images": Array [
503
503
  Object {
504
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
504
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
505
505
  "image": Object {
506
506
  "$type": "blob",
507
507
  "mimeType": "image/jpeg",
@@ -972,7 +972,7 @@ Object {
972
972
  "$type": "app.bsky.embed.images#view",
973
973
  "images": Array [
974
974
  Object {
975
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
975
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
976
976
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(3)/cids(5)@jpeg",
977
977
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(3)/cids(5)@jpeg",
978
978
  },
@@ -989,7 +989,7 @@ Object {
989
989
  "$type": "app.bsky.embed.images",
990
990
  "images": Array [
991
991
  Object {
992
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
992
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
993
993
  "image": Object {
994
994
  "$type": "blob",
995
995
  "mimeType": "image/jpeg",
@@ -1091,7 +1091,7 @@ Object {
1091
1091
  "$type": "app.bsky.embed.images#view",
1092
1092
  "images": Array [
1093
1093
  Object {
1094
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
1094
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
1095
1095
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(3)/cids(5)@jpeg",
1096
1096
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(3)/cids(5)@jpeg",
1097
1097
  },
@@ -1108,7 +1108,7 @@ Object {
1108
1108
  "$type": "app.bsky.embed.images",
1109
1109
  "images": Array [
1110
1110
  Object {
1111
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
1111
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
1112
1112
  "image": Object {
1113
1113
  "$type": "blob",
1114
1114
  "mimeType": "image/jpeg",
@@ -1322,7 +1322,7 @@ Object {
1322
1322
  "$type": "app.bsky.embed.images",
1323
1323
  "images": Array [
1324
1324
  Object {
1325
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
1325
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
1326
1326
  "image": Object {
1327
1327
  "$type": "blob",
1328
1328
  "mimeType": "image/jpeg",
@@ -1333,7 +1333,7 @@ Object {
1333
1333
  },
1334
1334
  },
1335
1335
  Object {
1336
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
1336
+ "alt": "../dev-env/assets/key-alt.jpg",
1337
1337
  "image": Object {
1338
1338
  "$type": "blob",
1339
1339
  "mimeType": "image/jpeg",
@@ -1666,12 +1666,12 @@ Object {
1666
1666
  "$type": "app.bsky.embed.images#view",
1667
1667
  "images": Array [
1668
1668
  Object {
1669
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
1669
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
1670
1670
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(3)/cids(3)@jpeg",
1671
1671
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(3)/cids(3)@jpeg",
1672
1672
  },
1673
1673
  Object {
1674
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
1674
+ "alt": "../dev-env/assets/key-alt.jpg",
1675
1675
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(3)/cids(4)@jpeg",
1676
1676
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(3)/cids(4)@jpeg",
1677
1677
  },
@@ -1728,7 +1728,7 @@ Object {
1728
1728
  "$type": "app.bsky.embed.images",
1729
1729
  "images": Array [
1730
1730
  Object {
1731
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
1731
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
1732
1732
  "image": Object {
1733
1733
  "$type": "blob",
1734
1734
  "mimeType": "image/jpeg",
@@ -1739,7 +1739,7 @@ Object {
1739
1739
  },
1740
1740
  },
1741
1741
  Object {
1742
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
1742
+ "alt": "../dev-env/assets/key-alt.jpg",
1743
1743
  "image": Object {
1744
1744
  "$type": "blob",
1745
1745
  "mimeType": "image/jpeg",
@@ -1924,7 +1924,7 @@ Object {
1924
1924
  "$type": "app.bsky.embed.images#view",
1925
1925
  "images": Array [
1926
1926
  Object {
1927
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
1927
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
1928
1928
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(4)/cids(5)@jpeg",
1929
1929
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(4)/cids(5)@jpeg",
1930
1930
  },
@@ -1941,7 +1941,7 @@ Object {
1941
1941
  "$type": "app.bsky.embed.images",
1942
1942
  "images": Array [
1943
1943
  Object {
1944
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
1944
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
1945
1945
  "image": Object {
1946
1946
  "$type": "blob",
1947
1947
  "mimeType": "image/jpeg",
@@ -2134,12 +2134,12 @@ Object {
2134
2134
  "$type": "app.bsky.embed.images#view",
2135
2135
  "images": Array [
2136
2136
  Object {
2137
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
2137
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
2138
2138
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(5)@jpeg",
2139
2139
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(5)@jpeg",
2140
2140
  },
2141
2141
  Object {
2142
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
2142
+ "alt": "../dev-env/assets/key-alt.jpg",
2143
2143
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(8)@jpeg",
2144
2144
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(8)@jpeg",
2145
2145
  },
@@ -2199,7 +2199,7 @@ Object {
2199
2199
  "$type": "app.bsky.embed.images",
2200
2200
  "images": Array [
2201
2201
  Object {
2202
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
2202
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
2203
2203
  "image": Object {
2204
2204
  "$type": "blob",
2205
2205
  "mimeType": "image/jpeg",
@@ -2210,7 +2210,7 @@ Object {
2210
2210
  },
2211
2211
  },
2212
2212
  Object {
2213
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
2213
+ "alt": "../dev-env/assets/key-alt.jpg",
2214
2214
  "image": Object {
2215
2215
  "$type": "blob",
2216
2216
  "mimeType": "image/jpeg",
@@ -2393,7 +2393,7 @@ Object {
2393
2393
  "$type": "app.bsky.embed.images#view",
2394
2394
  "images": Array [
2395
2395
  Object {
2396
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
2396
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
2397
2397
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(4)/cids(5)@jpeg",
2398
2398
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(4)/cids(5)@jpeg",
2399
2399
  },
@@ -2410,7 +2410,7 @@ Object {
2410
2410
  "$type": "app.bsky.embed.images",
2411
2411
  "images": Array [
2412
2412
  Object {
2413
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
2413
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
2414
2414
  "image": Object {
2415
2415
  "$type": "blob",
2416
2416
  "mimeType": "image/jpeg",
@@ -2650,7 +2650,7 @@ Object {
2650
2650
  "$type": "app.bsky.embed.images#view",
2651
2651
  "images": Array [
2652
2652
  Object {
2653
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
2653
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
2654
2654
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(4)/cids(5)@jpeg",
2655
2655
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(4)/cids(5)@jpeg",
2656
2656
  },
@@ -2667,7 +2667,7 @@ Object {
2667
2667
  "$type": "app.bsky.embed.images",
2668
2668
  "images": Array [
2669
2669
  Object {
2670
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
2670
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
2671
2671
  "image": Object {
2672
2672
  "$type": "blob",
2673
2673
  "mimeType": "image/jpeg",
@@ -2881,7 +2881,7 @@ Object {
2881
2881
  "$type": "app.bsky.embed.images",
2882
2882
  "images": Array [
2883
2883
  Object {
2884
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
2884
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
2885
2885
  "image": Object {
2886
2886
  "$type": "blob",
2887
2887
  "mimeType": "image/jpeg",
@@ -2892,7 +2892,7 @@ Object {
2892
2892
  },
2893
2893
  },
2894
2894
  Object {
2895
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
2895
+ "alt": "../dev-env/assets/key-alt.jpg",
2896
2896
  "image": Object {
2897
2897
  "$type": "blob",
2898
2898
  "mimeType": "image/jpeg",
@@ -3102,12 +3102,12 @@ Object {
3102
3102
  "$type": "app.bsky.embed.images#view",
3103
3103
  "images": Array [
3104
3104
  Object {
3105
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
3105
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
3106
3106
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(5)@jpeg",
3107
3107
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(5)@jpeg",
3108
3108
  },
3109
3109
  Object {
3110
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
3110
+ "alt": "../dev-env/assets/key-alt.jpg",
3111
3111
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(8)@jpeg",
3112
3112
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(8)@jpeg",
3113
3113
  },
@@ -3167,7 +3167,7 @@ Object {
3167
3167
  "$type": "app.bsky.embed.images",
3168
3168
  "images": Array [
3169
3169
  Object {
3170
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
3170
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
3171
3171
  "image": Object {
3172
3172
  "$type": "blob",
3173
3173
  "mimeType": "image/jpeg",
@@ -3178,7 +3178,7 @@ Object {
3178
3178
  },
3179
3179
  },
3180
3180
  Object {
3181
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
3181
+ "alt": "../dev-env/assets/key-alt.jpg",
3182
3182
  "image": Object {
3183
3183
  "$type": "blob",
3184
3184
  "mimeType": "image/jpeg",
@@ -3298,12 +3298,12 @@ Object {
3298
3298
  "$type": "app.bsky.embed.images#view",
3299
3299
  "images": Array [
3300
3300
  Object {
3301
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
3301
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
3302
3302
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(5)@jpeg",
3303
3303
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(5)@jpeg",
3304
3304
  },
3305
3305
  Object {
3306
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
3306
+ "alt": "../dev-env/assets/key-alt.jpg",
3307
3307
  "fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(8)@jpeg",
3308
3308
  "thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(8)@jpeg",
3309
3309
  },
@@ -3360,7 +3360,7 @@ Object {
3360
3360
  "$type": "app.bsky.embed.images",
3361
3361
  "images": Array [
3362
3362
  Object {
3363
- "alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
3363
+ "alt": "../dev-env/assets/key-landscape-small.jpg",
3364
3364
  "image": Object {
3365
3365
  "$type": "blob",
3366
3366
  "mimeType": "image/jpeg",
@@ -3371,7 +3371,7 @@ Object {
3371
3371
  },
3372
3372
  },
3373
3373
  Object {
3374
- "alt": "../dev-env/src/seed/img/key-alt.jpg",
3374
+ "alt": "../dev-env/assets/key-alt.jpg",
3375
3375
  "image": Object {
3376
3376
  "$type": "blob",
3377
3377
  "mimeType": "image/jpeg",
@@ -48,7 +48,7 @@ describe('proxy read after write', () => {
48
48
  assert(network.pds.ctx.cfg.bskyAppView)
49
49
  const blob = await sc.uploadFile(
50
50
  alice,
51
- '../dev-env/src/seed/img/key-landscape-small.jpg',
51
+ '../dev-env/assets/key-landscape-small.jpg',
52
52
  'image/jpeg',
53
53
  )
54
54
  await sc.updateProfile(alice, { displayName: 'blah', avatar: blob.image })
@@ -148,7 +148,7 @@ describe('proxy read after write', () => {
148
148
  assert(network.pds.ctx.cfg.bskyAppView)
149
149
  const img = await sc.uploadFile(
150
150
  alice,
151
- '../dev-env/src/seed/img/key-landscape-small.jpg',
151
+ '../dev-env/assets/key-landscape-small.jpg',
152
152
  'image/jpeg',
153
153
  )
154
154
  const replyRes1 = await agent.api.app.bsky.feed.post.create(
@@ -37,12 +37,12 @@ export default async (
37
37
  })
38
38
  const img1 = await sc.uploadFile(
39
39
  carol,
40
- '../dev-env/src/seed/img/key-landscape-small.jpg',
40
+ '../dev-env/assets/key-landscape-small.jpg',
41
41
  'image/jpeg',
42
42
  )
43
43
  const img2 = await sc.uploadFile(
44
44
  carol,
45
- '../dev-env/src/seed/img/key-alt.jpg',
45
+ '../dev-env/assets/key-alt.jpg',
46
46
  'image/jpeg',
47
47
  )
48
48
  await sc.post(
@@ -103,7 +103,7 @@ export default async (
103
103
 
104
104
  const replyImg = await sc.uploadFile(
105
105
  bob,
106
- '../dev-env/src/seed/img/key-landscape-small.jpg',
106
+ '../dev-env/assets/key-landscape-small.jpg',
107
107
  'image/jpeg',
108
108
  )
109
109
  // must ensure ordering of replies in indexing
@@ -0,0 +1,157 @@
1
+ import { AtpAgent, ComAtprotoModerationDefs } from '@atproto/api'
2
+ import { SeedClient, TestNetwork } from '@atproto/dev-env'
3
+ import { forSnapshot } from './_util'
4
+ import { ids } from '../src/lexicon/lexicons'
5
+
6
+ describe('appeal account takedown', () => {
7
+ let network: TestNetwork
8
+ let agent: AtpAgent
9
+ let sc: SeedClient
10
+ let moderator: string
11
+
12
+ beforeAll(async () => {
13
+ network = await TestNetwork.create({
14
+ dbPostgresSchema: 'takedown_appeal',
15
+ })
16
+ sc = network.getSeedClient()
17
+ const modAccount = await sc.createAccount('moderator', {
18
+ handle: 'testmod.test',
19
+ email: 'testmod@test.com',
20
+ password: 'testmod-pass',
21
+ })
22
+ moderator = modAccount.did
23
+ await network.ozone.addModeratorDid(moderator)
24
+
25
+ agent = network.pds.getClient()
26
+ })
27
+
28
+ afterAll(async () => {
29
+ await network.close()
30
+ })
31
+
32
+ it('actor takedown allows appeal request.', async () => {
33
+ const { data: account } = await agent.com.atproto.server.createAccount({
34
+ handle: 'jeff.test',
35
+ email: 'jeff@test.com',
36
+ password: 'password',
37
+ })
38
+
39
+ // Emit a takedown event
40
+ await network.ozone.getModClient().performTakedown({
41
+ subject: {
42
+ $type: 'com.atproto.admin.defs#repoRef',
43
+ did: account.did,
44
+ },
45
+ })
46
+
47
+ // Manually set the account as takendown at the PDS level
48
+ // since the takedown event only propagates when the daemon is running
49
+ await agent.com.atproto.admin.updateSubjectStatus(
50
+ {
51
+ subject: {
52
+ $type: 'com.atproto.admin.defs#repoRef',
53
+ did: account.did,
54
+ },
55
+ takedown: { applied: true },
56
+ },
57
+ {
58
+ encoding: 'application/json',
59
+ headers: { authorization: network.pds.adminAuth() },
60
+ },
61
+ )
62
+
63
+ // Verify user can not get session token without setting the optional param
64
+ await expect(
65
+ agent.com.atproto.server.createSession({
66
+ identifier: 'jeff.test',
67
+ password: 'password',
68
+ }),
69
+ ).rejects.toThrow('Account has been taken down')
70
+
71
+ const { data: auth } = await agent.com.atproto.server.createSession({
72
+ identifier: 'jeff.test',
73
+ password: 'password',
74
+ allowTakendown: true,
75
+ })
76
+
77
+ // send appeal event as the takendown account
78
+ await agent.com.atproto.moderation.createReport(
79
+ {
80
+ reasonType: ComAtprotoModerationDefs.REASONAPPEAL,
81
+ reason: 'I want my account back',
82
+ subject: { $type: 'com.atproto.admin.defs#repoRef', did: account.did },
83
+ },
84
+ {
85
+ headers: {
86
+ authorization: `Bearer ${auth.accessJwt}`,
87
+ },
88
+ },
89
+ )
90
+
91
+ // Verify that the appeal was created
92
+ const { data: result } = await agent.tools.ozone.moderation.queryStatuses(
93
+ {
94
+ subject: account.did,
95
+ },
96
+ { headers: sc.getHeaders(moderator) },
97
+ )
98
+
99
+ expect(result.subjectStatuses[0].appealed).toBe(true)
100
+ expect(forSnapshot(result.subjectStatuses[0])).toMatchSnapshot()
101
+ })
102
+
103
+ it('takendown actor is not allowed to create reports.', async () => {
104
+ const { data: auth } = await agent.com.atproto.server.createSession({
105
+ identifier: 'jeff.test',
106
+ password: 'password',
107
+ allowTakendown: true,
108
+ })
109
+
110
+ // send appeal event as the takendown account
111
+ await expect(
112
+ agent.com.atproto.moderation.createReport(
113
+ {
114
+ reasonType: ComAtprotoModerationDefs.REASONRUDE,
115
+ reason: 'reporting others',
116
+ subject: {
117
+ $type: 'com.atproto.admin.defs#repoRef',
118
+ did: 'did:plc:test',
119
+ },
120
+ },
121
+ {
122
+ headers: {
123
+ authorization: `Bearer ${auth.accessJwt}`,
124
+ },
125
+ },
126
+ ),
127
+ ).rejects.toThrow('Report not accepted from takendown account')
128
+ })
129
+ it('takendown actor is not allowed to create records.', async () => {
130
+ const { data: auth } = await agent.com.atproto.server.createSession({
131
+ identifier: 'jeff.test',
132
+ password: 'password',
133
+ allowTakendown: true,
134
+ })
135
+
136
+ // send appeal event as the takendown account
137
+ await expect(
138
+ agent.com.atproto.repo.createRecord(
139
+ {
140
+ repo: auth.did,
141
+ collection: ids.AppBskyFeedPost,
142
+ // rkey: 'self',
143
+ record: {
144
+ text: 'test',
145
+ createdAt: new Date().toISOString(),
146
+ },
147
+ },
148
+ {
149
+ headers: {
150
+ authorization: `Bearer ${auth.accessJwt}`,
151
+ },
152
+ encoding: 'application/json',
153
+ },
154
+ ),
155
+ ).rejects.toThrow('Bad token scope')
156
+ })
157
+ })