@perses-dev/client 0.54.0-beta.3 → 0.54.0-beta.4
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/dist/cjs/model/folder.js +16 -0
- package/dist/cjs/model/index.js +8 -2
- package/dist/cjs/model/role.js +60 -0
- package/dist/cjs/model/roleBindings.js +16 -0
- package/dist/cjs/model/secret.js +16 -0
- package/dist/cjs/model/user.js +16 -0
- package/dist/cjs/model/variable.js +34 -0
- package/dist/cjs/schema/index.js +3 -0
- package/dist/cjs/schema/role.js +86 -0
- package/dist/cjs/schema/secret.js +211 -0
- package/dist/cjs/schema/user.js +57 -0
- package/dist/model/ephemeralDashboard.d.ts +14 -0
- package/dist/model/ephemeralDashboard.d.ts.map +1 -0
- package/dist/model/ephemeralDashboard.js +15 -0
- package/dist/model/ephemeralDashboard.js.map +1 -0
- package/dist/model/folder.d.ts +19 -0
- package/dist/model/folder.d.ts.map +1 -0
- package/dist/model/{http-proxy.js → folder.js} +1 -1
- package/dist/model/folder.js.map +1 -0
- package/dist/model/http.d.ts +1 -1
- package/dist/model/http.d.ts.map +1 -1
- package/dist/model/http.js.map +1 -1
- package/dist/model/index.d.ts +8 -2
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +8 -2
- package/dist/model/index.js.map +1 -1
- package/dist/model/resource.d.ts +9 -0
- package/dist/model/resource.d.ts.map +1 -1
- package/dist/model/resource.js.map +1 -1
- package/dist/model/role.d.ts +31 -0
- package/dist/model/role.d.ts.map +1 -0
- package/dist/model/role.js +41 -0
- package/dist/model/role.js.map +1 -0
- package/dist/model/roleBindings.d.ts +27 -0
- package/dist/model/roleBindings.d.ts.map +1 -0
- package/dist/model/roleBindings.js +15 -0
- package/dist/model/roleBindings.js.map +1 -0
- package/dist/model/secret.d.ts +54 -0
- package/dist/model/secret.d.ts.map +1 -0
- package/dist/model/secret.js +15 -0
- package/dist/model/secret.js.map +1 -0
- package/dist/model/user.d.ts +21 -0
- package/dist/model/user.d.ts.map +1 -0
- package/dist/model/user.js +15 -0
- package/dist/model/user.js.map +1 -0
- package/dist/model/variable.d.ts +58 -0
- package/dist/model/variable.d.ts.map +1 -0
- package/dist/model/variable.js +18 -0
- package/dist/model/variable.js.map +1 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +3 -0
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/role.d.ts +58 -0
- package/dist/schema/role.d.ts.map +1 -0
- package/dist/schema/role.js +61 -0
- package/dist/schema/role.js.map +1 -0
- package/dist/schema/secret.d.ts +1597 -0
- package/dist/schema/secret.d.ts.map +1 -0
- package/dist/schema/secret.js +189 -0
- package/dist/schema/secret.js.map +1 -0
- package/dist/schema/user.d.ts +8 -0
- package/dist/schema/user.d.ts.map +1 -0
- package/dist/schema/user.js +36 -0
- package/dist/schema/user.js.map +1 -0
- package/package.json +2 -2
- package/dist/model/http-proxy.d.ts +0 -16
- package/dist/model/http-proxy.d.ts.map +0 -1
- package/dist/model/http-proxy.js.map +0 -1
- /package/dist/cjs/model/{http-proxy.js → ephemeralDashboard.js} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
package/dist/cjs/model/index.js
CHANGED
|
@@ -15,11 +15,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./datasource"), exports);
|
|
18
|
-
_export_star(require("./
|
|
19
|
-
_export_star(require("./http-proxy"), exports);
|
|
18
|
+
_export_star(require("./folder"), exports);
|
|
20
19
|
_export_star(require("./kind"), exports);
|
|
21
20
|
_export_star(require("./resource"), exports);
|
|
22
21
|
_export_star(require("./datasource-api"), exports);
|
|
22
|
+
_export_star(require("./http"), exports);
|
|
23
|
+
_export_star(require("./secret"), exports);
|
|
24
|
+
_export_star(require("./role"), exports);
|
|
25
|
+
_export_star(require("./roleBindings"), exports);
|
|
26
|
+
_export_star(require("./user"), exports);
|
|
27
|
+
_export_star(require("./ephemeralDashboard"), exports);
|
|
28
|
+
_export_star(require("./variable"), exports);
|
|
23
29
|
function _export_star(from, to) {
|
|
24
30
|
Object.keys(from).forEach(function(k) {
|
|
25
31
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get ACTIONS () {
|
|
25
|
+
return ACTIONS;
|
|
26
|
+
},
|
|
27
|
+
get GLOBAL_SCOPES () {
|
|
28
|
+
return GLOBAL_SCOPES;
|
|
29
|
+
},
|
|
30
|
+
get PROJECT_SCOPES () {
|
|
31
|
+
return PROJECT_SCOPES;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const ACTIONS = [
|
|
35
|
+
'*',
|
|
36
|
+
'create',
|
|
37
|
+
'read',
|
|
38
|
+
'update',
|
|
39
|
+
'delete'
|
|
40
|
+
];
|
|
41
|
+
const PROJECT_SCOPES = [
|
|
42
|
+
'*',
|
|
43
|
+
'Dashboard',
|
|
44
|
+
'Datasource',
|
|
45
|
+
'EphemeralDashboard',
|
|
46
|
+
'Folder',
|
|
47
|
+
'Project',
|
|
48
|
+
'Role',
|
|
49
|
+
'RoleBinding',
|
|
50
|
+
'Secret',
|
|
51
|
+
'Variable'
|
|
52
|
+
];
|
|
53
|
+
const GLOBAL_SCOPES = [
|
|
54
|
+
'GlobalDatasource',
|
|
55
|
+
'GlobalRole',
|
|
56
|
+
'GlobalRoleBinding',
|
|
57
|
+
'GlobalSecret',
|
|
58
|
+
'GlobalVariable',
|
|
59
|
+
'User'
|
|
60
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get DEFAULT_ALL_VALUE () {
|
|
25
|
+
return DEFAULT_ALL_VALUE;
|
|
26
|
+
},
|
|
27
|
+
get getVariableProject () {
|
|
28
|
+
return getVariableProject;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function getVariableProject(variable) {
|
|
32
|
+
return 'project' in variable.metadata ? variable.metadata.project : undefined;
|
|
33
|
+
}
|
|
34
|
+
const DEFAULT_ALL_VALUE = '$__all';
|
package/dist/cjs/schema/index.js
CHANGED
|
@@ -16,6 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./datasource"), exports);
|
|
18
18
|
_export_star(require("./metadata"), exports);
|
|
19
|
+
_export_star(require("./user"), exports);
|
|
20
|
+
_export_star(require("./secret"), exports);
|
|
21
|
+
_export_star(require("./role"), exports);
|
|
19
22
|
function _export_star(from, to) {
|
|
20
23
|
Object.keys(from).forEach(function(k) {
|
|
21
24
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get globalRoleSchema () {
|
|
25
|
+
return globalRoleSchema;
|
|
26
|
+
},
|
|
27
|
+
get permissionSchema () {
|
|
28
|
+
return permissionSchema;
|
|
29
|
+
},
|
|
30
|
+
get roleSchema () {
|
|
31
|
+
return roleSchema;
|
|
32
|
+
},
|
|
33
|
+
get roleSpecSchema () {
|
|
34
|
+
return roleSpecSchema;
|
|
35
|
+
},
|
|
36
|
+
get rolesEditorSchema () {
|
|
37
|
+
return rolesEditorSchema;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const _zod = require("zod");
|
|
41
|
+
const _metadata = require("./metadata");
|
|
42
|
+
const permissionSchema = _zod.z.object({
|
|
43
|
+
// TODO: use SCOPE & ACTIONS constants
|
|
44
|
+
actions: _zod.z.array(_zod.z.enum([
|
|
45
|
+
'*',
|
|
46
|
+
'create',
|
|
47
|
+
'read',
|
|
48
|
+
'update',
|
|
49
|
+
'delete'
|
|
50
|
+
])).nonempty('Must contains at least 1 action'),
|
|
51
|
+
scopes: _zod.z.array(_zod.z.enum([
|
|
52
|
+
'*',
|
|
53
|
+
'Dashboard',
|
|
54
|
+
'Datasource',
|
|
55
|
+
'EphemeralDashboard',
|
|
56
|
+
'Folder',
|
|
57
|
+
'GlobalDatasource',
|
|
58
|
+
'GlobalRole',
|
|
59
|
+
'GlobalRoleBinding',
|
|
60
|
+
'GlobalSecret',
|
|
61
|
+
'GlobalVariable',
|
|
62
|
+
'Project',
|
|
63
|
+
'Role',
|
|
64
|
+
'RoleBinding',
|
|
65
|
+
'Secret',
|
|
66
|
+
'User',
|
|
67
|
+
'Variable'
|
|
68
|
+
])).nonempty('Must contains at least 1 scope')
|
|
69
|
+
});
|
|
70
|
+
const roleSpecSchema = _zod.z.object({
|
|
71
|
+
permissions: _zod.z.array(permissionSchema)
|
|
72
|
+
});
|
|
73
|
+
const roleSchema = _zod.z.object({
|
|
74
|
+
kind: _zod.z.literal('Role'),
|
|
75
|
+
metadata: _metadata.projectMetadataSchema,
|
|
76
|
+
spec: roleSpecSchema
|
|
77
|
+
});
|
|
78
|
+
const globalRoleSchema = _zod.z.object({
|
|
79
|
+
kind: _zod.z.literal('GlobalRole'),
|
|
80
|
+
metadata: _metadata.metadataSchema,
|
|
81
|
+
spec: roleSpecSchema
|
|
82
|
+
});
|
|
83
|
+
const rolesEditorSchema = _zod.z.discriminatedUnion('kind', [
|
|
84
|
+
roleSchema,
|
|
85
|
+
globalRoleSchema
|
|
86
|
+
]);
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get globalSecretSchema () {
|
|
25
|
+
return globalSecretSchema;
|
|
26
|
+
},
|
|
27
|
+
get secretSchema () {
|
|
28
|
+
return secretSchema;
|
|
29
|
+
},
|
|
30
|
+
get secretSpecSchema () {
|
|
31
|
+
return secretSpecSchema;
|
|
32
|
+
},
|
|
33
|
+
get secretsEditorSchema () {
|
|
34
|
+
return secretsEditorSchema;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const _zod = require("zod");
|
|
38
|
+
const _metadata = require("./metadata");
|
|
39
|
+
const secretSpecSchema = _zod.z.object({
|
|
40
|
+
basicAuth: _zod.z.object({
|
|
41
|
+
username: _zod.z.string().min(1),
|
|
42
|
+
password: _zod.z.string().optional(),
|
|
43
|
+
passwordFile: _zod.z.string().optional()
|
|
44
|
+
}).superRefine((val, ctx)=>{
|
|
45
|
+
if (val.password && val.password.length > 0 && val.passwordFile && val.passwordFile.length > 0) {
|
|
46
|
+
ctx.addIssue({
|
|
47
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
48
|
+
message: 'Only one of the fields must be defined',
|
|
49
|
+
path: [
|
|
50
|
+
'password'
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
ctx.addIssue({
|
|
54
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
55
|
+
message: 'Only one of the fields must be defined',
|
|
56
|
+
path: [
|
|
57
|
+
'passwordFile'
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}).optional(),
|
|
62
|
+
authorization: _zod.z.object({
|
|
63
|
+
type: _zod.z.string().optional(),
|
|
64
|
+
credentials: _zod.z.string().optional(),
|
|
65
|
+
credentialsFile: _zod.z.string().optional()
|
|
66
|
+
}).superRefine((val, ctx)=>{
|
|
67
|
+
if (val.credentials && val.credentials.length > 0 && val.credentialsFile && val.credentialsFile.length > 0) {
|
|
68
|
+
ctx.addIssue({
|
|
69
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
70
|
+
message: 'Only one of the fields must be defined',
|
|
71
|
+
path: [
|
|
72
|
+
'credentials'
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
ctx.addIssue({
|
|
76
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
77
|
+
message: 'Only one of the fields must be defined',
|
|
78
|
+
path: [
|
|
79
|
+
'credentialsFile'
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}).optional(),
|
|
84
|
+
oauth: _zod.z.object({
|
|
85
|
+
clientID: _zod.z.string().min(1),
|
|
86
|
+
clientSecret: _zod.z.string().optional(),
|
|
87
|
+
clientSecretFile: _zod.z.string().optional(),
|
|
88
|
+
tokenURL: _zod.z.string().min(1),
|
|
89
|
+
scopes: _zod.z.array(_zod.z.string().nonempty()).default([]),
|
|
90
|
+
endpointParams: _zod.z.record(_zod.z.string().nonempty(), _zod.z.array(_zod.z.string())).default({}).optional(),
|
|
91
|
+
authStyle: _zod.z.union([
|
|
92
|
+
_zod.z.literal(0),
|
|
93
|
+
_zod.z.literal(1),
|
|
94
|
+
_zod.z.literal(2)
|
|
95
|
+
]).optional()
|
|
96
|
+
}).superRefine((val, ctx)=>{
|
|
97
|
+
if (val.clientSecret && val.clientSecret.length > 0 && val.clientSecretFile && val.clientSecretFile.length > 0) {
|
|
98
|
+
ctx.addIssue({
|
|
99
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
100
|
+
message: 'Only one of the fields must be defined',
|
|
101
|
+
path: [
|
|
102
|
+
'clientSecret'
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
ctx.addIssue({
|
|
106
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
107
|
+
message: 'Only one of the fields must be defined',
|
|
108
|
+
path: [
|
|
109
|
+
'clientSecretFile'
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}).optional(),
|
|
114
|
+
tlsConfig: _zod.z.object({
|
|
115
|
+
ca: _zod.z.string().optional(),
|
|
116
|
+
cert: _zod.z.string().optional(),
|
|
117
|
+
key: _zod.z.string().optional(),
|
|
118
|
+
caFile: _zod.z.string().optional(),
|
|
119
|
+
certFile: _zod.z.string().optional(),
|
|
120
|
+
keyFile: _zod.z.string().optional(),
|
|
121
|
+
serverName: _zod.z.string().optional(),
|
|
122
|
+
insecureSkipVerify: _zod.z.boolean().optional()
|
|
123
|
+
}).superRefine((val, ctx)=>{
|
|
124
|
+
if (val.ca && val.ca.length > 0 && val.caFile && val.caFile.length > 0) {
|
|
125
|
+
ctx.addIssue({
|
|
126
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
127
|
+
message: 'Only one of the fields must be defined',
|
|
128
|
+
path: [
|
|
129
|
+
'ca'
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
ctx.addIssue({
|
|
133
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
134
|
+
message: 'Only one of the fields must be defined',
|
|
135
|
+
path: [
|
|
136
|
+
'caFile'
|
|
137
|
+
]
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (val.cert && val.cert.length > 0 && val.certFile && val.certFile.length > 0) {
|
|
141
|
+
ctx.addIssue({
|
|
142
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
143
|
+
message: 'Only one of the fields must be defined',
|
|
144
|
+
path: [
|
|
145
|
+
'cert'
|
|
146
|
+
]
|
|
147
|
+
});
|
|
148
|
+
ctx.addIssue({
|
|
149
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
150
|
+
message: 'Only one of the fields must be defined',
|
|
151
|
+
path: [
|
|
152
|
+
'certFile'
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (val.key && val.key.length > 0 && val.keyFile && val.keyFile.length > 0) {
|
|
157
|
+
ctx.addIssue({
|
|
158
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
159
|
+
message: 'Only one of the fields must be defined',
|
|
160
|
+
path: [
|
|
161
|
+
'key'
|
|
162
|
+
]
|
|
163
|
+
});
|
|
164
|
+
ctx.addIssue({
|
|
165
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
166
|
+
message: 'Only one of the fields must be defined',
|
|
167
|
+
path: [
|
|
168
|
+
'keyFile'
|
|
169
|
+
]
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}).optional()
|
|
173
|
+
}).superRefine((val, ctx)=>{
|
|
174
|
+
if (val.basicAuth && val.authorization && val.oauth) {
|
|
175
|
+
ctx.addIssue({
|
|
176
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
177
|
+
message: 'Only one of the fields must be defined',
|
|
178
|
+
path: [
|
|
179
|
+
'basicAuth'
|
|
180
|
+
]
|
|
181
|
+
});
|
|
182
|
+
ctx.addIssue({
|
|
183
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
184
|
+
message: 'Only one of the fields must be defined',
|
|
185
|
+
path: [
|
|
186
|
+
'authorization'
|
|
187
|
+
]
|
|
188
|
+
});
|
|
189
|
+
ctx.addIssue({
|
|
190
|
+
code: _zod.z.ZodIssueCode.custom,
|
|
191
|
+
message: 'Only one of the fields must be defined',
|
|
192
|
+
path: [
|
|
193
|
+
'oauth'
|
|
194
|
+
]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
const secretSchema = _zod.z.object({
|
|
199
|
+
kind: _zod.z.literal('Secret'),
|
|
200
|
+
metadata: _metadata.projectMetadataSchema,
|
|
201
|
+
spec: secretSpecSchema
|
|
202
|
+
});
|
|
203
|
+
const globalSecretSchema = _zod.z.object({
|
|
204
|
+
kind: _zod.z.literal('GlobalSecret'),
|
|
205
|
+
metadata: _metadata.metadataSchema,
|
|
206
|
+
spec: secretSpecSchema
|
|
207
|
+
});
|
|
208
|
+
const secretsEditorSchema = _zod.z.discriminatedUnion('kind', [
|
|
209
|
+
secretSchema,
|
|
210
|
+
globalSecretSchema
|
|
211
|
+
]);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get nativeProviderSchema () {
|
|
25
|
+
return nativeProviderSchema;
|
|
26
|
+
},
|
|
27
|
+
get oauthProvidersSchema () {
|
|
28
|
+
return oauthProvidersSchema;
|
|
29
|
+
},
|
|
30
|
+
get userSchema () {
|
|
31
|
+
return userSchema;
|
|
32
|
+
},
|
|
33
|
+
get userSpecSchema () {
|
|
34
|
+
return userSpecSchema;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const _zod = require("zod");
|
|
38
|
+
const _metadata = require("./metadata");
|
|
39
|
+
const nativeProviderSchema = _zod.z.object({
|
|
40
|
+
password: _zod.z.string().optional()
|
|
41
|
+
});
|
|
42
|
+
const oauthProvidersSchema = _zod.z.object({
|
|
43
|
+
issuer: _zod.z.string().optional(),
|
|
44
|
+
email: _zod.z.string().optional(),
|
|
45
|
+
subject: _zod.z.string().optional()
|
|
46
|
+
});
|
|
47
|
+
const userSpecSchema = _zod.z.object({
|
|
48
|
+
firstName: _zod.z.string().optional(),
|
|
49
|
+
lastName: _zod.z.string().optional(),
|
|
50
|
+
nativeProvider: nativeProviderSchema.optional(),
|
|
51
|
+
oauthProviders: _zod.z.array(oauthProvidersSchema).optional()
|
|
52
|
+
});
|
|
53
|
+
const userSchema = _zod.z.object({
|
|
54
|
+
kind: _zod.z.literal('User'),
|
|
55
|
+
metadata: _metadata.metadataSchema,
|
|
56
|
+
spec: userSpecSchema
|
|
57
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProjectMetadata } from '@perses-dev/client';
|
|
2
|
+
import { DashboardSelector, DashboardSpec, DurationString } from '@perses-dev/spec';
|
|
3
|
+
export interface EphemeralDashboardResource {
|
|
4
|
+
kind: 'EphemeralDashboard';
|
|
5
|
+
metadata: ProjectMetadata;
|
|
6
|
+
spec: EphemeralDashboardSpec;
|
|
7
|
+
}
|
|
8
|
+
export interface EphemeralDashboardSpec extends DashboardSpec {
|
|
9
|
+
ttl: DurationString;
|
|
10
|
+
}
|
|
11
|
+
export interface EphemeralDashboardInfo extends DashboardSelector {
|
|
12
|
+
ttl: DurationString;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ephemeralDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ephemeralDashboard.d.ts","sourceRoot":"","sources":["../../src/model/ephemeralDashboard.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpF,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAuB,SAAQ,aAAa;IAC3D,GAAG,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,GAAG,EAAE,cAAc,CAAC;CACrB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export { };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=ephemeralDashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/ephemeralDashboard.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ProjectMetadata } from '@perses-dev/client';\nimport { DashboardSelector, DashboardSpec, DurationString } from '@perses-dev/spec';\n\nexport interface EphemeralDashboardResource {\n kind: 'EphemeralDashboard';\n metadata: ProjectMetadata;\n spec: EphemeralDashboardSpec;\n}\n\nexport interface EphemeralDashboardSpec extends DashboardSpec {\n ttl: DurationString;\n}\n\nexport interface EphemeralDashboardInfo extends DashboardSelector {\n ttl: DurationString;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAejC,WAEC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ProjectMetadata } from './resource';
|
|
2
|
+
export interface FolderDisplay {
|
|
3
|
+
name?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface FolderSpec {
|
|
6
|
+
display?: FolderDisplay;
|
|
7
|
+
items?: FolderItem[];
|
|
8
|
+
}
|
|
9
|
+
export interface FolderItem {
|
|
10
|
+
kind: 'Folder' | 'Dashboard';
|
|
11
|
+
name: string;
|
|
12
|
+
items?: FolderItem[];
|
|
13
|
+
}
|
|
14
|
+
export interface FolderResource {
|
|
15
|
+
kind: 'Folder';
|
|
16
|
+
metadata: ProjectMetadata;
|
|
17
|
+
spec: FolderSpec;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../src/model/folder.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,UAAU,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/folder.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ProjectMetadata } from './resource';\n\nexport interface FolderDisplay {\n name?: string;\n}\n\nexport interface FolderSpec {\n display?: FolderDisplay;\n items?: FolderItem[];\n}\n\nexport interface FolderItem {\n kind: 'Folder' | 'Dashboard';\n name: string;\n items?: FolderItem[];\n}\n\nexport interface FolderResource {\n kind: 'Folder';\n metadata: ProjectMetadata;\n spec: FolderSpec;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAmBjC,WAIC"}
|
package/dist/model/http.d.ts
CHANGED
package/dist/model/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/model/http.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/model/http.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
|
package/dist/model/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/http.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { HTTPProxy } from '
|
|
1
|
+
{"version":3,"sources":["../../src/model/http.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { HTTPProxy } from '@perses-dev/spec';\n\nexport type RequestHeaders = Record<string, string>;\nexport interface HTTPDatasourceSpec {\n directUrl?: string;\n proxy?: HTTPProxy;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAKjC,WAGC"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export * from './datasource';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './http-proxy';
|
|
2
|
+
export * from './folder';
|
|
4
3
|
export * from './kind';
|
|
5
4
|
export * from './resource';
|
|
6
5
|
export * from './datasource-api';
|
|
6
|
+
export * from './http';
|
|
7
|
+
export * from './secret';
|
|
8
|
+
export * from './role';
|
|
9
|
+
export * from './roleBindings';
|
|
10
|
+
export * from './user';
|
|
11
|
+
export * from './ephemeralDashboard';
|
|
12
|
+
export * from './variable';
|
|
7
13
|
//# sourceMappingURL=index.d.ts.map
|