@ordinlabs/wsm-types 2.2.2 → 2.2.3-alpha.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.
- package/LICENSE.md +673 -673
- package/README.md +3 -3
- package/dist/accessRules.d.ts +16 -16
- package/dist/accessRules.js +2 -2
- package/dist/apiKey.d.ts +14 -14
- package/dist/apiKey.js +2 -2
- package/dist/base.d.ts +20 -20
- package/dist/base.js +11 -11
- package/dist/clientConfig.d.ts +13 -13
- package/dist/clientConfig.js +2 -2
- package/dist/developer.d.ts +15 -15
- package/dist/developer.js +12 -12
- package/dist/group.d.ts +17 -17
- package/dist/group.js +20 -20
- package/dist/index.d.ts +22 -21
- package/dist/index.js +38 -37
- package/dist/index.js.map +1 -1
- package/dist/k8s.d.ts +11 -11
- package/dist/k8s.js +2 -2
- package/dist/login.d.ts +32 -32
- package/dist/login.js +6 -6
- package/dist/memberships.d.ts +7 -7
- package/dist/memberships.js +2 -2
- package/dist/navData.d.ts +15 -15
- package/dist/navData.js +2 -2
- package/dist/network.d.ts +21 -21
- package/dist/network.js +11 -11
- package/dist/nginx-ingress-types.d.ts +187 -187
- package/dist/nginx-ingress-types.js +5 -5
- package/dist/node.d.ts +11 -11
- package/dist/node.js +2 -2
- package/dist/params.d.ts +8 -0
- package/dist/params.js +8 -0
- package/dist/params.js.map +1 -0
- package/dist/project.d.ts +91 -91
- package/dist/project.js +36 -36
- package/dist/project.js.map +1 -1
- package/dist/publicKey.d.ts +17 -17
- package/dist/publicKey.js +2 -2
- package/dist/rbac.d.ts +3 -3
- package/dist/rbac.js +2 -2
- package/dist/reflection.d.ts +7 -7
- package/dist/reflection.js +22 -22
- package/dist/reporting.d.ts +35 -35
- package/dist/reporting.js +15 -15
- package/dist/requests.d.ts +22 -22
- package/dist/requests.js +2 -2
- package/dist/session.d.ts +12 -12
- package/dist/session.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/workspace.d.ts +69 -69
- package/dist/workspace.js +22 -22
- package/package.json +7 -4
- package/src/accessRules.ts +0 -18
- package/src/apiKey.ts +0 -16
- package/src/base.ts +0 -35
- package/src/clientConfig.ts +0 -13
- package/src/developer.ts +0 -29
- package/src/group.ts +0 -38
- package/src/index.ts +0 -21
- package/src/k8s.ts +0 -4
- package/src/login.ts +0 -36
- package/src/memberships.ts +0 -12
- package/src/navData.ts +0 -16
- package/src/network.ts +0 -35
- package/src/nginx-ingress-types.ts +0 -218
- package/src/node.ts +0 -13
- package/src/project.ts +0 -166
- package/src/publicKey.ts +0 -21
- package/src/rbac.ts +0 -5
- package/src/reflection.ts +0 -19
- package/src/reporting.ts +0 -60
- package/src/requests.ts +0 -27
- package/src/session.ts +0 -14
- package/src/workspace.ts +0 -121
- package/tsconfig.json +0 -10
package/dist/workspace.d.ts
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import * as k8s from '@kubernetes/client-node';
|
|
2
|
-
import { VirtualServer } from './nginx-ingress-types';
|
|
3
|
-
import { StoredParamValues } from '
|
|
4
|
-
import { HasHttpAccessRules } from './accessRules';
|
|
5
|
-
import { DataObject, HasKubeStructureVersion, NamedDataObject, UnsavedDataObject } from './base';
|
|
6
|
-
import { GitRepoRefInfo } from './project';
|
|
7
|
-
export type WorkspaceTemplateId = 'm2Ubuntu' | 'm1V2' | 'wordpressV2' | 'drupalV2' | 'laravel' | 'm2' | 'm1' | 'wordpress' | 'drupal';
|
|
8
|
-
export type WorkspaceInfo = NamedDataObject & {
|
|
9
|
-
projectId: string;
|
|
10
|
-
developerId: string;
|
|
11
|
-
lastSeen?: number;
|
|
12
|
-
};
|
|
13
|
-
export type WorkspaceInitType = 'empty' | 'repo' | 'install';
|
|
14
|
-
export type WorkspaceInitOptions = {
|
|
15
|
-
type: WorkspaceInitType;
|
|
16
|
-
repo?: string;
|
|
17
|
-
ref?: GitRepoRefInfo;
|
|
18
|
-
};
|
|
19
|
-
export type Workspace = WorkspaceInfo & HasHttpAccessRules & HasKubeStructureVersion & {
|
|
20
|
-
volumeSize: number;
|
|
21
|
-
initOptions?: WorkspaceInitOptions;
|
|
22
|
-
initialized: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Represents a keypair in PrivateKey/PublicKey collections (shared ID, see crypto.ts).
|
|
25
|
-
* Used for SSH access into the workspace.
|
|
26
|
-
*/
|
|
27
|
-
keyPairId?: string;
|
|
28
|
-
workspaceTemplate: WorkspaceTemplateId;
|
|
29
|
-
workspaceParams: StoredParamValues<any>;
|
|
30
|
-
};
|
|
31
|
-
export type UnsavedWorkspace = Omit<UnsavedDataObject<Workspace>, 'kubeStructureVersion' | 'initialized' | 'lastSeen'>;
|
|
32
|
-
export type WorkspaceDescription = DataObject & {
|
|
33
|
-
workspaceId: string;
|
|
34
|
-
description: string;
|
|
35
|
-
latest: boolean;
|
|
36
|
-
createdBy: string;
|
|
37
|
-
};
|
|
38
|
-
export type UpdateWorkspaceDescriptionRequest = {
|
|
39
|
-
id: string;
|
|
40
|
-
description: string;
|
|
41
|
-
};
|
|
42
|
-
export type WorkspaceInspection = {
|
|
43
|
-
workspace: Workspace;
|
|
44
|
-
resolvedParams: object;
|
|
45
|
-
deployment: k8s.V1Deployment;
|
|
46
|
-
currentPod?: k8s.V1Pod;
|
|
47
|
-
initJob?: k8s.V1Job;
|
|
48
|
-
pvc?: k8s.V1PersistentVolumeClaim;
|
|
49
|
-
projectVolumes?: k8s.V1PersistentVolumeClaim[];
|
|
50
|
-
projectVirtualServers?: VirtualServer[];
|
|
51
|
-
internalService?: k8s.V1Service;
|
|
52
|
-
nodePortService?: k8s.V1Service;
|
|
53
|
-
ebsClaims?: k8s.V1PersistentVolumeClaim[];
|
|
54
|
-
ingress?: k8s.V1Ingress;
|
|
55
|
-
virtualServers?: VirtualServer[];
|
|
56
|
-
events?: k8s.CoreV1Event[];
|
|
57
|
-
description: WorkspaceDescription | null;
|
|
58
|
-
};
|
|
59
|
-
export type StartWorkspaceRequest = {
|
|
60
|
-
workspaceId: string;
|
|
61
|
-
expiration?: number;
|
|
62
|
-
};
|
|
63
|
-
export declare function isStartWorkspaceRequest(obj: any): obj is StartWorkspaceRequest;
|
|
64
|
-
export type WorkspaceInitLog = DataObject & {
|
|
65
|
-
log: string;
|
|
66
|
-
};
|
|
67
|
-
export declare function isUnsavedWorkspace(obj: any): obj is UnsavedWorkspace;
|
|
68
|
-
export declare function isWorkspace(obj: any): obj is Workspace;
|
|
69
|
-
export declare function isWorkspaceLogRecord(obj: any): obj is WorkspaceInitLog;
|
|
1
|
+
import * as k8s from '@kubernetes/client-node';
|
|
2
|
+
import { VirtualServer } from './nginx-ingress-types';
|
|
3
|
+
import { StoredParamValues } from './params';
|
|
4
|
+
import { HasHttpAccessRules } from './accessRules';
|
|
5
|
+
import { DataObject, HasKubeStructureVersion, NamedDataObject, UnsavedDataObject } from './base';
|
|
6
|
+
import { GitRepoRefInfo } from './project';
|
|
7
|
+
export type WorkspaceTemplateId = 'm2Ubuntu' | 'm1V2' | 'wordpressV2' | 'drupalV2' | 'laravel' | 'm2' | 'm1' | 'wordpress' | 'drupal';
|
|
8
|
+
export type WorkspaceInfo = NamedDataObject & {
|
|
9
|
+
projectId: string;
|
|
10
|
+
developerId: string;
|
|
11
|
+
lastSeen?: number;
|
|
12
|
+
};
|
|
13
|
+
export type WorkspaceInitType = 'empty' | 'repo' | 'install';
|
|
14
|
+
export type WorkspaceInitOptions = {
|
|
15
|
+
type: WorkspaceInitType;
|
|
16
|
+
repo?: string;
|
|
17
|
+
ref?: GitRepoRefInfo;
|
|
18
|
+
};
|
|
19
|
+
export type Workspace = WorkspaceInfo & HasHttpAccessRules & HasKubeStructureVersion & {
|
|
20
|
+
volumeSize: number;
|
|
21
|
+
initOptions?: WorkspaceInitOptions;
|
|
22
|
+
initialized: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Represents a keypair in PrivateKey/PublicKey collections (shared ID, see crypto.ts).
|
|
25
|
+
* Used for SSH access into the workspace.
|
|
26
|
+
*/
|
|
27
|
+
keyPairId?: string;
|
|
28
|
+
workspaceTemplate: WorkspaceTemplateId;
|
|
29
|
+
workspaceParams: StoredParamValues<any>;
|
|
30
|
+
};
|
|
31
|
+
export type UnsavedWorkspace = Omit<UnsavedDataObject<Workspace>, 'kubeStructureVersion' | 'initialized' | 'lastSeen'>;
|
|
32
|
+
export type WorkspaceDescription = DataObject & {
|
|
33
|
+
workspaceId: string;
|
|
34
|
+
description: string;
|
|
35
|
+
latest: boolean;
|
|
36
|
+
createdBy: string;
|
|
37
|
+
};
|
|
38
|
+
export type UpdateWorkspaceDescriptionRequest = {
|
|
39
|
+
id: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
export type WorkspaceInspection = {
|
|
43
|
+
workspace: Workspace;
|
|
44
|
+
resolvedParams: object;
|
|
45
|
+
deployment: k8s.V1Deployment;
|
|
46
|
+
currentPod?: k8s.V1Pod;
|
|
47
|
+
initJob?: k8s.V1Job;
|
|
48
|
+
pvc?: k8s.V1PersistentVolumeClaim;
|
|
49
|
+
projectVolumes?: k8s.V1PersistentVolumeClaim[];
|
|
50
|
+
projectVirtualServers?: VirtualServer[];
|
|
51
|
+
internalService?: k8s.V1Service;
|
|
52
|
+
nodePortService?: k8s.V1Service;
|
|
53
|
+
ebsClaims?: k8s.V1PersistentVolumeClaim[];
|
|
54
|
+
ingress?: k8s.V1Ingress;
|
|
55
|
+
virtualServers?: VirtualServer[];
|
|
56
|
+
events?: k8s.CoreV1Event[];
|
|
57
|
+
description: WorkspaceDescription | null;
|
|
58
|
+
};
|
|
59
|
+
export type StartWorkspaceRequest = {
|
|
60
|
+
workspaceId: string;
|
|
61
|
+
expiration?: number;
|
|
62
|
+
};
|
|
63
|
+
export declare function isStartWorkspaceRequest(obj: any): obj is StartWorkspaceRequest;
|
|
64
|
+
export type WorkspaceInitLog = DataObject & {
|
|
65
|
+
log: string;
|
|
66
|
+
};
|
|
67
|
+
export declare function isUnsavedWorkspace(obj: any): obj is UnsavedWorkspace;
|
|
68
|
+
export declare function isWorkspace(obj: any): obj is Workspace;
|
|
69
|
+
export declare function isWorkspaceLogRecord(obj: any): obj is WorkspaceInitLog;
|
package/dist/workspace.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isWorkspaceLogRecord = exports.isWorkspace = exports.isUnsavedWorkspace = exports.isStartWorkspaceRequest = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
5
|
-
function isStartWorkspaceRequest(obj) {
|
|
6
|
-
return !!obj && typeof obj.workspaceId === 'string';
|
|
7
|
-
}
|
|
8
|
-
exports.isStartWorkspaceRequest = isStartWorkspaceRequest;
|
|
9
|
-
function isUnsavedWorkspace(obj) {
|
|
10
|
-
if (!(0, base_1.isUnsavedEntity)(obj))
|
|
11
|
-
return false;
|
|
12
|
-
return (typeof obj.developerId === 'string' && typeof obj.projectId === 'string');
|
|
13
|
-
}
|
|
14
|
-
exports.isUnsavedWorkspace = isUnsavedWorkspace;
|
|
15
|
-
function isWorkspace(obj) {
|
|
16
|
-
return (0, base_1.isEntity)(obj) && isUnsavedWorkspace(obj);
|
|
17
|
-
}
|
|
18
|
-
exports.isWorkspace = isWorkspace;
|
|
19
|
-
function isWorkspaceLogRecord(obj) {
|
|
20
|
-
return typeof obj.log === 'string' && (0, base_1.isEntity)(obj);
|
|
21
|
-
}
|
|
22
|
-
exports.isWorkspaceLogRecord = isWorkspaceLogRecord;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isWorkspaceLogRecord = exports.isWorkspace = exports.isUnsavedWorkspace = exports.isStartWorkspaceRequest = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
function isStartWorkspaceRequest(obj) {
|
|
6
|
+
return !!obj && typeof obj.workspaceId === 'string';
|
|
7
|
+
}
|
|
8
|
+
exports.isStartWorkspaceRequest = isStartWorkspaceRequest;
|
|
9
|
+
function isUnsavedWorkspace(obj) {
|
|
10
|
+
if (!(0, base_1.isUnsavedEntity)(obj))
|
|
11
|
+
return false;
|
|
12
|
+
return (typeof obj.developerId === 'string' && typeof obj.projectId === 'string');
|
|
13
|
+
}
|
|
14
|
+
exports.isUnsavedWorkspace = isUnsavedWorkspace;
|
|
15
|
+
function isWorkspace(obj) {
|
|
16
|
+
return (0, base_1.isEntity)(obj) && isUnsavedWorkspace(obj);
|
|
17
|
+
}
|
|
18
|
+
exports.isWorkspace = isWorkspace;
|
|
19
|
+
function isWorkspaceLogRecord(obj) {
|
|
20
|
+
return typeof obj.log === 'string' && (0, base_1.isEntity)(obj);
|
|
21
|
+
}
|
|
22
|
+
exports.isWorkspaceLogRecord = isWorkspaceLogRecord;
|
|
23
23
|
//# sourceMappingURL=workspace.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordinlabs/wsm-types",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3-alpha.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "LGPL-3.0-only",
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@ordinlabs/prettier-config-wsm": "^2.2.
|
|
17
|
+
"@ordinlabs/prettier-config-wsm": "^2.2.3-alpha.10",
|
|
18
18
|
"@types/jest": "^27.4.1",
|
|
19
19
|
"@types/jsbn": "^1.2.30",
|
|
20
20
|
"jest": "26.6.0",
|
|
@@ -31,9 +31,12 @@
|
|
|
31
31
|
"moment-timezone": "^0.5.34"
|
|
32
32
|
},
|
|
33
33
|
"prettier": "@ordinlabs/prettier-config-wsm",
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "844b189f4f4377aee9a6e4a054ace9013129d22d",
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public",
|
|
37
37
|
"registry": "https://registry.npmjs.org/"
|
|
38
|
-
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
]
|
|
39
42
|
}
|
package/src/accessRules.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type AllowListEntry = {
|
|
2
|
-
value: string;
|
|
3
|
-
comment?: string;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export type HttpAccessRule = {
|
|
7
|
-
id: string;
|
|
8
|
-
anyIp: boolean;
|
|
9
|
-
allowedIps?: AllowListEntry[];
|
|
10
|
-
anyPath: boolean;
|
|
11
|
-
allowedPaths?: AllowListEntry[];
|
|
12
|
-
enableCloudEditing?: boolean;
|
|
13
|
-
comment?: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type HasHttpAccessRules = {
|
|
17
|
-
httpAccessRules?: HttpAccessRule[];
|
|
18
|
-
};
|
package/src/apiKey.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type APIKeyInfo = {
|
|
2
|
-
id: string;
|
|
3
|
-
userId: string;
|
|
4
|
-
note: string;
|
|
5
|
-
created: number;
|
|
6
|
-
expiresAt: number;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export type APIKey = APIKeyInfo & {
|
|
10
|
-
secret: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type CreateAPIKeyRequest = {
|
|
14
|
-
note: string;
|
|
15
|
-
expiresAt: number;
|
|
16
|
-
};
|
package/src/base.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export type HasId<K = string> = {
|
|
2
|
-
id: K;
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
export type DatedObject = {
|
|
6
|
-
created: number;
|
|
7
|
-
lastModified: number;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type HasKubeStructureVersion = {
|
|
11
|
-
kubeStructureVersion: number;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type IdAndName<K = string> = {
|
|
15
|
-
id: K;
|
|
16
|
-
name: string;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type DataObject<K = string> = HasId<K> & DatedObject;
|
|
20
|
-
export type NamedDataObject<K = string> = IdAndName<K> & DatedObject;
|
|
21
|
-
export type UnsavedDataObject<T extends DataObject> = Omit<
|
|
22
|
-
T,
|
|
23
|
-
'id' | 'created' | 'lastModified'
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
export type Optional<Type, Key extends keyof Type> = Omit<Type, Key> &
|
|
27
|
-
Partial<Pick<Type, Key>>;
|
|
28
|
-
|
|
29
|
-
export function isEntity(obj: any): obj is DataObject<string> {
|
|
30
|
-
return typeof obj?.id === 'string' && isUnsavedEntity(obj);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function isUnsavedEntity(obj: any): obj is UnsavedDataObject<any> {
|
|
34
|
-
return typeof obj === 'object' && typeof obj?.name === 'string';
|
|
35
|
-
}
|
package/src/clientConfig.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type ClientConfig = {
|
|
2
|
-
appVersion: string;
|
|
3
|
-
sshHost: string;
|
|
4
|
-
sshNamePrefix: string;
|
|
5
|
-
workspaceDomain: string;
|
|
6
|
-
projectTemplateDefaults: Record<string, object>;
|
|
7
|
-
workspaceTemplateDefaults: Record<string, object>;
|
|
8
|
-
serverIpRanges: string[];
|
|
9
|
-
defaultTimezone: string;
|
|
10
|
-
authProviders: string[];
|
|
11
|
-
approvedGoogleDomains: string[];
|
|
12
|
-
vpnSupportEnabled: boolean;
|
|
13
|
-
};
|
package/src/developer.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ApplicationRole } from './rbac';
|
|
2
|
-
import {
|
|
3
|
-
isEntity,
|
|
4
|
-
isUnsavedEntity,
|
|
5
|
-
NamedDataObject,
|
|
6
|
-
UnsavedDataObject,
|
|
7
|
-
} from './base';
|
|
8
|
-
|
|
9
|
-
export type DeveloperInfo = NamedDataObject & {
|
|
10
|
-
email: string;
|
|
11
|
-
appRole?: ApplicationRole;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type Developer = DeveloperInfo & {
|
|
15
|
-
/** @deprecated use `publicKeys` instead */
|
|
16
|
-
publicKey?: string;
|
|
17
|
-
publicKeys: string[];
|
|
18
|
-
timezone?: string;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type UnsavedDeveloper = UnsavedDataObject<Developer>;
|
|
22
|
-
|
|
23
|
-
export function isUnsavedDeveloper(obj: any): obj is UnsavedDeveloper {
|
|
24
|
-
return isUnsavedEntity(obj) && typeof obj.email === 'string';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function isDeveloper(obj: any): obj is Developer {
|
|
28
|
-
return isEntity(obj) && isUnsavedDeveloper(obj);
|
|
29
|
-
}
|
package/src/group.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isEntity,
|
|
3
|
-
isUnsavedEntity,
|
|
4
|
-
NamedDataObject,
|
|
5
|
-
UnsavedDataObject,
|
|
6
|
-
} from './base';
|
|
7
|
-
import { GroupRole } from './rbac';
|
|
8
|
-
import { UserAssociation, UserAssociationId } from './memberships';
|
|
9
|
-
|
|
10
|
-
export type GroupInfo = NamedDataObject;
|
|
11
|
-
export type MyGroupInfo = GroupInfo & {
|
|
12
|
-
role?: GroupRole;
|
|
13
|
-
};
|
|
14
|
-
export type Group = GroupInfo;
|
|
15
|
-
export type UnsavedGroup = UnsavedDataObject<Group>;
|
|
16
|
-
|
|
17
|
-
export function isUnsavedGroup(obj: any): obj is UnsavedGroup {
|
|
18
|
-
return isUnsavedEntity(obj);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function isGroup(obj: any): obj is Group {
|
|
22
|
-
return isEntity(obj) && isUnsavedGroup(obj);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// User memberships
|
|
26
|
-
|
|
27
|
-
export type UserGroupRoleId = UserAssociationId & {
|
|
28
|
-
groupId: string;
|
|
29
|
-
};
|
|
30
|
-
export type UserGroupRole = UserAssociation<GroupRole, UserGroupRoleId>;
|
|
31
|
-
|
|
32
|
-
export function isUserGroupRoleId(obj: any): obj is UserGroupRoleId {
|
|
33
|
-
return typeof obj?.userId === 'string' && typeof obj?.groupId === 'string';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function isUserGroupRole(obj: any): obj is UserGroupRole {
|
|
37
|
-
return isUserGroupRoleId(obj.id) && typeof obj?.role === 'string';
|
|
38
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export * from './accessRules';
|
|
2
|
-
export * from './apiKey';
|
|
3
|
-
export * from './base';
|
|
4
|
-
export * from './clientConfig';
|
|
5
|
-
export * from './developer';
|
|
6
|
-
export * from './group';
|
|
7
|
-
export * from './login';
|
|
8
|
-
export * from './memberships';
|
|
9
|
-
export * from './navData';
|
|
10
|
-
export * from './network';
|
|
11
|
-
export * from './node';
|
|
12
|
-
export * from './project';
|
|
13
|
-
export * from './publicKey';
|
|
14
|
-
export * from './reflection';
|
|
15
|
-
export * from './reporting';
|
|
16
|
-
export * from './requests';
|
|
17
|
-
export * from './session';
|
|
18
|
-
export * from './workspace';
|
|
19
|
-
export * from './k8s';
|
|
20
|
-
export * from './nginx-ingress-types';
|
|
21
|
-
export * from './rbac';
|
package/src/k8s.ts
DELETED
package/src/login.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Developer } from './developer';
|
|
2
|
-
import { NavData } from './navData';
|
|
3
|
-
|
|
4
|
-
export type PasswordOptions = {
|
|
5
|
-
mustChange: boolean;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type PasswordMetadata = PasswordOptions & {
|
|
9
|
-
failureCount: number;
|
|
10
|
-
lastChanged: number;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const BAD_LOGIN_CREDENTIALS = 1;
|
|
14
|
-
export const TOO_MANY_LOGIN_FAILURES = 2;
|
|
15
|
-
export const LOGIN_BLOCKED = 3;
|
|
16
|
-
export type LoginErrorCode =
|
|
17
|
-
| typeof BAD_LOGIN_CREDENTIALS
|
|
18
|
-
| typeof TOO_MANY_LOGIN_FAILURES
|
|
19
|
-
| typeof LOGIN_BLOCKED;
|
|
20
|
-
export type LoginRequest = {
|
|
21
|
-
username: string;
|
|
22
|
-
password: string;
|
|
23
|
-
rememberMe: boolean;
|
|
24
|
-
};
|
|
25
|
-
export type LoginSuccess = {
|
|
26
|
-
success: true;
|
|
27
|
-
mustChangePassword: boolean;
|
|
28
|
-
developer: Developer;
|
|
29
|
-
};
|
|
30
|
-
export type LoginFailure = {
|
|
31
|
-
success: false;
|
|
32
|
-
errorCode: LoginErrorCode;
|
|
33
|
-
};
|
|
34
|
-
export type LoginResult = LoginSuccess | LoginFailure;
|
|
35
|
-
export type RPCLoginSuccess = LoginSuccess & { navData: NavData };
|
|
36
|
-
export type RPCLoginResult = RPCLoginSuccess | LoginFailure;
|
package/src/memberships.ts
DELETED
package/src/navData.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ClientConfig } from './clientConfig';
|
|
2
|
-
import { WorkspaceInfo } from './workspace';
|
|
3
|
-
import { MyProjectInfo } from './project';
|
|
4
|
-
import { DeveloperInfo } from './developer';
|
|
5
|
-
import { MyGroupInfo } from './group';
|
|
6
|
-
import { NodeInfo, RunningPodInfo } from './node';
|
|
7
|
-
|
|
8
|
-
export type NavData = {
|
|
9
|
-
config: ClientConfig;
|
|
10
|
-
workspaces: WorkspaceInfo[];
|
|
11
|
-
projects: MyProjectInfo[];
|
|
12
|
-
developers: DeveloperInfo[];
|
|
13
|
-
groups: MyGroupInfo[];
|
|
14
|
-
nodes: NodeInfo[];
|
|
15
|
-
runningPods: RunningPodInfo;
|
|
16
|
-
};
|
package/src/network.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { DataObject, Optional, UnsavedDataObject } from './base';
|
|
2
|
-
|
|
3
|
-
export type PortMapTypes = 'xdebug' | 'custom';
|
|
4
|
-
|
|
5
|
-
export type PortMap = {
|
|
6
|
-
type: PortMapTypes;
|
|
7
|
-
label: string;
|
|
8
|
-
from: number;
|
|
9
|
-
to: number;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type UnsavedPortMap = Optional<PortMap, 'from'>;
|
|
13
|
-
|
|
14
|
-
export type WireGuardPeer = DataObject & {
|
|
15
|
-
label: string;
|
|
16
|
-
userId: string;
|
|
17
|
-
publicKey: string;
|
|
18
|
-
privateKey: string;
|
|
19
|
-
preSharedKey: string;
|
|
20
|
-
ipAddress: string;
|
|
21
|
-
portMaps?: (PortMap | UnsavedPortMap)[];
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type UnsavedWireGuardPeer = Optional<
|
|
25
|
-
UnsavedDataObject<WireGuardPeer>,
|
|
26
|
-
'publicKey' | 'privateKey' | 'preSharedKey' | 'ipAddress'
|
|
27
|
-
>;
|
|
28
|
-
|
|
29
|
-
export function isUnsavedWireGuardPeer(obj: any): obj is UnsavedWireGuardPeer {
|
|
30
|
-
return typeof obj === 'object' && typeof obj?.id === 'undefined';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function isWireGuardPeer(obj: any): obj is WireGuardPeer {
|
|
34
|
-
return typeof obj === 'object' && typeof obj?.id === 'string';
|
|
35
|
-
}
|