rocket-launch-live-client 1.0.4 → 2.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.
Files changed (42) hide show
  1. package/README.md +105 -61
  2. package/lib/{esm/types/Client.d.ts → Client.d.ts} +6 -8
  3. package/lib/Client.js +61 -0
  4. package/lib/fetcher.d.ts +5 -0
  5. package/lib/fetcher.js +146 -0
  6. package/lib/{cjs/types/index.d.ts → index.d.ts} +0 -1
  7. package/lib/index.js +4 -0
  8. package/lib/{cjs/types/types → types}/application.d.ts +41 -27
  9. package/lib/types/application.js +41 -0
  10. package/lib/types/standards.d.ts +8 -0
  11. package/lib/types/standards.js +314 -0
  12. package/lib/{cjs/types/utils.d.ts → utils.d.ts} +1 -4
  13. package/lib/{esm/utils.js → utils.js} +18 -4
  14. package/lib/{cjs/types → watcher}/Watcher.d.ts +16 -12
  15. package/lib/watcher/Watcher.js +145 -0
  16. package/lib/watcher/index.d.ts +25 -0
  17. package/lib/watcher/index.js +3 -0
  18. package/package.json +30 -27
  19. package/lib/cjs/Client.js +0 -233
  20. package/lib/cjs/Watcher.js +0 -172
  21. package/lib/cjs/fetcher.js +0 -61
  22. package/lib/cjs/index.js +0 -30
  23. package/lib/cjs/package.json +0 -3
  24. package/lib/cjs/types/Client.d.ts +0 -189
  25. package/lib/cjs/types/application.js +0 -46
  26. package/lib/cjs/types/fetcher.d.ts +0 -2
  27. package/lib/cjs/types/standards.js +0 -321
  28. package/lib/cjs/types/types/standards.d.ts +0 -316
  29. package/lib/cjs/utils.js +0 -266
  30. package/lib/esm/Client.js +0 -229
  31. package/lib/esm/Watcher.js +0 -168
  32. package/lib/esm/fetcher.js +0 -54
  33. package/lib/esm/index.mjs +0 -22
  34. package/lib/esm/package.json +0 -3
  35. package/lib/esm/types/Watcher.d.ts +0 -81
  36. package/lib/esm/types/application.js +0 -43
  37. package/lib/esm/types/fetcher.d.ts +0 -2
  38. package/lib/esm/types/index.d.ts +0 -24
  39. package/lib/esm/types/standards.js +0 -316
  40. package/lib/esm/types/types/application.d.ts +0 -206
  41. package/lib/esm/types/types/standards.d.ts +0 -316
  42. package/lib/esm/types/utils.d.ts +0 -12
