@churchapps/content-providers 0.10.0 → 0.12.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/LICENSE +21 -21
- package/README.md +107 -105
- package/dist/index.cjs +4993 -1364
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -2
- package/dist/index.d.ts +49 -2
- package/dist/index.js +4988 -1364
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -38,7 +38,14 @@ interface DeviceFlowState {
|
|
|
38
38
|
error?: string;
|
|
39
39
|
pollCount?: number;
|
|
40
40
|
}
|
|
41
|
-
type AuthType = "none" | "oauth_pkce" | "device_flow" | "form_login";
|
|
41
|
+
type AuthType = "none" | "oauth_pkce" | "device_flow" | "form_login" | "network_discovery";
|
|
42
|
+
interface NetworkInstance {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
host: string;
|
|
46
|
+
ip: string;
|
|
47
|
+
port: number;
|
|
48
|
+
}
|
|
42
49
|
interface ProviderLogos {
|
|
43
50
|
light: string;
|
|
44
51
|
dark: string;
|
|
@@ -248,6 +255,7 @@ interface IProvider {
|
|
|
248
255
|
initiateDeviceFlow?(): Promise<DeviceAuthorizationResponse | null>;
|
|
249
256
|
pollDeviceFlowToken?(deviceCode: string): Promise<DeviceFlowPollResult>;
|
|
250
257
|
performLogin?(email: string, password: string): Promise<ContentProviderAuthData | null>;
|
|
258
|
+
discoverInstances?(): Promise<NetworkInstance[]>;
|
|
251
259
|
getPlaylist?(path: string, auth?: ContentProviderAuthData | null, resolution?: number): Promise<ContentFile[] | null>;
|
|
252
260
|
getInstructions?(path: string, auth?: ContentProviderAuthData | null): Promise<Instructions | null>;
|
|
253
261
|
getCurrentPlan?(auth?: ContentProviderAuthData | null): Promise<CurrentPlan | null>;
|
|
@@ -563,6 +571,45 @@ declare class CbnProvider extends BaseProvider {
|
|
|
563
571
|
pollDeviceFlowToken(deviceCode: string): Promise<DeviceFlowPollResult>;
|
|
564
572
|
}
|
|
565
573
|
|
|
574
|
+
type FreeShowDiscoverer = () => Promise<NetworkInstance[]>;
|
|
575
|
+
|
|
576
|
+
declare class FreeShowProvider extends BaseProvider {
|
|
577
|
+
readonly id = "freeshow";
|
|
578
|
+
readonly name = "FreeShow";
|
|
579
|
+
readonly logos: ProviderLogos;
|
|
580
|
+
readonly config: ContentProviderConfig;
|
|
581
|
+
readonly requiresAuth = true;
|
|
582
|
+
readonly authTypes: AuthType[];
|
|
583
|
+
readonly capabilities: ProviderCapabilities;
|
|
584
|
+
private discoverer;
|
|
585
|
+
/** mDNS needs native code, so the host app browses `_freeshow._udp` and maps results with freeShowServicesToInstances. */
|
|
586
|
+
setDiscoverer(discoverer: FreeShowDiscoverer | null): void;
|
|
587
|
+
discoverInstances(): Promise<NetworkInstance[]>;
|
|
588
|
+
toAuth(instance: NetworkInstance): ContentProviderAuthData;
|
|
589
|
+
selectedInstance(auth?: ContentProviderAuthData | null): NetworkInstance | null;
|
|
590
|
+
private requireInstance;
|
|
591
|
+
browse(path?: string | null, auth?: ContentProviderAuthData | null): Promise<ContentItem[]>;
|
|
592
|
+
private showFiles;
|
|
593
|
+
private load;
|
|
594
|
+
getPlaylist(path: string, auth?: ContentProviderAuthData | null, _resolution?: number): Promise<ContentFile[] | null>;
|
|
595
|
+
getInstructions(path: string, auth?: ContentProviderAuthData | null): Promise<Instructions | null>;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
declare const FREESHOW_REST_PORT = 5506;
|
|
599
|
+
interface MdnsService {
|
|
600
|
+
name: string;
|
|
601
|
+
host?: string | null;
|
|
602
|
+
txt?: Record<string, string>;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* FreeShow advertises its Remote/Stage/etc. servers (not its API) as `_freeshow._udp`, named `freeshow-<SERVER>-<instanceId>`,
|
|
606
|
+
* with TXT `ip` and `ips` (comma-joined). Group by machine and pick the address that answers the REST API.
|
|
607
|
+
*/
|
|
608
|
+
declare function servicesToInstances(services: MdnsService[], port?: number): Promise<NetworkInstance[]>;
|
|
609
|
+
|
|
610
|
+
declare function networkInstanceToAuth(instance: NetworkInstance): ContentProviderAuthData;
|
|
611
|
+
declare function authToNetworkInstance(auth?: ContentProviderAuthData | null): NetworkInstance | null;
|
|
612
|
+
|
|
566
613
|
/** Browses Life.Church's kids curriculum from a static catalog (series → units → lessons), plus a weekly scheduled lesson index. */
|
|
567
614
|
declare class LifeChurchProvider extends BaseProvider {
|
|
568
615
|
readonly id = "lifechurch";
|
|
@@ -606,4 +653,4 @@ declare function getAvailableProviders(ids?: string[]): ProviderInfo[];
|
|
|
606
653
|
*/
|
|
607
654
|
declare const VERSION: string;
|
|
608
655
|
|
|
609
|
-
export { APlayProvider, type AuthType, B1ChurchProvider, BaseProvider, BibleProjectProvider, CbnProvider, type ContentDownload, type ContentFile, type ContentFolder, type ContentItem, type ContentProviderAuthData, type ContentProviderConfig, type CurrentPlan, type DeviceAuthorizationResponse, DeviceFlowHelper, type DeviceFlowPollResult, type DeviceFlowState, DropboxProvider, type EndpointValue, type EndpointsConfig, type FeedActionInterface, type FeedDownloadInterface, type FeedFileInterface, type FeedSectionInterface, type FeedVenueInterface, HighVoltageKidsProvider, type IProvider, type InstructionItem, type Instructions, JesusFilmProvider, LessonsChurchProvider, LifeChurchProvider, type MediaLicenseResult, type MediaLicenseStatus, type MessageFileInterface, OAuthHelper, type Plan, type PlanPresentation, type PlanSection, type PlanTimelineItem, PlanningCenterProvider, type ProviderCapabilities, type ProviderInfo, type ProviderLogos, SignPresenterProvider, TokenHelper, VERSION, type VenueActionInterface, type VenueActionsResponseInterface, type VenueSectionActionsInterface, authIsExpired, getAllProviders, getAvailableProviders, getProvider, getProviderConfig, isContentFile, isContentFolder, navigateToPath, registerProvider, setProviderSecret, toAuthData };
|
|
656
|
+
export { APlayProvider, type AuthType, B1ChurchProvider, BaseProvider, BibleProjectProvider, CbnProvider, type ContentDownload, type ContentFile, type ContentFolder, type ContentItem, type ContentProviderAuthData, type ContentProviderConfig, type CurrentPlan, type DeviceAuthorizationResponse, DeviceFlowHelper, type DeviceFlowPollResult, type DeviceFlowState, DropboxProvider, type EndpointValue, type EndpointsConfig, FREESHOW_REST_PORT, type FeedActionInterface, type FeedDownloadInterface, type FeedFileInterface, type FeedSectionInterface, type FeedVenueInterface, type FreeShowDiscoverer, FreeShowProvider, HighVoltageKidsProvider, type IProvider, type InstructionItem, type Instructions, JesusFilmProvider, LessonsChurchProvider, LifeChurchProvider, type MdnsService, type MediaLicenseResult, type MediaLicenseStatus, type MessageFileInterface, type NetworkInstance, OAuthHelper, type Plan, type PlanPresentation, type PlanSection, type PlanTimelineItem, PlanningCenterProvider, type ProviderCapabilities, type ProviderInfo, type ProviderLogos, SignPresenterProvider, TokenHelper, VERSION, type VenueActionInterface, type VenueActionsResponseInterface, type VenueSectionActionsInterface, authIsExpired, authToNetworkInstance, servicesToInstances as freeShowServicesToInstances, getAllProviders, getAvailableProviders, getProvider, getProviderConfig, isContentFile, isContentFolder, navigateToPath, networkInstanceToAuth, registerProvider, setProviderSecret, toAuthData };
|
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,14 @@ interface DeviceFlowState {
|
|
|
38
38
|
error?: string;
|
|
39
39
|
pollCount?: number;
|
|
40
40
|
}
|
|
41
|
-
type AuthType = "none" | "oauth_pkce" | "device_flow" | "form_login";
|
|
41
|
+
type AuthType = "none" | "oauth_pkce" | "device_flow" | "form_login" | "network_discovery";
|
|
42
|
+
interface NetworkInstance {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
host: string;
|
|
46
|
+
ip: string;
|
|
47
|
+
port: number;
|
|
48
|
+
}
|
|
42
49
|
interface ProviderLogos {
|
|
43
50
|
light: string;
|
|
44
51
|
dark: string;
|
|
@@ -248,6 +255,7 @@ interface IProvider {
|
|
|
248
255
|
initiateDeviceFlow?(): Promise<DeviceAuthorizationResponse | null>;
|
|
249
256
|
pollDeviceFlowToken?(deviceCode: string): Promise<DeviceFlowPollResult>;
|
|
250
257
|
performLogin?(email: string, password: string): Promise<ContentProviderAuthData | null>;
|
|
258
|
+
discoverInstances?(): Promise<NetworkInstance[]>;
|
|
251
259
|
getPlaylist?(path: string, auth?: ContentProviderAuthData | null, resolution?: number): Promise<ContentFile[] | null>;
|
|
252
260
|
getInstructions?(path: string, auth?: ContentProviderAuthData | null): Promise<Instructions | null>;
|
|
253
261
|
getCurrentPlan?(auth?: ContentProviderAuthData | null): Promise<CurrentPlan | null>;
|
|
@@ -563,6 +571,45 @@ declare class CbnProvider extends BaseProvider {
|
|
|
563
571
|
pollDeviceFlowToken(deviceCode: string): Promise<DeviceFlowPollResult>;
|
|
564
572
|
}
|
|
565
573
|
|
|
574
|
+
type FreeShowDiscoverer = () => Promise<NetworkInstance[]>;
|
|
575
|
+
|
|
576
|
+
declare class FreeShowProvider extends BaseProvider {
|
|
577
|
+
readonly id = "freeshow";
|
|
578
|
+
readonly name = "FreeShow";
|
|
579
|
+
readonly logos: ProviderLogos;
|
|
580
|
+
readonly config: ContentProviderConfig;
|
|
581
|
+
readonly requiresAuth = true;
|
|
582
|
+
readonly authTypes: AuthType[];
|
|
583
|
+
readonly capabilities: ProviderCapabilities;
|
|
584
|
+
private discoverer;
|
|
585
|
+
/** mDNS needs native code, so the host app browses `_freeshow._udp` and maps results with freeShowServicesToInstances. */
|
|
586
|
+
setDiscoverer(discoverer: FreeShowDiscoverer | null): void;
|
|
587
|
+
discoverInstances(): Promise<NetworkInstance[]>;
|
|
588
|
+
toAuth(instance: NetworkInstance): ContentProviderAuthData;
|
|
589
|
+
selectedInstance(auth?: ContentProviderAuthData | null): NetworkInstance | null;
|
|
590
|
+
private requireInstance;
|
|
591
|
+
browse(path?: string | null, auth?: ContentProviderAuthData | null): Promise<ContentItem[]>;
|
|
592
|
+
private showFiles;
|
|
593
|
+
private load;
|
|
594
|
+
getPlaylist(path: string, auth?: ContentProviderAuthData | null, _resolution?: number): Promise<ContentFile[] | null>;
|
|
595
|
+
getInstructions(path: string, auth?: ContentProviderAuthData | null): Promise<Instructions | null>;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
declare const FREESHOW_REST_PORT = 5506;
|
|
599
|
+
interface MdnsService {
|
|
600
|
+
name: string;
|
|
601
|
+
host?: string | null;
|
|
602
|
+
txt?: Record<string, string>;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* FreeShow advertises its Remote/Stage/etc. servers (not its API) as `_freeshow._udp`, named `freeshow-<SERVER>-<instanceId>`,
|
|
606
|
+
* with TXT `ip` and `ips` (comma-joined). Group by machine and pick the address that answers the REST API.
|
|
607
|
+
*/
|
|
608
|
+
declare function servicesToInstances(services: MdnsService[], port?: number): Promise<NetworkInstance[]>;
|
|
609
|
+
|
|
610
|
+
declare function networkInstanceToAuth(instance: NetworkInstance): ContentProviderAuthData;
|
|
611
|
+
declare function authToNetworkInstance(auth?: ContentProviderAuthData | null): NetworkInstance | null;
|
|
612
|
+
|
|
566
613
|
/** Browses Life.Church's kids curriculum from a static catalog (series → units → lessons), plus a weekly scheduled lesson index. */
|
|
567
614
|
declare class LifeChurchProvider extends BaseProvider {
|
|
568
615
|
readonly id = "lifechurch";
|
|
@@ -606,4 +653,4 @@ declare function getAvailableProviders(ids?: string[]): ProviderInfo[];
|
|
|
606
653
|
*/
|
|
607
654
|
declare const VERSION: string;
|
|
608
655
|
|
|
609
|
-
export { APlayProvider, type AuthType, B1ChurchProvider, BaseProvider, BibleProjectProvider, CbnProvider, type ContentDownload, type ContentFile, type ContentFolder, type ContentItem, type ContentProviderAuthData, type ContentProviderConfig, type CurrentPlan, type DeviceAuthorizationResponse, DeviceFlowHelper, type DeviceFlowPollResult, type DeviceFlowState, DropboxProvider, type EndpointValue, type EndpointsConfig, type FeedActionInterface, type FeedDownloadInterface, type FeedFileInterface, type FeedSectionInterface, type FeedVenueInterface, HighVoltageKidsProvider, type IProvider, type InstructionItem, type Instructions, JesusFilmProvider, LessonsChurchProvider, LifeChurchProvider, type MediaLicenseResult, type MediaLicenseStatus, type MessageFileInterface, OAuthHelper, type Plan, type PlanPresentation, type PlanSection, type PlanTimelineItem, PlanningCenterProvider, type ProviderCapabilities, type ProviderInfo, type ProviderLogos, SignPresenterProvider, TokenHelper, VERSION, type VenueActionInterface, type VenueActionsResponseInterface, type VenueSectionActionsInterface, authIsExpired, getAllProviders, getAvailableProviders, getProvider, getProviderConfig, isContentFile, isContentFolder, navigateToPath, registerProvider, setProviderSecret, toAuthData };
|
|
656
|
+
export { APlayProvider, type AuthType, B1ChurchProvider, BaseProvider, BibleProjectProvider, CbnProvider, type ContentDownload, type ContentFile, type ContentFolder, type ContentItem, type ContentProviderAuthData, type ContentProviderConfig, type CurrentPlan, type DeviceAuthorizationResponse, DeviceFlowHelper, type DeviceFlowPollResult, type DeviceFlowState, DropboxProvider, type EndpointValue, type EndpointsConfig, FREESHOW_REST_PORT, type FeedActionInterface, type FeedDownloadInterface, type FeedFileInterface, type FeedSectionInterface, type FeedVenueInterface, type FreeShowDiscoverer, FreeShowProvider, HighVoltageKidsProvider, type IProvider, type InstructionItem, type Instructions, JesusFilmProvider, LessonsChurchProvider, LifeChurchProvider, type MdnsService, type MediaLicenseResult, type MediaLicenseStatus, type MessageFileInterface, type NetworkInstance, OAuthHelper, type Plan, type PlanPresentation, type PlanSection, type PlanTimelineItem, PlanningCenterProvider, type ProviderCapabilities, type ProviderInfo, type ProviderLogos, SignPresenterProvider, TokenHelper, VERSION, type VenueActionInterface, type VenueActionsResponseInterface, type VenueSectionActionsInterface, authIsExpired, authToNetworkInstance, servicesToInstances as freeShowServicesToInstances, getAllProviders, getAvailableProviders, getProvider, getProviderConfig, isContentFile, isContentFolder, navigateToPath, networkInstanceToAuth, registerProvider, setProviderSecret, toAuthData };
|