techne-sdk 0.4.0 → 0.6.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 (37) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +12 -3
  3. package/dist/auth/app-key.d.ts +5 -0
  4. package/dist/auth/app-key.js +7 -0
  5. package/dist/auth/index.d.ts +19 -11
  6. package/dist/auth/index.js +21 -13
  7. package/dist/catalog/catalog.gen.js +499 -139
  8. package/dist/connect.d.ts +18 -3
  9. package/dist/connect.js +2 -0
  10. package/dist/generated/index.d.ts +3 -0
  11. package/dist/generated/index.js +9 -0
  12. package/dist/generated/lexicons.d.ts +590 -146
  13. package/dist/generated/lexicons.js +332 -71
  14. package/dist/generated/nsid.d.ts +3 -0
  15. package/dist/generated/nsid.js +3 -0
  16. package/dist/generated/nsid.json +3 -0
  17. package/dist/generated/types/pub/techne/draft/identity/attest.d.ts +2 -0
  18. package/dist/generated/types/pub/techne/draft/identity/defs.d.ts +23 -7
  19. package/dist/generated/types/pub/techne/draft/identity/defs.js +7 -0
  20. package/dist/generated/types/pub/techne/draft/identity/finishAddMethod.d.ts +3 -0
  21. package/dist/generated/types/pub/techne/draft/identity/listMethods.d.ts +2 -1
  22. package/dist/generated/types/pub/techne/draft/identity/manageMethods.d.ts +52 -10
  23. package/dist/generated/types/pub/techne/draft/identity/manageMethods.js +56 -0
  24. package/dist/generated/types/pub/techne/draft/identity/writeAsCollective.d.ts +51 -0
  25. package/dist/generated/types/pub/techne/draft/identity/writeAsCollective.js +55 -0
  26. package/dist/generated/types/pub/techne/draft/permissioned/putRecord.d.ts +1 -1
  27. package/dist/generated/types/pub/techne/draft/permissioned/putRecords.d.ts +1 -1
  28. package/dist/generated/types/pub/techne/draft/query/getRecords.d.ts +11 -0
  29. package/dist/generated/types/pub/techne/draft/query/getRecords.js +7 -0
  30. package/dist/query/compose.d.ts +1 -1
  31. package/dist/query/compose.js +1 -1
  32. package/dist/query/index.d.ts +7 -0
  33. package/dist/query/index.js +28 -1
  34. package/dist/versions/react.js +19 -6
  35. package/dist/wasm/techne-wasm.gen.js +1 -1
  36. package/dist/wasm/techne-wasm2js.gen.js +16836 -16838
  37. package/package.json +3 -2
