@atproto/api 0.19.4 → 0.19.5

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 (35) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/agent.d.ts +6 -5
  3. package/dist/agent.d.ts.map +1 -1
  4. package/dist/agent.js +6 -2
  5. package/dist/agent.js.map +1 -1
  6. package/dist/atp-agent.d.ts +0 -1
  7. package/dist/atp-agent.d.ts.map +1 -1
  8. package/dist/atp-agent.js +0 -3
  9. package/dist/atp-agent.js.map +1 -1
  10. package/dist/client/lexicons.d.ts +12 -12
  11. package/dist/client/lexicons.d.ts.map +1 -1
  12. package/dist/client/lexicons.js +7 -10
  13. package/dist/client/lexicons.js.map +1 -1
  14. package/dist/client/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts +3 -3
  15. package/dist/client/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts.map +1 -1
  16. package/dist/client/types/app/bsky/graph/getSuggestedFollowsByActor.js.map +1 -1
  17. package/dist/client/types/com/atproto/label/defs.d.ts +1 -1
  18. package/dist/client/types/com/atproto/label/defs.d.ts.map +1 -1
  19. package/dist/client/types/com/atproto/label/defs.js.map +1 -1
  20. package/dist/index.d.ts +2 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +4 -1
  23. package/dist/index.js.map +1 -1
  24. package/package.json +5 -4
  25. package/scripts/code/labels.mjs +20 -17
  26. package/scripts/generate-code.mjs +3 -2
  27. package/src/agent.ts +10 -7
  28. package/src/atp-agent.ts +0 -4
  29. package/src/client/lexicons.ts +8 -11
  30. package/src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts +3 -3
  31. package/src/client/types/com/atproto/label/defs.ts +2 -5
  32. package/src/index.ts +3 -1
  33. package/tests/errors.test.ts +1 -1
  34. package/tests/moderation-prefs.test.ts +9 -9
  35. package/src/moderation/const/labels.ts +0 -220
@@ -9,12 +9,12 @@ export type QueryParams = {
9
9
  export type InputSchema = undefined;
10
10
  export interface OutputSchema {
11
11
  suggestions: AppBskyActorDefs.ProfileView[];
12
- /** If true, response has fallen-back to generic results, and is not scoped using relativeToDid */
12
+ /** Snowflake for this recommendation, use when submitting recommendation events. */
13
+ recIdStr?: string;
14
+ /** DEPRECATED, unused. Previously: if true, response has fallen-back to generic results, and is not scoped using relativeToDid */
13
15
  isFallback: boolean;
14
16
  /** DEPRECATED: use recIdStr instead. */
15
17
  recId?: number;
16
- /** Snowflake for this recommendation, use when submitting recommendation events. */
17
- recIdStr?: string;
18
18
  }
19
19
  export interface CallOptions {
20
20
  signal?: AbortSignal;
@@ -1 +1 @@
1
- {"version":3,"file":"getSuggestedFollowsByActor.d.ts","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAA;AASrD,OAAO,KAAK,KAAK,gBAAgB,MAAM,kBAAkB,CAAA;AAMzD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AACD,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,gBAAgB,CAAC,WAAW,EAAE,CAAA;IAC3C,kGAAkG;IAClG,UAAU,EAAE,OAAO,CAAA;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,UAAU,CAAA;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,UAAU,CAAA;IACnB,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,OAEhC"}
1
+ {"version":3,"file":"getSuggestedFollowsByActor.d.ts","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAA;AASrD,OAAO,KAAK,KAAK,gBAAgB,MAAM,kBAAkB,CAAA;AAMzD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AACD,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,gBAAgB,CAAC,WAAW,EAAE,CAAA;IAC3C,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kIAAkI;IAClI,UAAU,EAAE,OAAO,CAAA;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,UAAU,CAAA;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,UAAU,CAAA;IACnB,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,OAEhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getSuggestedFollowsByActor.js","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts"],"names":[],"mappings":";;AA4CA,gCAEC;AAxCD,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,2CAA2C,CAAA;AA4BtD,SAAgB,UAAU,CAAC,CAAM;IAC/B,OAAO,CAAC,CAAA;AACV,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { HeadersMap, XRPCError } from '@atproto/xrpc'\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as AppBskyActorDefs from '../actor/defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'app.bsky.graph.getSuggestedFollowsByActor'\n\nexport type QueryParams = {\n actor: string\n}\nexport type InputSchema = undefined\n\nexport interface OutputSchema {\n suggestions: AppBskyActorDefs.ProfileView[]\n /** If true, response has fallen-back to generic results, and is not scoped using relativeToDid */\n isFallback: boolean\n /** DEPRECATED: use recIdStr instead. */\n recId?: number\n /** Snowflake for this recommendation, use when submitting recommendation events. */\n recIdStr?: string\n}\n\nexport interface CallOptions {\n signal?: AbortSignal\n headers?: HeadersMap\n}\n\nexport interface Response {\n success: boolean\n headers: HeadersMap\n data: OutputSchema\n}\n\nexport function toKnownErr(e: any) {\n return e\n}\n"]}
1
+ {"version":3,"file":"getSuggestedFollowsByActor.js","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts"],"names":[],"mappings":";;AA4CA,gCAEC;AAxCD,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,2CAA2C,CAAA;AA4BtD,SAAgB,UAAU,CAAC,CAAM;IAC/B,OAAO,CAAC,CAAA;AACV,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { HeadersMap, XRPCError } from '@atproto/xrpc'\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as AppBskyActorDefs from '../actor/defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'app.bsky.graph.getSuggestedFollowsByActor'\n\nexport type QueryParams = {\n actor: string\n}\nexport type InputSchema = undefined\n\nexport interface OutputSchema {\n suggestions: AppBskyActorDefs.ProfileView[]\n /** Snowflake for this recommendation, use when submitting recommendation events. */\n recIdStr?: string\n /** DEPRECATED, unused. Previously: if true, response has fallen-back to generic results, and is not scoped using relativeToDid */\n isFallback: boolean\n /** DEPRECATED: use recIdStr instead. */\n recId?: number\n}\n\nexport interface CallOptions {\n signal?: AbortSignal\n headers?: HeadersMap\n}\n\nexport interface Response {\n success: boolean\n headers: HeadersMap\n data: OutputSchema\n}\n\nexport function toKnownErr(e: any) {\n return e\n}\n"]}
@@ -70,5 +70,5 @@ export interface LabelValueDefinitionStrings {
70
70
  }
