@atcute/client 3.1.0 → 4.0.1

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,132 +0,0 @@
1
- import type { At, Procedures, Queries } from './lexicons.js';
2
- import { type FetchHandler, type FetchHandlerObject } from './fetch-handler.js';
3
- /**
4
- * @deprecated
5
- */
6
- export type HeadersObject = Record<string, string>;
7
- /**
8
- * Response from XRPC service
9
- * @deprecated
10
- */
11
- export interface XRPCResponse<T = any> {
12
- data: T;
13
- headers: HeadersObject;
14
- }
15
- /**
16
- * Options for constructing an XRPC error
17
- * @deprecated
18
- */
19
- export interface XRPCErrorOptions {
20
- kind?: string;
21
- description?: string;
22
- headers?: HeadersObject;
23
- cause?: unknown;
24
- }
25
- /**
26
- * Error coming from the XRPC service
27
- * @deprecated
28
- */
29
- export declare class XRPCError extends Error {
30
- name: string;
31
- /** Response status */
32
- status: number;
33
- /** Response headers */
34
- headers: HeadersObject;
35
- /** Error kind */
36
- kind?: string;
37
- /** Error description */
38
- description?: string;
39
- constructor(status: number, { kind, description, headers, cause, }?: XRPCErrorOptions);
40
- }
41
- /**
42
- * Service proxy options
43
- * @deprecated
44
- */
45
- export interface XRPCProxyOptions {
46
- type: 'atproto_pds' | 'atproto_labeler' | 'bsky_fg' | 'bsky_notif' | ({} & string);
47
- service: At.Did;
48
- }
49
- /**
50
- * Options for constructing an XRPC
51
- * @deprecated
52
- */
53
- export interface XRPCOptions {
54
- handler: FetchHandler | FetchHandlerObject;
55
- proxy?: XRPCProxyOptions;
56
- }
57
- /**
58
- * XRPC request options
59
- * @deprecated
60
- */
61
- export interface XRPCRequestOptions {
62
- type: 'get' | 'post';
63
- nsid: string;
64
- headers?: HeadersInit;
65
- params?: Record<string, unknown>;
66
- data?: FormData | Blob | ArrayBufferView | Record<string, unknown>;
67
- signal?: AbortSignal;
68
- }
69
- /**
70
- * XRPC response
71
- * @deprecated
72
- */
73
- export interface XRPCResponse<T = any> {
74
- data: T;
75
- headers: HeadersObject;
76
- }
77
- /** Base options for the query/procedure request */
78
- interface BaseRPCOptions {
79
- /** Request headers to make */
80
- headers?: HeadersInit;
81
- /** Signal for aborting the request */
82
- signal?: AbortSignal;
83
- }
84
- /**
85
- * Options for the query/procedure request
86
- * @deprecated
87
- */
88
- export type RPCOptions<T> = BaseRPCOptions & (T extends {
89
- params: any;
90
- } ? {
91
- params: T['params'];
92
- } : {}) & (T extends {
93
- input: any;
94
- } ? {
95
- data: T['input'];
96
- } : {});
97
- type OutputOf<T> = T extends {
98
- output: any;
99
- } ? T['output'] : never;
100
- /**
101
- * @deprecated
102
- */
103
- export declare class XRPC {
104
- handle: FetchHandler;
105
- proxy: XRPCProxyOptions | undefined;
106
- constructor({ handler, proxy }: XRPCOptions);
107
- /**
108
- * Makes a query (GET) request
109
- * @param nsid Namespace ID of a query endpoint
110
- * @param options Options to include like parameters
111
- * @returns The response of the request
112
- */
113
- get<K extends keyof Queries>(nsid: K, options: RPCOptions<Queries[K]>): Promise<XRPCResponse<OutputOf<Queries[K]>>>;
114
- /**
115
- * Makes a procedure (POST) request
116
- * @param nsid Namespace ID of a procedure endpoint
117
- * @param options Options to include like input body or parameters
118
- * @returns The response of the request
119
- */
120
- call<K extends keyof Procedures>(nsid: K, options: RPCOptions<Procedures[K]>): Promise<XRPCResponse<OutputOf<Procedures[K]>>>;
121
- /** Makes a request to the XRPC service */
122
- request(options: XRPCRequestOptions): Promise<XRPCResponse>;
123
- }
124
- /**
125
- * @deprecated
126
- */
127
- export declare const clone: (rpc: XRPC) => XRPC;
128
- /**
129
- * @deprecated
130
- */
131
- export declare const withProxy: (rpc: XRPC, options: XRPCProxyOptions) => XRPC;
132
- export {};
package/dist/rpc.js DELETED
@@ -1,153 +0,0 @@
1
- import { buildFetchHandler } from './fetch-handler.js';
2
- import { mergeHeaders } from './utils/http.js';
3
- /**
4
- * Error coming from the XRPC service
5
- * @deprecated
6
- */
7
- export class XRPCError extends Error {
8
- constructor(status, { kind = `HTTP error ${status}`, description = `Unspecified error description`, headers, cause, } = {}) {
9
- super(`${kind} > ${description}`, { cause });
10
- this.name = 'XRPCError';
11
- this.status = status;
12
- this.kind = kind;
13
- this.description = description;
14
- this.headers = headers || {};
15
- }
16
- }
17
- /**
18
- * @deprecated
19
- */
20
- export class XRPC {
21
- constructor({ handler, proxy }) {
22
- this.handle = buildFetchHandler(handler);
23
- this.proxy = proxy;
24
- }
25
- /**
26
- * Makes a query (GET) request
27
- * @param nsid Namespace ID of a query endpoint
28
- * @param options Options to include like parameters
29
- * @returns The response of the request
30
- */
31
- get(nsid, options) {
32
- return this.request({ type: 'get', nsid: nsid, ...options });
33
- }
34
- /**
35
- * Makes a procedure (POST) request
36
- * @param nsid Namespace ID of a procedure endpoint
37
- * @param options Options to include like input body or parameters
38
- * @returns The response of the request
39
- */
40
- call(nsid, options) {
41
- return this.request({ type: 'post', nsid: nsid, ...options });
42
- }
43
- /** Makes a request to the XRPC service */
44
- async request(options) {
45
- const data = options.data;
46
- const url = `/xrpc/${options.nsid}` + constructSearchParams(options.params);
47
- const isInputJson = isJsonValue(data);
48
- const response = await this.handle(url, {
49
- method: options.type,
50
- signal: options.signal,
51
- body: isInputJson ? JSON.stringify(data) : data,
52
- headers: mergeHeaders(options.headers, {
53
- 'content-type': isInputJson ? 'application/json' : null,
54
- 'atproto-proxy': constructProxyHeader(this.proxy),
55
- }),
56
- });
57
- const responseStatus = response.status;
58
- const responseHeaders = Object.fromEntries(response.headers);
59
- const responseType = responseHeaders['content-type'];
60
- let promise;
61
- let ret;
62
- if (responseType) {
63
- if (responseType.startsWith('application/json')) {
64
- promise = response.json();
65
- }
66
- else if (responseType.startsWith('text/')) {
67
- promise = response.text();
68
- }
69
- }
70
- try {
71
- ret = await (promise || response.arrayBuffer().then((buffer) => new Uint8Array(buffer)));
72
- }
73
- catch (err) {
74
- throw new XRPCError(2, {
75
- cause: err,
76
- kind: 'InvalidResponse',
77
- description: `Failed to parse response body`,
78
- headers: responseHeaders,
79
- });
80
- }
81
- if (responseStatus === 200) {
82
- return {
83
- data: ret,
84
- headers: responseHeaders,
85
- };
86
- }
87
- if (isErrorResponse(ret)) {
88
- throw new XRPCError(responseStatus, {
89
- kind: ret.error,
90
- description: ret.message,
91
- headers: responseHeaders,
92
- });
93
- }
94
- throw new XRPCError(responseStatus, { headers: responseHeaders });
95
- }
96
- }
97
- const constructProxyHeader = (proxy) => {
98
- if (proxy) {
99
- return `${proxy.service}#${proxy.type}`;
100
- }
101
- return null;
102
- };
103
- const constructSearchParams = (params) => {
104
- let searchParams;
105
- for (const key in params) {
106
- const value = params[key];
107
- if (value !== undefined) {
108
- searchParams ??= new URLSearchParams();
109
- if (Array.isArray(value)) {
110
- for (let idx = 0, len = value.length; idx < len; idx++) {
111
- const val = value[idx];
112
- searchParams.append(key, '' + val);
113
- }
114
- }
115
- else {
116
- searchParams.set(key, '' + value);
117
- }
118
- }
119
- }
120
- return searchParams ? `?` + searchParams.toString() : '';
121
- };
122
- const isJsonValue = (o) => {
123
- if (typeof o !== 'object' || o === null) {
124
- return false;
125
- }
126
- if ('toJSON' in o) {
127
- return true;
128
- }
129
- const proto = Object.getPrototypeOf(o);
130
- return proto === null || proto === Object.prototype;
131
- };
132
- const isErrorResponse = (value) => {
133
- if (typeof value !== 'object' || value === null) {
134
- return false;
135
- }
136
- const kindType = typeof value.error;
137
- const messageType = typeof value.message;
138
- return ((kindType === 'undefined' || kindType === 'string') &&
139
- (messageType === 'undefined' || messageType === 'string'));
140
- };
141
- /**
142
- * @deprecated
143
- */
144
- export const clone = (rpc) => {
145
- return new XRPC({ handler: rpc.handle, proxy: rpc.proxy });
146
- };
147
- /**
148
- * @deprecated
149
- */
150
- export const withProxy = (rpc, options) => {
151
- return new XRPC({ handler: rpc.handle, proxy: options });
152
- };
153
- //# 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;AA2B/C;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAYnC,YACC,MAAc,EACd,EACC,IAAI,GAAG,cAAc,MAAM,EAAE,EAC7B,WAAW,GAAG,+BAA+B,EAC7C,OAAO,EACP,KAAK,MACgB,EAAE;QAExB,KAAK,CAAC,GAAG,IAAI,MAAM,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QApBrC,SAAI,GAAG,WAAW,CAAC;QAsB3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;IAC9B,CAAC;CACD;AA4DD;;GAEG;AACH,MAAM,OAAO,IAAI;IAIhB,YAAY,EAAE,OAAO,EAAE,KAAK,EAAe;QAC1C,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,GAAG,CACF,IAAO,EACP,OAA+B;QAE/B,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAI,OAAe,EAAE,CAAC,CAAC;IACvE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AC,SAAS,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAU,EAA8B,EAAE;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,KAAK,CAAC,KAAK,CAAC;IACpC,MAAM,WAAW,GAAG,OAAO,KAAK,CAAC,OAAO,CAAC;IAEzC,OAAO,CACN,CAAC,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,QAAQ,CAAC;QACnD,CAAC,WAAW,KAAK,WAAW,IAAI,WAAW,KAAK,QAAQ,CAAC,CACzD,CAAC;AACH,CAAC,CAAC;AAOF;;GAEG;AACH,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;;GAEG;AACH,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,MAA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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"}