@atproto/bsky 0.0.201 → 0.0.203

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 (126) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/age-assurance/const.d.ts.map +1 -1
  3. package/dist/api/age-assurance/const.js +20 -0
  4. package/dist/api/age-assurance/const.js.map +1 -1
  5. package/dist/api/app/bsky/ageassurance/begin.d.ts.map +1 -1
  6. package/dist/api/app/bsky/ageassurance/begin.js +15 -8
  7. package/dist/api/app/bsky/ageassurance/begin.js.map +1 -1
  8. package/dist/api/app/bsky/contact/dismissMatch.d.ts.map +1 -1
  9. package/dist/api/app/bsky/contact/dismissMatch.js +2 -3
  10. package/dist/api/app/bsky/contact/dismissMatch.js.map +1 -1
  11. package/dist/api/app/bsky/contact/getMatches.js +2 -3
  12. package/dist/api/app/bsky/contact/getMatches.js.map +1 -1
  13. package/dist/api/app/bsky/contact/getSyncStatus.d.ts.map +1 -1
  14. package/dist/api/app/bsky/contact/getSyncStatus.js +2 -3
  15. package/dist/api/app/bsky/contact/getSyncStatus.js.map +1 -1
  16. package/dist/api/app/bsky/contact/importContacts.js +2 -3
  17. package/dist/api/app/bsky/contact/importContacts.js.map +1 -1
  18. package/dist/api/app/bsky/contact/removeData.d.ts.map +1 -1
  19. package/dist/api/app/bsky/contact/removeData.js +2 -3
  20. package/dist/api/app/bsky/contact/removeData.js.map +1 -1
  21. package/dist/api/app/bsky/contact/sendNotification.d.ts.map +1 -1
  22. package/dist/api/app/bsky/contact/sendNotification.js.map +1 -1
  23. package/dist/api/app/bsky/contact/startPhoneVerification.d.ts.map +1 -1
  24. package/dist/api/app/bsky/contact/startPhoneVerification.js +2 -3
  25. package/dist/api/app/bsky/contact/startPhoneVerification.js.map +1 -1
  26. package/dist/api/app/bsky/contact/util.d.ts +7 -0
  27. package/dist/api/app/bsky/contact/util.d.ts.map +1 -1
  28. package/dist/api/app/bsky/contact/util.js +68 -0
  29. package/dist/api/app/bsky/contact/util.js.map +1 -1
  30. package/dist/api/app/bsky/contact/verifyPhone.d.ts.map +1 -1
  31. package/dist/api/app/bsky/contact/verifyPhone.js +2 -3
  32. package/dist/api/app/bsky/contact/verifyPhone.js.map +1 -1
  33. package/dist/api/index.d.ts +1 -0
  34. package/dist/api/index.d.ts.map +1 -1
  35. package/dist/api/index.js +4 -1
  36. package/dist/api/index.js.map +1 -1
  37. package/dist/api/sitemap.d.ts +4 -0
  38. package/dist/api/sitemap.d.ts.map +1 -0
  39. package/dist/api/sitemap.js +67 -0
  40. package/dist/api/sitemap.js.map +1 -0
  41. package/dist/data-plane/server/routes/index.d.ts.map +1 -1
  42. package/dist/data-plane/server/routes/index.js +2 -0
  43. package/dist/data-plane/server/routes/index.js.map +1 -1
  44. package/dist/data-plane/server/routes/profile.d.ts.map +1 -1
  45. package/dist/data-plane/server/routes/profile.js +10 -8
  46. package/dist/data-plane/server/routes/profile.js.map +1 -1
  47. package/dist/data-plane/server/routes/sitemap.d.ts +5 -0
  48. package/dist/data-plane/server/routes/sitemap.d.ts.map +1 -0
  49. package/dist/data-plane/server/routes/sitemap.js +38 -0
  50. package/dist/data-plane/server/routes/sitemap.js.map +1 -0
  51. package/dist/hydration/actor.js +1 -1
  52. package/dist/hydration/actor.js.map +1 -1
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +3 -0
  55. package/dist/index.js.map +1 -1
  56. package/dist/lexicon/lexicons.d.ts +100 -46
  57. package/dist/lexicon/lexicons.d.ts.map +1 -1
  58. package/dist/lexicon/lexicons.js +67 -22
  59. package/dist/lexicon/lexicons.js.map +1 -1
  60. package/dist/lexicon/types/app/bsky/contact/dismissMatch.d.ts +1 -1
  61. package/dist/lexicon/types/app/bsky/contact/dismissMatch.d.ts.map +1 -1
  62. package/dist/lexicon/types/app/bsky/contact/dismissMatch.js.map +1 -1
  63. package/dist/lexicon/types/app/bsky/contact/getMatches.d.ts +1 -1
  64. package/dist/lexicon/types/app/bsky/contact/getMatches.d.ts.map +1 -1
  65. package/dist/lexicon/types/app/bsky/contact/getMatches.js.map +1 -1
  66. package/dist/lexicon/types/app/bsky/contact/getSyncStatus.d.ts +1 -1
  67. package/dist/lexicon/types/app/bsky/contact/getSyncStatus.d.ts.map +1 -1
  68. package/dist/lexicon/types/app/bsky/contact/getSyncStatus.js.map +1 -1
  69. package/dist/lexicon/types/app/bsky/contact/importContacts.d.ts +1 -1
  70. package/dist/lexicon/types/app/bsky/contact/importContacts.d.ts.map +1 -1
  71. package/dist/lexicon/types/app/bsky/contact/importContacts.js.map +1 -1
  72. package/dist/lexicon/types/app/bsky/contact/removeData.d.ts +1 -1
  73. package/dist/lexicon/types/app/bsky/contact/removeData.d.ts.map +1 -1
  74. package/dist/lexicon/types/app/bsky/contact/removeData.js.map +1 -1
  75. package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.d.ts +1 -1
  76. package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.d.ts.map +1 -1
  77. package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.js.map +1 -1
  78. package/dist/lexicon/types/app/bsky/contact/verifyPhone.d.ts +1 -1
  79. package/dist/lexicon/types/app/bsky/contact/verifyPhone.d.ts.map +1 -1
  80. package/dist/lexicon/types/app/bsky/contact/verifyPhone.js.map +1 -1
  81. package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +1 -1
  82. package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
  83. package/dist/lexicon/types/app/bsky/notification/listNotifications.js.map +1 -1
  84. package/dist/proto/bsky_connect.d.ts +21 -1
  85. package/dist/proto/bsky_connect.d.ts.map +1 -1
  86. package/dist/proto/bsky_connect.js +20 -0
  87. package/dist/proto/bsky_connect.js.map +1 -1
  88. package/dist/proto/bsky_pb.d.ts +97 -0
  89. package/dist/proto/bsky_pb.d.ts.map +1 -1
  90. package/dist/proto/bsky_pb.js +256 -5
  91. package/dist/proto/bsky_pb.js.map +1 -1
  92. package/package.json +7 -7
  93. package/proto/bsky.proto +31 -0
  94. package/src/api/age-assurance/const.ts +20 -0
  95. package/src/api/app/bsky/ageassurance/begin.ts +21 -11
  96. package/src/api/app/bsky/contact/dismissMatch.ts +7 -6
  97. package/src/api/app/bsky/contact/getMatches.ts +8 -7
  98. package/src/api/app/bsky/contact/getSyncStatus.ts +6 -5
  99. package/src/api/app/bsky/contact/importContacts.ts +8 -7
  100. package/src/api/app/bsky/contact/removeData.ts +6 -5
  101. package/src/api/app/bsky/contact/sendNotification.ts +2 -1
  102. package/src/api/app/bsky/contact/startPhoneVerification.ts +7 -6
  103. package/src/api/app/bsky/contact/util.ts +80 -1
  104. package/src/api/app/bsky/contact/verifyPhone.ts +8 -7
  105. package/src/api/index.ts +4 -0
  106. package/src/api/sitemap.ts +76 -0
  107. package/src/data-plane/server/routes/index.ts +2 -0
  108. package/src/data-plane/server/routes/profile.ts +8 -6
  109. package/src/data-plane/server/routes/sitemap.ts +43 -0
  110. package/src/hydration/actor.ts +1 -1
  111. package/src/index.ts +6 -1
  112. package/src/lexicon/lexicons.ts +67 -22
  113. package/src/lexicon/types/app/bsky/contact/dismissMatch.ts +1 -1
  114. package/src/lexicon/types/app/bsky/contact/getMatches.ts +1 -1
  115. package/src/lexicon/types/app/bsky/contact/getSyncStatus.ts +1 -1
  116. package/src/lexicon/types/app/bsky/contact/importContacts.ts +6 -1
  117. package/src/lexicon/types/app/bsky/contact/removeData.ts +1 -1
  118. package/src/lexicon/types/app/bsky/contact/startPhoneVerification.ts +1 -1
  119. package/src/lexicon/types/app/bsky/contact/verifyPhone.ts +6 -1
  120. package/src/lexicon/types/app/bsky/notification/listNotifications.ts +1 -0
  121. package/src/proto/bsky_connect.ts +21 -1
  122. package/src/proto/bsky_pb.ts +188 -0
  123. package/tests/sitemap.test.ts +75 -0
  124. package/tests/views/age-assurance-v2.test.ts +51 -0
  125. package/tsconfig.build.tsbuildinfo +1 -1
  126. package/tsconfig.tests.tsbuildinfo +1 -1