71
71
  export declare function isLabelValueDefinitionStrings<V>(v: V): v is import("../../../../util").$TypedObject<V, "com.atproto.label.defs", "labelValueDefinitionStrings">;
72
72
  export declare function validateLabelValueDefinitionStrings<V>(v: V): ValidationResult<LabelValueDefinitionStrings & V>;
73
- export type LabelValue = '!hide' | '!no-promote' | '!warn' | '!no-unauthenticated' | 'dmca-violation' | 'doxxing' | 'porn' | 'sexual' | 'nudity' | 'nsfl' | 'gore' | (string & {});
73
+ export type LabelValue = '!hide' | '!warn' | '!no-unauthenticated' | 'porn' | 'sexual' | 'nudity' | 'graphic-media' | 'bot' | (string & {});
74
74
  //# sourceMappingURL=defs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../../../src/client/types/com/atproto/label/defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAajE,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE,8BAA8B,CAAA;IACtC,mDAAmD;IACnD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ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AE,CAAC,CAAA;IACrD,wJAAwJ;IACxJ,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACnD,0CAA0C;IAC1C,cAAc,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IAC1D,yFAAyF;IACzF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,2BAA2B,EAAE,CAAA;CACvC;AAID,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,qGAE7C;AAED,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,8CAEnD;AAED,sFAAsF;AACtF,MAAM,WAAW,2BAA2B;IAC1C,KAAK,CAAC,EAAE,oDAAoD,CAAA;IAC5D,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAA;IACZ,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAA;CACpB;AAID,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,4GAEpD;AAED,wBAAgB,mCAAmC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,qDAM1D;AAED,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,aAAa,GACb,OAAO,GACP,qBAAqB,GACrB,gBAAgB,GAChB,SAAS,GACT,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA"}
