@@ -18,11 +18,10 @@ export interface DeploymentOptions {
1818}
1919
2020export interface ProviderOptions {
21- appUrl ?: string | undefined ;
22- loginUrl ?: string | undefined ;
23- sessionTimeoutUrl ?: string | undefined ;
24- invalidTokenUrl ?: string | undefined ;
25- keysetUrl ?: string | undefined ;
21+ appRoute ?: string | undefined ;
22+ loginRoute ?: string | undefined ;
23+ keysetRoute ?: string | undefined ;
24+ dynregRoute ?: string | undefined ;
2625 https ?: boolean | undefined ;
2726 ssl ?: {
2827 key : string ;
@@ -35,15 +34,47 @@ export interface ProviderOptions {
3534 cookies ?: {
3635 secure ?: boolean | undefined ;
3736 sameSite ?: string | undefined ;
37+ domain ?: string | undefined ;
3838 } | undefined ;
39+ devMode ?: boolean | undefined ;
40+ ltiaas ?: boolean | undefined ;
41+ tokenMaxAge ?: number | undefined ;
42+ dynReg ?: {
43+ url : string ;
44+ name : string ;
45+ logo ?: string | undefined ;
46+ description ?: string | undefined ;
47+ redirectUris ?: string [ ] | undefined ;
48+ customParameters ?: any ;
49+ autoActivate ?: boolean | undefined ;
50+ useDeepLinking ?: boolean | undefined ;
51+ } | undefined ;
52+
53+ /**
54+ * @deprecated Use `appRoute` property instead.
55+ */
56+ appUrl ?: string | undefined ;
57+ /**
58+ * @deprecated Use `loginRoute` property instead.
59+ */
60+ loginUrl ?: string | undefined ;
61+ /**
62+ * @deprecated Use `keysetRoute` property instead.
63+ */
64+ keysetUrl ?: string | undefined ;
65+ }
66+
67+ export interface RequestCallback {
68+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
69+ ( request : Request , response : Response , next : NextFunction ) : Response | void ;
3970}
4071
41- export interface OnConnectCallback {
72+ export interface TokenRequestCallback {
4273 // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
43- ( connection : IdToken , request : Request , response : Response , next : NextFunction ) : Response | void ;
74+ ( token : IdToken , request : Request , response : Response , next : NextFunction ) : Response | void ;
4475}
4576
46- export interface UnregisteredPlatformCallback {
77+ export interface FinalRequestCallback {
4778 // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
4879 ( request : Request , response : Response ) : Response | void ;
4980}
@@ -58,6 +89,13 @@ export interface RedirectOptions {
5889 ignoreRoot ?: boolean | undefined ;
5990}
6091
92+ export type GetPlatformFunction = (
93+ url : string ,
94+ clientId ?: string ,
95+ ENCRYPTIONKEY ?: string ,
96+ Database ?: Database
97+ ) => Promise < Platform [ ] | Platform | false > ;
98+
6199declare class Provider {
62100 app : Express ;
63101
@@ -72,34 +110,43 @@ declare class Provider {
72110
73111 close ( ) : Promise < boolean > ;
74112
75- onConnect ( _connectCallback : OnConnectCallback , options ?: OnConnectOptions ) : true ;
113+ onConnect ( _connectCallback : TokenRequestCallback , options ?: OnConnectOptions ) : true ;
76114
77- onDeepLinking ( _connectCallback : OnConnectCallback , options ?: OnConnectOptions ) : true ;
115+ onDeepLinking ( _deepLinkingCallback : TokenRequestCallback ) : true ;
78116
79- onUnregisteredPlatform ( _unregisteredPlatformCallback : UnregisteredPlatformCallback ) : true ;
117+ onDynamicRegistration ( _dynamicRegistrationCallback : RequestCallback ) : true ;
80118
81- loginUrl ( ) : string ;
119+ onSessionTimeout ( _sessionTimeoutCallback : FinalRequestCallback ) : true ;
82120
83- appUrl ( ) : string ;
121+ onInvalidToken ( _invalidTokenCallback : FinalRequestCallback ) : true ;
84122
85- sessionTimeoutUrl ( ) : string ;
123+ onUnregisteredPlatform ( _unregisteredPlatformCallback : FinalRequestCallback ) : true ;
86124
87- invalidTokenUrl ( ) : string ;
125+ appRoute ( ) : string ;
88126
89- keysetUrl ( ) : string ;
127+ loginRoute ( ) : string ;
128+
129+ keysetRoute ( ) : string ;
130+
131+ dynRegRoute ( ) : string ;
90132
91133 whitelist ( ...urls : Array < string | { route : string ; method : string } > ) : true ;
92134
93- registerPlatform ( config : PlatformConfig ) : Promise < Platform | false > ;
135+ registerPlatform ( platform : PlatformConfig , getPlatform ?: GetPlatformFunction , ENCRYPTIONKEY ?: string , Database ?: Database ) : Promise < Platform > ;
94136
95- getPlatform ( url : string ) : Promise < Platform [ ] | false > ;
96- getPlatform ( url : string , clientId : string ) : Promise < Platform | false > ;
137+ getPlatform ( url : string , clientId ?: string , ENCRYPTIONKEY ?: string , Database ?: Database ) : Promise < Platform [ ] | Platform | false > ;
97138
98- deletePlatform ( url : string , clientId : string ) : Promise < boolean > ;
139+ updatePlatformById ( platformId : string , platformInfo : PlatformConfig ) : Promise < Platform > ;
99140
100- getAllPlatforms ( ) : Promise < Platform [ ] | false > ;
141+ deletePlatform ( url : string , clientId : string ) : Promise < true > ;
142+
143+ getAllPlatforms ( ) : Promise < Platform [ ] > ;
101144
102145 redirect ( response : Response , path : string , options ?: RedirectOptions ) : void ;
146+
147+ appUrl ( ) : string ;
148+ loginUrl ( ) : string ;
149+ keysetUrl ( ) : string ;
103150}
104151
105152declare const defaultProvider : Provider ;
0 commit comments