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
@@ -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 });
@@ -57,6 +62,8 @@ export function toKnownErr(e) {
57
62
  return new InvalidRequestError(e);
58
63
  if (e.error === 'Forbidden')
59
64
  return new ForbiddenError(e);
65
+ if (e.error === 'LastManager')
66
+ return new LastManagerError(e);
60
67
  if (e.error === 'AccountDeleting')
61
68
  return new AccountDeletingError(e);
62
69
  if (e.error === 'InvalidSwap')
@@ -32,6 +32,9 @@ export declare class InvalidRequestError extends XRPCError {
32
32
  export declare class ForbiddenError extends XRPCError {
33
33
  constructor(src: XRPCError);
34
34
  }
35
+ export declare class LastManagerError extends XRPCError {
36
+ constructor(src: XRPCError);
37
+ }
35
38
  export declare class AccountDeletingError extends XRPCError {
36
39
  constructor(src: XRPCError);
37
40
  }
@@ -76,8 +79,8 @@ export declare function validateWriteResult<V>(v: V): ValidationResult<WriteResu
76
79
  /** A write refused, and nothing of it written: the error putRecord would have answered. */
77
80
  export interface WriteError {
78
81
  $type?: 'pub.techne.draft.permissioned.putRecords#writeError';
79
- /** 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) or DuplicatePhone (a contact write introduces a number another of the caller's active contacts carries; see putRecord). */
80
- error: 'InvalidRequest' | 'InvalidSwap' | 'Conflict' | 'IdentityConflict' | 'DuplicatePhone' | (string & {});
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). */
83
+ error: 'InvalidRequest' | 'InvalidSwap' | 'Conflict' | 'IdentityConflict' | 'DuplicatePhone' | 'RateLimitExceeded' | 'Forbidden' | (string & {});
81
84
  message: string;
82
85
  }
83
86
  export declare function isWriteError<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.permissioned.putRecords", "writeError">;
@@ -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 });
@@ -37,6 +42,8 @@ export function toKnownErr(e) {
37
42
  return new InvalidRequestError(e);
38
43
  if (e.error === 'Forbidden')
39
44
  return new ForbiddenError(e);
45
+ if (e.error === 'LastManager')
46
+ return new LastManagerError(e);
40
47
  if (e.error === 'AccountDeleting')
41
48
  return new AccountDeletingError(e);
42
49
  if (e.error === 'AuthenticationRequired')
@@ -33,10 +33,16 @@ export interface Response {
33
33
  export declare class AuthenticationRequiredError extends XRPCError {
34
34
  constructor(src: XRPCError);
35
35
  }
36
- export declare class ForbiddenError extends XRPCError {
36
+ export declare class NotAuthorizedError extends XRPCError {
37
+ constructor(src: XRPCError);
38
+ }
39
+ export declare class ProgramRefusedError extends XRPCError {
37
40
  constructor(src: XRPCError);
38
41
  }
39
42
  export declare class UnknownTypeError extends XRPCError {
40
43
  constructor(src: XRPCError);
41
44
  }
45
+ export declare class InvalidRequestError extends XRPCError {
46
+ constructor(src: XRPCError);
47
+ }
42
48
  export declare function toKnownErr(e: any): any;
@@ -11,7 +11,12 @@ export class AuthenticationRequiredError extends XRPCError {
11
11
  super(src.status, src.error, src.message, src.headers, { cause: src });
12
12
  }
13
13
  }
14
- export class ForbiddenError extends XRPCError {
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 {
15
20
  constructor(src) {
16
21
  super(src.status, src.error, src.message, src.headers, { cause: src });
17
22
  }
@@ -21,14 +26,23 @@ export class UnknownTypeError extends XRPCError {
21
26
  super(src.status, src.error, src.message, src.headers, { cause: src });
22
27
  }
23
28
  }
29
+ export class InvalidRequestError extends XRPCError {
30
+ constructor(src) {
31
+ super(src.status, src.error, src.message, src.headers, { cause: src });
32
+ }
33
+ }
24
34
  export function toKnownErr(e) {
25
35
  if (e instanceof XRPCError) {
26
36
  if (e.error === 'AuthenticationRequired')
27
37
  return new AuthenticationRequiredError(e);
28
- if (e.error === 'Forbidden')
29
- return new ForbiddenError(e);
38
+ if (e.error === 'NotAuthorized')
39
+ return new NotAuthorizedError(e);
40
+ if (e.error === 'ProgramRefused')
41
+ return new ProgramRefusedError(e);
30
42
  if (e.error === 'UnknownType')
31
43
  return new UnknownTypeError(e);
44
+ if (e.error === 'InvalidRequest')
45
+ return new InvalidRequestError(e);
32
46
  }
33
47
  return e;
34
48
  }
@@ -30,10 +30,16 @@ export interface Response {
30
30
  export declare class AuthenticationRequiredError extends XRPCError {
31
31
  constructor(src: XRPCError);
32
32
  }
33
- export declare class ForbiddenError extends XRPCError {
33
+ export declare class NotAuthorizedError extends XRPCError {
34
+ constructor(src: XRPCError);
35
+ }
36
+ export declare class ProgramRefusedError extends XRPCError {
34
37
  constructor(src: XRPCError);
35
38
  }
36
39
  export declare class UnknownTypeError extends XRPCError {
37
40
  constructor(src: XRPCError);
38
41
  }
42
+ export declare class InvalidRequestError extends XRPCError {
43
+ constructor(src: XRPCError);
44
+ }
39
45
  export declare function toKnownErr(e: any): any;
@@ -11,7 +11,12 @@ export class AuthenticationRequiredError extends XRPCError {
11
11
  super(src.status, src.error, src.message, src.headers, { cause: src });
12
12
  }
13
13
  }
14
- export class ForbiddenError extends XRPCError {
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 {
15
20
  constructor(src) {
16
21
  super(src.status, src.error, src.message, src.headers, { cause: src });
17
22
  }
@@ -21,14 +26,23 @@ export class UnknownTypeError extends XRPCError {
21
26
  super(src.status, src.error, src.message, src.headers, { cause: src });
22
27
  }
23
28
  }
29
+ export class InvalidRequestError extends XRPCError {
30
+ constructor(src) {
31
+ super(src.status, src.error, src.message, src.headers, { cause: src });
32
+ }
33
+ }
24
34
  export function toKnownErr(e) {
25
35
  if (e instanceof XRPCError) {
26
36
  if (e.error === 'AuthenticationRequired')
27
37
  return new AuthenticationRequiredError(e);
28
- if (e.error === 'Forbidden')
29
- return new ForbiddenError(e);
38
+ if (e.error === 'NotAuthorized')
39
+ return new NotAuthorizedError(e);
40
+ if (e.error === 'ProgramRefused')
41
+ return new ProgramRefusedError(e);
30
42
  if (e.error === 'UnknownType')
31
43
  return new UnknownTypeError(e);
44
+ if (e.error === 'InvalidRequest')
45
+ return new InvalidRequestError(e);
32
46
  }
33
47
  return e;
34
48
  }
@@ -8,6 +8,8 @@ export interface Main {
8
8
  subject: ComAtprotoRepoStrongRef.Main;
9
9
  /** The line, as plain text. */
10
10
  text: string;
11
+ /** Optional: one emoji for the record (a card mark and map pin glyph). A single emoji, no flags; readers fall back to their own when absent. */
12
+ emoji?: string;
11
13
  createdAt: string;
12
14
  [k: string]: unknown;
13
15
  }