@perses-dev/client 0.54.0-beta.2 → 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC"}
|
package/dist/model/index.js
CHANGED
|
@@ -11,10 +11,16 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
export * from './datasource';
|
|
14
|
-
export * from './
|
|
15
|
-
export * from './http-proxy';
|
|
14
|
+
export * from './folder';
|
|
16
15
|
export * from './kind';
|
|
17
16
|
export * from './resource';
|
|
18
17
|
export * from './datasource-api';
|
|
18
|
+
export * from './http';
|
|
19
|
+
export * from './secret';
|
|
20
|
+
export * from './role';
|
|
21
|
+
export * from './roleBindings';
|
|
22
|
+
export * from './user';
|
|
23
|
+
export * from './ephemeralDashboard';
|
|
24
|
+
export * from './variable';
|
|
19
25
|
|
|
20
26
|
//# sourceMappingURL=index.js.map
|
package/dist/model/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/index.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\nexport * from './datasource';\nexport * from './
|
|
1
|
+
{"version":3,"sources":["../../src/model/index.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\nexport * from './datasource';\nexport * from './folder';\nexport * from './kind';\nexport * from './resource';\nexport * from './datasource-api';\nexport * from './http';\nexport * from './secret';\nexport * from './role';\nexport * from './roleBindings';\nexport * from './user';\nexport * from './ephemeralDashboard';\nexport * from './variable';\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,cAAc,eAAe;AAC7B,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,mBAAmB;AACjC,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,iBAAiB;AAC/B,cAAc,SAAS;AACvB,cAAc,uBAAuB;AACrC,cAAc,aAAa"}
|
package/dist/model/resource.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Display } from '@perses-dev/spec';
|
|
1
2
|
import { Kind } from './kind';
|
|
2
3
|
export declare function isProjectMetadata(metadata: Metadata | ProjectMetadata): metadata is ProjectMetadata;
|
|
3
4
|
export interface Metadata {
|
|
@@ -15,5 +16,13 @@ export interface Resource {
|
|
|
15
16
|
metadata: Metadata | ProjectMetadata;
|
|
16
17
|
spec?: any;
|
|
17
18
|
}
|
|
19
|
+
export interface ProjectResource {
|
|
20
|
+
kind: 'Project';
|
|
21
|
+
metadata: Metadata;
|
|
22
|
+
spec?: ProjectSpec;
|
|
23
|
+
}
|
|
24
|
+
export interface ProjectSpec {
|
|
25
|
+
display?: Display;
|
|
26
|
+
}
|
|
18
27
|
export declare function getMetadataProject(metadata: ProjectMetadata | Metadata): string | undefined;
|
|
19
28
|
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/model/resource.ts"],"names":[],"mappings":"AA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AAW,QAAQ;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,QAAQ,GAAG,eAAe,CAAC;IAErC,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAE3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/resource.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 { Kind } from './kind';\n\nexport function isProjectMetadata(metadata: Metadata | ProjectMetadata): metadata is ProjectMetadata {\n return 'project' in metadata;\n}\n\nexport interface Metadata {\n name: string;\n createdAt?: string;\n updatedAt?: string;\n version?: number;\n tags?: string[];\n}\n\nexport interface ProjectMetadata extends Metadata {\n project: string;\n}\n\nexport interface Resource {\n kind: Kind;\n metadata: Metadata | ProjectMetadata;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n spec?: any;\n}\n\nexport function getMetadataProject(metadata: ProjectMetadata | Metadata): string | undefined {\n return 'project' in metadata ? metadata.project : undefined;\n}\n"],"names":["isProjectMetadata","metadata","getMetadataProject","project","undefined"],"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;
|
|
1
|
+
{"version":3,"sources":["../../src/model/resource.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 { Display } from '@perses-dev/spec';\nimport { Kind } from './kind';\n\nexport function isProjectMetadata(metadata: Metadata | ProjectMetadata): metadata is ProjectMetadata {\n return 'project' in metadata;\n}\n\nexport interface Metadata {\n name: string;\n createdAt?: string;\n updatedAt?: string;\n version?: number;\n tags?: string[];\n}\n\nexport interface ProjectMetadata extends Metadata {\n project: string;\n}\n\nexport interface Resource {\n kind: Kind;\n metadata: Metadata | ProjectMetadata;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n spec?: any;\n}\n\nexport interface ProjectResource {\n kind: 'Project';\n metadata: Metadata;\n spec?: ProjectSpec;\n}\n\nexport interface ProjectSpec {\n display?: Display;\n}\n\nexport function getMetadataProject(metadata: ProjectMetadata | Metadata): string | undefined {\n return 'project' in metadata ? metadata.project : undefined;\n}\n"],"names":["isProjectMetadata","metadata","getMetadataProject","project","undefined"],"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,OAAO,SAASA,kBAAkBC,QAAoC;IACpE,OAAO,aAAaA;AACtB;AA+BA,OAAO,SAASC,mBAAmBD,QAAoC;IACrE,OAAO,aAAaA,WAAWA,SAASE,OAAO,GAAGC;AACpD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Kind, Metadata, ProjectMetadata } from '@perses-dev/client';
|
|
2
|
+
export type Action = 'create' | 'read' | 'update' | 'delete' | '*';
|
|
3
|
+
export declare const ACTIONS: string[];
|
|
4
|
+
export type Scope = Kind | '*';
|
|
5
|
+
export declare const PROJECT_SCOPES: string[];
|
|
6
|
+
export declare const GLOBAL_SCOPES: string[];
|
|
7
|
+
export interface Permission {
|
|
8
|
+
actions: Action[];
|
|
9
|
+
scopes: Scope[];
|
|
10
|
+
}
|
|
11
|
+
export interface RoleSpec {
|
|
12
|
+
permissions: Permission[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A role that belongs to a project.
|
|
16
|
+
*/
|
|
17
|
+
export interface RoleResource {
|
|
18
|
+
kind: 'Role';
|
|
19
|
+
metadata: ProjectMetadata;
|
|
20
|
+
spec: RoleSpec;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A global role that doesn´t belong to a project.
|
|
24
|
+
*/
|
|
25
|
+
export interface GlobalRoleResource {
|
|
26
|
+
kind: 'GlobalRole';
|
|
27
|
+
metadata: Metadata;
|
|
28
|
+
spec: RoleSpec;
|
|
29
|
+
}
|
|
30
|
+
export type Role = RoleResource | GlobalRoleResource;
|
|
31
|
+
//# sourceMappingURL=role.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../src/model/role.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,CAAC;AACnE,eAAO,MAAM,OAAO,UAA8C,CAAC;AACnE,MAAM,MAAM,KAAK,GAAG,IAAI,GAAG,GAAG,CAAC;AAC/B,eAAO,MAAM,cAAc,UAW1B,CAAC;AAEF,eAAO,MAAM,aAAa,UAOzB,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,MAAM,IAAI,GAAG,YAAY,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 const ACTIONS = [
|
|
14
|
+
'*',
|
|
15
|
+
'create',
|
|
16
|
+
'read',
|
|
17
|
+
'update',
|
|
18
|
+
'delete'
|
|
19
|
+
];
|
|
20
|
+
export const PROJECT_SCOPES = [
|
|
21
|
+
'*',
|
|
22
|
+
'Dashboard',
|
|
23
|
+
'Datasource',
|
|
24
|
+
'EphemeralDashboard',
|
|
25
|
+
'Folder',
|
|
26
|
+
'Project',
|
|
27
|
+
'Role',
|
|
28
|
+
'RoleBinding',
|
|
29
|
+
'Secret',
|
|
30
|
+
'Variable'
|
|
31
|
+
];
|
|
32
|
+
export const GLOBAL_SCOPES = [
|
|
33
|
+
'GlobalDatasource',
|
|
34
|
+
'GlobalRole',
|
|
35
|
+
'GlobalRoleBinding',
|
|
36
|
+
'GlobalSecret',
|
|
37
|
+
'GlobalVariable',
|
|
38
|
+
'User'
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/role.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 { Kind, Metadata, ProjectMetadata } from '@perses-dev/client';\n\nexport type Action = 'create' | 'read' | 'update' | 'delete' | '*';\nexport const ACTIONS = ['*', 'create', 'read', 'update', 'delete'];\nexport type Scope = Kind | '*';\nexport const PROJECT_SCOPES = [\n '*',\n 'Dashboard',\n 'Datasource',\n 'EphemeralDashboard',\n 'Folder',\n 'Project',\n 'Role',\n 'RoleBinding',\n 'Secret',\n 'Variable',\n];\n\nexport const GLOBAL_SCOPES = [\n 'GlobalDatasource',\n 'GlobalRole',\n 'GlobalRoleBinding',\n 'GlobalSecret',\n 'GlobalVariable',\n 'User',\n];\n\nexport interface Permission {\n actions: Action[];\n scopes: Scope[];\n}\n\nexport interface RoleSpec {\n permissions: Permission[];\n}\n\n/**\n * A role that belongs to a project.\n */\nexport interface RoleResource {\n kind: 'Role';\n metadata: ProjectMetadata;\n spec: RoleSpec;\n}\n\n/**\n * A global role that doesn´t belong to a project.\n */\nexport interface GlobalRoleResource {\n kind: 'GlobalRole';\n metadata: Metadata;\n spec: RoleSpec;\n}\n\nexport type Role = RoleResource | GlobalRoleResource;\n"],"names":["ACTIONS","PROJECT_SCOPES","GLOBAL_SCOPES"],"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,OAAO,MAAMA,UAAU;IAAC;IAAK;IAAU;IAAQ;IAAU;CAAS,CAAC;AAEnE,OAAO,MAAMC,iBAAiB;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAC;AAEF,OAAO,MAAMC,gBAAgB;IAC3B;IACA;IACA;IACA;IACA;IACA;CACD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Metadata, ProjectMetadata } from './resource';
|
|
2
|
+
export interface Subject {
|
|
3
|
+
kind: 'User';
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RoleBindingSpec {
|
|
7
|
+
role: string;
|
|
8
|
+
subjects: Subject[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A role binding that belongs to a project.
|
|
12
|
+
*/
|
|
13
|
+
export interface RoleBindingResource {
|
|
14
|
+
kind: 'RoleBinding';
|
|
15
|
+
metadata: ProjectMetadata;
|
|
16
|
+
spec: RoleBindingSpec;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A global role binding that doesn´t belong to a project.
|
|
20
|
+
*/
|
|
21
|
+
export interface GlobalRoleBindingResource {
|
|
22
|
+
kind: 'GlobalRoleBinding';
|
|
23
|
+
metadata: Metadata;
|
|
24
|
+
spec: RoleBindingSpec;
|
|
25
|
+
}
|
|
26
|
+
export type RoleBinding = RoleBindingResource | GlobalRoleBindingResource;
|
|
27
|
+
//# sourceMappingURL=roleBindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roleBindings.d.ts","sourceRoot":"","sources":["../../src/model/roleBindings.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAE9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,yBAAyB,CAAC"}
|
|
@@ -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=roleBindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/roleBindings.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 { Metadata, ProjectMetadata } from './resource';\n\nexport interface Subject {\n kind: 'User';\n name: string;\n}\n\nexport interface RoleBindingSpec {\n // name of the role or global role (metadata.name)\n role: string;\n subjects: Subject[];\n}\n\n/**\n * A role binding that belongs to a project.\n */\nexport interface RoleBindingResource {\n kind: 'RoleBinding';\n metadata: ProjectMetadata;\n spec: RoleBindingSpec;\n}\n\n/**\n * A global role binding that doesn´t belong to a project.\n */\nexport interface GlobalRoleBindingResource {\n kind: 'GlobalRoleBinding';\n metadata: Metadata;\n spec: RoleBindingSpec;\n}\n\nexport type RoleBinding = RoleBindingResource | GlobalRoleBindingResource;\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;AAiCjC,WAA0E"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Metadata, ProjectMetadata } from '@perses-dev/client';
|
|
2
|
+
export interface BasicAuth {
|
|
3
|
+
username: string;
|
|
4
|
+
password?: string;
|
|
5
|
+
passwordFile?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Authorization {
|
|
8
|
+
type?: string;
|
|
9
|
+
credentials?: string;
|
|
10
|
+
credentialsFile?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface OAuth {
|
|
13
|
+
clientID: string;
|
|
14
|
+
clientSecret?: string;
|
|
15
|
+
clientSecretFile?: string;
|
|
16
|
+
tokenURL: string;
|
|
17
|
+
scopes?: string[];
|
|
18
|
+
endpointParams?: Record<string, string[]>;
|
|
19
|
+
authStyle?: 0 | 1 | 2;
|
|
20
|
+
}
|
|
21
|
+
export interface TLSConfig {
|
|
22
|
+
ca?: string;
|
|
23
|
+
cert?: string;
|
|
24
|
+
key?: string;
|
|
25
|
+
caFile?: string;
|
|
26
|
+
certFile?: string;
|
|
27
|
+
keyFile?: string;
|
|
28
|
+
serverName?: string;
|
|
29
|
+
insecureSkipVerify?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface SecretSpec {
|
|
32
|
+
basicAuth?: BasicAuth;
|
|
33
|
+
authorization?: Authorization;
|
|
34
|
+
oauth?: OAuth;
|
|
35
|
+
tlsConfig?: TLSConfig;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A secret that belongs to a project.
|
|
39
|
+
*/
|
|
40
|
+
export interface SecretResource {
|
|
41
|
+
kind: 'Secret';
|
|
42
|
+
metadata: ProjectMetadata;
|
|
43
|
+
spec: SecretSpec;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A global secret that doesn´t belong to a project.
|
|
47
|
+
*/
|
|
48
|
+
export interface GlobalSecretResource {
|
|
49
|
+
kind: 'GlobalSecret';
|
|
50
|
+
metadata: Metadata;
|
|
51
|
+
spec: SecretSpec;
|
|
52
|
+
}
|
|
53
|
+
export type Secret = SecretResource | GlobalSecretResource;
|
|
54
|
+
//# sourceMappingURL=secret.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../../src/model/secret.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ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AAE,eAAe,CAAC;IAC1B,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,MAAM,MAAM,GAAG,cAAc,GAAG,oBAAoB,CAAC"}
|
|
@@ -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=secret.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/secret.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 { Metadata, ProjectMetadata } from '@perses-dev/client';\n\nexport interface BasicAuth {\n username: string;\n password?: string;\n passwordFile?: string;\n}\n\nexport interface Authorization {\n type?: string;\n credentials?: string;\n credentialsFile?: string;\n}\n\nexport interface OAuth {\n clientID: string;\n clientSecret?: string;\n clientSecretFile?: string;\n tokenURL: string;\n scopes?: string[];\n endpointParams?: Record<string, string[]>;\n authStyle?: 0 | 1 | 2;\n}\n\nexport interface TLSConfig {\n ca?: string;\n cert?: string;\n key?: string;\n caFile?: string;\n certFile?: string;\n keyFile?: string;\n serverName?: string;\n insecureSkipVerify?: boolean;\n}\n\nexport interface SecretSpec {\n basicAuth?: BasicAuth;\n authorization?: Authorization;\n oauth?: OAuth;\n tlsConfig?: TLSConfig;\n}\n\n/**\n * A secret that belongs to a project.\n */\nexport interface SecretResource {\n kind: 'Secret';\n metadata: ProjectMetadata;\n spec: SecretSpec;\n}\n\n/**\n * A global secret that doesn´t belong to a project.\n */\nexport interface GlobalSecretResource {\n kind: 'GlobalSecret';\n metadata: Metadata;\n spec: SecretSpec;\n}\n\nexport type Secret = SecretResource | GlobalSecretResource;\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;AA8DjC,WAA2D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Metadata } from './resource';
|
|
2
|
+
export interface NativeProvider {
|
|
3
|
+
password?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface OAuthProvider {
|
|
6
|
+
issuer?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
subject?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface UserSpec {
|
|
11
|
+
firstName?: string;
|
|
12
|
+
lastName?: string;
|
|
13
|
+
nativeProvider?: NativeProvider;
|
|
14
|
+
oauthProviders?: OAuthProvider[];
|
|
15
|
+
}
|
|
16
|
+
export interface UserResource {
|
|
17
|
+
kind: 'User';
|
|
18
|
+
metadata: Metadata;
|
|
19
|
+
spec: UserSpec;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/model/user.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;CAChB"}
|
|
@@ -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=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/user.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 { Metadata } from './resource';\n\nexport interface NativeProvider {\n password?: string;\n}\n\nexport interface OAuthProvider {\n issuer?: string;\n email?: string;\n subject?: string;\n}\n\nexport interface UserSpec {\n firstName?: string;\n lastName?: string;\n nativeProvider?: NativeProvider;\n oauthProviders?: OAuthProvider[];\n}\n\nexport interface UserResource {\n kind: 'User';\n metadata: Metadata;\n spec: UserSpec;\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;AAqBjC,WAIC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Metadata, ProjectMetadata } from '@perses-dev/client';
|
|
2
|
+
import { Definition, Display, UnknownSpec } from '@perses-dev/spec';
|
|
3
|
+
export type VariableNameType = string;
|
|
4
|
+
export type VariableValue = string | string[] | null;
|
|
5
|
+
export interface VariableDisplay extends Display {
|
|
6
|
+
hidden?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface VariableSpec {
|
|
9
|
+
name: VariableNameType;
|
|
10
|
+
display?: VariableDisplay;
|
|
11
|
+
}
|
|
12
|
+
export interface TextVariableDefinition extends Definition<TextVariableSpec> {
|
|
13
|
+
kind: 'TextVariable';
|
|
14
|
+
}
|
|
15
|
+
export interface TextVariableSpec extends VariableSpec {
|
|
16
|
+
value: string;
|
|
17
|
+
constant?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ListVariableDefinition extends Definition<ListVariableSpec> {
|
|
20
|
+
kind: 'ListVariable';
|
|
21
|
+
}
|
|
22
|
+
export interface ListVariableSpec<PluginSpec = UnknownSpec> extends VariableSpec {
|
|
23
|
+
defaultValue?: VariableValue;
|
|
24
|
+
allowMultiple: boolean;
|
|
25
|
+
allowAllValue: boolean;
|
|
26
|
+
customAllValue?: string;
|
|
27
|
+
capturingRegexp?: string;
|
|
28
|
+
sort?: string;
|
|
29
|
+
plugin: Definition<PluginSpec>;
|
|
30
|
+
}
|
|
31
|
+
export interface BuiltinVariableDefinition extends Definition<BuiltinVariableSpec> {
|
|
32
|
+
kind: 'BuiltinVariable';
|
|
33
|
+
}
|
|
34
|
+
export interface BuiltinVariableSpec extends VariableSpec {
|
|
35
|
+
value: () => string;
|
|
36
|
+
source: string;
|
|
37
|
+
}
|
|
38
|
+
export type VariableDefinition = TextVariableDefinition | ListVariableDefinition;
|
|
39
|
+
/**
|
|
40
|
+
* A variable that belongs to a project.
|
|
41
|
+
*/
|
|
42
|
+
export interface VariableResource {
|
|
43
|
+
kind: 'Variable';
|
|
44
|
+
metadata: ProjectMetadata;
|
|
45
|
+
spec: VariableDefinition;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A global variable that doesn´t belong to a project.
|
|
49
|
+
*/
|
|
50
|
+
export interface GlobalVariableResource {
|
|
51
|
+
kind: 'GlobalVariable';
|
|
52
|
+
metadata: Metadata;
|
|
53
|
+
spec: VariableDefinition;
|
|
54
|
+
}
|
|
55
|
+
export type VariableType = VariableResource | GlobalVariableResource;
|
|
56
|
+
export declare function getVariableProject(variable: VariableType): string | undefined;
|
|
57
|
+
export declare const DEFAULT_ALL_VALUE: "$__all";
|
|
58
|
+
//# sourceMappingURL=variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["../../src/model/variable.ts"],"names":[],"mappings":"AAa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M,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,sBAAsB,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,sBAAsB,CAAC;AAErE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAE7E;AAED,eAAO,MAAM,iBAAiB,UAAoB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 function getVariableProject(variable) {
|
|
14
|
+
return 'project' in variable.metadata ? variable.metadata.project : undefined;
|
|
15
|
+
}
|
|
16
|
+
export const DEFAULT_ALL_VALUE = '$__all';
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/variable.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 { Metadata, ProjectMetadata } from '@perses-dev/client';\nimport { Definition, Display, UnknownSpec } from '@perses-dev/spec';\n\nexport type VariableNameType = string;\n\nexport type VariableValue = string | string[] | null;\n\nexport interface VariableDisplay extends Display {\n hidden?: boolean;\n}\n\nexport interface VariableSpec {\n name: VariableNameType;\n display?: VariableDisplay;\n}\n\nexport interface TextVariableDefinition extends Definition<TextVariableSpec> {\n kind: 'TextVariable';\n}\n\nexport interface TextVariableSpec extends VariableSpec {\n value: string;\n constant?: boolean;\n}\n\nexport interface ListVariableDefinition extends Definition<ListVariableSpec> {\n kind: 'ListVariable';\n}\n\nexport interface ListVariableSpec<PluginSpec = UnknownSpec> extends VariableSpec {\n defaultValue?: VariableValue;\n allowMultiple: boolean;\n allowAllValue: boolean;\n customAllValue?: string;\n capturingRegexp?: string;\n sort?: string;\n plugin: Definition<PluginSpec>;\n}\n\nexport interface BuiltinVariableDefinition extends Definition<BuiltinVariableSpec> {\n kind: 'BuiltinVariable';\n}\n\nexport interface BuiltinVariableSpec extends VariableSpec {\n value: () => string;\n source: string;\n}\n\nexport type VariableDefinition = TextVariableDefinition | ListVariableDefinition;\n\n/**\n * A variable that belongs to a project.\n */\nexport interface VariableResource {\n kind: 'Variable';\n metadata: ProjectMetadata;\n spec: VariableDefinition;\n}\n\n/**\n * A global variable that doesn´t belong to a project.\n */\nexport interface GlobalVariableResource {\n kind: 'GlobalVariable';\n metadata: Metadata;\n spec: VariableDefinition;\n}\n\nexport type VariableType = VariableResource | GlobalVariableResource;\n\nexport function getVariableProject(variable: VariableType): string | undefined {\n return 'project' in variable.metadata ? variable.metadata.project : undefined;\n}\n\nexport const DEFAULT_ALL_VALUE = '$__all' as const;\n"],"names":["getVariableProject","variable","metadata","project","undefined","DEFAULT_ALL_VALUE"],"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;AAwEjC,OAAO,SAASA,mBAAmBC,QAAsB;IACvD,OAAO,aAAaA,SAASC,QAAQ,GAAGD,SAASC,QAAQ,CAACC,OAAO,GAAGC;AACtE;AAEA,OAAO,MAAMC,oBAAoB,SAAkB"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
package/dist/schema/index.js
CHANGED
package/dist/schema/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/index.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\nexport * from './datasource';\nexport * from './metadata';\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,cAAc,eAAe;AAC7B,cAAc,aAAa"}
|
|
1
|
+
{"version":3,"sources":["../../src/schema/index.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\nexport * from './datasource';\nexport * from './metadata';\nexport * from './user';\nexport * from './secret';\nexport * from './role';\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,cAAc,eAAe;AAC7B,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,SAAS"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Permission, Role, RoleSpec } from '../model';
|
|
3
|
+
export declare const permissionSchema: z.ZodSchema<Permission>;
|
|
4
|
+
export declare const roleSpecSchema: z.ZodSchema<RoleSpec>;
|
|
5
|
+
export declare const roleSchema: z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"Role">;
|
|
7
|
+
metadata: z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
} & {
|
|
10
|
+
project: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
project: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}, {
|
|
15
|
+
project: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}>;
|
|
18
|
+
spec: z.ZodType<RoleSpec, z.ZodTypeDef, RoleSpec>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
kind: "Role";
|
|
21
|
+
metadata: {
|
|
22
|
+
project: string;
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
spec: RoleSpec;
|
|
26
|
+
}, {
|
|
27
|
+
kind: "Role";
|
|
28
|
+
metadata: {
|
|
29
|
+
project: string;
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
spec: RoleSpec;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const globalRoleSchema: z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"GlobalRole">;
|
|
36
|
+
metadata: z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
name: string;
|
|
40
|
+
}, {
|
|
41
|
+
name: string;
|
|
42
|
+
}>;
|
|
43
|
+
spec: z.ZodType<RoleSpec, z.ZodTypeDef, RoleSpec>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
kind: "GlobalRole";
|
|
46
|
+
metadata: {
|
|
47
|
+
name: string;
|
|
48
|
+
};
|
|
49
|
+
spec: RoleSpec;
|
|
50
|
+
}, {
|
|
51
|
+
kind: "GlobalRole";
|
|
52
|
+
metadata: {
|
|
53
|
+
name: string;
|
|
54
|
+
};
|
|
55
|
+
spec: RoleSpec;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const rolesEditorSchema: z.ZodSchema<Role>;
|
|
58
|
+
//# sourceMappingURL=role.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../src/schema/role.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGtD,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,CAyBnD,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAE/C,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAgE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
import { z } from 'zod';
|
|
14
|
+
import { metadataSchema, projectMetadataSchema } from './metadata';
|
|
15
|
+
export const permissionSchema = z.object({
|
|
16
|
+
// TODO: use SCOPE & ACTIONS constants
|
|
17
|
+
actions: z.array(z.enum([
|
|
18
|
+
'*',
|
|
19
|
+
'create',
|
|
20
|
+
'read',
|
|
21
|
+
'update',
|
|
22
|
+
'delete'
|
|
23
|
+
])).nonempty('Must contains at least 1 action'),
|
|
24
|
+
scopes: z.array(z.enum([
|
|
25
|
+
'*',
|
|
26
|
+
'Dashboard',
|
|
27
|
+
'Datasource',
|
|
28
|
+
'EphemeralDashboard',
|
|
29
|
+
'Folder',
|
|
30
|
+
'GlobalDatasource',
|
|
31
|
+
'GlobalRole',
|
|
32
|
+
'GlobalRoleBinding',
|
|
33
|
+
'GlobalSecret',
|
|
34
|
+
'GlobalVariable',
|
|
35
|
+
'Project',
|
|
36
|
+
'Role',
|
|
37
|
+
'RoleBinding',
|
|
38
|
+
'Secret',
|
|
39
|
+
'User',
|
|
40
|
+
'Variable'
|
|
41
|
+
])).nonempty('Must contains at least 1 scope')
|
|
42
|
+
});
|
|
43
|
+
export const roleSpecSchema = z.object({
|
|
44
|
+
permissions: z.array(permissionSchema)
|
|
45
|
+
});
|
|
46
|
+
export const roleSchema = z.object({
|
|
47
|
+
kind: z.literal('Role'),
|
|
48
|
+
metadata: projectMetadataSchema,
|
|
49
|
+
spec: roleSpecSchema
|
|
50
|
+
});
|
|
51
|
+
export const globalRoleSchema = z.object({
|
|
52
|
+
kind: z.literal('GlobalRole'),
|
|
53
|
+
metadata: metadataSchema,
|
|
54
|
+
spec: roleSpecSchema
|
|
55
|
+
});
|
|
56
|
+
export const rolesEditorSchema = z.discriminatedUnion('kind', [
|
|
57
|
+
roleSchema,
|
|
58
|
+
globalRoleSchema
|
|
59
|
+
]);
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schema/role.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 { z } from 'zod';\nimport { Permission, Role, RoleSpec } from '../model';\nimport { metadataSchema, projectMetadataSchema } from './metadata';\n\nexport const permissionSchema: z.ZodSchema<Permission> = z.object({\n // TODO: use SCOPE & ACTIONS constants\n actions: z.array(z.enum(['*', 'create', 'read', 'update', 'delete'])).nonempty('Must contains at least 1 action'),\n scopes: z\n .array(\n z.enum([\n '*',\n 'Dashboard',\n 'Datasource',\n 'EphemeralDashboard',\n 'Folder',\n 'GlobalDatasource',\n 'GlobalRole',\n 'GlobalRoleBinding',\n 'GlobalSecret',\n 'GlobalVariable',\n 'Project',\n 'Role',\n 'RoleBinding',\n 'Secret',\n 'User',\n 'Variable',\n ])\n )\n .nonempty('Must contains at least 1 scope'), // TODO: limit project role\n});\n\nexport const roleSpecSchema: z.ZodSchema<RoleSpec> = z.object({\n permissions: z.array(permissionSchema),\n});\n\nexport const roleSchema = z.object({\n kind: z.literal('Role'),\n metadata: projectMetadataSchema,\n spec: roleSpecSchema,\n});\n\nexport const globalRoleSchema = z.object({\n kind: z.literal('GlobalRole'),\n metadata: metadataSchema,\n spec: roleSpecSchema,\n});\n\nexport const rolesEditorSchema: z.ZodSchema<Role> = z.discriminatedUnion('kind', [roleSchema, globalRoleSchema]);\n"],"names":["z","metadataSchema","projectMetadataSchema","permissionSchema","object","actions","array","enum","nonempty","scopes","roleSpecSchema","permissions","roleSchema","kind","literal","metadata","spec","globalRoleSchema","rolesEditorSchema","discriminatedUnion"],"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,SAASA,CAAC,QAAQ,MAAM;AAExB,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,aAAa;AAEnE,OAAO,MAAMC,mBAA4CH,EAAEI,MAAM,CAAC;IAChE,sCAAsC;IACtCC,SAASL,EAAEM,KAAK,CAACN,EAAEO,IAAI,CAAC;QAAC;QAAK;QAAU;QAAQ;QAAU;KAAS,GAAGC,QAAQ,CAAC;IAC/EC,QAAQT,EACLM,KAAK,CACJN,EAAEO,IAAI,CAAC;QACL;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD,GAEFC,QAAQ,CAAC;AACd,GAAG;AAEH,OAAO,MAAME,iBAAwCV,EAAEI,MAAM,CAAC;IAC5DO,aAAaX,EAAEM,KAAK,CAACH;AACvB,GAAG;AAEH,OAAO,MAAMS,aAAaZ,EAAEI,MAAM,CAAC;IACjCS,MAAMb,EAAEc,OAAO,CAAC;IAChBC,UAAUb;IACVc,MAAMN;AACR,GAAG;AAEH,OAAO,MAAMO,mBAAmBjB,EAAEI,MAAM,CAAC;IACvCS,MAAMb,EAAEc,OAAO,CAAC;IAChBC,UAAUd;IACVe,MAAMN;AACR,GAAG;AAEH,OAAO,MAAMQ,oBAAuClB,EAAEmB,kBAAkB,CAAC,QAAQ;IAACP;IAAYK;CAAiB,EAAE"}
|