@arcosmos/sdk 0.0.0-stage → 0.1.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.
@@ -0,0 +1,42 @@
1
+ import { type Kind, type MeasurementLike, type MotionInput, type Quantity, type SkyCoord } from '@arcosmos/astronomy';
2
+ /**
3
+ * A measurement as a Quantity, with its uncertainty and limit:
4
+ *
5
+ * ```ts
6
+ * const parallax = quantity(m, 'angle') // Quantity<'angle'>, or throws if it isn't an angle
7
+ * parallax.to('arcsec')
8
+ * ```
9
+ *
10
+ * Give the kind to have the type say what it is; it is checked when it runs. The error
11
+ * ellipse SIMBAD gives a proper motion is kept, and follows a change of unit. A label (a
12
+ * spectral type) isn't a quantity, and throws.
13
+ */
14
+ export declare function quantity(measurement: MeasurementLike): Quantity;
15
+ export declare function quantity<K extends Kind>(measurement: MeasurementLike, kind: K): Quantity<K>;
16
+ /** A position as the API gives one: ICRS degrees, at a Julian epoch or none. */
17
+ export interface PositionLike {
18
+ readonly ra: number;
19
+ readonly dec: number;
20
+ readonly unit: 'deg';
21
+ readonly frame: string | null;
22
+ readonly epoch: number | null;
23
+ }
24
+ /** A star's distance and motion, any of them optional, for `skyCoord`. Without uncertainties. */
25
+ export interface SkyMotion extends MotionInput {
26
+ readonly pmRaCosdec?: Quantity<'angular speed'>;
27
+ readonly pmDec?: Quantity<'angular speed'>;
28
+ }
29
+ /**
30
+ * A position as a SkyCoord in ICRS, its `obstime` the position's epoch (a Julian year, in TT):
31
+ *
32
+ * ```ts
33
+ * const { data } = await astro.objects.get('Vega')
34
+ * skyCoord(data.position!).galactic
35
+ * ```
36
+ *
37
+ * Give its distance and motion, chosen from the object's measurements, to move it with
38
+ * `applySpaceMotion`. A SkyCoord takes no uncertainties yet, so pass plain values. A position
39
+ * whose frame isn't ICRS throws.
40
+ */
41
+ export declare function skyCoord(position: PositionLike, motion?: SkyMotion): SkyCoord;
42
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,IAAI,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAEhF,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,eAAe,GAAG,QAAQ,CAAA;AAChE,wBAAgB,QAAQ,CAAC,CAAC,SAAS,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;AAM5F,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,iGAAiG;AACjG,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAA;IAC/C,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAA;CAC3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAE,SAAc,GAAG,QAAQ,CAOjF"}
@@ -0,0 +1,29 @@
1
+ // Responses stay JSON, as the API sends them. These turn the parts that are values into
2
+ // @arcosmos/astronomy's types, to convert units, propagate errors or change frames.
3
+ import { fromMeasurement, q, skyCoord as coordinate, time, } from '@arcosmos/astronomy';
4
+ export function quantity(measurement, kind) {
5
+ const value = fromMeasurement(measurement);
6
+ return kind === undefined ? value : value.as(kind);
7
+ }
8
+ /**
9
+ * A position as a SkyCoord in ICRS, its `obstime` the position's epoch (a Julian year, in TT):
10
+ *
11
+ * ```ts
12
+ * const { data } = await astro.objects.get('Vega')
13
+ * skyCoord(data.position!).galactic
14
+ * ```
15
+ *
16
+ * Give its distance and motion, chosen from the object's measurements, to move it with
17
+ * `applySpaceMotion`. A SkyCoord takes no uncertainties yet, so pass plain values. A position
18
+ * whose frame isn't ICRS throws.
19
+ */
20
+ export function skyCoord(position, motion = {}) {
21
+ if (position.frame === null || position.frame.toUpperCase() !== 'ICRS') {
22
+ throw new TypeError(`This position's frame is ${position.frame === null ? 'not stated' : position.frame}, not ICRS`);
23
+ }
24
+ if (position.unit !== 'deg')
25
+ throw new TypeError(`A position in ${String(position.unit)} isn't one the API gives`);
26
+ const obstime = motion.obstime ?? (position.epoch === null ? undefined : time(position.epoch, { format: 'jyear' }));
27
+ return coordinate({ ...motion, ra: q(position.ra, 'deg'), dec: q(position.dec, 'deg'), frame: 'icrs', obstime });
28
+ }
29
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,oFAAoF;AACpF,OAAO,EAC4E,eAAe,EAAE,CAAC,EAAE,QAAQ,IAAI,UAAU,EAC3H,IAAI,GACL,MAAM,qBAAqB,CAAA;AAgB5B,MAAM,UAAU,QAAQ,CAAC,WAA4B,EAAE,IAAW;IAChE,MAAM,KAAK,GAAG,eAAe,CAAC,WAAW,CAAC,CAAA;IAC1C,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AACpD,CAAC;AAiBD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,QAAQ,CAAC,QAAsB,EAAE,MAAM,GAAc,EAAE;IACrE,IAAI,QAAQ,CAAC,KAAK,KAAK,IAAI,IAAI,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;QACvE,MAAM,IAAI,SAAS,CAAC,4BAA4B,QAAQ,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,YAAY,CAAC,CAAA;IACtH,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,KAAK,KAAK;QAAE,MAAM,IAAI,SAAS,CAAC,iBAAiB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;IAClH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;IACnH,OAAO,UAAU,CAAC,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;AAClH,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type { ErrorDetails, Operations, Schemas } from './api.ts';
2
+ export { OPERATIONS } from './api.ts';
3
+ export { Client, type ClientOptions, DEFAULT_BASE_URL, type Input, type OperationId, type Output, type Quota, type RequestOptions, } from './client.ts';
4
+ export { type AnyErrorCode, ArcosmosError, ConnectionError, type DetailsOf, type ErrorCode } from './errors.ts';
5
+ export { type PositionLike, type SkyMotion, quantity, skyCoord } from './helpers.ts';
6
+ export { type PageLike, Paged } from './paging.ts';
7
+ export { Arcosmos, type MatchInput } from './resources.ts';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACL,MAAM,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,KAAK,KAAK,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,KAAK,cAAc,GACzH,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,KAAK,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAA;AAC/G,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACpF,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { OPERATIONS } from './api.js';
2
+ export { Client, DEFAULT_BASE_URL, } from './client.js';
3
+ export { ArcosmosError, ConnectionError } from './errors.js';
4
+ export { quantity, skyCoord } from './helpers.js';
5
+ export { Paged } from './paging.js';
6
+ export { Arcosmos } from './resources.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACL,MAAM,EAAsB,gBAAgB,GAC7C,MAAM,aAAa,CAAA;AACpB,OAAO,EAAqB,aAAa,EAAE,eAAe,EAAkC,MAAM,aAAa,CAAA;AAC/G,OAAO,EAAqC,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACpF,OAAO,EAAiB,KAAK,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,32 @@
1
+ /** A page of a list, as the API sends one. */
2
+ export interface PageLike<T> {
3
+ data: T[];
4
+ metadata: {
5
+ page: {
6
+ next_cursor: string | null;
7
+ };
8
+ };
9
+ }
10
+ /**
11
+ * A request for a paged list. `await` it for the first page, as the API sends it, or iterate
12
+ * it for every result across the pages:
13
+ *
14
+ * ```ts
15
+ * const first = await astro.stars.search({ distance_max: '10 pc' })
16
+ * for await (const star of astro.stars.search({ distance_max: '10 pc' })) { ... }
17
+ * ```
18
+ *
19
+ * Nothing is requested until it is awaited or iterated, and the first page is requested once.
20
+ */
21
+ export declare class Paged<R extends PageLike<unknown>> implements PromiseLike<R>, AsyncIterable<R['data'][number]> {
22
+ #private;
23
+ /** @internal The client makes these; `fetchPage` asks for the page after a cursor, or the first. */
24
+ constructor(fetchPage: (cursor: string | undefined) => Promise<R>);
25
+ then<A = R, B = never>(onFulfilled?: ((page: R) => A | PromiseLike<A>) | null, onRejected?: ((reason: unknown) => B | PromiseLike<B>) | null): Promise<A | B>;
26
+ /** Every page in turn, the first included. */
27
+ pages(): AsyncGenerator<R, void, undefined>;
28
+ /** Every result across the pages, in the API's order. Same as iterating the request itself. */
29
+ all(): AsyncGenerator<R['data'][number], void, undefined>;
30
+ [Symbol.asyncIterator](): AsyncGenerator<R['data'][number], void, undefined>;
31
+ }
32
+ //# sourceMappingURL=paging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paging.d.ts","sourceRoot":"","sources":["../src/paging.ts"],"names":[],"mappings":"AAGA,8CAA8C;AAC9C,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,QAAQ,EAAE;QAAE,IAAI,EAAE;YAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAA;KAAE,CAAA;CACnD;AAED;;;;;;;;;;GAUG;AACH,qBAAa,KAAK,CAAC,CAAC,SAAS,QAAQ,CAAC,OAAO,CAAC,CAAE,YAAW,WAAW,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;;IAIzG,oGAAoG;IACpG,YAAY,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,EAEhE;IAOD,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EACnB,WAAW,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EACtD,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAC5D,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAEhB;IAED,8CAA8C;IACvC,KAAK,IAAI,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAOjD;IAED,+FAA+F;IACxF,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAE/D;IAED,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAE3E;CACF"}
package/dist/paging.js ADDED
@@ -0,0 +1,46 @@
1
+ // A paged list: awaited, it is its first page; iterated, it is every result across the pages,
2
+ // following `metadata.page.next_cursor` until the last.
3
+ /**
4
+ * A request for a paged list. `await` it for the first page, as the API sends it, or iterate
5
+ * it for every result across the pages:
6
+ *
7
+ * ```ts
8
+ * const first = await astro.stars.search({ distance_max: '10 pc' })
9
+ * for await (const star of astro.stars.search({ distance_max: '10 pc' })) { ... }
10
+ * ```
11
+ *
12
+ * Nothing is requested until it is awaited or iterated, and the first page is requested once.
13
+ */
14
+ export class Paged {
15
+ #fetchPage;
16
+ #first;
17
+ /** @internal The client makes these; `fetchPage` asks for the page after a cursor, or the first. */
18
+ constructor(fetchPage) {
19
+ this.#fetchPage = fetchPage;
20
+ }
21
+ #firstPage() {
22
+ this.#first ??= this.#fetchPage(undefined);
23
+ return this.#first;
24
+ }
25
+ then(onFulfilled, onRejected) {
26
+ return this.#firstPage().then(onFulfilled, onRejected);
27
+ }
28
+ /** Every page in turn, the first included. */
29
+ async *pages() {
30
+ let page = await this.#firstPage();
31
+ yield page;
32
+ while (page.metadata.page.next_cursor !== null) {
33
+ page = await this.#fetchPage(page.metadata.page.next_cursor);
34
+ yield page;
35
+ }
36
+ }
37
+ /** Every result across the pages, in the API's order. Same as iterating the request itself. */
38
+ async *all() {
39
+ for await (const page of this.pages())
40
+ yield* page.data;
41
+ }
42
+ [Symbol.asyncIterator]() {
43
+ return this.all();
44
+ }
45
+ }
46
+ //# sourceMappingURL=paging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paging.js","sourceRoot":"","sources":["../src/paging.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,wDAAwD;AAQxD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,KAAK;IACP,UAAU,CAA4C;IAC/D,MAAM,CAAwB;IAE9B,oGAAoG;IACpG,YAAY,SAAqD;QAC/D,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;IAC7B,CAAC;IAED,UAAU;QACR,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,IAAI,CACF,WAAsD,EACtD,UAA6D;QAE7D,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;IACxD,CAAC;IAED,8CAA8C;IAC9C,KAAK,CAAC,CAAC,KAAK;QACV,IAAI,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;QAClC,MAAM,IAAI,CAAA;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;YAC/C,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YAC5D,MAAM,IAAI,CAAA;QACZ,CAAC;IACH,CAAC;IAED,+FAA+F;IAC/F,KAAK,CAAC,CAAC,GAAG;QACR,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YAAE,KAAK,CAAC,CAAC,IAAI,CAAC,IAA2B,CAAA;IAChF,CAAC;IAED,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,GAAG,EAAE,CAAA;IACnB,CAAC;CACF"}
@@ -0,0 +1,122 @@
1
+ import type { Quantity } from '@arcosmos/astronomy';
2
+ import type { Operations, Schemas } from './api.ts';
3
+ import { Client, type ClientOptions, type OperationId, type RequestOptions } from './client.ts';
4
+ import { Paged } from './paging.ts';
5
+ type Query<O extends OperationId> = Operations[O]['query'];
6
+ type Answer<O extends OperationId> = Promise<Operations[O]['response']>;
7
+ type Pages<O extends OperationId> = Operations[O]['response'] extends {
8
+ data: unknown[];
9
+ metadata: {
10
+ page: {
11
+ next_cursor: string | null;
12
+ };
13
+ };
14
+ } ? Paged<Operations[O]['response']> : never;
15
+ /** What `sky.match` takes: the API's body, with the radius also as an angle. */
16
+ export type MatchInput = Omit<Schemas['MatchRequest'], 'radius'> & {
17
+ /** How far from each position to look, at most 60 arcsec: `'2 arcsec'` or `q(2, 'arcsec')`. */
18
+ radius: Schemas['MatchRequest']['radius'] | Quantity<'angle'>;
19
+ };
20
+ /**
21
+ * The Arcosmos API: `new Arcosmos({ apiKey })`, or `new Arcosmos()` to read ARCOSMOS_API_KEY.
22
+ *
23
+ * ```ts
24
+ * const astro = new Arcosmos()
25
+ * const { data } = await astro.objects.get('Proxima Centauri')
26
+ * for await (const star of astro.objects.nearby('Proxima Centauri', { radius: '10 ly' })) { ... }
27
+ * ```
28
+ *
29
+ * Every method returns the API's JSON as it sends it, typed from its OpenAPI document. Lists
30
+ * in pages return a `Paged`: await it for the first page, iterate it for every result.
31
+ */
32
+ export declare class Arcosmos extends Client {
33
+ /** Objects by name, designation or id, and what relates to them: `/objects`. */
34
+ readonly objects: {
35
+ /** An object with its identifiers, relations and every catalog's measurements. `GET /objects/{identifier}` */
36
+ get: (identifier: string, options?: RequestOptions) => Answer<'getObject'>;
37
+ /** The planets an object hosts. `GET /objects/{identifier}/planets` */
38
+ planets: (identifier: string, options?: RequestOptions) => Answer<'listPlanets'>;
39
+ /** Stars within a distance in space of an object, nearest first. `GET /objects/{identifier}/nearby` */
40
+ nearby: (identifier: string, query: Query<'listNearbyStars'>, options?: RequestOptions) => Pages<'listNearbyStars'>;
41
+ /** The distance in space between two stars. `GET /objects/{identifier}/distance/{other}` */
42
+ distance: (identifier: string, other: string, options?: RequestOptions) => Answer<'getDistance'>;
43
+ /** Up to 100 identifiers at once, each with its own status. `POST /objects/resolve` */
44
+ resolve: (body: Schemas['ResolveRequest'], options?: RequestOptions) => Answer<'resolveIdentifiers'>;
45
+ /** The objects filed under an object in SIMBAD's hierarchy. `GET /objects/{identifier}/members` */
46
+ members: (identifier: string, query?: Query<'listMembers'>, options?: RequestOptions) => Pages<'listMembers'>;
47
+ /** The objects an object is filed under in SIMBAD's hierarchy. `GET /objects/{identifier}/parents` */
48
+ parents: (identifier: string, query?: Query<'listParents'>, options?: RequestOptions) => Pages<'listParents'>;
49
+ /** Every published parameter set for a planet or its host. `GET /objects/{identifier}/solutions` */
50
+ solutions: (identifier: string, options?: RequestOptions) => Answer<'listSolutions'>;
51
+ /** A star's whole system: its stars and their planets. `GET /objects/{identifier}/system` */
52
+ system: (identifier: string, options?: RequestOptions) => Answer<'getSystem'>;
53
+ /** Objects within an angle of an object on the sky, nearest first. `GET /objects/{identifier}/cone` */
54
+ cone: (identifier: string, query: Query<'listObjectsAround'>, options?: RequestOptions) => Pages<'listObjectsAround'>;
55
+ /** Every type SIMBAD assigns an object, with where each came from. `GET /objects/{identifier}/classifications` */
56
+ classifications: (identifier: string, options?: RequestOptions) => Answer<'listClassifications'>;
57
+ };
58
+ /** Searches by position: `/sky`. */
59
+ readonly sky: {
60
+ /** Stars within a distance in space of a point, nearest first. `GET /sky/nearby` */
61
+ nearby: (query: Query<'listStarsNearPoint'>, options?: RequestOptions) => Pages<'listStarsNearPoint'>;
62
+ /** Objects within an angle of a point on the sky, nearest first. `GET /sky/cone` */
63
+ cone: (query: Query<'searchCone'>, options?: RequestOptions) => Pages<'searchCone'>;
64
+ /** The objects near each of up to 100 positions, at their epochs. `POST /sky/match` */
65
+ match: (body: MatchInput, options?: RequestOptions) => Answer<'matchPositions'>;
66
+ };
67
+ /** The nearby-stars table and the brightest stars: `/stars`. */
68
+ readonly stars: {
69
+ /** Stars within about 100 pc, filtered and sorted. `GET /stars` */
70
+ search: (query?: Query<'searchStars'>, options?: RequestOptions) => Pages<'searchStars'>;
71
+ /** The Hipparcos stars, brightest first. `GET /stars/bright` */
72
+ bright: (query?: Query<'listBrightStars'>, options?: RequestOptions) => Pages<'listBrightStars'>;
73
+ /**
74
+ * Every row of the nearby-stars table as an Apache Arrow IPC stream, about 25 MB. Read the
75
+ * Response with apache-arrow's `tableFromIPC(response)`. `GET /stars/all`
76
+ */
77
+ all: (options?: RequestOptions) => Promise<Response>;
78
+ };
79
+ /** The NASA Exoplanet Archive's planets: `/exoplanets`. */
80
+ readonly exoplanets: {
81
+ /** Planets filtered by distance, size, mass, orbit and discovery. `GET /exoplanets` */
82
+ search: (query?: Query<'searchExoplanets'>, options?: RequestOptions) => Pages<'searchExoplanets'>;
83
+ };
84
+ /** The catalogs behind every value, their releases and rows: `/catalogs`. */
85
+ readonly catalogs: {
86
+ /** Every catalog, with its release, license and citation. `GET /catalogs` */
87
+ list: (options?: RequestOptions) => Answer<'listCatalogs'>;
88
+ /** One catalog, with its columns' documentation. `GET /catalogs/{id}` */
89
+ get: (id: string, options?: RequestOptions) => Answer<'getCatalog'>;
90
+ /** One row of a catalog, as published. `GET /catalogs/{id}/records/{key}` */
91
+ record: (id: string, key: string, options?: RequestOptions) => Answer<'getCatalogRecord'>;
92
+ /** A catalog's rows within an angle of a point, in sky order. `GET /catalogs/{id}/cone` */
93
+ cone: (id: string, query: Query<'catalogCone'>, options?: RequestOptions) => Pages<'catalogCone'>;
94
+ };
95
+ /** Canonical types and SIMBAD's: `/types`. */
96
+ readonly types: {
97
+ /** Every canonical type and SIMBAD type, with the mapping between them. `GET /types` */
98
+ list: (options?: RequestOptions) => Answer<'listTypes'>;
99
+ /** One SIMBAD type, with its ancestors, subtypes and candidates. `GET /types/{otype}` */
100
+ get: (otype: string, options?: RequestOptions) => Answer<'getType'>;
101
+ };
102
+ /** Name completion: `/names`. */
103
+ readonly names: {
104
+ /** Objects whose names start with what was typed, for a search box. `GET /names` */
105
+ complete: (query: Query<'completeNames'>, options?: RequestOptions) => Answer<'completeNames'>;
106
+ };
107
+ /** The account a key belongs to: `/account`. Not counted toward the quota. */
108
+ readonly account: {
109
+ /** The plan, this month's quota, the keys and 30 days of usage. `GET /account` */
110
+ get: (options?: RequestOptions) => Answer<'getAccount'>;
111
+ };
112
+ /** A key's own usage, and revoking it: `/api-keys`. Keys are created on the website. */
113
+ readonly apiKeys: {
114
+ /** A key with its usage by route. `GET /api-keys/{id}` */
115
+ get: (id: string, options?: RequestOptions) => Answer<'getApiKey'>;
116
+ /** Revokes a key at once. `DELETE /api-keys/{id}` */
117
+ revoke: (id: string, options?: RequestOptions) => Answer<'revokeApiKey'>;
118
+ };
119
+ constructor(options?: ClientOptions);
120
+ }
121
+ export {};
122
+ //# sourceMappingURL=resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAc,KAAK,WAAW,EAAE,KAAK,cAAc,EAAW,MAAM,aAAa,CAAA;AACpH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC,KAAK,KAAK,CAAC,CAAC,SAAS,WAAW,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AAC1D,KAAK,MAAM,CAAC,CAAC,SAAS,WAAW,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;AACvE,KAAK,KAAK,CAAC,CAAC,SAAS,WAAW,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS;IAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAAC,QAAQ,EAAE;QAAE,IAAI,EAAE;YAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,GACzI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAChC,KAAK,CAAA;AAKT,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,GAAG;IACjE,+FAA+F;IAC/F,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;CAC9D,CAAA;AAsBD;;;;;;;;;;;GAWG;AACH,qBAAa,QAAS,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,GAAG,UAAU,MAAM,YAAY,cAAc,KAAG,MAAM,CAAC,SAAS,CAAC;MAClE;IAED,iCAAiC;IACjC,QAAQ,CAAC,KAAK;QACZ,oFAAoF;QACpF,QAAQ,UAAU,KAAK,CAAC,eAAe,CAAC,YAAY,cAAc,KAAG,MAAM,CAAC,eAAe,CAAC;MAE7F;IAED,8EAA8E;IAC9E,QAAQ,CAAC,OAAO;QACd,kFAAkF;QAClF,GAAG,aAAa,cAAc,KAAG,MAAM,CAAC,YAAY,CAAC;MACtD;IAED,wFAAwF;IACxF,QAAQ,CAAC,OAAO;QACd,0DAA0D;QAC1D,GAAG,OAAO,MAAM,YAAY,cAAc,KAAG,MAAM,CAAC,WAAW,CAAC;QAChE,qDAAqD;QACrD,MAAM,OAAO,MAAM,YAAY,cAAc,KAAG,MAAM,CAAC,cAAc,CAAC;MACvE;IAED,YAAY,OAAO,GAAE,aAAkB,EAEtC;CACF"}
@@ -0,0 +1,123 @@
1
+ import { Client, decimal } from './client.js';
2
+ import { Paged } from './paging.js';
3
+ /** The radius units POST /sky/match takes, in its body. */
4
+ const MATCH_RADIUS_UNITS = ['arcsec', 'arcmin', 'deg'];
5
+ function call(client, op, input, options) {
6
+ return client.request(op, input, options);
7
+ }
8
+ function paged(client, op, path, query, options) {
9
+ return new Paged((cursor) => call(client, op, { path, query: cursor === undefined ? query : { ...query, cursor } }, options));
10
+ }
11
+ function angleText(radius) {
12
+ if (typeof radius === 'string')
13
+ return radius;
14
+ if (radius.uncertainty || radius.limit)
15
+ throw new TypeError('radius is a bound: give it without an uncertainty or limit');
16
+ const unit = radius.unit.toString();
17
+ const known = MATCH_RADIUS_UNITS.includes(unit);
18
+ return `${decimal(known ? radius.value : radius.valueIn('arcsec'))} ${known ? unit : 'arcsec'}`;
19
+ }
20
+ /**
21
+ * The Arcosmos API: `new Arcosmos({ apiKey })`, or `new Arcosmos()` to read ARCOSMOS_API_KEY.
22
+ *
23
+ * ```ts
24
+ * const astro = new Arcosmos()
25
+ * const { data } = await astro.objects.get('Proxima Centauri')
26
+ * for await (const star of astro.objects.nearby('Proxima Centauri', { radius: '10 ly' })) { ... }
27
+ * ```
28
+ *
29
+ * Every method returns the API's JSON as it sends it, typed from its OpenAPI document. Lists
30
+ * in pages return a `Paged`: await it for the first page, iterate it for every result.
31
+ */
32
+ export class Arcosmos extends Client {
33
+ /** Objects by name, designation or id, and what relates to them: `/objects`. */
34
+ objects = {
35
+ /** An object with its identifiers, relations and every catalog's measurements. `GET /objects/{identifier}` */
36
+ get: (identifier, options) => call(this, 'getObject', { path: { identifier } }, options),
37
+ /** The planets an object hosts. `GET /objects/{identifier}/planets` */
38
+ planets: (identifier, options) => call(this, 'listPlanets', { path: { identifier } }, options),
39
+ /** Stars within a distance in space of an object, nearest first. `GET /objects/{identifier}/nearby` */
40
+ nearby: (identifier, query, options) => paged(this, 'listNearbyStars', { identifier }, query, options),
41
+ /** The distance in space between two stars. `GET /objects/{identifier}/distance/{other}` */
42
+ distance: (identifier, other, options) => call(this, 'getDistance', { path: { identifier, other } }, options),
43
+ /** Up to 100 identifiers at once, each with its own status. `POST /objects/resolve` */
44
+ resolve: (body, options) => call(this, 'resolveIdentifiers', { body }, options),
45
+ /** The objects filed under an object in SIMBAD's hierarchy. `GET /objects/{identifier}/members` */
46
+ members: (identifier, query = {}, options) => paged(this, 'listMembers', { identifier }, query, options),
47
+ /** The objects an object is filed under in SIMBAD's hierarchy. `GET /objects/{identifier}/parents` */
48
+ parents: (identifier, query = {}, options) => paged(this, 'listParents', { identifier }, query, options),
49
+ /** Every published parameter set for a planet or its host. `GET /objects/{identifier}/solutions` */
50
+ solutions: (identifier, options) => call(this, 'listSolutions', { path: { identifier } }, options),
51
+ /** A star's whole system: its stars and their planets. `GET /objects/{identifier}/system` */
52
+ system: (identifier, options) => call(this, 'getSystem', { path: { identifier } }, options),
53
+ /** Objects within an angle of an object on the sky, nearest first. `GET /objects/{identifier}/cone` */
54
+ cone: (identifier, query, options) => paged(this, 'listObjectsAround', { identifier }, query, options),
55
+ /** Every type SIMBAD assigns an object, with where each came from. `GET /objects/{identifier}/classifications` */
56
+ classifications: (identifier, options) => call(this, 'listClassifications', { path: { identifier } }, options),
57
+ };
58
+ /** Searches by position: `/sky`. */
59
+ sky = {
60
+ /** Stars within a distance in space of a point, nearest first. `GET /sky/nearby` */
61
+ nearby: (query, options) => paged(this, 'listStarsNearPoint', undefined, query, options),
62
+ /** Objects within an angle of a point on the sky, nearest first. `GET /sky/cone` */
63
+ cone: (query, options) => paged(this, 'searchCone', undefined, query, options),
64
+ /** The objects near each of up to 100 positions, at their epochs. `POST /sky/match` */
65
+ match: (body, options) => call(this, 'matchPositions', { body: { ...body, radius: angleText(body.radius) } }, options),
66
+ };
67
+ /** The nearby-stars table and the brightest stars: `/stars`. */
68
+ stars = {
69
+ /** Stars within about 100 pc, filtered and sorted. `GET /stars` */
70
+ search: (query = {}, options) => paged(this, 'searchStars', undefined, query, options),
71
+ /** The Hipparcos stars, brightest first. `GET /stars/bright` */
72
+ bright: (query = {}, options) => paged(this, 'listBrightStars', undefined, query, options),
73
+ /**
74
+ * Every row of the nearby-stars table as an Apache Arrow IPC stream, about 25 MB. Read the
75
+ * Response with apache-arrow's `tableFromIPC(response)`. `GET /stars/all`
76
+ */
77
+ all: (options) => this.request('allStars', {}, options),
78
+ };
79
+ /** The NASA Exoplanet Archive's planets: `/exoplanets`. */
80
+ exoplanets = {
81
+ /** Planets filtered by distance, size, mass, orbit and discovery. `GET /exoplanets` */
82
+ search: (query = {}, options) => paged(this, 'searchExoplanets', undefined, query, options),
83
+ };
84
+ /** The catalogs behind every value, their releases and rows: `/catalogs`. */
85
+ catalogs = {
86
+ /** Every catalog, with its release, license and citation. `GET /catalogs` */
87
+ list: (options) => call(this, 'listCatalogs', {}, options),
88
+ /** One catalog, with its columns' documentation. `GET /catalogs/{id}` */
89
+ get: (id, options) => call(this, 'getCatalog', { path: { id } }, options),
90
+ /** One row of a catalog, as published. `GET /catalogs/{id}/records/{key}` */
91
+ record: (id, key, options) => call(this, 'getCatalogRecord', { path: { id, key } }, options),
92
+ /** A catalog's rows within an angle of a point, in sky order. `GET /catalogs/{id}/cone` */
93
+ cone: (id, query, options) => paged(this, 'catalogCone', { id }, query, options),
94
+ };
95
+ /** Canonical types and SIMBAD's: `/types`. */
96
+ types = {
97
+ /** Every canonical type and SIMBAD type, with the mapping between them. `GET /types` */
98
+ list: (options) => call(this, 'listTypes', {}, options),
99
+ /** One SIMBAD type, with its ancestors, subtypes and candidates. `GET /types/{otype}` */
100
+ get: (otype, options) => call(this, 'getType', { path: { otype } }, options),
101
+ };
102
+ /** Name completion: `/names`. */
103
+ names = {
104
+ /** Objects whose names start with what was typed, for a search box. `GET /names` */
105
+ complete: (query, options) => call(this, 'completeNames', { query }, options),
106
+ };
107
+ /** The account a key belongs to: `/account`. Not counted toward the quota. */
108
+ account = {
109
+ /** The plan, this month's quota, the keys and 30 days of usage. `GET /account` */
110
+ get: (options) => call(this, 'getAccount', {}, options),
111
+ };
112
+ /** A key's own usage, and revoking it: `/api-keys`. Keys are created on the website. */
113
+ apiKeys = {
114
+ /** A key with its usage by route. `GET /api-keys/{id}` */
115
+ get: (id, options) => call(this, 'getApiKey', { path: { id } }, options),
116
+ /** Revokes a key at once. `DELETE /api-keys/{id}` */
117
+ revoke: (id, options) => call(this, 'revokeApiKey', { path: { id } }, options),
118
+ };
119
+ constructor(options = {}) {
120
+ super(options);
121
+ }
122
+ }
123
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAyE,OAAO,EAAE,MAAM,aAAa,CAAA;AACpH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAQnC,2DAA2D;AAC3D,MAAM,kBAAkB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAA;AAQ/D,SAAS,IAAI,CACX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E,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC;KAChI,CAAA;IAED,YAAY,OAAO,GAAkB,EAAE;QACrC,KAAK,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,49 @@
1
1
  {
2
2
  "name": "@arcosmos/sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "The Arcosmos API client for TypeScript: objects, stars, exoplanets, catalogs and the sky, typed from the API's own OpenAPI document.",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Arcvos/arcosmos.git",
9
+ "directory": "packages/sdk"
10
+ },
11
+ "homepage": "https://github.com/Arcvos/arcosmos/tree/master/packages/sdk#readme",
12
+ "bugs": "https://github.com/Arcvos/arcosmos/issues",
13
+ "keywords": [
14
+ "astronomy",
15
+ "api",
16
+ "sdk",
17
+ "stars",
18
+ "exoplanets",
19
+ "gaia",
20
+ "simbad",
21
+ "catalogs"
22
+ ],
23
+ "type": "module",
24
+ "sideEffects": false,
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "default": "./dist/index.js"
29
+ }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "src"
34
+ ],
35
+ "dependencies": {
36
+ "@arcosmos/astronomy": "^0.1.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^22.10.2",
40
+ "typescript": "^7.0.2",
41
+ "vitest": "4.1.12"
42
+ },
43
+ "scripts": {
44
+ "build": "tsc -p tsconfig.build.json",
45
+ "typecheck": "tsc --noEmit -p .",
46
+ "test": "vitest run",
47
+ "generate": "node --experimental-transform-types --disable-warning=ExperimentalWarning scripts/generate.ts"
48
+ }
6
49
  }