1
+ {"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../../../src/client/types/com/atproto/label/defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAajE,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE,8B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D,MAAM,+BAA+B,GAAG,6BAA6B,CAAA;AAErE,SAAgB,6BAA6B,CAAI,CAAI;IACnD,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,+BAA+B,CAAC,CAAA;AACzD,CAAC;AAED,SAAgB,mCAAmC,CAAI,CAAI;IACzD,OAAO,QAAQ,CACb,CAAC,EACD,EAAE,EACF,+BAA+B,CAChC,CAAA;AACH,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'com.atproto.label.defs'\n\n/** Metadata tag on an atproto resource (eg, repo or record). */\nexport interface Label {\n $type?: 'com.atproto.label.defs#label'\n /** The AT Protocol version of the label object. */\n ver?: number\n /** DID of the actor who created this label. */\n src: string\n /** AT URI of the record, repository (account), or other resource that this label applies to. */\n uri: string\n /** Optionally, CID specifying the specific version of 'uri' resource this label applies to. */\n cid?: string\n /** The short string name of the value or type of this label. */\n val: string\n /** If true, this is a negation label, overwriting a previous label. */\n neg?: boolean\n /** Timestamp when this label was created. */\n cts: string\n /** Timestamp at which this label expires (no longer applies). */\n exp?: string\n /** Signature of dag-cbor encoded label. */\n sig?: Uint8Array\n}\n\nconst hashLabel = 'label'\n\nexport function isLabel<V>(v: V) {\n return is$typed(v, id, hashLabel)\n}\n\nexport function validateLabel<V>(v: V) {\n return validate<Label & V>(v, id, hashLabel)\n}\n\n/** Metadata tags on an atproto record, published by the author within the record. */\nexport interface SelfLabels {\n $type?: 'com.atproto.label.defs#selfLabels'\n values: SelfLabel[]\n}\n\nconst hashSelfLabels = 'selfLabels'\n\nexport function isSelfLabels<V>(v: V) {\n return is$typed(v, id, hashSelfLabels)\n}\n\nexport function validateSelfLabels<V>(v: V) {\n return validate<SelfLabels & V>(v, id, hashSelfLabels)\n}\n\n/** Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. */\nexport interface SelfLabel {\n $type?: 'com.atproto.label.defs#selfLabel'\n /** The short string name of the value or type of this label. */\n val: string\n}\n\nconst hashSelfLabel = 'selfLabel'\n\nexport function isSelfLabel<V>(v: V) {\n return is$typed(v, id, hashSelfLabel)\n}\n\nexport function validateSelfLabel<V>(v: V) {\n return validate<SelfLabel & V>(v, id, hashSelfLabel)\n}\n\n/** Declares a label value and its expected interpretations and behaviors. */\nexport interface LabelValueDefinition {\n $type?: 'com.atproto.label.defs#labelValueDefinition'\n /** The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). */\n identifier: string\n /** How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. */\n severity: 'inform' | 'alert' | 'none' | (string & {})\n /** What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing. */\n blurs: 'content' | 'media' | 'none' | (string & {})\n /** The default setting for this label. */\n defaultSetting: 'ignore' | 'warn' | 'hide' | (string & {})\n /** Does the user need to have adult content enabled in order to configure this label? */\n adultOnly?: boolean\n locales: LabelValueDefinitionStrings[]\n}\n\nconst hashLabelValueDefinition = 'labelValueDefinition'\n\nexport function isLabelValueDefinition<V>(v: V) {\n return is$typed(v, id, hashLabelValueDefinition)\n}\n\nexport function validateLabelValueDefinition<V>(v: V) {\n return validate<LabelValueDefinition & V>(v, id, hashLabelValueDefinition)\n}\n\n/** Strings which describe the label in the UI, localized into a specific language. */\nexport interface LabelValueDefinitionStrings {\n $type?: 'com.atproto.label.defs#labelValueDefinitionStrings'\n /** The code of the language these strings are written in. */\n lang: string\n /** A short human-readable name for the label. */\n name: string\n /** A longer description of what the label means and why it might be applied. */\n description: string\n}\n\nconst hashLabelValueDefinitionStrings = 'labelValueDefinitionStrings'\n\nexport function isLabelValueDefinitionStrings<V>(v: V) {\n return is$typed(v, id, hashLabelValueDefinitionStrings)\n}\n\nexport function validateLabelValueDefinitionStrings<V>(v: V) {\n return validate<LabelValueDefinitionStrings & V>(\n v,\n id,\n hashLabelValueDefinitionStrings,\n )\n}\n\nexport type LabelValue =\n | '!hide'\n | '!no-promote'\n | '!warn'\n | '!no-unauthenticated'\n | 'dmca-violation'\n | 'doxxing'\n | 'porn'\n | 'sexual'\n | 'nudity'\n | 'nsfl'\n | 'gore'\n | (string & {})\n"]}
1
+ {"version":3,"file":"defs.js","sourceRoot":"","sources":["../../../../../../src/client/types/com/atproto/label/defs.ts"],"names":[],"mappings":";;AAyCA,0BAEC;AAED,sCAEC;AAUD,oCAEC;AAED,gDAEC;AAWD,kCAEC;AAED,8CAEC;AAoBD,wDAEC;AAED,oEAEC;AAeD,sEAEC;AAED,kFAMC;AA9HD,mDAA4D;AAC5D,2CAIyB;AAEzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,wBAAwB,CAAA;AAyBnC,MAAM,SAAS,GAAG,OAAO,CAAA;AAEzB,SAAgB,OAAO,CAAI,CAAI;IAC7B,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;AACnC,CAAC;AAED,SAAgB,aAAa,CAAI,CAAI;IACnC,OAAO,QAAQ,CAAY,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;AAC9C,CAAC;AAQD,MAAM,cAAc,GAAG,YAAY,CAAA;AAEnC,SAAgB,YAAY,CAAI,CAAI;IAClC,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,cAAc,CAAC,CAAA;AACxC,CAAC;AAED,SAAgB,kBAAkB,CAAI,CAAI;IACxC,OAAO,QAAQ,CAAiB,CAAC,EAAE,EAAE,EAAE,cAAc,CAAC,CAAA;AACxD,CAAC;AASD,MAAM,aAAa,GAAG,WAAW,CAAA;AAEjC,SAAgB,WAAW,CAAI,CAAI;IACjC,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,aAAa,CAAC,CAAA;AACvC,CAAC;AAED,SAAgB,iBAAiB,CAAI,CAAI;IACvC,OAAO,QAAQ,CAAgB,CAAC,EAAE,EAAE,EAAE,aAAa,CAAC,CAAA;AACtD,CAAC;AAkBD,MAAM,wBAAwB,GAAG,sBAAsB,CAAA;AAEvD,SAAgB,sBAAsB,CAAI,CAAI;IAC5C,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,wBAAwB,CAAC,CAAA;AAClD,CAAC;AAED,SAAgB,4BAA4B,CAAI,CAAI;IAClD,OAAO,QAAQ,CAA2B,CAAC,EAAE,EAAE,EAAE,wBAAwB,CAAC,CAAA;AAC5E,CAAC;AAaD,MAAM,+BAA+B,GAAG,6BAA6B,CAAA;AAErE,SAAgB,6BAA6B,CAAI,CAAI;IACnD,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,+BAA+B,CAAC,CAAA;AACzD,CAAC;AAED,SAAgB,mCAAmC,CAAI,CAAI;IACzD,OAAO,QAAQ,CACb,CAAC,EACD,EAAE,EACF,+BAA+B,CAChC,CAAA;AACH,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'com.atproto.label.defs'\n\n/** Metadata tag on an atproto resource (eg, repo or record). */\nexport interface Label {\n $type?: 'com.atproto.label.defs#label'\n /** The AT Protocol version of the label object. */\n ver?: number\n /** DID of the actor who created this label. */\n src: string\n /** AT URI of the record, repository (account), or other resource that this label applies to. */\n uri: string\n /** Optionally, CID specifying the specific version of 'uri' resource this label applies to. */\n cid?: string\n /** The short string name of the value or type of this label. */\n val: string\n /** If true, this is a negation label, overwriting a previous label. */\n neg?: boolean\n /** Timestamp when this label was created. */\n cts: string\n /** Timestamp at which this label expires (no longer applies). */\n exp?: string\n /** Signature of dag-cbor encoded label. */\n sig?: Uint8Array\n}\n\nconst hashLabel = 'label'\n\nexport function isLabel<V>(v: V) {\n return is$typed(v, id, hashLabel)\n}\n\nexport function validateLabel<V>(v: V) {\n return validate<Label & V>(v, id, hashLabel)\n}\n\n/** Metadata tags on an atproto record, published by the author within the record. */\nexport interface SelfLabels {\n $type?: 'com.atproto.label.defs#selfLabels'\n values: SelfLabel[]\n}\n\nconst hashSelfLabels = 'selfLabels'\n\nexport function isSelfLabels<V>(v: V) {\n return is$typed(v, id, hashSelfLabels)\n}\n\nexport function validateSelfLabels<V>(v: V) {\n return validate<SelfLabels & V>(v, id, hashSelfLabels)\n}\n\n/** Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. */\nexport interface SelfLabel {\n $type?: 'com.atproto.label.defs#selfLabel'\n /** The short string name of the value or type of this label. */\n val: string\n}\n\nconst hashSelfLabel = 'selfLabel'\n\nexport function isSelfLabel<V>(v: V) {\n return is$typed(v, id, hashSelfLabel)\n}\n\nexport function validateSelfLabel<V>(v: V) {\n return validate<SelfLabel & V>(v, id, hashSelfLabel)\n}\n\n/** Declares a label value and its expected interpretations and behaviors. */\nexport interface LabelValueDefinition {\n $type?: 'com.atproto.label.defs#labelValueDefinition'\n /** The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). */\n identifier: string\n /** How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. */\n severity: 'inform' | 'alert' | 'none' | (string & {})\n /** What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing. */\n blurs: 'content' | 'media' | 'none' | (string & {})\n /** The default setting for this label. */\n defaultSetting: 'ignore' | 'warn' | 'hide' | (string & {})\n /** Does the user need to have adult content enabled in order to configure this label? */\n adultOnly?: boolean\n locales: LabelValueDefinitionStrings[]\n}\n\nconst hashLabelValueDefinition = 'labelValueDefinition'\n\nexport function isLabelValueDefinition<V>(v: V) {\n return is$typed(v, id, hashLabelValueDefinition)\n}\n\nexport function validateLabelValueDefinition<V>(v: V) {\n return validate<LabelValueDefinition & V>(v, id, hashLabelValueDefinition)\n}\n\n/** Strings which describe the label in the UI, localized into a specific language. */\nexport interface LabelValueDefinitionStrings {\n $type?: 'com.atproto.label.defs#labelValueDefinitionStrings'\n /** The code of the language these strings are written in. */\n lang: string\n /** A short human-readable name for the label. */\n name: string\n /** A longer description of what the label means and why it might be applied. */\n description: string\n}\n\nconst hashLabelValueDefinitionStrings = 'labelValueDefinitionStrings'\n\nexport function isLabelValueDefinitionStrings<V>(v: V) {\n return is$typed(v, id, hashLabelValueDefinitionStrings)\n}\n\nexport function validateLabelValueDefinitionStrings<V>(v: V) {\n return validate<LabelValueDefinitionStrings & V>(\n v,\n id,\n hashLabelValueDefinitionStrings,\n )\n}\n\nexport type LabelValue =\n | '!hide'\n | '!warn'\n | '!no-unauthenticated'\n | 'porn'\n | 'sexual'\n | 'nudity'\n | 'graphic-media'\n | 'bot'\n | (string & {})\n"]}
package/dist/index.d.ts CHANGED
@@ -2,11 +2,12 @@ import { Lexicons } from '@atproto/lexicon';
2
2
  export { AtUri } from '@atproto/syntax';
