techne-sdk 0.5.0 → 0.7.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 (45) hide show
  1. package/CHANGELOG.md +54 -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 +26 -16
  7. package/dist/auth/placement.gen.d.ts +1 -1
  8. package/dist/auth/placement.gen.js +4 -0
  9. package/dist/catalog/catalog.gen.d.ts +2 -2
  10. package/dist/catalog/catalog.gen.js +1503 -133
  11. package/dist/connect.d.ts +18 -3
  12. package/dist/connect.js +2 -0
  13. package/dist/generated/index.d.ts +132 -0
  14. package/dist/generated/index.js +179 -0
  15. package/dist/generated/lexicons.d.ts +1138 -156
  16. package/dist/generated/lexicons.js +610 -63
  17. package/dist/generated/nsid.d.ts +17 -1
  18. package/dist/generated/nsid.js +17 -1
  19. package/dist/generated/nsid.json +17 -1
  20. package/dist/generated/records.d.ts +148 -140
  21. package/dist/generated/types/app/certified/defs.d.ts +20 -0
  22. package/dist/generated/types/app/certified/defs.js +18 -0
  23. package/dist/generated/types/app/certified/signature/defs.d.ts +29 -0
  24. package/dist/generated/types/app/certified/signature/defs.js +18 -0
  25. package/dist/generated/types/org/hypercerts/funding/receipt.d.ts +56 -0
  26. package/dist/generated/types/org/hypercerts/funding/receipt.js +19 -0
  27. package/dist/generated/types/pub/techne/draft/financials.d.ts +26 -0
  28. package/dist/generated/types/pub/techne/draft/financials.js +12 -0
  29. package/dist/generated/types/pub/techne/draft/identity/createCollective.d.ts +5 -0
  30. package/dist/generated/types/pub/techne/draft/identity/createCollective.js +7 -0
  31. package/dist/generated/types/pub/techne/draft/identity/defs.d.ts +1 -1
  32. package/dist/generated/types/pub/techne/draft/identity/manageMethods.d.ts +4 -1
  33. package/dist/generated/types/pub/techne/draft/identity/writeAsCollective.d.ts +51 -0
  34. package/dist/generated/types/pub/techne/draft/identity/writeAsCollective.js +55 -0
  35. package/dist/generated/types/pub/techne/draft/org.d.ts +55 -25
  36. package/dist/generated/types/pub/techne/draft/org.js +12 -5
  37. package/dist/generated/types/pub/techne/draft/orgAtPlace.d.ts +17 -0
  38. package/dist/generated/types/pub/techne/draft/orgAtPlace.js +12 -0
  39. package/dist/generated/types/pub/techne/draft/permissioned/putRecord.d.ts +1 -1
  40. package/dist/generated/types/pub/techne/draft/permissioned/putRecords.d.ts +1 -1
  41. package/dist/generated/types/pub/techne/draft/statement.d.ts +19 -0
  42. package/dist/generated/types/pub/techne/draft/statement.js +12 -0
  43. package/dist/wasm/techne-wasm.gen.js +1 -1
  44. package/dist/wasm/techne-wasm2js.gen.js +16996 -16913
  45. package/package.json +3 -2
