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.
@@ -1,5 +1,5 @@
1
1
  import { IRegistryInfo } from './IRegistryInfo';
2
2
  export default interface RegistriesResponse {
3
3
  registries: IRegistryInfo[];
4
- defaultRegistryId?: string;
4
+ defaultPushRegistryId?: string;
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caprover-api",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "API client for CapRover",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
@@ -2,5 +2,5 @@ import { IRegistryInfo } from './IRegistryInfo'
2
2
 
3
3
  export default interface RegistriesResponse {
4
4
  registries: IRegistryInfo[]
5
- defaultRegistryId?: string
5
+ defaultPushRegistryId?: string
6
6
  }
@@ -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