package/src/index.ts CHANGED
@@ -10,7 +10,7 @@ import { AtpAgent } from '@atproto/api'
10
10
  import { DAY, SECOND } from '@atproto/common'
11
11
  import { Keypair } from '@atproto/crypto'
12
12
  import { IdResolver } from '@atproto/identity'
13
- import API, { blobResolver, external, health, wellKnown } from './api'
13
+ import API, { blobResolver, external, health, sitemap, wellKnown } from './api'
14
14
  import { createBlobDispatcher } from './api/blob-dispatcher'
15
15
  import { AuthVerifier, createPublicKeyObject } from './auth-verifier'
16
16
  import { authWithApiKey as bsyncAuth, createBsyncClient } from './bsync'
@@ -225,6 +225,11 @@ export class BskyAppView {
225
225
  app.use(wellKnown.createRouter(ctx))
226
226
  app.use(blobResolver.createMiddleware(ctx))
227
227
  app.use(imageServer.createMiddleware(ctx, { prefix: '/img/' }))
228
+
229
+ if (config.dataplaneUrls.length > 0 || config.dataplaneUrlsEtcdKeyPrefix) {
230
+ app.use(sitemap.createRouter(ctx))
231
+ }
232
+
228
233
  app.use(server.xrpc.router)
229
234
  app.use(error.handler)
230
235
  app.use('/external', external.createRouter(ctx))
@@ -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
  },
