1- import { RequestTracingConfig , inflightUrlWithQuery } from '../../../HttpClient'
1+ import { RequestTracingConfig , RequestConfig , inflightUrlWithQuery } from '../../../HttpClient'
22import { JanusClient } from '../JanusClient'
3+ import { OptionsListBindings , APIBindingRes } from './types'
34
45const TWO_MINUTES_S = 2 * 60
56
@@ -9,6 +10,7 @@ const routes = {
910 accountData : ( ) => `${ BASE_URL } /account` ,
1011 resourceAccess : ( resourceKey : string ) => `${ BASE_URL } /resources/${ resourceKey } /access` ,
1112 topbarData : ( ) => `${ BASE_URL } /site/pvt/newtopbar` ,
13+ listBindings : ( tenant : string ) => `${ BASE_URL } /binding/site/${ tenant } ` ,
1214}
1315
1416export class LicenseManager extends JanusClient {
@@ -60,4 +62,21 @@ export class LicenseManager extends JanusClient {
6062 ( ) => false
6163 )
6264 }
65+
66+ public listBindings = ( { tenant, adminUserAuthToken } : OptionsListBindings , config ?: RequestConfig ) => {
67+ const metric = 'lm-list-bindings'
68+ return this . http . get < APIBindingRes [ ] > ( routes . listBindings ( tenant ) , {
69+ inflightKey : inflightUrlWithQuery ,
70+ memoizeable : true ,
71+ metric,
72+ headers : {
73+ VtexIdclientAutCookie : adminUserAuthToken ,
74+ } ,
75+ ...config ,
76+ tracing : {
77+ requestSpanNameSuffix : metric ,
78+ ...config ?. tracing ,
79+ } ,
80+ } )
81+ }
6382}
0 commit comments