@rawcast/sdk 0.1.0 → 0.1.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/README.md CHANGED
@@ -15,6 +15,7 @@ Resolves high-speed adaptive HLS/DASH video streams, multi-language WebVTT subti
15
15
 
16
16
  - **Zero Runtime Dependencies**: Powered entirely by the standard Web Fetch API (`fetch`, `Headers`, `AbortController`). Runs anywhere (Node 18+, Bun, Deno, Cloudflare Workers, Next.js, Fastly Compute).
17
17
  - **Dual ESM & CommonJS**: Full first-class support for `import` and `require()`.
18
+ - **High Availability & Auto-Failover**: Seamlessly fails over to backup mirrors or queries an out-of-band remote discovery manifest (GitHub Gist) if the primary domain is unreachable, ensuring uninterrupted playback even during domain migrations or DNS outages.
18
19
  - **Smart Stream Selection**: Built-in `.bestStream()` ranking engine automatically picks optimal CDN manifests based on format (HLS/DASH/MP4), resolution, and audio track.
19
20
  - **Direct MP4 Downloads**: 1-click download links with RFC 6266 `Content-Disposition` attachment headers across 4 video qualities.
20
21
  - **Live Quota Tracking**: Real-time snapshot of remaining monthly developer quota and rate-limit reset windows via `client.quota`.
@@ -64,6 +65,35 @@ console.log('Remaining Monthly Quota:', rawcast.quota.remaining);
64
65
 
65
66
  ---
66
67
 
68
+ ## 🌐 High Availability & Out-of-Band Discovery
69
+
70
+ The Rawcast SDK features a **self-healing transport layer**. If the primary API domain suffers a DNS outage, the client automatically:
71
+ 1. Retries the request against warm standby mirrors (`fallbackUrls`).
72
+ 2. If all local mirrors are unreachable, it automatically queries an out-of-band remote discovery manifest hosted on GitHub Gist to discover active mirrors.
73
+ 3. Automatically updates its internal base URL so subsequent calls go straight to the working mirror without application restarts or code updates.
74
+
75
+ ```typescript
76
+ const rawcast = new Rawcast({
77
+ apiKey: 'rc_live_your_api_key',
78
+ // Primary endpoint:
79
+ baseUrl: 'https://api.rawcast.space/v1',
80
+ // Standby mirrors:
81
+ fallbackUrls: ['https://zeroms.space/v1'],
82
+ // Auto-failover enabled by default:
83
+ autoFailover: true,
84
+ });
85
+
86
+ // Check which endpoint is currently answering requests:
87
+ console.log(rawcast.baseUrl);
88
+
89
+ // Proactively inspect the remote discovery manifest:
90
+ const manifest = await rawcast.discoverEndpoints();
91
+ console.log('Active primary:', manifest?.primary);
92
+ console.log('Active mirrors:', manifest?.mirrors);
93
+ ```
94
+
95
+ ---
96
+
67
97
  ## 📖 Usage Guide
68
98
 
69
99
  ### 1. Resolving Movie Streams
