@atproto/lex-client 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/client.d.ts +33 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +8 -16
- package/dist/client.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @atproto/lex-client
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#5885](https://github.com/bluesky-social/atproto/pull/5885) [`6ee0f4d`](https://github.com/bluesky-social/atproto/commit/6ee0f4d7971dcc71efaab785aff4d4ef341a1c32) Thanks [@matthieusieben](https://github.com/matthieusieben)! - **Breaking:** `RETRYABLE_HTTP_STATUS_CODES` is now a frozen, literal-typed array instead of a `ReadonlySet<number>`. Replace `RETRYABLE_HTTP_STATUS_CODES.has(status)` with the new `isRetryableHttpStatus(status)` type guard (narrowing to the new `RetryableHttpStatus` type).
|
|
8
|
+
|
|
9
|
+
Also add `RETRYABLE_ERROR_CODES` and its `isRetryableErrorCode()` type guard (the XRPC error codes matching a retryable HTTP status, for classifying an error by code alone), and `getStatusErrorCode()`, mapping an HTTP status to the XRPC error code used for non-XRPC error responses.
|
|
10
|
+
|
|
11
|
+
- [#5948](https://github.com/bluesky-social/atproto/pull/5948) [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - **Breaking:** an `atproto-proxy` header passed in a request's `headers` no longer sets that request's `service`. The client's `service` now always applies, replacing that header, or removing it when the client has none. Pass `service` in the request options instead.
|
|
12
|
+
|
|
13
|
+
- [#5948](https://github.com/bluesky-social/atproto/pull/5948) [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - **Breaking:** `validateRequest: false` now also skips validating an XRPC request's params and applying their defaults, which are then sent as given. Since `Client` defaults `validateRequest` to `false`, its requests no longer validate params unless `validateRequest` is set.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#5950](https://github.com/bluesky-social/atproto/pull/5950) [`b9b1ca7`](https://github.com/bluesky-social/atproto/commit/b9b1ca7f176b93d12e39685799c5f2e1f9a63be7) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Update `vitest` to v5, `vite` to v8.3.8 and `rolldown` to v1.3.3 (dev dependencies)
|
|
18
|
+
|
|
19
|
+
- [#5948](https://github.com/bluesky-social/atproto/pull/5948) [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Infer the type parameters of generic actions from their input in `client.call()`.
|
|
20
|
+
|
|
21
|
+
- [#5948](https://github.com/bluesky-social/atproto/pull/5948) [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - `Client#assertAuthenticated()` narrows `client.agent` to an `AccountAgent`.
|
|
22
|
+
|
|
23
|
+
- [#5948](https://github.com/bluesky-social/atproto/pull/5948) [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Include the validation `error` in the invalid records yielded by `Client.list()` and `Client.listAll()`
|
|
24
|
+
|
|
25
|
+
- [#5948](https://github.com/bluesky-social/atproto/pull/5948) [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow `client.call()` to be called without input for actions whose input is optional.
|
|
26
|
+
|
|
27
|
+
- [#5948](https://github.com/bluesky-social/atproto/pull/5948) [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow the per-request `headers` option to be a (sync or async) function, called for every attempt (retries included). The client-wide `headers` (`ClientOptions`) still only accept a `HeadersInit`.
|
|
28
|
+
|
|
29
|
+
**Breaking**: `buildXrpcRequestHeaders()` is now async (returns a `Promise<Headers>`), and code reading the `headers` of `XrpcRequestHeadersOptions` (thus of `XrpcOptions`) must handle a function.
|
|
30
|
+
- Updated dependencies [[`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd), [`b9b1ca7`](https://github.com/bluesky-social/atproto/commit/b9b1ca7f176b93d12e39685799c5f2e1f9a63be7), [`6ee0f4d`](https://github.com/bluesky-social/atproto/commit/6ee0f4d7971dcc71efaab785aff4d4ef341a1c32), [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd), [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd), [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd), [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd), [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd), [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd), [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd), [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd), [`6ee0f4d`](https://github.com/bluesky-social/atproto/commit/6ee0f4d7971dcc71efaab785aff4d4ef341a1c32), [`ce37237`](https://github.com/bluesky-social/atproto/commit/ce37237663b7ea87e8cc04cb995377d0ee5d2efd)]:
|
|
31
|
+
- @atproto/lex-rpc@0.2.0
|
|
32
|
+
- @atproto/lex-data@0.1.11
|
|
33
|
+
- @atproto/lex-schema@0.3.0
|
|
34
|
+
|
|
3
35
|
## 0.5.0
|
|
4
36
|
|
|
5
37
|
### Minor Changes
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LexMap, TypedLexMap } from '@atproto/lex-data';
|
|
2
|
-
import { type Agent, type AgentOptions, type BinaryBodyInit, type IfXrpcStreamable, type RecordKeyOptions, type Service, type XrpcCancellationErrorHandler, type XrpcFailure, type XrpcOptions, type
|
|
3
|
-
import { type AtIdentifierString, type AtUriString, type CidString, type DidString, type Infer, type InferMethodInputBody, type InferMethodOutputBody, type Main, type NsidString, Procedure, Query, type RecordSchema, type Restricted } from '@atproto/lex-schema';
|
|
2
|
+
import { type AccountAgent, type Agent, type AgentOptions, type BinaryBodyInit, type IfXrpcStreamable, type RecordKeyOptions, type Service, type XrpcCancellationErrorHandler, type XrpcFailure, type XrpcOptions, type XrpcRequestParams, type XrpcResponse, type XrpcResponseBody, type XrpcStreamResponse, type XrpcStreamResult } from '@atproto/lex-rpc';
|
|
3
|
+
import { type AtIdentifierString, type AtUriString, type CidString, type DidString, type Infer, type InferMethodInputBody, type InferMethodOutputBody, type LexValidationError, type Main, type NsidString, Procedure, Query, type RecordSchema, type Restricted } from '@atproto/lex-schema';
|
|
4
4
|
import applyWrites from './lexicons/com/atproto/repo/applyWrites.js';
|
|
5
5
|
import createRecord from './lexicons/com/atproto/repo/createRecord.js';
|
|
6
6
|
import deleteRecord from './lexicons/com/atproto/repo/deleteRecord.js';
|
|
@@ -37,7 +37,28 @@ import { type WriteOperationsFactory } from './write-operation-builder.js';
|
|
|
37
37
|
* }
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
export type ClientOptions =
|
|
40
|
+
export type ClientOptions = {
|
|
41
|
+
/** @see {@link XrpcRequestHeadersOptions.headers} */
|
|
42
|
+
headers?: HeadersInit;
|
|
43
|
+
/** @see {@link XrpcRequestProcessingOptions.validateRequest} */
|
|
44
|
+
validateRequest?: boolean;
|
|
45
|
+
/** @see {@link XrpcResponseOptions.validateResponse} */
|
|
46
|
+
validateResponse?: boolean;
|
|
47
|
+
/** @see {@link XrpcResponseOptions.strictResponseProcessing} */
|
|
48
|
+
strictResponseProcessing?: boolean;
|
|
49
|
+
/** @see {@link XrpcResponseOptions.onCancellationError} */
|
|
50
|
+
onCancellationError?: XrpcCancellationErrorHandler;
|
|
51
|
+
/** @see {@link XrpcRequestHeadersOptions.labelers} */
|
|
52
|
+
labelers?: null | Iterable<DidString>;
|
|
53
|
+
/** @see {@link XrpcRequestHeadersOptions.appLabelers} */
|
|
54
|
+
appLabelers?: null | Iterable<DidString>;
|
|
55
|
+
/** @see {@link XrpcRequestHeadersOptions.service} */
|
|
56
|
+
service?: null | Service;
|
|
57
|
+
};
|
|
58
|
+
declare const subtypePassGuard: unique symbol;
|
|
59
|
+
type SubtypePassGuard = {
|
|
60
|
+
readonly [subtypePassGuard]?: never;
|
|
61
|
+
};
|
|
41
62
|
export type ActionOptions = {
|
|
42
63
|
/** AbortSignal to cancel the request. */
|
|
43
64
|
signal?: AbortSignal;
|
|
@@ -235,11 +256,13 @@ export type ListRecordItem<Value extends LexMap> = {
|
|
|
235
256
|
cid: CidString;
|
|
236
257
|
valid: true;
|
|
237
258
|
value: Value;
|
|
259
|
+
error?: never;
|
|
238
260
|
} | {
|
|
239
261
|
uri: AtUriString;
|
|
240
262
|
cid: CidString;
|
|
241
263
|
valid: false;
|
|
242
264
|
value: LexMap;
|
|
265
|
+
error: LexValidationError;
|
|
243
266
|
};
|
|
244
267
|
/**
|
|
245
268
|
* The Client class is the primary interface for interacting with AT Protocol
|
|
@@ -307,6 +330,7 @@ export declare class Client {
|
|
|
307
330
|
*/
|
|
308
331
|
assertAuthenticated(): asserts this is {
|
|
309
332
|
did: DidString;
|
|
333
|
+
agent: AccountAgent;
|
|
310
334
|
};
|
|
311
335
|
/**
|
|
312
336
|
* Replaces all labelers with the given set.
|
|
@@ -618,8 +642,11 @@ export declare class Client {
|
|
|
618
642
|
*/
|
|
619
643
|
call<const T extends Query>(ns: NonNullable<unknown> extends XrpcRequestParams<T> ? Main<T> : Restricted<'This query type requires a "params" argument'>): Promise<XrpcResponseBody<T>>;
|
|
620
644
|
call<const T extends Procedure>(ns: undefined extends InferMethodInputBody<T, Uint8Array> ? Main<T> : Restricted<'This procedure type requires an "input" argument'>): Promise<XrpcResponseBody<T>>;
|
|
621
|
-
call<const T extends Action>(ns:
|
|
622
|
-
call<
|
|
645
|
+
call<const T extends Action>(ns: undefined extends InferActionInput<T> ? Main<T> : Restricted<'This action type requires an "input" argument'>): Promise<InferActionOutput<T>>;
|
|
646
|
+
call<I, O>(ns: (client: Client, input: I, options: ActionOptions) => O | Promise<O>, arg: I & {
|
|
647
|
+
[K in keyof I]: I[K];
|
|
648
|
+
}, options?: ActionOptions): Promise<O>;
|
|
649
|
+
call<const T extends Action | Procedure | Query>(ns: Main<T> & SubtypePassGuard, arg: T extends Action ? InferActionInput<T> : T extends Procedure ? InferMethodInputBody<T, Uint8Array> : T extends Query ? XrpcRequestParams<T> : never, options?: T extends Action ? ActionOptions : T extends Procedure ? Omit<XrpcOptions<T>, 'body'> : T extends Query ? Omit<XrpcOptions<T>, 'params'> : never): Promise<T extends Action ? InferActionOutput<T> : T extends Procedure ? XrpcResponseBody<T> : T extends Query ? XrpcResponseBody<T> : never>;
|
|
623
650
|
/**
|
|
624
651
|
* Creates a new record with full type safety based on the schema.
|
|
625
652
|
*
|
|
@@ -740,4 +767,5 @@ export declare class Client {
|
|
|
740
767
|
*/
|
|
741
768
|
listAll<const T extends RecordSchema>(ns: Main<T>, { maxRetries, ...options }?: ListOptions): AsyncGenerator<ListRecordItem<Infer<T>>, void, unknown>;
|
|
742
769
|
}
|
|
770
|
+
export {};
|
|
743
771
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAY,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,EACL,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,4BAA4B,EACjC,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACjC,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAYtB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,IAAI,EACT,KAAK,UAAU,EAEf,SAAS,EACT,KAAK,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,qBAAqB,CAAA;AAI5B,OAAO,WAAW,MAAM,4CAA4C,CAAA;AACpE,OAAO,YAAY,MAAM,6CAA6C,CAAA;AACtE,OAAO,YAAY,MAAM,6CAA6C,CAAA;AACtE,OAAO,SAAS,MAAM,0CAA0C,CAAA;AAChE,OAAO,WAEN,MAAM,4CAA4C,CAAA;AACnD,OAAO,SAAS,MAAM,0CAA0C,CAAA;AAChE,OAAO,UAAU,MAAM,2CAA2C,CAAA;AAClE,OAAO,OAAO,MAAM,wCAAwC,CAAA;AAC5D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,8BAA8B,CAAA;AAErC;;;;;;;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AAC,EACX,EAAE,UAAc,EAAE,GAAG,OAAO,EAAE,GAAE,WAAgB,GAC/C,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAyBzD;CACF"}
|
package/dist/client.js
CHANGED
|
@@ -140,21 +140,13 @@ export class Client {
|
|
|
140
140
|
if (combined.appLabelers === undefined) {
|
|
141
141
|
combined.appLabelers = this.constructor.appLabelers;
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// Merge the instance-wide headers with the request-specific headers.
|
|
153
|
-
// Request-specific headers take precedence. This cannot be done in the
|
|
154
|
-
// applyDefaults step above because headers require special merging logic.
|
|
155
|
-
combined.headers = optionsHeaders
|
|
156
|
-
? mergeHeaders(this.headers, optionsHeaders)
|
|
157
|
-
: new Headers(this.headers);
|
|
143
|
+
// @NOTE Needs custom merging logic for headers as applyDefaults only deals
|
|
144
|
+
// with plain objects.
|
|
145
|
+
const { headers } = options;
|
|
146
|
+
combined.headers =
|
|
147
|
+
typeof headers === 'function'
|
|
148
|
+
? async () => mergeHeaders(this.headers, await headers())
|
|
149
|
+
: mergeHeaders(this.headers, headers);
|
|
158
150
|
// @NOTE Since the combined options here always contain a defined
|
|
159
151
|
// "service" (even if null), any "atproto-proxy" header in either the
|
|
160
152
|
// instance-wide or request-specific headers will be overridden by the
|
|
@@ -529,7 +521,7 @@ function processListRecord(record) {
|
|
|
529
521
|
return { ...record, valid: true, value: result.value };
|
|
530
522
|
}
|
|
531
523
|
else {
|
|
532
|
-
return { ...record, valid: false };
|
|
524
|
+
return { ...record, valid: false, error: result.reason };
|
|
533
525
|
}
|
|
534
526
|
}
|
|
535
527
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{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,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;gBAClD,OAAM;YACR,CAAC;YAED,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC9B,CAAC,QAAQ,OAAO,CAAC,MAAM,EAAC;IAC1B,CAAC;CACF;AAED,SAAS,iBAAiB,CAExB,MAAyB;IAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAA;IACxD,CAAC;SAAM,CAAC;QACN,OAAO,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACpC,CAAC;AACH,CAAC","sourcesContent":["import type { LexMap, LexValue, TypedLexMap } from '@atproto/lex-data'\nimport {\n type Agent,\n type AgentOptions,\n type BinaryBodyInit,\n type IfXrpcStreamable,\n type RecordKeyOptions,\n type Service,\n type XrpcCancellationErrorHandler,\n type XrpcFailure,\n type XrpcOptions,\n type XrpcRequestHeadersOptions,\n type XrpcRequestParams,\n type XrpcRequestProcessingOptions,\n type XrpcResponse,\n type XrpcResponseBody,\n type XrpcResponseOptions,\n type XrpcStreamResponse,\n type XrpcStreamResult,\n applyDefaults,\n buildAgent,\n isService,\n mergeHeaders,\n rkeyFor,\n rkeyForCreate,\n throwIfAborted,\n xrpc,\n xrpcSafe,\n xrpcStream,\n xrpcStreamSafe,\n} from '@atproto/lex-rpc'\nimport {\n type AtIdentifierString,\n type AtUriString,\n type CidString,\n type DidString,\n type Infer,\n type InferMethodInputBody,\n type InferMethodOutputBody,\n type Main,\n type NsidString,\n type Params,\n Procedure,\n Query,\n type RecordSchema,\n type Restricted,\n getMain,\n} from '@atproto/lex-schema'\n// @NOTE We could use import { com } from \"./lexicons/index.js\" here, but some\n// consumers might not know how to properly tree-shake that, so we import only\n// the needed lexicon schemas directly.\nimport applyWrites from './lexicons/com/atproto/repo/applyWrites.js'\nimport createRecord from './lexicons/com/atproto/repo/createRecord.js'\nimport deleteRecord from './lexicons/com/atproto/repo/deleteRecord.js'\nimport getRecord from './lexicons/com/atproto/repo/getRecord.js'\nimport listRecords, {\n type Record as ListRecordsRecord,\n} from './lexicons/com/atproto/repo/listRecords.js'\nimport putRecord from './lexicons/com/atproto/repo/putRecord.js'\nimport uploadBlob from './lexicons/com/atproto/repo/uploadBlob.js'\nimport getBlob from './lexicons/com/atproto/sync/getBlob.js'\nimport {\n WriteOperationHelper,\n type WriteOperationsFactory,\n} from './write-operation-builder.js'\n\n/**\n * Configuration options for creating a {@link Client}.\n *\n * @property {@link ClientOptions.labelers} - An iterable of labeler DIDs to include in requests. These will be combined with any global app labelers configured via {@link Client.configure}.\n * @property {@link ClientOptions.service} - An optional service identifier (DID or URL) for routing requests with service proxying.\n * @property {@link ClientOptions.headers} - Custom headers to include in all requests made by this client instance.\n * @property {@link ClientOptions.validateRequest} - If true, validates request bodies against their lexicon schemas before sending. Defaults to false for performance.\n * @property {@link ClientOptions.validateResponse} - If false, skips validation of response bodies against their lexicon schemas. Defaults to true to catch errors, but can be disabled for performance if you trust the server responses. Note that defaults will not be applied if validation is disabled, which can cause typing inconsistencies, so use with caution.\n * @property {@link ClientOptions.strictResponseProcessing} - If false, relaxes certain validation rules during response processing (e.g., allowing floats, deeper nesting, etc.). Defaults to true for strict compliance with {@link https://atproto.com/specs/data-model lexicon data model}, but can be disabled to handle non-compliant responses.\n * @property {@link ClientOptions.onCancellationError} - How discarded response bodies get cancelled. Defaults to `\"propagate\"` (awaited, failures thrown). Fetch handlers that may return responses with pending clones must use `\"log\"` (not awaited, failures logged) or a function, to avoid dead locks.\n *\n * @see {@link XrpcRequestHeadersOptions}\n * @see {@link XrpcRequestProcessingOptions}\n * @see {@link XrpcResponseOptions}\n *\n * @example\n * ```typescript\n * const options: ClientOptions = {\n * labelers: ['did:plc:labeler1'],\n * service: 'did:web:api.bsky.app#bsky_appview',\n * headers: { 'X-Custom-Header': 'value' },\n * validateRequest: false,\n * validateResponse: true,\n * strictResponseProcessing: false,\n * }\n * ```\n */\nexport type ClientOptions = XrpcRequestHeadersOptions &\n Pick<XrpcRequestProcessingOptions, 'validateRequest'> &\n XrpcResponseOptions\n\nexport type ActionOptions = {\n /** AbortSignal to cancel the request. */\n signal?: AbortSignal\n}\n\n/**\n * A composable action that can be invoked via {@link Client.call}.\n *\n * Actions provide a way to define custom operations that integrate with the\n * Client's call interface, enabling type-safe, reusable business logic.\n *\n * @typeParam I - The input type for the action\n * @typeParam O - The output type for the action\n *\n * @example\n * ```typescript\n * const myAction: Action<{ userId: string }, { profile: Profile }> = async (client, input, options) => {\n * const response = await client.xrpc(someMethod, { params: { actor: input.userId }, ...options })\n * return { profile: response.body }\n * }\n * ```\n */\nexport type Action<I = any, O = any> = (\n client: Client,\n input: I,\n options: ActionOptions,\n) => O | Promise<O>\n\n/**\n * Extracts the input type from an {@link Action}.\n * @typeParam A - The Action type to extract from\n */\nexport type InferActionInput<A extends Action> =\n A extends Action<infer I, any> ? I : never\n\n/**\n * Extracts the output type from an {@link Action}.\n * @typeParam A - The Action type to extract from\n */\nexport type InferActionOutput<A extends Action> =\n A extends Action<any, infer O> ? O : never\n\n/**\n * Options for creating a record in an AT Protocol repository.\n *\n * @see {@link Client.createRecord}\n */\nexport type CreateRecordOptions = Omit<\n XrpcOptions<typeof createRecord>,\n 'body'\n> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /** Compare-and-swap on the repo commit. If specified, must match current commit. */\n swapCommit?: string\n /**\n * Whether the PDS should validate the record against its lexicon schema.\n * When `true`, the PDS is asked to explicitly validate the record. When\n * `false`, the PDS is asked to explicitly skip validation. When `undefined`\n * (default), the PDS decides -- typically validating only collections whose\n * schemas it knows. This is server-side validation; for client-side\n * validation before sending, use {@link XrpcRequestProcessingOptions.validateRequest}.\n */\n validate?: boolean\n}\n\n/**\n * Options for deleting a record from an AT Protocol repository.\n *\n * @see {@link Client.deleteRecord}\n */\nexport type DeleteRecordOptions = Omit<\n XrpcOptions<typeof deleteRecord>,\n 'body'\n> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /** Compare-and-swap on the repo commit. If specified, must match current commit. */\n swapCommit?: string\n /** Compare-and-swap on the record CID. If specified, must match current record. */\n swapRecord?: string\n}\n\n/**\n * Options for retrieving a record from an AT Protocol repository.\n *\n * @see {@link Client.getRecord}\n */\nexport type GetRecordOptions = Omit<XrpcOptions<typeof getRecord>, 'params'> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n}\n\n/**\n * Options for creating or updating a record in an AT Protocol repository.\n *\n * @see {@link Client.putRecord}\n */\nexport type PutRecordOptions = Omit<XrpcOptions<typeof putRecord>, 'body'> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /** Compare-and-swap on the repo commit. If specified, must match current commit. */\n swapCommit?: string\n /** Compare-and-swap on the record CID. If specified, must match current record. */\n swapRecord?: string\n /**\n * Whether the PDS should validate the record against its lexicon schema.\n * When `true`, the PDS is asked to explicitly validate the record. When\n * `false`, the PDS is asked to explicitly skip validation. When `undefined`\n * (default), the PDS decides — typically validating only collections whose\n * schemas it knows. This is server-side validation; for client-side\n * validation before sending, use {@link XrpcRequestProcessingOptions.validateRequest}.\n */\n validate?: boolean\n}\n\n/**\n * Options for listing records in an AT Protocol repository collection.\n *\n * @see {@link Client.listRecords}\n */\nexport type ListRecordsOptions = Omit<\n XrpcOptions<typeof listRecords>,\n 'params'\n> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /** Maximum number of records to return. */\n limit?: number\n /** Pagination cursor from a previous response. */\n cursor?: string\n /** If true, returns records in reverse chronological order. */\n reverse?: boolean\n}\n\n/**\n * Options for applying a batch of writes (create/update/delete) to an AT Protocol repository.\n *\n * @see {@link Client.applyWrites}\n */\nexport type ApplyWritesOptions = Omit<\n XrpcOptions<typeof applyWrites>,\n 'body'\n> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /**\n * Whether the PDS should validate the records against their lexicon schemas.\n * When `true`, the PDS is asked to explicitly validate every record. When\n * `false`, the PDS is asked to explicitly skip validation. When `undefined`\n * (default), the PDS decides — typically validating only collections whose\n * schemas it knows.\n */\n validate?: boolean\n /** Compare-and-swap on the repo commit. If specified, must match current commit. */\n swapCommit?: CidString\n}\n\nexport type UploadBlobOptions = Omit<XrpcOptions<typeof uploadBlob>, 'body'>\n\nexport type GetBlobOptions = Omit<XrpcOptions<typeof getBlob>, 'params'>\n\n/**\n * Type-safe options for {@link Client.create}, combining record options with key requirements.\n * @typeParam T - The record schema type\n * @see {@link CreateRecordOptions}\n */\nexport type CreateOptions<T extends RecordSchema> = CreateRecordOptions &\n RecordKeyOptions<T, 'tid' | 'any'>\n\n/**\n * Output type for record creation operations.\n * Contains the URI and CID of the newly created record.\n */\nexport type CreateOutput = InferMethodOutputBody<\n typeof createRecord,\n Uint8Array\n>\n\n/**\n * Type-safe options for {@link Client.delete}, combining delete options with key requirements.\n * @typeParam T - The record schema type\n */\nexport type DeleteOptions<T extends RecordSchema> = DeleteRecordOptions &\n RecordKeyOptions<T>\n\n/**\n * Output type for record deletion operations.\n */\nexport type DeleteOutput = InferMethodOutputBody<\n typeof deleteRecord,\n Uint8Array\n>\n\n/**\n * Type-safe options for {@link Client.get}, combining get options with key requirements.\n * @typeParam T - The record schema type\n */\nexport type GetOptions<T extends RecordSchema> = GetRecordOptions &\n RecordKeyOptions<T>\n\n/**\n * Output type for record retrieval operations.\n * Contains the record value validated against the schema type.\n * @typeParam T - The record schema type\n */\nexport type GetOutput<T extends RecordSchema> = Omit<\n InferMethodOutputBody<typeof getRecord, Uint8Array>,\n 'value'\n> & { value: Infer<T> }\n\n/**\n * Type-safe options for {@link Client.put}, combining put options with key requirements.\n * @typeParam T - The record schema type\n */\nexport type PutOptions<T extends RecordSchema> = PutRecordOptions &\n RecordKeyOptions<T>\n\n/**\n * Output type for record put (create/update) operations.\n * Contains the URI and CID of the record.\n */\nexport type PutOutput = InferMethodOutputBody<typeof putRecord, Uint8Array>\n\n/**\n * Options for {@link Client.list} operations.\n */\nexport type ListOptions = ListRecordsOptions\n\n/**\n * Output type for record listing operations.\n * Contains validated records and any invalid records that failed schema validation.\n * @typeParam T - The record schema type\n */\nexport type ListOutput<T extends RecordSchema> = Omit<\n InferMethodOutputBody<typeof listRecords>,\n 'records'\n> & {\n /** Records that successfully validated against the schema. */\n records: ListRecordItem<Infer<T>>[]\n}\n\n/**\n * A discriminated union type representing the result of a record listing\n * operation.\n */\nexport type ListRecordItem<Value extends LexMap> =\n | { uri: AtUriString; cid: CidString; valid: true; value: Value }\n | { uri: AtUriString; cid: CidString; valid: false; value: LexMap }\n\n/**\n * The Client class is the primary interface for interacting with AT Protocol\n * services. It provides type-safe methods for XRPC calls, record operations,\n * and blob handling.\n *\n * @example\n * ```typescript\n * import { Client } from '@atproto/lex'\n * import { app } from '#/lexicons\n *\n * const client = new Client(oauthSession)\n *\n * const response = await client.xrpc(app.bsky.feed.getTimeline, {\n * params: { limit: 50 }\n * })\n * ```\n */\nexport class Client {\n static appLabelers: readonly DidString[] = []\n\n /**\n * Configures the Client (or its sub classes) globally.\n */\n static configure(opts: { appLabelers?: Iterable<DidString> }): void {\n if (opts.appLabelers) this.appLabelers = [...opts.appLabelers]\n }\n\n /** The underlying agent used for making requests. */\n public readonly agent: Agent\n\n /** Default header values to include in all requests made by this client instance. */\n public readonly headers: Headers\n\n /** Default {@link XrpcOptions} for this client instance. */\n public readonly xrpcDefaults: Readonly<{\n service: Service | null\n labelers: Set<DidString>\n appLabelers?: null | Iterable<DidString>\n validateRequest: boolean\n validateResponse: boolean\n strictResponseProcessing: boolean\n onCancellationError: XrpcCancellationErrorHandler\n }>\n\n constructor(agent: Agent | AgentOptions, options: ClientOptions = {}) {\n this.agent = buildAgent(agent)\n this.headers = new Headers(options.headers)\n\n // @NOTE An \"atproto-proxy\" header provided through the `headers` option\n // acts as fallback for the `service` option.\n const service = this.headers.get('atproto-proxy')?.trim()\n\n this.xrpcDefaults = Object.freeze({\n service:\n options.service === undefined && service != null && isService(service)\n ? service\n : (options.service ?? null),\n labelers: new Set(options.labelers),\n // @NOTE when provided (including `null`), will override the class wide\n // Client.appLabelers\n appLabelers:\n options.appLabelers != null\n ? new Set(options.appLabelers)\n : options.appLabelers,\n validateRequest: options.validateRequest ?? false,\n validateResponse: options.validateResponse ?? true,\n strictResponseProcessing: options.strictResponseProcessing ?? true,\n onCancellationError: options.onCancellationError ?? 'propagate',\n })\n }\n\n /**\n * The DID of the authenticated user, or `undefined` if not authenticated.\n */\n get did(): DidString | undefined {\n return this.agent.did\n }\n\n /**\n * The DID of the authenticated user.\n * @throws {Error} if not authenticated\n */\n get assertDid(): DidString {\n this.assertAuthenticated()\n return this.did\n }\n\n get service(): Service | null {\n return this.xrpcDefaults.service\n }\n\n get labelers(): Set<DidString> {\n return this.xrpcDefaults.labelers\n }\n\n /**\n * Asserts that the client is authenticated.\n * Use as a type guard when you need to ensure authentication.\n *\n * @throws {Error} if not authenticated\n *\n * @example\n * ```typescript\n * client.assertAuthenticated()\n * // TypeScript now knows client.did is defined\n * console.log(client.did)\n * ```\n */\n public assertAuthenticated(): asserts this is { did: DidString } {\n if (!this.did) throw new Error('Client is not authenticated')\n }\n\n /**\n * Replaces all labelers with the given set.\n * @param labelers - Iterable of labeler DIDs\n */\n public setLabelers(labelers: Iterable<DidString> = []): void {\n this.clearLabelers()\n this.addLabelers(labelers)\n }\n\n /**\n * Adds labelers to the current set.\n * @param labelers - Iterable of labeler DIDs to add\n */\n public addLabelers(labelers: Iterable<DidString>): void {\n for (const labeler of labelers) this.xrpcDefaults.labelers.add(labeler)\n }\n\n /**\n * Removes all labelers from this client instance.\n */\n public clearLabelers(): void {\n this.xrpcDefaults.labelers.clear()\n }\n\n /**\n * Makes an XRPC request. Throws on failure.\n *\n * @param ns - The lexicon method definition (e.g., `app.bsky.feed.getTimeline`)\n * @param options - Request options including params and body\n * @returns The successful XRPC response\n * @throws {XrpcFailure} when the request fails or returns an error\n *\n * @example Query with parameters\n * ```typescript\n * const response = await client.xrpc(app.bsky.feed.getTimeline, {\n * params: { limit: 50, cursor: 'abc123' }\n * })\n * console.log(response.body.feed)\n * ```\n *\n * @example Procedure with body\n * ```typescript\n * const response = await client.xrpc(com.atproto.repo.createRecord, {\n * body: {\n * repo: client.assertDid,\n * collection: 'app.bsky.feed.post',\n * record: { text: 'Hello!', createdAt: new Date().toISOString() }\n * }\n * })\n * ```\n *\n * @see {@link xrpcSafe} for a non-throwing variant\n * @see {@link xrpcStream} to stream binary payloads instead\n */\n async xrpc<const TMethod extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<TMethod>\n ? Main<TMethod>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcResponse<TMethod>>\n async xrpc<const TMethod extends Query | Procedure>(\n ns: Main<TMethod>,\n options: XrpcOptions<TMethod>,\n ): Promise<XrpcResponse<TMethod>>\n async xrpc<const TMethod extends Query | Procedure>(\n ns: Main<TMethod>,\n options: XrpcOptions<TMethod> = {} as XrpcOptions<TMethod>,\n ): Promise<XrpcResponse<TMethod>> {\n return xrpc(this.agent, ns, this.buildXrpcOptions(options))\n }\n\n /**\n * Makes an XRPC request without throwing on failure.\n * Returns either a successful response or a failure object.\n *\n * @param ns - The lexicon method definition\n * @param options - Request options\n * @returns Either an XrpcResponse on success or XrpcFailure on failure\n *\n * @example\n * ```typescript\n * const result = await client.xrpcSafe(app.bsky.actor.getProfile, {\n * params: { actor: 'alice.bsky.social' }\n * })\n *\n * if (result.success) {\n * console.log(result.body.displayName)\n * } else {\n * console.error('Failed:', result.error)\n * }\n * ```\n *\n * @see {@link xrpc} for a throwing variant\n */\n async xrpcSafe<const TMethod extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<TMethod>\n ? Main<TMethod>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcResponse<TMethod> | XrpcFailure<TMethod>>\n async xrpcSafe<const TMethod extends Query | Procedure>(\n ns: Main<TMethod>,\n options: XrpcOptions<TMethod>,\n ): Promise<XrpcResponse<TMethod> | XrpcFailure<TMethod>>\n async xrpcSafe<const TMethod extends Query | Procedure>(\n ns: Main<TMethod>,\n options: XrpcOptions<TMethod> = {} as XrpcOptions<TMethod>,\n ): Promise<XrpcResponse<TMethod> | XrpcFailure<TMethod>> {\n return xrpcSafe(this.agent, ns, this.buildXrpcOptions(options))\n }\n\n /**\n * Makes an XRPC request, returning binary (non JSON) payloads unread, as a\n * {@link ReadableStream}. Throws on failure.\n *\n * The caller owns the stream, and must either consume it or cancel it\n * ({@link XrpcStreamResponse.cancel}, or by disposing of the response).\n * Only accepts methods declaring a binary output (a non-JSON encoding,\n * without schema) or no output encoding at all.\n *\n * @example\n * ```typescript\n * await using response = await client.xrpcStream(com.atproto.sync.getRepo, {\n * params: { did },\n * })\n *\n * for await (const chunk of response.body) {\n * // ...\n * }\n * ```\n *\n * @see {@link xrpc} for the buffered variant\n * @see {@link xrpcStreamSafe} for a non-throwing variant\n */\n async xrpcStream<const TMethod extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<TMethod>\n ? IfXrpcStreamable<TMethod, Main<TMethod>>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcStreamResponse<TMethod>>\n async xrpcStream<const TMethod extends Query | Procedure>(\n ns: IfXrpcStreamable<TMethod, Main<TMethod>>,\n options: XrpcOptions<TMethod>,\n ): Promise<XrpcStreamResponse<TMethod>>\n async xrpcStream<const TMethod extends Query | Procedure>(\n ns: IfXrpcStreamable<TMethod, Main<TMethod>>,\n options: XrpcOptions<TMethod> = {} as XrpcOptions<TMethod>,\n ): Promise<XrpcStreamResponse<TMethod>> {\n return xrpcStream(this.agent, ns, this.buildXrpcOptions(options))\n }\n\n /**\n * Same as {@link xrpcStream}, but returns failures instead of throwing them.\n *\n * @returns Either a successful {@link XrpcStreamResponse} or an\n * {@link XrpcFailure}, both of which are disposable.\n *\n * @example\n * ```typescript\n * await using result = await client.xrpcStreamSafe(com.atproto.sync.getRepo, {\n * params: { did },\n * })\n *\n * if (result.success) {\n * for await (const chunk of result.body) {\n * // ...\n * }\n * }\n * ```\n */\n async xrpcStreamSafe<const TMethod extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<TMethod>\n ? IfXrpcStreamable<TMethod, Main<TMethod>>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcStreamResult<TMethod>>\n async xrpcStreamSafe<const TMethod extends Query | Procedure>(\n ns: IfXrpcStreamable<TMethod, Main<TMethod>>,\n options: XrpcOptions<TMethod>,\n ): Promise<XrpcStreamResult<TMethod>>\n async xrpcStreamSafe<const TMethod extends Query | Procedure>(\n ns: IfXrpcStreamable<TMethod, Main<TMethod>>,\n options: XrpcOptions<TMethod> = {} as XrpcOptions<TMethod>,\n ): Promise<XrpcStreamResult<TMethod>> {\n return xrpcStreamSafe(this.agent, ns, this.buildXrpcOptions(options))\n }\n\n protected buildXrpcOptions<TMethod extends Query | Procedure>(\n options: XrpcOptions<TMethod>,\n ): XrpcOptions<TMethod> {\n // Apply the instance-wide defaults for service, labelers, and validation\n // options.\n const combined = applyDefaults(options, this.xrpcDefaults)\n\n // Dynamically apply the class-wide appLabelers if they are not already set\n // in the combined options.\n if (combined.appLabelers === undefined) {\n combined.appLabelers = (this.constructor as typeof Client).appLabelers\n }\n\n const optionsHeaders =\n options.headers != null ? new Headers(options.headers) : null\n\n // @NOTE we allow the \"service\" options to fallback to the \"atproto-proxy\"\n // header if it is present in the request-specific headers.\n if (options.service === undefined && optionsHeaders?.has('atproto-proxy')) {\n const serviceHeader = optionsHeaders.get('atproto-proxy')?.trim()\n if (serviceHeader != null && isService(serviceHeader)) {\n combined.service = serviceHeader\n }\n }\n\n // Merge the instance-wide headers with the request-specific headers.\n // Request-specific headers take precedence. This cannot be done in the\n // applyDefaults step above because headers require special merging logic.\n combined.headers = optionsHeaders\n ? mergeHeaders(this.headers, optionsHeaders)\n : new Headers(this.headers)\n\n // @NOTE Since the combined options here always contain a defined\n // \"service\" (even if null), any \"atproto-proxy\" header in either the\n // instance-wide or request-specific headers will be overridden by the\n // \"service\" value. Note that an \"atproto-proxy\" header provided through\n // the constructor's `headers` option is used as fallback for the\n // constructor's `service` option (see constructor), making the two\n // equivalent.\n return combined\n }\n\n /**\n * Creates a new record in an AT Protocol repository.\n *\n * @param record - The record to create, must include an {@link NsidString} `$type`\n * @param rkey - Optional record key; if omitted, server generates a TID\n * @param options - Create options including repo, swapCommit, validate\n * @returns The XRPC response containing the created record's URI and CID\n *\n * @example\n * ```typescript\n * const response = await client.createRecord(\n * { $type: 'app.bsky.feed.post', text: 'Hello!', createdAt: new Date().toISOString() },\n * undefined, // Let server generate rkey\n * { validate: true }\n * )\n * console.log(response.body.uri)\n * ```\n *\n * @see {@link create} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n public async createRecord(\n record: TypedLexMap<NsidString>,\n rkey?: string,\n { service = null, labelers = null, ...options }: CreateRecordOptions = {},\n ): Promise<XrpcResponse<typeof createRecord>> {\n return this.xrpc(createRecord, {\n ...options,\n service,\n labelers,\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 /**\n * Deletes a record from an AT Protocol repository.\n *\n * @param collection - The collection NSID\n * @param rkey - The record key\n * @param options - Delete options including repo, swapCommit, swapRecord\n *\n * @see {@link delete} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async deleteRecord(\n collection: NsidString,\n rkey: string,\n { service = null, labelers = null, ...options }: DeleteRecordOptions = {},\n ): Promise<XrpcResponse<typeof deleteRecord>> {\n return this.xrpc(deleteRecord, {\n ...options,\n service,\n labelers,\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 /**\n * Retrieves a record from an AT Protocol repository.\n *\n * @param collection - The collection NSID\n * @param rkey - The record key\n * @param options - Get options including repo\n *\n * @see {@link get} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n public async getRecord(\n collection: NsidString,\n rkey: string,\n { service = null, labelers = null, ...options }: GetRecordOptions = {},\n ): Promise<XrpcResponse<typeof getRecord>> {\n return this.xrpc(getRecord, {\n ...options,\n service,\n labelers,\n params: {\n repo: options?.repo ?? this.assertDid,\n collection,\n rkey,\n },\n })\n }\n\n /**\n * Creates or updates a record in a repository.\n *\n * @param record - The record to put, must include an {@link NsidString} `$type`\n * @param rkey - The record key\n * @param options - Put options including repo, swapCommit, swapRecord, validate\n *\n * @see {@link put} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async putRecord(\n record: TypedLexMap<NsidString>,\n rkey: string,\n { service = null, labelers = null, ...options }: PutRecordOptions = {},\n ): Promise<XrpcResponse<typeof putRecord>> {\n return this.xrpc(putRecord, {\n ...options,\n service,\n labelers,\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 /**\n * Lists records in a collection.\n *\n * @param nsid - The collection NSID\n * @param options - List options including repo, limit, cursor, reverse\n *\n * @see {@link list} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async listRecords(\n nsid: NsidString,\n { service = null, labelers = null, ...options }: ListRecordsOptions = {},\n ): Promise<XrpcResponse<typeof listRecords>> {\n return this.xrpc(listRecords, {\n ...options,\n service,\n labelers,\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 /**\n * Performs an atomic batch of create, update, and delete operations on records in a repository.\n *\n * @param builder - A function that receives an {@link ApplyWritesOperations} instance to build the operations\n * @param options - ApplyWrites options including repo, validate, swapCommit\n * @returns The XRPC response from the applyWrites call\n *\n * @example\n * ```typescript\n * const response = await client.applyWrites((op) => [\n * op.create(app.bsky.feed.post, { text: 'Hello!' }),\n * op.update(app.bsky.feed.post, { text: 'Updated text' }, { rkey: 'post123' }),\n * op.delete(app.bsky.feed.post, 'post456'),\n * op.update(app.bsky.actor.profile, { displayName: 'Alice' }),\n * ], {\n * validate: true,\n * })\n *\n * for (const result of response.body.results) {\n * console.log(result.uri)\n * }\n * ```\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async applyWrites(\n factory: WriteOperationsFactory,\n { service = null, labelers = null, ...options }: ApplyWritesOptions = {},\n ): Promise<XrpcResponse<typeof applyWrites>> {\n return this.xrpc(applyWrites, {\n ...options,\n service,\n labelers,\n body: {\n repo: options?.repo ?? this.assertDid,\n writes: WriteOperationHelper.build(factory),\n validate: options?.validate,\n swapCommit: options?.swapCommit,\n },\n })\n }\n\n /**\n * Uploads a blob to an AT Protocol repository.\n *\n * @param body - The blob data (Uint8Array, ReadableStream, Blob, etc.)\n * @param options - Upload options including encoding hint\n * @returns Response containing the blob reference\n *\n * @example\n * ```typescript\n * const imageData = await fetch('image.png').then(r => r.arrayBuffer())\n * const response = await client.uploadBlob(new Uint8Array(imageData), {\n * encoding: 'image/png'\n * })\n * console.log(response.body.blob) // Use this ref in records\n * ```\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async uploadBlob(\n body: BinaryBodyInit,\n { service = null, labelers = null, ...options }: UploadBlobOptions = {},\n ): Promise<XrpcResponse<typeof uploadBlob>> {\n return this.xrpc(uploadBlob, { ...options, service, labelers, body })\n }\n\n /**\n * Retrieves a blob by DID and CID.\n *\n * @param did - The DID of the repository containing the blob\n * @param cid - The CID of the blob\n * @param options - Call options\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n *\n * @see {@link getBlobStream} to stream the blob instead\n */\n async getBlob(\n did: DidString,\n cid: CidString,\n { service = null, labelers = null, ...options }: GetBlobOptions = {},\n ): Promise<XrpcResponse<typeof getBlob>> {\n return this.xrpc(getBlob, {\n ...options,\n service,\n labelers,\n params: { did, cid },\n })\n }\n\n /**\n * Same as {@link getBlob}, but returns the blob unread, as a\n * {@link ReadableStream} (see {@link xrpcStream}).\n *\n * @example\n * ```typescript\n * await using response = await client.getBlobStream(did, cid)\n *\n * for await (const chunk of response.body) {\n * // ...\n * }\n * ```\n */\n async getBlobStream(\n did: DidString,\n cid: CidString,\n { service = null, labelers = null, ...options }: GetBlobOptions = {},\n ): Promise<XrpcStreamResponse<typeof getBlob>> {\n return this.xrpcStream(getBlob, {\n ...options,\n service,\n labelers,\n params: { did, cid },\n })\n }\n\n /**\n * Universal call method for queries, procedures, and custom actions.\n * Automatically determines the call type based on the lexicon definition.\n *\n * @param ns - The lexicon method or action definition\n * @param arg - The input argument (params for queries, body for procedures, input for actions)\n * @param options - Call options\n * @returns The method response body or action output\n * @see {@link xrpc} if you need access to the full response object\n *\n * @example Query\n * ```typescript\n * const profile = await client.call(app.bsky.actor.getProfile, {\n * actor: 'alice.bsky.social'\n * })\n * ```\n *\n * @example Procedure\n * ```typescript\n * const result = await client.call(com.atproto.repo.createRecord, {\n * repo: did,\n * collection: 'app.bsky.feed.post',\n * record: { text: 'Hello!' }\n * })\n * ```\n *\n * @example Action\n * ```typescript\n * const result = await client.call(updateProfile, (profile) => {\n * profile.displayName = 'Alice'\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?: T extends Action\n ? ActionOptions\n : T extends Procedure\n ? Omit<XrpcOptions<T>, 'body'>\n : T extends Query\n ? Omit<XrpcOptions<T>, 'params'>\n : never,\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: ActionOptions = {},\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 /**\n * Creates a new record with full type safety based on the schema.\n *\n * @param ns - The record schema definition\n * @param input - The record data (without `$type`, which is added automatically)\n * @param options - Create options including rkey (required for some record types)\n * @returns The create output including URI and CID\n *\n * @example Creating a post\n * ```typescript\n * const result = await client.create(app.bsky.feed.post, {\n * text: 'Hello, world!',\n * createdAt: new Date().toISOString()\n * })\n * console.log(result.uri)\n * ```\n *\n * @example Creating a record with explicit rkey\n * ```typescript\n * const result = await client.create(app.bsky.actor.profile, {\n * displayName: 'Alice'\n * }, { rkey: 'self' })\n * ```\n *\n * @see {@link createRecord} for a lower-level method that returns the raw response without schema validation\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 TypedLexMap<NsidString>\n if (options?.validateRequest) schema.validate(record)\n const rkey = rkeyForCreate(schema, options?.rkey)\n const response = await this.createRecord(record, rkey, options)\n return response.body\n }\n\n /**\n * Deletes a record with type-safe options.\n *\n * @param ns - The record schema definition\n * @param options - Delete options (rkey required for non-literal keys)\n * @returns The delete output\n *\n * @see {@link deleteRecord} for a lower-level method that returns the raw response without schema validation\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 = rkeyFor(schema, options.rkey)\n const response = await this.deleteRecord(schema.$type, rkey, options)\n return response.body\n }\n\n /**\n * Retrieves a record with type-safe validation.\n *\n * @param ns - The record schema definition\n * @param options - Get options (rkey required for non-literal keys)\n * @returns The record data validated against the schema\n *\n * @example\n * ```typescript\n * const profile = await client.get(app.bsky.actor.profile)\n * // profile.value is typed as app.bsky.actor.profile.Record\n * console.log(profile.value.displayName)\n * ```\n *\n * @see {@link getRecord} for a lower-level method that returns the raw record without schema validation\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 = rkeyFor(schema, options.rkey)\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 /**\n * Creates or updates a record with full type safety.\n *\n * @param ns - The record schema definition\n * @param input - The record data\n * @param options - Put options (rkey required for non-literal keys)\n * @returns The put output including URI and CID\n *\n * @example Creating a new record\n * ```typescript\n * const result = await client.put(app.bsky.feed.post, {\n * text: 'Hello, world!',\n * createdAt: new Date().toISOString()\n * })\n * console.log(result.uri)\n * ```\n *\n * @example Updating an existing record with explicit rkey\n * ```typescript\n * const result = await client.put(app.bsky.actor.profile, {\n * displayName: 'Alice'\n * }, { rkey: 'self' })\n * ```\n *\n * @see {@link putRecord} for a lower-level method that returns the raw record without schema validation\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 TypedLexMap<NsidString>\n if (options?.validateRequest) schema.validate(record)\n const rkey = rkeyFor(schema, options.rkey)\n const response = await this.putRecord(record, rkey, options)\n return response.body\n }\n\n /**\n * Lists records with type-safe validation and separation of valid/invalid records.\n *\n * @param ns - The record schema definition\n * @param options - List options\n * @returns Records validated against the schema, with invalid records included as LexMap\n *\n * @example\n * ```typescript\n * const result = await client.list(app.bsky.feed.post, { limit: 100 })\n * for (const record of result.records) {\n * if (record.valid) {\n * record.value // Fully typed\n * } else {\n * record.value // Invalid record, typed as LexMap\n * }\n * }\n * ```\n *\n * @see {@link listRecords} for a lower-level method that returns the raw records without schema validation\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 const records = body.records.map(processListRecord, schema)\n return { ...body, records }\n }\n\n /**\n * Asynchronously iterates over all records in a collection, handling\n * pagination automatically.\n *\n * @param ns - The record schema definition\n * @param options - List options including limit and cursor\n * @returns An async generator yielding each record validated against the schema\n *\n * @see {@link list} for a method that returns a single page of records\n * @see {@link listRecords} for a lower-level method that returns raw records without schema validation\n */\n async *listAll<const T extends RecordSchema>(\n ns: Main<T>,\n { maxRetries = 3, ...options }: ListOptions = {},\n ): AsyncGenerator<ListRecordItem<Infer<T>>, void, unknown> {\n const schema = getMain(ns)\n\n do {\n throwIfAborted(options.signal)\n\n const { body } = await this.listRecords(schema.$type, {\n ...options,\n maxRetries,\n })\n\n // We don't use this.list() here so that we can lazily process records as\n // they come in, rather than mapping and yielding the entire page at once.\n for (const record of body.records) {\n yield processListRecord.call(schema, record)\n }\n\n // If the server returns the same cursor, we may be in a loop. Stop\n // iteration.\n if (body.cursor && body.cursor === options.cursor) {\n return\n }\n\n options.cursor = body.cursor\n } while (options.cursor)\n }\n}\n\nfunction processListRecord<T extends RecordSchema>(\n this: T,\n record: ListRecordsRecord,\n): ListRecordItem<Infer<T>> {\n const result = this.safeValidate(record.value)\n if (result.success) {\n return { ...record, valid: true, value: result.value }\n } else {\n return { ...record, valid: false }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAgBL,aAAa,EACb,UAAU,EACV,SAAS,EACT,YAAY,EACZ,OAAO,EACP,aAAa,EACb,cAAc,EACd,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAYL,SAAS,EACT,KAAK,EAGL,OAAO,GACR,MAAM,qBAAqB,CAAA;AAC5B,8EAA8E;AAC9E,8EAA8E;AAC9E,uCAAuC;AACvC,OAAO,WAAW,MAAM,4CAA4C,CAAA;AACpE,OAAO,YAAY,MAAM,6CAA6C,CAAA;AACtE,OAAO,YAAY,MAAM,6CAA6C,CAAA;AACtE,OAAO,SAAS,MAAM,0CAA0C,CAAA;AAChE,OAAO,WAAW,EAAE,EAEnB,MAAM,4CAA4C,CAAA;AACnD,OAAO,SAAS,MAAM,0CAA0C,CAAA;AAChE,OAAO,UAAU,MAAM,2CAA2C,CAAA;AAClE,OAAO,OAAO,MAAM,wCAAwC,CAAA;AAC5D,OAAO,EACL,oBAAoB,GAErB,MAAM,8BAA8B,CAAA;AAoUrC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,MAAM;aACV,gBAAW,GAAyB,EAAE,CAAA;IAE7C;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,IAA2C;QAC1D,IAAI,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,WAAW,GAAG,C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CAAC;gBAClD,OAAM;YACR,CAAC;YAED,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC9B,CAAC,QAAQ,OAAO,CAAC,MAAM,EAAC;IAC1B,CAAC;CACF;AAED,SAAS,iBAAiB,CAExB,MAAyB;IAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAA;IACxD,CAAC;SAAM,CAAC;QACN,OAAO,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IAC1D,CAAC;AACH,CAAC","sourcesContent":["import type { LexMap, LexValue, TypedLexMap } from '@atproto/lex-data'\nimport {\n type AccountAgent,\n type Agent,\n type AgentOptions,\n type BinaryBodyInit,\n type IfXrpcStreamable,\n type RecordKeyOptions,\n type Service,\n type XrpcCancellationErrorHandler,\n type XrpcFailure,\n type XrpcOptions,\n type XrpcRequestParams,\n type XrpcResponse,\n type XrpcResponseBody,\n type XrpcStreamResponse,\n type XrpcStreamResult,\n applyDefaults,\n buildAgent,\n isService,\n mergeHeaders,\n rkeyFor,\n rkeyForCreate,\n throwIfAborted,\n xrpc,\n xrpcSafe,\n xrpcStream,\n xrpcStreamSafe,\n} from '@atproto/lex-rpc'\nimport {\n type AtIdentifierString,\n type AtUriString,\n type CidString,\n type DidString,\n type Infer,\n type InferMethodInputBody,\n type InferMethodOutputBody,\n type LexValidationError,\n type Main,\n type NsidString,\n type Params,\n Procedure,\n Query,\n type RecordSchema,\n type Restricted,\n getMain,\n} from '@atproto/lex-schema'\n// @NOTE We could use import { com } from \"./lexicons/index.js\" here, but some\n// consumers might not know how to properly tree-shake that, so we import only\n// the needed lexicon schemas directly.\nimport applyWrites from './lexicons/com/atproto/repo/applyWrites.js'\nimport createRecord from './lexicons/com/atproto/repo/createRecord.js'\nimport deleteRecord from './lexicons/com/atproto/repo/deleteRecord.js'\nimport getRecord from './lexicons/com/atproto/repo/getRecord.js'\nimport listRecords, {\n type Record as ListRecordsRecord,\n} from './lexicons/com/atproto/repo/listRecords.js'\nimport putRecord from './lexicons/com/atproto/repo/putRecord.js'\nimport uploadBlob from './lexicons/com/atproto/repo/uploadBlob.js'\nimport getBlob from './lexicons/com/atproto/sync/getBlob.js'\nimport {\n WriteOperationHelper,\n type WriteOperationsFactory,\n} from './write-operation-builder.js'\n\n/**\n * Configuration options for creating a {@link Client}.\n *\n * @property {@link ClientOptions.labelers} - An iterable of labeler DIDs to include in requests. These will be combined with any global app labelers configured via {@link Client.configure}.\n * @property {@link ClientOptions.service} - An optional service identifier (DID or URL) for routing requests with service proxying.\n * @property {@link ClientOptions.headers} - Custom headers to include in all requests made by this client instance.\n * @property {@link ClientOptions.validateRequest} - If true, validates request bodies against their lexicon schemas before sending. Defaults to false for performance.\n * @property {@link ClientOptions.validateResponse} - If false, skips validation of response bodies against their lexicon schemas. Defaults to true to catch errors, but can be disabled for performance if you trust the server responses. Note that defaults will not be applied if validation is disabled, which can cause typing inconsistencies, so use with caution.\n * @property {@link ClientOptions.strictResponseProcessing} - If false, relaxes certain validation rules during response processing (e.g., allowing floats, deeper nesting, etc.). Defaults to true for strict compliance with {@link https://atproto.com/specs/data-model lexicon data model}, but can be disabled to handle non-compliant responses.\n * @property {@link ClientOptions.onCancellationError} - How discarded response bodies get cancelled. Defaults to `\"propagate\"` (awaited, failures thrown). Fetch handlers that may return responses with pending clones must use `\"log\"` (not awaited, failures logged) or a function, to avoid dead locks.\n *\n * @see {@link XrpcRequestHeadersOptions}\n * @see {@link XrpcRequestProcessingOptions}\n * @see {@link XrpcResponseOptions}\n *\n * @example\n * ```typescript\n * const options: ClientOptions = {\n * labelers: ['did:plc:labeler1'],\n * service: 'did:web:api.bsky.app#bsky_appview',\n * headers: { 'X-Custom-Header': 'value' },\n * validateRequest: false,\n * validateResponse: true,\n * strictResponseProcessing: false,\n * }\n * ```\n */\nexport type ClientOptions = {\n /** @see {@link XrpcRequestHeadersOptions.headers} */\n headers?: HeadersInit\n\n /** @see {@link XrpcRequestProcessingOptions.validateRequest} */\n validateRequest?: boolean\n\n /** @see {@link XrpcResponseOptions.validateResponse} */\n validateResponse?: boolean\n\n /** @see {@link XrpcResponseOptions.strictResponseProcessing} */\n strictResponseProcessing?: boolean\n\n /** @see {@link XrpcResponseOptions.onCancellationError} */\n onCancellationError?: XrpcCancellationErrorHandler\n\n /** @see {@link XrpcRequestHeadersOptions.labelers} */\n labelers?: null | Iterable<DidString>\n\n /** @see {@link XrpcRequestHeadersOptions.appLabelers} */\n appLabelers?: null | Iterable<DidString>\n\n /** @see {@link XrpcRequestHeadersOptions.service} */\n service?: null | Service\n}\n\n// @NOTE When several overloads apply, TypeScript first selects them with the\n// (stricter) subtype relation, which a value only passes against this type if\n// it has the (never present) property. Overloads accepting it are thus only\n// selected with the assignability relation, i.e. after every other overload.\ndeclare const subtypePassGuard: unique symbol\ntype SubtypePassGuard = { readonly [subtypePassGuard]?: never }\n\nexport type ActionOptions = {\n /** AbortSignal to cancel the request. */\n signal?: AbortSignal\n}\n\n/**\n * A composable action that can be invoked via {@link Client.call}.\n *\n * Actions provide a way to define custom operations that integrate with the\n * Client's call interface, enabling type-safe, reusable business logic.\n *\n * @typeParam I - The input type for the action\n * @typeParam O - The output type for the action\n *\n * @example\n * ```typescript\n * const myAction: Action<{ userId: string }, { profile: Profile }> = async (client, input, options) => {\n * const response = await client.xrpc(someMethod, { params: { actor: input.userId }, ...options })\n * return { profile: response.body }\n * }\n * ```\n */\nexport type Action<I = any, O = any> = (\n client: Client,\n input: I,\n options: ActionOptions,\n) => O | Promise<O>\n\n/**\n * Extracts the input type from an {@link Action}.\n * @typeParam A - The Action type to extract from\n */\nexport type InferActionInput<A extends Action> =\n A extends Action<infer I, any> ? I : never\n\n/**\n * Extracts the output type from an {@link Action}.\n * @typeParam A - The Action type to extract from\n */\nexport type InferActionOutput<A extends Action> =\n A extends Action<any, infer O> ? O : never\n\n/**\n * Options for creating a record in an AT Protocol repository.\n *\n * @see {@link Client.createRecord}\n */\nexport type CreateRecordOptions = Omit<\n XrpcOptions<typeof createRecord>,\n 'body'\n> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /** Compare-and-swap on the repo commit. If specified, must match current commit. */\n swapCommit?: string\n /**\n * Whether the PDS should validate the record against its lexicon schema.\n * When `true`, the PDS is asked to explicitly validate the record. When\n * `false`, the PDS is asked to explicitly skip validation. When `undefined`\n * (default), the PDS decides -- typically validating only collections whose\n * schemas it knows. This is server-side validation; for client-side\n * validation before sending, use {@link XrpcRequestProcessingOptions.validateRequest}.\n */\n validate?: boolean\n}\n\n/**\n * Options for deleting a record from an AT Protocol repository.\n *\n * @see {@link Client.deleteRecord}\n */\nexport type DeleteRecordOptions = Omit<\n XrpcOptions<typeof deleteRecord>,\n 'body'\n> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /** Compare-and-swap on the repo commit. If specified, must match current commit. */\n swapCommit?: string\n /** Compare-and-swap on the record CID. If specified, must match current record. */\n swapRecord?: string\n}\n\n/**\n * Options for retrieving a record from an AT Protocol repository.\n *\n * @see {@link Client.getRecord}\n */\nexport type GetRecordOptions = Omit<XrpcOptions<typeof getRecord>, 'params'> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n}\n\n/**\n * Options for creating or updating a record in an AT Protocol repository.\n *\n * @see {@link Client.putRecord}\n */\nexport type PutRecordOptions = Omit<XrpcOptions<typeof putRecord>, 'body'> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /** Compare-and-swap on the repo commit. If specified, must match current commit. */\n swapCommit?: string\n /** Compare-and-swap on the record CID. If specified, must match current record. */\n swapRecord?: string\n /**\n * Whether the PDS should validate the record against its lexicon schema.\n * When `true`, the PDS is asked to explicitly validate the record. When\n * `false`, the PDS is asked to explicitly skip validation. When `undefined`\n * (default), the PDS decides — typically validating only collections whose\n * schemas it knows. This is server-side validation; for client-side\n * validation before sending, use {@link XrpcRequestProcessingOptions.validateRequest}.\n */\n validate?: boolean\n}\n\n/**\n * Options for listing records in an AT Protocol repository collection.\n *\n * @see {@link Client.listRecords}\n */\nexport type ListRecordsOptions = Omit<\n XrpcOptions<typeof listRecords>,\n 'params'\n> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /** Maximum number of records to return. */\n limit?: number\n /** Pagination cursor from a previous response. */\n cursor?: string\n /** If true, returns records in reverse chronological order. */\n reverse?: boolean\n}\n\n/**\n * Options for applying a batch of writes (create/update/delete) to an AT Protocol repository.\n *\n * @see {@link Client.applyWrites}\n */\nexport type ApplyWritesOptions = Omit<\n XrpcOptions<typeof applyWrites>,\n 'body'\n> & {\n /** Repository identifier (DID or handle). Defaults to authenticated user's DID. */\n repo?: AtIdentifierString\n /**\n * Whether the PDS should validate the records against their lexicon schemas.\n * When `true`, the PDS is asked to explicitly validate every record. When\n * `false`, the PDS is asked to explicitly skip validation. When `undefined`\n * (default), the PDS decides — typically validating only collections whose\n * schemas it knows.\n */\n validate?: boolean\n /** Compare-and-swap on the repo commit. If specified, must match current commit. */\n swapCommit?: CidString\n}\n\nexport type UploadBlobOptions = Omit<XrpcOptions<typeof uploadBlob>, 'body'>\n\nexport type GetBlobOptions = Omit<XrpcOptions<typeof getBlob>, 'params'>\n\n/**\n * Type-safe options for {@link Client.create}, combining record options with key requirements.\n * @typeParam T - The record schema type\n * @see {@link CreateRecordOptions}\n */\nexport type CreateOptions<T extends RecordSchema> = CreateRecordOptions &\n RecordKeyOptions<T, 'tid' | 'any'>\n\n/**\n * Output type for record creation operations.\n * Contains the URI and CID of the newly created record.\n */\nexport type CreateOutput = InferMethodOutputBody<\n typeof createRecord,\n Uint8Array\n>\n\n/**\n * Type-safe options for {@link Client.delete}, combining delete options with key requirements.\n * @typeParam T - The record schema type\n */\nexport type DeleteOptions<T extends RecordSchema> = DeleteRecordOptions &\n RecordKeyOptions<T>\n\n/**\n * Output type for record deletion operations.\n */\nexport type DeleteOutput = InferMethodOutputBody<\n typeof deleteRecord,\n Uint8Array\n>\n\n/**\n * Type-safe options for {@link Client.get}, combining get options with key requirements.\n * @typeParam T - The record schema type\n */\nexport type GetOptions<T extends RecordSchema> = GetRecordOptions &\n RecordKeyOptions<T>\n\n/**\n * Output type for record retrieval operations.\n * Contains the record value validated against the schema type.\n * @typeParam T - The record schema type\n */\nexport type GetOutput<T extends RecordSchema> = Omit<\n InferMethodOutputBody<typeof getRecord, Uint8Array>,\n 'value'\n> & { value: Infer<T> }\n\n/**\n * Type-safe options for {@link Client.put}, combining put options with key requirements.\n * @typeParam T - The record schema type\n */\nexport type PutOptions<T extends RecordSchema> = PutRecordOptions &\n RecordKeyOptions<T>\n\n/**\n * Output type for record put (create/update) operations.\n * Contains the URI and CID of the record.\n */\nexport type PutOutput = InferMethodOutputBody<typeof putRecord, Uint8Array>\n\n/**\n * Options for {@link Client.list} operations.\n */\nexport type ListOptions = ListRecordsOptions\n\n/**\n * Output type for record listing operations.\n * Contains validated records and any invalid records that failed schema validation.\n * @typeParam T - The record schema type\n */\nexport type ListOutput<T extends RecordSchema> = Omit<\n InferMethodOutputBody<typeof listRecords>,\n 'records'\n> & {\n /** Records that successfully validated against the schema. */\n records: ListRecordItem<Infer<T>>[]\n}\n\n/**\n * A discriminated union type representing the result of a record listing\n * operation.\n */\nexport type ListRecordItem<Value extends LexMap> =\n | {\n uri: AtUriString\n cid: CidString\n valid: true\n value: Value\n error?: never\n }\n | {\n uri: AtUriString\n cid: CidString\n valid: false\n value: LexMap\n error: LexValidationError\n }\n\n/**\n * The Client class is the primary interface for interacting with AT Protocol\n * services. It provides type-safe methods for XRPC calls, record operations,\n * and blob handling.\n *\n * @example\n * ```typescript\n * import { Client } from '@atproto/lex'\n * import { app } from '#/lexicons\n *\n * const client = new Client(oauthSession)\n *\n * const response = await client.xrpc(app.bsky.feed.getTimeline, {\n * params: { limit: 50 }\n * })\n * ```\n */\nexport class Client {\n static appLabelers: readonly DidString[] = []\n\n /**\n * Configures the Client (or its sub classes) globally.\n */\n static configure(opts: { appLabelers?: Iterable<DidString> }): void {\n if (opts.appLabelers) this.appLabelers = [...opts.appLabelers]\n }\n\n /** The underlying agent used for making requests. */\n public readonly agent: Agent\n\n /** Default header values to include in all requests made by this client instance. */\n public readonly headers: Headers\n\n /** Default {@link XrpcOptions} for this client instance. */\n public readonly xrpcDefaults: Readonly<{\n service: Service | null\n labelers: Set<DidString>\n appLabelers?: null | Iterable<DidString>\n validateRequest: boolean\n validateResponse: boolean\n strictResponseProcessing: boolean\n onCancellationError: XrpcCancellationErrorHandler\n }>\n\n constructor(agent: Agent | AgentOptions, options: ClientOptions = {}) {\n this.agent = buildAgent(agent)\n this.headers = new Headers(options.headers)\n\n // @NOTE An \"atproto-proxy\" header provided through the `headers` option\n // acts as fallback for the `service` option.\n const service = this.headers.get('atproto-proxy')?.trim()\n\n this.xrpcDefaults = Object.freeze({\n service:\n options.service === undefined && service != null && isService(service)\n ? service\n : (options.service ?? null),\n labelers: new Set(options.labelers),\n // @NOTE when provided (including `null`), will override the class wide\n // Client.appLabelers\n appLabelers:\n options.appLabelers != null\n ? new Set(options.appLabelers)\n : options.appLabelers,\n validateRequest: options.validateRequest ?? false,\n validateResponse: options.validateResponse ?? true,\n strictResponseProcessing: options.strictResponseProcessing ?? true,\n onCancellationError: options.onCancellationError ?? 'propagate',\n })\n }\n\n /**\n * The DID of the authenticated user, or `undefined` if not authenticated.\n */\n get did(): DidString | undefined {\n return this.agent.did\n }\n\n /**\n * The DID of the authenticated user.\n * @throws {Error} if not authenticated\n */\n get assertDid(): DidString {\n this.assertAuthenticated()\n return this.did\n }\n\n get service(): Service | null {\n return this.xrpcDefaults.service\n }\n\n get labelers(): Set<DidString> {\n return this.xrpcDefaults.labelers\n }\n\n /**\n * Asserts that the client is authenticated.\n * Use as a type guard when you need to ensure authentication.\n *\n * @throws {Error} if not authenticated\n *\n * @example\n * ```typescript\n * client.assertAuthenticated()\n * // TypeScript now knows client.did is defined\n * console.log(client.did)\n * ```\n */\n public assertAuthenticated(): asserts this is {\n did: DidString\n agent: AccountAgent\n } {\n if (!this.did) throw new Error('Client is not authenticated')\n }\n\n /**\n * Replaces all labelers with the given set.\n * @param labelers - Iterable of labeler DIDs\n */\n public setLabelers(labelers: Iterable<DidString> = []): void {\n this.clearLabelers()\n this.addLabelers(labelers)\n }\n\n /**\n * Adds labelers to the current set.\n * @param labelers - Iterable of labeler DIDs to add\n */\n public addLabelers(labelers: Iterable<DidString>): void {\n for (const labeler of labelers) this.xrpcDefaults.labelers.add(labeler)\n }\n\n /**\n * Removes all labelers from this client instance.\n */\n public clearLabelers(): void {\n this.xrpcDefaults.labelers.clear()\n }\n\n /**\n * Makes an XRPC request. Throws on failure.\n *\n * @param ns - The lexicon method definition (e.g., `app.bsky.feed.getTimeline`)\n * @param options - Request options including params and body\n * @returns The successful XRPC response\n * @throws {XrpcFailure} when the request fails or returns an error\n *\n * @example Query with parameters\n * ```typescript\n * const response = await client.xrpc(app.bsky.feed.getTimeline, {\n * params: { limit: 50, cursor: 'abc123' }\n * })\n * console.log(response.body.feed)\n * ```\n *\n * @example Procedure with body\n * ```typescript\n * const response = await client.xrpc(com.atproto.repo.createRecord, {\n * body: {\n * repo: client.assertDid,\n * collection: 'app.bsky.feed.post',\n * record: { text: 'Hello!', createdAt: new Date().toISOString() }\n * }\n * })\n * ```\n *\n * @see {@link xrpcSafe} for a non-throwing variant\n * @see {@link xrpcStream} to stream binary payloads instead\n */\n async xrpc<const TMethod extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<TMethod>\n ? Main<TMethod>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcResponse<TMethod>>\n async xrpc<const TMethod extends Query | Procedure>(\n ns: Main<TMethod>,\n options: XrpcOptions<TMethod>,\n ): Promise<XrpcResponse<TMethod>>\n async xrpc<const TMethod extends Query | Procedure>(\n ns: Main<TMethod>,\n options: XrpcOptions<TMethod> = {} as XrpcOptions<TMethod>,\n ): Promise<XrpcResponse<TMethod>> {\n return xrpc(this.agent, ns, this.buildXrpcOptions(options))\n }\n\n /**\n * Makes an XRPC request without throwing on failure.\n * Returns either a successful response or a failure object.\n *\n * @param ns - The lexicon method definition\n * @param options - Request options\n * @returns Either an XrpcResponse on success or XrpcFailure on failure\n *\n * @example\n * ```typescript\n * const result = await client.xrpcSafe(app.bsky.actor.getProfile, {\n * params: { actor: 'alice.bsky.social' }\n * })\n *\n * if (result.success) {\n * console.log(result.body.displayName)\n * } else {\n * console.error('Failed:', result.error)\n * }\n * ```\n *\n * @see {@link xrpc} for a throwing variant\n */\n async xrpcSafe<const TMethod extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<TMethod>\n ? Main<TMethod>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcResponse<TMethod> | XrpcFailure<TMethod>>\n async xrpcSafe<const TMethod extends Query | Procedure>(\n ns: Main<TMethod>,\n options: XrpcOptions<TMethod>,\n ): Promise<XrpcResponse<TMethod> | XrpcFailure<TMethod>>\n async xrpcSafe<const TMethod extends Query | Procedure>(\n ns: Main<TMethod>,\n options: XrpcOptions<TMethod> = {} as XrpcOptions<TMethod>,\n ): Promise<XrpcResponse<TMethod> | XrpcFailure<TMethod>> {\n return xrpcSafe(this.agent, ns, this.buildXrpcOptions(options))\n }\n\n /**\n * Makes an XRPC request, returning binary (non JSON) payloads unread, as a\n * {@link ReadableStream}. Throws on failure.\n *\n * The caller owns the stream, and must either consume it or cancel it\n * ({@link XrpcStreamResponse.cancel}, or by disposing of the response).\n * Only accepts methods declaring a binary output (a non-JSON encoding,\n * without schema) or no output encoding at all.\n *\n * @example\n * ```typescript\n * await using response = await client.xrpcStream(com.atproto.sync.getRepo, {\n * params: { did },\n * })\n *\n * for await (const chunk of response.body) {\n * // ...\n * }\n * ```\n *\n * @see {@link xrpc} for the buffered variant\n * @see {@link xrpcStreamSafe} for a non-throwing variant\n */\n async xrpcStream<const TMethod extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<TMethod>\n ? IfXrpcStreamable<TMethod, Main<TMethod>>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcStreamResponse<TMethod>>\n async xrpcStream<const TMethod extends Query | Procedure>(\n ns: IfXrpcStreamable<TMethod, Main<TMethod>>,\n options: XrpcOptions<TMethod>,\n ): Promise<XrpcStreamResponse<TMethod>>\n async xrpcStream<const TMethod extends Query | Procedure>(\n ns: IfXrpcStreamable<TMethod, Main<TMethod>>,\n options: XrpcOptions<TMethod> = {} as XrpcOptions<TMethod>,\n ): Promise<XrpcStreamResponse<TMethod>> {\n return xrpcStream(this.agent, ns, this.buildXrpcOptions(options))\n }\n\n /**\n * Same as {@link xrpcStream}, but returns failures instead of throwing them.\n *\n * @returns Either a successful {@link XrpcStreamResponse} or an\n * {@link XrpcFailure}, both of which are disposable.\n *\n * @example\n * ```typescript\n * await using result = await client.xrpcStreamSafe(com.atproto.sync.getRepo, {\n * params: { did },\n * })\n *\n * if (result.success) {\n * for await (const chunk of result.body) {\n * // ...\n * }\n * }\n * ```\n */\n async xrpcStreamSafe<const TMethod extends Query | Procedure>(\n ns: NonNullable<unknown> extends XrpcOptions<TMethod>\n ? IfXrpcStreamable<TMethod, Main<TMethod>>\n : Restricted<'This XRPC method requires an \"options\" argument'>,\n ): Promise<XrpcStreamResult<TMethod>>\n async xrpcStreamSafe<const TMethod extends Query | Procedure>(\n ns: IfXrpcStreamable<TMethod, Main<TMethod>>,\n options: XrpcOptions<TMethod>,\n ): Promise<XrpcStreamResult<TMethod>>\n async xrpcStreamSafe<const TMethod extends Query | Procedure>(\n ns: IfXrpcStreamable<TMethod, Main<TMethod>>,\n options: XrpcOptions<TMethod> = {} as XrpcOptions<TMethod>,\n ): Promise<XrpcStreamResult<TMethod>> {\n return xrpcStreamSafe(this.agent, ns, this.buildXrpcOptions(options))\n }\n\n protected buildXrpcOptions<TMethod extends Query | Procedure>(\n options: XrpcOptions<TMethod>,\n ): XrpcOptions<TMethod> {\n // Apply the instance-wide defaults for service, labelers, and validation\n // options.\n const combined = applyDefaults(options, this.xrpcDefaults)\n\n // Dynamically apply the class-wide appLabelers if they are not already set\n // in the combined options.\n if (combined.appLabelers === undefined) {\n combined.appLabelers = (this.constructor as typeof Client).appLabelers\n }\n\n // @NOTE Needs custom merging logic for headers as applyDefaults only deals\n // with plain objects.\n const { headers } = options\n combined.headers =\n typeof headers === 'function'\n ? async () => mergeHeaders(this.headers, await headers())\n : mergeHeaders(this.headers, headers)\n\n // @NOTE Since the combined options here always contain a defined\n // \"service\" (even if null), any \"atproto-proxy\" header in either the\n // instance-wide or request-specific headers will be overridden by the\n // \"service\" value. Note that an \"atproto-proxy\" header provided through\n // the constructor's `headers` option is used as fallback for the\n // constructor's `service` option (see constructor), making the two\n // equivalent.\n return combined\n }\n\n /**\n * Creates a new record in an AT Protocol repository.\n *\n * @param record - The record to create, must include an {@link NsidString} `$type`\n * @param rkey - Optional record key; if omitted, server generates a TID\n * @param options - Create options including repo, swapCommit, validate\n * @returns The XRPC response containing the created record's URI and CID\n *\n * @example\n * ```typescript\n * const response = await client.createRecord(\n * { $type: 'app.bsky.feed.post', text: 'Hello!', createdAt: new Date().toISOString() },\n * undefined, // Let server generate rkey\n * { validate: true }\n * )\n * console.log(response.body.uri)\n * ```\n *\n * @see {@link create} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n public async createRecord(\n record: TypedLexMap<NsidString>,\n rkey?: string,\n { service = null, labelers = null, ...options }: CreateRecordOptions = {},\n ): Promise<XrpcResponse<typeof createRecord>> {\n return this.xrpc(createRecord, {\n ...options,\n service,\n labelers,\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 /**\n * Deletes a record from an AT Protocol repository.\n *\n * @param collection - The collection NSID\n * @param rkey - The record key\n * @param options - Delete options including repo, swapCommit, swapRecord\n *\n * @see {@link delete} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async deleteRecord(\n collection: NsidString,\n rkey: string,\n { service = null, labelers = null, ...options }: DeleteRecordOptions = {},\n ): Promise<XrpcResponse<typeof deleteRecord>> {\n return this.xrpc(deleteRecord, {\n ...options,\n service,\n labelers,\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 /**\n * Retrieves a record from an AT Protocol repository.\n *\n * @param collection - The collection NSID\n * @param rkey - The record key\n * @param options - Get options including repo\n *\n * @see {@link get} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n public async getRecord(\n collection: NsidString,\n rkey: string,\n { service = null, labelers = null, ...options }: GetRecordOptions = {},\n ): Promise<XrpcResponse<typeof getRecord>> {\n return this.xrpc(getRecord, {\n ...options,\n service,\n labelers,\n params: {\n repo: options?.repo ?? this.assertDid,\n collection,\n rkey,\n },\n })\n }\n\n /**\n * Creates or updates a record in a repository.\n *\n * @param record - The record to put, must include an {@link NsidString} `$type`\n * @param rkey - The record key\n * @param options - Put options including repo, swapCommit, swapRecord, validate\n *\n * @see {@link put} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async putRecord(\n record: TypedLexMap<NsidString>,\n rkey: string,\n { service = null, labelers = null, ...options }: PutRecordOptions = {},\n ): Promise<XrpcResponse<typeof putRecord>> {\n return this.xrpc(putRecord, {\n ...options,\n service,\n labelers,\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 /**\n * Lists records in a collection.\n *\n * @param nsid - The collection NSID\n * @param options - List options including repo, limit, cursor, reverse\n *\n * @see {@link list} for a higher-level typed alternative\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async listRecords(\n nsid: NsidString,\n { service = null, labelers = null, ...options }: ListRecordsOptions = {},\n ): Promise<XrpcResponse<typeof listRecords>> {\n return this.xrpc(listRecords, {\n ...options,\n service,\n labelers,\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 /**\n * Performs an atomic batch of create, update, and delete operations on records in a repository.\n *\n * @param builder - A function that receives an {@link ApplyWritesOperations} instance to build the operations\n * @param options - ApplyWrites options including repo, validate, swapCommit\n * @returns The XRPC response from the applyWrites call\n *\n * @example\n * ```typescript\n * const response = await client.applyWrites((op) => [\n * op.create(app.bsky.feed.post, { text: 'Hello!' }),\n * op.update(app.bsky.feed.post, { text: 'Updated text' }, { rkey: 'post123' }),\n * op.delete(app.bsky.feed.post, 'post456'),\n * op.update(app.bsky.actor.profile, { displayName: 'Alice' }),\n * ], {\n * validate: true,\n * })\n *\n * for (const result of response.body.results) {\n * console.log(result.uri)\n * }\n * ```\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async applyWrites(\n factory: WriteOperationsFactory,\n { service = null, labelers = null, ...options }: ApplyWritesOptions = {},\n ): Promise<XrpcResponse<typeof applyWrites>> {\n return this.xrpc(applyWrites, {\n ...options,\n service,\n labelers,\n body: {\n repo: options?.repo ?? this.assertDid,\n writes: WriteOperationHelper.build(factory),\n validate: options?.validate,\n swapCommit: options?.swapCommit,\n },\n })\n }\n\n /**\n * Uploads a blob to an AT Protocol repository.\n *\n * @param body - The blob data (Uint8Array, ReadableStream, Blob, etc.)\n * @param options - Upload options including encoding hint\n * @returns Response containing the blob reference\n *\n * @example\n * ```typescript\n * const imageData = await fetch('image.png').then(r => r.arrayBuffer())\n * const response = await client.uploadBlob(new Uint8Array(imageData), {\n * encoding: 'image/png'\n * })\n * console.log(response.body.blob) // Use this ref in records\n * ```\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n */\n async uploadBlob(\n body: BinaryBodyInit,\n { service = null, labelers = null, ...options }: UploadBlobOptions = {},\n ): Promise<XrpcResponse<typeof uploadBlob>> {\n return this.xrpc(uploadBlob, { ...options, service, labelers, body })\n }\n\n /**\n * Retrieves a blob by DID and CID.\n *\n * @param did - The DID of the repository containing the blob\n * @param cid - The CID of the blob\n * @param options - Call options\n *\n * @note This method will ignore the `service` and `labelers` instance wide\n * defaults, and will always use `null` unless explicitly overridden in the\n * options.\n *\n * @see {@link getBlobStream} to stream the blob instead\n */\n async getBlob(\n did: DidString,\n cid: CidString,\n { service = null, labelers = null, ...options }: GetBlobOptions = {},\n ): Promise<XrpcResponse<typeof getBlob>> {\n return this.xrpc(getBlob, {\n ...options,\n service,\n labelers,\n params: { did, cid },\n })\n }\n\n /**\n * Same as {@link getBlob}, but returns the blob unread, as a\n * {@link ReadableStream} (see {@link xrpcStream}).\n *\n * @example\n * ```typescript\n * await using response = await client.getBlobStream(did, cid)\n *\n * for await (const chunk of response.body) {\n * // ...\n * }\n * ```\n */\n async getBlobStream(\n did: DidString,\n cid: CidString,\n { service = null, labelers = null, ...options }: GetBlobOptions = {},\n ): Promise<XrpcStreamResponse<typeof getBlob>> {\n return this.xrpcStream(getBlob, {\n ...options,\n service,\n labelers,\n params: { did, cid },\n })\n }\n\n /**\n * Universal call method for queries, procedures, and custom actions.\n * Automatically determines the call type based on the lexicon definition.\n *\n * @param ns - The lexicon method or action definition\n * @param arg - The input argument (params for queries, body for procedures, input for actions)\n * @param options - Call options\n * @returns The method response body or action output\n * @see {@link xrpc} if you need access to the full response object\n *\n * @example Query\n * ```typescript\n * const profile = await client.call(app.bsky.actor.getProfile, {\n * actor: 'alice.bsky.social'\n * })\n * ```\n *\n * @example Procedure\n * ```typescript\n * const result = await client.call(com.atproto.repo.createRecord, {\n * repo: did,\n * collection: 'app.bsky.feed.post',\n * record: { text: 'Hello!' }\n * })\n * ```\n *\n * @example Action\n * ```typescript\n * const result = await client.call(updateProfile, (profile) => {\n * profile.displayName = 'Alice'\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: undefined extends InferActionInput<T>\n ? Main<T>\n : Restricted<'This action type requires an \"input\" argument'>,\n ): Promise<InferActionOutput<T>>\n // @NOTE Inferring the input and output from the action's own signature, rather\n // than through InferActionInput / InferActionOutput, lets generic actions\n // infer their type parameters from the input. Intersecting the input with its\n // mapped type lowers the priority of the inference from the input, so that\n // excess properties are still reported (for non-generic actions). A generic\n // action fails the subtype relation when its input has optional properties\n // left out, hence the guard on the next overload, which would otherwise be\n // selected (with the type parameters of the action erased).\n public async call<I, O>(\n ns: (client: Client, input: I, options: ActionOptions) => O | Promise<O>,\n arg: I & { [K in keyof I]: I[K] },\n options?: ActionOptions,\n ): Promise<O>\n public async call<const T extends Action | Procedure | Query>(\n ns: Main<T> & SubtypePassGuard,\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?: T extends Action\n ? ActionOptions\n : T extends Procedure\n ? Omit<XrpcOptions<T>, 'body'>\n : T extends Query\n ? Omit<XrpcOptions<T>, 'params'>\n : never,\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: ActionOptions = {},\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 /**\n * Creates a new record with full type safety based on the schema.\n *\n * @param ns - The record schema definition\n * @param input - The record data (without `$type`, which is added automatically)\n * @param options - Create options including rkey (required for some record types)\n * @returns The create output including URI and CID\n *\n * @example Creating a post\n * ```typescript\n * const result = await client.create(app.bsky.feed.post, {\n * text: 'Hello, world!',\n * createdAt: new Date().toISOString()\n * })\n * console.log(result.uri)\n * ```\n *\n * @example Creating a record with explicit rkey\n * ```typescript\n * const result = await client.create(app.bsky.actor.profile, {\n * displayName: 'Alice'\n * }, { rkey: 'self' })\n * ```\n *\n * @see {@link createRecord} for a lower-level method that returns the raw response without schema validation\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 TypedLexMap<NsidString>\n if (options?.validateRequest) schema.validate(record)\n const rkey = rkeyForCreate(schema, options?.rkey)\n const response = await this.createRecord(record, rkey, options)\n return response.body\n }\n\n /**\n * Deletes a record with type-safe options.\n *\n * @param ns - The record schema definition\n * @param options - Delete options (rkey required for non-literal keys)\n * @returns The delete output\n *\n * @see {@link deleteRecord} for a lower-level method that returns the raw response without schema validation\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 = rkeyFor(schema, options.rkey)\n const response = await this.deleteRecord(schema.$type, rkey, options)\n return response.body\n }\n\n /**\n * Retrieves a record with type-safe validation.\n *\n * @param ns - The record schema definition\n * @param options - Get options (rkey required for non-literal keys)\n * @returns The record data validated against the schema\n *\n * @example\n * ```typescript\n * const profile = await client.get(app.bsky.actor.profile)\n * // profile.value is typed as app.bsky.actor.profile.Record\n * console.log(profile.value.displayName)\n * ```\n *\n * @see {@link getRecord} for a lower-level method that returns the raw record without schema validation\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 = rkeyFor(schema, options.rkey)\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 /**\n * Creates or updates a record with full type safety.\n *\n * @param ns - The record schema definition\n * @param input - The record data\n * @param options - Put options (rkey required for non-literal keys)\n * @returns The put output including URI and CID\n *\n * @example Creating a new record\n * ```typescript\n * const result = await client.put(app.bsky.feed.post, {\n * text: 'Hello, world!',\n * createdAt: new Date().toISOString()\n * })\n * console.log(result.uri)\n * ```\n *\n * @example Updating an existing record with explicit rkey\n * ```typescript\n * const result = await client.put(app.bsky.actor.profile, {\n * displayName: 'Alice'\n * }, { rkey: 'self' })\n * ```\n *\n * @see {@link putRecord} for a lower-level method that returns the raw record without schema validation\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 TypedLexMap<NsidString>\n if (options?.validateRequest) schema.validate(record)\n const rkey = rkeyFor(schema, options.rkey)\n const response = await this.putRecord(record, rkey, options)\n return response.body\n }\n\n /**\n * Lists records with type-safe validation and separation of valid/invalid records.\n *\n * @param ns - The record schema definition\n * @param options - List options\n * @returns Records validated against the schema, with invalid records included as LexMap\n *\n * @example\n * ```typescript\n * const result = await client.list(app.bsky.feed.post, { limit: 100 })\n * for (const record of result.records) {\n * if (record.valid) {\n * record.value // Fully typed\n * } else {\n * record.value // Invalid record, typed as LexMap\n * }\n * }\n * ```\n *\n * @see {@link listRecords} for a lower-level method that returns the raw records without schema validation\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 const records = body.records.map(processListRecord, schema)\n return { ...body, records }\n }\n\n /**\n * Asynchronously iterates over all records in a collection, handling\n * pagination automatically.\n *\n * @param ns - The record schema definition\n * @param options - List options including limit and cursor\n * @returns An async generator yielding each record validated against the schema\n *\n * @see {@link list} for a method that returns a single page of records\n * @see {@link listRecords} for a lower-level method that returns raw records without schema validation\n */\n async *listAll<const T extends RecordSchema>(\n ns: Main<T>,\n { maxRetries = 3, ...options }: ListOptions = {},\n ): AsyncGenerator<ListRecordItem<Infer<T>>, void, unknown> {\n const schema = getMain(ns)\n\n do {\n throwIfAborted(options.signal)\n\n const { body } = await this.listRecords(schema.$type, {\n ...options,\n maxRetries,\n })\n\n // We don't use this.list() here so that we can lazily process records as\n // they come in, rather than mapping and yielding the entire page at once.\n for (const record of body.records) {\n yield processListRecord.call(schema, record)\n }\n\n // If the server returns the same cursor, we may be in a loop. Stop\n // iteration.\n if (body.cursor && body.cursor === options.cursor) {\n return\n }\n\n options.cursor = body.cursor\n } while (options.cursor)\n }\n}\n\nfunction processListRecord<T extends RecordSchema>(\n this: T,\n record: ListRecordsRecord,\n): ListRecordItem<Infer<T>> {\n const result = this.safeValidate(record.value)\n if (result.success) {\n return { ...record, valid: true, value: result.value }\n } else {\n return { ...record, valid: false, error: result.reason }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/lex-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "HTTP client for interacting with Lexicon based APIs",
|
|
6
6
|
"keywords": [
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"node": ">=22"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atproto/lex-data": "^0.1.
|
|
36
|
-
"@atproto/lex-rpc": "^0.
|
|
37
|
-
"@atproto/lex-schema": "^0.
|
|
35
|
+
"@atproto/lex-data": "^0.1.11",
|
|
36
|
+
"@atproto/lex-rpc": "^0.2.0",
|
|
37
|
+
"@atproto/lex-schema": "^0.3.0",
|
|
38
38
|
"tslib": "^2.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@atproto/lex-cbor": "^0.1.
|
|
42
|
-
"@atproto/lex-json": "^0.1.
|
|
43
|
-
"@atproto/lex-builder": "^0.1.
|
|
44
|
-
"@atproto/lex-installer": "^0.2.
|
|
45
|
-
"vitest": "^
|
|
41
|
+
"@atproto/lex-cbor": "^0.1.11",
|
|
42
|
+
"@atproto/lex-json": "^0.1.10",
|
|
43
|
+
"@atproto/lex-builder": "^0.1.21",
|
|
44
|
+
"@atproto/lex-installer": "^0.2.10",
|
|
45
|
+
"vitest": "^5.1.1"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"lex:build": "lex-builder build --out ./src/lexicons --clear --lib @atproto/lex-schema --index-file --default-export",
|