@atproto/lex-client 0.0.10 → 0.0.11

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atproto/lex-client
2
2
 
3
+ ## 0.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#4589](https://github.com/bluesky-social/atproto/pull/4589) [`369bb02`](https://github.com/bluesky-social/atproto/commit/369bb02b9f80f0e15e5242e54f09bd4e01117f3a) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add ability to set default `headers` when creating XRPC agent
8
+
9
+ - [#4589](https://github.com/bluesky-social/atproto/pull/4589) [`369bb02`](https://github.com/bluesky-social/atproto/commit/369bb02b9f80f0e15e5242e54f09bd4e01117f3a) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve typing of error responses
10
+
11
+ - [#4589](https://github.com/bluesky-social/atproto/pull/4589) [`369bb02`](https://github.com/bluesky-social/atproto/commit/369bb02b9f80f0e15e5242e54f09bd4e01117f3a) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow omitting `rkey` for record definition usin `any`as record key
12
+
13
+ - Updated dependencies [[`369bb02`](https://github.com/bluesky-social/atproto/commit/369bb02b9f80f0e15e5242e54f09bd4e01117f3a)]:
14
+ - @atproto/lex-data@0.0.10
15
+ - @atproto/lex-json@0.0.10
16
+ - @atproto/lex-schema@0.0.11
17
+
3
18
  ## 0.0.10
4
19
 
5
20
  ### Patch Changes
package/dist/agent.d.ts CHANGED
@@ -21,6 +21,11 @@ export type AgentConfig = {
21
21
  * such as a service URL that changes based on authentication.
22
22
  */
23
23
  service: string | URL;
24
+ /**
25
+ * Optional headers to include with every request made by this agent, unless
26
+ * overridden by the request-specific headers provided to the fetch handler.
27
+ */
28
+ headers?: HeadersInit;
24
29
  /**
25
30
  * Bring your own fetch implementation. Typically useful for testing, logging,
26
31
  * mocking, or adding retries, session management, signatures, proof of
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,MAAM,YAAY,GAAG;AACzB;;;;GAIG;AACH,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,WAAW,KACd,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEtB,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAA;IACxB,YAAY,EAAE,YAAY,CAAA;CAC3B;AAED,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,GAAG,CAAC,EAAE,SAAS,CAAA;IAEf;;;;OAIG;IACH,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;IAErB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,GAAG,CAAA;AAErD,wBAAgB,UAAU,CAAC,OAAO,EAAE,KAAK,GAAG,YAAY,GAAG,KAAK,CAyB/D"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,MAAM,YAAY,GAAG;AACzB;;;;GAIG;AACH,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,WAAW,KACd,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEtB,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAA;IACxB,YAAY,EAAE,YAAY,CAAA;CAC3B;AAED,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,GAAG,CAAC,EAAE,SAAS,CAAA;IAEf;;;;OAIG;IACH,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAA;IAErB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,GAAG,CAAA;AAErD,wBAAgB,UAAU,CAAC,OAAO,EAAE,KAAK,GAAG,YAAY,GAAG,KAAK,CAiC/D"}
package/dist/agent.js CHANGED
@@ -17,8 +17,22 @@ function buildAgent(options) {
17
17
  return config.did;
18
18
  },
19
19
  async fetchHandler(path, init) {
20
- return fetch(new URL(path, service), init);
20
+ const headers = config.headers != null && init.headers != null
21
+ ? mergeHeaders(config.headers, init.headers)
22
+ : config.headers || init.headers;
23
+ return fetch(new URL(path, service), headers !== init.headers ? { ...init, headers } : init);
21
24
  },
22
25
  };
23
26
  }
27
+ function mergeHeaders(defaultHeaders, requestHeaders) {
28
+ // We don't want to alter the original Headers objects, so we create a new one
29
+ const result = new Headers(defaultHeaders);
30
+ const overrides = requestHeaders instanceof Headers
31
+ ? requestHeaders
32
+ : new Headers(requestHeaders);
33
+ for (const [key, value] of overrides.entries()) {
34
+ result.set(key, value);
35
+ }
36
+ return result;
37
+ }
24
38
  //# sourceMappingURL=agent.js.map
package/dist/agent.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;AAyCA,gCAyBC;AAzBD,SAAgB,UAAU,CAAC,OAA6B;IACtD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,IAAI,OAAO,EAAE,CAAC;QAC7D,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,MAAM,MAAM,GACV,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,YAAY,GAAG;QACnD,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE;QACtC,CAAC,CAAC,OAAO,CAAA;IAEb,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,GAAG,MAAM,CAAA;IAEpD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAA;IACrE,CAAC;IAED,OAAO;QACL,IAAI,GAAG;YACL,OAAO,MAAM,CAAC,GAAG,CAAA;QACnB,CAAC;QAED,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI;YAC3B,OAAO,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5C,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["import { DidString } from '@atproto/lex-schema'\n\nexport type FetchHandler = (\n /**\n * The URL (pathname + query parameters) to make the request to, without the\n * origin. The origin (protocol, hostname, and port) must be added by this\n * {@link FetchHandler}, typically based on authentication or other factors.\n */\n path: string,\n init: RequestInit,\n) => Promise<Response>\n\nexport interface Agent {\n readonly did?: DidString\n fetchHandler: FetchHandler\n}\n\nexport type AgentConfig = {\n /**\n * The identifier (DID) of the user represented by this agent.\n */\n did?: DidString\n\n /**\n * The service URL to make requests to. This can be a string, URL, or a\n * function that returns a string or URL. This is useful for dynamic URLs,\n * such as a service URL that changes based on authentication.\n */\n service: string | URL\n\n /**\n * Bring your own fetch implementation. Typically useful for testing, logging,\n * mocking, or adding retries, session management, signatures, proof of\n * possession (DPoP), SSRF protection, etc. Defaults to the global `fetch`\n * function.\n */\n fetch?: typeof globalThis.fetch\n}\n\nexport type AgentOptions = AgentConfig | string | URL\n\nexport function buildAgent(options: Agent | AgentOptions): Agent {\n if (typeof options === 'object' && 'fetchHandler' in options) {\n return options\n }\n\n const config: Agent | AgentConfig =\n typeof options === 'string' || options instanceof URL\n ? { did: undefined, service: options }\n : options\n\n const { service, fetch = globalThis.fetch } = config\n\n if (typeof fetch !== 'function') {\n throw new TypeError('fetch() is not available in this environment')\n }\n\n return {\n get did() {\n return config.did\n },\n\n async fetchHandler(path, init) {\n return fetch(new URL(path, service), init)\n },\n }\n}\n"]}
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;AA+CA,gCAiCC;AAjCD,SAAgB,UAAU,CAAC,OAA6B;IACtD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,IAAI,OAAO,EAAE,CAAC;QAC7D,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,MAAM,MAAM,GACV,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,YAAY,GAAG;QACnD,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE;QACtC,CAAC,CAAC,OAAO,CAAA;IAEb,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,GAAG,MAAM,CAAA;IAEpD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAA;IACrE,CAAC;IAED,OAAO;QACL,IAAI,GAAG;YACL,OAAO,MAAM,CAAC,GAAG,CAAA;QACnB,CAAC;QAED,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI;YAC3B,MAAM,OAAO,GACX,MAAM,CAAC,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI;gBAC5C,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;gBAC5C,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAA;YAEpC,OAAO,KAAK,CACV,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,EACtB,OAAO,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CACvD,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAED,SAAS,YAAY,CACnB,cAA2B,EAC3B,cAA2B;IAE3B,8EAA8E;IAC9E,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC,CAAA;IAE1C,MAAM,SAAS,GACb,cAAc,YAAY,OAAO;QAC/B,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,IAAI,OAAO,CAAC,cAAc,CAAC,CAAA;IAEjC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACxB,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { DidString } from '@atproto/lex-schema'\n\nexport type FetchHandler = (\n /**\n * The URL (pathname + query parameters) to make the request to, without the\n * origin. The origin (protocol, hostname, and port) must be added by this\n * {@link FetchHandler}, typically based on authentication or other factors.\n */\n path: string,\n init: RequestInit,\n) => Promise<Response>\n\nexport interface Agent {\n readonly did?: DidString\n fetchHandler: FetchHandler\n}\n\nexport type AgentConfig = {\n /**\n * The identifier (DID) of the user represented by this agent.\n */\n did?: DidString\n\n /**\n * The service URL to make requests to. This can be a string, URL, or a\n * function that returns a string or URL. This is useful for dynamic URLs,\n * such as a service URL that changes based on authentication.\n */\n service: string | URL\n\n /**\n * Optional headers to include with every request made by this agent, unless\n * overridden by the request-specific headers provided to the fetch handler.\n */\n headers?: HeadersInit\n\n /**\n * Bring your own fetch implementation. Typically useful for testing, logging,\n * mocking, or adding retries, session management, signatures, proof of\n * possession (DPoP), SSRF protection, etc. Defaults to the global `fetch`\n * function.\n */\n fetch?: typeof globalThis.fetch\n}\n\nexport type AgentOptions = AgentConfig | string | URL\n\nexport function buildAgent(options: Agent | AgentOptions): Agent {\n if (typeof options === 'object' && 'fetchHandler' in options) {\n return options\n }\n\n const config: Agent | AgentConfig =\n typeof options === 'string' || options instanceof URL\n ? { did: undefined, service: options }\n : options\n\n const { service, fetch = globalThis.fetch } = config\n\n if (typeof fetch !== 'function') {\n throw new TypeError('fetch() is not available in this environment')\n }\n\n return {\n get did() {\n return config.did\n },\n\n async fetchHandler(path, init) {\n const headers =\n config.headers != null && init.headers != null\n ? mergeHeaders(config.headers, init.headers)\n : config.headers || init.headers\n\n return fetch(\n new URL(path, service),\n headers !== init.headers ? { ...init, headers } : init,\n )\n },\n }\n}\n\nfunction mergeHeaders(\n defaultHeaders: HeadersInit,\n requestHeaders: HeadersInit,\n): Headers {\n // We don't want to alter the original Headers objects, so we create a new one\n const result = new Headers(defaultHeaders)\n\n const overrides =\n requestHeaders instanceof Headers\n ? requestHeaders\n : new Headers(requestHeaders)\n\n for (const [key, value] of overrides.entries()) {\n result.set(key, value)\n }\n\n return result\n}\n"]}
package/dist/client.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { LexMap, LexValue } from '@atproto/lex-data';
2
2
  import { AtIdentifierString, CidString, DidString, Infer, InferMethodInputBody, InferMethodOutputBody, InferRecordKey, LexiconRecordKey, Main, NsidString, Params, Procedure, Query, RecordSchema, Restricted, UnknownObject } from '@atproto/lex-schema';
3
3
  import { Agent, AgentOptions } from './agent.js';
4
+ import { XrpcFailure } from './errors.js';
4
5
  import { com } from './lexicons/index.js';
5
6
  import { XrpcResponse, XrpcResponseBody } from './response.js';
6
7
  import { BinaryBodyInit, CallOptions, Service } from './types.js';
7
- import { XrpcFailure, XrpcOptions, XrpcRequestParams } from './xrpc.js';
8
+ import { XrpcOptions, XrpcRequestParams } from './xrpc.js';
8
9
  export type { AtIdentifierString, CidString, DidString, InferMethodInputBody, InferMethodOutputBody, InferRecordKey, LexMap, LexValue, LexiconRecordKey, NsidString, Params, Procedure, Query, RecordSchema, Restricted, };
9
10
  export type ClientOptions = {
10
11
  labelers?: Iterable<DidString>;
@@ -44,7 +45,7 @@ export type RecordKeyOptions<T extends RecordSchema, AlsoOptionalWhenRecordKeyIs
44
45
  } : {
45
46
  rkey: InferRecordKey<T>;
46
47
  };
47
- export type CreateOptions<T extends RecordSchema> = CreateRecordOptions & RecordKeyOptions<T, 'tid'>;
48
+ export type CreateOptions<T extends RecordSchema> = CreateRecordOptions & RecordKeyOptions<T, 'tid' | 'any'>;
48
49
  export type CreateOutput = InferMethodOutputBody<typeof com.atproto.repo.createRecord.main, Uint8Array>;
49
50
  export type DeleteOptions<T extends RecordSchema> = DeleteRecordOptions & RecordKeyOptions<T>;
50
51
  export type DeleteOutput = InferMethodOutputBody<typeof com.atproto.repo.deleteRecord.main, Uint8Array>;
@@ -224,6 +225,7 @@ export declare class Client implements Agent {
224
225
  }>;
225
226
  }>, import("@atproto/lex-schema").Payload<"*/*", undefined>, readonly ["BlobNotFound", "RepoNotFound", "RepoTakendown", "RepoSuspended", "RepoDeactivated"]>>>;
226
227
  call<const T extends Query>(ns: NonNullable<unknown> extends XrpcRequestParams<T> ? Main<T> : Restricted<'This query type requires a "params" argument'>): Promise<XrpcResponseBody<T>>;
228
+ call<const T extends Procedure>(ns: undefined extends InferMethodInputBody<T, Uint8Array> ? Main<T> : Restricted<'This procedure type requires an "input" argument'>): Promise<XrpcResponseBody<T>>;
227
229
  call<const T extends Action>(ns: void extends InferActionInput<T> ? Main<T> : Restricted<'This action type requires an "input" argument'>): Promise<InferActionOutput<T>>;
228
230
  call<const T extends Action | Procedure | Query>(ns: Main<T>, arg: T extends Action ? InferActionInput<T> : T extends Procedure ? InferMethodInputBody<T, Uint8Array> : T extends Query ? XrpcRequestParams<T> : never, options?: CallOptions): Promise<T extends Action ? InferActionOutput<T> : T extends Procedure ? XrpcResponseBody<T> : T extends Query ? XrpcResponseBody<T> : never>;
229
231
  create<const T extends RecordSchema>(ns: NonNullable<unknown> extends CreateOptions<T> ? Main<T> : Restricted<'This record type requires an "options" argument'>, input: Omit<Infer<T>, '$type'>): Promise<CreateOutput>;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"m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CAAA;IACtC,CAAC;;AA/WH,wBAgXC;AAED,SAAS,mBAAmB,CAC1B,MAAS;IAET,kCAAkC;IAClC,IAAI,MAAM,CAAC,GAAG,KAAK,KAAK;QAAE,OAAO,SAAS,CAAA;IAC1C,IAAI,MAAM,CAAC,GAAG,KAAK,KAAK;QAAE,OAAO,SAAS,CAAA;IAE1C,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAA;AACpC,CAAC;AAED,SAAS,mBAAmB,CAC1B,MAAS;IAET,IAAI,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC5B,CAAC;IAED,MAAM,IAAI,SAAS,CACjB,mDAAmD,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,KAAK,GAAG,CACnF,CAAA;AACH,CAAC","sourcesContent":["import { LexError, LexMap, LexValue } from '@atproto/lex-data'\nimport {\n AtIdentifierString,\n CidString,\n DidString,\n Infer,\n InferMethodInputBody,\n InferMethodOutputBody,\n InferRecordKey,\n LexiconRecordKey,\n Main,\n NsidString,\n Params,\n Procedure,\n Query,\n RecordSchema,\n Restricted,\n UnknownObject,\n getMain,\n} from '@atproto/lex-schema'\nimport { Agent, AgentOptions, buildAgent } from './agent.js'\nimport { com } from './lexicons/index.js'\nimport { XrpcResponse, XrpcResponseBody } from './response.js'\nimport { BinaryBodyInit, CallOptions, Service } from './types.js'\nimport { buildAtprotoHeaders } from './util.js'\nimport {\n XrpcFailure,\n XrpcOptions,\n XrpcRequestParams,\n xrpc,\n xrpcSafe,\n} from './xrpc.js'\n\nexport type {\n AtIdentifierString,\n CidString,\n DidString,\n InferMethodInputBody,\n InferMethodOutputBody,\n InferRecordKey,\n LexMap,\n LexValue,\n LexiconRecordKey,\n NsidString,\n Params,\n Procedure,\n Query,\n RecordSchema,\n Restricted,\n}\n\nexport type ClientOptions = {\n labelers?: Iterable<DidString>\n headers?: HeadersInit\n service?: Service\n}\n\nexport type Action<I = any, O = any> = (\n client: Client,\n input: I,\n options: CallOptions,\n) => O | Promise<O>\nexport type InferActionInput<A extends Action> =\n A extends Action<infer I, any> ? I : never\nexport type InferActionOutput<A extends Action> =\n A extends Action<any, infer O> ? O : never\n\nexport type CreateRecordOptions = CallOptions & {\n repo?: AtIdentifierString\n swapCommit?: string\n validate?: boolean\n}\n\nexport type DeleteRecordOptions = CallOptions & {\n repo?: AtIdentifierString\n swapCommit?: string\n swapRecord?: string\n}\n\nexport type GetRecordOptions = CallOptions & {\n repo?: AtIdentifierString\n}\n\nexport type PutRecordOptions = CallOptions & {\n repo?: AtIdentifierString\n swapCommit?: string\n swapRecord?: string\n validate?: boolean\n}\n\nexport type ListRecordsOptions = CallOptions & {\n repo?: AtIdentifierString\n limit?: number\n cursor?: string\n reverse?: boolean\n}\n\nexport type RecordKeyOptions<\n T extends RecordSchema,\n AlsoOptionalWhenRecordKeyIs extends LexiconRecordKey = never,\n> = T['key'] extends `literal:${string}` | AlsoOptionalWhenRecordKeyIs\n ? { rkey?: InferRecordKey<T> }\n : { rkey: InferRecordKey<T> }\n\nexport type CreateOptions<T extends RecordSchema> = CreateRecordOptions &\n RecordKeyOptions<T, 'tid'>\nexport type CreateOutput = InferMethodOutputBody<\n typeof com.atproto.repo.createRecord.main,\n Uint8Array\n>\n\nexport type DeleteOptions<T extends RecordSchema> = DeleteRecordOptions &\n RecordKeyOptions<T>\nexport type DeleteOutput = InferMethodOutputBody<\n typeof com.atproto.repo.deleteRecord.main,\n Uint8Array\n>\nexport type GetOptions<T extends RecordSchema> = GetRecordOptions &\n RecordKeyOptions<T>\nexport type GetOutput<T extends RecordSchema> = Omit<\n InferMethodOutputBody<typeof com.atproto.repo.getRecord.main, Uint8Array>,\n 'value'\n> & { value: Infer<T> }\n\nexport type PutOptions<T extends RecordSchema> = PutRecordOptions &\n RecordKeyOptions<T>\nexport type PutOutput = InferMethodOutputBody<\n typeof com.atproto.repo.putRecord.main,\n Uint8Array\n>\n\nexport type ListOptions = ListRecordsOptions\nexport type ListOutput<T extends RecordSchema> = InferMethodOutputBody<\n typeof com.atproto.repo.listRecords.main,\n Uint8Array\n> & {\n records: ListRecord<Infer<T>>[]\n // @NOTE Because the schema uses \"type\": \"unknown\" instead of an open union,\n // we have to use UnknownObject instead of Unknown$TypedObject here.\n invalid: UnknownObject[]\n}\nexport type ListRecord<Value extends LexMap> =\n com.atproto.repo.listRecords.Record & {\n value: Value\n }\n\nexport class Client implements Agent {\n static appLabelers: readonly DidString[] = []\n\n /**\n * Configures the Client (or its sub classes) globally.\n */\n static configure(opts: { appLabelers?: Iterable<DidString> }) {\n if (opts.appLabelers) this.appLabelers = [...opts.appLabelers]\n }\n\n public readonly agent: Agent\n public readonly headers: Headers\n public readonly service?: Service\n public readonly labelers: Set<DidString>\n\n constructor(agent: Agent | AgentOptions, options: ClientOptions = {}) {\n this.agent = buildAgent(agent)\n this.service = options.service\n this.labelers = new Set(options.labelers)\n this.headers = new Headers(options.headers)\n }\n\n get did(): DidString | undefined {\n return this.agent.did\n }\n\n get assertDid(): DidString {\n this.assertAuthenticated()\n return this.did\n }\n\n public assertAuthenticated(): asserts this is { did: DidString } {\n if (!this.did) throw new LexError('AuthenticationRequired')\n }\n\n public setLabelers(labelers: Iterable<DidString> = []) {\n this.clearLabelers()\n this.addLabelers(labelers)\n }\n\n public addLabelers(labelers: Iterable<DidString>) {\n for (const labeler of labelers) this.labelers.add(labeler)\n }\n\n public clearLabelers() {\n this.labelers.clear()\n }\n\n public fetchHandler(path: string, init: RequestInit): Promise<Response> {\n const headers = buildAtprotoHeaders({\n headers: init.headers,\n service: this.service,\n labelers: [\n ...(this.constructor as typeof Client).appLabelers.map(\n (l) => `${l};redact` as const,\n ),\n ...this.labelers,\n ],\n })\n\n // Incoming headers take precedence\n for (const [key, value] of this.headers) {\n if (!headers.has(key)) headers.set(key, value)\n }\n\n // @NOTE The agent here could be another Client instance.\n return this.agent.fetchHandler(path, { ...init, headers })\n }\n\n /**\n * @throws {XrpcFailure<M>} when the request fails or the response is an error\n */\n async xrpc<const M extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<M>\n ? Main<M>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcResponse<M>>\n async xrpc<const M extends Query | Procedure>(\n ns: Main<M>,\n options: XrpcOptions<M>,\n ): Promise<XrpcResponse<M>>\n async xrpc<const M extends Query | Procedure>(\n ns: Main<M>,\n options: XrpcOptions<M> = {} as XrpcOptions<M>,\n ): Promise<XrpcResponse<M>> {\n return xrpc(this, ns, options)\n }\n\n async xrpcSafe<const M extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<M>\n ? Main<M>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcResponse<M> | XrpcFailure<M>>\n async xrpcSafe<const M extends Query | Procedure>(\n ns: Main<M>,\n options: XrpcOptions<M>,\n ): Promise<XrpcResponse<M> | XrpcFailure<M>>\n async xrpcSafe<const M extends Query | Procedure>(\n ns: Main<M>,\n options: XrpcOptions<M> = {} as XrpcOptions<M>,\n ): Promise<XrpcResponse<M> | XrpcFailure<M>> {\n return xrpcSafe(this, ns, options)\n }\n\n /**\n * @param rkey Leave `undefined` to have the server generate a TID.\n */\n public async createRecord(\n record: { $type: NsidString } & LexMap,\n rkey?: string,\n options?: CreateRecordOptions,\n ) {\n return this.xrpc(com.atproto.repo.createRecord.main, {\n ...options,\n body: {\n repo: options?.repo ?? this.assertDid,\n collection: record.$type,\n record,\n rkey,\n validate: options?.validate,\n swapCommit: options?.swapCommit,\n },\n })\n }\n\n async deleteRecord(\n collection: NsidString,\n rkey: string,\n options?: DeleteRecordOptions,\n ) {\n return this.xrpc(com.atproto.repo.deleteRecord.main, {\n ...options,\n body: {\n repo: options?.repo ?? this.assertDid,\n collection,\n rkey,\n swapCommit: options?.swapCommit,\n swapRecord: options?.swapRecord,\n },\n })\n }\n\n public async getRecord(\n collection: NsidString,\n rkey: string,\n options?: GetRecordOptions,\n ) {\n return this.xrpc(com.atproto.repo.getRecord.main, {\n ...options,\n params: {\n repo: options?.repo ?? this.assertDid,\n collection,\n rkey,\n },\n })\n }\n\n async putRecord(\n record: { $type: NsidString } & LexMap,\n rkey: string,\n options?: PutRecordOptions,\n ) {\n return this.xrpc(com.atproto.repo.putRecord.main, {\n ...options,\n body: {\n repo: options?.repo ?? this.assertDid,\n collection: record.$type,\n rkey,\n record,\n validate: options?.validate,\n swapCommit: options?.swapCommit,\n swapRecord: options?.swapRecord,\n },\n })\n }\n\n async listRecords(nsid: NsidString, options?: ListRecordsOptions) {\n return this.xrpc(com.atproto.repo.listRecords.main, {\n ...options,\n params: {\n repo: options?.repo ?? this.assertDid,\n collection: nsid,\n cursor: options?.cursor,\n limit: options?.limit,\n reverse: options?.reverse,\n },\n })\n }\n\n async uploadBlob(\n body: BinaryBodyInit,\n options?: CallOptions & { encoding?: `${string}/${string}` },\n ) {\n return this.xrpc(com.atproto.repo.uploadBlob.main, {\n ...options,\n body,\n })\n }\n\n async getBlob(did: DidString, cid: CidString, options?: CallOptions) {\n return this.xrpc(com.atproto.sync.getBlob.main, {\n ...options,\n params: { did, cid },\n })\n }\n\n public async call<const T extends Query>(\n ns: NonNullable<unknown> extends XrpcRequestParams<T>\n ? Main<T>\n : Restricted<'This query type requires a \"params\" argument'>,\n ): Promise<XrpcResponseBody<T>>\n public async call<const T extends Action>(\n ns: void extends InferActionInput<T>\n ? Main<T>\n : Restricted<'This action type requires an \"input\" argument'>,\n ): Promise<InferActionOutput<T>>\n public async call<const T extends Action | Procedure | Query>(\n ns: Main<T>,\n arg: T extends Action\n ? InferActionInput<T>\n : T extends Procedure\n ? InferMethodInputBody<T, Uint8Array>\n : T extends Query\n ? XrpcRequestParams<T>\n : never,\n options?: CallOptions,\n ): Promise<\n T extends Action\n ? InferActionOutput<T>\n : T extends Procedure\n ? XrpcResponseBody<T>\n : T extends Query\n ? XrpcResponseBody<T>\n : never\n >\n public async call(\n ns: Main<Action> | Main<Procedure> | Main<Query>,\n arg?: LexValue | Params,\n options: CallOptions = {},\n ): Promise<unknown> {\n const method = getMain(ns)\n\n if (typeof method === 'function') {\n return method(this, arg, options)\n }\n\n if (method instanceof Procedure) {\n const result = await this.xrpc(method, { ...options, body: arg as any })\n return result.body\n } else if (method instanceof Query) {\n const result = await this.xrpc(method, { ...options, params: arg as any })\n return result.body\n } else {\n throw new TypeError('Invalid lexicon')\n }\n }\n\n public async create<const T extends RecordSchema>(\n ns: NonNullable<unknown> extends CreateOptions<T>\n ? Main<T>\n : Restricted<'This record type requires an \"options\" argument'>,\n input: Omit<Infer<T>, '$type'>,\n ): Promise<CreateOutput>\n public async create<const T extends RecordSchema>(\n ns: Main<T>,\n input: Omit<Infer<T>, '$type'>,\n options: CreateOptions<T>,\n ): Promise<CreateOutput>\n public async create<const T extends RecordSchema>(\n ns: Main<T>,\n input: Omit<Infer<T>, '$type'>,\n options: CreateOptions<T> = {} as CreateOptions<T>,\n ): Promise<CreateOutput> {\n const schema: T = getMain(ns)\n const record = schema.build(input) as { $type: NsidString } & LexMap\n const rkey = options.rkey ?? getDefaultRecordKey(schema)\n if (rkey !== undefined) schema.keySchema.assert(rkey)\n const response = await this.createRecord(record, rkey, options)\n return response.body\n }\n\n public async delete<const T extends RecordSchema>(\n ns: NonNullable<unknown> extends DeleteOptions<T>\n ? Main<T>\n : Restricted<'This record type requires an \"options\" argument'>,\n ): Promise<DeleteOutput>\n public async delete<const T extends RecordSchema>(\n ns: Main<T>,\n options?: DeleteOptions<T>,\n ): Promise<DeleteOutput>\n public async delete<const T extends RecordSchema>(\n ns: Main<T>,\n options: DeleteOptions<T> = {} as DeleteOptions<T>,\n ): Promise<DeleteOutput> {\n const schema = getMain(ns)\n const rkey = schema.keySchema.parse(\n options.rkey ?? getLiteralRecordKey(schema),\n )\n const response = await this.deleteRecord(schema.$type, rkey, options)\n return response.body\n }\n\n public async get<const T extends RecordSchema>(\n ns: T['key'] extends `literal:${string}`\n ? Main<T>\n : Restricted<'This record type requires an \"options\" argument'>,\n ): Promise<GetOutput<T>>\n public async get<const T extends RecordSchema>(\n ns: Main<T>,\n options?: GetOptions<T>,\n ): Promise<GetOutput<T>>\n public async get<const T extends RecordSchema>(\n ns: Main<T>,\n options: GetOptions<T> = {} as GetOptions<T>,\n ): Promise<GetOutput<T>> {\n const schema = getMain(ns)\n const rkey = schema.keySchema.parse(\n options.rkey ?? getLiteralRecordKey(schema),\n )\n const response = await this.getRecord(schema.$type, rkey, options)\n const value = schema.validate(response.body.value)\n return { ...response.body, value }\n }\n\n public async put<const T extends RecordSchema>(\n ns: NonNullable<unknown> extends PutOptions<T>\n ? Main<T>\n : Restricted<'This record type requires an \"options\" argument'>,\n input: Omit<Infer<T>, '$type'>,\n ): Promise<PutOutput>\n public async put<const T extends RecordSchema>(\n ns: Main<T>,\n input: Omit<Infer<T>, '$type'>,\n options: PutOptions<T>,\n ): Promise<PutOutput>\n public async put<const T extends RecordSchema>(\n ns: Main<T>,\n input: Omit<Infer<T>, '$type'>,\n options: PutOptions<T> = {} as PutOptions<T>,\n ): Promise<PutOutput> {\n const schema: T = getMain(ns)\n const record = schema.build(input) as { $type: NsidString } & LexMap\n const rkey = options.rkey ?? getLiteralRecordKey(schema)\n const response = await this.putRecord(record, rkey, options)\n return response.body\n }\n\n async list<const T extends RecordSchema>(\n ns: Main<T>,\n options?: ListOptions,\n ): Promise<ListOutput<T>> {\n const schema = getMain(ns)\n const { body } = await this.listRecords(schema.$type, options)\n\n const records: ListRecord<Infer<T>>[] = []\n const invalid: LexMap[] = []\n\n for (const record of body.records) {\n const parsed = schema.safeValidate(record.value)\n if (parsed.success) {\n records.push({ ...record, value: parsed.value })\n } else {\n invalid.push(record.value)\n }\n }\n\n return { ...body, records, invalid }\n }\n}\n\nfunction getDefaultRecordKey<const T extends RecordSchema>(\n schema: T,\n): undefined | InferRecordKey<T> {\n // Let the server generate the TID\n if (schema.key === 'tid') return undefined\n if (schema.key === 'any') return undefined\n\n return getLiteralRecordKey(schema)\n}\n\nfunction getLiteralRecordKey<const T extends RecordSchema>(\n schema: T,\n): InferRecordKey<T> {\n if (schema.key.startsWith('literal:')) {\n return schema.key.slice(8)\n }\n\n throw new TypeError(\n `An \"rkey\" must be provided for record key type \"${schema.key}\" (${schema.$type})`,\n )\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,gDAA8D;AAC9D,oDAkB4B;AAC5B,yCAA4D;AAE5D,kDAAyC;AAGzC,uCAA+C;AAC/C,uCAA0E;AAmH1E,MAAa,MAAM;IACjB,MAAM,CAAC,WAAW,GAAyB,EAAE,CAAA;IAE7C;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,IAA2C;QAC1D,IAAI,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAA;IAChE,CAAC;IAEe,KAAK,CAAO;IACZ,OAAO,CAAS;IAChB,OAAO,CAAU;IACjB,QAAQ,CAAgB;IAExC,YAAY,KAA2B,EAAE,UAAyB,EAAE;QAClE,IAAI,CAAC,KAAK,GAAG,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAA;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC7C,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA;IACvB,CAAC;IAED,IAAI,SAAS;QACX,IAAI,CAAC,mBAAmB,EAAE,CAAA;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAEM,mBAAmB;QACxB,IAAI,CAAC,I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CAAC,GAAG,KAAK,KAAK;QAAE,OAAO,SAAS,CAAA;IAC1C,IAAI,MAAM,CAAC,GAAG,KAAK,KAAK;QAAE,OAAO,SAAS,CAAA;IAE1C,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAA;AACpC,CAAC;AAED,SAAS,mBAAmB,CAC1B,MAAS;IAET,IAAI,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC5B,CAAC;IAED,MAAM,IAAI,SAAS,CACjB,mDAAmD,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,KAAK,GAAG,CACnF,CAAA;AACH,CAAC","sourcesContent":["import { LexError, LexMap, LexValue } from '@atproto/lex-data'\nimport {\n AtIdentifierString,\n CidString,\n DidString,\n Infer,\n InferMethodInputBody,\n InferMethodOutputBody,\n InferRecordKey,\n LexiconRecordKey,\n Main,\n NsidString,\n Params,\n Procedure,\n Query,\n RecordSchema,\n Restricted,\n UnknownObject,\n getMain,\n} from '@atproto/lex-schema'\nimport { Agent, AgentOptions, buildAgent } from './agent.js'\nimport { XrpcFailure } from './errors.js'\nimport { com } from './lexicons/index.js'\nimport { XrpcResponse, XrpcResponseBody } from './response.js'\nimport { BinaryBodyInit, CallOptions, Service } from './types.js'\nimport { buildAtprotoHeaders } from './util.js'\nimport { XrpcOptions, XrpcRequestParams, xrpc, xrpcSafe } from './xrpc.js'\n\nexport type {\n AtIdentifierString,\n CidString,\n DidString,\n InferMethodInputBody,\n InferMethodOutputBody,\n InferRecordKey,\n LexMap,\n LexValue,\n LexiconRecordKey,\n NsidString,\n Params,\n Procedure,\n Query,\n RecordSchema,\n Restricted,\n}\n\nexport type ClientOptions = {\n labelers?: Iterable<DidString>\n headers?: HeadersInit\n service?: Service\n}\n\nexport type Action<I = any, O = any> = (\n client: Client,\n input: I,\n options: CallOptions,\n) => O | Promise<O>\nexport type InferActionInput<A extends Action> =\n A extends Action<infer I, any> ? I : never\nexport type InferActionOutput<A extends Action> =\n A extends Action<any, infer O> ? O : never\n\nexport type CreateRecordOptions = CallOptions & {\n repo?: AtIdentifierString\n swapCommit?: string\n validate?: boolean\n}\n\nexport type DeleteRecordOptions = CallOptions & {\n repo?: AtIdentifierString\n swapCommit?: string\n swapRecord?: string\n}\n\nexport type GetRecordOptions = CallOptions & {\n repo?: AtIdentifierString\n}\n\nexport type PutRecordOptions = CallOptions & {\n repo?: AtIdentifierString\n swapCommit?: string\n swapRecord?: string\n validate?: boolean\n}\n\nexport type ListRecordsOptions = CallOptions & {\n repo?: AtIdentifierString\n limit?: number\n cursor?: string\n reverse?: boolean\n}\n\nexport type RecordKeyOptions<\n T extends RecordSchema,\n AlsoOptionalWhenRecordKeyIs extends LexiconRecordKey = never,\n> = T['key'] extends `literal:${string}` | AlsoOptionalWhenRecordKeyIs\n ? { rkey?: InferRecordKey<T> }\n : { rkey: InferRecordKey<T> }\n\nexport type CreateOptions<T extends RecordSchema> = CreateRecordOptions &\n RecordKeyOptions<T, 'tid' | 'any'>\nexport type CreateOutput = InferMethodOutputBody<\n typeof com.atproto.repo.createRecord.main,\n Uint8Array\n>\n\nexport type DeleteOptions<T extends RecordSchema> = DeleteRecordOptions &\n RecordKeyOptions<T>\nexport type DeleteOutput = InferMethodOutputBody<\n typeof com.atproto.repo.deleteRecord.main,\n Uint8Array\n>\nexport type GetOptions<T extends RecordSchema> = GetRecordOptions &\n RecordKeyOptions<T>\nexport type GetOutput<T extends RecordSchema> = Omit<\n InferMethodOutputBody<typeof com.atproto.repo.getRecord.main, Uint8Array>,\n 'value'\n> & { value: Infer<T> }\n\nexport type PutOptions<T extends RecordSchema> = PutRecordOptions &\n RecordKeyOptions<T>\nexport type PutOutput = InferMethodOutputBody<\n typeof com.atproto.repo.putRecord.main,\n Uint8Array\n>\n\nexport type ListOptions = ListRecordsOptions\nexport type ListOutput<T extends RecordSchema> = InferMethodOutputBody<\n typeof com.atproto.repo.listRecords.main,\n Uint8Array\n> & {\n records: ListRecord<Infer<T>>[]\n // @NOTE Because the schema uses \"type\": \"unknown\" instead of an open union,\n // we have to use UnknownObject instead of Unknown$TypedObject here.\n invalid: UnknownObject[]\n}\nexport type ListRecord<Value extends LexMap> =\n com.atproto.repo.listRecords.Record & {\n value: Value\n }\n\nexport class Client implements Agent {\n static appLabelers: readonly DidString[] = []\n\n /**\n * Configures the Client (or its sub classes) globally.\n */\n static configure(opts: { appLabelers?: Iterable<DidString> }) {\n if (opts.appLabelers) this.appLabelers = [...opts.appLabelers]\n }\n\n public readonly agent: Agent\n public readonly headers: Headers\n public readonly service?: Service\n public readonly labelers: Set<DidString>\n\n constructor(agent: Agent | AgentOptions, options: ClientOptions = {}) {\n this.agent = buildAgent(agent)\n this.service = options.service\n this.labelers = new Set(options.labelers)\n this.headers = new Headers(options.headers)\n }\n\n get did(): DidString | undefined {\n return this.agent.did\n }\n\n get assertDid(): DidString {\n this.assertAuthenticated()\n return this.did\n }\n\n public assertAuthenticated(): asserts this is { did: DidString } {\n if (!this.did) throw new LexError('AuthenticationRequired')\n }\n\n public setLabelers(labelers: Iterable<DidString> = []) {\n this.clearLabelers()\n this.addLabelers(labelers)\n }\n\n public addLabelers(labelers: Iterable<DidString>) {\n for (const labeler of labelers) this.labelers.add(labeler)\n }\n\n public clearLabelers() {\n this.labelers.clear()\n }\n\n public fetchHandler(path: string, init: RequestInit): Promise<Response> {\n const headers = buildAtprotoHeaders({\n headers: init.headers,\n service: this.service,\n labelers: [\n ...(this.constructor as typeof Client).appLabelers.map(\n (l) => `${l};redact` as const,\n ),\n ...this.labelers,\n ],\n })\n\n // Incoming headers take precedence\n for (const [key, value] of this.headers) {\n if (!headers.has(key)) headers.set(key, value)\n }\n\n // @NOTE The agent here could be another Client instance.\n return this.agent.fetchHandler(path, { ...init, headers })\n }\n\n /**\n * @throws {XrpcFailure<M>} when the request fails or the response is an error\n */\n async xrpc<const M extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<M>\n ? Main<M>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcResponse<M>>\n async xrpc<const M extends Query | Procedure>(\n ns: Main<M>,\n options: XrpcOptions<M>,\n ): Promise<XrpcResponse<M>>\n async xrpc<const M extends Query | Procedure>(\n ns: Main<M>,\n options: XrpcOptions<M> = {} as XrpcOptions<M>,\n ): Promise<XrpcResponse<M>> {\n return xrpc(this, ns, options)\n }\n\n async xrpcSafe<const M extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<M>\n ? Main<M>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcResponse<M> | XrpcFailure<M>>\n async xrpcSafe<const M extends Query | Procedure>(\n ns: Main<M>,\n options: XrpcOptions<M>,\n ): Promise<XrpcResponse<M> | XrpcFailure<M>>\n async xrpcSafe<const M extends Query | Procedure>(\n ns: Main<M>,\n options: XrpcOptions<M> = {} as XrpcOptions<M>,\n ): Promise<XrpcResponse<M> | XrpcFailure<M>> {\n return xrpcSafe(this, ns, options)\n }\n\n /**\n * @param rkey Leave `undefined` to have the server generate a TID.\n */\n public async createRecord(\n record: { $type: NsidString } & LexMap,\n rkey?: string,\n options?: CreateRecordOptions,\n ) {\n return this.xrpc(com.atproto.repo.createRecord.main, {\n ...options,\n body: {\n repo: options?.repo ?? this.assertDid,\n collection: record.$type,\n record,\n rkey,\n validate: options?.validate,\n swapCommit: options?.swapCommit,\n },\n })\n }\n\n async deleteRecord(\n collection: NsidString,\n rkey: string,\n options?: DeleteRecordOptions,\n ) {\n return this.xrpc(com.atproto.repo.deleteRecord.main, {\n ...options,\n body: {\n repo: options?.repo ?? this.assertDid,\n collection,\n rkey,\n swapCommit: options?.swapCommit,\n swapRecord: options?.swapRecord,\n },\n })\n }\n\n public async getRecord(\n collection: NsidString,\n rkey: string,\n options?: GetRecordOptions,\n ) {\n return this.xrpc(com.atproto.repo.getRecord.main, {\n ...options,\n params: {\n repo: options?.repo ?? this.assertDid,\n collection,\n rkey,\n },\n })\n }\n\n async putRecord(\n record: { $type: NsidString } & LexMap,\n rkey: string,\n options?: PutRecordOptions,\n ) {\n return this.xrpc(com.atproto.repo.putRecord.main, {\n ...options,\n body: {\n repo: options?.repo ?? this.assertDid,\n collection: record.$type,\n rkey,\n record,\n validate: options?.validate,\n swapCommit: options?.swapCommit,\n swapRecord: options?.swapRecord,\n },\n })\n }\n\n async listRecords(nsid: NsidString, options?: ListRecordsOptions) {\n return this.xrpc(com.atproto.repo.listRecords.main, {\n ...options,\n params: {\n repo: options?.repo ?? this.assertDid,\n collection: nsid,\n cursor: options?.cursor,\n limit: options?.limit,\n reverse: options?.reverse,\n },\n })\n }\n\n async uploadBlob(\n body: BinaryBodyInit,\n options?: CallOptions & { encoding?: `${string}/${string}` },\n ) {\n return this.xrpc(com.atproto.repo.uploadBlob.main, {\n ...options,\n body,\n })\n }\n\n async getBlob(did: DidString, cid: CidString, options?: CallOptions) {\n return this.xrpc(com.atproto.sync.getBlob.main, {\n ...options,\n params: { did, cid },\n })\n }\n\n public async call<const T extends Query>(\n ns: NonNullable<unknown> extends XrpcRequestParams<T>\n ? Main<T>\n : Restricted<'This query type requires a \"params\" argument'>,\n ): Promise<XrpcResponseBody<T>>\n public async call<const T extends Procedure>(\n ns: undefined extends InferMethodInputBody<T, Uint8Array>\n ? Main<T>\n : Restricted<'This procedure type requires an \"input\" argument'>,\n ): Promise<XrpcResponseBody<T>>\n public async call<const T extends Action>(\n ns: void extends InferActionInput<T>\n ? Main<T>\n : Restricted<'This action type requires an \"input\" argument'>,\n ): Promise<InferActionOutput<T>>\n public async call<const T extends Action | Procedure | Query>(\n ns: Main<T>,\n arg: T extends Action\n ? InferActionInput<T>\n : T extends Procedure\n ? InferMethodInputBody<T, Uint8Array>\n : T extends Query\n ? XrpcRequestParams<T>\n : never,\n options?: CallOptions,\n ): Promise<\n T extends Action\n ? InferActionOutput<T>\n : T extends Procedure\n ? XrpcResponseBody<T>\n : T extends Query\n ? XrpcResponseBody<T>\n : never\n >\n public async call(\n ns: Main<Action> | Main<Procedure> | Main<Query>,\n arg?: LexValue | Params,\n options: CallOptions = {},\n ): Promise<unknown> {\n const method = getMain(ns)\n\n if (typeof method === 'function') {\n return method(this, arg, options)\n }\n\n if (method instanceof Procedure) {\n const result = await this.xrpc(method, { ...options, body: arg as any })\n return result.body\n } else if (method instanceof Query) {\n const result = await this.xrpc(method, { ...options, params: arg as any })\n return result.body\n } else {\n throw new TypeError('Invalid lexicon')\n }\n }\n\n public async create<const T extends RecordSchema>(\n ns: NonNullable<unknown> extends CreateOptions<T>\n ? Main<T>\n : Restricted<'This record type requires an \"options\" argument'>,\n input: Omit<Infer<T>, '$type'>,\n ): Promise<CreateOutput>\n public async create<const T extends RecordSchema>(\n ns: Main<T>,\n input: Omit<Infer<T>, '$type'>,\n options: CreateOptions<T>,\n ): Promise<CreateOutput>\n public async create<const T extends RecordSchema>(\n ns: Main<T>,\n input: Omit<Infer<T>, '$type'>,\n options: CreateOptions<T> = {} as CreateOptions<T>,\n ): Promise<CreateOutput> {\n const schema: T = getMain(ns)\n const record = schema.build(input) as { $type: NsidString } & LexMap\n const rkey = options.rkey ?? getDefaultRecordKey(schema)\n if (rkey !== undefined) schema.keySchema.assert(rkey)\n const response = await this.createRecord(record, rkey, options)\n return response.body\n }\n\n public async delete<const T extends RecordSchema>(\n ns: NonNullable<unknown> extends DeleteOptions<T>\n ? Main<T>\n : Restricted<'This record type requires an \"options\" argument'>,\n ): Promise<DeleteOutput>\n public async delete<const T extends RecordSchema>(\n ns: Main<T>,\n options?: DeleteOptions<T>,\n ): Promise<DeleteOutput>\n public async delete<const T extends RecordSchema>(\n ns: Main<T>,\n options: DeleteOptions<T> = {} as DeleteOptions<T>,\n ): Promise<DeleteOutput> {\n const schema = getMain(ns)\n const rkey = schema.keySchema.parse(\n options.rkey ?? getLiteralRecordKey(schema),\n )\n const response = await this.deleteRecord(schema.$type, rkey, options)\n return response.body\n }\n\n public async get<const T extends RecordSchema>(\n ns: T['key'] extends `literal:${string}`\n ? Main<T>\n : Restricted<'This record type requires an \"options\" argument'>,\n ): Promise<GetOutput<T>>\n public async get<const T extends RecordSchema>(\n ns: Main<T>,\n options?: GetOptions<T>,\n ): Promise<GetOutput<T>>\n public async get<const T extends RecordSchema>(\n ns: Main<T>,\n options: GetOptions<T> = {} as GetOptions<T>,\n ): Promise<GetOutput<T>> {\n const schema = getMain(ns)\n const rkey = schema.keySchema.parse(\n options.rkey ?? getLiteralRecordKey(schema),\n )\n const response = await this.getRecord(schema.$type, rkey, options)\n const value = schema.validate(response.body.value)\n return { ...response.body, value }\n }\n\n public async put<const T extends RecordSchema>(\n ns: NonNullable<unknown> extends PutOptions<T>\n ? Main<T>\n : Restricted<'This record type requires an \"options\" argument'>,\n input: Omit<Infer<T>, '$type'>,\n ): Promise<PutOutput>\n public async put<const T extends RecordSchema>(\n ns: Main<T>,\n input: Omit<Infer<T>, '$type'>,\n options: PutOptions<T>,\n ): Promise<PutOutput>\n public async put<const T extends RecordSchema>(\n ns: Main<T>,\n input: Omit<Infer<T>, '$type'>,\n options: PutOptions<T> = {} as PutOptions<T>,\n ): Promise<PutOutput> {\n const schema: T = getMain(ns)\n const record = schema.build(input) as { $type: NsidString } & LexMap\n const rkey = options.rkey ?? getLiteralRecordKey(schema)\n const response = await this.putRecord(record, rkey, options)\n return response.body\n }\n\n async list<const T extends RecordSchema>(\n ns: Main<T>,\n options?: ListOptions,\n ): Promise<ListOutput<T>> {\n const schema = getMain(ns)\n const { body } = await this.listRecords(schema.$type, options)\n\n const records: ListRecord<Infer<T>>[] = []\n const invalid: LexMap[] = []\n\n for (const record of body.records) {\n const parsed = schema.safeValidate(record.value)\n if (parsed.success) {\n records.push({ ...record, value: parsed.value })\n } else {\n invalid.push(record.value)\n }\n }\n\n return { ...body, records, invalid }\n }\n}\n\nfunction getDefaultRecordKey<const T extends RecordSchema>(\n schema: T,\n): undefined | InferRecordKey<T> {\n // Let the server generate the TID\n if (schema.key === 'tid') return undefined\n if (schema.key === 'any') return undefined\n\n return getLiteralRecordKey(schema)\n}\n\nfunction getLiteralRecordKey<const T extends RecordSchema>(\n schema: T,\n): InferRecordKey<T> {\n if (schema.key.startsWith('literal:')) {\n return schema.key.slice(8)\n }\n\n throw new TypeError(\n `An \"rkey\" must be provided for record key type \"${schema.key}\" (${schema.$type})`,\n )\n}\n"]}
package/dist/errors.d.ts CHANGED
@@ -1,13 +1,11 @@
1
1
  import { LexError, LexErrorCode, LexErrorData } from '@atproto/lex-data';
2
- import { l } from '@atproto/lex-schema';
2
+ import { InferMethodError, Procedure, Query, ResultFailure } from '@atproto/lex-schema';
3
3
  import { XrpcPayload } from './util.js';
4
+ import { WWWAuthenticate } from './www-authenticate.js';
5
+ export declare const RETRYABLE_HTTP_STATUS_CODES: ReadonlySet<number>;
4
6
  export { LexError };
5
7
  export type { LexErrorCode, LexErrorData };
6
8
  export type XrpcErrorPayload<N extends LexErrorCode = LexErrorCode> = XrpcPayload<LexErrorData<N>, 'application/json'>;
7
- export declare class XrpcError<N extends LexErrorCode = LexErrorCode> extends LexError<N> {
8
- name: string;
9
- constructor(error: N, message?: string, options?: ErrorOptions);
10
- }
11
9
  /**
12
10
  * All unsuccessful responses should follow a standard error response
13
11
  * schema. The Content-Type should be application/json, and the payload
@@ -21,63 +19,66 @@ export declare class XrpcError<N extends LexErrorCode = LexErrorCode> extends Le
21
19
  * This function checks whether a given payload matches this schema.
22
20
  */
23
21
  export declare function isXrpcErrorPayload(payload: XrpcPayload | null): payload is XrpcErrorPayload;
22
+ export declare abstract class XrpcError<M extends Procedure | Query = Procedure | Query, N extends LexErrorCode = LexErrorCode, TReason = unknown> extends LexError<N> implements ResultFailure<TReason> {
23
+ readonly method: M;
24
+ name: string;
25
+ constructor(method: M, error: N, message?: string, options?: ErrorOptions);
26
+ /**
27
+ * @see {@link ResultFailure.success}
28
+ */
29
+ readonly success: false;
30
+ /**
31
+ * @see {@link ResultFailure.reason}
32
+ */
33
+ abstract readonly reason: TReason;
34
+ /**
35
+ * Indicates whether the error is transient and can be retried.
36
+ */
37
+ abstract shouldRetry(): boolean;
38
+ matchesSchema(): this is XrpcError<M, InferMethodError<M>>;
39
+ }
24
40
  /**
25
- * Interface representing a failed XRPC request result.
26
- */
27
- type LexRpcFailureResult<N extends LexErrorCode, E> = l.ResultFailure<E> & {
28
- readonly error: N;
29
- shouldRetry(): boolean;
30
- matchesSchema(): boolean;
31
- };
32
- /**
33
- * Class used to represent an HTTP request that resulted in an XRPC method error
34
- * That is, a non-2xx response with a valid XRPC error payload.
41
+ * Class used to represent an HTTP request that resulted in an XRPC method
42
+ * error. That is, a non-2xx response with a valid XRPC error payload.
35
43
  */
36
- export declare class XrpcResponseError<M extends l.Procedure | l.Query = l.Procedure | l.Query, N extends LexErrorCode = LexErrorCode> extends XrpcError<N> implements LexRpcFailureResult<N, XrpcResponseError<M, N>> {
37
- readonly method: M;
38
- readonly status: number;
39
- readonly headers: Headers;
44
+ export declare class XrpcResponseError<M extends Procedure | Query = Procedure | Query, N extends LexErrorCode = InferMethodError<M> | LexErrorCode> extends XrpcError<M, N, XrpcResponseError<M, N>> {
45
+ readonly response: Response;
40
46
  readonly payload: XrpcErrorPayload<N>;
41
47
  name: string;
42
- constructor(method: M, status: number, headers: Headers, payload: XrpcErrorPayload<N>, options?: ErrorOptions);
43
- readonly success = false;
48
+ constructor(method: M, response: Response, payload: XrpcErrorPayload<N>, options?: ErrorOptions);
44
49
  get reason(): this;
45
- get body(): LexErrorData;
46
- matchesSchema(): this is M extends {
47
- errors: readonly (infer E extends string)[];
48
- } ? XrpcResponseError<M, E> : never;
49
50
  shouldRetry(): boolean;
50
51
  toJSON(): LexErrorData<N>;
51
52
  toResponse(): Response;
53
+ get body(): LexErrorData;
54
+ }
55
+ export type { WWWAuthenticate };
56
+ export declare class XrpcAuthenticationError<M extends Procedure | Query = Procedure | Query, N extends LexErrorCode = LexErrorCode> extends XrpcResponseError<M, N> {
57
+ #private;
58
+ name: string;
59
+ shouldRetry(): boolean;
60
+ get wwwAuthenticate(): WWWAuthenticate;
52
61
  }
53
62
  /**
54
- * This class represents an invalid XRPC response from the server.
63
+ * This class represents invalid or unprocessable XRPC response from the
64
+ * upstream server.
55
65
  */
56
- export declare class XrpcUpstreamError<N extends 'InvalidResponse' | 'UpstreamFailure' = 'InvalidResponse' | 'UpstreamFailure'> extends XrpcError<N> implements LexRpcFailureResult<N, XrpcUpstreamError<N>> {
57
- name: "XrpcUpstreamError";
58
- readonly response: {
59
- status: number;
60
- headers: Headers;
61
- payload: XrpcPayload | null;
62
- };
63
- constructor(error: N, message: string, response: {
64
- status: number;
65
- headers: Headers;
66
- }, payload: XrpcPayload | null, options?: ErrorOptions);
67
- readonly success: false;
66
+ export declare class XrpcUpstreamError<M extends Procedure | Query = Procedure | Query> extends XrpcError<M, 'UpstreamFailure', XrpcUpstreamError<M>> {
67
+ readonly response: Response;
68
+ readonly payload: XrpcPayload | null;
69
+ name: string;
70
+ constructor(method: M, response: Response, payload: XrpcPayload | null, message?: string, options?: ErrorOptions);
68
71
  get reason(): this;
69
- matchesSchema(): false;
70
72
  shouldRetry(): boolean;
71
73
  toResponse(): Response;
72
74
  }
73
- export declare class XrpcUnexpectedError extends XrpcError<'InternalServerError'> implements LexRpcFailureResult<'InternalServerError', unknown> {
74
- name: "XrpcUnexpectedError";
75
- protected constructor(message: string, options: Required<ErrorOptions>);
76
- readonly success = false;
77
- get reason(): unknown;
78
- matchesSchema(): false;
79
- shouldRetry(): boolean;
75
+ export declare class XrpcInternalError<M extends Procedure | Query = Procedure | Query> extends XrpcError<M, 'InternalServerError', XrpcInternalError<M>> {
76
+ name: string;
77
+ constructor(method: M, message?: string, options?: ErrorOptions);
78
+ get reason(): this;
79
+ shouldRetry(): true;
80
80
  toResponse(): Response;
81
- static from(cause: unknown, message?: string): XrpcUnexpectedError;
82
81
  }
82
+ export type XrpcFailure<M extends Procedure | Query = Procedure | Query> = XrpcResponseError<M> | XrpcUpstreamError<M> | XrpcInternalError<M>;
83
+ export declare function asXrpcFailure<M extends Procedure | Query>(method: M, cause: unknown): XrpcFailure<M>;
83
84
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,CAAA;AACnB,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AAE1C,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAChE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAA;AAElD,qBAAa,SAAS,CACpB,CAAC,SAAS,YAAY,GAAG,YAAY,CACrC,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACnB,IAAI,SAAc;gBAGhB,KAAK,EAAE,CAAC,EACR,OAAO,GAAE,MAAqC,EAC9C,OAAO,CAAC,EAAE,YAAY;CAIzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,GAAG,IAAI,GAC1B,OAAO,IAAI,gBAAgB,CAM7B;AAED;;GAEG;AACH,KAAK,mBAAmB,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG;IACzE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;IACjB,WAAW,IAAI,OAAO,CAAA;IACtB,aAAa,IAAI,OAAO,CAAA;CACzB,CAAA;AAED;;;GAGG;AACH,qBAAa,iBAAiB,CAC1B,CAAC,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,K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