@deadair/sdk 0.26.3 → 0.27.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/index.js CHANGED
@@ -3364,6 +3364,14 @@ var __dt10 = /* @__PURE__ */ __name((v, path) => {
3364
3364
  if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
3365
3365
  return d;
3366
3366
  }, "__dt");
3367
+ var __dtf = /* @__PURE__ */ __name((v, path, fmt) => {
3368
+ if (typeof v !== "string") {
3369
+ throw new TypeError(`ContractKit: expected a string at '${path}' in format ${fmt}, received ${typeof v}.`);
3370
+ }
3371
+ const d = DateTime10.fromFormat(v, fmt);
3372
+ if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' does not match format ${fmt}.`);
3373
+ return d;
3374
+ }, "__dtf");
3367
3375
  function reviveStationHeartbeat(raw) {
3368
3376
  const __o0 = raw;
3369
3377
  __o0["startedAt"] = __dt10(__o0["startedAt"], "StationHeartbeat.startedAt");
@@ -3373,6 +3381,14 @@ function reviveStationHeartbeat(raw) {
3373
3381
  return raw;
3374
3382
  }
3375
3383
  __name(reviveStationHeartbeat, "reviveStationHeartbeat");
3384
+ function reviveStationRelease(raw) {
3385
+ const __o0 = raw;
3386
+ if (__o0["date"] != null) {
3387
+ __o0["date"] = __dtf(__o0["date"], "StationRelease.date", "yyyy-MM-dd");
3388
+ }
3389
+ return raw;
3390
+ }
3391
+ __name(reviveStationRelease, "reviveStationRelease");
3376
3392
  function reviveStationCheckup(raw) {
3377
3393
  const __o0 = raw;
3378
3394
  __o0["readAt"] = __dt10(__o0["readAt"], "StationCheckup.readAt");
@@ -3387,6 +3403,26 @@ function reviveStationCheckup(raw) {
3387
3403
  return raw;
3388
3404
  }
3389
3405
  __name(reviveStationCheckup, "reviveStationCheckup");
3406
+ function reviveStationReleases(raw) {
3407
+ const __o0 = raw;
3408
+ {
3409
+ const __a1 = __o0["notes"];
3410
+ for (let __i2 = 0; __i2 < __a1.length; __i2++) {
3411
+ reviveStationRelease(__a1[__i2]);
3412
+ }
3413
+ }
3414
+ if (__o0["checkedAt"] != null) {
3415
+ __o0["checkedAt"] = __dt10(__o0["checkedAt"], "StationReleases.checkedAt");
3416
+ }
3417
+ {
3418
+ const __a3 = __o0["available"];
3419
+ for (let __i4 = 0; __i4 < __a3.length; __i4++) {
3420
+ reviveStationRelease(__a3[__i4]);
3421
+ }
3422
+ }
3423
+ return raw;
3424
+ }
3425
+ __name(reviveStationReleases, "reviveStationReleases");
3390
3426
 
3391
3427
  // src/station/types/traces.types.ts
3392
3428
  import { DateTime as DateTime11 } from "luxon";
@@ -3509,6 +3545,26 @@ var StationClient = class {
3509
3545
  });
3510
3546
  return reviveStationCheckup(await parseJson(result));
3511
3547
  }
3548
+ /**
3549
+ * @name Read station releases
3550
+ * @description The releases this build contains and what each one changed, newest first
3551
+ */
3552
+ async readStationReleases() {
3553
+ const result = await this.fetch(`/station/releases`, {
3554
+ method: "GET"
3555
+ });
3556
+ return reviveStationReleases(await parseJson(result));
3557
+ }
3558
+ /**
3559
+ * @name Check station releases
3560
+ * @description Asks GitHub for newer releases now, and answers with what the station then knows
3561
+ */
3562
+ async checkStationReleases() {
3563
+ const result = await this.fetch(`/station/releases/check`, {
3564
+ method: "POST"
3565
+ });
3566
+ return reviveStationReleases(await parseJson(result));
3567
+ }
3512
3568
  /**
3513
3569
  * @name Read traces
3514
3570
  * @description Recent decisions, newest first, folded to one row each
@@ -3874,6 +3930,8 @@ export {
3874
3930
  reviveSessionFactor,
3875
3931
  reviveStationCheckup,
3876
3932
  reviveStationHeartbeat,
3933
+ reviveStationRelease,
3934
+ reviveStationReleases,
3877
3935
  reviveStepUpStartResponse,
3878
3936
  reviveStepUpStartResponseOutput,
3879
3937
  reviveStorageReport,