@deadair/sdk 0.31.2 → 0.32.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.
- package/dist/deadair.sdk.d.ts +4 -0
- package/dist/deadair.sdk.d.ts.map +1 -1
- package/dist/director/types/director.types.d.ts +9 -6
- package/dist/director/types/director.types.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +397 -46
- package/dist/index.js.map +1 -1
- package/dist/messaging/messaging.client.d.ts +22 -0
- package/dist/messaging/messaging.client.d.ts.map +1 -0
- package/dist/messaging/types/index.d.ts +2 -0
- package/dist/messaging/types/index.d.ts.map +1 -0
- package/dist/messaging/types/messaging.types.d.ts +39 -0
- package/dist/messaging/types/messaging.types.d.ts.map +1 -0
- package/dist/playlists/playlists.client.d.ts +46 -0
- package/dist/playlists/playlists.client.d.ts.map +1 -1
- package/dist/playlists/types/index.d.ts +1 -0
- package/dist/playlists/types/index.d.ts.map +1 -1
- package/dist/playlists/types/station.playlists.types.d.ts +185 -0
- package/dist/playlists/types/station.playlists.types.d.ts.map +1 -0
- package/dist/playout/playout.client.d.ts +6 -1
- package/dist/playout/playout.client.d.ts.map +1 -1
- package/dist/playout/types/playout.types.d.ts +21 -12
- package/dist/playout/types/playout.types.d.ts.map +1 -1
- package/dist/requests/requests.client.d.ts +42 -0
- package/dist/requests/requests.client.d.ts.map +1 -0
- package/dist/requests/types/index.d.ts +2 -0
- package/dist/requests/types/index.d.ts.map +1 -0
- package/dist/requests/types/requests.types.d.ts +89 -0
- package/dist/requests/types/requests.types.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1554,6 +1554,80 @@ var HistoryClient = class {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
};
|
|
1556
1556
|
|
|
1557
|
+
// src/messaging/types/messaging.types.ts
|
|
1558
|
+
import { DateTime as DateTime6 } from "luxon";
|
|
1559
|
+
var __dt6 = /* @__PURE__ */ __name((v, path) => {
|
|
1560
|
+
if (typeof v !== "string") {
|
|
1561
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
1562
|
+
}
|
|
1563
|
+
const d = DateTime6.fromISO(v);
|
|
1564
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
1565
|
+
return d;
|
|
1566
|
+
}, "__dt");
|
|
1567
|
+
function reviveMessagingLinkCode(raw) {
|
|
1568
|
+
const __o0 = raw;
|
|
1569
|
+
__o0["expiresAt"] = __dt6(__o0["expiresAt"], "MessagingLinkCode.expiresAt");
|
|
1570
|
+
return raw;
|
|
1571
|
+
}
|
|
1572
|
+
__name(reviveMessagingLinkCode, "reviveMessagingLinkCode");
|
|
1573
|
+
function reviveMessagingLink(raw) {
|
|
1574
|
+
const __o0 = raw;
|
|
1575
|
+
__o0["createdAt"] = __dt6(__o0["createdAt"], "MessagingLink.createdAt");
|
|
1576
|
+
return raw;
|
|
1577
|
+
}
|
|
1578
|
+
__name(reviveMessagingLink, "reviveMessagingLink");
|
|
1579
|
+
function reviveMessagingLinkList(raw) {
|
|
1580
|
+
const __o0 = raw;
|
|
1581
|
+
{
|
|
1582
|
+
const __a1 = __o0["links"];
|
|
1583
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
1584
|
+
reviveMessagingLink(__a1[__i2]);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
return raw;
|
|
1588
|
+
}
|
|
1589
|
+
__name(reviveMessagingLinkList, "reviveMessagingLinkList");
|
|
1590
|
+
|
|
1591
|
+
// src/messaging/messaging.client.ts
|
|
1592
|
+
var MessagingClient = class {
|
|
1593
|
+
static {
|
|
1594
|
+
__name(this, "MessagingClient");
|
|
1595
|
+
}
|
|
1596
|
+
fetch;
|
|
1597
|
+
constructor(fetch2) {
|
|
1598
|
+
this.fetch = fetch2;
|
|
1599
|
+
}
|
|
1600
|
+
/**
|
|
1601
|
+
* @name List messaging links
|
|
1602
|
+
* @description The chat accounts linked to the signed-in account
|
|
1603
|
+
*/
|
|
1604
|
+
async listMessagingLinks() {
|
|
1605
|
+
const result = await this.fetch(`/messaging/links`, {
|
|
1606
|
+
method: "GET"
|
|
1607
|
+
});
|
|
1608
|
+
return reviveMessagingLinkList(await parseJson(result));
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* @name Create messaging link code
|
|
1612
|
+
* @description A new one-time code for linking a chat account. It replaces any earlier code and stops working after ten minutes
|
|
1613
|
+
*/
|
|
1614
|
+
async createMessagingLinkCode() {
|
|
1615
|
+
const result = await this.fetch(`/messaging/links/code`, {
|
|
1616
|
+
method: "POST"
|
|
1617
|
+
});
|
|
1618
|
+
return reviveMessagingLinkCode(await parseJson(result));
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* @name Remove messaging link
|
|
1622
|
+
* @description Unlink a chat account. Its operator commands are refused from the next one on
|
|
1623
|
+
*/
|
|
1624
|
+
async removeMessagingLink(pluginId, platformUserId) {
|
|
1625
|
+
await this.fetch(`/messaging/links/${encodeURIComponent(pluginId)}/${encodeURIComponent(platformUserId)}`, {
|
|
1626
|
+
method: "DELETE"
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
};
|
|
1630
|
+
|
|
1557
1631
|
// src/narrations/narrations.client.ts
|
|
1558
1632
|
var NarrationsClient = class {
|
|
1559
1633
|
static {
|
|
@@ -1659,32 +1733,32 @@ var NowplayingClient = class {
|
|
|
1659
1733
|
};
|
|
1660
1734
|
|
|
1661
1735
|
// src/oauth/types/oauth.types.ts
|
|
1662
|
-
import { DateTime as
|
|
1663
|
-
var
|
|
1736
|
+
import { DateTime as DateTime7 } from "luxon";
|
|
1737
|
+
var __dt7 = /* @__PURE__ */ __name((v, path) => {
|
|
1664
1738
|
if (typeof v !== "string") {
|
|
1665
1739
|
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
1666
1740
|
}
|
|
1667
|
-
const d =
|
|
1741
|
+
const d = DateTime7.fromISO(v);
|
|
1668
1742
|
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
1669
1743
|
return d;
|
|
1670
1744
|
}, "__dt");
|
|
1671
1745
|
function reviveOAuthGrant(raw) {
|
|
1672
1746
|
const __o0 = raw;
|
|
1673
|
-
__o0["createdAt"] =
|
|
1747
|
+
__o0["createdAt"] = __dt7(__o0["createdAt"], "OAuthGrant.createdAt");
|
|
1674
1748
|
if (__o0["lastUsedAt"] != null) {
|
|
1675
|
-
__o0["lastUsedAt"] =
|
|
1749
|
+
__o0["lastUsedAt"] = __dt7(__o0["lastUsedAt"], "OAuthGrant.lastUsedAt");
|
|
1676
1750
|
}
|
|
1677
1751
|
return raw;
|
|
1678
1752
|
}
|
|
1679
1753
|
__name(reviveOAuthGrant, "reviveOAuthGrant");
|
|
1680
1754
|
function reviveOAuthClientSummary(raw) {
|
|
1681
1755
|
const __o0 = raw;
|
|
1682
|
-
__o0["createdAt"] =
|
|
1756
|
+
__o0["createdAt"] = __dt7(__o0["createdAt"], "OAuthClientSummary.createdAt");
|
|
1683
1757
|
if (__o0["lastUsedAt"] != null) {
|
|
1684
|
-
__o0["lastUsedAt"] =
|
|
1758
|
+
__o0["lastUsedAt"] = __dt7(__o0["lastUsedAt"], "OAuthClientSummary.lastUsedAt");
|
|
1685
1759
|
}
|
|
1686
1760
|
if (__o0["expiresAt"] != null) {
|
|
1687
|
-
__o0["expiresAt"] =
|
|
1761
|
+
__o0["expiresAt"] = __dt7(__o0["expiresAt"], "OAuthClientSummary.expiresAt");
|
|
1688
1762
|
}
|
|
1689
1763
|
return raw;
|
|
1690
1764
|
}
|
|
@@ -2322,6 +2396,46 @@ var PersonasClient = class {
|
|
|
2322
2396
|
}
|
|
2323
2397
|
};
|
|
2324
2398
|
|
|
2399
|
+
// src/playlists/types/station.playlists.types.ts
|
|
2400
|
+
import { DateTime as DateTime8 } from "luxon";
|
|
2401
|
+
var __dt8 = /* @__PURE__ */ __name((v, path) => {
|
|
2402
|
+
if (typeof v !== "string") {
|
|
2403
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
2404
|
+
}
|
|
2405
|
+
const d = DateTime8.fromISO(v);
|
|
2406
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
2407
|
+
return d;
|
|
2408
|
+
}, "__dt");
|
|
2409
|
+
function reviveStationPlaylist(raw) {
|
|
2410
|
+
const __o0 = raw;
|
|
2411
|
+
__o0["createdAt"] = __dt8(__o0["createdAt"], "StationPlaylist.createdAt");
|
|
2412
|
+
__o0["updatedAt"] = __dt8(__o0["updatedAt"], "StationPlaylist.updatedAt");
|
|
2413
|
+
return raw;
|
|
2414
|
+
}
|
|
2415
|
+
__name(reviveStationPlaylist, "reviveStationPlaylist");
|
|
2416
|
+
function reviveStationPlaylistList(raw) {
|
|
2417
|
+
const __o0 = raw;
|
|
2418
|
+
{
|
|
2419
|
+
const __a1 = __o0["playlists"];
|
|
2420
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
2421
|
+
reviveStationPlaylist(__a1[__i2]);
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
return raw;
|
|
2425
|
+
}
|
|
2426
|
+
__name(reviveStationPlaylistList, "reviveStationPlaylistList");
|
|
2427
|
+
function reviveStationPlaylistDetail(raw) {
|
|
2428
|
+
reviveStationPlaylist(raw);
|
|
2429
|
+
return raw;
|
|
2430
|
+
}
|
|
2431
|
+
__name(reviveStationPlaylistDetail, "reviveStationPlaylistDetail");
|
|
2432
|
+
function revivePlaylistImportResult(raw) {
|
|
2433
|
+
const __o0 = raw;
|
|
2434
|
+
reviveStationPlaylist(__o0["playlist"]);
|
|
2435
|
+
return raw;
|
|
2436
|
+
}
|
|
2437
|
+
__name(revivePlaylistImportResult, "revivePlaylistImportResult");
|
|
2438
|
+
|
|
2325
2439
|
// src/playlists/playlists.client.ts
|
|
2326
2440
|
var PlaylistsClient = class {
|
|
2327
2441
|
static {
|
|
@@ -2387,6 +2501,102 @@ var PlaylistsClient = class {
|
|
|
2387
2501
|
method: "POST"
|
|
2388
2502
|
});
|
|
2389
2503
|
}
|
|
2504
|
+
/**
|
|
2505
|
+
* @name List station playlists
|
|
2506
|
+
* @description Every playlist the station owns, newest first
|
|
2507
|
+
*/
|
|
2508
|
+
async listStationPlaylists() {
|
|
2509
|
+
const result = await this.fetch(`/station-playlists`, {
|
|
2510
|
+
method: "GET"
|
|
2511
|
+
});
|
|
2512
|
+
return reviveStationPlaylistList(await parseJson(result));
|
|
2513
|
+
}
|
|
2514
|
+
/**
|
|
2515
|
+
* @name Get station playlist
|
|
2516
|
+
* @description One station playlist with its records in order, placeholders included
|
|
2517
|
+
*/
|
|
2518
|
+
async getStationPlaylist(id) {
|
|
2519
|
+
const result = await this.fetch(`/station-playlists/${encodeURIComponent(id)}`, {
|
|
2520
|
+
method: "GET"
|
|
2521
|
+
});
|
|
2522
|
+
return reviveStationPlaylistDetail(await parseJson(result));
|
|
2523
|
+
}
|
|
2524
|
+
/**
|
|
2525
|
+
* @name Update station playlist
|
|
2526
|
+
* @description Renames a station playlist, or rewrites what it is for
|
|
2527
|
+
*/
|
|
2528
|
+
async updateStationPlaylist(id, body) {
|
|
2529
|
+
const result = await this.fetch(`/station-playlists/${encodeURIComponent(id)}`, {
|
|
2530
|
+
method: "PATCH",
|
|
2531
|
+
headers: {
|
|
2532
|
+
"Content-Type": "application/json"
|
|
2533
|
+
},
|
|
2534
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2535
|
+
});
|
|
2536
|
+
return reviveStationPlaylist(await parseJson(result));
|
|
2537
|
+
}
|
|
2538
|
+
/**
|
|
2539
|
+
* @name Delete station playlist
|
|
2540
|
+
* @description Deletes a station playlist. The records it named stay in the library
|
|
2541
|
+
*/
|
|
2542
|
+
async deleteStationPlaylist(id) {
|
|
2543
|
+
await this.fetch(`/station-playlists/${encodeURIComponent(id)}`, {
|
|
2544
|
+
method: "DELETE"
|
|
2545
|
+
});
|
|
2546
|
+
}
|
|
2547
|
+
/**
|
|
2548
|
+
* @name Fill station playlist
|
|
2549
|
+
* @description Looks up the records this playlist names and the library does not hold, in the background, and adds the ones a provider has. The activity feed says how it went
|
|
2550
|
+
*/
|
|
2551
|
+
async fillStationPlaylist(id) {
|
|
2552
|
+
await this.fetch(`/station-playlists/${encodeURIComponent(id)}/fill`, {
|
|
2553
|
+
method: "POST"
|
|
2554
|
+
});
|
|
2555
|
+
}
|
|
2556
|
+
/**
|
|
2557
|
+
* @name Export station playlist
|
|
2558
|
+
* @description One station playlist as a file another station can import
|
|
2559
|
+
*/
|
|
2560
|
+
async exportStationPlaylist(id) {
|
|
2561
|
+
const result = await this.fetch(`/station-playlists/${encodeURIComponent(id)}/export`, {
|
|
2562
|
+
method: "GET"
|
|
2563
|
+
});
|
|
2564
|
+
const data = await parseJson(result);
|
|
2565
|
+
return {
|
|
2566
|
+
data,
|
|
2567
|
+
headers: {
|
|
2568
|
+
contentDisposition: result.headers.get("Content-Disposition") ?? void 0
|
|
2569
|
+
}
|
|
2570
|
+
};
|
|
2571
|
+
}
|
|
2572
|
+
/**
|
|
2573
|
+
* @name Preview playlist import
|
|
2574
|
+
* @description Reads a source and reports which of its records the library holds and which it would have to find. Writes nothing
|
|
2575
|
+
*/
|
|
2576
|
+
async previewPlaylistImport(body) {
|
|
2577
|
+
const result = await this.fetch(`/station-playlists/import/preview`, {
|
|
2578
|
+
method: "POST",
|
|
2579
|
+
headers: {
|
|
2580
|
+
"Content-Type": "application/json"
|
|
2581
|
+
},
|
|
2582
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2583
|
+
});
|
|
2584
|
+
return await parseJson(result);
|
|
2585
|
+
}
|
|
2586
|
+
/**
|
|
2587
|
+
* @name Import playlist
|
|
2588
|
+
* @description Makes a new station playlist from a source and answers with what it did
|
|
2589
|
+
*/
|
|
2590
|
+
async importPlaylist(body) {
|
|
2591
|
+
const result = await this.fetch(`/station-playlists/import`, {
|
|
2592
|
+
method: "POST",
|
|
2593
|
+
headers: {
|
|
2594
|
+
"Content-Type": "application/json"
|
|
2595
|
+
},
|
|
2596
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2597
|
+
});
|
|
2598
|
+
return revivePlaylistImportResult(await parseJson(result));
|
|
2599
|
+
}
|
|
2390
2600
|
};
|
|
2391
2601
|
|
|
2392
2602
|
// src/playout/playout.client.ts
|
|
@@ -2422,6 +2632,20 @@ var PlayoutClient = class {
|
|
|
2422
2632
|
});
|
|
2423
2633
|
return await parseJson(result);
|
|
2424
2634
|
}
|
|
2635
|
+
/**
|
|
2636
|
+
* @name Play a station playlist
|
|
2637
|
+
* @description Loads a playlist the station owns into the running order and starts handing it to the player. The same replacement a plugin playlist makes, from records the library already holds
|
|
2638
|
+
*/
|
|
2639
|
+
async playAStationPlaylist(body) {
|
|
2640
|
+
const result = await this.fetch(`/playout/station-playlist`, {
|
|
2641
|
+
method: "POST",
|
|
2642
|
+
headers: {
|
|
2643
|
+
"Content-Type": "application/json"
|
|
2644
|
+
},
|
|
2645
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2646
|
+
});
|
|
2647
|
+
return await parseJson(result);
|
|
2648
|
+
}
|
|
2425
2649
|
/**
|
|
2426
2650
|
* @name Play a chart
|
|
2427
2651
|
* @description Builds the running order from a published chart and starts handing it to the player. The same replacement a playlist makes, from a document somebody else ranked
|
|
@@ -2469,22 +2693,22 @@ var PlayoutClient = class {
|
|
|
2469
2693
|
};
|
|
2470
2694
|
|
|
2471
2695
|
// src/plugins/types/plugins.types.ts
|
|
2472
|
-
import { DateTime as
|
|
2473
|
-
var
|
|
2696
|
+
import { DateTime as DateTime9 } from "luxon";
|
|
2697
|
+
var __dt9 = /* @__PURE__ */ __name((v, path) => {
|
|
2474
2698
|
if (typeof v !== "string") {
|
|
2475
2699
|
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
2476
2700
|
}
|
|
2477
|
-
const d =
|
|
2701
|
+
const d = DateTime9.fromISO(v);
|
|
2478
2702
|
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
2479
2703
|
return d;
|
|
2480
2704
|
}, "__dt");
|
|
2481
2705
|
function revivePluginSummary(raw) {
|
|
2482
2706
|
const __o0 = raw;
|
|
2483
2707
|
if (__o0["firstEnabledAt"] != null) {
|
|
2484
|
-
__o0["firstEnabledAt"] =
|
|
2708
|
+
__o0["firstEnabledAt"] = __dt9(__o0["firstEnabledAt"], "PluginSummary.firstEnabledAt");
|
|
2485
2709
|
}
|
|
2486
2710
|
if (__o0["nextProbeAt"] != null) {
|
|
2487
|
-
__o0["nextProbeAt"] =
|
|
2711
|
+
__o0["nextProbeAt"] = __dt9(__o0["nextProbeAt"], "PluginSummary.nextProbeAt");
|
|
2488
2712
|
}
|
|
2489
2713
|
return raw;
|
|
2490
2714
|
}
|
|
@@ -2801,19 +3025,19 @@ var PodcastsClient = class {
|
|
|
2801
3025
|
};
|
|
2802
3026
|
|
|
2803
3027
|
// src/productions/types/productions.types.ts
|
|
2804
|
-
import { DateTime as
|
|
2805
|
-
var
|
|
3028
|
+
import { DateTime as DateTime10 } from "luxon";
|
|
3029
|
+
var __dt10 = /* @__PURE__ */ __name((v, path) => {
|
|
2806
3030
|
if (typeof v !== "string") {
|
|
2807
3031
|
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
2808
3032
|
}
|
|
2809
|
-
const d =
|
|
3033
|
+
const d = DateTime10.fromISO(v);
|
|
2810
3034
|
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
2811
3035
|
return d;
|
|
2812
3036
|
}, "__dt");
|
|
2813
3037
|
function reviveProductionRequest(raw) {
|
|
2814
3038
|
const __o0 = raw;
|
|
2815
3039
|
if (__o0["scheduledFor"] != null) {
|
|
2816
|
-
__o0["scheduledFor"] =
|
|
3040
|
+
__o0["scheduledFor"] = __dt10(__o0["scheduledFor"], "ProductionRequest.scheduledFor");
|
|
2817
3041
|
}
|
|
2818
3042
|
return raw;
|
|
2819
3043
|
}
|
|
@@ -2821,12 +3045,12 @@ __name(reviveProductionRequest, "reviveProductionRequest");
|
|
|
2821
3045
|
function reviveProduction(raw) {
|
|
2822
3046
|
const __o0 = raw;
|
|
2823
3047
|
if (__o0["scheduledFor"] != null) {
|
|
2824
|
-
__o0["scheduledFor"] =
|
|
3048
|
+
__o0["scheduledFor"] = __dt10(__o0["scheduledFor"], "Production.scheduledFor");
|
|
2825
3049
|
}
|
|
2826
3050
|
if (__o0["cancelledAt"] != null) {
|
|
2827
|
-
__o0["cancelledAt"] =
|
|
3051
|
+
__o0["cancelledAt"] = __dt10(__o0["cancelledAt"], "Production.cancelledAt");
|
|
2828
3052
|
}
|
|
2829
|
-
__o0["createdAt"] =
|
|
3053
|
+
__o0["createdAt"] = __dt10(__o0["createdAt"], "Production.createdAt");
|
|
2830
3054
|
return raw;
|
|
2831
3055
|
}
|
|
2832
3056
|
__name(reviveProduction, "reviveProduction");
|
|
@@ -2888,26 +3112,26 @@ var ProductionsClient = class {
|
|
|
2888
3112
|
};
|
|
2889
3113
|
|
|
2890
3114
|
// src/render/types/render.types.ts
|
|
2891
|
-
import { DateTime as
|
|
2892
|
-
var
|
|
3115
|
+
import { DateTime as DateTime11 } from "luxon";
|
|
3116
|
+
var __dt11 = /* @__PURE__ */ __name((v, path) => {
|
|
2893
3117
|
if (typeof v !== "string") {
|
|
2894
3118
|
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
2895
3119
|
}
|
|
2896
|
-
const d =
|
|
3120
|
+
const d = DateTime11.fromISO(v);
|
|
2897
3121
|
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
2898
3122
|
return d;
|
|
2899
3123
|
}, "__dt");
|
|
2900
3124
|
function revivePad(raw) {
|
|
2901
3125
|
const __o0 = raw;
|
|
2902
3126
|
if (__o0["lastUsedAt"] != null) {
|
|
2903
|
-
__o0["lastUsedAt"] =
|
|
3127
|
+
__o0["lastUsedAt"] = __dt11(__o0["lastUsedAt"], "Pad.lastUsedAt");
|
|
2904
3128
|
}
|
|
2905
3129
|
return raw;
|
|
2906
3130
|
}
|
|
2907
3131
|
__name(revivePad, "revivePad");
|
|
2908
3132
|
function reviveScriptAttempt(raw) {
|
|
2909
3133
|
const __o0 = raw;
|
|
2910
|
-
__o0["at"] =
|
|
3134
|
+
__o0["at"] = __dt11(__o0["at"], "ScriptAttempt.at");
|
|
2911
3135
|
return raw;
|
|
2912
3136
|
}
|
|
2913
3137
|
__name(reviveScriptAttempt, "reviveScriptAttempt");
|
|
@@ -3387,6 +3611,118 @@ var RenderClient = class {
|
|
|
3387
3611
|
}
|
|
3388
3612
|
};
|
|
3389
3613
|
|
|
3614
|
+
// src/requests/types/requests.types.ts
|
|
3615
|
+
import { DateTime as DateTime12 } from "luxon";
|
|
3616
|
+
var __dt12 = /* @__PURE__ */ __name((v, path) => {
|
|
3617
|
+
if (typeof v !== "string") {
|
|
3618
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
3619
|
+
}
|
|
3620
|
+
const d = DateTime12.fromISO(v);
|
|
3621
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
3622
|
+
return d;
|
|
3623
|
+
}, "__dt");
|
|
3624
|
+
function reviveListenerRequest(raw) {
|
|
3625
|
+
const __o0 = raw;
|
|
3626
|
+
__o0["createdAt"] = __dt12(__o0["createdAt"], "ListenerRequest.createdAt");
|
|
3627
|
+
if (__o0["airedAt"] != null) {
|
|
3628
|
+
__o0["airedAt"] = __dt12(__o0["airedAt"], "ListenerRequest.airedAt");
|
|
3629
|
+
}
|
|
3630
|
+
return raw;
|
|
3631
|
+
}
|
|
3632
|
+
__name(reviveListenerRequest, "reviveListenerRequest");
|
|
3633
|
+
function reviveListenerRequestList(raw) {
|
|
3634
|
+
const __o0 = raw;
|
|
3635
|
+
{
|
|
3636
|
+
const __a1 = __o0["requests"];
|
|
3637
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
3638
|
+
reviveListenerRequest(__a1[__i2]);
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
return raw;
|
|
3642
|
+
}
|
|
3643
|
+
__name(reviveListenerRequestList, "reviveListenerRequestList");
|
|
3644
|
+
|
|
3645
|
+
// src/requests/requests.client.ts
|
|
3646
|
+
var RequestsClient = class {
|
|
3647
|
+
static {
|
|
3648
|
+
__name(this, "RequestsClient");
|
|
3649
|
+
}
|
|
3650
|
+
fetch;
|
|
3651
|
+
constructor(fetch2) {
|
|
3652
|
+
this.fetch = fetch2;
|
|
3653
|
+
}
|
|
3654
|
+
/**
|
|
3655
|
+
* @name Search requestable records
|
|
3656
|
+
* @description Records the station could be asked to play, matching a title or an artist
|
|
3657
|
+
*/
|
|
3658
|
+
async searchRequestableRecords(query) {
|
|
3659
|
+
const qs = buildQueryString(query);
|
|
3660
|
+
const result = await this.fetch(`/requests/search${qs}`, {
|
|
3661
|
+
method: "GET"
|
|
3662
|
+
});
|
|
3663
|
+
return await parseJson(result);
|
|
3664
|
+
}
|
|
3665
|
+
/**
|
|
3666
|
+
* @name List requests
|
|
3667
|
+
* @description Every recent request, for the operator deciding on them
|
|
3668
|
+
*/
|
|
3669
|
+
async listRequests(query) {
|
|
3670
|
+
const qs = buildQueryString(query);
|
|
3671
|
+
const result = await this.fetch(`/requests${qs}`, {
|
|
3672
|
+
method: "GET"
|
|
3673
|
+
});
|
|
3674
|
+
return reviveListenerRequestList(await parseJson(result));
|
|
3675
|
+
}
|
|
3676
|
+
/**
|
|
3677
|
+
* @name Create request
|
|
3678
|
+
* @description Ask the station to play a record. Answers with the request whatever became of it, so a refusal says why in `reason`
|
|
3679
|
+
*/
|
|
3680
|
+
async createRequest(body) {
|
|
3681
|
+
const result = await this.fetch(`/requests`, {
|
|
3682
|
+
method: "POST",
|
|
3683
|
+
headers: {
|
|
3684
|
+
"Content-Type": "application/json"
|
|
3685
|
+
},
|
|
3686
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
3687
|
+
});
|
|
3688
|
+
return reviveListenerRequest(await parseJson(result));
|
|
3689
|
+
}
|
|
3690
|
+
/**
|
|
3691
|
+
* @name List my requests
|
|
3692
|
+
* @description The signed-in account's own recent requests
|
|
3693
|
+
*/
|
|
3694
|
+
async listMyRequests() {
|
|
3695
|
+
const result = await this.fetch(`/requests/mine`, {
|
|
3696
|
+
method: "GET"
|
|
3697
|
+
});
|
|
3698
|
+
return reviveListenerRequestList(await parseJson(result));
|
|
3699
|
+
}
|
|
3700
|
+
/**
|
|
3701
|
+
* @name Grant request
|
|
3702
|
+
* @description Let a waiting request through. It goes into the running order once its audio is here
|
|
3703
|
+
*/
|
|
3704
|
+
async grantRequest(id) {
|
|
3705
|
+
const result = await this.fetch(`/requests/${encodeURIComponent(id)}/grant`, {
|
|
3706
|
+
method: "POST"
|
|
3707
|
+
});
|
|
3708
|
+
return reviveListenerRequest(await parseJson(result));
|
|
3709
|
+
}
|
|
3710
|
+
/**
|
|
3711
|
+
* @name Decline request
|
|
3712
|
+
* @description Turn a request down. One already in the running order is left there; take it out of the order instead
|
|
3713
|
+
*/
|
|
3714
|
+
async declineRequest(id, body) {
|
|
3715
|
+
const result = await this.fetch(`/requests/${encodeURIComponent(id)}/decline`, {
|
|
3716
|
+
method: "POST",
|
|
3717
|
+
headers: {
|
|
3718
|
+
"Content-Type": "application/json"
|
|
3719
|
+
},
|
|
3720
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
3721
|
+
});
|
|
3722
|
+
return reviveListenerRequest(await parseJson(result));
|
|
3723
|
+
}
|
|
3724
|
+
};
|
|
3725
|
+
|
|
3390
3726
|
// src/schedule/schedule.client.ts
|
|
3391
3727
|
var ScheduleClient = class {
|
|
3392
3728
|
static {
|
|
@@ -3513,19 +3849,19 @@ var SettingsClient = class {
|
|
|
3513
3849
|
};
|
|
3514
3850
|
|
|
3515
3851
|
// src/station/types/logs.types.ts
|
|
3516
|
-
import { DateTime as
|
|
3517
|
-
var
|
|
3852
|
+
import { DateTime as DateTime13 } from "luxon";
|
|
3853
|
+
var __dt13 = /* @__PURE__ */ __name((v, path) => {
|
|
3518
3854
|
if (typeof v !== "string") {
|
|
3519
3855
|
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
3520
3856
|
}
|
|
3521
|
-
const d =
|
|
3857
|
+
const d = DateTime13.fromISO(v);
|
|
3522
3858
|
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
3523
3859
|
return d;
|
|
3524
3860
|
}, "__dt");
|
|
3525
3861
|
function reviveLogSource(raw) {
|
|
3526
3862
|
const __o0 = raw;
|
|
3527
3863
|
if (__o0["lastWriteAt"] != null) {
|
|
3528
|
-
__o0["lastWriteAt"] =
|
|
3864
|
+
__o0["lastWriteAt"] = __dt13(__o0["lastWriteAt"], "LogSource.lastWriteAt");
|
|
3529
3865
|
}
|
|
3530
3866
|
return raw;
|
|
3531
3867
|
}
|
|
@@ -3543,12 +3879,12 @@ function reviveLogSourceList(raw) {
|
|
|
3543
3879
|
__name(reviveLogSourceList, "reviveLogSourceList");
|
|
3544
3880
|
|
|
3545
3881
|
// src/station/types/station.types.ts
|
|
3546
|
-
import { DateTime as
|
|
3547
|
-
var
|
|
3882
|
+
import { DateTime as DateTime14 } from "luxon";
|
|
3883
|
+
var __dt14 = /* @__PURE__ */ __name((v, path) => {
|
|
3548
3884
|
if (typeof v !== "string") {
|
|
3549
3885
|
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
3550
3886
|
}
|
|
3551
|
-
const d =
|
|
3887
|
+
const d = DateTime14.fromISO(v);
|
|
3552
3888
|
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
3553
3889
|
return d;
|
|
3554
3890
|
}, "__dt");
|
|
@@ -3556,15 +3892,15 @@ var __dtf = /* @__PURE__ */ __name((v, path, fmt) => {
|
|
|
3556
3892
|
if (typeof v !== "string") {
|
|
3557
3893
|
throw new TypeError(`ContractKit: expected a string at '${path}' in format ${fmt}, received ${typeof v}.`);
|
|
3558
3894
|
}
|
|
3559
|
-
const d =
|
|
3895
|
+
const d = DateTime14.fromFormat(v, fmt);
|
|
3560
3896
|
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' does not match format ${fmt}.`);
|
|
3561
3897
|
return d;
|
|
3562
3898
|
}, "__dtf");
|
|
3563
3899
|
function reviveStationHeartbeat(raw) {
|
|
3564
3900
|
const __o0 = raw;
|
|
3565
|
-
__o0["startedAt"] =
|
|
3901
|
+
__o0["startedAt"] = __dt14(__o0["startedAt"], "StationHeartbeat.startedAt");
|
|
3566
3902
|
if (__o0["lastBeat"] != null) {
|
|
3567
|
-
__o0["lastBeat"] =
|
|
3903
|
+
__o0["lastBeat"] = __dt14(__o0["lastBeat"], "StationHeartbeat.lastBeat");
|
|
3568
3904
|
}
|
|
3569
3905
|
return raw;
|
|
3570
3906
|
}
|
|
@@ -3579,7 +3915,7 @@ function reviveStationRelease(raw) {
|
|
|
3579
3915
|
__name(reviveStationRelease, "reviveStationRelease");
|
|
3580
3916
|
function reviveStationCheckup(raw) {
|
|
3581
3917
|
const __o0 = raw;
|
|
3582
|
-
__o0["readAt"] =
|
|
3918
|
+
__o0["readAt"] = __dt14(__o0["readAt"], "StationCheckup.readAt");
|
|
3583
3919
|
if (__o0["heartbeats"] != null) {
|
|
3584
3920
|
{
|
|
3585
3921
|
const __a1 = __o0["heartbeats"];
|
|
@@ -3600,7 +3936,7 @@ function reviveStationReleases(raw) {
|
|
|
3600
3936
|
}
|
|
3601
3937
|
}
|
|
3602
3938
|
if (__o0["checkedAt"] != null) {
|
|
3603
|
-
__o0["checkedAt"] =
|
|
3939
|
+
__o0["checkedAt"] = __dt14(__o0["checkedAt"], "StationReleases.checkedAt");
|
|
3604
3940
|
}
|
|
3605
3941
|
{
|
|
3606
3942
|
const __a3 = __o0["available"];
|
|
@@ -3613,24 +3949,24 @@ function reviveStationReleases(raw) {
|
|
|
3613
3949
|
__name(reviveStationReleases, "reviveStationReleases");
|
|
3614
3950
|
|
|
3615
3951
|
// src/station/types/traces.types.ts
|
|
3616
|
-
import { DateTime as
|
|
3617
|
-
var
|
|
3952
|
+
import { DateTime as DateTime15 } from "luxon";
|
|
3953
|
+
var __dt15 = /* @__PURE__ */ __name((v, path) => {
|
|
3618
3954
|
if (typeof v !== "string") {
|
|
3619
3955
|
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
3620
3956
|
}
|
|
3621
|
-
const d =
|
|
3957
|
+
const d = DateTime15.fromISO(v);
|
|
3622
3958
|
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
3623
3959
|
return d;
|
|
3624
3960
|
}, "__dt");
|
|
3625
3961
|
function reviveTraceDecision(raw) {
|
|
3626
3962
|
const __o0 = raw;
|
|
3627
|
-
__o0["at"] =
|
|
3963
|
+
__o0["at"] = __dt15(__o0["at"], "TraceDecision.at");
|
|
3628
3964
|
return raw;
|
|
3629
3965
|
}
|
|
3630
3966
|
__name(reviveTraceDecision, "reviveTraceDecision");
|
|
3631
3967
|
function reviveTraceSpan(raw) {
|
|
3632
3968
|
const __o0 = raw;
|
|
3633
|
-
__o0["at"] =
|
|
3969
|
+
__o0["at"] = __dt15(__o0["at"], "TraceSpan.at");
|
|
3634
3970
|
return raw;
|
|
3635
3971
|
}
|
|
3636
3972
|
__name(reviveTraceSpan, "reviveTraceSpan");
|
|
@@ -3777,18 +4113,18 @@ var StationClient = class {
|
|
|
3777
4113
|
};
|
|
3778
4114
|
|
|
3779
4115
|
// src/storage/types/storage.types.ts
|
|
3780
|
-
import { DateTime as
|
|
3781
|
-
var
|
|
4116
|
+
import { DateTime as DateTime16 } from "luxon";
|
|
4117
|
+
var __dt16 = /* @__PURE__ */ __name((v, path) => {
|
|
3782
4118
|
if (typeof v !== "string") {
|
|
3783
4119
|
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
3784
4120
|
}
|
|
3785
|
-
const d =
|
|
4121
|
+
const d = DateTime16.fromISO(v);
|
|
3786
4122
|
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
3787
4123
|
return d;
|
|
3788
4124
|
}, "__dt");
|
|
3789
4125
|
function reviveStorageReport(raw) {
|
|
3790
4126
|
const __o0 = raw;
|
|
3791
|
-
__o0["readAt"] =
|
|
4127
|
+
__o0["readAt"] = __dt16(__o0["readAt"], "StorageReport.readAt");
|
|
3792
4128
|
return raw;
|
|
3793
4129
|
}
|
|
3794
4130
|
__name(reviveStorageReport, "reviveStorageReport");
|
|
@@ -3977,6 +4313,7 @@ var DeadairSdk = class {
|
|
|
3977
4313
|
charts;
|
|
3978
4314
|
director;
|
|
3979
4315
|
history;
|
|
4316
|
+
messaging;
|
|
3980
4317
|
narrations;
|
|
3981
4318
|
news;
|
|
3982
4319
|
nowplaying;
|
|
@@ -3989,6 +4326,7 @@ var DeadairSdk = class {
|
|
|
3989
4326
|
podcasts;
|
|
3990
4327
|
productions;
|
|
3991
4328
|
render;
|
|
4329
|
+
requests;
|
|
3992
4330
|
schedule;
|
|
3993
4331
|
settings;
|
|
3994
4332
|
station;
|
|
@@ -4004,6 +4342,7 @@ var DeadairSdk = class {
|
|
|
4004
4342
|
this.charts = new ChartsClient(sdkFetch);
|
|
4005
4343
|
this.director = new DirectorClient(sdkFetch);
|
|
4006
4344
|
this.history = new HistoryClient(sdkFetch);
|
|
4345
|
+
this.messaging = new MessagingClient(sdkFetch);
|
|
4007
4346
|
this.narrations = new NarrationsClient(sdkFetch);
|
|
4008
4347
|
this.news = new NewsClient(sdkFetch);
|
|
4009
4348
|
this.nowplaying = new NowplayingClient(sdkFetch);
|
|
@@ -4016,6 +4355,7 @@ var DeadairSdk = class {
|
|
|
4016
4355
|
this.podcasts = new PodcastsClient(sdkFetch);
|
|
4017
4356
|
this.productions = new ProductionsClient(sdkFetch);
|
|
4018
4357
|
this.render = new RenderClient(sdkFetch);
|
|
4358
|
+
this.requests = new RequestsClient(sdkFetch);
|
|
4019
4359
|
this.schedule = new ScheduleClient(sdkFetch);
|
|
4020
4360
|
this.settings = new SettingsClient(sdkFetch);
|
|
4021
4361
|
this.station = new StationClient(sdkFetch);
|
|
@@ -4036,6 +4376,7 @@ export {
|
|
|
4036
4376
|
DeadairSdk,
|
|
4037
4377
|
DirectorClient,
|
|
4038
4378
|
HistoryClient,
|
|
4379
|
+
MessagingClient,
|
|
4039
4380
|
NarrationsClient,
|
|
4040
4381
|
NewsClient,
|
|
4041
4382
|
NowplayingClient,
|
|
@@ -4048,6 +4389,7 @@ export {
|
|
|
4048
4389
|
PodcastsClient,
|
|
4049
4390
|
ProductionsClient,
|
|
4050
4391
|
RenderClient,
|
|
4392
|
+
RequestsClient,
|
|
4051
4393
|
ScheduleClient,
|
|
4052
4394
|
SdkError,
|
|
4053
4395
|
SettingsClient,
|
|
@@ -4097,9 +4439,14 @@ export {
|
|
|
4097
4439
|
reviveHistoryEntry,
|
|
4098
4440
|
reviveHistoryPage,
|
|
4099
4441
|
reviveLinkAuthenticationLoginStartResponse,
|
|
4442
|
+
reviveListenerRequest,
|
|
4443
|
+
reviveListenerRequestList,
|
|
4100
4444
|
reviveLogSource,
|
|
4101
4445
|
reviveLogSourceList,
|
|
4102
4446
|
reviveLogin,
|
|
4447
|
+
reviveMessagingLink,
|
|
4448
|
+
reviveMessagingLinkCode,
|
|
4449
|
+
reviveMessagingLinkList,
|
|
4103
4450
|
reviveMfaEnrollFidoStartResponse,
|
|
4104
4451
|
reviveMfaEnrollPhoneStartResponse,
|
|
4105
4452
|
reviveMfaRequiredResponse,
|
|
@@ -4114,6 +4461,7 @@ export {
|
|
|
4114
4461
|
revivePad,
|
|
4115
4462
|
revivePadList,
|
|
4116
4463
|
revivePhoneFactorRegistrationResponse,
|
|
4464
|
+
revivePlaylistImportResult,
|
|
4117
4465
|
revivePluginDetail,
|
|
4118
4466
|
revivePluginImportResult,
|
|
4119
4467
|
revivePluginSummary,
|
|
@@ -4126,6 +4474,9 @@ export {
|
|
|
4126
4474
|
reviveSessionFactor,
|
|
4127
4475
|
reviveStationCheckup,
|
|
4128
4476
|
reviveStationHeartbeat,
|
|
4477
|
+
reviveStationPlaylist,
|
|
4478
|
+
reviveStationPlaylistDetail,
|
|
4479
|
+
reviveStationPlaylistList,
|
|
4129
4480
|
reviveStationRelease,
|
|
4130
4481
|
reviveStationReleases,
|
|
4131
4482
|
reviveStepUpStartResponse,
|