@atproto/bsky 0.0.197 → 0.0.199

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 (188) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/api/age-assurance/const.d.ts +11 -0
  3. package/dist/api/age-assurance/const.d.ts.map +1 -0
  4. package/dist/api/age-assurance/const.js +142 -0
  5. package/dist/api/age-assurance/const.js.map +1 -0
  6. package/dist/api/age-assurance/index.d.ts +4 -0
  7. package/dist/api/age-assurance/index.d.ts.map +1 -0
  8. package/dist/api/age-assurance/index.js +24 -0
  9. package/dist/api/age-assurance/index.js.map +1 -0
  10. package/dist/api/age-assurance/kws/age-verified.d.ts +109 -0
  11. package/dist/api/age-assurance/kws/age-verified.d.ts.map +1 -0
  12. package/dist/api/age-assurance/kws/age-verified.js +63 -0
  13. package/dist/api/age-assurance/kws/age-verified.js.map +1 -0
  14. package/dist/api/age-assurance/kws/const.d.ts +13 -0
  15. package/dist/api/age-assurance/kws/const.d.ts.map +1 -0
  16. package/dist/api/age-assurance/kws/const.js +36 -0
  17. package/dist/api/age-assurance/kws/const.js.map +1 -0
  18. package/dist/api/age-assurance/kws/external-payload.d.ts +75 -0
  19. package/dist/api/age-assurance/kws/external-payload.d.ts.map +1 -0
  20. package/dist/api/age-assurance/kws/external-payload.js +124 -0
  21. package/dist/api/age-assurance/kws/external-payload.js.map +1 -0
  22. package/dist/api/age-assurance/kws/external-payload.test.d.ts +2 -0
  23. package/dist/api/age-assurance/kws/external-payload.test.d.ts.map +1 -0
  24. package/dist/api/age-assurance/kws/external-payload.test.js +65 -0
  25. package/dist/api/age-assurance/kws/external-payload.test.js.map +1 -0
  26. package/dist/api/age-assurance/redirects/kws-age-verified.d.ts +4 -0
  27. package/dist/api/age-assurance/redirects/kws-age-verified.d.ts.map +1 -0
  28. package/dist/api/age-assurance/redirects/kws-age-verified.js +76 -0
  29. package/dist/api/age-assurance/redirects/kws-age-verified.js.map +1 -0
  30. package/dist/api/age-assurance/stash.d.ts +4 -0
  31. package/dist/api/age-assurance/stash.d.ts.map +1 -0
  32. package/dist/api/age-assurance/stash.js +19 -0
  33. package/dist/api/age-assurance/stash.js.map +1 -0
  34. package/dist/api/age-assurance/types.d.ts +10 -0
  35. package/dist/api/age-assurance/types.d.ts.map +1 -0
  36. package/dist/api/age-assurance/types.js +3 -0
  37. package/dist/api/age-assurance/types.js.map +1 -0
  38. package/dist/api/age-assurance/util.d.ts +15 -0
  39. package/dist/api/age-assurance/util.d.ts.map +1 -0
  40. package/dist/api/age-assurance/util.js +54 -0
  41. package/dist/api/age-assurance/util.js.map +1 -0
  42. package/dist/api/age-assurance/webhooks/kws-age-verified.d.ts +4 -0
  43. package/dist/api/age-assurance/webhooks/kws-age-verified.d.ts.map +1 -0
  44. package/dist/api/age-assurance/webhooks/kws-age-verified.js +63 -0
  45. package/dist/api/age-assurance/webhooks/kws-age-verified.js.map +1 -0
  46. package/dist/api/app/bsky/ageassurance/begin.d.ts +4 -0
  47. package/dist/api/app/bsky/ageassurance/begin.d.ts.map +1 -0
  48. package/dist/api/app/bsky/ageassurance/begin.js +131 -0
  49. package/dist/api/app/bsky/ageassurance/begin.js.map +1 -0
  50. package/dist/api/app/bsky/ageassurance/getConfig.d.ts +4 -0
  51. package/dist/api/app/bsky/ageassurance/getConfig.d.ts.map +1 -0
  52. package/dist/api/app/bsky/ageassurance/getConfig.js +16 -0
  53. package/dist/api/app/bsky/ageassurance/getConfig.js.map +1 -0
  54. package/dist/api/app/bsky/ageassurance/getState.d.ts +4 -0
  55. package/dist/api/app/bsky/ageassurance/getState.d.ts.map +1 -0
  56. package/dist/api/app/bsky/ageassurance/getState.js +42 -0
  57. package/dist/api/app/bsky/ageassurance/getState.js.map +1 -0
  58. package/dist/api/external.d.ts.map +1 -1
  59. package/dist/api/external.js +2 -0
  60. package/dist/api/external.js.map +1 -1
  61. package/dist/api/index.d.ts.map +1 -1
  62. package/dist/api/index.js +8 -2
  63. package/dist/api/index.js.map +1 -1
  64. package/dist/api/kws/api.d.ts.map +1 -1
  65. package/dist/api/kws/api.js +44 -26
  66. package/dist/api/kws/api.js.map +1 -1
  67. package/dist/api/kws/index.d.ts.map +1 -1
  68. package/dist/api/kws/index.js +3 -1
  69. package/dist/api/kws/index.js.map +1 -1
  70. package/dist/api/kws/webhook.d.ts +3 -1
  71. package/dist/api/kws/webhook.d.ts.map +1 -1
  72. package/dist/api/kws/webhook.js +48 -20
  73. package/dist/api/kws/webhook.js.map +1 -1
  74. package/dist/config.d.ts +14 -0
  75. package/dist/config.d.ts.map +1 -1
  76. package/dist/config.js +10 -2
  77. package/dist/config.js.map +1 -1
  78. package/dist/data-plane/bsync/index.d.ts.map +1 -1
  79. package/dist/data-plane/bsync/index.js +22 -0
  80. package/dist/data-plane/bsync/index.js.map +1 -1
  81. package/dist/data-plane/server/db/migrations/20251120T004738098Z-update-actor-age-assurance-v2.d.ts +4 -0
  82. package/dist/data-plane/server/db/migrations/20251120T004738098Z-update-actor-age-assurance-v2.d.ts.map +1 -0
  83. package/dist/data-plane/server/db/migrations/20251120T004738098Z-update-actor-age-assurance-v2.js +30 -0
  84. package/dist/data-plane/server/db/migrations/20251120T004738098Z-update-actor-age-assurance-v2.js.map +1 -0
  85. package/dist/data-plane/server/db/migrations/index.d.ts +1 -0
  86. package/dist/data-plane/server/db/migrations/index.d.ts.map +1 -1
  87. package/dist/data-plane/server/db/migrations/index.js +2 -1
  88. package/dist/data-plane/server/db/migrations/index.js.map +1 -1
  89. package/dist/data-plane/server/db/pagination.d.ts +3 -3
  90. package/dist/data-plane/server/db/tables/actor.d.ts +3 -0
  91. package/dist/data-plane/server/db/tables/actor.d.ts.map +1 -1
  92. package/dist/data-plane/server/db/tables/actor.js.map +1 -1
  93. package/dist/data-plane/server/routes/profile.d.ts.map +1 -1
  94. package/dist/data-plane/server/routes/profile.js +13 -1
  95. package/dist/data-plane/server/routes/profile.js.map +1 -1
  96. package/dist/hydration/hydrator.js +1 -1
  97. package/dist/hydration/hydrator.js.map +1 -1
  98. package/dist/kws.d.ts +35 -0
  99. package/dist/kws.d.ts.map +1 -1
  100. package/dist/kws.js +54 -0
  101. package/dist/kws.js.map +1 -1
  102. package/dist/lexicon/index.d.ts +11 -0
  103. package/dist/lexicon/index.d.ts.map +1 -1
  104. package/dist/lexicon/index.js +32 -1
  105. package/dist/lexicon/index.js.map +1 -1
  106. package/dist/lexicon/lexicons.d.ts +700 -0
  107. package/dist/lexicon/lexicons.d.ts.map +1 -1
  108. package/dist/lexicon/lexicons.js +367 -0
  109. package/dist/lexicon/lexicons.js.map +1 -1
  110. package/dist/lexicon/types/app/bsky/ageassurance/begin.d.ts +31 -0
  111. package/dist/lexicon/types/app/bsky/ageassurance/begin.d.ts.map +1 -0
  112. package/dist/lexicon/types/app/bsky/ageassurance/begin.js +7 -0
  113. package/dist/lexicon/types/app/bsky/ageassurance/begin.js.map +1 -0
  114. package/dist/lexicon/types/app/bsky/ageassurance/defs.d.ts +138 -0
  115. package/dist/lexicon/types/app/bsky/ageassurance/defs.d.ts.map +1 -0
  116. package/dist/lexicon/types/app/bsky/ageassurance/defs.js +115 -0
  117. package/dist/lexicon/types/app/bsky/ageassurance/defs.js.map +1 -0
  118. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.d.ts +18 -0
  119. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.d.ts.map +1 -0
  120. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.js +7 -0
  121. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.js.map +1 -0
  122. package/dist/lexicon/types/app/bsky/ageassurance/getState.d.ts +24 -0
  123. package/dist/lexicon/types/app/bsky/ageassurance/getState.d.ts.map +1 -0
  124. package/dist/lexicon/types/app/bsky/ageassurance/getState.js +7 -0
  125. package/dist/lexicon/types/app/bsky/ageassurance/getState.js.map +1 -0
  126. package/dist/logger.d.ts +1 -0
  127. package/dist/logger.d.ts.map +1 -1
  128. package/dist/logger.js +2 -1
  129. package/dist/logger.js.map +1 -1
  130. package/dist/proto/bsky_pb.d.ts +8 -0
  131. package/dist/proto/bsky_pb.d.ts.map +1 -1
  132. package/dist/proto/bsky_pb.js +20 -0
  133. package/dist/proto/bsky_pb.js.map +1 -1
  134. package/dist/stash.d.ts +1 -0
  135. package/dist/stash.d.ts.map +1 -1
  136. package/dist/stash.js +2 -0
  137. package/dist/stash.js.map +1 -1
  138. package/dist/util/uris.d.ts +2 -2
  139. package/dist/util/uris.d.ts.map +1 -1
  140. package/package.json +17 -16
  141. package/proto/bsky.proto +1 -0
  142. package/src/api/age-assurance/const.ts +142 -0
  143. package/src/api/age-assurance/index.ts +34 -0
  144. package/src/api/age-assurance/kws/age-verified.ts +75 -0
  145. package/src/api/age-assurance/kws/const.ts +33 -0
  146. package/src/api/age-assurance/kws/external-payload.test.ts +72 -0
  147. package/src/api/age-assurance/kws/external-payload.ts +149 -0
  148. package/src/api/age-assurance/redirects/kws-age-verified.ts +107 -0
  149. package/src/api/age-assurance/stash.ts +22 -0
  150. package/src/api/age-assurance/types.ts +10 -0
  151. package/src/api/age-assurance/util.ts +66 -0
  152. package/src/api/age-assurance/webhooks/kws-age-verified.ts +75 -0
  153. package/src/api/app/bsky/ageassurance/begin.ts +167 -0
  154. package/src/api/app/bsky/ageassurance/getConfig.ts +15 -0
  155. package/src/api/app/bsky/ageassurance/getState.ts +53 -0
  156. package/src/api/external.ts +2 -0
  157. package/src/api/index.ts +6 -0
  158. package/src/api/kws/api.ts +55 -34
  159. package/src/api/kws/index.ts +7 -1
  160. package/src/api/kws/webhook.ts +57 -34
  161. package/src/config.ts +26 -2
  162. package/src/data-plane/bsync/index.ts +31 -0
  163. package/src/data-plane/server/db/migrations/20251120T004738098Z-update-actor-age-assurance-v2.ts +28 -0
  164. package/src/data-plane/server/db/migrations/index.ts +1 -0
  165. package/src/data-plane/server/db/tables/actor.ts +3 -0
  166. package/src/data-plane/server/routes/profile.ts +12 -1
  167. package/src/hydration/hydrator.ts +1 -1
  168. package/src/kws.ts +81 -0
  169. package/src/lexicon/index.ts +49 -0
  170. package/src/lexicon/lexicons.ts +392 -0
  171. package/src/lexicon/types/app/bsky/ageassurance/begin.ts +54 -0
  172. package/src/lexicon/types/app/bsky/ageassurance/defs.ts +301 -0
  173. package/src/lexicon/types/app/bsky/ageassurance/getConfig.ts +34 -0
  174. package/src/lexicon/types/app/bsky/ageassurance/getState.ts +42 -0
  175. package/src/logger.ts +2 -0
  176. package/src/proto/bsky_pb.ts +12 -0
  177. package/src/stash.ts +5 -0
  178. package/tests/blob-resolver.test.ts +2 -0
  179. package/tests/data-plane/duplicate-records.test.ts +2 -0
  180. package/tests/data-plane/indexing.test.ts +2 -0
  181. package/tests/data-plane/subscription.test.ts +2 -0
  182. package/tests/image/server.test.ts +2 -0
  183. package/tests/image/uri.test.ts +2 -0
  184. package/tests/views/age-assurance-v2.test.ts +745 -0
  185. package/tests/views/age-assurance.test.ts +2 -0
  186. package/tests/views/posts.test.ts +96 -0
  187. package/tsconfig.build.tsbuildinfo +1 -1
  188. package/tsconfig.tests.tsbuildinfo +1 -1
