techne-sdk 0.0.0-stage → 0.2.0

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 (335) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/LICENSE +21 -0
  3. package/README.md +115 -2
  4. package/dist/auth/index.d.ts +151 -0
  5. package/dist/auth/index.js +167 -0
  6. package/dist/auth/placement.gen.d.ts +1 -0
  7. package/dist/auth/placement.gen.js +49 -0
  8. package/dist/catalog/catalog.gen.d.ts +841 -0
  9. package/dist/catalog/catalog.gen.js +29696 -0
  10. package/dist/catalog/index.d.ts +11 -0
  11. package/dist/catalog/index.js +11 -0
  12. package/dist/connect.d.ts +38 -0
  13. package/dist/connect.js +19 -0
  14. package/dist/generated/index.d.ts +2296 -0
  15. package/dist/generated/index.js +3320 -0
  16. package/dist/generated/lexicons.d.ts +17254 -0
  17. package/dist/generated/lexicons.js +9225 -0
  18. package/dist/generated/nsid.d.ts +529 -0
  19. package/dist/generated/nsid.js +1094 -0
  20. package/dist/generated/nsid.json +1082 -0
  21. package/dist/generated/records.d.ts +143 -0
  22. package/dist/generated/records.js +1 -0
  23. package/dist/generated/types/app/bsky/richtext/facet.d.ts +44 -0
  24. package/dist/generated/types/app/bsky/richtext/facet.js +39 -0
  25. package/dist/generated/types/com/atproto/admin/defs.d.ts +10 -0
  26. package/dist/generated/types/com/atproto/admin/defs.js +11 -0
  27. package/dist/generated/types/com/atproto/label/defs.d.ts +73 -0
  28. package/dist/generated/types/com/atproto/label/defs.js +39 -0
  29. package/dist/generated/types/com/atproto/moderation/createReport.d.ts +39 -0
  30. package/dist/generated/types/com/atproto/moderation/createReport.js +7 -0
  31. package/dist/generated/types/com/atproto/moderation/defs.d.ts +15 -0
  32. package/dist/generated/types/com/atproto/moderation/defs.js +18 -0
  33. package/dist/generated/types/com/atproto/repo/applyWrites.d.ts +88 -0
  34. package/dist/generated/types/com/atproto/repo/applyWrites.js +62 -0
  35. package/dist/generated/types/com/atproto/repo/createRecord.d.ts +43 -0
  36. package/dist/generated/types/com/atproto/repo/createRecord.js +20 -0
  37. package/dist/generated/types/com/atproto/repo/defs.d.ts +11 -0
  38. package/dist/generated/types/com/atproto/repo/defs.js +11 -0
  39. package/dist/generated/types/com/atproto/repo/deleteRecord.d.ts +36 -0
  40. package/dist/generated/types/com/atproto/repo/deleteRecord.js +20 -0
  41. package/dist/generated/types/com/atproto/repo/getRecord.d.ts +35 -0
  42. package/dist/generated/types/com/atproto/repo/getRecord.js +20 -0
  43. package/dist/generated/types/com/atproto/repo/listRecords.d.ts +41 -0
  44. package/dist/generated/types/com/atproto/repo/listRecords.js +14 -0
  45. package/dist/generated/types/com/atproto/repo/putRecord.d.ts +45 -0
  46. package/dist/generated/types/com/atproto/repo/putRecord.js +20 -0
  47. package/dist/generated/types/com/atproto/repo/strongRef.d.ts +11 -0
  48. package/dist/generated/types/com/atproto/repo/strongRef.js +11 -0
  49. package/dist/generated/types/com/atproto/server/getServiceAuth.d.ts +29 -0
  50. package/dist/generated/types/com/atproto/server/getServiceAuth.js +20 -0
  51. package/dist/generated/types/community/lexicon/calendar/event.d.ts +65 -0
  52. package/dist/generated/types/community/lexicon/calendar/event.js +35 -0
  53. package/dist/generated/types/community/lexicon/calendar/rsvp.d.ts +20 -0
  54. package/dist/generated/types/community/lexicon/calendar/rsvp.js +18 -0
  55. package/dist/generated/types/community/lexicon/location/address.d.ts +22 -0
  56. package/dist/generated/types/community/lexicon/location/address.js +11 -0
  57. package/dist/generated/types/community/lexicon/location/fsq.d.ts +16 -0
  58. package/dist/generated/types/community/lexicon/location/fsq.js +11 -0
  59. package/dist/generated/types/community/lexicon/location/geo.d.ts +15 -0
  60. package/dist/generated/types/community/lexicon/location/geo.js +11 -0
  61. package/dist/generated/types/community/lexicon/location/hthree.d.ts +14 -0
  62. package/dist/generated/types/community/lexicon/location/hthree.js +11 -0
  63. package/dist/generated/types/pub/techne/draft/accessRule.d.ts +36 -0
  64. package/dist/generated/types/pub/techne/draft/accessRule.js +33 -0
  65. package/dist/generated/types/pub/techne/draft/accountLink.d.ts +16 -0
  66. package/dist/generated/types/pub/techne/draft/accountLink.js +12 -0
  67. package/dist/generated/types/pub/techne/draft/actor/profile.d.ts +20 -0
  68. package/dist/generated/types/pub/techne/draft/actor/profile.js +12 -0
  69. package/dist/generated/types/pub/techne/draft/appAccess.d.ts +25 -0
  70. package/dist/generated/types/pub/techne/draft/appAccess.js +19 -0
  71. package/dist/generated/types/pub/techne/draft/appAccessRequest.d.ts +16 -0
  72. package/dist/generated/types/pub/techne/draft/appAccessRequest.js +12 -0
  73. package/dist/generated/types/pub/techne/draft/appConfig.d.ts +24 -0
  74. package/dist/generated/types/pub/techne/draft/appConfig.js +19 -0
  75. package/dist/generated/types/pub/techne/draft/approval.d.ts +18 -0
  76. package/dist/generated/types/pub/techne/draft/approval.js +12 -0
  77. package/dist/generated/types/pub/techne/draft/assessment.d.ts +36 -0
  78. package/dist/generated/types/pub/techne/draft/assessment.js +26 -0
  79. package/dist/generated/types/pub/techne/draft/attentionPrefs.d.ts +14 -0
  80. package/dist/generated/types/pub/techne/draft/attentionPrefs.js +12 -0
  81. package/dist/generated/types/pub/techne/draft/beacon.d.ts +17 -0
  82. package/dist/generated/types/pub/techne/draft/beacon.js +12 -0
  83. package/dist/generated/types/pub/techne/draft/beaconLists.d.ts +13 -0
  84. package/dist/generated/types/pub/techne/draft/beaconLists.js +12 -0
  85. package/dist/generated/types/pub/techne/draft/beaconSpot.d.ts +17 -0
  86. package/dist/generated/types/pub/techne/draft/beaconSpot.js +12 -0
  87. package/dist/generated/types/pub/techne/draft/block.d.ts +14 -0
  88. package/dist/generated/types/pub/techne/draft/block.js +12 -0
  89. package/dist/generated/types/pub/techne/draft/channelVerification.d.ts +15 -0
  90. package/dist/generated/types/pub/techne/draft/channelVerification.js +12 -0
  91. package/dist/generated/types/pub/techne/draft/circleBeacon.d.ts +14 -0
  92. package/dist/generated/types/pub/techne/draft/circleBeacon.js +12 -0
  93. package/dist/generated/types/pub/techne/draft/collective.d.ts +29 -0
  94. package/dist/generated/types/pub/techne/draft/collective.js +12 -0
  95. package/dist/generated/types/pub/techne/draft/commons/createServiceAccount.d.ts +47 -0
  96. package/dist/generated/types/pub/techne/draft/commons/createServiceAccount.js +55 -0
  97. package/dist/generated/types/pub/techne/draft/commons/getVersions.d.ts +78 -0
  98. package/dist/generated/types/pub/techne/draft/commons/getVersions.js +41 -0
  99. package/dist/generated/types/pub/techne/draft/commons/moveAccountHandle.d.ts +45 -0
  100. package/dist/generated/types/pub/techne/draft/commons/moveAccountHandle.js +48 -0
  101. package/dist/generated/types/pub/techne/draft/commons/runChain.d.ts +53 -0
  102. package/dist/generated/types/pub/techne/draft/commons/runChain.js +34 -0
  103. package/dist/generated/types/pub/techne/draft/connection.d.ts +16 -0
  104. package/dist/generated/types/pub/techne/draft/connection.js +12 -0
  105. package/dist/generated/types/pub/techne/draft/contact.d.ts +20 -0
  106. package/dist/generated/types/pub/techne/draft/contact.js +12 -0
  107. package/dist/generated/types/pub/techne/draft/contactChannel.d.ts +18 -0
  108. package/dist/generated/types/pub/techne/draft/contactChannel.js +12 -0
  109. package/dist/generated/types/pub/techne/draft/contactList.d.ts +14 -0
  110. package/dist/generated/types/pub/techne/draft/contactList.js +12 -0
  111. package/dist/generated/types/pub/techne/draft/containedIn.d.ts +17 -0
  112. package/dist/generated/types/pub/techne/draft/containedIn.js +12 -0
  113. package/dist/generated/types/pub/techne/draft/credential.d.ts +39 -0
  114. package/dist/generated/types/pub/techne/draft/credential.js +19 -0
  115. package/dist/generated/types/pub/techne/draft/credentialRevocation.d.ts +14 -0
  116. package/dist/generated/types/pub/techne/draft/credentialRevocation.js +12 -0
  117. package/dist/generated/types/pub/techne/draft/derivation.d.ts +50 -0
  118. package/dist/generated/types/pub/techne/draft/derivation.js +26 -0
  119. package/dist/generated/types/pub/techne/draft/description.d.ts +17 -0
  120. package/dist/generated/types/pub/techne/draft/description.js +12 -0
  121. package/dist/generated/types/pub/techne/draft/distinctFrom.d.ts +15 -0
  122. package/dist/generated/types/pub/techne/draft/distinctFrom.js +12 -0
  123. package/dist/generated/types/pub/techne/draft/evaluation.d.ts +18 -0
  124. package/dist/generated/types/pub/techne/draft/evaluation.js +12 -0
  125. package/dist/generated/types/pub/techne/draft/event/config.d.ts +22 -0
  126. package/dist/generated/types/pub/techne/draft/event/config.js +12 -0
  127. package/dist/generated/types/pub/techne/draft/event/detail.d.ts +25 -0
  128. package/dist/generated/types/pub/techne/draft/event/detail.js +12 -0
  129. package/dist/generated/types/pub/techne/draft/event/listing.d.ts +14 -0
  130. package/dist/generated/types/pub/techne/draft/event/listing.js +12 -0
  131. package/dist/generated/types/pub/techne/draft/feed/recipe.d.ts +50 -0
  132. package/dist/generated/types/pub/techne/draft/feed/recipe.js +26 -0
  133. package/dist/generated/types/pub/techne/draft/geo.d.ts +19 -0
  134. package/dist/generated/types/pub/techne/draft/geo.js +12 -0
  135. package/dist/generated/types/pub/techne/draft/heldAt.d.ts +17 -0
  136. package/dist/generated/types/pub/techne/draft/heldAt.js +12 -0
  137. package/dist/generated/types/pub/techne/draft/identity/accountsForPhones.d.ts +43 -0
  138. package/dist/generated/types/pub/techne/draft/identity/accountsForPhones.js +41 -0
  139. package/dist/generated/types/pub/techne/draft/identity/attest.d.ts +48 -0
  140. package/dist/generated/types/pub/techne/draft/identity/attest.js +48 -0
  141. package/dist/generated/types/pub/techne/draft/identity/beginAddMethod.d.ts +35 -0
  142. package/dist/generated/types/pub/techne/draft/identity/beginAddMethod.js +34 -0
  143. package/dist/generated/types/pub/techne/draft/identity/checkLinkToken.d.ts +41 -0
  144. package/dist/generated/types/pub/techne/draft/identity/checkLinkToken.js +41 -0
  145. package/dist/generated/types/pub/techne/draft/identity/createCollective.d.ts +28 -0
  146. package/dist/generated/types/pub/techne/draft/identity/createCollective.js +20 -0
  147. package/dist/generated/types/pub/techne/draft/identity/createLinkToken.d.ts +47 -0
  148. package/dist/generated/types/pub/techne/draft/identity/createLinkToken.js +48 -0
  149. package/dist/generated/types/pub/techne/draft/identity/defs.d.ts +75 -0
  150. package/dist/generated/types/pub/techne/draft/identity/defs.js +53 -0
  151. package/dist/generated/types/pub/techne/draft/identity/finishAddMethod.d.ts +46 -0
  152. package/dist/generated/types/pub/techne/draft/identity/finishAddMethod.js +34 -0
  153. package/dist/generated/types/pub/techne/draft/identity/fold.d.ts +37 -0
  154. package/dist/generated/types/pub/techne/draft/identity/fold.js +34 -0
  155. package/dist/generated/types/pub/techne/draft/identity/holdForPhone.d.ts +54 -0
  156. package/dist/generated/types/pub/techne/draft/identity/holdForPhone.js +41 -0
  157. package/dist/generated/types/pub/techne/draft/identity/link.d.ts +35 -0
  158. package/dist/generated/types/pub/techne/draft/identity/link.js +34 -0
  159. package/dist/generated/types/pub/techne/draft/identity/linkRedeemed.d.ts +46 -0
  160. package/dist/generated/types/pub/techne/draft/identity/linkRedeemed.js +48 -0
  161. package/dist/generated/types/pub/techne/draft/identity/linkRedemption.d.ts +18 -0
  162. package/dist/generated/types/pub/techne/draft/identity/linkRedemption.js +12 -0
  163. package/dist/generated/types/pub/techne/draft/identity/listLinkRedemptions.d.ts +36 -0
  164. package/dist/generated/types/pub/techne/draft/identity/listLinkRedemptions.js +41 -0
  165. package/dist/generated/types/pub/techne/draft/identity/listLinkTokens.d.ts +39 -0
  166. package/dist/generated/types/pub/techne/draft/identity/listLinkTokens.js +41 -0
  167. package/dist/generated/types/pub/techne/draft/identity/listMethods.d.ts +24 -0
  168. package/dist/generated/types/pub/techne/draft/identity/listMethods.js +20 -0
  169. package/dist/generated/types/pub/techne/draft/identity/listPhoneHolds.d.ts +49 -0
  170. package/dist/generated/types/pub/techne/draft/identity/listPhoneHolds.js +34 -0
  171. package/dist/generated/types/pub/techne/draft/identity/redeemLinkToken.d.ts +47 -0
  172. package/dist/generated/types/pub/techne/draft/identity/redeemLinkToken.js +55 -0
  173. package/dist/generated/types/pub/techne/draft/identity/releasePhoneHold.d.ts +32 -0
  174. package/dist/generated/types/pub/techne/draft/identity/releasePhoneHold.js +34 -0
  175. package/dist/generated/types/pub/techne/draft/identity/resetLinkToken.d.ts +45 -0
  176. package/dist/generated/types/pub/techne/draft/identity/resetLinkToken.js +48 -0
  177. package/dist/generated/types/pub/techne/draft/identity/resolve.d.ts +39 -0
  178. package/dist/generated/types/pub/techne/draft/identity/resolve.js +34 -0
  179. package/dist/generated/types/pub/techne/draft/identity/revokeLinkToken.d.ts +36 -0
  180. package/dist/generated/types/pub/techne/draft/identity/revokeLinkToken.js +41 -0
  181. package/dist/generated/types/pub/techne/draft/identity/unlinkAccount.d.ts +29 -0
  182. package/dist/generated/types/pub/techne/draft/identity/unlinkAccount.js +27 -0
  183. package/dist/generated/types/pub/techne/draft/identity/unlinkMethod.d.ts +32 -0
  184. package/dist/generated/types/pub/techne/draft/identity/unlinkMethod.js +34 -0
  185. package/dist/generated/types/pub/techne/draft/interest.d.ts +14 -0
  186. package/dist/generated/types/pub/techne/draft/interest.js +12 -0
  187. package/dist/generated/types/pub/techne/draft/introProposal.d.ts +28 -0
  188. package/dist/generated/types/pub/techne/draft/introProposal.js +19 -0
  189. package/dist/generated/types/pub/techne/draft/invite.d.ts +16 -0
  190. package/dist/generated/types/pub/techne/draft/invite.js +12 -0
  191. package/dist/generated/types/pub/techne/draft/market/ask.d.ts +18 -0
  192. package/dist/generated/types/pub/techne/draft/market/ask.js +12 -0
  193. package/dist/generated/types/pub/techne/draft/market/offer.d.ts +14 -0
  194. package/dist/generated/types/pub/techne/draft/market/offer.js +12 -0
  195. package/dist/generated/types/pub/techne/draft/membership.d.ts +22 -0
  196. package/dist/generated/types/pub/techne/draft/membership.js +12 -0
  197. package/dist/generated/types/pub/techne/draft/notificationState.d.ts +18 -0
  198. package/dist/generated/types/pub/techne/draft/notificationState.js +12 -0
  199. package/dist/generated/types/pub/techne/draft/operator.d.ts +20 -0
  200. package/dist/generated/types/pub/techne/draft/operator.js +12 -0
  201. package/dist/generated/types/pub/techne/draft/org.d.ts +42 -0
  202. package/dist/generated/types/pub/techne/draft/org.js +19 -0
  203. package/dist/generated/types/pub/techne/draft/passage.d.ts +18 -0
  204. package/dist/generated/types/pub/techne/draft/passage.js +12 -0
  205. package/dist/generated/types/pub/techne/draft/pendingBeaconSpot.d.ts +19 -0
  206. package/dist/generated/types/pub/techne/draft/pendingBeaconSpot.js +12 -0
  207. package/dist/generated/types/pub/techne/draft/permissioned/deleteRecord.d.ts +47 -0
  208. package/dist/generated/types/pub/techne/draft/permissioned/deleteRecord.js +55 -0
  209. package/dist/generated/types/pub/techne/draft/permissioned/getGrants.d.ts +32 -0
  210. package/dist/generated/types/pub/techne/draft/permissioned/getGrants.js +34 -0
  211. package/dist/generated/types/pub/techne/draft/permissioned/getRecord.d.ts +36 -0
  212. package/dist/generated/types/pub/techne/draft/permissioned/getRecord.js +34 -0
  213. package/dist/generated/types/pub/techne/draft/permissioned/listChanges.d.ts +71 -0
  214. package/dist/generated/types/pub/techne/draft/permissioned/listChanges.js +41 -0
  215. package/dist/generated/types/pub/techne/draft/permissioned/listRecords.d.ts +53 -0
  216. package/dist/generated/types/pub/techne/draft/permissioned/listRecords.js +34 -0
  217. package/dist/generated/types/pub/techne/draft/permissioned/putRecord.d.ts +70 -0
  218. package/dist/generated/types/pub/techne/draft/permissioned/putRecord.js +76 -0
  219. package/dist/generated/types/pub/techne/draft/permissioned/putRecords.d.ts +84 -0
  220. package/dist/generated/types/pub/techne/draft/permissioned/putRecords.js +69 -0
  221. package/dist/generated/types/pub/techne/draft/place.d.ts +36 -0
  222. package/dist/generated/types/pub/techne/draft/place.js +19 -0
  223. package/dist/generated/types/pub/techne/draft/post.d.ts +30 -0
  224. package/dist/generated/types/pub/techne/draft/post.js +19 -0
  225. package/dist/generated/types/pub/techne/draft/presence.d.ts +16 -0
  226. package/dist/generated/types/pub/techne/draft/presence.js +12 -0
  227. package/dist/generated/types/pub/techne/draft/profile.d.ts +53 -0
  228. package/dist/generated/types/pub/techne/draft/profile.js +33 -0
  229. package/dist/generated/types/pub/techne/draft/provenance.d.ts +52 -0
  230. package/dist/generated/types/pub/techne/draft/provenance.js +33 -0
  231. package/dist/generated/types/pub/techne/draft/publisher.d.ts +43 -0
  232. package/dist/generated/types/pub/techne/draft/publisher.js +19 -0
  233. package/dist/generated/types/pub/techne/draft/query/countRecords.d.ts +47 -0
  234. package/dist/generated/types/pub/techne/draft/query/countRecords.js +34 -0
  235. package/dist/generated/types/pub/techne/draft/query/getRecords.d.ts +86 -0
  236. package/dist/generated/types/pub/techne/draft/query/getRecords.js +48 -0
  237. package/dist/generated/types/pub/techne/draft/query/listRecords.d.ts +83 -0
  238. package/dist/generated/types/pub/techne/draft/query/listRecords.js +34 -0
  239. package/dist/generated/types/pub/techne/draft/query/listRejections.d.ts +50 -0
  240. package/dist/generated/types/pub/techne/draft/query/listRejections.js +27 -0
  241. package/dist/generated/types/pub/techne/draft/questionSet.d.ts +31 -0
  242. package/dist/generated/types/pub/techne/draft/questionSet.js +19 -0
  243. package/dist/generated/types/pub/techne/draft/receipt.d.ts +16 -0
  244. package/dist/generated/types/pub/techne/draft/receipt.js +12 -0
  245. package/dist/generated/types/pub/techne/draft/reflection.d.ts +20 -0
  246. package/dist/generated/types/pub/techne/draft/reflection.js +12 -0
  247. package/dist/generated/types/pub/techne/draft/retirement.d.ts +16 -0
  248. package/dist/generated/types/pub/techne/draft/retirement.js +12 -0
  249. package/dist/generated/types/pub/techne/draft/rsvpNote.d.ts +16 -0
  250. package/dist/generated/types/pub/techne/draft/rsvpNote.js +12 -0
  251. package/dist/generated/types/pub/techne/draft/sameAs.d.ts +15 -0
  252. package/dist/generated/types/pub/techne/draft/sameAs.js +12 -0
  253. package/dist/generated/types/pub/techne/draft/scraper/cursor.d.ts +17 -0
  254. package/dist/generated/types/pub/techne/draft/scraper/cursor.js +12 -0
  255. package/dist/generated/types/pub/techne/draft/scraper/raw.d.ts +31 -0
  256. package/dist/generated/types/pub/techne/draft/scraper/raw.js +12 -0
  257. package/dist/generated/types/pub/techne/draft/share.d.ts +14 -0
  258. package/dist/generated/types/pub/techne/draft/share.js +12 -0
  259. package/dist/generated/types/pub/techne/draft/source.d.ts +23 -0
  260. package/dist/generated/types/pub/techne/draft/source.js +12 -0
  261. package/dist/generated/types/pub/techne/draft/sourceAttribution.d.ts +25 -0
  262. package/dist/generated/types/pub/techne/draft/sourceAttribution.js +12 -0
  263. package/dist/generated/types/pub/techne/draft/sourceRef.d.ts +23 -0
  264. package/dist/generated/types/pub/techne/draft/sourceRef.js +12 -0
  265. package/dist/generated/types/pub/techne/draft/subjectPrefs.d.ts +18 -0
  266. package/dist/generated/types/pub/techne/draft/subjectPrefs.js +12 -0
  267. package/dist/generated/types/pub/techne/draft/sync/indexRecord.d.ts +48 -0
  268. package/dist/generated/types/pub/techne/draft/sync/indexRecord.js +55 -0
  269. package/dist/generated/types/pub/techne/draft/verdict.d.ts +16 -0
  270. package/dist/generated/types/pub/techne/draft/verdict.js +12 -0
  271. package/dist/generated/types/pub/techne/draft/verification.d.ts +14 -0
  272. package/dist/generated/types/pub/techne/draft/verification.js +12 -0
  273. package/dist/generated/types/pub/techne/draft/weeklyCheckIn.d.ts +21 -0
  274. package/dist/generated/types/pub/techne/draft/weeklyCheckIn.js +12 -0
  275. package/dist/generated/types/social/scenius/approveAppAccess.d.ts +36 -0
  276. package/dist/generated/types/social/scenius/approveAppAccess.js +27 -0
  277. package/dist/generated/types/social/scenius/createCirclePost.d.ts +39 -0
  278. package/dist/generated/types/social/scenius/createCirclePost.js +41 -0
  279. package/dist/generated/types/social/scenius/createContactInvite.d.ts +41 -0
  280. package/dist/generated/types/social/scenius/createContactInvite.js +34 -0
  281. package/dist/generated/types/social/scenius/deleteCirclePost.d.ts +34 -0
  282. package/dist/generated/types/social/scenius/deleteCirclePost.js +34 -0
  283. package/dist/generated/types/social/scenius/deleteCircleProfile.d.ts +33 -0
  284. package/dist/generated/types/social/scenius/deleteCircleProfile.js +34 -0
  285. package/dist/generated/types/social/scenius/getAppAccess.d.ts +30 -0
  286. package/dist/generated/types/social/scenius/getAppAccess.js +27 -0
  287. package/dist/generated/types/social/scenius/getAppConfig.d.ts +26 -0
  288. package/dist/generated/types/social/scenius/getAppConfig.js +7 -0
  289. package/dist/generated/types/social/scenius/getCircleThread.d.ts +48 -0
  290. package/dist/generated/types/social/scenius/getCircleThread.js +41 -0
  291. package/dist/generated/types/social/scenius/getContactInvite.d.ts +37 -0
  292. package/dist/generated/types/social/scenius/getContactInvite.js +27 -0
  293. package/dist/generated/types/social/scenius/listAppAccess.d.ts +35 -0
  294. package/dist/generated/types/social/scenius/listAppAccess.js +27 -0
  295. package/dist/generated/types/social/scenius/listCirclePosts.d.ts +47 -0
  296. package/dist/generated/types/social/scenius/listCirclePosts.js +34 -0
  297. package/dist/generated/types/social/scenius/listCircleProfiles.d.ts +50 -0
  298. package/dist/generated/types/social/scenius/listCircleProfiles.js +41 -0
  299. package/dist/generated/types/social/scenius/previewContactInvite.d.ts +37 -0
  300. package/dist/generated/types/social/scenius/previewContactInvite.js +34 -0
  301. package/dist/generated/types/social/scenius/putCircleProfile.d.ts +39 -0
  302. package/dist/generated/types/social/scenius/putCircleProfile.js +41 -0
  303. package/dist/generated/types/social/scenius/redeemContactInvite.d.ts +43 -0
  304. package/dist/generated/types/social/scenius/redeemContactInvite.js +48 -0
  305. package/dist/generated/types/social/scenius/revokeContactInvite.d.ts +33 -0
  306. package/dist/generated/types/social/scenius/revokeContactInvite.js +20 -0
  307. package/dist/generated/util.d.ts +36 -0
  308. package/dist/generated/util.js +32 -0
  309. package/dist/links/index.d.ts +65 -0
  310. package/dist/links/index.js +119 -0
  311. package/dist/platform.d.ts +14 -0
  312. package/dist/platform.js +16 -0
  313. package/dist/put/contacts.d.ts +29 -0
  314. package/dist/put/contacts.js +109 -0
  315. package/dist/put/index.d.ts +148 -0
  316. package/dist/put/index.js +252 -0
  317. package/dist/query/hosts.d.ts +77 -0
  318. package/dist/query/hosts.js +227 -0
  319. package/dist/query/index.d.ts +201 -0
  320. package/dist/query/index.js +167 -0
  321. package/dist/versions/index.d.ts +121 -0
  322. package/dist/versions/index.js +90 -0
  323. package/dist/versions/react.d.ts +53 -0
  324. package/dist/versions/react.js +81 -0
  325. package/dist/wasm/index.d.ts +85 -0
  326. package/dist/wasm/index.js +51 -0
  327. package/dist/wasm/load.d.ts +2 -0
  328. package/dist/wasm/load.js +16 -0
  329. package/dist/wasm/load.native.d.ts +11 -0
  330. package/dist/wasm/load.native.js +3 -0
  331. package/dist/wasm/techne-wasm.gen.d.ts +2 -0
  332. package/dist/wasm/techne-wasm.gen.js +3 -0
  333. package/dist/wasm/techne-wasm2js.gen.d.ts +6 -0
  334. package/dist/wasm/techne-wasm2js.gen.js +90467 -0
  335. package/package.json +136 -4