@@ -258,19 +288,28 @@ try {
258
288
  ---
259
289
 
260
290
  ## ⚙️ Client Options
261
-
291
+
262
292
  ```typescript
263
293
  interface RawcastOptions {
264
294
  /** Your Rawcast API key (starts with rc_live_) */
265
295
  apiKey: string;
266
296
 
267
- /** API Base URL (defaults to https://zeroms.space/v1) */
297
+ /** API Base URL (defaults to https://api.rawcast.space/v1) */
268
298
  baseUrl?: string;
269
299
 
300
+ /** Standby mirror base URLs to try on connection failure (defaults to ["https://zeroms.space/v1"]) */
301
+ fallbackUrls?: string[];
302
+
303
+ /** Out-of-band remote discovery endpoint URL (defaults to official Rawcast GitHub Gist) */
304
+ discoveryUrl?: string;
305
+
306
+ /** Whether to automatically failover to fallback mirrors or query discovery (defaults to true) */
307
+ autoFailover?: boolean;
308
+
270
309
  /** Request timeout in milliseconds (defaults to 25000) */
271
310
  timeoutMs?: number;
272
311
 
273
- /** Maximum retries on 429 or 502/503/504 errors (defaults to 2) */
312
+ /** Maximum retries on 429 or 502/503/504 errors per endpoint (defaults to 2) */
274
313
  maxRetries?: number;
275
314
 
276
315
  /** Custom fetch implementation for proxies or test mocks */
package/dist/client.d.ts CHANGED
@@ -4,7 +4,7 @@ import { MoviesResource } from './resources/movies';
4
4
  import { ResolveResource } from './resources/resolve';
5
5
  import { SubtitlesResource } from './resources/subtitles';
6
6
  import { TvResource } from './resources/tv';
7
- import type { QuotaState, RawcastOptions } from './types';
7
+ import type { QuotaState, RawcastEndpointsManifest, RawcastOptions } from './types';
8
8
  /**
9
9
  * Main Rawcast SDK client entry point.
10
10
  *
@@ -36,6 +36,19 @@ export declare class Rawcast {
36
36
  readonly resolve: ResolveResource;
37
37
  readonly health: HealthResource;
38
38
  constructor(optionsOrApiKey?: string | RawcastOptions);
39
+ /**
40
+ * The currently active API base URL (updates dynamically on failover).
41
+ */
42
+ get baseUrl(): string;
43
+ /**
44
+ * Manually override the active API base URL at runtime.
45
+ */
46
+ setBaseUrl(url: string): void;
47
+ /**
48
+ * Proactively queries the out-of-band remote discovery manifest (GitHub Gist)
49
+ * to check current endpoint statuses and mirrors.
50
+ */
51
+ discoverEndpoints(): Promise<RawcastEndpointsManifest | null>;
39
52
  /**
40
53
  * Current rate-limit and monthly credit quota snapshot,
41
54
  * updated automatically after every API response.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAE1C,SAAgB,MAAM,EAAE,cAAc,CAAC;IACvC,SAAgB,EAAE,EAAE,UAAU,CAAC;IAC/B,SAAgB,SAAS,EAAE,iBAAiB,CAAC;IAC7C,SAAgB,QAAQ,EAAE,gBAAgB,CAAC;IAC3C,+BAA+B;IAC/B,SAAgB,IAAI,EAAE,gBAAgB,CAAC;IACv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AO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAI1E;;;OAGG;IACH,IAAW,KAAK,IAAI,QAAQ,CAAC,UAAU,CAAC,CAEvC;CACF"}
package/dist/index.cjs CHANGED
@@ -464,12 +464,21 @@ class TvResource {
464
464
  }
465
465
 
466
466
  // src/transport.ts
467
+ var DEFAULT_BASE_URL = "https://api.rawcast.space/v1";
468
+ var DEFAULT_FALLBACK_URLS = ["https://zeroms.space/v1"];
469
+ var DEFAULT_DISCOVERY_URL = "https://gist.githubusercontent.com/c1ph3rhunt3r/8e11bc9b749378b140616d89157a5a6c/raw/rawcast-endpoints.json";
470
+
467
471
  class HttpTransport {
468
- baseUrl;
472
+ currentBaseUrl;
473
+ fallbackUrls;
474
+ discoveryUrl;
475
+ autoFailover;
469
476
  apiKey;
470
477
  timeoutMs;
471
478
  maxRetries;
472
479
  fetchFn;
480
+ discoveredManifest = null;
481
+ discoveryPromise = null;
473
482
  quota = {
474
483
  limit: null,
475
484
  remaining: null,
@@ -481,7 +490,16 @@ class HttpTransport {
481
490
  throw new RawcastAuthenticationError("Rawcast API key is required. Pass apiKey or set process.env.RAWCAST_API_KEY.");
482
491
  }
483
492
  this.apiKey = options.apiKey.trim();
484
- this.baseUrl = (options.baseUrl || "https://zeroms.space/v1").replace(/\/+$/, "");
493
+ this.currentBaseUrl = (options.baseUrl || DEFAULT_BASE_URL).replace(/\/+$/, "");
494
+ if (options.fallbackUrls) {
495
+ this.fallbackUrls = options.fallbackUrls.map((u) => u.replace(/\/+$/, ""));
496
+ } else if (options.baseUrl) {
497
+ this.fallbackUrls = [];
498
+ } else {
499
+ this.fallbackUrls = [...DEFAULT_FALLBACK_URLS];
500
+ }
501
+ this.discoveryUrl = options.discoveryUrl || DEFAULT_DISCOVERY_URL;
502
+ this.autoFailover = options.autoFailover ?? true;
485
503
  this.timeoutMs = options.timeoutMs ?? 25000;
486
504
  this.maxRetries = Math.max(0, options.maxRetries ?? 2);
487
505
  this.fetchFn = options.fetch ?? globalThis.fetch;
@@ -489,6 +507,75 @@ class HttpTransport {
489
507
  throw new RawcastError("Global fetch is not available. Please provide a custom fetch implementation or upgrade Node/runtime.");
490
508
  }
491
509
  }
510
+ get baseUrl() {
511
+ return this.currentBaseUrl;
512
+ }
513
+ getBaseUrl() {
514
+ return this.currentBaseUrl;
515
+ }
516
+ setBaseUrl(url) {
517
+ this.currentBaseUrl = url.replace(/\/+$/, "");
518
+ }
519
+ getApiKey() {
520
+ return this.apiKey;
521
+ }
522
+ getFetch() {
523
+ return this.fetchFn;
524
+ }
525
+ async discoverEndpoints() {
526
+ if (this.discoveredManifest)
527
+ return this.discoveredManifest;
528
+ if (this.discoveryPromise)
529
+ return this.discoveryPromise;
530
+ this.discoveryPromise = (async () => {
531
+ try {
532
+ const controller = new AbortController;
533
+ const timer = setTimeout(() => controller.abort(), 6000);
534
+ const res = await this.fetchFn(this.discoveryUrl, {
535
+ method: "GET",
536
+ headers: { Accept: "application/json, text/plain, */*" },
537
+ signal: controller.signal
538
+ });
539
+ clearTimeout(timer);
540
+ if (res.ok) {
541
+ const data = await res.json();
542
+ if (data && typeof data === "object" && typeof data.primary === "string") {
543
+ this.discoveredManifest = data;
544
+ return data;
545
+ }
546
+ }
547
+ } catch {} finally {
548
+ this.discoveryPromise = null;
549
+ }
550
+ return null;
551
+ })();
552
+ return this.discoveryPromise;
553
+ }
554
+ getNextCandidate(triedUrls) {
555
+ for (const url of this.fallbackUrls) {
556
+ const clean = url.replace(/\/+$/, "");
557
+ if (!triedUrls.has(clean)) {
558
+ return clean;
559
+ }
560
+ }
561
+ if (this.discoveredManifest) {
562
+ if (this.discoveredManifest.primary) {
563
+ const clean = this.discoveredManifest.primary.replace(/\/+$/, "");
564
+ if (!triedUrls.has(clean)) {
565
+ return clean;
566
+ }
567
+ }
568
+ if (Array.isArray(this.discoveredManifest.mirrors)) {
569
+ for (const mirror of this.discoveredManifest.mirrors) {
570
+ const clean = mirror.replace(/\/+$/, "");
571
+ if (!triedUrls.has(clean)) {
572
+ return clean;
573
+ }
574
+ }
575
+ }
576
+ }
577
+ return null;
578
+ }
492
579
  updateQuotaHeaders(headers) {
493
580
  const limit = headers.get("x-ratelimit-limit");
494
581
  const remaining = headers.get("x-ratelimit-remaining");
@@ -503,17 +590,8 @@ class HttpTransport {
503
590
  async sleep(ms) {
504
591
  return new Promise((resolve) => setTimeout(resolve, ms));
505
592
  }
506
- getBaseUrl() {
507
- return this.baseUrl;
508
- }
509
- getApiKey() {
510
- return this.apiKey;
511
- }
512
- getFetch() {
513
- return this.fetchFn;
514
- }
515
593
  async rawFetch(endpoint, options = {}) {
516
- const url = endpoint.startsWith("http") ? endpoint : `${this.baseUrl}/${endpoint.replace(/^\/+/, "")}`;
594
+ const url = endpoint.startsWith("http") ? endpoint : `${this.currentBaseUrl}/${endpoint.replace(/^\/+/, "")}`;
517
595
  const headers = new Headers(options.headers || {});
518
596
  if (!options.skipAuth) {
519
597
  headers.set("X-API-Key", this.apiKey);
@@ -523,8 +601,8 @@ class HttpTransport {
523
601
  headers
524
602
  });
525
603
  }
526
- async request(endpoint, options = {}) {
527
- const url = endpoint.startsWith("http") ? endpoint : `${this.baseUrl}/${endpoint.replace(/^\/+/, "")}`;
604
+ async executeSingle(baseUrl, endpoint, options = {}) {
605
+ const url = endpoint.startsWith("http") ? endpoint : `${baseUrl}/${endpoint.replace(/^\/+/, "")}`;
528
606
  const timeout = options.timeoutMs ?? this.timeoutMs;
529
607
  let attempt = 0;
530
608
  while (attempt <= this.maxRetries) {
@@ -615,6 +693,33 @@ class HttpTransport {
615
693
  }
616
694
  throw new RawcastError("Request failed after maximum retries exceeded.");
617
695
  }
696
+ async request(endpoint, options = {}) {
697
+ if (endpoint.startsWith("http://") || endpoint.startsWith("https://")) {
698
+ return this.executeSingle("", endpoint, options);
699
+ }
700
+ const triedUrls = new Set;
701
+ while (true) {
702
+ const activeUrl = this.currentBaseUrl;
703
+ triedUrls.add(activeUrl);
704
+ try {
705
+ return await this.executeSingle(activeUrl, endpoint, options);
706
+ } catch (err) {
707
+ const isEligibleForFailover = err instanceof RawcastError && (err.code === "RC_NETWORK_ERROR" || err.code === "RC_TIMEOUT") || err instanceof RawcastTimeoutError || err instanceof RawcastUpstreamError;
708
+ if (!this.autoFailover || !isEligibleForFailover) {
709
+ throw err;
710
+ }
711
+ let nextCandidate = this.getNextCandidate(triedUrls);
712
+ if (!nextCandidate) {
713
+ await this.discoverEndpoints();
714
+ nextCandidate = this.getNextCandidate(triedUrls);
715
+ }
716
+ if (!nextCandidate) {
717
+ throw err;
718
+ }
719
+ this.currentBaseUrl = nextCandidate;
720
+ }
721
+ }
722
+ }
618
723
  }
619
724
 
620
725
  // src/client.ts
@@ -646,6 +751,15 @@ class Rawcast {
646
751
  this.resolve = new ResolveResource(this.transport);
647
752
  this.health = new HealthResource(this.transport);
648
753
  }
754
+ get baseUrl() {
755
+ return this.transport.getBaseUrl();
756
+ }
757
+ setBaseUrl(url) {
758
+ this.transport.setBaseUrl(url);
759
+ }
760
+ async discoverEndpoints() {
761
+ return this.transport.discoverEndpoints();
762
+ }
649
763
  get quota() {
650
764
  return this.transport.quota;
651
765
  }
package/dist/index.mjs CHANGED
@@ -403,12 +403,21 @@ class TvResource {
403
403
  }
404
404
 
405
405
  // src/transport.ts
406
+ var DEFAULT_BASE_URL = "https://api.rawcast.space/v1";
407
+ var DEFAULT_FALLBACK_URLS = ["https://zeroms.space/v1"];
408
+ var DEFAULT_DISCOVERY_URL = "https://gist.githubusercontent.com/c1ph3rhunt3r/8e11bc9b749378b140616d89157a5a6c/raw/rawcast-endpoints.json";
409
+
406
410
  class HttpTransport {
407
- baseUrl;
411
+ currentBaseUrl;
412
+ fallbackUrls;
413
+ discoveryUrl;
414
+ autoFailover;
408
415
  apiKey;
409
416
  timeoutMs;
410
417
  maxRetries;
411
418
  fetchFn;
419
+ discoveredManifest = null;
420
+ discoveryPromise = null;
412
421
  quota = {
413
422
  limit: null,
414
423
  remaining: null,
@@ -420,7 +429,16 @@ class HttpTransport {
420
429
  throw new RawcastAuthenticationError("Rawcast API key is required. Pass apiKey or set process.env.RAWCAST_API_KEY.");
421
430
  }
422
431
  this.apiKey = options.apiKey.trim();
423
- this.baseUrl = (options.baseUrl || "https://zeroms.space/v1").replace(/\/+$/, "");
432
+ this.currentBaseUrl = (options.baseUrl || DEFAULT_BASE_URL).replace(/\/+$/, "");
433
+ if (options.fallbackUrls) {
434
+ this.fallbackUrls = options.fallbackUrls.map((u) => u.replace(/\/+$/, ""));
435
+ } else if (options.baseUrl) {
436
+ this.fallbackUrls = [];
437
+ } else {
438
+ this.fallbackUrls = [...DEFAULT_FALLBACK_URLS];
439
+ }
440
+ this.discoveryUrl = options.discoveryUrl || DEFAULT_DISCOVERY_URL;
441
+ this.autoFailover = options.autoFailover ?? true;
424
442
  this.timeoutMs = options.timeoutMs ?? 25000;
425
443
  this.maxRetries = Math.max(0, options.maxRetries ?? 2);
426
444
  this.fetchFn = options.fetch ?? globalThis.fetch;
@@ -428,6 +446,75 @@ class HttpTransport {
428
446
  throw new RawcastError("Global fetch is not available. Please provide a custom fetch implementation or upgrade Node/runtime.");
429
447
  }
430
448
  }
449
+ get baseUrl() {
450
+ return this.currentBaseUrl;
451
+ }
452
+ getBaseUrl() {
453
+ return this.currentBaseUrl;
454
+ }
455
+ setBaseUrl(url) {
456
+ this.currentBaseUrl = url.replace(/\/+$/, "");
457
+ }
458
+ getApiKey() {
459
+ return this.apiKey;
460
+ }
461
+ getFetch() {
462
+ return this.fetchFn;
463
+ }
464
+ async discoverEndpoints() {
465
+ if (this.discoveredManifest)
466
+ return this.discoveredManifest;
467
+ if (this.discoveryPromise)
468
+ return this.discoveryPromise;
469
+ this.discoveryPromise = (async () => {
470
+ try {
471
+ const controller = new AbortController;
472
+ const timer = setTimeout(() => controller.abort(), 6000);
473
+ const res = await this.fetchFn(this.discoveryUrl, {
474
+ method: "GET",
475
+ headers: { Accept: "application/json, text/plain, */*" },
476
+ signal: controller.signal
477
+ });
478
+ clearTimeout(timer);
479
+ if (res.ok) {
480
+ const data = await res.json();
481
+ if (data && typeof data === "object" && typeof data.primary === "string") {
482
+ this.discoveredManifest = data;
483
+ return data;
484
+ }
485
+ }
486
+ } catch {} finally {
487
+ this.discoveryPromise = null;
488
+ }
489
+ return null;
490
+ })();
491
+ return this.discoveryPromise;
492
+ }
493
+ getNextCandidate(triedUrls) {
494
+ for (const url of this.fallbackUrls) {
495
+ const clean = url.replace(/\/+$/, "");
496
+ if (!triedUrls.has(clean)) {
497
+ return clean;
498
+ }
499
+ }
500
+ if (this.discoveredManifest) {
501
+ if (this.discoveredManifest.primary) {
502
+ const clean = this.discoveredManifest.primary.replace(/\/+$/, "");
503
+ if (!triedUrls.has(clean)) {
504
+ return clean;
505
+ }
506
+ }
507
+ if (Array.isArray(this.discoveredManifest.mirrors)) {
508
+ for (const mirror of this.discoveredManifest.mirrors) {
509
+ const clean = mirror.replace(/\/+$/, "");
510
+ if (!triedUrls.has(clean)) {
511
+ return clean;
512
+ }
513
+ }
514
+ }
515
+ }
516
+ return null;
517
+ }
431
518
  updateQuotaHeaders(headers) {
432
519
  const limit = headers.get("x-ratelimit-limit");
433
520
  const remaining = headers.get("x-ratelimit-remaining");
@@ -442,17 +529,8 @@ class HttpTransport {
442
529
  async sleep(ms) {
443
530
  return new Promise((resolve) => setTimeout(resolve, ms));
444
531
  }
445
- getBaseUrl() {
446
- return this.baseUrl;
447
- }
448
- getApiKey() {
449
- return this.apiKey;
450
- }
451
- getFetch() {
452
- return this.fetchFn;
453
- }
454
532
  async rawFetch(endpoint, options = {}) {
455
- const url = endpoint.startsWith("http") ? endpoint : `${this.baseUrl}/${endpoint.replace(/^\/+/, "")}`;
533
+ const url = endpoint.startsWith("http") ? endpoint : `${this.currentBaseUrl}/${endpoint.replace(/^\/+/, "")}`;
456
534
  const headers = new Headers(options.headers || {});
457
535
  if (!options.skipAuth) {
458
536
  headers.set("X-API-Key", this.apiKey);
@@ -462,8 +540,8 @@ class HttpTransport {
462
540
  headers
463
541
  });
464
542
  }
465
- async request(endpoint, options = {}) {
466
- const url = endpoint.startsWith("http") ? endpoint : `${this.baseUrl}/${endpoint.replace(/^\/+/, "")}`;
543
+ async executeSingle(baseUrl, endpoint, options = {}) {
544
+ const url = endpoint.startsWith("http") ? endpoint : `${baseUrl}/${endpoint.replace(/^\/+/, "")}`;
467
545
  const timeout = options.timeoutMs ?? this.timeoutMs;
468
546
  let attempt = 0;
469
547
  while (attempt <= this.maxRetries) {
@@ -554,6 +632,33 @@ class HttpTransport {
554
632
  }
555
633
  throw new RawcastError("Request failed after maximum retries exceeded.");
556
634
  }
635
+ async request(endpoint, options = {}) {
636
+ if (endpoint.startsWith("http://") || endpoint.startsWith("https://")) {
637
+ return this.executeSingle("", endpoint, options);
638
+ }
639
+ const triedUrls = new Set;
640
+ while (true) {
641
+ const activeUrl = this.currentBaseUrl;
642
+ triedUrls.add(activeUrl);
643
+ try {
644
+ return await this.executeSingle(activeUrl, endpoint, options);
645
+ } catch (err) {
646
+ const isEligibleForFailover = err instanceof RawcastError && (err.code === "RC_NETWORK_ERROR" || err.code === "RC_TIMEOUT") || err instanceof RawcastTimeoutError || err instanceof RawcastUpstreamError;
647
+ if (!this.autoFailover || !isEligibleForFailover) {
648
+ throw err;
649
+ }
650
+ let nextCandidate = this.getNextCandidate(triedUrls);
651
+ if (!nextCandidate) {
652
+ await this.discoverEndpoints();
653
+ nextCandidate = this.getNextCandidate(triedUrls);
654
+ }
655
+ if (!nextCandidate) {
656
+ throw err;
657
+ }
658
+ this.currentBaseUrl = nextCandidate;
659
+ }
660
+ }
661
+ }
557
662
  }
558
663
 
559
664
  // src/client.ts
@@ -585,6 +690,15 @@ class Rawcast {
585
690
  this.resolve = new ResolveResource(this.transport);
586
691
  this.health = new HealthResource(this.transport);
587
692
  }
693
+ get baseUrl() {
694
+ return this.transport.getBaseUrl();
695
+ }
696
+ setBaseUrl(url) {
697
+ this.transport.setBaseUrl(url);
698
+ }
699
+ async discoverEndpoints() {
700
+ return this.transport.discoverEndpoints();
701
+ }
588
702
  get quota() {
589
703
  return this.transport.quota;
590
704
  }
@@ -1,20 +1,33 @@
1
- import type { QuotaState, RawcastOptions } from './types';
1
+ import type { QuotaState, RawcastEndpointsManifest, RawcastOptions } from './types';
2
+ export declare const DEFAULT_BASE_URL = "https://api.rawcast.space/v1";
3
+ export declare const DEFAULT_FALLBACK_URLS: string[];
4
+ export declare const DEFAULT_DISCOVERY_URL = "https://gist.githubusercontent.com/c1ph3rhunt3r/8e11bc9b749378b140616d89157a5a6c/raw/rawcast-endpoints.json";
2
5
  export declare class HttpTransport {
3
- readonly baseUrl: string;
6
+ private currentBaseUrl;
7
+ private readonly fallbackUrls;
8
+ private readonly discoveryUrl;
9
+ private readonly autoFailover;
4
10
  private readonly apiKey;
5
11
  private readonly timeoutMs;
6
12
  private readonly maxRetries;
7
13
  private readonly fetchFn;
14
+ private discoveredManifest;
15
+ private discoveryPromise;
8
16
  readonly quota: QuotaState;
9
17
  constructor(options: RawcastOptions);
10
- private updateQuotaHeaders;
11
- private sleep;
18
+ get baseUrl(): string;
12
19
  getBaseUrl(): string;
20
+ setBaseUrl(url: string): void;
13
21
  getApiKey(): string;
14
22
  getFetch(): typeof fetch;
23
+ discoverEndpoints(): Promise<RawcastEndpointsManifest | null>;
24
+ private getNextCandidate;
25
+ private updateQuotaHeaders;
26
+ private sleep;
15
27
  rawFetch(endpoint: string, options?: RequestInit & {
16
28
  skipAuth?: boolean;
17
29
  }): Promise<Response>;
30
+ private executeSingle;
18
31
  request<T>(endpoint: string, options?: RequestInit & {
19
32
  timeoutMs?: number;
20
33
  skipAuth?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,aAAa;IACxB,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,QA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AO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;IAEvC,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,gBAAgB,CAAyD;IAEjF,SAAgB,KAAK,EAAE,UAAU,CAK/B;gBAEU,OAAO,EAAE,cAAc;IAgCnC,IAAW,OAAO,IAAI,MAAM,CAE3B;IAEM,UAAU,IAAI,MAAM;IAIpB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7B,SAAS,IAAI,MAAM;IAInB,QAAQ,IAAI,OAAO,KAAK;IAIlB,iBAAiB,IAAI,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAmC1E,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,kBAAkB;YAcZ,KAAK;IAIN,QAAQ,CACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAO,GACjD,OAAO,CAAC,QAAQ,CAAC;YAgBN,aAAa;IAsId,OAAO,CAAC,CAAC,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,WAAW,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAO,GACrE,OAAO,CAAC,CAAC,CAAC;CAwCd"}
package/dist/types.d.ts CHANGED
@@ -15,6 +15,18 @@ export interface ProviderHealthDashboard {
15
15
  timestamp: string;
16
16
  servers: Record<string, string>;
17
17
  }
18
+ /**
19
+ * Out-of-band remote endpoints manifest structure.
20
+ */
21
+ export interface RawcastEndpointsManifest {
22
+ version: number;
23
+ updated_at?: string;
24
+ status?: string;
25
+ primary: string;
26
+ portal?: string;
27
+ mirrors?: string[];
28
+ notice?: string;
29
+ }
18
30
  /**
19
31
  * Configuration options for the Rawcast SDK client.
20
32
  */
@@ -25,16 +37,31 @@ export interface RawcastOptions {
25
37
  apiKey: string;
26
38
  /**
27
39
  * Base URL of the Rawcast API.
28
- * @default "https://zeroms.space/v1"
40
+ * @default "https://api.rawcast.space/v1"
29
41
  */
30
42
  baseUrl?: string;
43
+ /**
44
+ * List of fallback mirror base URLs to try if the primary endpoint is unreachable.
45
+ * @default ["https://zeroms.space/v1"]
46
+ */
47
+ fallbackUrls?: string[];
48
+ /**
49
+ * Out-of-band remote discovery endpoint URL for finding live mirrors if primary and hardcoded fallbacks fail.
50
+ * @default "https://gist.githubusercontent.com/c1ph3rhunt3r/8e11bc9b749378b140616d89157a5a6c/raw/rawcast-endpoints.json"
51
+ */
52
+ discoveryUrl?: string;
53
+ /**
54
+ * Whether to automatically failover to fallback mirrors or query the remote discovery endpoint on network / DNS failures.
55
+ * @default true
56
+ */
57
+ autoFailover?: boolean;
31
58
  /**
32
59
  * Request timeout in milliseconds.
33
60
  * @default 25000
34
61
  */
35
62
  timeoutMs?: number;
36
63
  /**
37
- * Maximum number of automatic retries on rate limits (HTTP 429) or transient 5xx errors.
64
+ * Maximum number of automatic retries on rate limits (HTTP 429) or transient 5xx errors per endpoint.
38
65
  * @default 2
39
66
  */
40
67
  maxRetries?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,YAAY,EACb,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,YAAY,GACb,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AA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IAEhD;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@rawcast/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Official TypeScript/JavaScript SDK for Rawcast Media Resolution API",
5
5
  "author": "Rawcast Team",
6
6
  "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
7
10
  "main": "./dist/index.cjs",
8
11
  "module": "./dist/index.mjs",
9
12
  "types": "./dist/index.d.ts",