@ninedeploy/sdk 0.18.4 → 0.18.10

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.
Files changed (54) hide show
  1. package/dist/index.d.ts +2 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/resources/auth.d.ts +20 -1
  4. package/dist/resources/auth.d.ts.map +1 -1
  5. package/dist/resources/auth.js +9 -0
  6. package/dist/resources/auth.js.map +1 -1
  7. package/dist/resources/databases.d.ts +6 -1
  8. package/dist/resources/databases.d.ts.map +1 -1
  9. package/dist/resources/databases.js +4 -0
  10. package/dist/resources/databases.js.map +1 -1
  11. package/dist/resources/deploys.d.ts +34 -1
  12. package/dist/resources/deploys.d.ts.map +1 -1
  13. package/dist/resources/deploys.js +11 -0
  14. package/dist/resources/deploys.js.map +1 -1
  15. package/dist/resources/domains.d.ts +16 -1
  16. package/dist/resources/domains.d.ts.map +1 -1
  17. package/dist/resources/domains.js +9 -0
  18. package/dist/resources/domains.js.map +1 -1
  19. package/dist/resources/servers.d.ts +49 -1
  20. package/dist/resources/servers.d.ts.map +1 -1
  21. package/dist/resources/servers.js +26 -0
  22. package/dist/resources/servers.js.map +1 -1
  23. package/dist/resources/services.d.ts +78 -1
  24. package/dist/resources/services.d.ts.map +1 -1
  25. package/dist/resources/services.js +47 -0
  26. package/dist/resources/services.js.map +1 -1
  27. package/dist/resources/settings.d.ts +47 -2
  28. package/dist/resources/settings.d.ts.map +1 -1
  29. package/dist/resources/settings.js +6 -0
  30. package/dist/resources/settings.js.map +1 -1
  31. package/dist/resources/sources.d.ts +6 -1
  32. package/dist/resources/sources.d.ts.map +1 -1
  33. package/dist/resources/sources.js +5 -0
  34. package/dist/resources/sources.js.map +1 -1
  35. package/dist/resources/system.d.ts +20 -1
  36. package/dist/resources/system.d.ts.map +1 -1
  37. package/dist/resources/system.js +8 -0
  38. package/dist/resources/system.js.map +1 -1
  39. package/dist/resources/traefik.d.ts +9 -0
  40. package/dist/resources/traefik.d.ts.map +1 -1
  41. package/dist/resources/traefik.js +4 -0
  42. package/dist/resources/traefik.js.map +1 -1
  43. package/package.json +2 -2
  44. package/src/index.ts +2 -2
  45. package/src/resources/auth.ts +25 -0
  46. package/src/resources/databases.ts +11 -0
  47. package/src/resources/deploys.ts +37 -0
  48. package/src/resources/domains.ts +30 -0
  49. package/src/resources/servers.ts +80 -0
  50. package/src/resources/services.ts +138 -0
  51. package/src/resources/settings.ts +45 -1
  52. package/src/resources/sources.ts +12 -0
  53. package/src/resources/system.ts +24 -0
  54. package/src/resources/traefik.ts +9 -0
@@ -10,6 +10,8 @@ import type {
10
10
  GithubAppManifestRequest,
11
11
  GithubAppManifestResponse,
12
12
  GithubAppPatch,
13
+ GithubRunnerConfig,
14
+ GithubRunnerStatus,
13
15
  } from '@ninedeploy/schemas';
14
16
  import type { GithubAppInstallationSync, SourceRepo, SourceUpdateInput } from '../types.js';
15
17
  import type { Transport } from '../transport.js';
@@ -88,6 +90,11 @@ export interface SourcesApi {
88
90
  remove: (id: number) => Promise<void>;
89
91
  syncInstallations: (id: number) => Promise<GithubAppInstallationSync>;
90
92
  installations: (id: number) => Promise<GithubAppInstallation[]>;
93
+ /** Self-hosted Actions runners (G4.5): settings, waiting jobs, running runners and what is missing. */
94
+ runners: (id: number) => Promise<GithubRunnerStatus>;
95
+ setRunners: (id: number, config: GithubRunnerConfig) => Promise<GithubRunnerStatus>;
96
+ /** Stop one runner container (and remove its registration on GitHub). */
97
+ stopRunner: (id: number, name: string) => Promise<void>;
91
98
  };
92
99
  }
93
100
 
@@ -126,6 +133,11 @@ export function sourcesApi(t: Transport): SourcesApi {
126
133
  },
