@@ -19,6 +19,17 @@ exports.info = functions.https.onRequest((req, res) => {
1919
2020const verifyIdToken = ( token ) => admin . auth ( ) . verifyIdToken ( token ) ;
2121
22+ const supportedProductIds = ( functions . config ( ) . paddle . product_ids || '' )
23+ . split ( ',' )
24+ . filter ( Boolean ) ;
25+ const checkSupportedProductIds = ( productId ) => {
26+ return productId && supportedProductIds . includes ( productId ) ;
27+ } ;
28+
29+ exports . supported_product_ids = functions . https . onRequest ( async ( req , res ) => {
30+ res . status ( 200 ) . send ( JSON . stringify ( supportedProductIds ) ) ;
31+ } ) ;
32+
2233exports . authenticate = functions . https . onRequest ( async ( req , res ) => {
2334 console . log ( 'request:' , req ) ;
2435 const auth = req . get ( 'Authorization' ) ;
@@ -48,19 +59,6 @@ exports.sync_diagram = functions.https.onRequest(async (req, res) => {
4859 console . log ( 'using LaraSite URL:' , baseUrlHttps ) ;
4960 console . log ( 'using publicBaseUrl:' , publicBaseUrl ) ;
5061
51- const supportedProductIds = ( functions . config ( ) . paddle . product_ids || '' )
52- . split ( ',' )
53- . filter ( Boolean ) ;
54- const checkSupportedProductIds = ( productId ) => {
55- return productId && supportedProductIds . includes ( productId ) ;
56- } ;
57-
58- exports . supported_product_ids = functions . https . onRequest (
59- async ( req , res ) => {
60- res . status ( 200 ) . send ( JSON . stringify ( supportedProductIds ) ) ;
61- } ,
62- ) ;
63-
6462 const replaceBaseUrlInShareLink = ( responseData ) => {
6563 const data = JSON . parse ( responseData ) ;
6664 data . page_share = data . page_share
0 commit comments