@perses-dev/client 0.54.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/cjs/index.js +32 -0
- package/dist/cjs/model/datasource-api.js +16 -0
- package/dist/cjs/model/datasource.js +16 -0
- package/dist/cjs/model/http-proxy.js +16 -0
- package/dist/cjs/model/http.js +16 -0
- package/dist/cjs/model/index.js +35 -0
- package/dist/cjs/model/kind.js +39 -0
- package/dist/cjs/model/resource.js +36 -0
- package/dist/cjs/schema/datasource.js +66 -0
- package/dist/cjs/schema/index.js +31 -0
- package/dist/cjs/schema/metadata.js +41 -0
- package/dist/cjs/test/index.js +30 -0
- package/dist/cjs/test/render.js +38 -0
- package/dist/cjs/test/setup-tests.js +18 -0
- package/dist/cjs/util/fetch.js +82 -0
- package/dist/cjs/util/index.js +30 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/model/datasource-api.d.ts +41 -0
- package/dist/model/datasource-api.d.ts.map +1 -0
- package/dist/model/datasource-api.js +19 -0
- package/dist/model/datasource-api.js.map +1 -0
- package/dist/model/datasource.d.ts +28 -0
- package/dist/model/datasource.d.ts.map +1 -0
- package/dist/model/datasource.js +15 -0
- package/dist/model/datasource.js.map +1 -0
- package/dist/model/http-proxy.d.ts +16 -0
- package/dist/model/http-proxy.d.ts.map +1 -0
- package/dist/model/http-proxy.js +15 -0
- package/dist/model/http-proxy.js.map +1 -0
- package/dist/model/http.d.ts +7 -0
- package/dist/model/http.d.ts.map +1 -0
- package/dist/model/http.js +15 -0
- package/dist/model/http.js.map +1 -0
- package/dist/model/index.d.ts +7 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +20 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/kind.d.ts +3 -0
- package/dist/model/kind.d.ts.map +1 -0
- package/dist/model/kind.js +31 -0
- package/dist/model/kind.js.map +1 -0
- package/dist/model/resource.d.ts +19 -0
- package/dist/model/resource.d.ts.map +1 -0
- package/dist/model/resource.js +20 -0
- package/dist/model/resource.js.map +1 -0
- package/dist/schema/datasource.d.ts +59 -0
- package/dist/schema/datasource.d.ts.map +1 -0
- package/dist/schema/datasource.js +41 -0
- package/dist/schema/datasource.js.map +1 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +16 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/metadata.d.ts +21 -0
- package/dist/schema/metadata.d.ts.map +1 -0
- package/dist/schema/metadata.js +22 -0
- package/dist/schema/metadata.js.map +1 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +15 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/render.d.ts +7 -0
- package/dist/test/render.d.ts.map +1 -0
- package/dist/test/render.js +32 -0
- package/dist/test/render.js.map +1 -0
- package/dist/test/setup-tests.d.ts +2 -0
- package/dist/test/setup-tests.d.ts.map +1 -0
- package/dist/test/setup-tests.js +16 -0
- package/dist/test/setup-tests.js.map +1 -0
- package/dist/util/fetch.d.ts +28 -0
- package/dist/util/fetch.d.ts.map +1 -0
- package/dist/util/fetch.js +68 -0
- package/dist/util/fetch.js.map +1 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +15 -0
- package/dist/util/index.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/datasource-api.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 { DatasourceResource, DatasourceSelector, GlobalDatasourceResource } from './datasource';\n\n/**\n * Parameters for building a datasource proxy URL\n */\nexport interface BuildDatasourceProxyUrlParams {\n project?: string;\n dashboard?: string;\n name: string;\n}\n\n/**\n * Function type for building datasource proxy URLs\n */\nexport type BuildDatasourceProxyUrlFunc = (params: BuildDatasourceProxyUrlParams) => string;\n\n/**\n * The external API contract for fetching datasource resources.\n * This defines the interface that must be implemented to provide\n * datasource functionality to the dashboard.\n */\nexport interface DatasourceApi {\n /**\n * Optional function to build proxy URLs for datasources\n */\n buildProxyUrl?: BuildDatasourceProxyUrlFunc;\n /**\n * Get a datasource resource for a specific project\n */\n getDatasource: (project: string, selector: DatasourceSelector) => Promise<DatasourceResource | undefined>;\n /**\n * Get a global datasource resource\n */\n getGlobalDatasource: (selector: DatasourceSelector) => Promise<GlobalDatasourceResource | undefined>;\n /**\n * List all datasources for a project, optionally filtered by plugin kind\n */\n listDatasources: (project: string, pluginKind?: string) => Promise<DatasourceResource[]>;\n /**\n * List all global datasources, optionally filtered by plugin kind\n */\n listGlobalDatasources: (pluginKind?: string) => Promise<GlobalDatasourceResource[]>;\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;AAkBjC;;;;CAIC,GACD,WAqBC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DatasourceSpec, DatasourceSelector } from '@perses-dev/spec';
|
|
2
|
+
import { Metadata, ProjectMetadata } from './resource';
|
|
3
|
+
export type { DatasourceSelector, DatasourceSpec };
|
|
4
|
+
/**
|
|
5
|
+
* A Datasource that's available across all projects.
|
|
6
|
+
*/
|
|
7
|
+
export interface GlobalDatasourceResource {
|
|
8
|
+
kind: 'GlobalDatasource';
|
|
9
|
+
metadata: Metadata;
|
|
10
|
+
spec: DatasourceSpec;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A Datasource resource, that belongs to a project.
|
|
14
|
+
*/
|
|
15
|
+
export interface DatasourceResource {
|
|
16
|
+
kind: 'Datasource';
|
|
17
|
+
metadata: ProjectMetadata;
|
|
18
|
+
spec: DatasourceSpec;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* An intermediary type to regroup the name and the spec of a datasource.
|
|
22
|
+
*/
|
|
23
|
+
export interface DatasourceDefinition {
|
|
24
|
+
name: string;
|
|
25
|
+
spec: DatasourceSpec;
|
|
26
|
+
}
|
|
27
|
+
export type Datasource = DatasourceResource | GlobalDatasourceResource;
|
|
28
|
+
//# sourceMappingURL=datasource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/model/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,cAAc,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,MAAM,UAAU,GAAG,kBAAkB,GAAG,wBAAwB,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=datasource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/datasource.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 { DatasourceSpec, DatasourceSelector } from '@perses-dev/spec';\nimport { Metadata, ProjectMetadata } from './resource';\nexport type { DatasourceSelector, DatasourceSpec };\n\n/**\n * A Datasource that's available across all projects.\n */\nexport interface GlobalDatasourceResource {\n kind: 'GlobalDatasource';\n metadata: Metadata;\n spec: DatasourceSpec;\n}\n\n/**\n * A Datasource resource, that belongs to a project.\n */\nexport interface DatasourceResource {\n kind: 'Datasource';\n metadata: ProjectMetadata;\n spec: DatasourceSpec;\n}\n\n/**\n * An intermediary type to regroup the name and the spec of a datasource.\n */\nexport interface DatasourceDefinition {\n name: string;\n spec: DatasourceSpec;\n}\n\nexport type Datasource = DatasourceResource | GlobalDatasourceResource;\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;AAgCjC,WAAuE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RequestHeaders } from './http';
|
|
2
|
+
export interface HTTPProxy {
|
|
3
|
+
kind: 'HTTPProxy';
|
|
4
|
+
spec: HTTPProxySpec;
|
|
5
|
+
}
|
|
6
|
+
export interface HTTPProxySpec {
|
|
7
|
+
url: string;
|
|
8
|
+
allowedEndpoints?: HTTPAllowedEndpoint[];
|
|
9
|
+
headers?: RequestHeaders;
|
|
10
|
+
secret?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface HTTPAllowedEndpoint {
|
|
13
|
+
endpointPattern: string;
|
|
14
|
+
method: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=http-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-proxy.d.ts","sourceRoot":"","sources":["../../src/model/http-proxy.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC;CACrB;AACD,MAAM,WAAW,aAAa;IAG5B,GAAG,EAAE,MAAM,CAAC;IAGZ,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC,OAAO,CAAC,EAAE,cAAc,CAAC;IAGzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,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=http-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/http-proxy.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 { RequestHeaders } from './http';\n\nexport interface HTTPProxy {\n kind: 'HTTPProxy';\n spec: HTTPProxySpec;\n}\nexport interface HTTPProxySpec {\n // url is the url of the datasource. It is not the url of the proxy.\n // The Perses server is the proxy, so it needs to know where to redirect the request.\n url: string;\n // allowedEndpoints is a list of tuples of http methods and http endpoints that will be accessible.\n // Leave it empty if you don't want to restrict the access to the datasource.\n allowedEndpoints?: HTTPAllowedEndpoint[];\n // headers can be used to provide additional headers that need to be forwarded when requesting the datasource\n headers?: RequestHeaders;\n // secret is the name of the secret that should be used for the proxy or discovery configuration\n // It will contain any sensitive information such as password, token, certificate.\n secret?: string;\n}\n\nexport interface HTTPAllowedEndpoint {\n endpointPattern: string;\n method: string;\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;AAsBjC,WAGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/model/http.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
|
|
@@ -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=http.js.map
|
|
@@ -0,0 +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 './http-proxy';\n\nexport type RequestHeaders = Record<string, string>;\n\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;AAMjC,WAGC"}
|
|
@@ -0,0 +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;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 * from './datasource';
|
|
14
|
+
export * from './http';
|
|
15
|
+
export * from './http-proxy';
|
|
16
|
+
export * from './kind';
|
|
17
|
+
export * from './resource';
|
|
18
|
+
export * from './datasource-api';
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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 './http';\nexport * from './http-proxy';\nexport * from './kind';\nexport * from './resource';\nexport * from './datasource-api';\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,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,mBAAmB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type Kind = 'Dashboard' | 'Datasource' | 'EphemeralDashboard' | 'Folder' | 'GlobalDatasource' | 'GlobalRole' | 'GlobalRoleBinding' | 'GlobalSecret' | 'GlobalVariable' | 'Project' | 'Role' | 'RoleBinding' | 'Secret' | 'User' | 'Variable';
|
|
2
|
+
export declare const KINDS: Kind[];
|
|
3
|
+
//# sourceMappingURL=kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../src/model/kind.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,IAAI,GACZ,WAAW,GACX,YAAY,GACZ,oBAAoB,GACpB,QAAQ,GACR,kBAAkB,GAClB,YAAY,GACZ,mBAAmB,GACnB,cAAc,GACd,gBAAgB,GAChB,SAAS,GACT,MAAM,GACN,aAAa,GACb,QAAQ,GACR,MAAM,GACN,UAAU,CAAC;AAEf,eAAO,MAAM,KAAK,EAAE,IAAI,EAgBvB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 KINDS = [
|
|
14
|
+
'Dashboard',
|
|
15
|
+
'Datasource',
|
|
16
|
+
'EphemeralDashboard',
|
|
17
|
+
'Folder',
|
|
18
|
+
'GlobalDatasource',
|
|
19
|
+
'GlobalRole',
|
|
20
|
+
'GlobalRoleBinding',
|
|
21
|
+
'GlobalSecret',
|
|
22
|
+
'GlobalVariable',
|
|
23
|
+
'Project',
|
|
24
|
+
'Role',
|
|
25
|
+
'RoleBinding',
|
|
26
|
+
'Secret',
|
|
27
|
+
'User',
|
|
28
|
+
'Variable'
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/kind.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 type Kind =\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\nexport const KINDS: Kind[] = [\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"],"names":["KINDS"],"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,OAAO,MAAMA,QAAgB;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Kind } from './kind';
|
|
2
|
+
export declare function isProjectMetadata(metadata: Metadata | ProjectMetadata): metadata is ProjectMetadata;
|
|
3
|
+
export interface Metadata {
|
|
4
|
+
name: string;
|
|
5
|
+
createdAt?: string;
|
|
6
|
+
updatedAt?: string;
|
|
7
|
+
version?: number;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface ProjectMetadata extends Metadata {
|
|
11
|
+
project: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Resource {
|
|
14
|
+
kind: Kind;
|
|
15
|
+
metadata: Metadata | ProjectMetadata;
|
|
16
|
+
spec?: any;
|
|
17
|
+
}
|
|
18
|
+
export declare function getMetadataProject(metadata: ProjectMetadata | Metadata): string | undefined;
|
|
19
|
+
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/model/resource.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,eAAe,GAAG,QAAQ,IAAI,eAAe,CAEnG;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,QAAQ,GAAG,eAAe,CAAC;IAErC,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAE3F"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 isProjectMetadata(metadata) {
|
|
14
|
+
return 'project' in metadata;
|
|
15
|
+
}
|
|
16
|
+
export function getMetadataProject(metadata) {
|
|
17
|
+
return 'project' in metadata ? metadata.project : undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +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;AAIjC,OAAO,SAASA,kBAAkBC,QAAoC;IACpE,OAAO,aAAaA;AACtB;AAqBA,OAAO,SAASC,mBAAmBD,QAAoC;IACrE,OAAO,aAAaA,WAAWA,SAASE,OAAO,GAAGC;AACpD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PluginSchema } from '@perses-dev/spec';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { Datasource, DatasourceDefinition } from '../model';
|
|
4
|
+
export declare const datasourceSchema: z.ZodObject<{
|
|
5
|
+
kind: z.ZodLiteral<"Datasource">;
|
|
6
|
+
metadata: z.ZodObject<{
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
} & {
|
|
9
|
+
project: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
project: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}, {
|
|
14
|
+
project: string;
|
|
15
|
+
name: string;
|
|
16
|
+
}>;
|
|
17
|
+
spec: z.ZodType<import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>, z.ZodTypeDef, import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
kind: "Datasource";
|
|
20
|
+
metadata: {
|
|
21
|
+
project: string;
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
24
|
+
spec: import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>;
|
|
25
|
+
}, {
|
|
26
|
+
kind: "Datasource";
|
|
27
|
+
metadata: {
|
|
28
|
+
project: string;
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
spec: import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const globalDatasourceSchema: z.ZodObject<{
|
|
34
|
+
kind: z.ZodLiteral<"GlobalDatasource">;
|
|
35
|
+
metadata: z.ZodObject<{
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
name: string;
|
|
39
|
+
}, {
|
|
40
|
+
name: string;
|
|
41
|
+
}>;
|
|
42
|
+
spec: z.ZodType<import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>, z.ZodTypeDef, import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
kind: "GlobalDatasource";
|
|
45
|
+
metadata: {
|
|
46
|
+
name: string;
|
|
47
|
+
};
|
|
48
|
+
spec: import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>;
|
|
49
|
+
}, {
|
|
50
|
+
kind: "GlobalDatasource";
|
|
51
|
+
metadata: {
|
|
52
|
+
name: string;
|
|
53
|
+
};
|
|
54
|
+
spec: import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>;
|
|
55
|
+
}>;
|
|
56
|
+
export declare const datasourcesSchema: z.Schema<Datasource>;
|
|
57
|
+
export declare const datasourceDefinitionSchema: z.Schema<DatasourceDefinition>;
|
|
58
|
+
export declare function buildDatasourceDefinitionSchema(pluginSchema: PluginSchema): z.Schema<DatasourceDefinition>;
|
|
59
|
+
//# sourceMappingURL=datasource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/schema/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,EAAmD,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG5D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;EAIjC,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAGjD,CAAC;AAEH,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAGpE,CAAC;AAEH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAK1G"}
|
|
@@ -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
|
+
import { buildDatasourceSpecSchema, datasourceSpecSchema } from '@perses-dev/spec';
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
import { metadataSchema, projectMetadataSchema } from './metadata';
|
|
16
|
+
export const datasourceSchema = z.object({
|
|
17
|
+
kind: z.literal('Datasource'),
|
|
18
|
+
metadata: projectMetadataSchema,
|
|
19
|
+
spec: datasourceSpecSchema
|
|
20
|
+
});
|
|
21
|
+
export const globalDatasourceSchema = z.object({
|
|
22
|
+
kind: z.literal('GlobalDatasource'),
|
|
23
|
+
metadata: metadataSchema,
|
|
24
|
+
spec: datasourceSpecSchema
|
|
25
|
+
});
|
|
26
|
+
export const datasourcesSchema = z.discriminatedUnion('kind', [
|
|
27
|
+
datasourceSchema,
|
|
28
|
+
globalDatasourceSchema
|
|
29
|
+
]);
|
|
30
|
+
export const datasourceDefinitionSchema = z.object({
|
|
31
|
+
name: z.string().min(1),
|
|
32
|
+
spec: datasourceSpecSchema
|
|
33
|
+
});
|
|
34
|
+
export function buildDatasourceDefinitionSchema(pluginSchema) {
|
|
35
|
+
return z.object({
|
|
36
|
+
name: z.string().min(1),
|
|
37
|
+
spec: buildDatasourceSpecSchema(pluginSchema)
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=datasource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schema/datasource.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 { buildDatasourceSpecSchema, datasourceSpecSchema, PluginSchema } from '@perses-dev/spec';\nimport { z } from 'zod';\nimport { Datasource, DatasourceDefinition } from '../model';\nimport { metadataSchema, projectMetadataSchema } from './metadata';\n\nexport const datasourceSchema = z.object({\n kind: z.literal('Datasource'),\n metadata: projectMetadataSchema,\n spec: datasourceSpecSchema,\n});\n\nexport const globalDatasourceSchema = z.object({\n kind: z.literal('GlobalDatasource'),\n metadata: metadataSchema,\n spec: datasourceSpecSchema,\n});\n\nexport const datasourcesSchema: z.Schema<Datasource> = z.discriminatedUnion('kind', [\n datasourceSchema,\n globalDatasourceSchema,\n]);\n\nexport const datasourceDefinitionSchema: z.Schema<DatasourceDefinition> = z.object({\n name: z.string().min(1),\n spec: datasourceSpecSchema,\n});\n\nexport function buildDatasourceDefinitionSchema(pluginSchema: PluginSchema): z.Schema<DatasourceDefinition> {\n return z.object({\n name: z.string().min(1),\n spec: buildDatasourceSpecSchema(pluginSchema),\n });\n}\n"],"names":["buildDatasourceSpecSchema","datasourceSpecSchema","z","metadataSchema","projectMetadataSchema","datasourceSchema","object","kind","literal","metadata","spec","globalDatasourceSchema","datasourcesSchema","discriminatedUnion","datasourceDefinitionSchema","name","string","min","buildDatasourceDefinitionSchema","pluginSchema"],"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,yBAAyB,EAAEC,oBAAoB,QAAsB,mBAAmB;AACjG,SAASC,CAAC,QAAQ,MAAM;AAExB,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,aAAa;AAEnE,OAAO,MAAMC,mBAAmBH,EAAEI,MAAM,CAAC;IACvCC,MAAML,EAAEM,OAAO,CAAC;IAChBC,UAAUL;IACVM,MAAMT;AACR,GAAG;AAEH,OAAO,MAAMU,yBAAyBT,EAAEI,MAAM,CAAC;IAC7CC,MAAML,EAAEM,OAAO,CAAC;IAChBC,UAAUN;IACVO,MAAMT;AACR,GAAG;AAEH,OAAO,MAAMW,oBAA0CV,EAAEW,kBAAkB,CAAC,QAAQ;IAClFR;IACAM;CACD,EAAE;AAEH,OAAO,MAAMG,6BAA6DZ,EAAEI,MAAM,CAAC;IACjFS,MAAMb,EAAEc,MAAM,GAAGC,GAAG,CAAC;IACrBP,MAAMT;AACR,GAAG;AAEH,OAAO,SAASiB,gCAAgCC,YAA0B;IACxE,OAAOjB,EAAEI,MAAM,CAAC;QACdS,MAAMb,EAAEc,MAAM,GAAGC,GAAG,CAAC;QACrBP,MAAMV,0BAA0BmB;IAClC;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -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
|
+
export * from './datasource';
|
|
14
|
+
export * from './metadata';
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const nameSchema: z.ZodString;
|
|
3
|
+
export declare const metadataSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
name: string;
|
|
7
|
+
}, {
|
|
8
|
+
name: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const projectMetadataSchema: z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
} & {
|
|
13
|
+
project: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
project: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}, {
|
|
18
|
+
project: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/schema/metadata.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,UAAU,aAImF,CAAC;AAE3G,eAAO,MAAM,cAAc;;;;;;EAEzB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;EAEhC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
export const nameSchema = z.string().min(1, 'Required').max(75, 'Must be 75 or fewer characters long').regex(/^[a-zA-Z0-9_.-]+$/, 'Must only contains alphanumerical characters and special characters _ . -');
|
|
15
|
+
export const metadataSchema = z.object({
|
|
16
|
+
name: nameSchema
|
|
17
|
+
});
|
|
18
|
+
export const projectMetadataSchema = metadataSchema.extend({
|
|
19
|
+
project: nameSchema
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schema/metadata.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';\n\nexport const nameSchema = z\n .string()\n .min(1, 'Required')\n .max(75, 'Must be 75 or fewer characters long')\n .regex(/^[a-zA-Z0-9_.-]+$/, 'Must only contains alphanumerical characters and special characters _ . -');\n\nexport const metadataSchema = z.object({\n name: nameSchema,\n});\n\nexport const projectMetadataSchema = metadataSchema.extend({\n project: nameSchema,\n});\n"],"names":["z","nameSchema","string","min","max","regex","metadataSchema","object","name","projectMetadataSchema","extend","project"],"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,OAAO,MAAMC,aAAaD,EACvBE,MAAM,GACNC,GAAG,CAAC,GAAG,YACPC,GAAG,CAAC,IAAI,uCACRC,KAAK,CAAC,qBAAqB,6EAA6E;AAE3G,OAAO,MAAMC,iBAAiBN,EAAEO,MAAM,CAAC;IACrCC,MAAMP;AACR,GAAG;AAEH,OAAO,MAAMQ,wBAAwBH,eAAeI,MAAM,CAAC;IACzDC,SAASV;AACX,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,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 * from './render';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/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 './render';\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,WAAW"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Test helper to render a React component with some common app-level providers wrapped around it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function renderWithContext(ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): RenderResult;
|
|
7
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/test/render.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAU,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrC;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG,YAAY,CAE1G"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { render } from '@testing-library/react';
|
|
15
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
16
|
+
const queryClient = new QueryClient({
|
|
17
|
+
defaultOptions: {
|
|
18
|
+
queries: {
|
|
19
|
+
refetchOnWindowFocus: false
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Test helper to render a React component with some common app-level providers wrapped around it.
|
|
25
|
+
*/ export function renderWithContext(ui, options) {
|
|
26
|
+
return render(/*#__PURE__*/ _jsx(QueryClientProvider, {
|
|
27
|
+
client: queryClient,
|
|
28
|
+
children: ui
|
|
29
|
+
}), options);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/render.tsx"],"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 { render, RenderOptions, RenderResult } from '@testing-library/react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ReactElement } from 'react';\n\nconst queryClient = new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false } } });\n\n/**\n * Test helper to render a React component with some common app-level providers wrapped around it.\n */\nexport function renderWithContext(ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): RenderResult {\n return render(<QueryClientProvider client={queryClient}>{ui}</QueryClientProvider>, options);\n}\n"],"names":["render","QueryClient","QueryClientProvider","queryClient","defaultOptions","queries","refetchOnWindowFocus","renderWithContext","ui","options","client"],"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,MAAM,QAAqC,yBAAyB;AAC7E,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,wBAAwB;AAGzE,MAAMC,cAAc,IAAIF,YAAY;IAAEG,gBAAgB;QAAEC,SAAS;YAAEC,sBAAsB;QAAM;IAAE;AAAE;AAEnG;;CAEC,GACD,OAAO,SAASC,kBAAkBC,EAAgB,EAAEC,OAAwC;IAC1F,OAAOT,qBAAO,KAACE;QAAoBQ,QAAQP;kBAAcK;QAA2BC;AACtF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/test/setup-tests.ts"],"names":[],"mappings":"AAcA,OAAO,yCAAyC,CAAC"}
|
|
@@ -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
|
+
// Add testing library assertions
|
|
14
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=setup-tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/setup-tests.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\n// Add testing library assertions\nimport '@testing-library/jest-dom/extend-expect';\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,iCAAiC;AACjC,OAAO,0CAA0C"}
|