3
3
  export { BlobRef, jsonStringToLex, jsonToLex, lexToJson, stringifyLex, } from '@atproto/lexicon';
4
4
  export { parseLanguage } from '@atproto/common-web';
5
+ export { XRPCError } from '@atproto/xrpc';
5
6
  export * from './types';
6
7
  export * from './const';
7
8
  export * from './util';
8
9
  export * from './client';
9
- export { schemas } from './client/lexicons';
10
+ export { ids, schemas } from './client/lexicons';
10
11
  export type { $Typed, Un$Typed } from './client/util';
11
12
  export { asPredicate } from './client/util';
12
13
  export * from './rich-text/rich-text';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,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,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EACL,OAAO,EACP,eAAe,EACf,SAAS,EACT,SAAS,EACT,YAAY,GACb,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO;AACL,kBAAkB;AAClB,QAAQ,IAAI,OAAO,GACpB,MAAM,aAAa,CAAA;AAIpB,eAAO,MAAM,QAAQ,UAAiC,CAAA"}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.lexicons = exports.default = exports.BskyAgent = exports.CredentialSession = exports.AtpAgent = exports.Agent = exports.LABELS = exports.DEFAULT_LABEL_SETTINGS = exports.asPredicate = exports.schemas = exports.parseLanguage = exports.stringifyLex = exports.lexToJson = exports.jsonToLex = exports.jsonStringToLex = exports.BlobRef = exports.AtUri = void 0;
17
+ exports.lexicons = exports.default = exports.BskyAgent = exports.CredentialSession = exports.AtpAgent = exports.Agent = exports.LABELS = exports.DEFAULT_LABEL_SETTINGS = exports.asPredicate = exports.schemas = exports.ids = exports.XRPCError = exports.parseLanguage = exports.stringifyLex = exports.lexToJson = exports.jsonToLex = exports.jsonStringToLex = exports.BlobRef = exports.AtUri = void 0;
18
18
  const lexicon_1 = require("@atproto/lexicon");
