@distr-sh/distr-sdk 2.5.2
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/README.md +28 -0
- package/dist/client/client.d.ts +34 -0
- package/dist/client/client.js +115 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/config.d.ts +4 -0
- package/dist/client/config.js +2 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/service.d.ts +151 -0
- package/dist/client/service.js +235 -0
- package/dist/client/service.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/types/access-token.d.ts +13 -0
- package/dist/types/access-token.js +2 -0
- package/dist/types/access-token.js.map +1 -0
- package/dist/types/agent-version.d.ts +4 -0
- package/dist/types/agent-version.js +2 -0
- package/dist/types/agent-version.js.map +1 -0
- package/dist/types/application.d.ts +26 -0
- package/dist/types/application.js +2 -0
- package/dist/types/application.js.map +1 -0
- package/dist/types/base.d.ts +16 -0
- package/dist/types/base.js +2 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/customer-organization.d.ts +14 -0
- package/dist/types/customer-organization.js +2 -0
- package/dist/types/customer-organization.js.map +1 -0
- package/dist/types/deployment-target.d.ts +28 -0
- package/dist/types/deployment-target.js +2 -0
- package/dist/types/deployment-target.js.map +1 -0
- package/dist/types/deployment.d.ts +45 -0
- package/dist/types/deployment.js +2 -0
- package/dist/types/deployment.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/organization-branding.d.ts +8 -0
- package/dist/types/organization-branding.js +2 -0
- package/dist/types/organization-branding.js.map +1 -0
- package/dist/types/user-account.d.ts +13 -0
- package/dist/types/user-account.js +2 -0
- package/dist/types/user-account.js.map +1 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Distr SDK
|
|
2
|
+
|
|
3
|
+
You can install the Distr SDK for JavaScript from [npmjs.org](https://npmjs.org/):
|
|
4
|
+
|
|
5
|
+
```shell
|
|
6
|
+
npm install --save @distr-sh/distr-sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Conceptually, the SDK is divided into two parts:
|
|
10
|
+
|
|
11
|
+
- A high-level service called `DistrService`, which provides a simplified interface for interacting with the Distr API.
|
|
12
|
+
- A low-level client called `Client`, which provides a more direct interface for interacting with the Distr API.
|
|
13
|
+
|
|
14
|
+
In order to connect to the Distr API, you have to create a Personal Access Token (PAT) in the Distr web interface.
|
|
15
|
+
Optionally, you can specify the URL of the Distr API you want to communicate with. It defaults to `https://app.distr.sh/api/v1`.
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import {DistrService} from '@distr-sh/distr-sdk';
|
|
19
|
+
const service = new DistrService({
|
|
20
|
+
// to use your selfhosted instance, set apiBase: 'https://selfhosted-instance.company/api/v1',
|
|
21
|
+
apiKey: '<your-personal-access-token-here>',
|
|
22
|
+
});
|
|
23
|
+
// do something with the service
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The [src/examples](https://github.com/distr-sh/distr/tree/main/sdk/js/src/examples) directory contains examples of how to use the SDK.
|
|
27
|
+
|
|
28
|
+
See the [docs](https://github.com/distr-sh/distr/tree/main/sdk/js/docs/README.md) for more information.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Application, ApplicationVersion, DeploymentRequest, DeploymentTarget, DeploymentTargetAccessResponse } from '../types';
|
|
2
|
+
import { ConditionalPartial, defaultClientConfig } from './config';
|
|
3
|
+
export type ClientConfig = {
|
|
4
|
+
/** The base URL of the Distr API ending with /api/v1, e.g. https://app.distr.sh/api/v1. */
|
|
5
|
+
apiBase: string;
|
|
6
|
+
/** The API key to authenticate with the Distr API. */
|
|
7
|
+
apiKey: string;
|
|
8
|
+
};
|
|
9
|
+
export type ApplicationVersionFiles = {
|
|
10
|
+
composeFile?: string;
|
|
11
|
+
baseValuesFile?: string;
|
|
12
|
+
templateFile?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The low-level Distr API client. Each method represents on API endpoint.
|
|
16
|
+
*/
|
|
17
|
+
export declare class Client {
|
|
18
|
+
private readonly config;
|
|
19
|
+
constructor(config: ConditionalPartial<ClientConfig, keyof typeof defaultClientConfig>);
|
|
20
|
+
getApplications(): Promise<Application[]>;
|
|
21
|
+
getApplication(applicationId: string): Promise<Application>;
|
|
22
|
+
createApplication(application: Application): Promise<Application>;
|
|
23
|
+
updateApplication(application: Application): Promise<Application>;
|
|
24
|
+
createApplicationVersion(applicationId: string, version: ApplicationVersion, files?: ApplicationVersionFiles): Promise<ApplicationVersion>;
|
|
25
|
+
getDeploymentTargets(): Promise<DeploymentTarget[]>;
|
|
26
|
+
getDeploymentTarget(deploymentTargetId: string): Promise<DeploymentTarget>;
|
|
27
|
+
createDeploymentTarget(deploymentTarget: DeploymentTarget): Promise<DeploymentTarget>;
|
|
28
|
+
createOrUpdateDeployment(deploymentRequest: DeploymentRequest): Promise<DeploymentRequest>;
|
|
29
|
+
createAccessForDeploymentTarget(deploymentTargetId: string): Promise<DeploymentTargetAccessResponse>;
|
|
30
|
+
private get;
|
|
31
|
+
private post;
|
|
32
|
+
private put;
|
|
33
|
+
private handleResponse;
|
|
34
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { defaultClientConfig } from './config';
|
|
2
|
+
/**
|
|
3
|
+
* The low-level Distr API client. Each method represents on API endpoint.
|
|
4
|
+
*/
|
|
5
|
+
export class Client {
|
|
6
|
+
config;
|
|
7
|
+
constructor(config) {
|
|
8
|
+
this.config = {
|
|
9
|
+
apiKey: config.apiKey,
|
|
10
|
+
apiBase: config.apiBase || defaultClientConfig.apiBase,
|
|
11
|
+
};
|
|
12
|
+
if (!this.config.apiBase.endsWith('/')) {
|
|
13
|
+
this.config.apiBase += '/';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async getApplications() {
|
|
17
|
+
return this.get('applications');
|
|
18
|
+
}
|
|
19
|
+
async getApplication(applicationId) {
|
|
20
|
+
return this.get(`applications/${applicationId}`);
|
|
21
|
+
}
|
|
22
|
+
async createApplication(application) {
|
|
23
|
+
return this.post('applications', application);
|
|
24
|
+
}
|
|
25
|
+
async updateApplication(application) {
|
|
26
|
+
return this.put(`applications/${application.id}`, application);
|
|
27
|
+
}
|
|
28
|
+
async createApplicationVersion(applicationId, version, files) {
|
|
29
|
+
const formData = new FormData();
|
|
30
|
+
formData.append('applicationversion', JSON.stringify(version));
|
|
31
|
+
if (files?.composeFile) {
|
|
32
|
+
formData.append('composefile', new Blob([files.composeFile], { type: 'application/yaml' }));
|
|
33
|
+
}
|
|
34
|
+
if (files?.baseValuesFile) {
|
|
35
|
+
formData.append('valuesfile', new Blob([files.baseValuesFile], { type: 'application/yaml' }));
|
|
36
|
+
}
|
|
37
|
+
if (files?.templateFile) {
|
|
38
|
+
formData.append('templatefile', new Blob([files.templateFile], { type: 'application/yaml' }));
|
|
39
|
+
}
|
|
40
|
+
const path = `applications/${applicationId}/versions`;
|
|
41
|
+
const response = await fetch(`${this.config.apiBase}${path}`, {
|
|
42
|
+
method: 'POST',
|
|
43
|
+
headers: {
|
|
44
|
+
Accept: 'application/json',
|
|
45
|
+
Authorization: `AccessToken ${this.config.apiKey}`,
|
|
46
|
+
},
|
|
47
|
+
body: formData,
|
|
48
|
+
});
|
|
49
|
+
return this.handleResponse(response, 'POST', path);
|
|
50
|
+
}
|
|
51
|
+
async getDeploymentTargets() {
|
|
52
|
+
return this.get('deployment-targets');
|
|
53
|
+
}
|
|
54
|
+
async getDeploymentTarget(deploymentTargetId) {
|
|
55
|
+
return this.get(`deployment-targets/${deploymentTargetId}`);
|
|
56
|
+
}
|
|
57
|
+
async createDeploymentTarget(deploymentTarget) {
|
|
58
|
+
return this.post('deployment-targets', deploymentTarget);
|
|
59
|
+
}
|
|
60
|
+
async createOrUpdateDeployment(deploymentRequest) {
|
|
61
|
+
return this.put('deployments', deploymentRequest);
|
|
62
|
+
}
|
|
63
|
+
async createAccessForDeploymentTarget(deploymentTargetId) {
|
|
64
|
+
return this.post(`deployment-targets/${deploymentTargetId}/access-request`);
|
|
65
|
+
}
|
|
66
|
+
async get(path) {
|
|
67
|
+
const response = await fetch(`${this.config.apiBase}${path}`, {
|
|
68
|
+
method: 'GET',
|
|
69
|
+
headers: {
|
|
70
|
+
Accept: 'application/json',
|
|
71
|
+
Authorization: `AccessToken ${this.config.apiKey}`,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
return await this.handleResponse(response, 'GET', path);
|
|
75
|
+
}
|
|
76
|
+
async post(path, body) {
|
|
77
|
+
const response = await fetch(`${this.config.apiBase}${path}`, {
|
|
78
|
+
method: 'POST',
|
|
79
|
+
headers: {
|
|
80
|
+
Accept: 'application/json',
|
|
81
|
+
Authorization: `AccessToken ${this.config.apiKey}`,
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
},
|
|
84
|
+
body: JSON.stringify(body),
|
|
85
|
+
});
|
|
86
|
+
return await this.handleResponse(response, 'POST', path);
|
|
87
|
+
}
|
|
88
|
+
async put(path, body) {
|
|
89
|
+
const response = await fetch(`${this.config.apiBase}${path}`, {
|
|
90
|
+
method: 'PUT',
|
|
91
|
+
headers: {
|
|
92
|
+
Accept: 'application/json',
|
|
93
|
+
Authorization: `AccessToken ${this.config.apiKey}`,
|
|
94
|
+
'Content-Type': 'application/json',
|
|
95
|
+
},
|
|
96
|
+
body: JSON.stringify(body),
|
|
97
|
+
});
|
|
98
|
+
return await this.handleResponse(response, 'PUT', path);
|
|
99
|
+
}
|
|
100
|
+
async handleResponse(response, method, path) {
|
|
101
|
+
if (response.status < 200 || response.status >= 300) {
|
|
102
|
+
throw new Error(`${method} ${path} failed: ${response.status} ${response.statusText} "${await response.text()}"`);
|
|
103
|
+
}
|
|
104
|
+
const contentLength = response.headers.get('content-length');
|
|
105
|
+
if (response.status === 204 || contentLength === '0') {
|
|
106
|
+
return {};
|
|
107
|
+
}
|
|
108
|
+
const text = await response.text();
|
|
109
|
+
if (!text) {
|
|
110
|
+
return {};
|
|
111
|
+
}
|
|
112
|
+
return JSON.parse(text);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAOA,OAAO,EAAqB,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAejE;;GAEG;AACH,MAAM,OAAO,MAAM;IACA,MAAM,CAAe;IAEtC,YAAY,MAA0E;QACpF,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,mBAAmB,CAAC,OAAO;SACvD,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,GAAG,CAAC;QAC7B,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,eAAe;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAgB,cAAc,CAAC,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,aAAqB;QAC/C,OAAO,IAAI,CAAC,GAAG,CAAc,gBAAgB,aAAa,EAAE,CAAC,CAAC;IAChE,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,WAAwB;QACrD,OAAO,IAAI,CAAC,IAAI,CAAc,cAAc,EAAE,WAAW,CAAC,CAAC;IAC7D,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,WAAwB;QACrD,OAAO,IAAI,CAAC,GAAG,CAAc,gBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE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G,IAAI,aAAa,KAAK,GAAG,EAAE,CAAC;YACrD,OAAO,EAAO,CAAC;QACjB,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,EAAO,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/client/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAC,OAAO,EAAE,8BAA8B,EAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Application, ApplicationVersion, DeploymentTarget, DeploymentTargetAccessResponse, DeploymentTargetScope, DeploymentType, HelmChartType } from '../types';
|
|
2
|
+
import { ClientConfig } from './client';
|
|
3
|
+
import { ConditionalPartial, defaultClientConfig } from './config';
|
|
4
|
+
/**
|
|
5
|
+
* The strategy for determining the latest version of an application.
|
|
6
|
+
* * 'semver' uses semantic versioning to determine the latest version.
|
|
7
|
+
* * 'chronological' uses the creation date of the versions to determine the latest version.
|
|
8
|
+
*/
|
|
9
|
+
export type LatestVersionStrategy = 'semver' | 'chronological';
|
|
10
|
+
export type CreateDeploymentParams = {
|
|
11
|
+
target: {
|
|
12
|
+
name: string;
|
|
13
|
+
type: DeploymentType;
|
|
14
|
+
kubernetes?: {
|
|
15
|
+
namespace: string;
|
|
16
|
+
scope: DeploymentTargetScope;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
application: {
|
|
20
|
+
id?: string;
|
|
21
|
+
versionId?: string;
|
|
22
|
+
};
|
|
23
|
+
kubernetesDeployment?: {
|
|
24
|
+
releaseName: string;
|
|
25
|
+
valuesYaml?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type CreateDeploymentResult = {
|
|
29
|
+
deploymentTarget: DeploymentTarget;
|
|
30
|
+
access: DeploymentTargetAccessResponse;
|
|
31
|
+
};
|
|
32
|
+
export type UpdateDeploymentParams = {
|
|
33
|
+
deploymentTargetId: string;
|
|
34
|
+
applicationId: string;
|
|
35
|
+
applicationVersionId: string;
|
|
36
|
+
kubernetesDeployment?: {
|
|
37
|
+
valuesYaml?: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type UpdateAllDeploymentsResult = {
|
|
41
|
+
updatedTargets: Array<{
|
|
42
|
+
deploymentTargetId: string;
|
|
43
|
+
deploymentTargetName: string;
|
|
44
|
+
previousVersionId: string;
|
|
45
|
+
newVersionId: string;
|
|
46
|
+
}>;
|
|
47
|
+
skippedTargets: Array<{
|
|
48
|
+
deploymentTargetId: string;
|
|
49
|
+
deploymentTargetName: string;
|
|
50
|
+
reason: string;
|
|
51
|
+
}>;
|
|
52
|
+
};
|
|
53
|
+
export type IsOutdatedResultItem = {
|
|
54
|
+
deployment: {
|
|
55
|
+
id: string;
|
|
56
|
+
applicationId: string;
|
|
57
|
+
applicationVersionId: string;
|
|
58
|
+
};
|
|
59
|
+
application: Application;
|
|
60
|
+
newerVersions: ApplicationVersion[];
|
|
61
|
+
outdated: boolean;
|
|
62
|
+
};
|
|
63
|
+
export type IsOutdatedResult = {
|
|
64
|
+
deploymentTarget: DeploymentTarget;
|
|
65
|
+
results: IsOutdatedResultItem[];
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The DistrService provides a higher-level API for the Distr API. It allows to create and update deployments, check
|
|
69
|
+
* if a deployment is outdated, and get the latest version of an application according to a specified strategy.
|
|
70
|
+
* Under the hood it uses the low-level {@link Client}.
|
|
71
|
+
*/
|
|
72
|
+
export declare class DistrService {
|
|
73
|
+
private readonly latestVersionStrategy;
|
|
74
|
+
private readonly client;
|
|
75
|
+
/**
|
|
76
|
+
* Creates a new DistrService instance. A client config containing an API key must be provided, optionally the API
|
|
77
|
+
* base URL can be set. Optionally, a strategy for determining the latest version of an application can be specified –
|
|
78
|
+
* the default is semantic versioning.
|
|
79
|
+
* @param config ClientConfig containing at least an API key and optionally an API base URL
|
|
80
|
+
* @param latestVersionStrategy Strategy for determining the latest version of an application (default: 'semver')
|
|
81
|
+
*/
|
|
82
|
+
constructor(config: ConditionalPartial<ClientConfig, keyof typeof defaultClientConfig>, latestVersionStrategy?: LatestVersionStrategy);
|
|
83
|
+
/**
|
|
84
|
+
* Creates a new application version for the given docker application using a Docker Compose file and an
|
|
85
|
+
* optional template file.
|
|
86
|
+
* @param applicationId
|
|
87
|
+
* @param name Name of the new version
|
|
88
|
+
* @param data
|
|
89
|
+
*/
|
|
90
|
+
createDockerApplicationVersion(applicationId: string, name: string, data: {
|
|
91
|
+
composeFile: string;
|
|
92
|
+
templateFile?: string;
|
|
93
|
+
linkTemplate?: string;
|
|
94
|
+
}): Promise<ApplicationVersion>;
|
|
95
|
+
/**
|
|
96
|
+
* Creates a new application version for the given Kubernetes application using a Helm chart.
|
|
97
|
+
* @param applicationId
|
|
98
|
+
* @param versionName
|
|
99
|
+
* @param data
|
|
100
|
+
*/
|
|
101
|
+
createKubernetesApplicationVersion(applicationId: string, versionName: string, data: {
|
|
102
|
+
chartName?: string;
|
|
103
|
+
chartVersion: string;
|
|
104
|
+
chartType: HelmChartType;
|
|
105
|
+
chartUrl: string;
|
|
106
|
+
baseValuesFile?: string;
|
|
107
|
+
templateFile?: string;
|
|
108
|
+
linkTemplate?: string;
|
|
109
|
+
}): Promise<ApplicationVersion>;
|
|
110
|
+
/**
|
|
111
|
+
* Creates a new deployment target and deploys the given application version to it.
|
|
112
|
+
* * If deployment type is 'kubernetes', the namespace and scope must be provided.
|
|
113
|
+
* * If deployment type is 'kubernetes', the helm release name and values YAML can be provided.
|
|
114
|
+
* * If no application version ID is given, the latest version of the application will be deployed.
|
|
115
|
+
* @param params
|
|
116
|
+
*/
|
|
117
|
+
createDeployment(params: CreateDeploymentParams): Promise<CreateDeploymentResult>;
|
|
118
|
+
/**
|
|
119
|
+
* Updates the deployment of an existing deployment target to the specified application version.
|
|
120
|
+
* @param params
|
|
121
|
+
*/
|
|
122
|
+
updateDeployment(params: UpdateDeploymentParams): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Updates all deployment targets that have the specified application deployed to the specified version.
|
|
125
|
+
* Only updates deployments that are not already on the target version.
|
|
126
|
+
* @param applicationId The application ID to update
|
|
127
|
+
* @param applicationVersionId The target version ID to update to
|
|
128
|
+
*/
|
|
129
|
+
updateAllDeployments(applicationId: string, applicationVersionId: string): Promise<UpdateAllDeploymentsResult>;
|
|
130
|
+
/**
|
|
131
|
+
* Checks if the deployments on the given deployment target are outdated, i.e. if there is a newer version of the application available.
|
|
132
|
+
* Returns results for all deployments on the target. Each result contains versions that are newer than the currently deployed one, ordered ascending.
|
|
133
|
+
* @param deploymentTargetId
|
|
134
|
+
*/
|
|
135
|
+
isOutdated(deploymentTargetId: string): Promise<IsOutdatedResult>;
|
|
136
|
+
/**
|
|
137
|
+
* Returns the latest version of the given application according to the specified strategy.
|
|
138
|
+
* @param appId
|
|
139
|
+
*/
|
|
140
|
+
getLatestVersion(appId: string): Promise<ApplicationVersion | undefined>;
|
|
141
|
+
/**
|
|
142
|
+
* Returns the application and all versions that are newer than the given version ID. If no version ID is given,
|
|
143
|
+
* all versions are considered. The versions are ordered ascending according to the given strategy.
|
|
144
|
+
* @param appId
|
|
145
|
+
* @param currentVersionId
|
|
146
|
+
*/
|
|
147
|
+
getNewerVersions(appId: string, currentVersionId?: string): Promise<{
|
|
148
|
+
app: Application;
|
|
149
|
+
newerVersions: ApplicationVersion[];
|
|
150
|
+
}>;
|
|
151
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import semver from 'semver/preload';
|
|
2
|
+
import { Client } from './client';
|
|
3
|
+
/**
|
|
4
|
+
* The DistrService provides a higher-level API for the Distr API. It allows to create and update deployments, check
|
|
5
|
+
* if a deployment is outdated, and get the latest version of an application according to a specified strategy.
|
|
6
|
+
* Under the hood it uses the low-level {@link Client}.
|
|
7
|
+
*/
|
|
8
|
+
export class DistrService {
|
|
9
|
+
latestVersionStrategy;
|
|
10
|
+
client;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new DistrService instance. A client config containing an API key must be provided, optionally the API
|
|
13
|
+
* base URL can be set. Optionally, a strategy for determining the latest version of an application can be specified –
|
|
14
|
+
* the default is semantic versioning.
|
|
15
|
+
* @param config ClientConfig containing at least an API key and optionally an API base URL
|
|
16
|
+
* @param latestVersionStrategy Strategy for determining the latest version of an application (default: 'semver')
|
|
17
|
+
*/
|
|
18
|
+
constructor(config, latestVersionStrategy = 'semver') {
|
|
19
|
+
this.latestVersionStrategy = latestVersionStrategy;
|
|
20
|
+
this.client = new Client(config);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new application version for the given docker application using a Docker Compose file and an
|
|
24
|
+
* optional template file.
|
|
25
|
+
* @param applicationId
|
|
26
|
+
* @param name Name of the new version
|
|
27
|
+
* @param data
|
|
28
|
+
*/
|
|
29
|
+
async createDockerApplicationVersion(applicationId, name, data) {
|
|
30
|
+
return this.client.createApplicationVersion(applicationId, { name, linkTemplate: data.linkTemplate ?? '' }, {
|
|
31
|
+
composeFile: data.composeFile,
|
|
32
|
+
templateFile: data.templateFile,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new application version for the given Kubernetes application using a Helm chart.
|
|
37
|
+
* @param applicationId
|
|
38
|
+
* @param versionName
|
|
39
|
+
* @param data
|
|
40
|
+
*/
|
|
41
|
+
async createKubernetesApplicationVersion(applicationId, versionName, data) {
|
|
42
|
+
return this.client.createApplicationVersion(applicationId, {
|
|
43
|
+
name: versionName,
|
|
44
|
+
linkTemplate: data.linkTemplate ?? '',
|
|
45
|
+
chartName: data.chartName,
|
|
46
|
+
chartVersion: data.chartVersion,
|
|
47
|
+
chartType: data.chartType,
|
|
48
|
+
chartUrl: data.chartUrl,
|
|
49
|
+
}, {
|
|
50
|
+
baseValuesFile: data.baseValuesFile,
|
|
51
|
+
templateFile: data.templateFile,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Creates a new deployment target and deploys the given application version to it.
|
|
56
|
+
* * If deployment type is 'kubernetes', the namespace and scope must be provided.
|
|
57
|
+
* * If deployment type is 'kubernetes', the helm release name and values YAML can be provided.
|
|
58
|
+
* * If no application version ID is given, the latest version of the application will be deployed.
|
|
59
|
+
* @param params
|
|
60
|
+
*/
|
|
61
|
+
async createDeployment(params) {
|
|
62
|
+
const { target, application, kubernetesDeployment } = params;
|
|
63
|
+
let versionId = application.versionId;
|
|
64
|
+
if (!versionId) {
|
|
65
|
+
if (!application.id) {
|
|
66
|
+
throw new Error('application ID or version ID must be provided');
|
|
67
|
+
}
|
|
68
|
+
const latest = await this.getLatestVersion(application.id);
|
|
69
|
+
if (!latest) {
|
|
70
|
+
throw new Error('no version available for this application');
|
|
71
|
+
}
|
|
72
|
+
versionId = latest.id;
|
|
73
|
+
}
|
|
74
|
+
const deploymentTarget = await this.client.createDeploymentTarget({
|
|
75
|
+
name: target.name,
|
|
76
|
+
type: target.type,
|
|
77
|
+
namespace: target.kubernetes?.namespace,
|
|
78
|
+
scope: target.kubernetes?.scope,
|
|
79
|
+
deployments: [],
|
|
80
|
+
metricsEnabled: false,
|
|
81
|
+
});
|
|
82
|
+
await this.client.createOrUpdateDeployment({
|
|
83
|
+
deploymentTargetId: deploymentTarget.id,
|
|
84
|
+
applicationVersionId: versionId,
|
|
85
|
+
releaseName: kubernetesDeployment?.releaseName,
|
|
86
|
+
valuesYaml: kubernetesDeployment?.valuesYaml ? btoa(kubernetesDeployment?.valuesYaml) : undefined,
|
|
87
|
+
});
|
|
88
|
+
return {
|
|
89
|
+
deploymentTarget: await this.client.getDeploymentTarget(deploymentTarget.id),
|
|
90
|
+
access: await this.client.createAccessForDeploymentTarget(deploymentTarget.id),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Updates the deployment of an existing deployment target to the specified application version.
|
|
95
|
+
* @param params
|
|
96
|
+
*/
|
|
97
|
+
async updateDeployment(params) {
|
|
98
|
+
const { deploymentTargetId, applicationId, applicationVersionId, kubernetesDeployment } = params;
|
|
99
|
+
const existing = await this.client.getDeploymentTarget(deploymentTargetId);
|
|
100
|
+
const existingDeployment = existing.deployments.find((d) => d.applicationId === applicationId);
|
|
101
|
+
if (!existingDeployment) {
|
|
102
|
+
throw new Error(`cannot update deployment, no deployment found for application ${applicationId}`);
|
|
103
|
+
}
|
|
104
|
+
await this.client.createOrUpdateDeployment({
|
|
105
|
+
deploymentTargetId,
|
|
106
|
+
deploymentId: existingDeployment.id,
|
|
107
|
+
applicationVersionId,
|
|
108
|
+
valuesYaml: kubernetesDeployment?.valuesYaml ? btoa(kubernetesDeployment?.valuesYaml) : undefined,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Updates all deployment targets that have the specified application deployed to the specified version.
|
|
113
|
+
* Only updates deployments that are not already on the target version.
|
|
114
|
+
* @param applicationId The application ID to update
|
|
115
|
+
* @param applicationVersionId The target version ID to update to
|
|
116
|
+
*/
|
|
117
|
+
async updateAllDeployments(applicationId, applicationVersionId) {
|
|
118
|
+
const allTargets = await this.client.getDeploymentTargets();
|
|
119
|
+
const updatedTargets = [];
|
|
120
|
+
const skippedTargets = [];
|
|
121
|
+
for (const target of allTargets) {
|
|
122
|
+
const deployment = target.deployments?.find((d) => d.applicationId === applicationId);
|
|
123
|
+
if (!deployment) {
|
|
124
|
+
skippedTargets.push({
|
|
125
|
+
deploymentTargetId: target.id,
|
|
126
|
+
deploymentTargetName: target.name,
|
|
127
|
+
reason: 'Application not deployed on this target',
|
|
128
|
+
});
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (deployment.applicationVersionId === applicationVersionId) {
|
|
132
|
+
skippedTargets.push({
|
|
133
|
+
deploymentTargetId: target.id,
|
|
134
|
+
deploymentTargetName: target.name,
|
|
135
|
+
reason: 'Already on target version',
|
|
136
|
+
});
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
try {
|
|
140
|
+
await this.client.createOrUpdateDeployment({
|
|
141
|
+
deploymentTargetId: target.id,
|
|
142
|
+
deploymentId: deployment.id,
|
|
143
|
+
applicationVersionId,
|
|
144
|
+
});
|
|
145
|
+
updatedTargets.push({
|
|
146
|
+
deploymentTargetId: target.id,
|
|
147
|
+
deploymentTargetName: target.name,
|
|
148
|
+
previousVersionId: deployment.applicationVersionId,
|
|
149
|
+
newVersionId: applicationVersionId,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
skippedTargets.push({
|
|
154
|
+
deploymentTargetId: target.id,
|
|
155
|
+
deploymentTargetName: target.name,
|
|
156
|
+
reason: `Update failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return { updatedTargets, skippedTargets };
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Checks if the deployments on the given deployment target are outdated, i.e. if there is a newer version of the application available.
|
|
164
|
+
* Returns results for all deployments on the target. Each result contains versions that are newer than the currently deployed one, ordered ascending.
|
|
165
|
+
* @param deploymentTargetId
|
|
166
|
+
*/
|
|
167
|
+
async isOutdated(deploymentTargetId) {
|
|
168
|
+
const existing = await this.client.getDeploymentTarget(deploymentTargetId);
|
|
169
|
+
if (existing.deployments.length === 0) {
|
|
170
|
+
throw new Error('nothing deployed yet');
|
|
171
|
+
}
|
|
172
|
+
const results = [];
|
|
173
|
+
for (const deployment of existing.deployments) {
|
|
174
|
+
const { app, newerVersions } = await this.getNewerVersions(deployment.applicationId, deployment.applicationVersionId);
|
|
175
|
+
results.push({
|
|
176
|
+
deployment: {
|
|
177
|
+
id: deployment.id,
|
|
178
|
+
applicationId: deployment.applicationId,
|
|
179
|
+
applicationVersionId: deployment.applicationVersionId,
|
|
180
|
+
},
|
|
181
|
+
application: app,
|
|
182
|
+
newerVersions: newerVersions,
|
|
183
|
+
outdated: newerVersions.length > 0,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
deploymentTarget: existing,
|
|
188
|
+
results,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Returns the latest version of the given application according to the specified strategy.
|
|
193
|
+
* @param appId
|
|
194
|
+
*/
|
|
195
|
+
async getLatestVersion(appId) {
|
|
196
|
+
const { newerVersions } = await this.getNewerVersions(appId);
|
|
197
|
+
return newerVersions.length > 0 ? newerVersions[newerVersions.length - 1] : undefined;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Returns the application and all versions that are newer than the given version ID. If no version ID is given,
|
|
201
|
+
* all versions are considered. The versions are ordered ascending according to the given strategy.
|
|
202
|
+
* @param appId
|
|
203
|
+
* @param currentVersionId
|
|
204
|
+
*/
|
|
205
|
+
async getNewerVersions(appId, currentVersionId) {
|
|
206
|
+
const app = await this.client.getApplication(appId);
|
|
207
|
+
const currentVersion = (app.versions || []).find((it) => it.id === currentVersionId);
|
|
208
|
+
if (!currentVersion && currentVersionId) {
|
|
209
|
+
throw new Error('given version ID does not exist in this application');
|
|
210
|
+
}
|
|
211
|
+
const newerVersions = (app.versions || [])
|
|
212
|
+
.filter((it) => {
|
|
213
|
+
if (!currentVersion) {
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
// surely there are fancier ways to deal with strategies but that's it for now
|
|
217
|
+
switch (this.latestVersionStrategy) {
|
|
218
|
+
case 'semver':
|
|
219
|
+
return semver.gt(it.name, currentVersion.name, { loose: true });
|
|
220
|
+
case 'chronological':
|
|
221
|
+
return it.createdAt > currentVersion.createdAt; // TODO proper date handling maybe
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
.sort((a, b) => {
|
|
225
|
+
switch (this.latestVersionStrategy) {
|
|
226
|
+
case 'semver':
|
|
227
|
+
return semver.compare(a.name, b.name, { loose: true });
|
|
228
|
+
case 'chronological':
|
|
229
|
+
return a.createdAt?.localeCompare(b.createdAt) ?? 0; // TODO proper date handling maybe
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
return { app, newerVersions };
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/client/service.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAUpC,OAAO,EAAC,MAAM,EAAe,MAAM,UAAU,CAAC;AAyE9C;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAYJ;IAXF,MAAM,CAAS;IAEhC;;;;;;OAMG;IACH,YACE,MAA0E,EACzD,wBAA+C,QAAQ;QAAvD,0BAAqB,GAArB,qBAAqB,CAAkC;QAExE,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,8BAA8B,CACzC,aAAqB,EACrB,IAAY,EACZ,IAIC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,wBAAwB,CACzC,aAAa,EACb,EAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE,EAAC,EAC7C;YACE,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,kCAAkC,CAC7C,aAAqB,EACrB,WAAmB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eAAe;oBAClB,OAAO,EAAE,CAAC,SAAU,GAAG,cAAc,CAAC,SAAU,CAAC,CAAC,kCAAkC;YACxF,CAAC;QACH,CAAC,CAAC;aACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACb,QAAQ,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBACnC,KAAK,QAAQ;oBACX,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAK,EAAE,CAAC,CAAC,IAAK,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;gBACzD,KAAK,eAAe;oBAClB,OAAO,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,SAAU,CAAC,IAAI,CAAC,CAAC,CAAC,kCAAkC;YAC5F,CAAC;QACH,CAAC,CAAC,CAAC;QACL,OAAO,EAAC,GAAG,EAAE,aAAa,EAAC,CAAC;IAC9B,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export interface AccessToken extends BaseModel {
|
|
3
|
+
expiresAt?: string;
|
|
4
|
+
lastUsedAt?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AccessTokenWithKey extends AccessToken {
|
|
8
|
+
key: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreateAccessTokenRequest {
|
|
11
|
+
label?: string;
|
|
12
|
+
expiresAt?: Date;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-token.js","sourceRoot":"","sources":["../../src/types/access-token.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-version.js","sourceRoot":"","sources":["../../src/types/agent-version.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseModel, Named } from './base';
|
|
2
|
+
import { DeploymentType, HelmChartType } from './deployment';
|
|
3
|
+
export interface Application extends BaseModel, Named {
|
|
4
|
+
type: DeploymentType;
|
|
5
|
+
imageUrl?: string;
|
|
6
|
+
versions?: ApplicationVersion[];
|
|
7
|
+
}
|
|
8
|
+
export interface ApplicationVersion {
|
|
9
|
+
id?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
linkTemplate?: string;
|
|
12
|
+
createdAt?: string;
|
|
13
|
+
archivedAt?: string;
|
|
14
|
+
applicationId?: string;
|
|
15
|
+
chartType?: HelmChartType;
|
|
16
|
+
chartName?: string;
|
|
17
|
+
chartUrl?: string;
|
|
18
|
+
chartVersion?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface PatchApplicationRequest {
|
|
21
|
+
name?: string;
|
|
22
|
+
versions?: {
|
|
23
|
+
id: string;
|
|
24
|
+
archivedAt?: string;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../src/types/application.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface BaseModel {
|
|
2
|
+
id?: string;
|
|
3
|
+
createdAt?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Named {
|
|
6
|
+
name?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TokenResponse {
|
|
9
|
+
token: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DeploymentTargetAccessResponse {
|
|
12
|
+
connectUrl: string;
|
|
13
|
+
targetId: string;
|
|
14
|
+
targetSecret: string;
|
|
15
|
+
connectCommand: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export interface CustomerOrganization extends Required<BaseModel> {
|
|
3
|
+
name: string;
|
|
4
|
+
imageId?: string;
|
|
5
|
+
imageUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CustomerOrganizationWithUsage extends CustomerOrganization {
|
|
8
|
+
userCount: number;
|
|
9
|
+
deploymentTargetCount: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CreateUpdateCustomerOrganizationRequest {
|
|
12
|
+
name: string;
|
|
13
|
+
imageId?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer-organization.js","sourceRoot":"","sources":["../../src/types/customer-organization.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AgentVersion } from './agent-version';
|
|
2
|
+
import { BaseModel, Named } from './base';
|
|
3
|
+
import { CustomerOrganization } from './customer-organization';
|
|
4
|
+
import { DeploymentTargetScope, DeploymentType, DeploymentWithLatestRevision } from './deployment';
|
|
5
|
+
import { UserAccountWithRole } from './user-account';
|
|
6
|
+
export interface DeploymentTarget extends BaseModel, Named {
|
|
7
|
+
name: string;
|
|
8
|
+
type: DeploymentType;
|
|
9
|
+
namespace?: string;
|
|
10
|
+
scope?: DeploymentTargetScope;
|
|
11
|
+
createdBy?: UserAccountWithRole;
|
|
12
|
+
customerOrganization?: CustomerOrganization;
|
|
13
|
+
currentStatus?: DeploymentTargetStatus;
|
|
14
|
+
deployments: DeploymentWithLatestRevision[];
|
|
15
|
+
agentVersion?: AgentVersion;
|
|
16
|
+
reportedAgentVersionId?: string;
|
|
17
|
+
metricsEnabled: boolean;
|
|
18
|
+
resources?: DeploymentTargetResources;
|
|
19
|
+
}
|
|
20
|
+
export interface DeploymentTargetResources {
|
|
21
|
+
cpuRequest: string;
|
|
22
|
+
memoryRequest: string;
|
|
23
|
+
cpuLimit: string;
|
|
24
|
+
memoryLimit: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DeploymentTargetStatus extends BaseModel {
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-target.js","sourceRoot":"","sources":["../../src/types/deployment-target.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export interface Deployment extends BaseModel {
|
|
3
|
+
deploymentTargetId: string;
|
|
4
|
+
releaseName?: string;
|
|
5
|
+
dockerType?: DockerType;
|
|
6
|
+
logsEnabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface DeploymentRequest {
|
|
9
|
+
deploymentTargetId: string;
|
|
10
|
+
applicationVersionId: string;
|
|
11
|
+
deploymentId?: string;
|
|
12
|
+
applicationLicenseId?: string;
|
|
13
|
+
releaseName?: string;
|
|
14
|
+
dockerType?: DockerType;
|
|
15
|
+
valuesYaml?: string;
|
|
16
|
+
envFileData?: string;
|
|
17
|
+
logsEnabled?: boolean;
|
|
18
|
+
forceRestart?: boolean;
|
|
19
|
+
ignoreRevisionSkew?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface PatchDeploymentRequest {
|
|
22
|
+
logsEnabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface DeploymentWithLatestRevision extends Deployment {
|
|
25
|
+
applicationId: string;
|
|
26
|
+
applicationName: string;
|
|
27
|
+
applicationVersionId: string;
|
|
28
|
+
applicationVersionName: string;
|
|
29
|
+
applicationLink: string;
|
|
30
|
+
applicationLicenseId?: string;
|
|
31
|
+
valuesYaml?: string;
|
|
32
|
+
envFileData?: string;
|
|
33
|
+
deploymentRevisionId?: string;
|
|
34
|
+
deploymentRevisionCreatedAt?: string;
|
|
35
|
+
latestStatus?: DeploymentRevisionStatus;
|
|
36
|
+
}
|
|
37
|
+
export interface DeploymentRevisionStatus extends BaseModel {
|
|
38
|
+
type: DeploymentStatusType;
|
|
39
|
+
message: string;
|
|
40
|
+
}
|
|
41
|
+
export type DeploymentType = 'docker' | 'kubernetes';
|
|
42
|
+
export type HelmChartType = 'repository' | 'oci';
|
|
43
|
+
export type DockerType = 'compose' | 'swarm';
|
|
44
|
+
export type DeploymentStatusType = 'ok' | 'progressing' | 'error';
|
|
45
|
+
export type DeploymentTargetScope = 'cluster' | 'namespace';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../src/types/deployment.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './access-token';
|
|
2
|
+
export * from './agent-version';
|
|
3
|
+
export * from './application';
|
|
4
|
+
export * from './base';
|
|
5
|
+
export * from './customer-organization';
|
|
6
|
+
export * from './deployment';
|
|
7
|
+
export * from './deployment-target';
|
|
8
|
+
export * from './organization-branding';
|
|
9
|
+
export * from './user-account';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './access-token';
|
|
2
|
+
export * from './agent-version';
|
|
3
|
+
export * from './application';
|
|
4
|
+
export * from './base';
|
|
5
|
+
export * from './customer-organization';
|
|
6
|
+
export * from './deployment';
|
|
7
|
+
export * from './deployment-target';
|
|
8
|
+
export * from './organization-branding';
|
|
9
|
+
export * from './user-account';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-branding.js","sourceRoot":"","sources":["../../src/types/organization-branding.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export type UserRole = 'read_only' | 'read_write' | 'admin';
|
|
3
|
+
export interface UserAccount extends BaseModel {
|
|
4
|
+
email: string;
|
|
5
|
+
emailVerified: boolean;
|
|
6
|
+
name?: string;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UserAccountWithRole extends UserAccount {
|
|
10
|
+
userRole: UserRole;
|
|
11
|
+
customerOrganizationId?: string;
|
|
12
|
+
joinedOrgAt: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-account.js","sourceRoot":"","sources":["../../src/types/user-account.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@distr-sh/distr-sdk",
|
|
3
|
+
"version": "2.5.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"description": "Distr SDK",
|
|
7
|
+
"homepage": "https://distr.sh",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/distr-sh/distr.git",
|
|
11
|
+
"directory": "sdk/js"
|
|
12
|
+
},
|
|
13
|
+
"main": "dist/index.js",
|
|
14
|
+
"types": "dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"semver": "^7.6.3"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/semver": "^7.5.8",
|
|
23
|
+
"prettier": "^3.5.3",
|
|
24
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
25
|
+
"rimraf": "^6.0.1",
|
|
26
|
+
"typedoc": "^0.28.0",
|
|
27
|
+
"typedoc-plugin-markdown": "^4.5.0",
|
|
28
|
+
"typescript": "^5.7.3"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "rimraf dist && tsc",
|
|
32
|
+
"docs": "typedoc",
|
|
33
|
+
"test:examples": "npx tsx src/examples/test-client.ts"
|
|
34
|
+
}
|
|
35
|
+
}
|