techne-sdk 0.3.4 → 0.4.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 (59) hide show
  1. package/CHANGELOG.md +159 -0
  2. package/README.md +3 -1
  3. package/dist/auth/account.d.ts +67 -0
  4. package/dist/auth/account.js +136 -0
  5. package/dist/auth/hosts.d.ts +4 -0
  6. package/dist/auth/hosts.js +4 -0
  7. package/dist/auth/index.d.ts +30 -5
  8. package/dist/auth/index.js +80 -12
  9. package/dist/catalog/catalog.gen.d.ts +24 -24
  10. package/dist/catalog/catalog.gen.js +1256 -85
  11. package/dist/generated/index.d.ts +9 -0
  12. package/dist/generated/index.js +27 -0
  13. package/dist/generated/lexicons.d.ts +1539 -147
  14. package/dist/generated/lexicons.js +1020 -202
  15. package/dist/generated/nsid.d.ts +18 -0
  16. package/dist/generated/nsid.js +18 -0
  17. package/dist/generated/nsid.json +18 -0
  18. package/dist/generated/types/pub/techne/draft/beacon.d.ts +2 -0
  19. package/dist/generated/types/pub/techne/draft/collective.d.ts +1 -1
  20. package/dist/generated/types/pub/techne/draft/commons/moveAccountHandle.d.ts +3 -0
  21. package/dist/generated/types/pub/techne/draft/commons/moveAccountHandle.js +7 -0
  22. package/dist/generated/types/pub/techne/draft/identity/attest.d.ts +6 -0
  23. package/dist/generated/types/pub/techne/draft/identity/attest.js +14 -0
  24. package/dist/generated/types/pub/techne/draft/identity/beginAddMethod.d.ts +6 -0
  25. package/dist/generated/types/pub/techne/draft/identity/beginAddMethod.js +14 -0
  26. package/dist/generated/types/pub/techne/draft/identity/cancelPendingChange.d.ts +29 -0
  27. package/dist/generated/types/pub/techne/draft/identity/cancelPendingChange.js +27 -0
  28. package/dist/generated/types/pub/techne/draft/identity/defs.d.ts +22 -4
  29. package/dist/generated/types/pub/techne/draft/identity/defs.js +7 -0
  30. package/dist/generated/types/pub/techne/draft/identity/finishAddMethod.d.ts +12 -0
  31. package/dist/generated/types/pub/techne/draft/identity/finishAddMethod.js +28 -0
  32. package/dist/generated/types/pub/techne/draft/identity/fold.d.ts +3 -0
  33. package/dist/generated/types/pub/techne/draft/identity/fold.js +7 -0
  34. package/dist/generated/types/pub/techne/draft/identity/holdForPhone.d.ts +1 -1
  35. package/dist/generated/types/pub/techne/draft/identity/link.d.ts +3 -0
  36. package/dist/generated/types/pub/techne/draft/identity/link.js +7 -0
  37. package/dist/generated/types/pub/techne/draft/identity/listMethods.d.ts +6 -1
  38. package/dist/generated/types/pub/techne/draft/identity/manageMethods.d.ts +225 -0
  39. package/dist/generated/types/pub/techne/draft/identity/manageMethods.js +209 -0
  40. package/dist/generated/types/pub/techne/draft/identity/openAccountPage.d.ts +40 -0
  41. package/dist/generated/types/pub/techne/draft/identity/openAccountPage.js +55 -0
  42. package/dist/generated/types/pub/techne/draft/identity/resolve.d.ts +10 -0
  43. package/dist/generated/types/pub/techne/draft/identity/unlinkMethod.d.ts +6 -0
  44. package/dist/generated/types/pub/techne/draft/identity/unlinkMethod.js +7 -0
  45. package/dist/generated/types/pub/techne/draft/membership.d.ts +1 -1
  46. package/dist/generated/types/pub/techne/draft/permissioned/deleteRecord.d.ts +3 -0
  47. package/dist/generated/types/pub/techne/draft/permissioned/deleteRecord.js +7 -0
  48. package/dist/generated/types/pub/techne/draft/permissioned/putRecord.d.ts +3 -0
  49. package/dist/generated/types/pub/techne/draft/permissioned/putRecord.js +7 -0
  50. package/dist/generated/types/pub/techne/draft/permissioned/putRecords.d.ts +5 -2
  51. package/dist/generated/types/pub/techne/draft/permissioned/putRecords.js +7 -0
  52. package/dist/generated/types/pub/techne/draft/registry/blockIndex.d.ts +7 -1
  53. package/dist/generated/types/pub/techne/draft/registry/blockIndex.js +17 -3
  54. package/dist/generated/types/pub/techne/draft/registry/purgeType.d.ts +7 -1
  55. package/dist/generated/types/pub/techne/draft/registry/purgeType.js +17 -3
  56. package/dist/generated/types/pub/techne/draft/summary.d.ts +2 -0
  57. package/dist/wasm/techne-wasm.gen.js +1 -1
  58. package/dist/wasm/techne-wasm2js.gen.js +9950 -9947
  59. package/package.json +2 -1