@@ -101,6 +101,7 @@ export declare const NSID: {
101
101
  readonly IDENTITY_DEFS_LINK_VIEW: "pub.techne.draft.identity.defs#linkView";
102
102
  readonly IDENTITY_DEFS_METHOD_VIEW: "pub.techne.draft.identity.defs#methodView";
103
103
  readonly IDENTITY_DEFS_PENDING_CHANGE: "pub.techne.draft.identity.defs#pendingChange";
104
+ readonly IDENTITY_DEFS_PERSON_MEMBER: "pub.techne.draft.identity.defs#personMember";
104
105
  readonly IDENTITY_FINISH_ADD_METHOD: "pub.techne.draft.identity.finishAddMethod";
105
106
  readonly IDENTITY_FINISH_ADD_METHOD_OFFER: "pub.techne.draft.identity.finishAddMethod#offer";
106
107
  readonly IDENTITY_FOLD: "pub.techne.draft.identity.fold";
@@ -132,6 +133,7 @@ export declare const NSID: {
132
133
  readonly IDENTITY_REVOKE_LINK_TOKEN: "pub.techne.draft.identity.revokeLinkToken";
133
134
  readonly IDENTITY_UNLINK_ACCOUNT: "pub.techne.draft.identity.unlinkAccount";
134
135
  readonly IDENTITY_UNLINK_METHOD: "pub.techne.draft.identity.unlinkMethod";
136
+ readonly IDENTITY_WRITE_AS_COLLECTIVE: "pub.techne.draft.identity.writeAsCollective";
135
137
  readonly INTEREST: "pub.techne.draft.interest";
136
138
  readonly INTRO_PROPOSAL: "pub.techne.draft.introProposal";
137
139
  readonly INTRO_PROPOSAL_PARTY_CONTEXT: "pub.techne.draft.introProposal#partyContext";
@@ -211,6 +213,7 @@ export declare const NSID: {
211
213
  readonly QUERY_GET_RECORDS_CURATION: "pub.techne.draft.query.getRecords#curation";
212
214
  readonly QUERY_GET_RECORDS_DEFAULT: "pub.techne.draft.query.getRecords#default";
213
215
  readonly QUERY_GET_RECORDS_HANDLE: "pub.techne.draft.query.getRecords#handle";
216
+ readonly QUERY_GET_RECORDS_LINKED_HANDLE: "pub.techne.draft.query.getRecords#linkedHandle";
214
217
  readonly QUERY_GET_RECORDS_RESOLVED: "pub.techne.draft.query.getRecords#resolved";
215
218
  readonly QUERY_HAS: "pub.techne.draft.query#has";
216
219
  readonly QUERY_LIST_RECORDS: "pub.techne.draft.query.listRecords";
@@ -105,6 +105,7 @@ export const NSID = {
105
105
  IDENTITY_DEFS_LINK_VIEW: 'pub.techne.draft.identity.defs#linkView',
106
106
  IDENTITY_DEFS_METHOD_VIEW: 'pub.techne.draft.identity.defs#methodView',
107
107
  IDENTITY_DEFS_PENDING_CHANGE: 'pub.techne.draft.identity.defs#pendingChange',
108
+ IDENTITY_DEFS_PERSON_MEMBER: 'pub.techne.draft.identity.defs#personMember',
108
109
  IDENTITY_FINISH_ADD_METHOD: 'pub.techne.draft.identity.finishAddMethod',
109
110
  IDENTITY_FINISH_ADD_METHOD_OFFER: 'pub.techne.draft.identity.finishAddMethod#offer',
110
111
  IDENTITY_FOLD: 'pub.techne.draft.identity.fold',
@@ -136,6 +137,7 @@ export const NSID = {
136
137
  IDENTITY_REVOKE_LINK_TOKEN: 'pub.techne.draft.identity.revokeLinkToken',
137
138
  IDENTITY_UNLINK_ACCOUNT: 'pub.techne.draft.identity.unlinkAccount',
138
139
  IDENTITY_UNLINK_METHOD: 'pub.techne.draft.identity.unlinkMethod',
140
+ IDENTITY_WRITE_AS_COLLECTIVE: 'pub.techne.draft.identity.writeAsCollective',
139
141
  INTEREST: 'pub.techne.draft.interest',
140
142
  INTRO_PROPOSAL: 'pub.techne.draft.introProposal',
141
143
  INTRO_PROPOSAL_PARTY_CONTEXT: 'pub.techne.draft.introProposal#partyContext',
@@ -215,6 +217,7 @@ export const NSID = {
215
217
  QUERY_GET_RECORDS_CURATION: 'pub.techne.draft.query.getRecords#curation',
216
218
  QUERY_GET_RECORDS_DEFAULT: 'pub.techne.draft.query.getRecords#default',
217
219
  QUERY_GET_RECORDS_HANDLE: 'pub.techne.draft.query.getRecords#handle',
220
+ QUERY_GET_RECORDS_LINKED_HANDLE: 'pub.techne.draft.query.getRecords#linkedHandle',
218
221
  QUERY_GET_RECORDS_RESOLVED: 'pub.techne.draft.query.getRecords#resolved',
219
222
  QUERY_HAS: 'pub.techne.draft.query#has',
220
223
  QUERY_LIST_RECORDS: 'pub.techne.draft.query.listRecords',
@@ -101,6 +101,7 @@
101
101
  "IDENTITY_DEFS_LINK_VIEW": "pub.techne.draft.identity.defs#linkView",
102
102
  "IDENTITY_DEFS_METHOD_VIEW": "pub.techne.draft.identity.defs#methodView",
103
103
  "IDENTITY_DEFS_PENDING_CHANGE": "pub.techne.draft.identity.defs#pendingChange",
104
+ "IDENTITY_DEFS_PERSON_MEMBER": "pub.techne.draft.identity.defs#personMember",
104
105
  "IDENTITY_FINISH_ADD_METHOD": "pub.techne.draft.identity.finishAddMethod",
105
106
  "IDENTITY_FINISH_ADD_METHOD_OFFER": "pub.techne.draft.identity.finishAddMethod#offer",
106
107
  "IDENTITY_FOLD": "pub.techne.draft.identity.fold",
@@ -132,6 +133,7 @@
132
133
  "IDENTITY_REVOKE_LINK_TOKEN": "pub.techne.draft.identity.revokeLinkToken",
133
134
  "IDENTITY_UNLINK_ACCOUNT": "pub.techne.draft.identity.unlinkAccount",
134
135
  "IDENTITY_UNLINK_METHOD": "pub.techne.draft.identity.unlinkMethod",
136
+ "IDENTITY_WRITE_AS_COLLECTIVE": "pub.techne.draft.identity.writeAsCollective",
135
137
  "INTEREST": "pub.techne.draft.interest",
136
138
  "INTRO_PROPOSAL": "pub.techne.draft.introProposal",
137
139
  "INTRO_PROPOSAL_PARTY_CONTEXT": "pub.techne.draft.introProposal#partyContext",
@@ -211,6 +213,7 @@
211
213
  "QUERY_GET_RECORDS_CURATION": "pub.techne.draft.query.getRecords#curation",
212
214
  "QUERY_GET_RECORDS_DEFAULT": "pub.techne.draft.query.getRecords#default",
213
215
  "QUERY_GET_RECORDS_HANDLE": "pub.techne.draft.query.getRecords#handle",
216
+ "QUERY_GET_RECORDS_LINKED_HANDLE": "pub.techne.draft.query.getRecords#linkedHandle",
214
217
  "QUERY_GET_RECORDS_RESOLVED": "pub.techne.draft.query.getRecords#resolved",
215
218
  "QUERY_HAS": "pub.techne.draft.query#has",
216
219
  "QUERY_LIST_RECORDS": "pub.techne.draft.query.listRecords",
@@ -13,6 +13,8 @@ export interface InputSchema {
13
13
  verifiedAt: string;
14
14
  /** The PDS created the account in this sign-in. */
15
15
  newAccount: boolean;
16
+ /** Optional; sent only as true, and only with `newAccount`. The PDS's sign-in page named its Terms of Use and Privacy Policy when this account was made there, so the issuer records the person's assent. Absent: nothing to record (a returning sign-in, a page without the line, an older PDS, or a first-party app that shows its own terms). */
17
+ termsShown?: boolean;
16
18
  }
17
19
  export interface OutputSchema {
18
20
  /** Hook protocol version. */
@@ -11,7 +11,7 @@ export interface Channel {
11
11
  }
12
12
  export declare function isChannel<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.defs", "channel">;
13
13
  export declare function validateChannel<V>(v: V): ValidationResult<Channel & V>;
14
- /** One sign-in method of the caller's account, masked. */
14
+ /** One sign-in method of an account. `masked` is always masked. Only identity.manageMethods `list` (the identity PDS's signed hook, for the signed-in owner's own account page) adds `value`; identity.listMethods never does. */
15
15
  export interface MethodView {
16
16
  $type?: 'pub.techne.draft.identity.defs#methodView';
17
17
  /** The method's id: the binding id (the credential's record key) of an email or phone, else the platform's id for it. Names the method in unlinkMethod and manageMethods. */
@@ -19,6 +19,8 @@ export interface MethodView {
19
19
  type: 'email' | 'phone' | 'passkey' | 'nostr' | 'recoveryCodes' | (string & {});
20
20
  /** The channel with most of it hidden, e.g. `j•••@example.com`, `+1 ••• ••• 4567`; a passkey's or Nostr key's label; `Recovery codes (n left)`. */
21
21
  masked: string;
22
+ /** An email's full address or a phone's full number (E.164). Sent only by identity.manageMethods `list`, to the identity PDS, for the owner's own account page; never in identity.listMethods, signInMethods or a notice. Absent on a passkey, Nostr key or recovery codes. */
23
+ value?: string;
22
24
  boundAt: string;
23
25
  /** A recovery method of this account. Private: only the account sees it. */
24
26
  recovery?: boolean;
@@ -29,30 +31,44 @@ export interface MethodView {
29
31
  }
30
32
  export declare function isMethodView<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.defs", "methodView">;
31
33
  export declare function validateMethodView<V>(v: V): ValidationResult<MethodView & V>;
32
- /** A change that waits for its time (a method's removal or the account's deletion, 7 days; the account's first recovery mark, 24 hours). Any of the account's methods, a frozen one too, can cancel it until then; a wait during which one of the account's methods was frozen (and not lifted early by a recovery method) is dropped when it runs out, not completed. */
34
+ /** A change that waits for its time (a method's removal, the account's deletion, or a method's move onto another account (identity.manageMethods moveMethod), 7 days, or none for a move a recovery method proved; the account's first recovery mark, 24 hours). A move is completed by the platform once due, tried again after a failed write, and may be dropped instead (identity.manageMethods moveMethod says when). Any of the account's methods, a frozen one too, can cancel it until then; a wait during which one of the account's methods was frozen (even if a recovery method lifted the freeze early) is dropped when it runs out, not completed. */
33
35
  export interface PendingChange {
34
36
  $type?: 'pub.techne.draft.identity.defs#pendingChange';
35
37
  id: string;
36
- kind: 'removeMethod' | 'deleteAccount' | 'markRecovery' | (string & {});
37
- /** The method it removes or marks. */
38
+ kind: 'removeMethod' | 'deleteAccount' | 'markRecovery' | 'moveMethod' | (string & {});
39
+ /** The method it removes, marks or moves (for an incoming move, the other account's method). */
38
40
  method?: string;
41
+ /** moveMethod: the other account. On the account the method leaves, where it goes; on the account it joins (identity.manageMethods `list` shows the move there too, and either account can cancel it), where it comes from. */
42
+ other?: string;
39
43
  createdAt: string;
40
44
  dueAt: string;
41
45
  }
42
46
  export declare function isPendingChange<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.defs", "pendingChange">;
43
47
  export declare function validatePendingChange<V>(v: V): ValidationResult<PendingChange & V>;
44
- /** An alias link between the caller's account and another. */
48
+ /** Another account of the caller's person: the two are linked (identity.manageMethods moveMethod), every DID of the person naming every other in `alsoKnownAs`. Linked accounts have no primary, and a link is always mutual: identity.listMethods sends `mutual` as true. */
45
49
  export interface LinkView {
46
50
  $type?: 'pub.techne.draft.identity.defs#linkView';
47
51
  /** The other account. */
48
52
  did: string;
49
53
  handle?: string;
50
- primary: string;
51
- /** Both accounts hold a matching pub.techne.draft.accountLink; a link counts only when true. */
54
+ /** Retired: a link is always mutual, and identity.listMethods sends `true` (it was: both accounts hold a matching pub.techne.draft.accountLink). */
52
55
  mutual: boolean;
56
+ /** When the two accounts became one person. */
57
+ since?: string;
53
58
  }
54
59
  export declare function isLinkView<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.defs", "linkView">;
55
60
  export declare function validateLinkView<V>(v: V): ValidationResult<LinkView & V>;
61
+ /** Another account of an account's person (identity.manageMethods `list` and moveMethod). */
62
+ export interface PersonMember {
63
+ $type?: 'pub.techne.draft.identity.defs#personMember';
64
+ did: string;
65
+ /** When it joined the person. Sent by `list`. */
66
+ since?: string;
67
+ /** Its handle, when the platform knows one. Sent in addChannel's `otherPerson`. */
68
+ handle?: string;
69
+ }
70
+ export declare function isPersonMember<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.defs", "personMember">;
71
+ export declare function validatePersonMember<V>(v: V): ValidationResult<PersonMember & V>;
56
72
  /** A link token as its owner sees it, without the token. */
57
73
  export interface LinkTokenView {
58
74
  $type?: 'pub.techne.draft.identity.defs#linkTokenView';
@@ -30,6 +30,13 @@ export function isLinkView(v) {
30
30
  export function validateLinkView(v) {
31
31
  return validate(v, id, hashLinkView);
32
32
  }
33
+ const hashPersonMember = 'personMember';
34
+ export function isPersonMember(v) {
35
+ return is$typed(v, id, hashPersonMember);
36
+ }
37
+ export function validatePersonMember(v) {
38
+ return validate(v, id, hashPersonMember);
39
+ }
33
40
  const hashLinkTokenView = 'linkTokenView';
34
41
  export function isLinkTokenView(v) {
35
42
  return is$typed(v, id, hashLinkTokenView);
@@ -13,6 +13,8 @@ export interface OutputSchema {
13
13
  status: 'added' | 'alreadyYours' | 'boundElsewhere' | 'unavailable' | (string & {});
14
14
  method?: PubTechneDraftIdentityDefs.MethodView;
15
15
  offer?: Offer;
16
+ /** `boundElsewhere` when both accounts hold something: the account the method signs in to (no `offer`). */
17
+ other?: string;
16
18
  }
17
19
  export interface CallOptions {
18
20
  signal?: AbortSignal;
@@ -46,6 +48,7 @@ export declare class UpstreamFailureError extends XRPCError {
46
48
  export declare function toKnownErr(e: any): any;
47
49
  export interface Offer {
48
50
  $type?: 'pub.techne.draft.identity.finishAddMethod#offer';
51
+ /** `fold`. (`link` is retired and no longer offered.) */
49
52
  action: 'fold' | 'link' | (string & {});
50
53
  token: string;
51
54
  /** The account the method is bound to. */
@@ -10,8 +10,9 @@ export type QueryParams = {
10
10
  export type InputSchema = undefined;
11
11
  export interface OutputSchema {
12
12
  methods: PubTechneDraftIdentityDefs.MethodView[];
13
+ /** The other accounts of the caller's person (linked with identity.manageMethods moveMethod), each with `did`, `since` and `mutual` (always true); linked accounts have no primary. Empty when it is alone. */
13
14
  links: PubTechneDraftIdentityDefs.LinkView[];
14
- /** The account's pending changes, soonest first (the account page shows them at the top, with Cancel). */
15
+ /** The account's pending changes, soonest first (the account page shows them at the top, with Cancel), a move of one of its methods onto another account included. */
15
16
  pending?: PubTechneDraftIdentityDefs.PendingChange[];
16
17
  }
17
18
  export interface CallOptions {
@@ -8,11 +8,12 @@ import type * as PubTechneDraftIdentityFinishAddMethod from './finishAddMethod.j
8
8
  export type QueryParams = {};
9
9
  export interface InputSchema {
10
10
  v: 1;
11
- op: 'list' | 'signInMethods' | 'sendTo' | 'remove' | 'cancel' | 'freeze' | 'unfreeze' | 'mark' | 'unmark' | 'signOut' | 'delete' | 'addExternal' | 'newRecoveryCodes' | 'redeemCode' | 'setPrograms' | 'importBackupEmails' | 'findKey' | 'notices' | 'noticesSent' | 'dueDeletes' | 'dueDeletesDone' | 'addChannel' | 'fold' | 'link' | 'operator' | (string & {});
11
+ /** The op. `link` is retired: it answers 400 InvalidRequest; `moveMethod` links two accounts now. */
12
+ op: 'list' | 'signInMethods' | 'sendTo' | 'remove' | 'cancel' | 'freeze' | 'unfreeze' | 'mark' | 'unmark' | 'signOut' | 'delete' | 'addExternal' | 'newRecoveryCodes' | 'redeemCode' | 'setPrograms' | 'importBackupEmails' | 'findKey' | 'notices' | 'noticesSent' | 'dueDeletes' | 'dueDeletesDone' | 'addChannel' | 'fold' | 'link' | 'moveMethod' | 'unlink' | 'operator' | (string & {});
12
13
  /** The signed-in account. Required for every op but `notices`, `noticesSent`, `dueDeletes` and `dueDeletesDone`. */
13
14
  did?: string;
14
15
  stepUp?: StepUp;
15
- /** The method acted on (its `id` in `list` or `signInMethods`). */
16
+ /** The method acted on (its `id` in `list` or `signInMethods`). moveMethod: the method of `from` that moves onto `did`. unlink: the method of `did` handed to `other` when `other` would have none left. */
16
17
  method?: string;
17
18
  /** The pending change `cancel` cancels. */
18
19
  pending?: string;
@@ -21,7 +22,7 @@ export interface InputSchema {
21
22
  external?: External;
22
23
  /** A recovery code, for `redeemCode`. */
23
24
  code?: string;
24
- /** Notice ids, for `noticesSent`. */
25
+ /** Unused, kept for older clients: notice ids for `noticesSent`, which confirms none. */
25
26
  ids?: number[];
26
27
  /** Retired, not read: a bare list has no verification dates, so the cutoff can't hold. importBackupEmails without `backupEmails` is 400 InvalidRequest. */
27
28
  emails?: string[];
@@ -30,9 +31,14 @@ export interface InputSchema {
30
31
  /** dueDeletesDone: the accounts whose PDS account was deleted. */
31
32
  dids?: string[];
32
33
  channel?: PubTechneDraftIdentityDefs.Channel;
33
- /** fold / link: the offer's token from addChannel. */
34
+ /** fold: the offer's token from addChannel. (link, retired, took one too.) */
34
35
  token?: string;
35
- /** link: which of the two accounts is the primary. */
36
+ /** moveMethod: the account the method leaves. */
37
+ from?: string;
38
+ fromStepUp?: StepUp;
39
+ /** unlink: the account that leaves `did`'s person. */
40
+ other?: string;
41
+ /** Retired, not read: it was the retired `link` op's primary account. Linked accounts have no primary. */
36
42
  primary?: string;
37
43
  /** setPrograms: on or off. */
38
44
  on?: boolean;
@@ -41,17 +47,21 @@ export interface InputSchema {
41
47
  }
42
48
  export interface OutputSchema {
43
49
  v: 1;
44
- /** `done`: it happened now. `pending`: it waits (`pending`). `deleted` / `deleting` (`delete` done now): the account is gone / its local half is gone and a sweep finishes the rest (deleteAccount's `deleted` / `pending`; a deletion that could not start answers 503 Unavailable, try again). `bound`: addExternal's key is on another account. `invalid`: redeemCode's code is wrong, used, or the set is not a recovery method or is frozen. `hasRecovery`: importBackupEmails found a recovery method on the account; nothing changed. `indexOff`: importBackupEmails can't mark anything while the identity index is off; nothing changed. `alreadyImported`: importBackupEmails ran for this account before; nothing changed. `added` / `alreadyYours` / `boundElsewhere` / `unavailable`: addChannel, as identity.finishAddMethod. `folded` / `linked`: fold / link done. `none`: findKey's key is no method of an account the calling PDS hosts. */
50
+ /** `done`: it happened now. `pending`: it waits (`pending`). `deleted` / `deleting` (`delete` done now): the account is gone / its local half is gone and a sweep finishes the rest (deleteAccount's `deleted` / `pending`; a deletion that could not start answers 503 Unavailable, try again). `bound`: addExternal's key is on another account. `invalid`: redeemCode's code is wrong, used, or the set is not a recovery method or is frozen. `hasRecovery`: importBackupEmails found a recovery method on the account; nothing changed. `indexOff`: importBackupEmails can't mark anything while the identity index is off; nothing changed. `alreadyImported`: importBackupEmails ran for this account before; nothing changed. `added` / `alreadyYours` / `boundElsewhere` / `unavailable`: addChannel, as identity.finishAddMethod. `folded`: fold done. `linked`: retired (the retired `link` op's answer). moveMethod answers `pending` only, with `pending` (the change, a defs#pendingChange) and `due`. `none`: findKey's key is no method of an account the calling PDS hosts. */
45
51
  status?: 'done' | 'pending' | 'deleted' | 'deleting' | 'bound' | 'invalid' | 'hasRecovery' | 'indexOff' | 'alreadyImported' | 'added' | 'alreadyYours' | 'boundElsewhere' | 'unavailable' | 'folded' | 'linked' | 'none' | (string & {});
46
52
  pending?: PubTechneDraftIdentityDefs.PendingChange;
47
- /** addExternal's new method id, the recovery-code set redeemCode used, or addChannel's method id when `added` or `alreadyYours` (empty while the identity index is off); findKey's method id of the key. */
53
+ /** moveMethod `pending`: when the move is due (now for one a recovery method of `from` proved, else 7 days on). The platform completes it then or after a failed try, unless it is cancelled or dropped. */
54
+ due?: string;
55
+ /** addExternal's new method id, the recovery-code set redeemCode used, or addChannel's method id when `added` or `alreadyYours` (empty while the identity index is off); findKey's method id of the key. addChannel `boundElsewhere` when both accounts hold something: the other account's method id, for `moveMethod` (identity.finishAddMethod's session answer leaves it out). */
48
56
  method?: string;
49
57
  /** newRecoveryCodes: the codes, shown once. */
50
58
  codes?: string[];
59
+ /** list: the account's methods (`value` on emails and phones; see defs#methodView). */
51
60
  methods?: PubTechneDraftIdentityDefs.MethodView[];
52
61
  hasRecovery?: boolean;
62
+ /** Unused, kept for older clients: always empty. The platform emails every notice itself. */
53
63
  notices?: Notice[];
54
- /** noticesSent / dueDeletesDone: how many were confirmed. */
64
+ /** dueDeletesDone: how many were confirmed. noticesSent (unused, kept for older clients): always 0. */
55
65
  count?: number;
56
66
  /** signInMethods: the account's methods that can sign in now (not frozen), oldest first. */
57
67
  signInMethods?: SignInMethod[];
@@ -63,8 +73,14 @@ export interface OutputSchema {
63
73
  offer?: PubTechneDraftIdentityFinishAddMethod.Offer;
64
74
  /** fold: the kept account. findKey: the account the key signs in to. */
65
75
  did?: string;
76
+ /** addChannel `boundElsewhere` when both accounts hold something: the account the channel signs in to (for `moveMethod`'s `from`). */
77
+ other?: string;
78
+ /** addChannel `boundElsewhere` (either form): the other accounts of the person of the account the channel signs in to, now (`did`, `handle` when known), that account itself left out; empty when it is alone. */
79
+ otherPerson?: PubTechneDraftIdentityDefs.PersonMember[];
66
80
  /** fold: the account folded in and deleted. */
67
81
  emptied?: string;
82
+ /** list: the other accounts of `did`'s person (empty when it is alone). moveMethod no longer answers `done`, which carried the person's accounts here. */
83
+ person?: PubTechneDraftIdentityDefs.PersonMember[];
68
84
  link?: PubTechneDraftIdentityDefs.LinkView;
69
85
  /** findKey: the key's method is frozen now and can't sign in. */
70
86
  frozen?: boolean;
@@ -141,6 +157,30 @@ export declare class ProgramsOnError extends XRPCError {
141
157
  export declare class IsRecoveryError extends XRPCError {
142
158
  constructor(src: XRPCError);
143
159
  }
160
+ export declare class FromStepUpRequiredError extends XRPCError {
161
+ constructor(src: XRPCError);
162
+ }
163
+ export declare class FrozenError extends XRPCError {
164
+ constructor(src: XRPCError);
165
+ }
166
+ export declare class PendingChangeError extends XRPCError {
167
+ constructor(src: XRPCError);
168
+ }
169
+ export declare class TooManyError extends XRPCError {
170
+ constructor(src: XRPCError);
171
+ }
172
+ export declare class SameError extends XRPCError {
173
+ constructor(src: XRPCError);
174
+ }
175
+ export declare class NoKeyError extends XRPCError {
176
+ constructor(src: XRPCError);
177
+ }
178
+ export declare class NeedsMethodError extends XRPCError {
179
+ constructor(src: XRPCError);
180
+ }
181
+ export declare class NotLinkedError extends XRPCError {
182
+ constructor(src: XRPCError);
183
+ }
144
184
  export declare function toKnownErr(e: any): any;
145
185
  /** What the PDS's step-up proved. */
146
186
  export interface StepUp {
@@ -159,12 +199,13 @@ export interface External {
159
199
  }
160
200
  export declare function isExternal<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "external">;
161
201
  export declare function validateExternal<V>(v: V): ValidationResult<External & V>;
202
+ /** Unused, kept for older clients: `notices` always answers an empty list. The platform emails every notice itself, to the account's email methods only. */
162
203
  export interface Notice {
163
204
  $type?: 'pub.techne.draft.identity.manageMethods#notice';
164
205
  id: number;
165
206
  did: string;
166
- /** What the notice is about: a change that started to wait (`removeMethod`, `deleteAccount`, `markRecovery`), a `freeze`, `waitDropped`: the change in `pending` was not completed because one of the account's methods was frozen during its wait, or `programsOn`: programs can now sign in with one of the account's Nostr keys (`setPrograms` on; no `pending`). */
167
- event: 'removeMethod' | 'deleteAccount' | 'markRecovery' | 'freeze' | 'waitDropped' | 'programsOn' | (string & {});
207
+ /** What the notice is about: a change that started to wait (`removeMethod`, `deleteAccount`, `markRecovery`, `moveMethod`), a `freeze`, `waitDropped`: the change in `pending` was not completed because one of the account's methods was frozen during its wait, `programsOn`: programs can now sign in with one of the account's Nostr keys (`setPrograms` on; no `pending`), `linked` / `unlinked`: a link (moveMethod completed) or an unlink changed the account's person, `moveDropped` / `moveTimedOut` / `moveCancelled`: a move was dropped because a key can't be used or the identity PDS refused it for good, because it still could not be written 24 hours past due, or because something changed on one of its accounts, or `akaLeft` / `emailLeft`: an `alsoKnownAs` entry or an identity-PDS account email the platform owed removing was given up and is left. */
208
+ event: 'removeMethod' | 'deleteAccount' | 'markRecovery' | 'freeze' | 'waitDropped' | 'programsOn' | 'moveMethod' | 'linked' | 'unlinked' | 'moveDropped' | 'moveTimedOut' | 'moveCancelled' | 'akaLeft' | 'emailLeft' | (string & {});
168
209
  to: NoticeTo;
169
210
  pending?: PubTechneDraftIdentityDefs.PendingChange;
170
211
  createdAt: string;
@@ -179,6 +220,7 @@ export interface ProvedMethod {
179
220
  }
180
221
  export declare function isProvedMethod<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "provedMethod">;
181
222
  export declare function validateProvedMethod<V>(v: V): ValidationResult<ProvedMethod & V>;
223
+ /** An email or phone number in full: `sendTo`'s `to`. Also the shape of #notice's `to`, which is unused and kept for older clients (notices go to email methods only). */
182
224
  export interface NoticeTo {
183
225
  $type?: 'pub.techne.draft.identity.manageMethods#noticeTo';
184
226
  type: 'email' | 'phone' | 'nostr' | (string & {});
@@ -101,6 +101,46 @@ export class IsRecoveryError extends XRPCError {
101
101
  super(src.status, src.error, src.message, src.headers, { cause: src });
102
102
  }
103
103
  }
104
+ export class FromStepUpRequiredError extends XRPCError {
105
+ constructor(src) {
106
+ super(src.status, src.error, src.message, src.headers, { cause: src });
107
+ }
108
+ }
109
+ export class FrozenError extends XRPCError {
110
+ constructor(src) {
111
+ super(src.status, src.error, src.message, src.headers, { cause: src });
112
+ }
113
+ }
114
+ export class PendingChangeError extends XRPCError {
115
+ constructor(src) {
116
+ super(src.status, src.error, src.message, src.headers, { cause: src });
117
+ }
118
+ }
119
+ export class TooManyError extends XRPCError {
120
+ constructor(src) {
121
+ super(src.status, src.error, src.message, src.headers, { cause: src });
122
+ }
123
+ }
124
+ export class SameError extends XRPCError {
125
+ constructor(src) {
126
+ super(src.status, src.error, src.message, src.headers, { cause: src });
127
+ }
128
+ }
129
+ export class NoKeyError extends XRPCError {
130
+ constructor(src) {
131
+ super(src.status, src.error, src.message, src.headers, { cause: src });
132
+ }
133
+ }
134
+ export class NeedsMethodError extends XRPCError {
135
+ constructor(src) {
136
+ super(src.status, src.error, src.message, src.headers, { cause: src });
137
+ }
138
+ }
139
+ export class NotLinkedError extends XRPCError {
140
+ constructor(src) {
141
+ super(src.status, src.error, src.message, src.headers, { cause: src });
142
+ }
143
+ }
104
144
  export function toKnownErr(e) {
105
145
  if (e instanceof XRPCError) {
106
146
  if (e.error === 'BadSignature')
@@ -141,6 +181,22 @@ export function toKnownErr(e) {
141
181
  return new ProgramsOnError(e);
142
182
  if (e.error === 'IsRecovery')
143
183
  return new IsRecoveryError(e);
184
+ if (e.error === 'FromStepUpRequired')
185
+ return new FromStepUpRequiredError(e);
186
+ if (e.error === 'Frozen')
187
+ return new FrozenError(e);
188
+ if (e.error === 'PendingChange')
189
+ return new PendingChangeError(e);
190
+ if (e.error === 'TooMany')
191
+ return new TooManyError(e);
192
+ if (e.error === 'Same')
193
+ return new SameError(e);
194
+ if (e.error === 'NoKey')
195
+ return new NoKeyError(e);
196
+ if (e.error === 'NeedsMethod')
197
+ return new NeedsMethodError(e);
198
+ if (e.error === 'NotLinked')
199
+ return new NotLinkedError(e);
144
200
  }
145
201
  return e;
146
202
  }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc';
5
+ import { type $Typed } from '../../../../../util.js';
6
+ import type * as ComAtprotoRepoApplyWrites from '../../../../com/atproto/repo/applyWrites.js';
7
+ import type * as ComAtprotoRepoDefs from '../../../../com/atproto/repo/defs.js';
8
+ export type QueryParams = {};
9
+ export interface InputSchema {
10
+ /** The collective's DID. Not the caller's own. */
11
+ repo: string;
12
+ /** As com.atproto.repo.applyWrites: passed to the collective's PDS. */
13
+ validate?: boolean;
14
+ writes: ($Typed<ComAtprotoRepoApplyWrites.Create> | $Typed<ComAtprotoRepoApplyWrites.Update> | $Typed<ComAtprotoRepoApplyWrites.Delete>)[];
15
+ /** As com.atproto.repo.applyWrites: the whole batch fails unless the collective's repo is at this commit. */
16
+ swapCommit?: string;
17
+ }
18
+ export interface OutputSchema {
19
+ commit?: ComAtprotoRepoDefs.CommitMeta;
20
+ results?: ($Typed<ComAtprotoRepoApplyWrites.CreateResult> | $Typed<ComAtprotoRepoApplyWrites.UpdateResult> | $Typed<ComAtprotoRepoApplyWrites.DeleteResult>)[];
21
+ }
22
+ export interface CallOptions {
23
+ signal?: AbortSignal;
24
+ headers?: HeadersMap;
25
+ qp?: QueryParams;
26
+ encoding?: 'application/json';
27
+ }
28
+ export interface Response {
29
+ success: boolean;
30
+ headers: HeadersMap;
31
+ data: OutputSchema;
32
+ }
33
+ export declare class InvalidRequestError extends XRPCError {
34
+ constructor(src: XRPCError);
35
+ }
36
+ export declare class ForbiddenError extends XRPCError {
37
+ constructor(src: XRPCError);
38
+ }
39
+ export declare class NotAuthorizedError extends XRPCError {
40
+ constructor(src: XRPCError);
41
+ }
42
+ export declare class LastManagerError extends XRPCError {
43
+ constructor(src: XRPCError);
44
+ }
45
+ export declare class PayloadTooLargeError extends XRPCError {
46
+ constructor(src: XRPCError);
47
+ }
48
+ export declare class RateLimitExceededError extends XRPCError {
49
+ constructor(src: XRPCError);
50
+ }
51
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,55 @@
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 = 'pub.techne.draft.identity.writeAsCollective';
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 ForbiddenError extends XRPCError {
15
+ constructor(src) {
16
+ super(src.status, src.error, src.message, src.headers, { cause: src });
17
+ }
18
+ }
19
+ export class NotAuthorizedError extends XRPCError {
20
+ constructor(src) {
21
+ super(src.status, src.error, src.message, src.headers, { cause: src });
22
+ }
23
+ }
24
+ export class LastManagerError extends XRPCError {
25
+ constructor(src) {
26
+ super(src.status, src.error, src.message, src.headers, { cause: src });
27
+ }
28
+ }
29
+ export class PayloadTooLargeError extends XRPCError {
30
+ constructor(src) {
31
+ super(src.status, src.error, src.message, src.headers, { cause: src });
32
+ }
33
+ }
34
+ export class RateLimitExceededError extends XRPCError {
35
+ constructor(src) {
36
+ super(src.status, src.error, src.message, src.headers, { cause: src });
37
+ }
38
+ }
39
+ export function toKnownErr(e) {
40
+ if (e instanceof XRPCError) {
41
+ if (e.error === 'InvalidRequest')
42
+ return new InvalidRequestError(e);
43
+ if (e.error === 'Forbidden')
44
+ return new ForbiddenError(e);
45
+ if (e.error === 'NotAuthorized')
46
+ return new NotAuthorizedError(e);
47
+ if (e.error === 'LastManager')
48
+ return new LastManagerError(e);
49
+ if (e.error === 'PayloadTooLarge')
50
+ return new PayloadTooLargeError(e);
51
+ if (e.error === 'RateLimitExceeded')
52
+ return new RateLimitExceededError(e);
53
+ }
54
+ return e;
55
+ }
@@ -26,7 +26,7 @@ export interface OutputSchema {
26
26
  rev: string;
27
27
  /** The DIDs the `share`s placed in the space the record counts in name (its authority left out), when the caller may read that space; empty otherwise. For a source space this is its whole audience beside the owner (as getGrants). */
28
28
  read: string[];
29
- /** The space the record counts in now. Absent when it counts in none (the space's write policy does not admit the writer, or a space.private space written by an app other than the one its key names). */
29
+ /** The space the record counts in now. Absent when it counts in none (the space's write policy does not admit the writer). */
30
30
  space?: string;
31
31
  }
32
32
  export interface CallOptions {
@@ -79,7 +79,7 @@ export declare function validateWriteResult<V>(v: V): ValidationResult<WriteResu
79
79
  /** A write refused, and nothing of it written: the error putRecord would have answered. */
80
80
  export interface WriteError {
81
81
  $type?: 'pub.techne.draft.permissioned.putRecords#writeError';
82
- /** InvalidRequest (malformed, a body that fails its collection's published lexicon, or a record over 2 MiB, more than a putRecord body may be), InvalidSwap (swapCid did not match the current version), Conflict (the same key holds a public record in the caller's repo, or a concurrent write replaced this version before it was recorded), IdentityConflict (the write would change a contact's identity, which writing again never fixes; see putRecord), DuplicatePhone (a contact write introduces a number another of the caller's active contacts carries; see putRecord), RateLimitExceeded (a contact write that binds a number to an account found the caller's phone lookups spent; retry it in a minute) or Forbidden (the call's `space:` scopes do not cover the write, or it replaces a record already written for an app's space and the caller is neither the app its key names nor holds `space:` scopes covering it; see putRecord). */
82
+ /** InvalidRequest (malformed, a body that fails its collection's published lexicon, or a record over 2 MiB, more than a putRecord body may be), InvalidSwap (swapCid did not match the current version), Conflict (the same key holds a public record in the caller's repo, or a concurrent write replaced this version before it was recorded), IdentityConflict (the write would change a contact's identity, which writing again never fixes; see putRecord), DuplicatePhone (a contact write introduces a number another of the caller's active contacts carries; see putRecord), RateLimitExceeded (a contact write that binds a number to an account found the caller's phone lookups spent; retry it in a minute) or Forbidden (the call's `space:` scopes do not cover the write, or it replaces a record already written for an app's space under `space:` scopes that do not cover it; see putRecord). */
83
83
  error: 'InvalidRequest' | 'InvalidSwap' | 'Conflict' | 'IdentityConflict' | 'DuplicatePhone' | 'RateLimitExceeded' | 'Forbidden' | (string & {});
84
84
  message: string;
85
85
  }
@@ -48,9 +48,20 @@ export interface Handle {
48
48
  $type?: 'pub.techne.draft.query.getRecords#handle';
49
49
  did: string;
50
50
  handle: string;
51
+ /** The other accounts linked to this one now (the same person; links are public, alsoKnownAs on both DIDs). Absent when none, and while a sign-in method of any account of the person is frozen (a freeze pauses the link). A linked account that is not active or is suspended is left out. */
52
+ linked?: LinkedHandle[];
51
53
  }
52
54
  export declare function isHandle<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.getRecords", "handle">;
53
55
  export declare function validateHandle<V>(v: V): ValidationResult<Handle & V>;
56
+ export interface LinkedHandle {
57
+ $type?: 'pub.techne.draft.query.getRecords#linkedHandle';
58
+ did: string;
59
+ handle?: string;
60
+ /** The linked account's public profile name, when it has one. */
61
+ displayName?: string;
62
+ }
63
+ export declare function isLinkedHandle<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.query.getRecords", "linkedHandle">;
64
+ export declare function validateLinkedHandle<V>(v: V): ValidationResult<LinkedHandle & V>;
54
65
  export interface Resolved {
55
66
  $type?: 'pub.techne.draft.query.getRecords#resolved';
56
67
  /** The URI asked. */
@@ -25,6 +25,13 @@ export function isHandle(v) {
25
25
  export function validateHandle(v) {
26
26
  return validate(v, id, hashHandle);
27
27
  }
28
+ const hashLinkedHandle = 'linkedHandle';
29
+ export function isLinkedHandle(v) {
30
+ return is$typed(v, id, hashLinkedHandle);
31
+ }
32
+ export function validateLinkedHandle(v) {
33
+ return validate(v, id, hashLinkedHandle);
34
+ }
28
35
  const hashResolved = 'resolved';
29
36
  export function isResolved(v) {
30
37
  return is$typed(v, id, hashResolved);
@@ -224,7 +224,7 @@ export declare class Composed {
224
224
  * than the platform reads in one step, and this throws (`<who>: step <name> matched more than …`) rather than
225
225
  * answer part of the list. */
226
226
  whole<V = Record<string, unknown>, E extends EnvelopeField = EnvelopeField, U extends boolean = true>(step: StepRef<'list', true, E, U>, who: string): StepRecord<V, E, U>[];
227
- /** A get step's answer as `getRecordsAnswer` gives it: records by URI, withheld, handles, curation, defaults.
227
+ /** A get step's answer as `getRecordsAnswer` gives it: records by URI, withheld, handles, linked, curation, defaults.
228
228
  * Only a step that keeps its records' `uri`. */
229
229
  answer<V = Record<string, unknown>, E extends EnvelopeField = EnvelopeField>(step: StepRef<'get', true, E, true>): StepAnswer<V, E>;
230
230
  /** A step's records in the order answered, list or get: the read for a step asked `uri: false`, whose records
@@ -316,7 +316,7 @@ export class Composed {
316
316
  throw new Error(`${who}: step ${step.name} matched more than ${MAX_STEP_LIMIT} records`);
317
317
  return page.records;
318
318
  }
319
- /** A get step's answer as `getRecordsAnswer` gives it: records by URI, withheld, handles, curation, defaults.
319
+ /** A get step's answer as `getRecordsAnswer` gives it: records by URI, withheld, handles, linked, curation, defaults.
320
320
  * Only a step that keeps its records' `uri`. */
321
321
  answer(step) {
322
322
  const s = this.#raw(step.name);
@@ -189,6 +189,10 @@ export declare function curationOf(c: unknown): Curation | undefined;
189
189
  /** A handle fit to show, trimmed: `undefined` when there is none, or when it is `handle.invalid` (any case),
190
190
  * what atproto reports for an account whose handle does not verify, which names no one. */
191
191
  export declare function shownHandle(handle: string | null | undefined): string | undefined;
192
+ /** Another account of the same person as a handle entry's (Linking v2: accounts linked on the identity PDS are
193
+ * one person on the platform): its DID, and its public handle (never `handle.invalid`, see {@link shownHandle})
194
+ * and profile name when it has them. The generated `getRecords#linkedHandle`. */
195
+ export type LinkedAccount = Omit<GetRecords.LinkedHandle, '$type'>;
192
196
  /** {@link getRecords}'s records, and the asked URIs moderation withheld from this caller. */
193
197
  export interface RecordsAnswer<V = Record<string, unknown>> {
194
198
  records: Map<string, QueryRecord<V>>;
@@ -196,6 +200,9 @@ export interface RecordsAnswer<V = Record<string, unknown>> {
196
200
  /** Asked with `{ handles: true }`: each named repo's public handle, by DID (empty otherwise; never
197
201
  * `handle.invalid`, see {@link shownHandle}). */
198
202
  handles: Map<string, string>;
203
+ /** Asked with `{ handles: true }`: the other accounts of each named repo's person, by DID, from each handle
204
+ * entry's `linked` (only DIDs that have some; empty otherwise, and from a platform that does not send it). */
205
+ linked: Map<string, LinkedAccount[]>;
199
206
  /** Asked with `{ curation: true }`, signed in: the curation status of each asked URI that is the
200
207
  * caller's own, by URI (empty otherwise, and for anyone else's record or a private one). */
201
208
  curation: Map<string, Curation>;