@@ -0,0 +1,37 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc';
5
+ export type QueryParams = {};
6
+ export interface InputSchema {
7
+ /** Opaque bearer token from the URL fragment. */
8
+ token: string;
9
+ }
10
+ export interface OutputSchema {
11
+ inviterDid: string;
12
+ /** The inviter's public profile name, when present. */
13
+ inviterName?: string;
14
+ recipientDid: string;
15
+ expiresAt: string;
16
+ }
17
+ export interface CallOptions {
18
+ signal?: AbortSignal;
19
+ headers?: HeadersMap;
20
+ qp?: QueryParams;
21
+ encoding?: 'application/json';
22
+ }
23
+ export interface Response {
24
+ success: boolean;
25
+ headers: HeadersMap;
26
+ data: OutputSchema;
27
+ }
28
+ export declare class AuthenticationRequiredError extends XRPCError {
29
+ constructor(src: XRPCError);
30
+ }
31
+ export declare class RecordNotFoundError extends XRPCError {
32
+ constructor(src: XRPCError);
33
+ }
34
+ export declare class RateLimitExceededError extends XRPCError {
35
+ constructor(src: XRPCError);
36
+ }
37
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { XRPCError } from '@atproto/xrpc';
5
+ import { validate as _validate } from '../../../lexicons.js';
6
+ import { is$typed as _is$typed } from '../../../util.js';
7
+ const is$typed = _is$typed, validate = _validate;
8
+ const id = 'social.scenius.previewContactInvite';
9
+ export class AuthenticationRequiredError extends XRPCError {
10
+ constructor(src) {
11
+ super(src.status, src.error, src.message, src.headers, { cause: src });
12
+ }
13
+ }
14
+ export class RecordNotFoundError extends XRPCError {
15
+ constructor(src) {
16
+ super(src.status, src.error, src.message, src.headers, { cause: src });
17
+ }
18
+ }
19
+ export class RateLimitExceededError extends XRPCError {
20
+ constructor(src) {
21
+ super(src.status, src.error, src.message, src.headers, { cause: src });
22
+ }
23
+ }
24
+ export function toKnownErr(e) {
25
+ if (e instanceof XRPCError) {
26
+ if (e.error === 'AuthenticationRequired')
27
+ return new AuthenticationRequiredError(e);
28
+ if (e.error === 'RecordNotFound')
29
+ return new RecordNotFoundError(e);
30
+ if (e.error === 'RateLimitExceeded')
31
+ return new RateLimitExceededError(e);
32
+ }
33
+ return e;
34
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc';
5
+ import type * as PubTechneDraftActorProfile from '../../pub/techne/draft/actor/profile.js';
6
+ export type QueryParams = {};
7
+ export interface InputSchema {
8
+ /** Canonical collective DID that fits one record key. The caller owns the circle space; no roster or space manifest is created. */
9
+ collective: string;
10
+ profile: PubTechneDraftActorProfile.Main;
11
+ }
12
+ export interface OutputSchema {
13
+ uri: string;
14
+ cid: string;
15
+ }
16
+ export interface CallOptions {
17
+ signal?: AbortSignal;
18
+ headers?: HeadersMap;
19
+ qp?: QueryParams;
20
+ encoding?: 'application/json';
21
+ }
22
+ export interface Response {
23
+ success: boolean;
24
+ headers: HeadersMap;
25
+ data: OutputSchema;
26
+ }
27
+ export declare class InvalidRequestError extends XRPCError {
28
+ constructor(src: XRPCError);
29
+ }
30
+ export declare class AuthenticationRequiredError extends XRPCError {
31
+ constructor(src: XRPCError);
32
+ }
33
+ export declare class NotFoundError extends XRPCError {
34
+ constructor(src: XRPCError);
35
+ }
36
+ export declare class NotAuthorizedError extends XRPCError {
37
+ constructor(src: XRPCError);
38
+ }
39
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { XRPCError } from '@atproto/xrpc';
5
+ import { validate as _validate } from '../../../lexicons.js';
6
+ import { is$typed as _is$typed } from '../../../util.js';
7
+ const is$typed = _is$typed, validate = _validate;
8
+ const id = 'social.scenius.putCircleProfile';
9
+ export class InvalidRequestError extends XRPCError {
10
+ constructor(src) {
11
+ super(src.status, src.error, src.message, src.headers, { cause: src });
12
+ }
13
+ }
14
+ export class AuthenticationRequiredError extends XRPCError {
15
+ constructor(src) {
16
+ super(src.status, src.error, src.message, src.headers, { cause: src });
17
+ }
18
+ }
19
+ export class NotFoundError extends XRPCError {
20
+ constructor(src) {
21
+ super(src.status, src.error, src.message, src.headers, { cause: src });
22
+ }
23
+ }
24
+ export class NotAuthorizedError extends XRPCError {
25
+ constructor(src) {
26
+ super(src.status, src.error, src.message, src.headers, { cause: src });
27
+ }
28
+ }
29
+ export function toKnownErr(e) {
30
+ if (e instanceof XRPCError) {
31
+ if (e.error === 'InvalidRequest')
32
+ return new InvalidRequestError(e);
33
+ if (e.error === 'AuthenticationRequired')
34
+ return new AuthenticationRequiredError(e);
35
+ if (e.error === 'NotFound')
36
+ return new NotFoundError(e);
37
+ if (e.error === 'NotAuthorized')
38
+ return new NotAuthorizedError(e);
39
+ }
40
+ return e;
41
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc';
5
+ export type QueryParams = {};
6
+ export interface InputSchema {
7
+ /** Opaque bearer token from the URL fragment. */
8
+ token: string;
9
+ /** A caller-chosen retry key. */
10
+ requestId: string;
11
+ }
12
+ export interface OutputSchema {
13
+ connected: boolean;
14
+ /** Whether Beacon access convergence remains pending. True whenever the contact has Beacon access rules, including rules for beacons that have since ended, which will not share. */
15
+ sharingPending: boolean;
16
+ }
17
+ export interface CallOptions {
18
+ signal?: AbortSignal;
19
+ headers?: HeadersMap;
20
+ qp?: QueryParams;
21
+ encoding?: 'application/json';
22
+ }
23
+ export interface Response {
24
+ success: boolean;
25
+ headers: HeadersMap;
26
+ data: OutputSchema;
27
+ }
28
+ export declare class AuthenticationRequiredError extends XRPCError {
29
+ constructor(src: XRPCError);
30
+ }
31
+ export declare class RecordNotFoundError extends XRPCError {
32
+ constructor(src: XRPCError);
33
+ }
34
+ export declare class StaleRecordError extends XRPCError {
35
+ constructor(src: XRPCError);
36
+ }
37
+ export declare class IdentityConflictError extends XRPCError {
38
+ constructor(src: XRPCError);
39
+ }
40
+ export declare class RateLimitExceededError extends XRPCError {
41
+ constructor(src: XRPCError);
42
+ }
43
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { XRPCError } from '@atproto/xrpc';
5
+ import { validate as _validate } from '../../../lexicons.js';
6
+ import { is$typed as _is$typed } from '../../../util.js';
7
+ const is$typed = _is$typed, validate = _validate;
8
+ const id = 'social.scenius.redeemContactInvite';
9
+ export class AuthenticationRequiredError extends XRPCError {
10
+ constructor(src) {
11
+ super(src.status, src.error, src.message, src.headers, { cause: src });
12
+ }
13
+ }
14
+ export class RecordNotFoundError extends XRPCError {
15
+ constructor(src) {
16
+ super(src.status, src.error, src.message, src.headers, { cause: src });
17
+ }
18
+ }
19
+ export class StaleRecordError extends XRPCError {
20
+ constructor(src) {
21
+ super(src.status, src.error, src.message, src.headers, { cause: src });
22
+ }
23
+ }
24
+ export class IdentityConflictError extends XRPCError {
25
+ constructor(src) {
26
+ super(src.status, src.error, src.message, src.headers, { cause: src });
27
+ }
28
+ }
29
+ export class RateLimitExceededError extends XRPCError {
30
+ constructor(src) {
31
+ super(src.status, src.error, src.message, src.headers, { cause: src });
32
+ }
33
+ }
34
+ export function toKnownErr(e) {
35
+ if (e instanceof XRPCError) {
36
+ if (e.error === 'AuthenticationRequired')
37
+ return new AuthenticationRequiredError(e);
38
+ if (e.error === 'RecordNotFound')
39
+ return new RecordNotFoundError(e);
40
+ if (e.error === 'StaleRecord')
41
+ return new StaleRecordError(e);
42
+ if (e.error === 'IdentityConflict')
43
+ return new IdentityConflictError(e);
44
+ if (e.error === 'RateLimitExceeded')
45
+ return new RateLimitExceededError(e);
46
+ }
47
+ return e;
48
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc';
5
+ export type QueryParams = {};
6
+ export interface InputSchema {
7
+ contact: string;
8
+ inviteId: string;
9
+ /** A caller-chosen retry key. */
10
+ requestId: string;
11
+ }
12
+ export interface OutputSchema {
13
+ inviteId: string;
14
+ /** Always empty for a revoked result. */
15
+ url: string;
16
+ expiresAt: string;
17
+ state: 'revoked' | (string & {});
18
+ }
19
+ export interface CallOptions {
20
+ signal?: AbortSignal;
21
+ headers?: HeadersMap;
22
+ qp?: QueryParams;
23
+ encoding?: 'application/json';
24
+ }
25
+ export interface Response {
26
+ success: boolean;
27
+ headers: HeadersMap;
28
+ data: OutputSchema;
29
+ }
30
+ export declare class InvalidRequestError extends XRPCError {
31
+ constructor(src: XRPCError);
32
+ }
33
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { XRPCError } from '@atproto/xrpc';
5
+ import { validate as _validate } from '../../../lexicons.js';
6
+ import { is$typed as _is$typed } from '../../../util.js';
7
+ const is$typed = _is$typed, validate = _validate;
8
+ const id = 'social.scenius.revokeContactInvite';
9
+ export class InvalidRequestError extends XRPCError {
10
+ constructor(src) {
11
+ super(src.status, src.error, src.message, src.headers, { cause: src });
12
+ }
13
+ }
14
+ export function toKnownErr(e) {
15
+ if (e instanceof XRPCError) {
16
+ if (e.error === 'InvalidRequest')
17
+ return new InvalidRequestError(e);
18
+ }
19
+ return e;
20
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { type ValidationResult } from '@atproto/lexicon';
5
+ export type OmitKey<T, K extends keyof T> = {
6
+ [K2 in keyof T as K2 extends K ? never : K2]: T[K2];
7
+ };
8
+ export type $Typed<V, T extends string = string> = V & {
9
+ $type: T;
10
+ };
11
+ export type Un$Typed<V extends {
12
+ $type?: string;
13
+ }> = OmitKey<V, '$type'>;
14
+ export type $Type<Id extends string, Hash extends string> = Hash extends 'main' ? Id : `${Id}#${Hash}`;
15
+ export type $TypedObject<V, Id extends string, Hash extends string> = V extends {
16
+ $type: $Type<Id, Hash>;
17
+ } ? V : V extends {
18
+ $type?: string;
19
+ } ? V extends {
20
+ $type?: infer T extends $Type<Id, Hash>;
21
+ } ? V & {
22
+ $type: T;
23
+ } : never : V & {
24
+ $type: $Type<Id, Hash>;
25
+ };
26
+ export declare function is$typed<V, Id extends string, Hash extends string>(v: V, id: Id, hash: Hash): v is $TypedObject<V, Id, Hash>;
27
+ export declare function maybe$typed<V, Id extends string, Hash extends string>(v: V, id: Id, hash: Hash): v is V & object & {
28
+ $type?: $Type<Id, Hash>;
29
+ };
30
+ export type Validator<R = unknown> = (v: unknown) => ValidationResult<R>;
31
+ export type ValidatorParam<V extends Validator> = V extends Validator<infer R> ? R : never;
32
+ /**
33
+ * Utility function that allows to convert a "validate*" utility function into a
34
+ * type predicate.
35
+ */
36
+ export declare function asPredicate<V extends Validator>(validate: V): <T>(v: T) => v is T & ValidatorParam<V>;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ function isObject(v) {
5
+ return v != null && typeof v === 'object';
6
+ }
7
+ function is$type($type, id, hash) {
8
+ return hash === 'main'
9
+ ? $type === id
10
+ : // $type === `${id}#${hash}`
11
+ typeof $type === 'string' &&
12
+ $type.length === id.length + 1 + hash.length &&
13
+ $type.charCodeAt(id.length) === 35 /* '#' */ &&
14
+ $type.startsWith(id) &&
15
+ $type.endsWith(hash);
16
+ }
17
+ export function is$typed(v, id, hash) {
18
+ return isObject(v) && '$type' in v && is$type(v.$type, id, hash);
19
+ }
20
+ export function maybe$typed(v, id, hash) {
21
+ return (isObject(v) &&
22
+ ('$type' in v ? v.$type === undefined || is$type(v.$type, id, hash) : true));
23
+ }
24
+ /**
25
+ * Utility function that allows to convert a "validate*" utility function into a
26
+ * type predicate.
27
+ */
28
+ export function asPredicate(validate) {
29
+ return function (v) {
30
+ return validate(v).success;
31
+ };
32
+ }
@@ -0,0 +1,65 @@
1
+ import type { Techne } from '../connect.js';
2
+ import type * as Defs from '../generated/types/pub/techne/draft/identity/defs.js';
3
+ import type * as Create from '../generated/types/pub/techne/draft/identity/createLinkToken.js';
4
+ import type * as Redeem from '../generated/types/pub/techne/draft/identity/redeemLinkToken.js';
5
+ import type * as Check from '../generated/types/pub/techne/draft/identity/checkLinkToken.js';
6
+ import type * as Reset from '../generated/types/pub/techne/draft/identity/resetLinkToken.js';
7
+ export type LinkGrant = Defs.LinkGrant;
8
+ export type LinkTokenView = Defs.LinkTokenView;
9
+ export type LinkTokenListed = Defs.LinkTokenListed;
10
+ export type LinkRedemption = Defs.LinkRedemptionView;
11
+ export type Redemption = Redeem.OutputSchema;
12
+ /** The message every unusable link answers with (unknown, used, revoked or expired alike). */
13
+ export declare const LINK_NOT_USABLE = "this link no longer works";
14
+ /** The link is unknown, used, revoked or expired; which is not said. */
15
+ export declare class LinkNotUsableError extends Error {
16
+ constructor(options?: {
17
+ cause?: unknown;
18
+ });
19
+ }
20
+ /** The caller made this link; they cannot redeem it themselves. */
21
+ export declare class OwnLinkError extends Error {
22
+ constructor(options?: {
23
+ cause?: unknown;
24
+ });
25
+ }
26
+ /** What a link is for: the app (a label of the caller's) and its target (a URI with a scheme). */
27
+ export interface LinkFor {
28
+ app: string;
29
+ target: string;
30
+ }
31
+ /** A new link: the token to put in the URL, and its view (`link.id` is its id). */
32
+ export type NewLink = Create.OutputSchema;
33
+ /** A new link for `app` and `target`: one-time unless `reusable`, live until `expiresAt` if given. */
34
+ export declare function createLink(techne: Techne, input: LinkFor & {
35
+ reusable?: boolean;
36
+ expiresAt?: Date | string;
37
+ grant?: LinkGrant;
38
+ }): Promise<NewLink>;
39
+ /**
40
+ * A fresh reusable link for `app` and `target`, revoking the live reusable ones it replaces. Without
41
+ * `grant` it carries over the newest unrevoked grant of a reusable link for the same app and target (a
42
+ * one-time link's grant is never carried); with neither, the new link has no grant.
43
+ */
44
+ export declare function resetLink(techne: Techne, input: LinkFor & {
45
+ grant?: LinkGrant;
46
+ }): Promise<Reset.OutputSchema>;
47
+ /** Revoke one of the caller's links; `false` when they have no link with this id or it was already revoked. */
48
+ export declare function revokeLink(techne: Techne, id: string): Promise<boolean>;
49
+ /** The caller's live links for `app` and `target`, in no promised order. */
50
+ export declare function listLinks(techne: Techne, input: LinkFor): Promise<LinkTokenListed[]>;
51
+ /** Who redeemed one of the caller's links, and when (empty for a link that is not theirs). */
52
+ export declare function linkRedemptions(techne: Techne, id: string): Promise<LinkRedemption[]>;
53
+ /**
54
+ * Redeem `token` as the signed-in user. Throws {@link LinkNotUsableError} for a link that no longer
55
+ * works and {@link OwnLinkError} for the caller's own; a repeat by the same account answers `repeat`.
56
+ */
57
+ export declare function redeemLink(techne: Techne, token: string): Promise<Redemption>;
58
+ /** What a live token is for: the lexicon's answer with every field a live one carries. */
59
+ export type LiveLink = Required<Pick<Check.OutputSchema, 'id' | 'app' | 'target' | 'owner' | 'reusable'>> & Pick<Check.OutputSchema, 'expiresAt'> & {
60
+ live: true;
61
+ };
62
+ /** Whether `token` is live, and if so what it is for; a dead or unknown one says nothing more. */
63
+ export declare function checkLink(techne: Techne, token: string): Promise<LiveLink | {
64
+ live: false;
65
+ }>;
@@ -0,0 +1,119 @@
1
+ /**
2
+ * techne-sdk/links — link tokens (techne P19.2): a link someone opens to get something from you.
3
+ *
4
+ * The handshake: the maker asks for a link (`createLinkToken`) and gets a secret token to put in a URL.
5
+ * Whoever opens that URL, signed in, redeems the token (`redeemLinkToken`); the identity PDS that keeps
6
+ * the token records who redeemed it and tells the platform. A one-time link works for its first
7
+ * redeemer only (anyone after is refused, the first redeemer asking again gets `repeat: true`); a
8
+ * reusable link works once for each account. The maker can list, reset and revoke their links and see
9
+ * who redeemed one. Anyone, signed in or not, can ask whether a token is live (`checkLink`); a dead or
10
+ * unknown token says only `live: false`.
11
+ *
12
+ * What a redemption grants is the app's to say: `grant` is a write template (`{actAs, write}`, the
13
+ * phone hold's), with `"$subject"` where the redeemer's DID goes, that the platform writes as `actAs`
14
+ * for each account that redeems the link (for example an `accessRule` in the maker's personal space
15
+ * naming `"$subject"`: "share this with whoever opens the link"). The platform checks when the link is
16
+ * made that the maker can write as `actAs`. A link to something public needs no token: send the URL.
17
+ *
18
+ * The grant lands shortly after `redeemLink` answers (the identity PDS reports the redemption before it
19
+ * answers, so usually first); read the granted thing again if it is not there yet.
20
+ *
21
+ * Every call goes to the platform through the user's PDS (`techne.platform`, `atproto-proxy`), like
22
+ * `put`; the platform relays it to the identity PDS. An account not on the identity PDS gets
23
+ * `NotSupported`.
24
+ */
25
+ import { XRPCError } from '@atproto/xrpc';
26
+ /** The message every unusable link answers with (unknown, used, revoked or expired alike). */
27
+ export const LINK_NOT_USABLE = 'this link no longer works';
28
+ /** The link is unknown, used, revoked or expired; which is not said. */
29
+ export class LinkNotUsableError extends Error {
30
+ constructor(options) {
31
+ super(LINK_NOT_USABLE, options);
32
+ this.name = 'LinkNotUsableError';
33
+ }
34
+ }
35
+ /** The caller made this link; they cannot redeem it themselves. */
36
+ export class OwnLinkError extends Error {
37
+ constructor(options) {
38
+ super('this is your own link', options);
39
+ this.name = 'OwnLinkError';
40
+ }
41
+ }
42
+ function mapped(e) {
43
+ if (e instanceof XRPCError) {
44
+ if (e.error === 'LinkNotUsable')
45
+ return new LinkNotUsableError({ cause: e });
46
+ if (e.error === 'OwnLink')
47
+ return new OwnLinkError({ cause: e });
48
+ }
49
+ return e;
50
+ }
51
+ async function withLinkErrors(p) {
52
+ try {
53
+ return await p;
54
+ }
55
+ catch (e) {
56
+ throw mapped(e);
57
+ }
58
+ }
59
+ const iso = (at) => (at instanceof Date ? at.toISOString() : at);
60
+ /** A new link for `app` and `target`: one-time unless `reusable`, live until `expiresAt` if given. */
61
+ export async function createLink(techne, input) {
62
+ const body = { app: input.app, target: input.target, reusable: input.reusable ?? false };
63
+ if (input.expiresAt !== undefined)
64
+ body.expiresAt = iso(input.expiresAt);
65
+ if (input.grant)
66
+ body.grant = input.grant;
67
+ const { data } = await withLinkErrors(techne.platform.pub.techne.draft.identity.createLinkToken(body));
68
+ return data;
69
+ }
70
+ /**
71
+ * A fresh reusable link for `app` and `target`, revoking the live reusable ones it replaces. Without
72
+ * `grant` it carries over the newest unrevoked grant of a reusable link for the same app and target (a
73
+ * one-time link's grant is never carried); with neither, the new link has no grant.
74
+ */
75
+ export async function resetLink(techne, input) {
76
+ const { data } = await withLinkErrors(techne.platform.pub.techne.draft.identity.resetLinkToken({ app: input.app, target: input.target, ...(input.grant ? { grant: input.grant } : {}) }));
77
+ return data;
78
+ }
79
+ /** Revoke one of the caller's links; `false` when they have no link with this id or it was already revoked. */
80
+ export async function revokeLink(techne, id) {
81
+ const { data } = await withLinkErrors(techne.platform.pub.techne.draft.identity.revokeLinkToken({ id }));
82
+ return data.revoked;
83
+ }
84
+ /** The caller's live links for `app` and `target`, in no promised order. */
85
+ export async function listLinks(techne, input) {
86
+ const { data } = await withLinkErrors(techne.platform.pub.techne.draft.identity.listLinkTokens({ app: input.app, target: input.target }));
87
+ return data.links;
88
+ }
89
+ /** Who redeemed one of the caller's links, and when (empty for a link that is not theirs). */
90
+ export async function linkRedemptions(techne, id) {
91
+ const { data } = await withLinkErrors(techne.platform.pub.techne.draft.identity.listLinkRedemptions({ id }));
92
+ return data.redemptions;
93
+ }
94
+ /**
95
+ * Redeem `token` as the signed-in user. Throws {@link LinkNotUsableError} for a link that no longer
96
+ * works and {@link OwnLinkError} for the caller's own; a repeat by the same account answers `repeat`.
97
+ */
98
+ export async function redeemLink(techne, token) {
99
+ const { data } = await withLinkErrors(techne.platform.pub.techne.draft.identity.redeemLinkToken({ token }));
100
+ return data;
101
+ }
102
+ /** Whether `token` is live, and if so what it is for; a dead or unknown one says nothing more. */
103
+ export async function checkLink(techne, token) {
104
+ const { data } = await withLinkErrors(techne.platform.pub.techne.draft.identity.checkLinkToken({ token }));
105
+ return liveLink(data);
106
+ }
107
+ /** A live answer missing what a live link carries is the platform's fault: it throws, never reads as dead. */
108
+ function liveLink(data) {
109
+ if (!data.live)
110
+ return { live: false };
111
+ const { id, app, target, owner, reusable, expiresAt } = data;
112
+ if (!id || !app || !target || !owner || typeof reusable !== 'boolean') {
113
+ throw new Error('checkLinkToken answered live without id, app, target, owner and reusable');
114
+ }
115
+ const out = { live: true, id, app, target, owner, reusable };
116
+ if (expiresAt)
117
+ out.expiresAt = expiresAt;
118
+ return out;
119
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The Techne platform's service DID, the one name every audience the sign-in scopes build comes from
3
+ * (`techne-sdk/auth`). Internal: `techne-sdk/auth` re-exports {@link TECHNE_PLATFORM_DID}.
4
+ *
5
+ * It is the production name, `did:web:techne.computer`, whose document is
6
+ * `https://techne.computer/.well-known/did.json`. A test deployment (a `did:plc`) passes its own DID as
7
+ * the `platform` option instead.
8
+ */
9
+ /** The platform's service DID (production). */
10
+ export declare const TECHNE_PLATFORM_DID = "did:web:techne.computer";
11
+ /** The fragment naming the platform's service in its DID document. */
12
+ export declare const APPVIEW_SERVICE_ID = "#atproto_appview";
13
+ /** `did#atproto_appview`: what `atproto-proxy` and a permission set's `aud` name. */
14
+ export declare function appviewRef(platform?: string): string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The Techne platform's service DID, the one name every audience the sign-in scopes build comes from
3
+ * (`techne-sdk/auth`). Internal: `techne-sdk/auth` re-exports {@link TECHNE_PLATFORM_DID}.
4
+ *
5
+ * It is the production name, `did:web:techne.computer`, whose document is
6
+ * `https://techne.computer/.well-known/did.json`. A test deployment (a `did:plc`) passes its own DID as
7
+ * the `platform` option instead.
8
+ */
9
+ /** The platform's service DID (production). */
10
+ export const TECHNE_PLATFORM_DID = 'did:web:techne.computer';
11
+ /** The fragment naming the platform's service in its DID document. */
12
+ export const APPVIEW_SERVICE_ID = '#atproto_appview';
13
+ /** `did#atproto_appview`: what `atproto-proxy` and a permission set's `aud` name. */
14
+ export function appviewRef(platform = TECHNE_PLATFORM_DID) {
15
+ return `${platform}${APPVIEW_SERVICE_ID}`;
16
+ }
@@ -0,0 +1,29 @@
1
+ import type { Techne } from '../connect.js';
2
+ type Raw = {
3
+ [k: string]: unknown;
4
+ };
5
+ /** One of the owner's stored contacts, as `permissioned.listRecords` answers it. */
6
+ export interface StoredContact {
7
+ uri: string;
8
+ value: Raw;
9
+ }
10
+ /** One contact write the check refuses. */
11
+ export interface ContactConflict {
12
+ uri: string;
13
+ error: 'IdentityConflict' | 'Archived' | 'DuplicatePhone' | 'InvalidPhone';
14
+ message: string;
15
+ }
16
+ /** A put that would change who a contact is: nothing was written. */
17
+ export declare class ContactConflictError extends Error {
18
+ readonly conflicts: ContactConflict[];
19
+ name: string;
20
+ constructor(conflicts: ContactConflict[]);
21
+ }
22
+ /** What the contact writes in `writes` would do to `stored` (the owner's contacts), refused or not. */
23
+ export declare function contactConflicts(stored: StoredContact[], writes: {
24
+ uri: string;
25
+ record: object;
26
+ }[]): ContactConflict[];
27
+ /** Every contact the owner has, through the platform's private read (one page after another). */
28
+ export declare function storedContacts(techne: Techne): Promise<StoredContact[]>;
29
+ export {};