@atcute/client 3.0.1 → 4.0.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/dist/lexicons.js DELETED
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This file is automatically generated, do not edit!
3
- export {};
4
- //# sourceMappingURL=lexicons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lexicons.js","sourceRoot":"","sources":["../lib/lexicons.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,qDAAqD"}
package/dist/rpc.d.ts DELETED
@@ -1,96 +0,0 @@
1
- import type { At, Procedures, Queries } from './lexicons.js';
2
- import { type FetchHandler, type FetchHandlerObject } from './fetch-handler.js';
3
- export type HeadersObject = Record<string, string>;
4
- /** Response from XRPC service */
5
- export interface XRPCResponse<T = any> {
6
- data: T;
7
- headers: HeadersObject;
8
- }
9
- /** Options for constructing an XRPC error */
10
- export interface XRPCErrorOptions {
11
- kind?: string;
12
- description?: string;
13
- headers?: HeadersObject;
14
- cause?: unknown;
15
- }
16
- /** Error coming from the XRPC service */
17
- export declare class XRPCError extends Error {
18
- name: string;
19
- /** Response status */
20
- status: number;
21
- /** Response headers */
22
- headers: HeadersObject;
23
- /** Error kind */
24
- kind?: string;
25
- /** Error description */
26
- description?: string;
27
- constructor(status: number, { kind, description, headers, cause, }?: XRPCErrorOptions);
28
- }
29
- /** Service proxy options */
30
- export interface XRPCProxyOptions {
31
- type: 'atproto_pds' | 'atproto_labeler' | 'bsky_fg' | 'bsky_notif' | ({} & string);
32
- service: At.Did;
33
- }
34
- /** Options for constructing an XRPC */
35
- export interface XRPCOptions {
36
- handler: FetchHandler | FetchHandlerObject;
37
- proxy?: XRPCProxyOptions;
38
- }
39
- /** XRPC request options */
40
- export interface XRPCRequestOptions {
41
- type: 'get' | 'post';
42
- nsid: string;
43
- headers?: HeadersInit;
44
- params?: Record<string, unknown>;
45
- data?: FormData | Blob | ArrayBufferView | Record<string, unknown>;
46
- signal?: AbortSignal;
47
- }
48
- /** XRPC response */
49
- export interface XRPCResponse<T = any> {
50
- data: T;
51
- headers: HeadersObject;
52
- }
53
- /** Base options for the query/procedure request */
54
- interface BaseRPCOptions {
55
- /** Request headers to make */
56
- headers?: HeadersInit;
57
- /** Signal for aborting the request */
58
- signal?: AbortSignal;
59
- }
60
- /** Options for the query/procedure request */
61
- export type RPCOptions<T> = BaseRPCOptions & (T extends {
62
- params: any;
63
- } ? {
64
- params: T['params'];
65
- } : {}) & (T extends {
66
- input: any;
67
- } ? {
68
- data: T['input'];
69
- } : {});
70
- type OutputOf<T> = T extends {
71
- output: any;
72
- } ? T['output'] : never;
73
- export declare class XRPC {
74
- handle: FetchHandler;
75
- proxy: XRPCProxyOptions | undefined;
76
- constructor({ handler, proxy }: XRPCOptions);
77
- /**
78
- * Makes a query (GET) request
79
- * @param nsid Namespace ID of a query endpoint
80
- * @param options Options to include like parameters
81
- * @returns The response of the request
82
- */
83
- get<K extends keyof Queries>(nsid: K, options: RPCOptions<Queries[K]>): Promise<XRPCResponse<OutputOf<Queries[K]>>>;
84
- /**
85
- * Makes a procedure (POST) request
86
- * @param nsid Namespace ID of a procedure endpoint
87
- * @param options Options to include like input body or parameters
88
- * @returns The response of the request
89
- */
90
- call<K extends keyof Procedures>(nsid: K, options: RPCOptions<Procedures[K]>): Promise<XRPCResponse<OutputOf<Procedures[K]>>>;
91
- /** Makes a request to the XRPC service */
92
- request(options: XRPCRequestOptions): Promise<XRPCResponse>;
93
- }
94
- export declare const clone: (rpc: XRPC) => XRPC;
95
- export declare const withProxy: (rpc: XRPC, options: XRPCProxyOptions) => XRPC;
96
- export {};
package/dist/rpc.js DELETED
@@ -1,141 +0,0 @@
1
- import { buildFetchHandler } from './fetch-handler.js';
2
- import { mergeHeaders } from './utils/http.js';
3
- /** Error coming from the XRPC service */
4
- export class XRPCError extends Error {
5
- constructor(status, { kind = `HTTP error ${status}`, description = `Unspecified error description`, headers, cause, } = {}) {
6
- super(`${kind} > ${description}`, { cause });
7
- this.name = 'XRPCError';
8
- this.status = status;
9
- this.kind = kind;
10
- this.description = description;
11
- this.headers = headers || {};
12
- }
13
- }
14
- export class XRPC {
15
- constructor({ handler, proxy }) {
16
- this.handle = buildFetchHandler(handler);
17
- this.proxy = proxy;
18
- }
19
- /**
20
- * Makes a query (GET) request
21
- * @param nsid Namespace ID of a query endpoint
22
- * @param options Options to include like parameters
23
- * @returns The response of the request
24
- */
25
- get(nsid, options) {
26
- return this.request({ type: 'get', nsid: nsid, ...options });
27
- }
28
- /**
29
- * Makes a procedure (POST) request
30
- * @param nsid Namespace ID of a procedure endpoint
31
- * @param options Options to include like input body or parameters
32
- * @returns The response of the request
33
- */
34
- call(nsid, options) {
35
- return this.request({ type: 'post', nsid: nsid, ...options });
36
- }
37
- /** Makes a request to the XRPC service */
38
- async request(options) {
39
- const data = options.data;
40
- const url = `/xrpc/${options.nsid}` + constructSearchParams(options.params);
41
- const isInputJson = isJsonValue(data);
42
- const response = await this.handle(url, {
43
- method: options.type,
44
- signal: options.signal,
45
- body: isInputJson ? JSON.stringify(data) : data,
46
- headers: mergeHeaders(options.headers, {
47
- 'content-type': isInputJson ? 'application/json' : null,
48
- 'atproto-proxy': constructProxyHeader(this.proxy),
49
- }),
50
- });
51
- const responseStatus = response.status;
52
- const responseHeaders = Object.fromEntries(response.headers);
53
- const responseType = responseHeaders['content-type'];
54
- let promise;
55
- let ret;
56
- if (responseType) {
57
- if (responseType.startsWith('application/json')) {
58
- promise = response.json();
59
- }
60
- else if (responseType.startsWith('text/')) {
61
- promise = response.text();
62
- }
63
- }
64
- try {
65
- ret = await (promise || response.arrayBuffer().then((buffer) => new Uint8Array(buffer)));
66
- }
67
- catch (err) {
68
- throw new XRPCError(2, {
69
- cause: err,
70
- kind: 'InvalidResponse',
71
- description: `Failed to parse response body`,
72
- headers: responseHeaders,
73
- });
74
- }
75
- if (responseStatus === 200) {
76
- return {
77
- data: ret,
78
- headers: responseHeaders,
79
- };
80
- }
81
- if (isErrorResponse(ret)) {
82
- throw new XRPCError(responseStatus, {
83
- kind: ret.error,
84
- description: ret.message,
85
- headers: responseHeaders,
86
- });
87
- }
88
- throw new XRPCError(responseStatus, { headers: responseHeaders });
89
- }
90
- }
91
- const constructProxyHeader = (proxy) => {
92
- if (proxy) {
93
- return `${proxy.service}#${proxy.type}`;
94
- }
95
- return null;
96
- };
97
- const constructSearchParams = (params) => {
98
- let searchParams;
99
- for (const key in params) {
100
- const value = params[key];
101
- if (value !== undefined) {
102
- searchParams ??= new URLSearchParams();
103
- if (Array.isArray(value)) {
104
- for (let idx = 0, len = value.length; idx < len; idx++) {
105
- const val = value[idx];
106
- searchParams.append(key, '' + val);
107
- }
108
- }
109
- else {
110
- searchParams.set(key, '' + value);
111
- }
112
- }
113
- }
114
- return searchParams ? `?` + searchParams.toString() : '';
115
- };
116
- const isJsonValue = (o) => {
117
- if (typeof o !== 'object' || o === null) {
118
- return false;
119
- }
120
- if ('toJSON' in o) {
121
- return true;
122
- }
123
- const proto = Object.getPrototypeOf(o);
124
- return proto === null || proto === Object.prototype;
125
- };
126
- const isErrorResponse = (value) => {
127
- if (typeof value !== 'object' || value === null) {
128
- return false;
129
- }
130
- const kindType = typeof value.error;
131
- const messageType = typeof value.message;
132
- return ((kindType === 'undefined' || kindType === 'string') &&
133
- (messageType === 'undefined' || messageType === 'string'));
134
- };
135
- export const clone = (rpc) => {
136
- return new XRPC({ handler: rpc.handle, proxy: rpc.proxy });
137
- };
138
- export const withProxy = (rpc, options) => {
139
- return new XRPC({ handler: rpc.handle, proxy: options });
140
- };
141
- //# sourceMappingURL=rpc.js.map
package/dist/rpc.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc.js","sourceRoot":"","sources":["../lib/rpc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAA8C,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAkB/C,yCAAyC;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KAAK,WAAW,IAAI,WAAW,KAAK,QAAQ,CAAC,CACzD,CAAC;AACH,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAS,EAAQ,EAAE;IACxC,OAAO,IAAI,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAS,EAAE,OAAyB,EAAE,EAAE;IACjE,OAAO,IAAI,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1D,CAAC,CAAC"}
@@ -1,38 +0,0 @@
1
- /**
2
- * @module
3
- * DID document-related functionalities.
4
- * This module is exported for convenience and is no way part of public API,
5
- * it can be removed at any time.
6
- */
7
- /**
8
- * Retrieves AT Protocol PDS endpoint from the DID document, if available
9
- * @param doc DID document
10
- * @returns The PDS endpoint, if available
11
- */
12
- export declare const getPdsEndpoint: (doc: DidDocument) => string | undefined;
13
- /**
14
- * Retrieve a service endpoint from the DID document, if available
15
- * @param doc DID document
16
- * @param serviceId Service ID
17
- * @param serviceType Service type
18
- * @returns The requested service endpoint, if available
19
- */
20
- export declare const getServiceEndpoint: (doc: DidDocument, serviceId: string, serviceType: string) => string | undefined;
21
- /**
22
- * DID document
23
- */
24
- export interface DidDocument {
25
- id: string;
26
- alsoKnownAs?: string[];
27
- verificationMethod?: Array<{
28
- id: string;
29
- type: string;
30
- controller: string;
31
- publicKeyMultibase?: string;
32
- }>;
33
- service?: Array<{
34
- id: string;
35
- type: string;
36
- serviceEndpoint: string | Record<string, unknown>;
37
- }>;
38
- }
package/dist/utils/did.js DELETED
@@ -1,44 +0,0 @@
1
- /**
2
- * @module
3
- * DID document-related functionalities.
4
- * This module is exported for convenience and is no way part of public API,
5
- * it can be removed at any time.
6
- */
7
- /**
8
- * Retrieves AT Protocol PDS endpoint from the DID document, if available
9
- * @param doc DID document
10
- * @returns The PDS endpoint, if available
11
- */
12
- export const getPdsEndpoint = (doc) => {
13
- return getServiceEndpoint(doc, '#atproto_pds', 'AtprotoPersonalDataServer');
14
- };
15
- /**
16
- * Retrieve a service endpoint from the DID document, if available
17
- * @param doc DID document
18
- * @param serviceId Service ID
19
- * @param serviceType Service type
20
- * @returns The requested service endpoint, if available
21
- */
22
- export const getServiceEndpoint = (doc, serviceId, serviceType) => {
23
- const did = doc.id;
24
- const didServiceId = did + serviceId;
25
- const found = doc.service?.find((service) => service.id === serviceId || service.id === didServiceId);
26
- if (!found || found.type !== serviceType || typeof found.serviceEndpoint !== 'string') {
27
- return undefined;
28
- }
29
- return validateUrl(found.serviceEndpoint);
30
- };
31
- const validateUrl = (urlStr) => {
32
- let url;
33
- try {
34
- url = new URL(urlStr);
35
- }
36
- catch {
37
- return undefined;
38
- }
39
- const proto = url.protocol;
40
- if (url.hostname && (proto === 'http:' || proto === 'https:')) {
41
- return urlStr;
42
- }
43
- };
44
- //# sourceMappingURL=did.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"did.js","sourceRoot":"","sources":["../../lib/utils/did.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAgB,EAAsB,EAAE;IACtE,OAAO,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,2BAA2B,CAAC,CAAC;AAC7E,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CACjC,GAAgB,EAChB,SAAiB,EACjB,WAAmB,EACE,EAAE;IACvB,MAAM,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC;IAEnB,MAAM,YAAY,GAAG,GAAG,GAAG,SAAS,CAAC;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,SAAS,IAAI,OAAO,CAAC,EAAE,KAAK,YAAY,CAAC,CAAC;IAEtG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,KAAK,CAAC,eAAe,KAAK,QAAQ,EAAE,CAAC;QACvF,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,WAAW,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,MAAc,EAAsB,EAAE;IAC1D,IAAI,GAAG,CAAC;IACR,IAAI,CAAC;QACJ,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC;IAE3B,IAAI,GAAG,CAAC,QAAQ,IAAI,CAAC,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,QAAQ,CAAC,EAAE,CAAC;QAC/D,OAAO,MAAM,CAAC;IACf,CAAC;AACF,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * @module
3
- * Assortment of HTTP utilities
4
- * This module is exported for convenience and is no way part of public API,
5
- * it can be removed at any time.
6
- */
7
- export declare const mergeHeaders: (init: HeadersInit | undefined, defaults: Record<string, string | null>) => HeadersInit | undefined;
@@ -1,20 +0,0 @@
1
- /**
2
- * @module
3
- * Assortment of HTTP utilities
4
- * This module is exported for convenience and is no way part of public API,
5
- * it can be removed at any time.
6
- */
7
- export const mergeHeaders = (init, defaults) => {
8
- let headers;
9
- for (const name in defaults) {
10
- const value = defaults[name];
11
- if (value !== null) {
12
- headers ??= new Headers(init);
13
- if (!headers.has(name)) {
14
- headers.set(name, value);
15
- }
16
- }
17
- }
18
- return headers ?? init;
19
- };
20
- //# sourceMappingURL=http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../lib/utils/http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC3B,IAA6B,EAC7B,QAAuC,EACb,EAAE;IAC5B,IAAI,OAA4B,CAAC;IAEjC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAE7B,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACpB,OAAO,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;YAE9B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC1B,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,OAAO,IAAI,IAAI,CAAC;AACxB,CAAC,CAAC"}