@@ -6803,6 +6847,7 @@ export const schemaDict = {
6803
6847
  'like-via-repost',
6804
6848
  'repost-via-repost',
6805
6849
  'subscribed-post',
6850
+ 'contact-match',
6806
6851
  ],
6807
6852
  },
6808
6853
  reasonSubject: {
@@ -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
@@ -67,6 +67,7 @@ export interface Notification {
67
67
  | 'like-via-repost'
68
68
  | 'repost-via-repost'
69
69
  | 'subscribed-post'
70
+ | 'contact-match'
70
71
  | (string & {})
71
72
  reasonSubject?: string
72
73
  record: { [_ in string]: unknown }
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
5
 
6
- import { ClearActorMutelistSubscriptionsRequest, ClearActorMutelistSubscriptionsResponse, ClearActorMutesRequest, ClearActorMutesResponse, ClearThreadMutesRequest, ClearThreadMutesResponse, CreateActorMutelistSubscriptionRequest, CreateActorMutelistSubscriptionResponse, CreateActorMuteRequest, CreateActorMuteResponse, CreateThreadMuteRequest, CreateThreadMuteResponse, DeleteActorMutelistSubscriptionRequest, DeleteActorMutelistSubscriptionResponse, DeleteActorMuteRequest, DeleteActorMuteResponse, DeleteThreadMuteRequest, DeleteThreadMuteResponse, GetActivitySubscriptionDidsRequest, GetActivitySubscriptionDidsResponse, GetActivitySubscriptionsByActorAndSubjectsRequest, GetActivitySubscriptionsByActorAndSubjectsResponse, GetActorBookmarksRequest, GetActorBookmarksResponse, GetActorChatDeclarationRecordsRequest, GetActorChatDeclarationRecordsResponse, GetActorFeedsRequest, GetActorFeedsResponse, GetActorFollowsActorsRequest, GetActorFollowsActorsResponse, GetActorLikesRequest, GetActorLikesResponse, GetActorListsRequest, GetActorListsResponse, GetActorMutesActorRequest, GetActorMutesActorResponse, GetActorMutesActorViaListRequest, GetActorMutesActorViaListResponse, GetActorRepostsRequest, GetActorRepostsResponse, GetActorsRequest, GetActorsResponse, GetActorStarterPacksRequest, GetActorStarterPacksResponse, GetActorTakedownRequest, GetActorTakedownResponse, GetAllLabelersRequest, GetAllLabelersResponse, GetAuthorFeedRequest, GetAuthorFeedResponse, GetBidirectionalBlockRequest, GetBidirectionalBlockResponse, GetBidirectionalBlockViaListRequest, GetBidirectionalBlockViaListResponse, GetBlobTakedownRequest, GetBlobTakedownResponse, GetBlockExistenceRequest, GetBlockExistenceResponse, GetBlocklistSubscriptionRequest, GetBlocklistSubscriptionResponse, GetBlocklistSubscriptionsRequest, GetBlocklistSubscriptionsResponse, GetBlockRecordsRequest, GetBlockRecordsResponse, GetBlocksRequest, GetBlocksResponse, GetBookmarksByActorAndSubjectsRequest, GetBookmarksByActorAndSubjectsResponse, GetCountsForUsersRequest, GetCountsForUsersResponse, GetDidsByHandlesRequest, GetDidsByHandlesResponse, GetFeedGeneratorRecordsRequest, GetFeedGeneratorRecordsResponse, GetFeedGeneratorStatusRequest, GetFeedGeneratorStatusResponse, GetFollowersRequest, GetFollowersResponse, GetFollowRecordsRequest, GetFollowRecordsResponse, GetFollowsFollowingRequest, GetFollowsFollowingResponse, GetFollowsRequest, GetFollowsResponse, GetFollowSuggestionsRequest, GetFollowSuggestionsResponse, GetIdentityByDidRequest, GetIdentityByDidResponse, GetIdentityByHandleRequest, GetIdentityByHandleResponse, GetInteractionCountsRequest, GetInteractionCountsResponse, GetLabelerRecordsRequest, GetLabelerRecordsResponse, GetLabelsRequest, GetLabelsResponse, GetLatestRevRequest, GetLatestRevResponse, GetLikeRecordsRequest, GetLikeRecordsResponse, GetLikesByActorAndSubjectsRequest, GetLikesByActorAndSubjectsResponse, GetLikesBySubjectRequest, GetLikesBySubjectResponse, GetLikesBySubjectSortedRequest, GetLikesBySubjectSortedResponse, GetListBlockRecordsRequest, GetListBlockRecordsResponse, GetListCountRequest, GetListCountResponse, GetListCountsRequest, GetListCountsResponse, GetListFeedRequest, GetListFeedResponse, GetListItemRecordsRequest, GetListItemRecordsResponse, GetListMembershipRequest, GetListMembershipResponse, GetListMembersRequest, GetListMembersResponse, GetListRecordsRequest, GetListRecordsResponse, GetMutelistSubscriptionRequest, GetMutelistSubscriptionResponse, GetMutelistSubscriptionsRequest, GetMutelistSubscriptionsResponse, GetMutesRequest, GetMutesResponse, GetNewUserCountForRangeRequest, GetNewUserCountForRangeResponse, GetNotificationDeclarationRecordsRequest, GetNotificationDeclarationRecordsResponse, GetNotificationPreferencesRequest, GetNotificationPreferencesResponse, GetNotificationSeenRequest, GetNotificationSeenResponse, GetNotificationsRequest, GetNotificationsResponse, GetPostgateRecordsRequest, GetPostgateRecordsResponse, GetPostRecordsRequest, GetPostRecordsResponse, GetProfileRecordsRequest, GetProfileRecordsResponse, GetQuotesBySubjectSortedRequest, GetQuotesBySubjectSortedResponse, GetRecordTakedownRequest, GetRecordTakedownResponse, GetRelationshipsRequest, GetRelationshipsResponse, GetRepostRecordsRequest, GetRepostRecordsResponse, GetRepostsByActorAndSubjectsRequest, GetRepostsByActorAndSubjectsResponse, GetRepostsBySubjectRequest, GetRepostsBySubjectResponse, GetStarterPackCountsRequest, GetStarterPackCountsResponse, GetStarterPackRecordsRequest, GetStarterPackRecordsResponse, GetStatusRecordsRequest, GetStatusRecordsResponse, GetSuggestedEntitiesRequest, GetSuggestedEntitiesResponse, GetSuggestedFeedsRequest, GetSuggestedFeedsResponse, GetThreadGateRecordsRequest, GetThreadGateRecordsResponse, GetThreadMutesOnSubjectsRequest, GetThreadMutesOnSubjectsResponse, GetThreadRequest, GetThreadResponse, GetTimelineRequest, GetTimelineResponse, GetUnreadNotificationCountRequest, GetUnreadNotificationCountResponse, GetVerificationRecordsRequest, GetVerificationRecordsResponse, GetVerificationsIssuedRequest, GetVerificationsIssuedResponse, GetVerificationsReceivedRequest, GetVerificationsReceivedResponse, PingRequest, PingResponse, SearchActorsRequest, SearchActorsResponse, SearchFeedGeneratorsRequest, SearchFeedGeneratorsResponse, SearchPostsRequest, SearchPostsResponse, SearchStarterPacksRequest, SearchStarterPacksResponse, TakedownActorRequest, TakedownActorResponse, TakedownBlobRequest, TakedownBlobResponse, TakedownRecordRequest, TakedownRecordResponse, UntakedownActorRequest, UntakedownActorResponse, UntakedownBlobRequest, UntakedownBlobResponse, UntakedownRecordRequest, UntakedownRecordResponse, UpdateActorUpstreamStatusRequest, UpdateActorUpstreamStatusResponse, UpdateNotificationSeenRequest, UpdateNotificationSeenResponse } from "./bsky_pb";
6
+ import { ClearActorMutelistSubscriptionsRequest, ClearActorMutelistSubscriptionsResponse, ClearActorMutesRequest, ClearActorMutesResponse, ClearThreadMutesRequest, ClearThreadMutesResponse, CreateActorMutelistSubscriptionRequest, CreateActorMutelistSubscriptionResponse, CreateActorMuteRequest, CreateActorMuteResponse, CreateThreadMuteRequest, CreateThreadMuteResponse, DeleteActorMutelistSubscriptionRequest, DeleteActorMutelistSubscriptionResponse, DeleteActorMuteRequest, DeleteActorMuteResponse, DeleteThreadMuteRequest, DeleteThreadMuteResponse, GetActivitySubscriptionDidsRequest, GetActivitySubscriptionDidsResponse, GetActivitySubscriptionsByActorAndSubjectsRequest, GetActivitySubscriptionsByActorAndSubjectsResponse, GetActorBookmarksRequest, GetActorBookmarksResponse, GetActorChatDeclarationRecordsRequest, GetActorChatDeclarationRecordsResponse, GetActorFeedsRequest, GetActorFeedsResponse, GetActorFollowsActorsRequest, GetActorFollowsActorsResponse, GetActorLikesRequest, GetActorLikesResponse, GetActorListsRequest, GetActorListsResponse, GetActorMutesActorRequest, GetActorMutesActorResponse, GetActorMutesActorViaListRequest, GetActorMutesActorViaListResponse, GetActorRepostsRequest, GetActorRepostsResponse, GetActorsRequest, GetActorsResponse, GetActorStarterPacksRequest, GetActorStarterPacksResponse, GetActorTakedownRequest, GetActorTakedownResponse, GetAllLabelersRequest, GetAllLabelersResponse, GetAuthorFeedRequest, GetAuthorFeedResponse, GetBidirectionalBlockRequest, GetBidirectionalBlockResponse, GetBidirectionalBlockViaListRequest, GetBidirectionalBlockViaListResponse, GetBlobTakedownRequest, GetBlobTakedownResponse, GetBlockExistenceRequest, GetBlockExistenceResponse, GetBlocklistSubscriptionRequest, GetBlocklistSubscriptionResponse, GetBlocklistSubscriptionsRequest, GetBlocklistSubscriptionsResponse, GetBlockRecordsRequest, GetBlockRecordsResponse, GetBlocksRequest, GetBlocksResponse, GetBookmarksByActorAndSubjectsRequest, GetBookmarksByActorAndSubjectsResponse, GetCountsForUsersRequest, GetCountsForUsersResponse, GetDidsByHandlesRequest, GetDidsByHandlesResponse, GetFeedGeneratorRecordsRequest, GetFeedGeneratorRecordsResponse, GetFeedGeneratorStatusRequest, GetFeedGeneratorStatusResponse, GetFollowersRequest, GetFollowersResponse, GetFollowRecordsRequest, GetFollowRecordsResponse, GetFollowsFollowingRequest, GetFollowsFollowingResponse, GetFollowsRequest, GetFollowsResponse, GetFollowSuggestionsRequest, GetFollowSuggestionsResponse, GetIdentityByDidRequest, GetIdentityByDidResponse, GetIdentityByHandleRequest, GetIdentityByHandleResponse, GetInteractionCountsRequest, GetInteractionCountsResponse, GetLabelerRecordsRequest, GetLabelerRecordsResponse, GetLabelsRequest, GetLabelsResponse, GetLatestRevRequest, GetLatestRevResponse, GetLikeRecordsRequest, GetLikeRecordsResponse, GetLikesByActorAndSubjectsRequest, GetLikesByActorAndSubjectsResponse, GetLikesBySubjectRequest, GetLikesBySubjectResponse, GetLikesBySubjectSortedRequest, GetLikesBySubjectSortedResponse, GetListBlockRecordsRequest, GetListBlockRecordsResponse, GetListCountRequest, GetListCountResponse, GetListCountsRequest, GetListCountsResponse, GetListFeedRequest, GetListFeedResponse, GetListItemRecordsRequest, GetListItemRecordsResponse, GetListMembershipRequest, GetListMembershipResponse, GetListMembersRequest, GetListMembersResponse, GetListRecordsRequest, GetListRecordsResponse, GetMutelistSubscriptionRequest, GetMutelistSubscriptionResponse, GetMutelistSubscriptionsRequest, GetMutelistSubscriptionsResponse, GetMutesRequest, GetMutesResponse, GetNewUserCountForRangeRequest, GetNewUserCountForRangeResponse, GetNotificationDeclarationRecordsRequest, GetNotificationDeclarationRecordsResponse, GetNotificationPreferencesRequest, GetNotificationPreferencesResponse, GetNotificationSeenRequest, GetNotificationSeenResponse, GetNotificationsRequest, GetNotificationsResponse, GetPostgateRecordsRequest, GetPostgateRecordsResponse, GetPostRecordsRequest, GetPostRecordsResponse, GetProfileRecordsRequest, GetProfileRecordsResponse, GetQuotesBySubjectSortedRequest, GetQuotesBySubjectSortedResponse, GetRecordTakedownRequest, GetRecordTakedownResponse, GetRelationshipsRequest, GetRelationshipsResponse, GetRepostRecordsRequest, GetRepostRecordsResponse, GetRepostsByActorAndSubjectsRequest, GetRepostsByActorAndSubjectsResponse, GetRepostsBySubjectRequest, GetRepostsBySubjectResponse, GetSitemapIndexRequest, GetSitemapIndexResponse, GetSitemapPageRequest, GetSitemapPageResponse, GetStarterPackCountsRequest, GetStarterPackCountsResponse, GetStarterPackRecordsRequest, GetStarterPackRecordsResponse, GetStatusRecordsRequest, GetStatusRecordsResponse, GetSuggestedEntitiesRequest, GetSuggestedEntitiesResponse, GetSuggestedFeedsRequest, GetSuggestedFeedsResponse, GetThreadGateRecordsRequest, GetThreadGateRecordsResponse, GetThreadMutesOnSubjectsRequest, GetThreadMutesOnSubjectsResponse, GetThreadRequest, GetThreadResponse, GetTimelineRequest, GetTimelineResponse, GetUnreadNotificationCountRequest, GetUnreadNotificationCountResponse, GetVerificationRecordsRequest, GetVerificationRecordsResponse, GetVerificationsIssuedRequest, GetVerificationsIssuedResponse, GetVerificationsReceivedRequest, GetVerificationsReceivedResponse, PingRequest, PingResponse, SearchActorsRequest, SearchActorsResponse, SearchFeedGeneratorsRequest, SearchFeedGeneratorsResponse, SearchPostsRequest, SearchPostsResponse, SearchStarterPacksRequest, SearchStarterPacksResponse, TakedownActorRequest, TakedownActorResponse, TakedownBlobRequest, TakedownBlobResponse, TakedownRecordRequest, TakedownRecordResponse, UntakedownActorRequest, UntakedownActorResponse, UntakedownBlobRequest, UntakedownBlobResponse, UntakedownRecordRequest, UntakedownRecordResponse, UpdateActorUpstreamStatusRequest, UpdateActorUpstreamStatusResponse, UpdateNotificationSeenRequest, UpdateNotificationSeenResponse } from "./bsky_pb";
7
7
  import { MethodKind } from "@bufbuild/protobuf";
8
8
 
9
9
  /**
@@ -858,6 +858,26 @@ export const Service = {
858
858
  O: GetFollowsFollowingResponse,
859
859
  kind: MethodKind.Unary,
860
860
  },
861
+ /**
862
+ * Sitemaps
863
+ *
864
+ * @generated from rpc bsky.Service.GetSitemapIndex
865
+ */
866
+ getSitemapIndex: {
867
+ name: "GetSitemapIndex",
868
+ I: GetSitemapIndexRequest,
869
+ O: GetSitemapIndexResponse,
870
+ kind: MethodKind.Unary,
871
+ },
872
+ /**
873
+ * @generated from rpc bsky.Service.GetSitemapPage
874
+ */
875
+ getSitemapPage: {
876
+ name: "GetSitemapPage",
877
+ I: GetSitemapPageRequest,
878
+ O: GetSitemapPageResponse,
879
+ kind: MethodKind.Unary,
880
+ },
861
881
  /**
862
882
  * Ping
863
883
  *
@@ -96,6 +96,26 @@ proto3.util.setEnumType(FeedType, "bsky.FeedType", [
96
96
  { no: 4, name: "FEED_TYPE_POSTS_WITH_VIDEO" },
97
97
  ]);
98
98
 
99
+ /**
100
+ * @generated from enum bsky.SitemapPageType
101
+ */
102
+ export enum SitemapPageType {
103
+ /**
104
+ * @generated from enum value: SITEMAP_PAGE_TYPE_UNSPECIFIED = 0;
105
+ */
106
+ UNSPECIFIED = 0,
107
+
108
+ /**
109
+ * @generated from enum value: SITEMAP_PAGE_TYPE_USER = 1;
110
+ */
111
+ USER = 1,
112
+ }
113
+ // Retrieve enum metadata with: proto3.getEnumType(SitemapPageType)
114
+ proto3.util.setEnumType(SitemapPageType, "bsky.SitemapPageType", [
115
+ { no: 0, name: "SITEMAP_PAGE_TYPE_UNSPECIFIED" },
116
+ { no: 1, name: "SITEMAP_PAGE_TYPE_USER" },
117
+ ]);
118
+
99
119
  /**
100
120
  * @generated from message bsky.Record
101
121
  */
@@ -9391,6 +9411,174 @@ export class GetFollowsFollowingResponse extends Message<GetFollowsFollowingResp
9391
9411
  }
9392
9412
  }