@@ -0,0 +1,29 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { type ValidationResult } from '@atproto/lexicon';
5
+ import { type $Typed } from '../../../../util.js';
6
+ import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js';
7
+ export type List = ($Typed<Inline> | $Typed<CreatedVia> | $Typed<ComAtprotoRepoStrongRef.Main> | {
8
+ $type: string;
9
+ })[];
10
+ /** Inline attestation signature embedded directly in a record. Conforms to the ATProtocol Attestation Specification: the signed input is the 36-byte CIDv1 (dag-cbor + SHA-256) of the record with the `signatures` field removed and a temporary `$sig` metadata object (containing `$type`, `key` and the housing repository DID) inserted before canonical DAG-CBOR encoding. ECDSA with the low-S variant per BIP-0062 is required; the curve (P-256 or K-256) is determined by the multicodec prefix of the verification method's `publicKeyMultibase`. */
11
+ export interface Inline {
12
+ $type?: 'app.certified.signature.defs#inline';
13
+ /** ECDSA signature bytes (raw r,s) over the 36-byte CID of the record. Low-S variant per BIP-0062 is mandatory. */
14
+ signature: Uint8Array;
15
+ /** Full DID verification method reference (format: did:{method}:{identifier}#{fragment}). Identifies the signer and the specific key used; the key's multicodec prefix determines the signing curve. */
16
+ key: string;
17
+ }
18
+ export declare function isInline<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "app.certified.signature.defs", "inline">;
19
+ export declare function validateInline<V>(v: V): ValidationResult<Inline & V>;
20
+ /** Inline signature by the application that wrote this version of the record. It does not mean the application endorses the content. A record should carry at most one `#createdVia` signature; applications enforce this, `#list` validation does not. Signed exactly like `#inline`: `$sig` is this signature entry without its `signature` field (so `$type` and `key`), plus `repository`, the DID of the repository that holds the record. */
21
+ export interface CreatedVia {
22
+ $type?: 'app.certified.signature.defs#createdVia';
23
+ /** ECDSA signature bytes (raw r,s) over the 36-byte CID of the record. Low-S variant per BIP-0062 is mandatory. */
24
+ signature: Uint8Array;
25
+ /** DID verification method of the application's signing key. It should be in the application's own DID document, preferably a did:web on the application's domain, so that the DID names the application. */
26
+ key: string;
27
+ }
28
+ export declare function isCreatedVia<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "app.certified.signature.defs", "createdVia">;
29
+ export declare function validateCreatedVia<V>(v: V): ValidationResult<CreatedVia & V>;
@@ -0,0 +1,18 @@
1
+ import { validate as _validate } from '../../../../lexicons.js';
2
+ import { is$typed as _is$typed, } from '../../../../util.js';
3
+ const is$typed = _is$typed, validate = _validate;
4
+ const id = 'app.certified.signature.defs';
5
+ const hashInline = 'inline';
6
+ export function isInline(v) {
7
+ return is$typed(v, id, hashInline);
8
+ }
9
+ export function validateInline(v) {
10
+ return validate(v, id, hashInline);
11
+ }
12
+ const hashCreatedVia = 'createdVia';
13
+ export function isCreatedVia(v) {
14
+ return is$typed(v, id, hashCreatedVia);
15
+ }
16
+ export function validateCreatedVia(v) {
17
+ return validate(v, id, hashCreatedVia);
18
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { type ValidationResult } from '@atproto/lexicon';
5
+ import { type $Typed } from '../../../../util.js';
6
+ import type * as AppCertifiedDefs from '../../../app/certified/defs.js';
7
+ import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js';
8
+ import type * as AppCertifiedSignatureDefs from '../../../app/certified/signature/defs.js';
9
+ export interface Main {
10
+ $type: 'org.hypercerts.funding.receipt';
11
+ from?: $Typed<Text> | $Typed<AppCertifiedDefs.Did> | $Typed<ComAtprotoRepoStrongRef.Main> | {
12
+ $type: string;
13
+ };
14
+ to: $Typed<Text> | $Typed<AppCertifiedDefs.Did> | $Typed<ComAtprotoRepoStrongRef.Main> | {
15
+ $type: string;
16
+ };
17
+ via?: $Typed<Text> | $Typed<AppCertifiedDefs.Did> | $Typed<ComAtprotoRepoStrongRef.Main> | {
18
+ $type: string;
19
+ };
20
+ /** What the payment is: a donation (a gift from the sender), a match (funds a matching pool allocated on the strength of other gifts) or a grant (funds awarded through a selection process). Values beyond the known set are permitted. Omit if unknown. */
21
+ type?: 'donation' | 'match' | 'grant' | (string & {});
22
+ /** Gross amount the sender paid, before fees, as a numeric string (e.g. '1000.50'). Omit if unknown, and set netAmount instead. */
23
+ amount?: string;
24
+ /** Currency of amount: an ISO 4217 code for fiat (e.g. EUR), a token ticker for digital assets (e.g. USDC). This is what marks the funds as fiat or digital. Set it whenever amount is set. */
25
+ currency?: string;
26
+ /** What the recipient received after fees and conversion, as a numeric string in netCurrency. */
27
+ netAmount?: string;
28
+ /** Currency of netAmount: an ISO 4217 code for fiat, a token ticker for digital assets. Set it whenever netAmount is set. */
29
+ netCurrency?: string;
30
+ /** How the sender paid. Use 'payment_processor' only when the underlying method is unknown. */
31
+ paymentRail?: 'onchain' | 'bank_transfer' | 'card' | 'direct_debit' | 'mobile_money' | 'payment_processor' | 'cash' | 'check' | (string & {});
32
+ /** Where transactionId can be looked up: the chain for onchain payments, preferably as a CAIP-2 ID (e.g. 'eip155:1'), otherwise the processor or scheme (e.g. stripe, sepa). Set it whenever transactionId is a transaction hash. */
33
+ paymentNetwork?: string;
34
+ /** ID of the sender's payment, not of a platform's later payout: a transaction hash for onchain payments, otherwise the processor's or scheme's reference. Receipts are public: prefer opaque processor IDs to bank references, and note that a hash reveals the sender's wallet even when from is omitted. */
35
+ transactionId?: string;
36
+ for?: ComAtprotoRepoStrongRef.Main;
37
+ /** Optional notes or additional context for this funding receipt. */
38
+ notes?: string;
39
+ /** Timestamp when the payment occurred. */
40
+ occurredAt?: string;
41
+ /** Client-declared timestamp when this receipt record was created. */
42
+ createdAt: string;
43
+ signatures?: AppCertifiedSignatureDefs.List;
44
+ [k: string]: unknown;
45
+ }
46
+ export declare function isMain<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "org.hypercerts.funding.receipt", "main">;
47
+ export declare function validateMain<V>(v: V): ValidationResult<Main & V>;
48
+ export { type Main as Record, isMain as isRecord, validateMain as validateRecord, };
49
+ /** A free-text string value (e.g. a display name, wallet address, or other identifier). */
50
+ export interface Text {
51
+ $type?: 'org.hypercerts.funding.receipt#text';
52
+ /** The string value. */
53
+ value: string;
54
+ }
55
+ export declare function isText<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "org.hypercerts.funding.receipt", "text">;
56
+ export declare function validateText<V>(v: V): ValidationResult<Text & V>;
@@ -0,0 +1,19 @@
1
+ import { validate as _validate } from '../../../../lexicons.js';
2
+ import { is$typed as _is$typed, } from '../../../../util.js';
3
+ const is$typed = _is$typed, validate = _validate;
4
+ const id = 'org.hypercerts.funding.receipt';
5
+ const hashMain = 'main';
6
+ export function isMain(v) {
7
+ return is$typed(v, id, hashMain);
8
+ }
9
+ export function validateMain(v) {
10
+ return validate(v, id, hashMain, true);
11
+ }
12
+ export { isMain as isRecord, validateMain as validateRecord, };
13
+ const hashText = 'text';
14
+ export function isText(v) {
15
+ return is$typed(v, id, hashText);
16
+ }
17
+ export function validateText(v) {
18
+ return validate(v, id, hashText);
19
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { type ValidationResult } from '@atproto/lexicon';
5
+ import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js';
6
+ export interface Main {
7
+ $type: 'pub.techne.draft.financials';
8
+ subject: ComAtprotoRepoStrongRef.Main;
9
+ /** The tax year the figures cover, as the filing names it. */
10
+ taxYear: number;
11
+ /** The last day of the tax year (YYYY-MM-DD) when the filing states it; a fiscal year need not end in December. */
12
+ periodEnd?: string;
13
+ /** Total revenue for the year, in whole units of `currency`, as the filing reports it. May be negative. */
14
+ revenue?: number;
15
+ /** Total expenses for the year, in whole units of `currency`, as the filing reports it. May be negative. */
16
+ expenses?: number;
17
+ /** Total assets at the end of the year, in whole units of `currency`, as the filing reports it. May be negative. */
18
+ assets?: number;
19
+ /** ISO 4217 code of the amounts. */
20
+ currency: string;
21
+ createdAt: string;
22
+ [k: string]: unknown;
23
+ }
24
+ export declare function isMain<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.financials", "main">;
25
+ export declare function validateMain<V>(v: V): ValidationResult<Main & V>;
26
+ export { type Main as Record, isMain as isRecord, validateMain as validateRecord, };
@@ -0,0 +1,12 @@
1
+ import { validate as _validate } from '../../../../lexicons.js';
2
+ import { is$typed as _is$typed, } from '../../../../util.js';
3
+ const is$typed = _is$typed, validate = _validate;
4
+ const id = 'pub.techne.draft.financials';
5
+ const hashMain = 'main';
6
+ export function isMain(v) {
7
+ return is$typed(v, id, hashMain);
8
+ }
9
+ export function validateMain(v) {
10
+ return validate(v, id, hashMain, true);
11
+ }
12
+ export { isMain as isRecord, validateMain as validateRecord, };
@@ -4,6 +4,8 @@
4
4
  import { HeadersMap, XRPCError } from '@atproto/xrpc';
5
5
  export type QueryParams = {};
6
6
  export interface InputSchema {
7
+ /** Who sees the founding membership: `members` (placed in the collective's member space, `pub.techne.draft.space.collective.member/self`, seen by its members) or `public` (a public record). */
8
+ founderMembershipVisibility?: 'public' | 'members' | (string & {});
7
9
  }
8
10
  export interface OutputSchema {
9
11
  /** The new collective. */
@@ -22,6 +24,9 @@ export interface Response {
22
24
  headers: HeadersMap;
23
25
  data: OutputSchema;
24
26
  }
27
+ export declare class InvalidRequestError extends XRPCError {
28
+ constructor(src: XRPCError);
29
+ }
25
30
  export declare class RateLimitExceededError extends XRPCError {
26
31
  constructor(src: XRPCError);
27
32
  }
@@ -6,6 +6,11 @@ import { validate as _validate } from '../../../../../lexicons.js';
6
6
  import { is$typed as _is$typed, } from '../../../../../util.js';
7
7
  const is$typed = _is$typed, validate = _validate;
8
8
  const id = 'pub.techne.draft.identity.createCollective';
9
+ export class InvalidRequestError extends XRPCError {
10
+ constructor(src) {
11
+ super(src.status, src.error, src.message, src.headers, { cause: src });
12
+ }
13
+ }
9
14
  export class RateLimitExceededError extends XRPCError {
10
15
  constructor(src) {
11
16
  super(src.status, src.error, src.message, src.headers, { cause: src });
@@ -13,6 +18,8 @@ export class RateLimitExceededError extends XRPCError {
13
18
  }
14
19
  export function toKnownErr(e) {
15
20
  if (e instanceof XRPCError) {
21
+ if (e.error === 'InvalidRequest')
22
+ return new InvalidRequestError(e);
16
23
  if (e.error === 'RateLimitExceeded')
17
24
  return new RateLimitExceededError(e);
18
25
  }
@@ -17,7 +17,7 @@ export interface 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. */
18
18
  bid: string;
19
19
  type: 'email' | 'phone' | 'passkey' | 'nostr' | 'recoveryCodes' | (string & {});
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)`. */
20
+ /** The channel with most of it hidden, e.g. `j•••@example.com`, `••• ••• 4567`; a passkey's or Nostr key's label; `Recovery codes (n left)`. */
21
21
  masked: string;
22
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
23
  value?: string;
@@ -228,13 +228,16 @@ export interface NoticeTo {
228
228
  }
229
229
  export declare function isNoticeTo<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "noticeTo">;
230
230
  export declare function validateNoticeTo<V>(v: V): ValidationResult<NoticeTo & V>;
231
- /** 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. */
231
+ /** One way to sign in, as a page may show it before anyone has signed in: masked, never its full value (though an address whose local part is one character is fully implied). */
232
232
  export interface SignInMethod {
233
233
  $type?: 'pub.techne.draft.identity.manageMethods#signInMethod';
234
234
  /** The method id (for `sendTo`, and the PDS's own passkey or Nostr challenge). */
235
235
  id: string;
236
236
  type: 'email' | 'phone' | 'passkey' | 'nostr' | (string & {});
237
+ /** For any page, one reached by typing a handle included: an email keeps its first character and, at a common email provider, its domain (`a•••@gmail.com`), at any other domain only the domain's last part (`a•••@•••.dev`; `a•••@•••` for a domain with no dot); a phone its last two digits (`•••• 97`); a passkey or Nostr key its label. */
237
238
  display: string;
239
+ /** Only for the PDS's chooser of the accounts already signed in on that browser, never for a page reached by typing a handle: an email keeps its first character and its whole domain (`a•••@example.dev`), a phone its last four digits (`••• ••• 4242`); a passkey or Nostr key its label, as `display`. Present exactly when `display` is. Absent from a platform older than this field: use `display`. */
240
+ displayDevice?: string;
238
241
  }
239
242
  export declare function isSignInMethod<V>(v: V): v is import("../../../../../util.js").$TypedObject<V, "pub.techne.draft.identity.manageMethods", "signInMethod">;
240
243
  export declare function validateSignInMethod<V>(v: V): ValidationResult<SignInMethod & V>;
@@ -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
+ }
@@ -2,41 +2,71 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { type ValidationResult } from '@atproto/lexicon';
5
+ import { type $Typed } from '../../../../util.js';
6
+ import type * as CommunityLexiconLocationGeo from '../../../community/lexicon/location/geo.js';
5
7
  import type * as CommunityLexiconLocationAddress from '../../../community/lexicon/location/address.js';
8
+ import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js';
6
9
  export interface Main {
7
10
  $type: 'pub.techne.draft.org';
8
- /** The organization's registered name. From the almanac `name` attribute. */
11
+ /** The organization's name as its registry records it. */
9
12
  name: string;
10
- /** CO SoS entity-type code (e.g. DLLC, DPC, DNC). From the almanac `entityType` attribute, clipped to 64 chars there (co-sos-registry pipeline.py) — matched here so the two bounds agree. */
11
- entityType?: string;
12
- /** Where the entity was legally formed, as the registry states it. From the almanac `jurisdictionOfFormation` attribute. */
13
- jurisdictionOfFormation?: string;
14
- /** The entity's IRS EIN: exactly 9 digits, no dash (shape ^[0-9]{9}$ — atproto lexicon strings carry no pattern property, so the publisher enforces this before write). From the almanac `ein` attribute. */
15
- identifier?: string;
16
- /** The organization's website, absolute http(s). From the almanac `website` attribute. */
17
- url?: string;
18
- /** E.164 phone number. From the almanac `phone` attribute. */
19
- telephone?: string;
20
- /** Public contact address. From the almanac `email` attribute, when a merged peg carries one. No atproto lexicon "email" format token exists (atrium-codegen's fixed format enum has no such variant) — unlike the almanac's own value_schema, this field carries no format assertion, only the length bound. */
21
- email?: string;
22
- /** Formation date — year, year-month, or full date (shape ^[0-9]{4}(-[0-9]{2}(-[0-9]{2})?)?$ — atproto lexicon strings carry no pattern property, so the publisher enforces this before write), as the source states it. From the almanac `founded` attribute. */
13
+ /** Ids the organization has in other registries: `{scheme: "ein", value}` (9 digits, no dash), `{scheme: "co-sos", value}`. Identity between two org records is a `pub.techne.draft.sameAs`, never a field here; an EIN is its strongest basis. */
14
+ identifiers?: SchemeValue[];
15
+ /** Classification codes per scheme: `irs-ntee`, `irs-subsection`, `co-sos-entity-type`. */
16
+ category?: SchemeValue[];
17
+ /** Registry standing per scheme (`irs`, `co-sos`). A closed organization keeps its record with its status; it is never deleted. */
18
+ status?: SchemeValue[];
19
+ /** Formation date as the source states it: year, year-month or full date (shape ^[0-9]{4}(-[0-9]{2}(-[0-9]{2})?)?$; atproto strings carry no pattern, so the writer enforces it). */
23
20
  founded?: string;
24
- address?: CommunityLexiconLocationAddress.Main;
25
- /** Registry status per scheme (co-sos, irs). Zero or more; a co-sos and an irs status can coexist for one entity. */
26
- status?: SchemeTag[];
27
- /** Classification codes per scheme (irs-subsection, irs-ntee). */
28
- category?: SchemeTag[];
21
+ /** Prose about the organization: for a nonprofit, the mission and program text it filed with the IRS (Form 990). Public. */
22
+ description?: string;
23
+ /** The organization's own website, absolute http(s). */
24
+ url?: string;
25
+ /** Public phone number, E.164. */
26
+ phone?: string;
27
+ /** Where the organization is: a point, an address or a place record. Never a mailing address: a registry's address is often an organizer's home, so it is not published. An organization's office or storefront at a commons place is a `pub.techne.draft.orgAtPlace` record, not an entry here. */
28
+ locations?: ($Typed<CommunityLexiconLocationGeo.Main> | $Typed<CommunityLexiconLocationAddress.Main> | $Typed<ComAtprotoRepoStrongRef.Main> | {
29
+ $type: string;
30
+ })[];
29
31
  createdAt: string;
30
32
  [k: string]: unknown;
31
33
  }
32
34
  export declare function isMain<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.org", "main">;
33
35
  export declare function validateMain<V>(v: V): ValidationResult<Main & V>;
34
36
  export { type Main as Record, isMain as isRecord, validateMain as validateRecord, };
35
- /** One classification or status code in a named scheme, mirroring the almanac's own {scheme, code} attribute shape. */
36
- export interface SchemeTag {
37
- $type?: 'pub.techne.draft.org#schemeTag';
37
+ /** Some of an org's own fields, carried by a `pub.techne.draft.statement` about an org record someone else wrote (the subject). Every property is the main record's property of the same name, with the same shape; none is required. */
38
+ export interface Fields {
39
+ $type?: 'pub.techne.draft.org#fields';
40
+ /** The organization's name as its registry records it. */
41
+ name?: string;
42
+ /** Ids the organization has in other registries: `{scheme: "ein", value}` (9 digits, no dash), `{scheme: "co-sos", value}`. Identity between two org records is a `pub.techne.draft.sameAs`, never a field here; an EIN is its strongest basis. */
43
+ identifiers?: SchemeValue[];
44
+ /** Classification codes per scheme: `irs-ntee`, `irs-subsection`, `co-sos-entity-type`. */
45
+ category?: SchemeValue[];
46
+ /** Registry standing per scheme (`irs`, `co-sos`). A closed organization keeps its record with its status; it is never deleted. */
47
+ status?: SchemeValue[];
48
+ /** Formation date as the source states it: year, year-month or full date (shape ^[0-9]{4}(-[0-9]{2}(-[0-9]{2})?)?$; atproto strings carry no pattern, so the writer enforces it). */
49
+ founded?: string;
50
+ /** Prose about the organization: for a nonprofit, the mission and program text it filed with the IRS (Form 990). Public. */
51
+ description?: string;
52
+ /** The organization's own website, absolute http(s). */
53
+ url?: string;
54
+ /** Public phone number, E.164. */
55
+ phone?: string;
56
+ /** Where the organization is: a point, an address or a place record. Never a mailing address: a registry's address is often an organizer's home, so it is not published. An organization's office or storefront at a commons place is a `pub.techne.draft.orgAtPlace` record, not an entry here. */
57
+ locations?: ($Typed<CommunityLexiconLocationGeo.Main> | $Typed<CommunityLexiconLocationAddress.Main> | $Typed<ComAtprotoRepoStrongRef.Main> | {
58
+ $type: string;
59
+ })[];
60
+ }
61
+ export declare function isFields<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.org", "fields">;
62
+ export declare function validateFields<V>(v: V): ValidationResult<Fields & V>;
63
+ /** One code in a named scheme: an identifier (`identifiers`), a classification (`category`) or a standing (`status`). `scheme` names the registry or code list, `value` is the code as that registry writes it. */
64
+ export interface SchemeValue {
65
+ $type?: 'pub.techne.draft.org#schemeValue';
66
+ /** The registry or code list, e.g. `ein`, `co-sos`, `irs-ntee`, `irs-subsection`, `co-sos-entity-type`, `irs`. */
38
67
  scheme: string;
39
- code: string;
68
+ /** The code as the registry writes it, e.g. an EIN as 9 digits with no dash. */
69
+ value: string;
40
70
  }
41
- export declare function isSchemeTag<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.org", "schemeTag">;
42
- export declare function validateSchemeTag<V>(v: V): ValidationResult<SchemeTag & V>;
71
+ export declare function isSchemeValue<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.org", "schemeValue">;
72
+ export declare function validateSchemeValue<V>(v: V): ValidationResult<SchemeValue & V>;
@@ -10,10 +10,17 @@ export function validateMain(v) {
10
10
  return validate(v, id, hashMain, true);
11
11
  }
12
12
  export { isMain as isRecord, validateMain as validateRecord, };
13
- const hashSchemeTag = 'schemeTag';
14
- export function isSchemeTag(v) {
15
- return is$typed(v, id, hashSchemeTag);
13
+ const hashFields = 'fields';
14
+ export function isFields(v) {
15
+ return is$typed(v, id, hashFields);
16
16
  }
17
- export function validateSchemeTag(v) {
18
- return validate(v, id, hashSchemeTag);
17
+ export function validateFields(v) {
18
+ return validate(v, id, hashFields);
19
+ }
20
+ const hashSchemeValue = 'schemeValue';
21
+ export function isSchemeValue(v) {
22
+ return is$typed(v, id, hashSchemeValue);
23
+ }
24
+ export function validateSchemeValue(v) {
25
+ return validate(v, id, hashSchemeValue);
19
26
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { type ValidationResult } from '@atproto/lexicon';
5
+ import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js';
6
+ export interface Main {
7
+ $type: 'pub.techne.draft.orgAtPlace';
8
+ subject: ComAtprotoRepoStrongRef.Main;
9
+ place: ComAtprotoRepoStrongRef.Main;
10
+ /** What the place is to the organization. Values beyond the known set are permitted. */
11
+ role?: 'office' | 'storefront' | (string & {});
12
+ createdAt: string;
13
+ [k: string]: unknown;
14
+ }
15
+ export declare function isMain<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.orgAtPlace", "main">;
16
+ export declare function validateMain<V>(v: V): ValidationResult<Main & V>;
17
+ export { type Main as Record, isMain as isRecord, validateMain as validateRecord, };
@@ -0,0 +1,12 @@
1
+ import { validate as _validate } from '../../../../lexicons.js';
2
+ import { is$typed as _is$typed, } from '../../../../util.js';
3
+ const is$typed = _is$typed, validate = _validate;
4
+ const id = 'pub.techne.draft.orgAtPlace';
5
+ const hashMain = 'main';
6
+ export function isMain(v) {
7
+ return is$typed(v, id, hashMain);
8
+ }
9
+ export function validateMain(v) {
10
+ return validate(v, id, hashMain, true);
11
+ }
12
+ export { isMain as isRecord, validateMain as validateRecord, };
@@ -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
  }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { type ValidationResult } from '@atproto/lexicon';
5
+ import { type $Typed } from '../../../../util.js';
6
+ import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js';
7
+ import type * as PubTechneDraftOrg from './org.js';
8
+ export interface Main {
9
+ $type: 'pub.techne.draft.statement';
10
+ subject: ComAtprotoRepoStrongRef.Main;
11
+ fields: $Typed<PubTechneDraftOrg.Fields> | {
12
+ $type: string;
13
+ };
14
+ createdAt: string;
15
+ [k: string]: unknown;
16
+ }
17
+ export declare function isMain<V>(v: V): v is import("../../../../util.js").$TypedObject<V, "pub.techne.draft.statement", "main">;
18
+ export declare function validateMain<V>(v: V): ValidationResult<Main & V>;
19
+ export { type Main as Record, isMain as isRecord, validateMain as validateRecord, };
@@ -0,0 +1,12 @@
1
+ import { validate as _validate } from '../../../../lexicons.js';
2
+ import { is$typed as _is$typed, } from '../../../../util.js';
3
+ const is$typed = _is$typed, validate = _validate;
4
+ const id = 'pub.techne.draft.statement';
5
+ const hashMain = 'main';
6
+ export function isMain(v) {
7
+ return is$typed(v, id, hashMain);
8
+ }
9
+ export function validateMain(v) {
10
+ return validate(v, id, hashMain, true);
11
+ }
12
+ export { isMain as isRecord, validateMain as validateRecord, };