@@ -0,0 +1,225 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc';
5
+ import { type ValidationResult } from '@atproto/lexicon';
6
+ import type * as PubTechneDraftIdentityDefs from './defs.js';
7
+ import type * as PubTechneDraftIdentityFinishAddMethod from './finishAddMethod.js';
8
+ export type QueryParams = {};
9
+ export interface InputSchema {
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 & {});
12
+ /** The signed-in account. Required for every op but `notices`, `noticesSent`, `dueDeletes` and `dueDeletesDone`. */
13
+ did?: string;
14
+ stepUp?: StepUp;
15
+ /** The method acted on (its `id` in `list` or `signInMethods`). */
16
+ method?: string;
17
+ /** The pending change `cancel` cancels. */
18
+ pending?: string;
19
+ /** With `freeze`: also sign out everywhere. */
20
+ signOut?: boolean;
21
+ external?: External;
22
+ /** A recovery code, for `redeemCode`. */
23
+ code?: string;
24
+ /** Notice ids, for `noticesSent`. */
25
+ ids?: number[];
26
+ /** Retired, not read: a bare list has no verification dates, so the cutoff can't hold. importBackupEmails without `backupEmails` is 400 InvalidRequest. */
27
+ emails?: string[];
28
+ /** importBackupEmails: the account's verified backup email addresses, all of them, each with when the PDS verified it. */
29
+ backupEmails?: BackupEmail[];
30
+ /** dueDeletesDone: the accounts whose PDS account was deleted. */
31
+ dids?: string[];
32
+ channel?: PubTechneDraftIdentityDefs.Channel;
33
+ /** fold / link: the offer's token from addChannel. */
34
+ token?: string;
35
+ /** link: which of the two accounts is the primary. */
36
+ primary?: string;
37
+ /** setPrograms: on or off. */
38
+ on?: boolean;
39
+ /** A program made this request: a session or token the PDS's programmatic sign-in opened. Account security is refused (ProgramRefused). */
40
+ program?: boolean;
41
+ }
42
+ export interface OutputSchema {
43
+ 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. */
45
+ status?: 'done' | 'pending' | 'deleted' | 'deleting' | 'bound' | 'invalid' | 'hasRecovery' | 'indexOff' | 'alreadyImported' | 'added' | 'alreadyYours' | 'boundElsewhere' | 'unavailable' | 'folded' | 'linked' | 'none' | (string & {});
46
+ 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. */
48
+ method?: string;
49
+ /** newRecoveryCodes: the codes, shown once. */
50
+ codes?: string[];
51
+ methods?: PubTechneDraftIdentityDefs.MethodView[];
52
+ hasRecovery?: boolean;
53
+ notices?: Notice[];
54
+ /** noticesSent / dueDeletesDone: how many were confirmed. */
55
+ count?: number;
56
+ /** signInMethods: the account's methods that can sign in now (not frozen), oldest first. */
57
+ signInMethods?: SignInMethod[];
58
+ to?: NoticeTo;
59
+ /** importBackupEmails: each address sent, with what happened to it. */
60
+ imported?: ImportedEmail[];
61
+ /** dueDeletes: accounts to delete on the PDS, oldest first. */
62
+ dueDeletes?: DueDelete[];
63
+ offer?: PubTechneDraftIdentityFinishAddMethod.Offer;
64
+ /** fold: the kept account. findKey: the account the key signs in to. */
65
+ did?: string;
66
+ /** fold: the account folded in and deleted. */
67
+ emptied?: string;
68
+ link?: PubTechneDraftIdentityDefs.LinkView;
69
+ /** findKey: the key's method is frozen now and can't sign in. */
70
+ frozen?: boolean;
71
+ /** findKey: "Programs can sign in with this key" is on. */
72
+ programs?: boolean;
73
+ /** operator: whether `did` is one of the platform's operators. */
74
+ operator?: boolean;
75
+ }
76
+ export interface CallOptions {
77
+ signal?: AbortSignal;
78
+ headers?: HeadersMap;
79
+ qp?: QueryParams;
80
+ encoding?: 'application/json';
81
+ }
82
+ export interface Response {
83
+ success: boolean;
84
+ headers: HeadersMap;
85
+ data: OutputSchema;
86
+ }
87
+ export declare class BadSignatureError extends XRPCError {
88
+ constructor(src: XRPCError);
89
+ }
90
+ export declare class InvalidRequestError extends XRPCError {
91
+ constructor(src: XRPCError);
92
+ }
93
+ export declare class UnknownAccountError extends XRPCError {
94
+ constructor(src: XRPCError);
95
+ }
96
+ export declare class RateLimitExceededError extends XRPCError {
97
+ constructor(src: XRPCError);
98
+ }
99
+ export declare class UnavailableError extends XRPCError {
100
+ constructor(src: XRPCError);
101
+ }
102
+ export declare class NotFoundError extends XRPCError {
103
+ constructor(src: XRPCError);
104
+ }
105
+ export declare class NotYourMethodError extends XRPCError {
106
+ constructor(src: XRPCError);
107
+ }
108
+ export declare class LastMethodError extends XRPCError {
109
+ constructor(src: XRPCError);
110
+ }
111
+ export declare class RecoveryProtectedError extends XRPCError {
112
+ constructor(src: XRPCError);
113
+ }
114
+ export declare class NeedsRecoveryMethodError extends XRPCError {
115
+ constructor(src: XRPCError);
116
+ }
117
+ export declare class StepUpRequiredError extends XRPCError {
118
+ constructor(src: XRPCError);
119
+ }
120
+ export declare class SameMethodError extends XRPCError {
121
+ constructor(src: XRPCError);
122
+ }
123
+ export declare class MethodFrozenError extends XRPCError {
124
+ constructor(src: XRPCError);
125
+ }
126
+ export declare class InvalidTokenError extends XRPCError {
127
+ constructor(src: XRPCError);
128
+ }
129
+ export declare class ProtectedAccountError extends XRPCError {
130
+ constructor(src: XRPCError);
131
+ }
132
+ export declare class NotEmptyError extends XRPCError {
133
+ constructor(src: XRPCError);
134
+ }
135
+ export declare class ProgramRefusedError extends XRPCError {
136
+ constructor(src: XRPCError);
137
+ }
138
+ export declare class ProgramsOnError extends XRPCError {
139
+ constructor(src: XRPCError);
140
+ }
141
+ export declare class IsRecoveryError extends XRPCError {
142
+ constructor(src: XRPCError);
143
+ }
144
+ export declare function toKnownErr(e: any): any;
145
+ /** What the PDS's step-up proved. */
146
+ export interface StepUp {
147
+ $type?: 'pub.techne.draft.identity.manageMethods#stepUp';
148
+ method: ProvedMethod;
149
+ provedAt: string;
150
+ }
151
+ export declare function isStepUp<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "stepUp">;
152
+ export declare function validateStepUp<V>(v: V): ValidationResult<StepUp & V>;
153
+ export interface External {
154
+ $type?: 'pub.techne.draft.identity.manageMethods#external';
155
+ type: 'passkey' | 'nostr' | (string & {});
156
+ /** The passkey credential id, or the Nostr key (hex). */
157
+ ref: string;
158
+ label?: string;
159
+ }
160
+ export declare function isExternal<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "external">;
161
+ export declare function validateExternal<V>(v: V): ValidationResult<External & V>;
162
+ export interface Notice {
163
+ $type?: 'pub.techne.draft.identity.manageMethods#notice';
164
+ id: number;
165
+ 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 & {});
168
+ to: NoticeTo;
169
+ pending?: PubTechneDraftIdentityDefs.PendingChange;
170
+ createdAt: string;
171
+ }
172
+ export declare function isNotice<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "notice">;
173
+ export declare function validateNotice<V>(v: V): ValidationResult<Notice & V>;
174
+ export interface ProvedMethod {
175
+ $type?: 'pub.techne.draft.identity.manageMethods#provedMethod';
176
+ type: 'email' | 'phone' | 'passkey' | 'nostr' | 'recoveryCodes' | (string & {});
177
+ /** The email or E.164 phone, the passkey credential id, or the Nostr key (hex). None for recoveryCodes. */
178
+ value?: string;
179
+ }
180
+ export declare function isProvedMethod<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "provedMethod">;
181
+ export declare function validateProvedMethod<V>(v: V): ValidationResult<ProvedMethod & V>;
182
+ export interface NoticeTo {
183
+ $type?: 'pub.techne.draft.identity.manageMethods#noticeTo';
184
+ type: 'email' | 'phone' | 'nostr' | (string & {});
185
+ value: string;
186
+ }
187
+ export declare function isNoticeTo<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "noticeTo">;
188
+ export declare function validateNoticeTo<V>(v: V): ValidationResult<NoticeTo & V>;
189
+ /** One way to sign in, as a page may show it before anyone has signed in: an email as `***a@***e.***m` (the last character of each dot-separated part), a phone as `•••• 97` (its last two digits), a passkey or Nostr key by its label. */
190
+ export interface SignInMethod {
191
+ $type?: 'pub.techne.draft.identity.manageMethods#signInMethod';
192
+ /** The method id (for `sendTo`, and the PDS's own passkey or Nostr challenge). */
193
+ id: string;
194
+ type: 'email' | 'phone' | 'passkey' | 'nostr' | (string & {});
195
+ display: string;
196
+ }
197
+ export declare function isSignInMethod<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "signInMethod">;
198
+ export declare function validateSignInMethod<V>(v: V): ValidationResult<SignInMethod & V>;
199
+ /** One address importBackupEmails was sent, with what happened to it. */
200
+ export interface ImportedEmail {
201
+ $type?: 'pub.techne.draft.identity.manageMethods#importedEmail';
202
+ email: string;
203
+ /** `marked`: an email method of the account now, marked for recovery. `boundElsewhere`: on another account, left there. `released`: the account removed it; only adding it again binds it back. `invalid`: not an email address. `afterCutoff`: verified at or after 2026-11-13T00:00:00Z, not imported (add it and mark it under the rules). */
204
+ status: 'marked' | 'boundElsewhere' | 'released' | 'invalid' | 'afterCutoff' | (string & {});
205
+ }
206
+ export declare function isImportedEmail<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "importedEmail">;
207
+ export declare function validateImportedEmail<V>(v: V): ValidationResult<ImportedEmail & V>;
208
+ /** One backup email importBackupEmails moves, with when the PDS verified it. */
209
+ export interface BackupEmail {
210
+ $type?: 'pub.techne.draft.identity.manageMethods#backupEmail';
211
+ email: string;
212
+ /** When the PDS verified the address. Only one verified before 2026-11-13T00:00:00Z is imported. */
213
+ verifiedAt: string;
214
+ }
215
+ export declare function isBackupEmail<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "backupEmail">;
216
+ export declare function validateBackupEmail<V>(v: V): ValidationResult<BackupEmail & V>;
217
+ /** An account whose scheduled deletion ran on the platform: the PDS deletes its PDS account, then confirms (`dueDeletesDone`). An account already gone from the PDS counts as deleted. */
218
+ export interface DueDelete {
219
+ $type?: 'pub.techne.draft.identity.manageMethods#dueDelete';
220
+ did: string;
221
+ /** When the platform deleted its side. */
222
+ deletedAt: string;
223
+ }
224
+ export declare function isDueDelete<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "dueDelete">;
225
+ export declare function validateDueDelete<V>(v: V): ValidationResult<DueDelete & V>;
@@ -0,0 +1,209 @@
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.manageMethods';
9
+ export class BadSignatureError extends XRPCError {
10
+ constructor(src) {
11
+ super(src.status, src.error, src.message, src.headers, { cause: src });
12
+ }
13
+ }
14
+ export class InvalidRequestError extends XRPCError {
15
+ constructor(src) {
16
+ super(src.status, src.error, src.message, src.headers, { cause: src });
17
+ }
18
+ }
19
+ export class UnknownAccountError extends XRPCError {
20
+ constructor(src) {
21
+ super(src.status, src.error, src.message, src.headers, { cause: src });
22
+ }
23
+ }
24
+ export class RateLimitExceededError extends XRPCError {
25
+ constructor(src) {
26
+ super(src.status, src.error, src.message, src.headers, { cause: src });
27
+ }
28
+ }
29
+ export class UnavailableError extends XRPCError {
30
+ constructor(src) {
31
+ super(src.status, src.error, src.message, src.headers, { cause: src });
32
+ }
33
+ }
34
+ export class NotFoundError extends XRPCError {
35
+ constructor(src) {
36
+ super(src.status, src.error, src.message, src.headers, { cause: src });
37
+ }
38
+ }
39
+ export class NotYourMethodError extends XRPCError {
40
+ constructor(src) {
41
+ super(src.status, src.error, src.message, src.headers, { cause: src });
42
+ }
43
+ }
44
+ export class LastMethodError extends XRPCError {
45
+ constructor(src) {
46
+ super(src.status, src.error, src.message, src.headers, { cause: src });
47
+ }
48
+ }
49
+ export class RecoveryProtectedError extends XRPCError {
50
+ constructor(src) {
51
+ super(src.status, src.error, src.message, src.headers, { cause: src });
52
+ }
53
+ }
54
+ export class NeedsRecoveryMethodError extends XRPCError {
55
+ constructor(src) {
56
+ super(src.status, src.error, src.message, src.headers, { cause: src });
57
+ }
58
+ }
59
+ export class StepUpRequiredError extends XRPCError {
60
+ constructor(src) {
61
+ super(src.status, src.error, src.message, src.headers, { cause: src });
62
+ }
63
+ }
64
+ export class SameMethodError extends XRPCError {
65
+ constructor(src) {
66
+ super(src.status, src.error, src.message, src.headers, { cause: src });
67
+ }
68
+ }
69
+ export class MethodFrozenError extends XRPCError {
70
+ constructor(src) {
71
+ super(src.status, src.error, src.message, src.headers, { cause: src });
72
+ }
73
+ }
74
+ export class InvalidTokenError extends XRPCError {
75
+ constructor(src) {
76
+ super(src.status, src.error, src.message, src.headers, { cause: src });
77
+ }
78
+ }
79
+ export class ProtectedAccountError extends XRPCError {
80
+ constructor(src) {
81
+ super(src.status, src.error, src.message, src.headers, { cause: src });
82
+ }
83
+ }
84
+ export class NotEmptyError extends XRPCError {
85
+ constructor(src) {
86
+ super(src.status, src.error, src.message, src.headers, { cause: src });
87
+ }
88
+ }
89
+ export class ProgramRefusedError extends XRPCError {
90
+ constructor(src) {
91
+ super(src.status, src.error, src.message, src.headers, { cause: src });
92
+ }
93
+ }
94
+ export class ProgramsOnError extends XRPCError {
95
+ constructor(src) {
96
+ super(src.status, src.error, src.message, src.headers, { cause: src });
97
+ }
98
+ }
99
+ export class IsRecoveryError extends XRPCError {
100
+ constructor(src) {
101
+ super(src.status, src.error, src.message, src.headers, { cause: src });
102
+ }
103
+ }
104
+ export function toKnownErr(e) {
105
+ if (e instanceof XRPCError) {
106
+ if (e.error === 'BadSignature')
107
+ return new BadSignatureError(e);
108
+ if (e.error === 'InvalidRequest')
109
+ return new InvalidRequestError(e);
110
+ if (e.error === 'UnknownAccount')
111
+ return new UnknownAccountError(e);
112
+ if (e.error === 'RateLimitExceeded')
113
+ return new RateLimitExceededError(e);
114
+ if (e.error === 'Unavailable')
115
+ return new UnavailableError(e);
116
+ if (e.error === 'NotFound')
117
+ return new NotFoundError(e);
118
+ if (e.error === 'NotYourMethod')
119
+ return new NotYourMethodError(e);
120
+ if (e.error === 'LastMethod')
121
+ return new LastMethodError(e);
122
+ if (e.error === 'RecoveryProtected')
123
+ return new RecoveryProtectedError(e);
124
+ if (e.error === 'NeedsRecoveryMethod')
125
+ return new NeedsRecoveryMethodError(e);
126
+ if (e.error === 'StepUpRequired')
127
+ return new StepUpRequiredError(e);
128
+ if (e.error === 'SameMethod')
129
+ return new SameMethodError(e);
130
+ if (e.error === 'MethodFrozen')
131
+ return new MethodFrozenError(e);
132
+ if (e.error === 'InvalidToken')
133
+ return new InvalidTokenError(e);
134
+ if (e.error === 'ProtectedAccount')
135
+ return new ProtectedAccountError(e);
136
+ if (e.error === 'NotEmpty')
137
+ return new NotEmptyError(e);
138
+ if (e.error === 'ProgramRefused')
139
+ return new ProgramRefusedError(e);
140
+ if (e.error === 'ProgramsOn')
141
+ return new ProgramsOnError(e);
142
+ if (e.error === 'IsRecovery')
143
+ return new IsRecoveryError(e);
144
+ }
145
+ return e;
146
+ }
147
+ const hashStepUp = 'stepUp';
148
+ export function isStepUp(v) {
149
+ return is$typed(v, id, hashStepUp);
150
+ }
151
+ export function validateStepUp(v) {
152
+ return validate(v, id, hashStepUp);
153
+ }
154
+ const hashExternal = 'external';
155
+ export function isExternal(v) {
156
+ return is$typed(v, id, hashExternal);
157
+ }
158
+ export function validateExternal(v) {
159
+ return validate(v, id, hashExternal);
160
+ }
161
+ const hashNotice = 'notice';
162
+ export function isNotice(v) {
163
+ return is$typed(v, id, hashNotice);
164
+ }
165
+ export function validateNotice(v) {
166
+ return validate(v, id, hashNotice);
167
+ }
168
+ const hashProvedMethod = 'provedMethod';
169
+ export function isProvedMethod(v) {
170
+ return is$typed(v, id, hashProvedMethod);
171
+ }
172
+ export function validateProvedMethod(v) {
173
+ return validate(v, id, hashProvedMethod);
174
+ }
175
+ const hashNoticeTo = 'noticeTo';
176
+ export function isNoticeTo(v) {
177
+ return is$typed(v, id, hashNoticeTo);
178
+ }
179
+ export function validateNoticeTo(v) {
180
+ return validate(v, id, hashNoticeTo);
181
+ }
182
+ const hashSignInMethod = 'signInMethod';
183
+ export function isSignInMethod(v) {
184
+ return is$typed(v, id, hashSignInMethod);
185
+ }
186
+ export function validateSignInMethod(v) {
187
+ return validate(v, id, hashSignInMethod);
188
+ }
189
+ const hashImportedEmail = 'importedEmail';
190
+ export function isImportedEmail(v) {
191
+ return is$typed(v, id, hashImportedEmail);
192
+ }
193
+ export function validateImportedEmail(v) {
194
+ return validate(v, id, hashImportedEmail);
195
+ }
196
+ const hashBackupEmail = 'backupEmail';
197
+ export function isBackupEmail(v) {
198
+ return is$typed(v, id, hashBackupEmail);
199
+ }
200
+ export function validateBackupEmail(v) {
201
+ return validate(v, id, hashBackupEmail);
202
+ }
203
+ const hashDueDelete = 'dueDelete';
204
+ export function isDueDelete(v) {
205
+ return is$typed(v, id, hashDueDelete);
206
+ }
207
+ export function validateDueDelete(v) {
208
+ return validate(v, id, hashDueDelete);
209
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc';
5
+ export type QueryParams = {};
6
+ export type InputSchema = undefined;
7
+ export interface OutputSchema {
8
+ /** Open it once, before expiresAt. */
9
+ url: string;
10
+ expiresAt: string;
11
+ }
12
+ export interface CallOptions {
13
+ signal?: AbortSignal;
14
+ headers?: HeadersMap;
15
+ qp?: QueryParams;
16
+ }
17
+ export interface Response {
18
+ success: boolean;
19
+ headers: HeadersMap;
20
+ data: OutputSchema;
21
+ }
22
+ export declare class AuthenticationRequiredError extends XRPCError {
23
+ constructor(src: XRPCError);
24
+ }
25
+ export declare class NotAuthorizedError extends XRPCError {
26
+ constructor(src: XRPCError);
27
+ }
28
+ export declare class ProgramRefusedError extends XRPCError {
29
+ constructor(src: XRPCError);
30
+ }
31
+ export declare class NotFoundError extends XRPCError {
32
+ constructor(src: XRPCError);
33
+ }
34
+ export declare class RateLimitExceededError extends XRPCError {
35
+ constructor(src: XRPCError);
36
+ }
37
+ export declare class UnavailableError extends XRPCError {
38
+ constructor(src: XRPCError);
39
+ }
40
+ 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.openAccountPage';
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 NotAuthorizedError extends XRPCError {
15
+ constructor(src) {
16
+ super(src.status, src.error, src.message, src.headers, { cause: src });
17
+ }
18
+ }
19
+ export class ProgramRefusedError extends XRPCError {
20
+ constructor(src) {
21
+ super(src.status, src.error, src.message, src.headers, { cause: src });
22
+ }
23
+ }
24
+ export class NotFoundError 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 class UnavailableError 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 === 'AuthenticationRequired')
42
+ return new AuthenticationRequiredError(e);
43
+ if (e.error === 'NotAuthorized')
44
+ return new NotAuthorizedError(e);
45
+ if (e.error === 'ProgramRefused')
46
+ return new ProgramRefusedError(e);
47
+ if (e.error === 'NotFound')
48
+ return new NotFoundError(e);
49
+ if (e.error === 'RateLimitExceeded')
50
+ return new RateLimitExceededError(e);
51
+ if (e.error === 'Unavailable')
52
+ return new UnavailableError(e);
53
+ }
54
+ return e;
55
+ }
@@ -15,6 +15,16 @@ export interface OutputSchema {
15
15
  status: 'bound' | 'unbound' | 'unavailable' | (string & {});
16
16
  /** Present only with `bound`, and only when the calling PDS hosts the account. */
17
17
  did?: string;
18
+ /** Present (true) only with `unbound`: the phone number was removed from an account (identity.unlinkMethod) and nobody has bound it since. The PDS must not sign the number in to an account it kept for it before (a placeholder from an earlier sign-in); it starts a new account instead. Email channels never carry it. */
19
+ released?: boolean;
20
+ /** Present only with `released`, and only when the calling PDS hosts the account that removed the number: that account's DID. A PDS that keeps an account per phone number (a placeholder) uses it to tell two placeholders apart: the old account's, which must not sign in with this number again, and the one it started for the number's new holder after the removal, which it finds by this DID and `releaseId` and signs in until the number is bound to it. Binding the number back to this account through identity.attest is refused (`ChannelReleased`). */
21
+ releasedFrom?: string;
22
+ /** Present (true) only with `did`: this method of the account is frozen (identity.manageMethods `freeze`). The PDS refuses the sign-in and creates nothing; the account's other methods still sign in. */
23
+ frozen?: boolean;
24
+ /** Present only with `frozen`: when the freeze ends, unless a recovery method lifts it sooner. */
25
+ frozenUntil?: string;
26
+ /** Present only with `releasedFrom`: the platform's id for that removal, fresh each time the number is removed. A PDS keys the number's next holder's account on `releasedFrom` and `releaseId` together, so an account that later removed the number itself is never handed on to the holder after it. */
27
+ releaseId?: string;
18
28
  }