127
134
  syncInstallations: (id) => send<GithubAppInstallationSync>('POST', `/v1/github-apps/${id}/installations/sync`),
128
135
  installations: (id) => get<GithubAppInstallation[]>(`/v1/github-apps/${id}/installations`),
136
+ runners: (id) => get<GithubRunnerStatus>(`/v1/github-apps/${id}/runners`),
137
+ setRunners: (id, config) => send<GithubRunnerStatus>('PUT', `/v1/github-apps/${id}/runners`, config),
138
+ stopRunner: async (id, name) => {
139
+ await request(`/v1/github-apps/${id}/runners/${encodeURIComponent(name)}`, { method: 'DELETE' });
140
+ },
129
141
  },
130
142
  };
131
143
  }
@@ -25,11 +25,27 @@ import type {
25
25
  PanelBackupRestore,
26
26
  PanelBackupSettingsPatch,
27
27
  PanelBackupStatus,
28
+ GitopsApplyStep,
29
+ GitopsCheck,
30
+ GitopsConfigInput,
31
+ GitopsView,
28
32
  } from '@ninedeploy/schemas';
29
33
  import type { HealthStatus, ImageInfo, PruneImagesInput, PruneImagesResult } from '../types.js';
30
34
  import type { Transport } from '../transport.js';
31
35
 
32
36
  export interface SystemApi {
37
+ /** G5.3 instance GitOps (operators): the instance as a file in a repository. */
38
+ gitops: {
39
+ get: () => Promise<GitopsView>;
40
+ configure: (input: GitopsConfigInput) => Promise<GitopsView>;
41
+ remove: () => Promise<{ ok: true }>;
42
+ /** Read the file now and report the drift. */
43
+ check: () => Promise<GitopsCheck>;
44
+ /** Create and update what the file names (never deletes). */
45
+ apply: () => Promise<{ steps: GitopsApplyStep[]; check: GitopsCheck }>;
46
+ /** The live instance as the file, to commit. */
47
+ export: () => Promise<{ file: string }>;
48
+ };
33
49
  system: {
34
50
  resources: () => Promise<DockerResources>;
35
51
  pruneImages: () => Promise<{ ok: boolean }>;
@@ -175,6 +191,14 @@ export interface SystemApi {
175
191
  export function systemApi(t: Transport): SystemApi {
176
192
  const { get, send, request } = t;
177
193
  return {
194
+ gitops: {
195
+ get: () => get<GitopsView>('/v1/gitops'),
196
+ configure: (input) => send<GitopsView>('PUT', '/v1/gitops', input),
197
+ remove: () => send<{ ok: true }>('DELETE', '/v1/gitops'),
198
+ check: () => send<GitopsCheck>('POST', '/v1/gitops/check'),
199
+ apply: () => send<{ steps: GitopsApplyStep[]; check: GitopsCheck }>('POST', '/v1/gitops/apply'),
200
+ export: () => get<{ file: string }>('/v1/gitops/export?format=json'),
201
+ },
178
202
  system: {
179
203
  resources: () => get<DockerResources>('/v1/system/resources'),
180
204
  pruneImages: () => send<{ ok: boolean }>('POST', '/v1/system/prune-images'),
@@ -76,6 +76,11 @@ export interface TraefikApi {
76
76
  replace: (id: number, input: CustomCertificateReplace) => Promise<CustomCertificateSaved>;
77
77
  delete: (id: number) => Promise<{ ok: boolean }>;
78
78
  };
79
+ /** G5.7: give node proxies the panel's ACME certificates for the hosts they route (operator; off by default). */
80
+ sharedCertificates: {
81
+ get: () => Promise<{ enabled: boolean }>;
82
+ set: (enabled: boolean) => Promise<{ enabled: boolean }>;
83
+ };
79
84
  };
80
85
  }
81
86
 
@@ -120,6 +125,10 @@ export function traefikApi(t: Transport): TraefikApi {
120
125
  replace: (id, input) => send<CustomCertificateSaved>('PUT', `/v1/traefik/certificates/custom/${id}`, input),
121
126
  delete: (id) => send<{ ok: boolean }>('DELETE', `/v1/traefik/certificates/custom/${id}`),
122
127
  },
128
+ sharedCertificates: {
129
+ get: () => get<{ enabled: boolean }>('/v1/traefik/certificates/shared'),
130
+ set: (enabled) => send<{ enabled: boolean }>('PUT', '/v1/traefik/certificates/shared', { enabled }),
131
+ },
123
132
  },
124
133
  };
125
134
  }