@@ -0,0 +1,301 @@
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.ageassurance.defs'
16
+
17
+ /** The access level granted based on Age Assurance data we've processed. */
18
+ export type Access = 'unknown' | 'none' | 'safe' | 'full' | (string & {})
19
+ /** The status of the Age Assurance process. */
20
+ export type Status =
21
+ | 'unknown'
22
+ | 'pending'
23
+ | 'assured'
24
+ | 'blocked'
25
+ | (string & {})
26
+
27
+ /** The user's computed Age Assurance state. */
28
+ export interface State {
29
+ $type?: 'app.bsky.ageassurance.defs#state'
30
+ /** The timestamp when this state was last updated. */
31
+ lastInitiatedAt?: string
32
+ status: Status
33
+ access: Access
34
+ }
35
+
36
+ const hashState = 'state'
37
+
38
+ export function isState<V>(v: V) {
39
+ return is$typed(v, id, hashState)
40
+ }
41
+
42
+ export function validateState<V>(v: V) {
43
+ return validate<State & V>(v, id, hashState)
44
+ }
45
+
46
+ /** Additional metadata needed to compute Age Assurance state client-side. */
47
+ export interface StateMetadata {
48
+ $type?: 'app.bsky.ageassurance.defs#stateMetadata'
49
+ /** The account creation timestamp. */
50
+ accountCreatedAt?: string
51
+ }
52
+
53
+ const hashStateMetadata = 'stateMetadata'
54
+
55
+ export function isStateMetadata<V>(v: V) {
56
+ return is$typed(v, id, hashStateMetadata)
57
+ }
58
+
59
+ export function validateStateMetadata<V>(v: V) {
60
+ return validate<StateMetadata & V>(v, id, hashStateMetadata)
61
+ }
62
+
63
+ export interface Config {
64
+ $type?: 'app.bsky.ageassurance.defs#config'
65
+ /** The per-region Age Assurance configuration. */
66
+ regions: ConfigRegion[]
67
+ }
68
+
69
+ const hashConfig = 'config'
70
+
71
+ export function isConfig<V>(v: V) {
72
+ return is$typed(v, id, hashConfig)
73
+ }
74
+
75
+ export function validateConfig<V>(v: V) {
76
+ return validate<Config & V>(v, id, hashConfig)
77
+ }
78
+
79
+ /** The Age Assurance configuration for a specific region. */
80
+ export interface ConfigRegion {
81
+ $type?: 'app.bsky.ageassurance.defs#configRegion'
82
+ /** The ISO 3166-1 alpha-2 country code this configuration applies to. */
83
+ countryCode: string
84
+ /** The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country. */
85
+ regionCode?: string
86
+ /** The ordered list of Age Assurance rules that apply to this region. Rules should be applied in order, and the first matching rule determines the access level granted. The rules array should always include a default rule as the last item. */
87
+ rules: (
88
+ | $Typed<ConfigRegionRuleDefault>
89
+ | $Typed<ConfigRegionRuleIfDeclaredOverAge>
90
+ | $Typed<ConfigRegionRuleIfDeclaredUnderAge>
91
+ | $Typed<ConfigRegionRuleIfAssuredOverAge>
92
+ | $Typed<ConfigRegionRuleIfAssuredUnderAge>
93
+ | $Typed<ConfigRegionRuleIfAccountNewerThan>
94
+ | $Typed<ConfigRegionRuleIfAccountOlderThan>
95
+ | { $type: string }
96
+ )[]
97
+ }
98
+
99
+ const hashConfigRegion = 'configRegion'
100
+
101
+ export function isConfigRegion<V>(v: V) {
102
+ return is$typed(v, id, hashConfigRegion)
103
+ }
104
+
105
+ export function validateConfigRegion<V>(v: V) {
106
+ return validate<ConfigRegion & V>(v, id, hashConfigRegion)
107
+ }
108
+
109
+ /** Age Assurance rule that applies by default. */
110
+ export interface ConfigRegionRuleDefault {
111
+ $type?: 'app.bsky.ageassurance.defs#configRegionRuleDefault'
112
+ access: Access
113
+ }
114
+
115
+ const hashConfigRegionRuleDefault = 'configRegionRuleDefault'
116
+
117
+ export function isConfigRegionRuleDefault<V>(v: V) {
118
+ return is$typed(v, id, hashConfigRegionRuleDefault)
119
+ }
120
+
121
+ export function validateConfigRegionRuleDefault<V>(v: V) {
122
+ return validate<ConfigRegionRuleDefault & V>(
123
+ v,
124
+ id,
125
+ hashConfigRegionRuleDefault,
126
+ )
127
+ }
128
+
129
+ /** Age Assurance rule that applies if the user has declared themselves equal-to or over a certain age. */
130
+ export interface ConfigRegionRuleIfDeclaredOverAge {
131
+ $type?: 'app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge'
132
+ /** The age threshold as a whole integer. */
133
+ age: number
134
+ access: Access
135
+ }
136
+
137
+ const hashConfigRegionRuleIfDeclaredOverAge =
138
+ 'configRegionRuleIfDeclaredOverAge'
139
+
140
+ export function isConfigRegionRuleIfDeclaredOverAge<V>(v: V) {
141
+ return is$typed(v, id, hashConfigRegionRuleIfDeclaredOverAge)
142
+ }
143
+
144
+ export function validateConfigRegionRuleIfDeclaredOverAge<V>(v: V) {
145
+ return validate<ConfigRegionRuleIfDeclaredOverAge & V>(
146
+ v,
147
+ id,
148
+ hashConfigRegionRuleIfDeclaredOverAge,
149
+ )
150
+ }
151
+
152
+ /** Age Assurance rule that applies if the user has declared themselves under a certain age. */
153
+ export interface ConfigRegionRuleIfDeclaredUnderAge {
154
+ $type?: 'app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge'
155
+ /** The age threshold as a whole integer. */
156
+ age: number
157
+ access: Access
158
+ }
159
+
160
+ const hashConfigRegionRuleIfDeclaredUnderAge =
161
+ 'configRegionRuleIfDeclaredUnderAge'
162
+
163
+ export function isConfigRegionRuleIfDeclaredUnderAge<V>(v: V) {
164
+ return is$typed(v, id, hashConfigRegionRuleIfDeclaredUnderAge)
165
+ }
166
+
167
+ export function validateConfigRegionRuleIfDeclaredUnderAge<V>(v: V) {
168
+ return validate<ConfigRegionRuleIfDeclaredUnderAge & V>(
169
+ v,
170
+ id,
171
+ hashConfigRegionRuleIfDeclaredUnderAge,
172
+ )
173
+ }
174
+
175
+ /** Age Assurance rule that applies if the user has been assured to be equal-to or over a certain age. */
176
+ export interface ConfigRegionRuleIfAssuredOverAge {
177
+ $type?: 'app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge'
178
+ /** The age threshold as a whole integer. */
179
+ age: number
180
+ access: Access
181
+ }
182
+
183
+ const hashConfigRegionRuleIfAssuredOverAge = 'configRegionRuleIfAssuredOverAge'
184
+
185
+ export function isConfigRegionRuleIfAssuredOverAge<V>(v: V) {
186
+ return is$typed(v, id, hashConfigRegionRuleIfAssuredOverAge)
187
+ }
188
+
189
+ export function validateConfigRegionRuleIfAssuredOverAge<V>(v: V) {
190
+ return validate<ConfigRegionRuleIfAssuredOverAge & V>(
191
+ v,
192
+ id,
193
+ hashConfigRegionRuleIfAssuredOverAge,
194
+ )
195
+ }
196
+
197
+ /** Age Assurance rule that applies if the user has been assured to be under a certain age. */
198
+ export interface ConfigRegionRuleIfAssuredUnderAge {
199
+ $type?: 'app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge'
200
+ /** The age threshold as a whole integer. */
201
+ age: number
202
+ access: Access
203
+ }
204
+
205
+ const hashConfigRegionRuleIfAssuredUnderAge =
206
+ 'configRegionRuleIfAssuredUnderAge'
207
+
208
+ export function isConfigRegionRuleIfAssuredUnderAge<V>(v: V) {
209
+ return is$typed(v, id, hashConfigRegionRuleIfAssuredUnderAge)
210
+ }
211
+
212
+ export function validateConfigRegionRuleIfAssuredUnderAge<V>(v: V) {
213
+ return validate<ConfigRegionRuleIfAssuredUnderAge & V>(
214
+ v,
215
+ id,
216
+ hashConfigRegionRuleIfAssuredUnderAge,
217
+ )
218
+ }
219
+
220
+ /** Age Assurance rule that applies if the account is equal-to or newer than a certain date. */
221
+ export interface ConfigRegionRuleIfAccountNewerThan {
222
+ $type?: 'app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan'
223
+ /** The date threshold as a datetime string. */
224
+ date: string
225
+ access: Access
226
+ }
227
+
228
+ const hashConfigRegionRuleIfAccountNewerThan =
229
+ 'configRegionRuleIfAccountNewerThan'
230
+
231
+ export function isConfigRegionRuleIfAccountNewerThan<V>(v: V) {
232
+ return is$typed(v, id, hashConfigRegionRuleIfAccountNewerThan)
233
+ }
234
+
235
+ export function validateConfigRegionRuleIfAccountNewerThan<V>(v: V) {
236
+ return validate<ConfigRegionRuleIfAccountNewerThan & V>(
237
+ v,
238
+ id,
239
+ hashConfigRegionRuleIfAccountNewerThan,
240
+ )
241
+ }
242
+
243
+ /** Age Assurance rule that applies if the account is older than a certain date. */
244
+ export interface ConfigRegionRuleIfAccountOlderThan {
245
+ $type?: 'app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan'
246
+ /** The date threshold as a datetime string. */
247
+ date: string
248
+ access: Access
249
+ }
250
+
251
+ const hashConfigRegionRuleIfAccountOlderThan =
252
+ 'configRegionRuleIfAccountOlderThan'
253
+
254
+ export function isConfigRegionRuleIfAccountOlderThan<V>(v: V) {
255
+ return is$typed(v, id, hashConfigRegionRuleIfAccountOlderThan)
256
+ }
257
+
258
+ export function validateConfigRegionRuleIfAccountOlderThan<V>(v: V) {
259
+ return validate<ConfigRegionRuleIfAccountOlderThan & V>(
260
+ v,
261
+ id,
262
+ hashConfigRegionRuleIfAccountOlderThan,
263
+ )
264
+ }
265
+
266
+ /** Object used to store Age Assurance data in stash. */
267
+ export interface Event {
268
+ $type?: 'app.bsky.ageassurance.defs#event'
269
+ /** The date and time of this write operation. */
270
+ createdAt: string
271
+ /** The unique identifier for this instance of the Age Assurance flow, in UUID format. */
272
+ attemptId: string
273
+ /** The status of the Age Assurance process. */
274
+ status: 'unknown' | 'pending' | 'assured' | 'blocked' | (string & {})
275
+ /** The access level granted based on Age Assurance data we've processed. */
276
+ access: 'unknown' | 'none' | 'safe' | 'full' | (string & {})
277
+ /** The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow. */
278
+ countryCode: string
279
+ /** The ISO 3166-2 region code provided when beginning the Age Assurance flow. */
280
+ regionCode?: string
281
+ /** The email used for Age Assurance. */
282
+ email?: string
283
+ /** The IP address used when initiating the Age Assurance flow. */
284
+ initIp?: string
285
+ /** The user agent used when initiating the Age Assurance flow. */
286
+ initUa?: string
287
+ /** The IP address used when completing the Age Assurance flow. */
288
+ completeIp?: string
289
+ /** The user agent used when completing the Age Assurance flow. */
290
+ completeUa?: string
291
+ }
292
+
293
+ const hashEvent = 'event'
294
+
295
+ export function isEvent<V>(v: V) {
296
+ return is$typed(v, id, hashEvent)
297
+ }
298
+
299
+ export function validateEvent<V>(v: V) {
300
+ return validate<Event & V>(v, id, hashEvent)
301
+ }
@@ -0,0 +1,34 @@
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
+ import type * as AppBskyAgeassuranceDefs from './defs.js'
13
+
14
+ const is$typed = _is$typed,
15
+ validate = _validate
16
+ const id = 'app.bsky.ageassurance.getConfig'
17
+
18
+ export type QueryParams = {}
19
+ export type InputSchema = undefined
20
+ export type OutputSchema = AppBskyAgeassuranceDefs.Config
21
+ export type HandlerInput = void
22
+
23
+ export interface HandlerSuccess {
24
+ encoding: 'application/json'
25
+ body: OutputSchema
26
+ headers?: { [key: string]: string }
27
+ }
28
+
29
+ export interface HandlerError {
30
+ status: number
31
+ message?: string
32
+ }
33
+
34
+ export type HandlerOutput = HandlerError | HandlerSuccess
@@ -0,0 +1,42 @@
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
+ import type * as AppBskyAgeassuranceDefs from './defs.js'
13
+
14
+ const is$typed = _is$typed,
15
+ validate = _validate
16
+ const id = 'app.bsky.ageassurance.getState'
17
+
18
+ export type QueryParams = {
19
+ countryCode: string
20
+ regionCode?: string
21
+ }
22
+ export type InputSchema = undefined
23
+
24
+ export interface OutputSchema {
25
+ state: AppBskyAgeassuranceDefs.State
26
+ metadata: AppBskyAgeassuranceDefs.StateMetadata
27
+ }
28
+
29
+ export type HandlerInput = void
30
+
31
+ export interface HandlerSuccess {
32
+ encoding: 'application/json'
33
+ body: OutputSchema
34
+ headers?: { [key: string]: string }
35
+ }
36
+
37
+ export interface HandlerError {
38
+ status: number
39
+ message?: string
40
+ }
41
+
42
+ export type HandlerOutput = HandlerError | HandlerSuccess
package/src/logger.ts CHANGED
@@ -17,6 +17,8 @@ export const featureGatesLogger: ReturnType<typeof subsystemLogger> =
17
17
  subsystemLogger('bsky:featuregates')