19
19
  const lexicons_1 = require("./client/lexicons");
20
20
  var syntax_1 = require("@atproto/syntax");
@@ -27,11 +27,14 @@ Object.defineProperty(exports, "lexToJson", { enumerable: true, get: function ()
27
27
  Object.defineProperty(exports, "stringifyLex", { enumerable: true, get: function () { return lexicon_2.stringifyLex; } });
28
28
  var common_web_1 = require("@atproto/common-web");
29
29
  Object.defineProperty(exports, "parseLanguage", { enumerable: true, get: function () { return common_web_1.parseLanguage; } });
30
+ var xrpc_1 = require("@atproto/xrpc");
31
+ Object.defineProperty(exports, "XRPCError", { enumerable: true, get: function () { return xrpc_1.XRPCError; } });
30
32
  __exportStar(require("./types"), exports);
31
33
  __exportStar(require("./const"), exports);
32
34
  __exportStar(require("./util"), exports);
33
35
  __exportStar(require("./client"), exports);
34
36
  var lexicons_2 = require("./client/lexicons");
37
+ Object.defineProperty(exports, "ids", { enumerable: true, get: function () { return lexicons_2.ids; } });
35
38
  Object.defineProperty(exports, "schemas", { enumerable: true, get: function () { return lexicons_2.schemas; } });
36
39
  var util_1 = require("./client/util");
37
40
  Object.defineProperty(exports, "asPredicate", { enumerable: true, get: function () { return util_1.asPredicate; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA2C;AAC3C,gDAAgE;AAEhE,0CAAuC;AAA9B,+FAAA,KAAK,OAAA;AACd,4CAMyB;AALvB,kGAAA,OAAO,OAAA;AACP,0GAAA,eAAe,OAAA;AACf,oGAAA,SAAS,OAAA;AACT,oGAAA,SAAS,OAAA;AACT,uGAAA,YAAY,OAAA;AAEd,kDAAmD;AAA1C,2GAAA,aAAa,OAAA;AACtB,0CAAuB;AACvB,0CAAuB;AACvB,yCAAsB;AACtB,2CAAwB;AACxB,8CAA2C;AAAlC,mGAAA,OAAO,OAAA;AAEhB,sCAA2C;AAAlC,mGAAA,WAAW,OAAA;AACpB,wDAAqC;AACrC,2DAAwC;AACxC,sDAAmC;AACnC,mDAAgC;AAChC,+CAA4B;AAC5B,qDAAkC;AAClC,2CAAwB;AACxB,kDAA+B;AAC/B,oDAA0E;AAAjE,gHAAA,sBAAsB,OAAA;AAAE,gGAAA,MAAM,OAAA;AACvC,iCAA+B;AAAtB,8FAAA,KAAK,OAAA;AAEd,yCAA4D;AAAnD,qGAAA,QAAQ,OAAA;AACjB,yCAA+C;AAAtC,8GAAA,iBAAiB,OAAA;AAC1B,2CAAwC;AAA/B,uGAAA,SAAS,OAAA;AAElB,yCAGoB;AAFlB,kBAAkB;AAClB,oGAAA,QAAQ,OAAW;AAGrB,+EAA+E;AAC/E,2BAA2B;AACd,QAAA,QAAQ,GAAG,IAAI,kBAAQ,CAAC,mBAAgB,CAAC,CAAA","sourcesContent":["import { Lexicons } from '@atproto/lexicon'\nimport { lexicons as internalLexicons } from './client/lexicons'\n\nexport { AtUri } from '@atproto/syntax'\nexport {\n BlobRef,\n jsonStringToLex,\n jsonToLex,\n lexToJson,\n stringifyLex,\n} from '@atproto/lexicon'\nexport { parseLanguage } from '@atproto/common-web'\nexport * from './types'\nexport * from './const'\nexport * from './util'\nexport * from './client'\nexport { schemas } from './client/lexicons'\nexport type { $Typed, Un$Typed } from './client/util'\nexport { asPredicate } from './client/util'\nexport * from './rich-text/rich-text'\nexport * from './rich-text/sanitization'\nexport * from './rich-text/unicode'\nexport * from './rich-text/util'\nexport * from './moderation'\nexport * from './moderation/types'\nexport * from './mocker'\nexport * from './age-assurance'\nexport { DEFAULT_LABEL_SETTINGS, LABELS } from './moderation/const/labels'\nexport { Agent } from './agent'\n\nexport { AtpAgent, type AtpAgentOptions } from './atp-agent'\nexport { CredentialSession } from './atp-agent'\nexport { BskyAgent } from './bsky-agent'\n\nexport {\n /** @deprecated */\n AtpAgent as default,\n} from './atp-agent'\n\n// Expose a copy to prevent alteration of the internal Lexicon instance used by\n// the AtpBaseClient class.\nexport const lexicons = new Lexicons(internalLexicons)\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA2C;AAC3C,gDAAgE;AAEhE,0CAAuC;AAA9B,+FAAA,KAAK,OAAA;AACd,4CAMyB;AALvB,kGAAA,OAAO,OAAA;AACP,0GAAA,eAAe,OAAA;AACf,oGAAA,SAAS,OAAA;AACT,oGAAA,SAAS,OAAA;AACT,uGAAA,YAAY,OAAA;AAEd,kDAAmD;AAA1C,2GAAA,aAAa,OAAA;AACtB,sCAAyC;AAAhC,iGAAA,SAAS,OAAA;AAElB,0CAAuB;AACvB,0CAAuB;AACvB,yCAAsB;AACtB,2CAAwB;AACxB,8CAAgD;AAAvC,+FAAA,GAAG,OAAA;AAAE,mGAAA,OAAO,OAAA;AAErB,sCAA2C;AAAlC,mGAAA,WAAW,OAAA;AACpB,wDAAqC;AACrC,2DAAwC;AACxC,sDAAmC;AACnC,mDAAgC;AAChC,+CAA4B;AAC5B,qDAAkC;AAClC,2CAAwB;AACxB,kDAA+B;AAC/B,oDAA0E;AAAjE,gHAAA,sBAAsB,OAAA;AAAE,gGAAA,MAAM,OAAA;AACvC,iCAA+B;AAAtB,8FAAA,KAAK,OAAA;AAEd,yCAA4D;AAAnD,qGAAA,QAAQ,OAAA;AACjB,yCAA+C;AAAtC,8GAAA,iBAAiB,OAAA;AAC1B,2CAAwC;AAA/B,uGAAA,SAAS,OAAA;AAElB,yCAGoB;AAFlB,kBAAkB;AAClB,oGAAA,QAAQ,OAAW;AAGrB,+EAA+E;AAC/E,2BAA2B;AACd,QAAA,QAAQ,GAAG,IAAI,kBAAQ,CAAC,mBAAgB,CAAC,CAAA","sourcesContent":["import { Lexicons } from '@atproto/lexicon'\nimport { lexicons as internalLexicons } from './client/lexicons'\n\nexport { AtUri } from '@atproto/syntax'\nexport {\n BlobRef,\n jsonStringToLex,\n jsonToLex,\n lexToJson,\n stringifyLex,\n} from '@atproto/lexicon'\nexport { parseLanguage } from '@atproto/common-web'\nexport { XRPCError } from '@atproto/xrpc'\n\nexport * from './types'\nexport * from './const'\nexport * from './util'\nexport * from './client'\nexport { ids, schemas } from './client/lexicons'\nexport type { $Typed, Un$Typed } from './client/util'\nexport { asPredicate } from './client/util'\nexport * from './rich-text/rich-text'\nexport * from './rich-text/sanitization'\nexport * from './rich-text/unicode'\nexport * from './rich-text/util'\nexport * from './moderation'\nexport * from './moderation/types'\nexport * from './mocker'\nexport * from './age-assurance'\nexport { DEFAULT_LABEL_SETTINGS, LABELS } from './moderation/const/labels'\nexport { Agent } from './agent'\n\nexport { AtpAgent, type AtpAgentOptions } from './atp-agent'\nexport { CredentialSession } from './atp-agent'\nexport { BskyAgent } from './bsky-agent'\n\nexport {\n /** @deprecated */\n AtpAgent as default,\n} from './atp-agent'\n\n// Expose a copy to prevent alteration of the internal Lexicon instance used by\n// the AtpBaseClient class.\nexport const lexicons = new Lexicons(internalLexicons)\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/api",
3
- "version": "0.19.4",
3
+ "version": "0.19.5",
4
4
  "license": "MIT",
5
5
  "description": "Client library for atproto and Bluesky",
6
6
  "keywords": [
@@ -21,9 +21,9 @@
21
21
  "multiformats": "^9.9.0",
22
22
  "tlds": "^1.234.0",
23
23
  "zod": "^3.23.8",
24
- "@atproto/common-web": "^0.4.18",
24
+ "@atproto/common-web": "^0.4.19",
25
25
  "@atproto/lexicon": "^0.6.2",
26
- "@atproto/syntax": "^0.5.1",
26
+ "@atproto/syntax": "^0.5.2",
27
27
  "@atproto/xrpc": "^0.7.7"
28
28
  },
29
29
  "devDependencies": {
@@ -34,7 +34,8 @@
34
34
  "@atproto/lex-cli": "^0.9.9"
35
35
  },
36
36
  "scripts": {
37
- "codegen": "node ./scripts/generate-code.mjs && lex gen-api --yes ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/* ../../lexicons/chat/bsky/*/* ../../lexicons/tools/ozone/*/* ../../lexicons/com/germnetwork/*",
37
+ "codegen": "lex gen-api --yes ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/* ../../lexicons/chat/bsky/*/* ../../lexicons/tools/ozone/*/* ../../lexicons/com/germnetwork/*",
38
+ "prebuild": "node ./scripts/generate-code.mjs && ([ -f ./src/client/index.ts ] || pnpm run codegen)",
38
39
  "build": "tsc --build tsconfig.build.json",
39
40
  "test": "jest"
40
41
  }
@@ -1,22 +1,27 @@
1
- import * as url from 'url'
2
- import { readFileSync, writeFileSync } from 'fs'
3
- import { join } from 'path'
1
+ import { mkdir, writeFile } from 'node:fs/promises'
2
+ import { dirname, join } from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
4
  import * as prettier from 'prettier'
5
+ import labelsDef from '../../definitions/labels.json' with { type: 'json' }
5
6
 
6
- const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
7
+ const __dirname = dirname(fileURLToPath(import.meta.url))
7
8
 
8
- const labelsDef = JSON.parse(
9
- readFileSync(
10
- join(__dirname, '..', '..', 'definitions', 'labels.json'),
11
- 'utf8',
12
- ),
13
- )
9
+ export async function labels() {
10
+ const content = await gen()
14
11
 
15
- writeFileSync(
16
- join(__dirname, '..', '..', 'src', 'moderation', 'const', 'labels.ts'),
17
- await gen(),
18
- 'utf8',
19
- )
12
+ const path = join(
13
+ __dirname,
14
+ '..',
15
+ '..',
16
+ 'src',
17
+ 'moderation',
18
+ 'const',
19
+ 'labels.ts',
20
+ )
21
+
22
+ await mkdir(dirname(path), { recursive: true })
23
+ await writeFile(path, content, 'utf8')
24
+ }
20
25
 
21
26
  async function gen() {
22
27
  const knownValues = new Set()
@@ -70,5 +75,3 @@ async function gen() {
70
75
  { semi: false, parser: 'typescript', singleQuote: true },
71
76
  )
72
77
  }
73
-
74
- export {}
@@ -1,3 +1,4 @@
1
- import './code/labels.mjs'
1
+ import { labels } from './code/labels.mjs'
2
+ export { labels }
2
3
 
3
- export {}
4
+ labels()
package/src/agent.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import AwaitLock from 'await-lock'
2
2
  import { TID, retry } from '@atproto/common-web'
3
- import { AtUri, ensureValidDid } from '@atproto/syntax'
3
+ import { AtUri, DidString, ensureValidDidRegex } from '@atproto/syntax'
4
4
  import {
5
5
  FetchHandler,
6
6
  FetchHandlerOptions,
@@ -63,7 +63,7 @@ const THREAD_VIEW_PREF_DEFAULTS = {
63
63
  sort: 'hotness',
64
64
  }
65
65
 
66
- export type { FetchHandler }
66
+ export type { DidString, FetchHandler }
67
67
 
68
68
  /**
69
69
  * An {@link Agent} is an {@link AtpBaseClient} with the following
@@ -207,8 +207,11 @@ export class Agent extends XrpcClient {
207
207
  /**
208
208
  * Get the authenticated user's DID, if any.
209
209
  */
210
- get did() {
211
- return this.sessionManager.did
210
+ get did(): DidString | undefined {
211
+ const { did } = this.sessionManager
212
+ if (!did) return undefined
213
+ ensureValidDidRegex(did)
214
+ return did
212
215
  }
213
216
 
214
217
  /** @deprecated Use {@link Agent.assertDid} instead */
@@ -219,7 +222,7 @@ export class Agent extends XrpcClient {
219
222
  /**
220
223
  * Get the authenticated user's DID, or throw an error if not authenticated.
221
224
  */
222
- get assertDid(): string {
225
+ get assertDid(): DidString {
223
226
  this.assertAuthenticated()
224
227
  return this.did
225
228
  }
@@ -227,7 +230,7 @@ export class Agent extends XrpcClient {
227
230
  /**
228
231
  * Assert that the user is authenticated.
229
232
  */
230
- public assertAuthenticated(): asserts this is { did: string } {
233
+ public assertAuthenticated(): asserts this is { did: DidString } {
231
234
  if (!this.did) throw new Error('Not logged in')
232
235
  }
233
236
 
@@ -890,7 +893,7 @@ export class Agent extends XrpcClient {
890
893
  labelerDid?: string,
891
894
  ) {
892
895
  if (labelerDid) {
893
- ensureValidDid(labelerDid)
896
+ ensureValidDidRegex(labelerDid)
894
897
  }
895
898
  await this.updatePreferences((prefs) => {
896
899
  const labelPref = prefs
package/src/atp-agent.ts CHANGED
@@ -88,10 +88,6 @@ export class AtpAgent extends Agent {
88
88
  return this.sessionManager.hasSession
89
89
  }
90
90
 
91
- get did() {
92
- return this.sessionManager.did
93
- }
94
-
95
91
  get serviceUrl() {
96
92
  return this.sessionManager.serviceUrl
97
93
  }
@@ -6243,21 +6243,21 @@ export const schemaDict = {
6243
6243
  ref: 'lex:app.bsky.actor.defs#profileView',
6244
6244
  },
6245
6245
  },
6246
+ recIdStr: {
6247
+ type: 'string',
6248
+ description:
6249
+ 'Snowflake for this recommendation, use when submitting recommendation events.',
6250
+ },
6246
6251
  isFallback: {
6247
6252
  type: 'boolean',
6248
6253
  description:
6249
- 'If true, response has fallen-back to generic results, and is not scoped using relativeToDid',
6254
+ 'DEPRECATED, unused. Previously: if true, response has fallen-back to generic results, and is not scoped using relativeToDid',
6250
6255
  default: false,
6251
6256
  },
6252
6257
  recId: {
6253
6258
  type: 'integer',
6254
6259
  description: 'DEPRECATED: use recIdStr instead.',
6255
6260
  },
6256
- recIdStr: {
6257
- type: 'string',
6258
- description:
6259
- 'Snowflake for this recommendation, use when submitting recommendation events.',
6260
- },
6261
6261
  },
6262
6262
  },
6263
6263
  },
@@ -11842,16 +11842,13 @@ export const schemaDict = {
11842
11842
  type: 'string',
11843
11843
  knownValues: [
11844
11844
  '!hide',
11845
- '!no-promote',
11846
11845
  '!warn',
11847
11846
  '!no-unauthenticated',
11848
- 'dmca-violation',
11849
- 'doxxing',
11850
11847
  'porn',
11851
11848
  'sexual',
11852
11849
  'nudity',
11853
- 'nsfl',
11854
- 'gore',
11850
+ 'graphic-media',
11851
+ 'bot',
11855
11852
  ],
11856
11853
  },
11857
11854
  },
@@ -23,12 +23,12 @@ export type InputSchema = undefined
23
23
 
24
24
  export interface OutputSchema {
25
25
  suggestions: AppBskyActorDefs.ProfileView[]
26
- /** If true, response has fallen-back to generic results, and is not scoped using relativeToDid */
26
+ /** Snowflake for this recommendation, use when submitting recommendation events. */
27
+ recIdStr?: string
28
+ /** DEPRECATED, unused. Previously: if true, response has fallen-back to generic results, and is not scoped using relativeToDid */
27
29
  isFallback: boolean
28
30
  /** DEPRECATED: use recIdStr instead. */
29
31
  recId?: number
30
- /** Snowflake for this recommendation, use when submitting recommendation events. */
31
- recIdStr?: string
32
32
  }
33
33
 
34
34
  export interface CallOptions {
@@ -133,14 +133,11 @@ export function validateLabelValueDefinitionStrings<V>(v: V) {
133
133
 
134
134
  export type LabelValue =
135
135
  | '!hide'
136
- | '!no-promote'
137
136
  | '!warn'
138
137
  | '!no-unauthenticated'
139
- | 'dmca-violation'
140
- | 'doxxing'
141
138
  | 'porn'
142
139
  | 'sexual'
143
140
  | 'nudity'
144
- | 'nsfl'
145
- | 'gore'
141
+ | 'graphic-media'
142
+ | 'bot'
146
143
  | (string & {})
package/src/index.ts CHANGED
@@ -10,11 +10,13 @@ export {
10
10
  stringifyLex,
11
11
  } from '@atproto/lexicon'
12
12
  export { parseLanguage } from '@atproto/common-web'
13
+ export { XRPCError } from '@atproto/xrpc'
14
+
13
15
  export * from './types'
14
16
  export * from './const'
15
17
  export * from './util'
16
18
  export * from './client'
17
- export { schemas } from './client/lexicons'
19
+ export { ids, schemas } from './client/lexicons'
18
20
  export type { $Typed, Un$Typed } from './client/util'
19
21
  export { asPredicate } from './client/util'
20
22
  export * from './rich-text/rich-text'
@@ -9,7 +9,7 @@ describe('errors', () => {
9
9
  network = await TestNetworkNoAppView.create({
10
10
  dbPostgresSchema: 'known_errors',
11
11
  })
12
- client = network.pds.getClient()
12
+ client = network.pds.getAgent()
13
13
  })
14
14
 
15
15
  afterAll(async () => {
@@ -17,7 +17,7 @@ describe('agent', () => {
17
17
  })
18
18
 
19
19
  it('migrates legacy content-label prefs (no mutations)', async () => {
20
- const agent = network.pds.getClient()
20
+ const agent = network.pds.getAgent()
21
21
 
22
22
  await agent.createAccount({
23
23
  handle: 'user1.test',
@@ -101,7 +101,7 @@ describe('agent', () => {
101
101
  })
102
102
 
103
103
  it('adds/removes moderation services', async () => {
104
- const agent = network.pds.getClient()
104
+ const agent = network.pds.getAgent()
105
105
 
106
106
  await agent.createAccount({
107
107
  handle: 'user5.test',
@@ -207,7 +207,7 @@ describe('agent', () => {
207
207
  })
208
208
 
209
209
  it('sets label preferences globally and per-moderator', async () => {
210
- const agent = network.pds.getClient()
210
+ const agent = network.pds.getAgent()
211
211
 
212
212
  await agent.createAccount({
213
213
  handle: 'user7.test',
@@ -273,7 +273,7 @@ describe('agent', () => {
273
273
  })
274
274
 
275
275
  it(`updates label pref`, async () => {
276
- const agent = network.pds.getClient()
276
+ const agent = network.pds.getAgent()
277
277
 
278
278
  await agent.createAccount({
279
279
  handle: 'user8.test',
@@ -297,7 +297,7 @@ describe('agent', () => {
297
297
  })
298
298
 
299
299
  it(`double-write for legacy: 'graphic-media' in sync with 'gore'`, async () => {
300
- const agent = network.pds.getClient()
300
+ const agent = network.pds.getAgent()
301
301
 
302
302
  await agent.createAccount({
303
303
  handle: 'user9.test',
@@ -319,7 +319,7 @@ describe('agent', () => {
319
319
  })
320
320
 
321
321
  it(`double-write for legacy: 'porn' in sync with 'nsfw'`, async () => {
322
- const agent = network.pds.getClient()
322
+ const agent = network.pds.getAgent()
323
323
 
324
324
  await agent.createAccount({
325
325
  handle: 'user10.test',
@@ -341,7 +341,7 @@ describe('agent', () => {
341
341
  })
342
342
 
343
343
  it(`double-write for legacy: 'sexual' in sync with 'suggestive'`, async () => {
344
- const agent = network.pds.getClient()
344
+ const agent = network.pds.getAgent()
345
345
 
346
346
  await agent.createAccount({
347
347
  handle: 'user11.test',
@@ -363,7 +363,7 @@ describe('agent', () => {
363
363
  })
364
364
 
365
365
  it(`double-write for legacy: filters out existing old label pref if double-written`, async () => {
366
- const agent = network.pds.getClient()
366
+ const agent = network.pds.getAgent()
367
367
 
368
368
  await agent.createAccount({
369
369
  handle: 'user12.test',
@@ -382,7 +382,7 @@ describe('agent', () => {
382
382
  })
383
383
 
384
384
  it(`remaps old values to new on read`, async () => {
385
- const agent = network.pds.getClient()
385
+ const agent = network.pds.getAgent()
386
386
 
387
387
  await agent.createAccount({
388
388
  handle: 'user13.test',