@@ -1,316 +0,0 @@
1
- export const countryCodes = {
2
- AF: "AF",
3
- AL: "AL",
4
- DZ: "DZ",
5
- AS: "AS",
6
- AD: "AD",
7
- AO: "AO",
8
- AI: "AI",
9
- AQ: "AQ",
10
- AG: "AG",
11
- AR: "AR",
12
- AM: "AM",
13
- AW: "AW",
14
- AU: "AU",
15
- AT: "AT",
16
- AZ: "AZ",
17
- BS: "BS",
18
- BH: "BH",
19
- BD: "BD",
20
- BB: "BB",
21
- BY: "BY",
22
- BE: "BE",
23
- BZ: "BZ",
24
- BJ: "BJ",
25
- BM: "BM",
26
- BT: "BT",
27
- BO: "BO",
28
- BQ: "BQ",
29
- BA: "BA",
30
- BW: "BW",
31
- BV: "BV",
32
- BR: "BR",
33
- IO: "IO",
34
- BN: "BN",
35
- BG: "BG",
36
- BF: "BF",
37
- BI: "BI",
38
- CV: "CV",
39
- KH: "KH",
40
- CM: "CM",
41
- CA: "CA",
42
- KY: "KY",
43
- CF: "CF",
44
- TD: "TD",
45
- CL: "CL",
46
- CN: "CN",
47
- CX: "CX",
48
- CC: "CC",
49
- CO: "CO",
50
- KM: "KM",
51
- CD: "CD",
52
- CG: "CG",
53
- CK: "CK",
54
- CR: "CR",
55
- HR: "HR",
56
- CU: "CU",
57
- CW: "CW",
58
- CY: "CY",
59
- CZ: "CZ",
60
- CI: "CI",
61
- DK: "DK",
62
- DJ: "DJ",
63
- DM: "DM",
64
- DO: "DO",
65
- EC: "EC",
66
- EG: "EG",
67
- SV: "SV",
68
- GQ: "GQ",
69
- ER: "ER",
70
- EE: "EE",
71
- SZ: "SZ",
72
- ET: "ET",
73
- FK: "FK",
74
- FO: "FO",
75
- FJ: "FJ",
76
- FI: "FI",
77
- FR: "FR",
78
- GF: "GF",
79
- PF: "PF",
80
- TF: "TF",
81
- GA: "GA",
82
- GM: "GM",
83
- GE: "GE",
84
- DE: "DE",
85
- GH: "GH",
86
- GI: "GI",
87
- GR: "GR",
88
- GL: "GL",
89
- GD: "GD",
90
- GP: "GP",
91
- GU: "GU",
92
- GT: "GT",
93
- GG: "GG",
94
- GN: "GN",
95
- GW: "GW",
96
- GY: "GY",
97
- HT: "HT",
98
- HM: "HM",
99
- VA: "VA",
100
- HN: "HN",
101
- HK: "HK",
102
- HU: "HU",
103
- IS: "IS",
104
- IN: "IN",
105
- ID: "ID",
106
- IR: "IR",
107
- IQ: "IQ",
108
- IE: "IE",
109
- IM: "IM",
110
- IL: "IL",
111
- IT: "IT",
112
- JM: "JM",
113
- JP: "JP",
114
- JE: "JE",
115
- JO: "JO",
116
- KZ: "KZ",
117
- KE: "KE",
118
- KI: "KI",
119
- KP: "KP",
120
- KR: "KR",
121
- KW: "KW",
122
- KG: "KG",
123
- LA: "LA",
124
- LV: "LV",
125
- LB: "LB",
126
- LS: "LS",
127
- LR: "LR",
128
- LY: "LY",
129
- LI: "LI",
130
- LT: "LT",
131
- LU: "LU",
132
- MO: "MO",
133
- MG: "MG",
134
- MW: "MW",
135
- MY: "MY",
136
- MV: "MV",
137
- ML: "ML",
138
- MT: "MT",
139
- MH: "MH",
140
- MQ: "MQ",
141
- MR: "MR",
142
- MU: "MU",
143
- YT: "YT",
144
- MX: "MX",
145
- FM: "FM",
146
- MD: "MD",
147
- MC: "MC",
148
- MN: "MN",
149
- ME: "ME",
150
- MS: "MS",
151
- MA: "MA",
152
- MZ: "MZ",
153
- MM: "MM",
154
- NA: "NA",
155
- NR: "NR",
156
- NP: "NP",
157
- NL: "NL",
158
- NC: "NC",
159
- NZ: "NZ",
160
- NI: "NI",
161
- NE: "NE",
162
- NG: "NG",
163
- NU: "NU",
164
- NF: "NF",
165
- MP: "MP",
166
- NO: "NO",
167
- OM: "OM",
168
- PK: "PK",
169
- PW: "PW",
170
- PS: "PS",
171
- PA: "PA",
172
- PG: "PG",
173
- PY: "PY",
174
- PE: "PE",
175
- PH: "PH",
176
- PN: "PN",
177
- PL: "PL",
178
- PT: "PT",
179
- PR: "PR",
180
- QA: "QA",
181
- MK: "MK",
182
- RO: "RO",
183
- RU: "RU",
184
- RW: "RW",
185
- RE: "RE",
186
- BL: "BL",
187
- SH: "SH",
188
- KN: "KN",
189
- LC: "LC",
190
- MF: "MF",
191
- PM: "PM",
192
- VC: "VC",
193
- WS: "WS",
194
- SM: "SM",
195
- ST: "ST",
196
- SA: "SA",
197
- SN: "SN",
198
- RS: "RS",
199
- SC: "SC",
200
- SL: "SL",
201
- SG: "SG",
202
- SX: "SX",
203
- SK: "SK",
204
- SI: "SI",
205
- SB: "SB",
206
- SO: "SO",
207
- ZA: "ZA",
208
- GS: "GS",
209
- SS: "SS",
210
- ES: "ES",
211
- LK: "LK",
212
- SD: "SD",
213
- SR: "SR",
214
- SJ: "SJ",
215
- SE: "SE",
216
- CH: "CH",
217
- SY: "SY",
218
- TW: "TW",
219
- TJ: "TJ",
220
- TZ: "TZ",
221
- TH: "TH",
222
- TL: "TL",
223
- TG: "TG",
224
- TK: "TK",
225
- TO: "TO",
226
- TT: "TT",
227
- TN: "TN",
228
- TR: "TR",
229
- TM: "TM",
230
- TC: "TC",
231
- TV: "TV",
232
- UG: "UG",
233
- UA: "UA",
234
- AE: "AE",
235
- GB: "GB",
236
- UM: "UM",
237
- US: "US",
238
- UY: "UY",
239
- UZ: "UZ",
240
- VU: "VU",
241
- VE: "VE",
242
- VN: "VN",
243
- VG: "VG",
244
- VI: "VI",
245
- WF: "WF",
246
- EH: "EH",
247
- YE: "YE",
248
- ZM: "ZM",
249
- ZW: "ZW",
250
- AX: "AX",
251
- };
252
- export const usStateCodes = {
253
- AL: "AL",
254
- AK: "AK",
255
- AZ: "AZ",
256
- AR: "AR",
257
- CA: "CA",
258
- CO: "CO",
259
- CT: "CT",
260
- DE: "DE",
261
- FL: "FL",
262
- GA: "GA",
263
- HI: "HI",
264
- ID: "ID",
265
- IL: "IL",
266
- IN: "IN",
267
- IA: "IA",
268
- KS: "KS",
269
- KY: "KY",
270
- LA: "LA",
271
- ME: "ME",
272
- MD: "MD",
273
- MA: "MA",
274
- MI: "MI",
275
- MN: "MN",
276
- MS: "MS",
277
- MO: "MO",
278
- MT: "MT",
279
- NE: "NE",
280
- NV: "NV",
281
- NH: "NH",
282
- NJ: "NJ",
283
- NM: "NM",
284
- NY: "NY",
285
- NC: "NC",
286
- ND: "ND",
287
- OH: "OH",
288
- OK: "OK",
289
- OR: "OR",
290
- PA: "PA",
291
- RI: "RI",
292
- SC: "SC",
293
- SD: "SD",
294
- TN: "TN",
295
- TX: "TX",
296
- UT: "UT",
297
- VT: "VT",
298
- VA: "VA",
299
- WA: "WA",
300
- WV: "WV",
301
- WI: "WI",
302
- WY: "WY",
303
- DC: "DC",
304
- AS: "AS",
305
- GU: "GU",
306
- MP: "MP",
307
- PR: "PR",
308
- UM: "UM",
309
- VI: "VI",
310
- };
311
- export const isValidCountryCode = (code) => {
312
- return !!countryCodes[code];
313
- };
314
- export const isValidStateCode = (code) => {
315
- return !!usStateCodes[code];
316
- };
@@ -1,206 +0,0 @@
1
- import { ISO3166Alpha2 } from "./standards.js";
2
- export declare enum RLLEndPoint {
3
- COMPANIES = "companies",
4
- LAUNCHES = "launches",
5
- LOCATIONS = "locations",
6
- MISSIONS = "missions",
7
- PADS = "pads",
8
- TAGS = "tags",
9
- VEHICLES = "vehicles"
10
- }
11
- export declare namespace RLLEntity {
12
- interface RLLRecord {
13
- id: number;
14
- }
15
- export interface Country {
16
- name: string;
17
- code: ISO3166Alpha2.CountryCode | "";
18
- }
19
- export interface State {
20
- name: string;
21
- abbr?: ISO3166Alpha2.StateCodeUS;
22
- }
23
- export interface Company extends RLLRecord {
24
- name: string;
25
- country: Country;
26
- inactive: boolean;
27
- }
28
- export enum LaunchResult {
29
- NOT_SET = -1,
30
- FAILURE = 0,
31
- SUCCESS = 1,
32
- PARTIAL_FAILURE = 2,
33
- IN_FLIGHT_ABORT_CREWED = 3
34
- }
35
- export interface Media extends RLLRecord {
36
- media_url: string | null;
37
- youtube_vidid: string | null;
38
- featured: boolean;
39
- ldfeatured: boolean;
40
- approved: boolean;
41
- }
42
- export interface Launch extends RLLRecord {
43
- name: string;
44
- cospar_id: string | null;
45
- sort_date: string;
46
- provider: {
47
- slug: string;
48
- } & Omit<Company, "inactive" | "country">;
49
- vehicle: {
50
- company_id: number;
51
- slug: string;
52
- } & Omit<Vehicle, "company">;
53
- pad: Omit<Pad, "full_name" | "location"> & {
54
- location: Omit<Location, "pads" | "utc_offset" | "latitute" | "latitude" | "longitude" | "country" | "state"> & {
55
- slug: string;
56
- country: string;
57
- state: ISO3166Alpha2.StateCodeUS | null;
58
- };
59
- };
60
- missions: Omit<Mission, "launch_id" | "company">[];
61
- mission_description: string | null;
62
- launch_description: string;
63
- win_open: string | null;
64
- t0: string | null;
65
- win_close: string | null;
66
- est_date: {
67
- month: number | null;
68
- day: number | null;
69
- year: number | null;
70
- quarter: number | null;
71
- };
72
- date_str: string;
73
- tags: Omit<Tag, "slug">[];
74
- slug: string;
75
- weather_summary: string | null;
76
- weather_condition: string | null;
77
- weather_wind_mph: number | null;
78
- weather_temp: number | null;
79
- weather_icon: string | null;
80
- weather_updated: string | null;
81
- quicktext: string;
82
- media?: Media[];
83
- result: LaunchResult | null;
84
- suborbital: boolean;
85
- modified: string;
86
- }
87
- export interface Location extends RLLRecord {
88
- name: string;
89
- latitute: string;
90
- latitude: string;
91
- longitude: string;
92
- state: State | null;
93
- statename?: string | null;
94
- country: Country | null;
95
- pads: Omit<Pad, "full_name" | "location" | "country" | "state">[];
96
- utc_offset: number | null;
97
- }
98
- export interface Mission extends RLLRecord {
99
- name: string;
100
- description: string | null;
101
- launch_id: number;
102
- company: Omit<Company, "inactive" | "country">;
103
- }
104
- export interface Pad extends RLLRecord {
105
- name: string;
106
- full_name: string;
107
- location: Omit<Location, "pads" | "utc_offset" | "latitute" | "statename">;
108
- }
109
- export interface Tag extends RLLRecord {
110
- text: string;
111
- slug: string;
112
- }
113
- export interface Vehicle extends RLLRecord {
114
- name: string;
115
- company: Omit<Company, "inactive" | "country">;
116
- }
117
- export {};
118
- }
119
- export declare const RLLQueryParams: {
120
- id: boolean;
121
- page: boolean;
122
- name: boolean;
123
- country_code: boolean;
124
- inactive: boolean;
125
- cospar_id: boolean;
126
- after_date: boolean;
127
- before_date: boolean;
128
- modified_since: boolean;
129
- location_id: boolean;
130
- pad_id: boolean;
131
- provider_id: boolean;
132
- tag_id: boolean;
133
- vehicle_id: boolean;
134
- state_abbr: boolean;
135
- search: boolean;
136
- slug: boolean;
137
- text: boolean;
138
- limit: boolean;
139
- direction: boolean;
140
- };
141
- export declare namespace RLLQueryConfig {
142
- interface Base {
143
- id?: number | string;
144
- page?: number | string;
145
- }
146
- export interface Companies extends Base {
147
- name?: string | number;
148
- country_code?: ISO3166Alpha2.CountryCode;
149
- inactive?: boolean;
150
- }
151
- export interface Launches extends Base {
152
- cospar_id?: string;
153
- after_date?: Date | string;
154
- before_date?: Date | string;
155
- modified_since?: Date | string;
156
- location_id?: number | string;
157
- pad_id?: number | string;
158
- provider_id?: number | string;
159
- tag_id?: number | string;
160
- vehicle_id?: number | string;
161
- state_abbr?: ISO3166Alpha2.StateCodeUS;
162
- country_code?: ISO3166Alpha2.CountryCode;
163
- search?: string | number;
164
- slug?: string | number;
165
- limit?: number | string;
166
- direction?: "asc" | "desc";
167
- }
168
- export interface Locations extends Base {
169
- name?: string | number;
170
- state_abbr?: ISO3166Alpha2.StateCodeUS;
171
- country_code?: ISO3166Alpha2.CountryCode;
172
- }
173
- export interface Missions extends Base {
174
- name?: string | number;
175
- }
176
- export interface Pads extends Base {
177
- name?: string | number;
178
- state_abbr?: ISO3166Alpha2.StateCodeUS;
179
- country_code?: ISO3166Alpha2.CountryCode;
180
- }
181
- export interface Tags extends Base {
182
- text?: string | number;
183
- }
184
- export interface Vehicles extends Base {
185
- name?: string | number;
186
- }
187
- export {};
188
- }
189
- export type RLLClientOptions = {
190
- keyInQueryParams?: boolean;
191
- };
192
- export type RLLResponse<T> = {
193
- errors?: string[];
194
- valid_auth: boolean;
195
- count: number;
196
- limit: number;
197
- total: number;
198
- last_page: number;
199
- result: T;
200
- };
201
- export type RLLError = {
202
- error: string;
203
- statusCode: number | null;
204
- message: string;
205
- server_response: string | null;
206
- };