9393
9413
 
9414
+ /**
9415
+ * @generated from message bsky.GetSitemapIndexRequest
9416
+ */
9417
+ export class GetSitemapIndexRequest extends Message<GetSitemapIndexRequest> {
9418
+ /**
9419
+ * @generated from field: bsky.SitemapPageType type = 1;
9420
+ */
9421
+ type = SitemapPageType.UNSPECIFIED;
9422
+
9423
+ constructor(data?: PartialMessage<GetSitemapIndexRequest>) {
9424
+ super();
9425
+ proto3.util.initPartial(data, this);
9426
+ }
9427
+
9428
+ static readonly runtime: typeof proto3 = proto3;
9429
+ static readonly typeName = "bsky.GetSitemapIndexRequest";
9430
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
9431
+ { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(SitemapPageType) },
9432
+ ]);
9433
+
9434
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetSitemapIndexRequest {
9435
+ return new GetSitemapIndexRequest().fromBinary(bytes, options);
9436
+ }
9437
+
9438
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetSitemapIndexRequest {
9439
+ return new GetSitemapIndexRequest().fromJson(jsonValue, options);
9440
+ }
9441
+
9442
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetSitemapIndexRequest {
9443
+ return new GetSitemapIndexRequest().fromJsonString(jsonString, options);
9444
+ }
9445
+
9446
+ static equals(a: GetSitemapIndexRequest | PlainMessage<GetSitemapIndexRequest> | undefined, b: GetSitemapIndexRequest | PlainMessage<GetSitemapIndexRequest> | undefined): boolean {
9447
+ return proto3.util.equals(GetSitemapIndexRequest, a, b);
9448
+ }
9449
+ }
9450
+
9451
+ /**
9452
+ * @generated from message bsky.GetSitemapIndexResponse
9453
+ */
9454
+ export class GetSitemapIndexResponse extends Message<GetSitemapIndexResponse> {
9455
+ /**
9456
+ * GZIP compressed XML sitemap
9457
+ *
9458
+ * @generated from field: bytes sitemap = 1;
9459
+ */
9460
+ sitemap = new Uint8Array(0);
9461
+
9462
+ constructor(data?: PartialMessage<GetSitemapIndexResponse>) {
9463
+ super();
9464
+ proto3.util.initPartial(data, this);
9465
+ }
9466
+
9467
+ static readonly runtime: typeof proto3 = proto3;
9468
+ static readonly typeName = "bsky.GetSitemapIndexResponse";
9469
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
9470
+ { no: 1, name: "sitemap", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
9471
+ ]);
9472
+
9473
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetSitemapIndexResponse {
9474
+ return new GetSitemapIndexResponse().fromBinary(bytes, options);
9475
+ }
9476
+
9477
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetSitemapIndexResponse {
9478
+ return new GetSitemapIndexResponse().fromJson(jsonValue, options);
9479
+ }
9480
+
9481
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetSitemapIndexResponse {
9482
+ return new GetSitemapIndexResponse().fromJsonString(jsonString, options);
9483
+ }
9484
+
9485
+ static equals(a: GetSitemapIndexResponse | PlainMessage<GetSitemapIndexResponse> | undefined, b: GetSitemapIndexResponse | PlainMessage<GetSitemapIndexResponse> | undefined): boolean {
9486
+ return proto3.util.equals(GetSitemapIndexResponse, a, b);
9487
+ }
9488
+ }
9489
+
9490
+ /**
9491
+ * Sitemap HTTP paths are typically of the form `/type/yyyy-mm-dd/N.xml.gz`, i.e. `/users/2025-01-01/1.xml.gz`
9492
+ *
9493
+ * @generated from message bsky.GetSitemapPageRequest
9494
+ */
9495
+ export class GetSitemapPageRequest extends Message<GetSitemapPageRequest> {
9496
+ /**
9497
+ * @generated from field: bsky.SitemapPageType type = 1;
9498
+ */
9499
+ type = SitemapPageType.UNSPECIFIED;
9500
+
9501
+ /**
9502
+ * @generated from field: google.protobuf.Timestamp date = 2;
9503
+ */
9504
+ date?: Timestamp;
9505
+
9506
+ /**
9507
+ * One-indexed
9508
+ *
9509
+ * @generated from field: int32 bucket = 3;
9510
+ */
9511
+ bucket = 0;
9512
+
9513
+ constructor(data?: PartialMessage<GetSitemapPageRequest>) {
9514
+ super();
9515
+ proto3.util.initPartial(data, this);
9516
+ }
9517
+
9518
+ static readonly runtime: typeof proto3 = proto3;
9519
+ static readonly typeName = "bsky.GetSitemapPageRequest";
9520
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
9521
+ { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(SitemapPageType) },
9522
+ { no: 2, name: "date", kind: "message", T: Timestamp },
9523
+ { no: 3, name: "bucket", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
9524
+ ]);
9525
+
9526
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetSitemapPageRequest {
9527
+ return new GetSitemapPageRequest().fromBinary(bytes, options);
9528
+ }
9529
+
9530
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetSitemapPageRequest {
9531
+ return new GetSitemapPageRequest().fromJson(jsonValue, options);
9532
+ }
9533
+
9534
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetSitemapPageRequest {
9535
+ return new GetSitemapPageRequest().fromJsonString(jsonString, options);
9536
+ }
9537
+
9538
+ static equals(a: GetSitemapPageRequest | PlainMessage<GetSitemapPageRequest> | undefined, b: GetSitemapPageRequest | PlainMessage<GetSitemapPageRequest> | undefined): boolean {
9539
+ return proto3.util.equals(GetSitemapPageRequest, a, b);
9540
+ }
9541
+ }
9542
+
9543
+ /**
9544
+ * @generated from message bsky.GetSitemapPageResponse
9545
+ */
9546
+ export class GetSitemapPageResponse extends Message<GetSitemapPageResponse> {
9547
+ /**
9548
+ * GZIP compressed XML sitemap
9549
+ *
9550
+ * @generated from field: bytes sitemap = 1;
9551
+ */
9552
+ sitemap = new Uint8Array(0);
9553
+
9554
+ constructor(data?: PartialMessage<GetSitemapPageResponse>) {
9555
+ super();
9556
+ proto3.util.initPartial(data, this);
9557
+ }
9558
+
9559
+ static readonly runtime: typeof proto3 = proto3;
9560
+ static readonly typeName = "bsky.GetSitemapPageResponse";
9561
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
9562
+ { no: 1, name: "sitemap", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
9563
+ ]);
9564
+
9565
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetSitemapPageResponse {
9566
+ return new GetSitemapPageResponse().fromBinary(bytes, options);
9567
+ }
9568
+
9569
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetSitemapPageResponse {
9570
+ return new GetSitemapPageResponse().fromJson(jsonValue, options);
9571
+ }
9572
+
9573
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetSitemapPageResponse {
9574
+ return new GetSitemapPageResponse().fromJsonString(jsonString, options);
9575
+ }
9576
+
9577
+ static equals(a: GetSitemapPageResponse | PlainMessage<GetSitemapPageResponse> | undefined, b: GetSitemapPageResponse | PlainMessage<GetSitemapPageResponse> | undefined): boolean {
9578
+ return proto3.util.equals(GetSitemapPageResponse, a, b);
9579
+ }
9580
+ }
9581
+
9394
9582
  /**
9395
9583
  * Ping
9396
9584
  *
@@ -0,0 +1,75 @@
1
+ import { TestNetwork } from '@atproto/dev-env'
2
+
3
+ describe('sitemap', () => {
4
+ let network: TestNetwork
5
+
6
+ beforeAll(async () => {
7
+ network = await TestNetwork.create({
8
+ dbPostgresSchema: 'bsky_sitemap',
9
+ })
10
+ })
11
+
12
+ afterAll(async () => {
13
+ await network.close()
14
+ })
15
+
16
+ it('returns sitemap index', async () => {
17
+ const response = await fetch(
18
+ `${network.bsky.url}/external/sitemap/users.xml.gz`,
19
+ )
20
+ expect(response.status).toEqual(200)
21
+ expect(response.headers.get('content-type')).toEqual('application/gzip')
22
+ expect(response.headers.get('content-encoding')).toEqual('gzip')
23
+
24
+ // fetch automatically decompresses gzip when Content-Encoding is set
25
+ const xml = await response.text()
26
+
27
+ expect(xml).toContain('<?xml version="1.0" encoding="UTF-8"?>')
28
+ expect(xml).toContain('<sitemapindex')
29
+ expect(xml).toContain('</sitemapindex>')
30
+ })
31
+
32
+ it('returns sitemap page', async () => {
33
+ const response = await fetch(
34
+ `${network.bsky.url}/external/sitemap/users/2025-01-01/1.xml.gz`,
35
+ )
36
+ expect(response.status).toEqual(200)
37
+ expect(response.headers.get('content-type')).toEqual('application/gzip')
38
+ expect(response.headers.get('content-encoding')).toEqual('gzip')
39
+
40
+ // fetch automatically decompresses gzip when Content-Encoding is set
41
+ const xml = await response.text()
42
+
43
+ expect(xml).toContain('<?xml version="1.0" encoding="UTF-8"?>')
44
+ expect(xml).toContain('<urlset')
45
+ expect(xml).toContain('</urlset>')
46
+ })
47
+
48
+ it('returns 400 for invalid date format', async () => {
49
+ const response = await fetch(
50
+ `${network.bsky.url}/external/sitemap/users/invalid-date/1.xml.gz`,
51
+ )
52
+ expect(response.status).toEqual(400)
53
+ })
54
+
55
+ it('returns 400 for invalid bucket number', async () => {
56
+ const response = await fetch(
57
+ `${network.bsky.url}/external/sitemap/users/2025-01-01/0.xml.gz`,
58
+ )
59
+ expect(response.status).toEqual(400)
60
+ })
61
+
62
+ it('returns 400 for non-numeric bucket', async () => {
63
+ const response = await fetch(
64
+ `${network.bsky.url}/external/sitemap/users/2025-01-01/abc.xml.gz`,
65
+ )
66
+ expect(response.status).toEqual(400)
67
+ })
68
+
69
+ it('returns 404 for non-existent sitemap page', async () => {
70
+ const response = await fetch(
71
+ `${network.bsky.url}/external/sitemap/users/2024-01-01/1.xml.gz`,
72
+ )
73
+ expect(response.status).toEqual(404)
74
+ })
75
+ })