caprover-api 0.0.24 → 0.0.25
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/package.json
CHANGED
package/test/ApiManager.test.js
CHANGED
|
@@ -182,3 +182,19 @@ test('getOneClickAppByName returns the parsed template object', async () => {
|
|
|
182
182
|
})
|
|
183
183
|
assert.strictEqual(response.appTemplate, appTemplate)
|
|
184
184
|
})
|
|
185
|
+
|
|
186
|
+
test('getDockerRegistries exposes the backend default push registry ID', async () => {
|
|
187
|
+
const registries = [{ id: 'registry-1', registryDomain: 'ghcr.io' }]
|
|
188
|
+
const data = { registries, defaultPushRegistryId: 'registry-1' }
|
|
189
|
+
const { api, requests } = createApiWithRequestRecorder(data)
|
|
190
|
+
|
|
191
|
+
const response = await api.getDockerRegistries()
|
|
192
|
+
|
|
193
|
+
assert.deepEqual(requests, [{
|
|
194
|
+
method: 'GET',
|
|
195
|
+
endpoint: '/user/registries',
|
|
196
|
+
data: {},
|
|
197
|
+
bodyType: 'json',
|
|
198
|
+
}])
|
|
199
|
+
assert.strictEqual(response, data)
|
|
200
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type CapRoverAPI from '../dist'
|
|
2
|
+
|
|
3
|
+
type RegistriesResponse = Awaited<ReturnType<CapRoverAPI['getDockerRegistries']>>
|
|
4
|
+
|
|
5
|
+
declare const response: RegistriesResponse
|
|
6
|
+
const defaultPushRegistryId: string | undefined = response.defaultPushRegistryId
|
|
7
|
+
|
|
8
|
+
// @ts-expect-error The backend never returns this old property.
|
|
9
|
+
response.defaultRegistryId
|
|
10
|
+
|
|
11
|
+
void defaultPushRegistryId
|