Skip to content

Commit 72daeb0

Browse files
committed
feat(LicenseManager): add deleteBinding
1 parent 51934a2 commit 72daeb0

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/clients/janus/LicenseManager/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
APIBindingCreate,
99
Addr,
1010
APICreateBindingRes,
11+
OptionsDeleteBinding,
1112
} from './types'
1213

1314
const TWO_MINUTES_S = 2 * 60
@@ -21,6 +22,7 @@ const routes = {
2122
listBindings: (tenant: string) => `${BASE_URL}/binding/site/${encodeURIComponent(tenant)}`,
2223
getBinding: (bindingId: string) => `${BASE_URL}/binding/${encodeURIComponent(bindingId)}`,
2324
createBinding: () => `${BASE_URL}/binding`,
25+
deleteBinding: (bindingId: string) => `${BASE_URL}/binding/${encodeURIComponent(bindingId)}`,
2426
}
2527

2628
export class LicenseManager extends JanusClient {
@@ -171,4 +173,21 @@ export class LicenseManager extends JanusClient {
171173
},
172174
})
173175
}
176+
177+
public deleteBinding = ({ adminUserAuthToken, bindingId }: OptionsDeleteBinding, config?: RequestConfig) => {
178+
const metric = 'lm-delete-binding'
179+
180+
return this.http.delete(routes.deleteBinding(bindingId), {
181+
inflightKey: inflightUrlWithQuery,
182+
metric,
183+
headers: {
184+
VtexIdclientAutCookie: adminUserAuthToken,
185+
},
186+
...config,
187+
tracing: {
188+
requestSpanNameSuffix: metric,
189+
...config?.tracing,
190+
},
191+
})
192+
}
174193
}

src/clients/janus/LicenseManager/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export interface OptionsGetBinding {
88
bindingId: string
99
}
1010

11+
export interface OptionsDeleteBinding {
12+
adminUserAuthToken: string
13+
bindingId: string
14+
}
15+
1116
export interface Addr {
1217
host: string
1318
path: string

0 commit comments

Comments
 (0)