19
29
  export interface CallOptions {
20
30
  signal?: AbortSignal;
@@ -2,12 +2,15 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { HeadersMap, XRPCError } from '@atproto/xrpc';
5
+ import type * as PubTechneDraftIdentityDefs from './defs.js';
5
6
  export type QueryParams = {};
6
7
  export interface InputSchema {
7
8
  bid: string;
8
9
  }
9
10
  export interface OutputSchema {
10
11
  ok: boolean;
12
+ status?: 'pending' | (string & {});
13
+ pending?: PubTechneDraftIdentityDefs.PendingChange;
11
14
  }
12
15
  export interface CallOptions {
13
16
  signal?: AbortSignal;
@@ -29,4 +32,7 @@ export declare class NotFoundError extends XRPCError {
29
32
  export declare class LastMethodError extends XRPCError {
30
33
  constructor(src: XRPCError);
31
34
  }
35
+ export declare class RecoveryProtectedError extends XRPCError {
36
+ constructor(src: XRPCError);
37
+ }
32
38
  export declare function toKnownErr(e: any): any;
@@ -21,6 +21,11 @@ export class LastMethodError extends XRPCError {
21
21
  super(src.status, src.error, src.message, src.headers, { cause: src });
22
22
  }
23
23
  }
24
+ export class RecoveryProtectedError extends XRPCError {
25
+ constructor(src) {
26
+ super(src.status, src.error, src.message, src.headers, { cause: src });
27
+ }
28
+ }
24
29
  export function toKnownErr(e) {
25
30
  if (e instanceof XRPCError) {
26
31
  if (e.error === 'AuthenticationRequired')
@@ -29,6 +34,8 @@ export function toKnownErr(e) {
29
34
  return new NotFoundError(e);
30
35
  if (e.error === 'LastMethod')
31
36
  return new LastMethodError(e);
37
+ if (e.error === 'RecoveryProtected')
38
+ return new RecoveryProtectedError(e);
32
39
  }
33
40
  return e;
34
41
  }
@@ -12,7 +12,7 @@ export interface Main {
12
12
  validFrom?: string;
13
13
  /** Optional expiry; an expired claim grants nothing at policy evaluation. Our remove and leave set it to now: the membership ends, and what the member wrote while it held still counts. */
14
14
  validUntil?: string;
15
- /** The member on whose initiative the authority authored this claim. Attribution DATA carried in the claim body — stamped by the handler from the authenticated caller who passed the space's `manage` check, NEVER client-supplied, and read by NO policy predicate (the boundedness invariant is untouched: nothing evaluates access from this field). Meant for in-space (permissioned) rosters only; a firehose membership claim's `addedBy` would publish "who recruited whom" as a new world-readable social edge with no surface asking anyone's consent for that, so no PUBLIC-collective writer stamps it. Stamped by `proposeInvite` (`xrpc/invite.rs`) on in-space rosters only — carried forward from the pending claim at bind, never re-derived; never on a firehose claim. CAVEAT: deriving meaning from this field's ABSENCE would be fragile — any legacy or imported claim satisfies "absent addedBy" without having founded anything — so a future reader must not lean on absence; the intended fix, the day one is needed, is a positive `founder` marker, not stronger inference over this field's absence. */
15
+ /** The member on whose initiative the authority authored this claim. Attribution DATA carried in the claim body, read by NO policy predicate (the boundedness invariant is untouched: nothing evaluates access from this field). Who sets it: whoever writes the claim with the authority's pen. A writer holding only the write leg of a circle's member space (role 20-29, who may write adds and their own claim, nothing else) must name themselves or nobody on an add, and a re-put of their own claim keeps the stored value. A writer holding manage may put any DID here (the platform checks only that it is a DID); `proposeInvite` (`xrpc/invite.rs`) stamps the caller who passed `manage` and carries it forward from the pending claim at bind. A circle founder's own claim names themself ("Started by"); a collective made with identity.createCollective writes its founder's claim without addedBy. Meant for in-space (permissioned) rosters only; a firehose membership claim's `addedBy` would publish "who recruited whom" as a new world-readable social edge with no surface asking anyone's consent for that, so no PUBLIC-collective writer stamps it. CAVEAT: deriving meaning from this field's ABSENCE would be fragile (any legacy or imported claim satisfies "absent addedBy" without having founded anything), so a reader must not lean on absence; the intended fix, the day one is needed, is a positive `founder` marker. */
16
16
  addedBy?: string;
17
17
  createdAt: string;
18
18
  [k: string]: unknown;
@@ -34,6 +34,9 @@ export declare class InvalidRequestError extends XRPCError {
34
34
  export declare class ForbiddenError extends XRPCError {
35
35
  constructor(src: XRPCError);
36
36
  }
37
+ export declare class LastManagerError extends XRPCError {
38
+ constructor(src: XRPCError);
39
+ }
37
40
  export declare class AccountDeletingError extends XRPCError {
38
41
  constructor(src: XRPCError);
39
42
  }
@@ -16,6 +16,11 @@ export class ForbiddenError extends XRPCError {
16
16
  super(src.status, src.error, src.message, src.headers, { cause: src });
17
17
  }
18
18
  }
19
+ export class LastManagerError extends XRPCError {
20
+ constructor(src) {
21
+ super(src.status, src.error, src.message, src.headers, { cause: src });
22
+ }
23
+ }
19
24
  export class AccountDeletingError extends XRPCError {
20
25
  constructor(src) {
21
26
  super(src.status, src.error, src.message, src.headers, { cause: src });
@@ -47,6 +52,8 @@ export function toKnownErr(e) {
47
52
  return new InvalidRequestError(e);
48
53
  if (e.error === 'Forbidden')
49
54
  return new ForbiddenError(e);
55
+ if (e.error === 'LastManager')
56
+ return new LastManagerError(e);
50
57
  if (e.error === 'AccountDeleting')
51
58
  return new AccountDeletingError(e);
52
59
  if (e.error === 'InvalidSwap')
@@ -46,6 +46,9 @@ export declare class InvalidRequestError extends XRPCError {
46
46
  export declare class ForbiddenError extends XRPCError {
47
47
  constructor(src: XRPCError);
48
48
  }
49
+ export declare class LastManagerError extends XRPCError {
50
+ constructor(src: XRPCError);
51
+ }
49
52
  export declare class AccountDeletingError extends XRPCError {
50
53
  constructor(src: XRPCError);
51
54
  }