18
18
  export const dataplaneLogger: ReturnType<typeof subsystemLogger> =
19
19
  subsystemLogger('bsky:dp')
20
+ export const ageAssuranceLogger: ReturnType<typeof subsystemLogger> =
21
+ subsystemLogger('bsky:aa')
20
22
  export const httpLogger: ReturnType<typeof subsystemLogger> =
21
23
  subsystemLogger('bsky')
22
24
 
@@ -3856,6 +3856,16 @@ export class AgeAssuranceStatus extends Message<AgeAssuranceStatus> {
3856
3856
  */
3857
3857
  overrideApplied = false;
3858
3858
 
3859
+ /**
3860
+ * @generated from field: string access = 4;
3861
+ */
3862
+ access = "";
3863
+
3864
+ /**
3865
+ * @generated from field: string access_reason = 5;
3866
+ */
3867
+ accessReason = "";
3868
+
3859
3869
  constructor(data?: PartialMessage<AgeAssuranceStatus>) {
3860
3870
  super();
3861
3871
  proto3.util.initPartial(data, this);
@@ -3867,6 +3877,8 @@ export class AgeAssuranceStatus extends Message<AgeAssuranceStatus> {
3867
3877
  { no: 1, name: "status", kind: "scalar", T: 9 /* ScalarType.STRING */ },
3868
3878
  { no: 2, name: "last_initiated_at", kind: "message", T: Timestamp },
3869
3879
  { no: 3, name: "override_applied", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
3880
+ { no: 4, name: "access", kind: "scalar", T: 9 /* ScalarType.STRING */ },
3881
+ { no: 5, name: "access_reason", kind: "scalar", T: 9 /* ScalarType.STRING */ },
3870
3882
  ]);
3871
3883
 
3872
3884
  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AgeAssuranceStatus {
package/src/stash.ts CHANGED
@@ -1,6 +1,9 @@
1
+ /* eslint-disable import/no-deprecated */
2
+
1
3
  import { LexValue, stringifyLex } from '@atproto/lexicon'
2
4
  import { BsyncClient } from './bsync'
3
5
  import { lexicons } from './lexicon/lexicons'
6
+ import { Event as AgeAssuranceEventV2 } from './lexicon/types/app/bsky/ageassurance/defs'
4
7
  import { Bookmark } from './lexicon/types/app/bsky/bookmark/defs'
5
8
  import {
6
9
  Preferences,
@@ -20,6 +23,8 @@ export const Namespaces = {
20
23
  'app.bsky.notification.defs#subjectActivitySubscription' satisfies PickNSID<SubjectActivitySubscription>,
21
24
  AppBskyUnspeccedDefsAgeAssuranceEvent:
22
25
  'app.bsky.unspecced.defs#ageAssuranceEvent' satisfies PickNSID<AgeAssuranceEvent>,
26
+ AppBskyAgeassuranceDefsEvent:
27
+ 'app.bsky.ageassurance.defs#event' satisfies PickNSID<AgeAssuranceEventV2>,
23
28
  }
24
29
 
25
30
  export type Namespace = (typeof Namespaces)[keyof typeof Namespaces]
@@ -1,3 +1,5 @@
1
+ /* eslint-disable import/no-deprecated */
2
+
1
3
  import { CID } from 'multiformats/cid'
2
4
  import { request } from 'undici'
3
5
  import { cidForCbor, verifyCidForBytes } from '@atproto/common'
@@ -1,3 +1,5 @@
1
+ /* eslint-disable import/no-deprecated */
2
+
1
3
  import { TID, cidForCbor } from '@atproto/common'
2
4
  import { TestNetwork } from '@atproto/dev-env'
3
5
  import { WriteOpAction } from '@atproto/repo'
@@ -1,3 +1,5 @@
1
+ /* eslint-disable import/no-deprecated */
2
+
1
3
  import { sql } from 'kysely'
2
4
  import { CID } from 'multiformats/cid'
3
5
  import {
@@ -1,3 +1,5 @@
1
+ /* eslint-disable import/no-deprecated */
2
+
1
3
  import { AtpAgent } from '@atproto/api'
2
4
  import { cborDecode, cborEncode } from '@atproto/common'
3
5
  import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
@@ -1,3 +1,5 @@
1
+ /* eslint-disable import/no-deprecated */
2
+
1
3
  import { Readable } from 'node:stream'
2
4
  import { CID } from 'multiformats/cid'
3
5
  import { cidForCbor } from '@atproto/common'
@@ -1,3 +1,5 @@
1
+ /* eslint-disable import/no-deprecated */
2
+
1
3
  import { CID } from 'multiformats/cid'
2
4
  import { cidForCbor } from '@atproto/common'
3
5
  import { BadPathError, ImageUriBuilder } from '../../src/image/uri'