@perses-dev/client 0.55.0-beta.2 → 0.55.0-beta.6
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/context/FetchContext.d.ts +1 -1
- package/dist/context/FetchContext.d.ts.map +1 -1
- package/dist/context/FetchContext.js +3 -3
- package/dist/context/FetchContext.js.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/model/dashboard.d.ts +2 -2
- package/dist/model/dashboard.d.ts.map +1 -1
- package/dist/model/dashboard.js.map +1 -1
- package/dist/model/datasource-api.d.ts +22 -2
- package/dist/model/datasource-api.d.ts.map +1 -1
- package/dist/model/datasource-api.js +58 -4
- package/dist/model/datasource-api.js.map +1 -1
- package/dist/model/datasource.d.ts +2 -2
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/ephemeralDashboard.d.ts +2 -2
- package/dist/model/ephemeralDashboard.d.ts.map +1 -1
- package/dist/model/ephemeralDashboard.js.map +1 -1
- package/dist/model/folder.d.ts +1 -1
- package/dist/model/folder.d.ts.map +1 -1
- package/dist/model/folder.js.map +1 -1
- package/dist/model/index.js +13 -13
- package/dist/model/index.js.map +1 -1
- package/dist/model/resource.d.ts +2 -2
- package/dist/model/resource.d.ts.map +1 -1
- package/dist/model/resource.js.map +1 -1
- package/dist/model/role.d.ts +1 -1
- package/dist/model/role.d.ts.map +1 -1
- package/dist/model/role.js.map +1 -1
- package/dist/model/roleBindings.d.ts +1 -1
- package/dist/model/roleBindings.d.ts.map +1 -1
- package/dist/model/roleBindings.js.map +1 -1
- package/dist/model/secret.d.ts +1 -1
- package/dist/model/secret.d.ts.map +1 -1
- package/dist/model/secret.js.map +1 -1
- package/dist/model/user.d.ts +1 -1
- package/dist/model/user.d.ts.map +1 -1
- package/dist/model/user.js.map +1 -1
- package/dist/model/variable.d.ts +2 -2
- package/dist/model/variable.d.ts.map +1 -1
- package/dist/model/variable.js.map +1 -1
- package/dist/schema/datasource.d.ts +6 -6
- package/dist/schema/datasource.d.ts.map +1 -1
- package/dist/schema/datasource.js +3 -3
- package/dist/schema/datasource.js.map +1 -1
- package/dist/schema/index.js +6 -6
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/metadata.js +1 -1
- package/dist/schema/role.d.ts +5 -5
- package/dist/schema/role.d.ts.map +1 -1
- package/dist/schema/role.js +2 -2
- package/dist/schema/role.js.map +1 -1
- package/dist/schema/rolebinding.d.ts +5 -5
- package/dist/schema/rolebinding.d.ts.map +1 -1
- package/dist/schema/rolebinding.js +2 -2
- package/dist/schema/rolebinding.js.map +1 -1
- package/dist/schema/secret.d.ts +22 -22
- package/dist/schema/secret.d.ts.map +1 -1
- package/dist/schema/secret.js +2 -2
- package/dist/schema/secret.js.map +1 -1
- package/dist/schema/user.d.ts +1 -1
- package/dist/schema/user.d.ts.map +1 -1
- package/dist/schema/user.js +2 -2
- package/dist/schema/user.js.map +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/render.d.ts +2 -2
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +2 -2
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.d.ts +1 -1
- package/dist/test/setup-tests.d.ts.map +1 -1
- package/dist/test/setup-tests.js +2 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/{cjs/model/datasource-api.js → types/globals.d.js} +2 -4
- package/dist/types/globals.d.js.map +1 -0
- package/dist/util/index.js +1 -1
- package/dist/util/index.js.map +1 -1
- package/package.json +9 -9
- package/dist/cjs/context/FetchContext.js +0 -53
- package/dist/cjs/context/index.js +0 -30
- package/dist/cjs/index.js +0 -33
- package/dist/cjs/model/dashboard.js +0 -16
- package/dist/cjs/model/datasource.js +0 -16
- package/dist/cjs/model/ephemeralDashboard.js +0 -16
- package/dist/cjs/model/folder.js +0 -16
- package/dist/cjs/model/http.js +0 -16
- package/dist/cjs/model/index.js +0 -42
- package/dist/cjs/model/kind.js +0 -39
- package/dist/cjs/model/resource.js +0 -36
- package/dist/cjs/model/role.js +0 -60
- package/dist/cjs/model/roleBindings.js +0 -16
- package/dist/cjs/model/secret.js +0 -16
- package/dist/cjs/model/user.js +0 -16
- package/dist/cjs/model/variable.js +0 -34
- package/dist/cjs/schema/datasource.js +0 -66
- package/dist/cjs/schema/index.js +0 -35
- package/dist/cjs/schema/metadata.js +0 -41
- package/dist/cjs/schema/role.js +0 -86
- package/dist/cjs/schema/rolebinding.js +0 -65
- package/dist/cjs/schema/secret.js +0 -211
- package/dist/cjs/schema/user.js +0 -57
- package/dist/cjs/test/index.js +0 -30
- package/dist/cjs/test/render.js +0 -38
- package/dist/cjs/test/setup-tests.js +0 -18
- package/dist/cjs/util/fetch.js +0 -82
- package/dist/cjs/util/index.js +0 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetchContext.d.ts","sourceRoot":"","sources":["../../src/context/FetchContext.tsx"],"names":[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"FetchContext.d.ts","sourceRoot":"","sources":["../../src/context/FetchContext.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrD,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAI1F,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,kBAAkB,GAAG,YAAY,CAErF;AAED,wBAAgB,QAAQ,IAAI;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CAC5E,CAYA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
// Copyright The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,8 +10,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { createContext, useCallback, useContext } from "react";
|
|
15
|
+
import { fetch as defaultFetch } from "../util/fetch.js";
|
|
16
16
|
const FetchContext = /*#__PURE__*/ createContext(defaultFetch);
|
|
17
17
|
export function FetchProvider({ fetchFn, children }) {
|
|
18
18
|
return /*#__PURE__*/ _jsx(FetchContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/FetchContext.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 {
|
|
1
|
+
{"version":3,"sources":["../../src/context/FetchContext.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 type { ReactElement, ReactNode } from 'react';\nimport { createContext, useCallback, useContext } from 'react';\n\nimport { fetch as defaultFetch } from '../util/fetch';\n\nexport type FetchFn = (...args: Parameters<typeof globalThis.fetch>) => Promise<Response>;\n\nconst FetchContext = createContext<FetchFn>(defaultFetch);\n\nexport interface FetchProviderProps {\n fetchFn: FetchFn;\n children: ReactNode;\n}\n\nexport function FetchProvider({ fetchFn, children }: FetchProviderProps): ReactElement {\n return <FetchContext.Provider value={fetchFn}>{children}</FetchContext.Provider>;\n}\n\nexport function useFetch(): {\n fetch: FetchFn;\n fetchJson: <T>(...args: Parameters<typeof globalThis.fetch>) => Promise<T>;\n} {\n const fetch = useContext(FetchContext);\n\n const fetchJson = useCallback(\n async <T,>(...args: Parameters<typeof globalThis.fetch>): Promise<T> => {\n const response = await fetch(...args);\n return await response.json();\n },\n [fetch],\n );\n\n return { fetch, fetchJson };\n}\n"],"names":["createContext","useCallback","useContext","fetch","defaultFetch","FetchContext","FetchProvider","fetchFn","children","Provider","value","useFetch","fetchJson","args","response","json"],"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;;AAGjC,SAASA,aAAa,EAAEC,WAAW,EAAEC,UAAU,QAAQ,QAAQ;AAE/D,SAASC,SAASC,YAAY,QAAQ,mBAAgB;AAItD,MAAMC,6BAAeL,cAAuBI;AAO5C,OAAO,SAASE,cAAc,EAAEC,OAAO,EAAEC,QAAQ,EAAsB;IACrE,qBAAO,KAACH,aAAaI,QAAQ;QAACC,OAAOH;kBAAUC;;AACjD;AAEA,OAAO,SAASG;IAId,MAAMR,QAAQD,WAAWG;IAEzB,MAAMO,YAAYX,YAChB,OAAW,GAAGY;QACZ,MAAMC,WAAW,MAAMX,SAASU;QAChC,OAAO,MAAMC,SAASC,IAAI;IAC5B,GACA;QAACZ;KAAM;IAGT,OAAO;QAAEA;QAAOS;IAAU;AAC5B"}
|
package/dist/context/index.js
CHANGED
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
13
|
+
export * from "./FetchContext.js";
|
|
14
14
|
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/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 './FetchContext';\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,
|
|
1
|
+
{"version":3,"sources":["../../src/context/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 './FetchContext';\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,oBAAiB"}
|
package/dist/index.js
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
13
|
+
export * from "./util/index.js";
|
|
14
|
+
export * from "./model/index.js";
|
|
15
|
+
export * from "./schema/index.js";
|
|
16
|
+
export * from "./context/index.js";
|
|
17
17
|
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/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 './util';\nexport * from './model';\nexport * from './schema';\nexport * from './context';\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,
|
|
1
|
+
{"version":3,"sources":["../src/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 './util';\nexport * from './model';\nexport * from './schema';\nexport * from './context';\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,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,oBAAW;AACzB,cAAc,qBAAY"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProjectMetadata } from '@perses-dev/client';
|
|
2
|
-
import { DashboardSpec } from '@perses-dev/spec';
|
|
1
|
+
import type { ProjectMetadata } from '@perses-dev/client';
|
|
2
|
+
import type { DashboardSpec } from '@perses-dev/spec';
|
|
3
3
|
export type DashboardKind = 'Dashboard' | 'EphemeralDashboard';
|
|
4
4
|
export interface DashboardResource {
|
|
5
5
|
kind: DashboardKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/model/dashboard.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/model/dashboard.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,oBAAoB,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/dashboard.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ProjectMetadata } from '@perses-dev/client';\nimport { DashboardSpec } from '@perses-dev/spec';\n\nexport type DashboardKind = 'Dashboard' | 'EphemeralDashboard';\n\nexport interface DashboardResource {\n kind: DashboardKind;\n spec: DashboardSpec;\n metadata: ProjectMetadata;\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;AAOjC,WAIC"}
|
|
1
|
+
{"version":3,"sources":["../../src/model/dashboard.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 type { ProjectMetadata } from '@perses-dev/client';\nimport type { DashboardSpec } from '@perses-dev/spec';\n\nexport type DashboardKind = 'Dashboard' | 'EphemeralDashboard';\n\nexport interface DashboardResource {\n kind: DashboardKind;\n spec: DashboardSpec;\n metadata: ProjectMetadata;\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;AAOjC,WAIC"}
|
|
@@ -1,16 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DatasourceSpec, HTTPProxy, UnknownSpec } from '@perses-dev/spec';
|
|
2
|
+
import type { DatasourceResource, DatasourceSelector, GlobalDatasourceResource } from './datasource';
|
|
2
3
|
/**
|
|
3
4
|
* Parameters for building a datasource proxy URL
|
|
4
5
|
*/
|
|
5
6
|
export interface BuildDatasourceProxyUrlParams {
|
|
6
7
|
project?: string;
|
|
7
8
|
dashboard?: string;
|
|
8
|
-
|
|
9
|
+
/** Omit to generate an unsaved-datasource proxy URL */
|
|
10
|
+
name?: string;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Function type for building datasource proxy URLs
|
|
12
14
|
*/
|
|
13
15
|
export type BuildDatasourceProxyUrlFunc = (params: BuildDatasourceProxyUrlParams) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Builds a proxy URL for a datasource. When name is omitted the URL targets the
|
|
18
|
+
* unsaved-datasource proxy endpoint (used for testing connectivity before saving).
|
|
19
|
+
* Reads api_prefix from window.PERSES_APP_CONFIG if available.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildProxyUrl({ project, dashboard, name }: BuildDatasourceProxyUrlParams): string;
|
|
22
|
+
export declare function hasHTTPProxy(spec: UnknownSpec): spec is {
|
|
23
|
+
proxy: HTTPProxy;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Creates a function that tests connectivity for an unsaved datasource.
|
|
27
|
+
* Supports directUrl (direct mode) and HTTPProxy (proxy mode).
|
|
28
|
+
* Throws for any spec that does not match either shape.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createTestDatasourceConnection({ project, dashboard }?: {
|
|
31
|
+
project?: string;
|
|
32
|
+
dashboard?: string;
|
|
33
|
+
}): (spec: DatasourceSpec, healthCheckPath: string) => Promise<void>;
|
|
14
34
|
/**
|
|
15
35
|
* The external API contract for fetching datasource resources.
|
|
16
36
|
* This defines the interface that must be implemented to provide
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-api.d.ts","sourceRoot":"","sources":["../../src/model/datasource-api.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"datasource-api.d.ts","sourceRoot":"","sources":["../../src/model/datasource-api.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAErG;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,MAAM,EAAE,6BAA6B,KAAK,MAAM,CAAC;AAE5F;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,6BAA6B,GAAG,MAAM,CAOjG;AAoBD,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,IAAI;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,CAQ5E;AACD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,CACrH,IAAI,EAAE,cAAc,EACpB,eAAe,EAAE,MAAM,KACpB,OAAO,CAAC,IAAI,CAAC,CAsBjB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C;;OAEG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,KAAK,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IAC1G;;OAEG;IACH,mBAAmB,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAAC;IACrG;;OAEG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACzF;;OAEG;IACH,qBAAqB,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;CACrF"}
|
|
@@ -10,10 +10,64 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
+
import { fetch } from "../util/index.js";
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*/ export { }
|
|
15
|
+
* Builds a proxy URL for a datasource. When name is omitted the URL targets the
|
|
16
|
+
* unsaved-datasource proxy endpoint (used for testing connectivity before saving).
|
|
17
|
+
* Reads api_prefix from window.PERSES_APP_CONFIG if available.
|
|
18
|
+
*/ export function buildProxyUrl({ project, dashboard, name }) {
|
|
19
|
+
const apiPrefix = typeof window !== 'undefined' && window.PERSES_APP_CONFIG?.api_prefix || '';
|
|
20
|
+
let url = `${!project && !dashboard ? 'globaldatasources' : 'datasources'}`;
|
|
21
|
+
if (dashboard) url = `dashboards/${encodeURIComponent(dashboard)}/${url}`;
|
|
22
|
+
if (project) url = `projects/${encodeURIComponent(project)}/${url}`;
|
|
23
|
+
url = name === undefined ? `unsaved/${url}` : `${url}/${encodeURIComponent(name)}`;
|
|
24
|
+
return `${apiPrefix}/proxy/${url}`;
|
|
25
|
+
}
|
|
26
|
+
function hasDirectUrl(pluginSpec) {
|
|
27
|
+
return typeof pluginSpec === 'object' && pluginSpec !== null && typeof pluginSpec['directUrl'] === 'string';
|
|
28
|
+
}
|
|
29
|
+
function isRecord(value) {
|
|
30
|
+
return typeof value === 'object' && value !== null;
|
|
31
|
+
}
|
|
32
|
+
export function hasHTTPProxy(spec) {
|
|
33
|
+
return isRecord(spec) && isRecord(spec['proxy']) && spec['proxy']['kind'] === 'HTTPProxy' && isRecord(spec['proxy']['spec']) && typeof spec['proxy']['spec']['url'] === 'string';
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Creates a function that tests connectivity for an unsaved datasource.
|
|
37
|
+
* Supports directUrl (direct mode) and HTTPProxy (proxy mode).
|
|
38
|
+
* Throws for any spec that does not match either shape.
|
|
39
|
+
*/ export function createTestDatasourceConnection({ project, dashboard } = {}) {
|
|
40
|
+
return async (spec, healthCheckPath)=>{
|
|
41
|
+
const normalizedPath = healthCheckPath.startsWith('/') ? healthCheckPath : `/${healthCheckPath}`;
|
|
42
|
+
const pluginSpec = spec.plugin.spec;
|
|
43
|
+
if (hasDirectUrl(pluginSpec)) {
|
|
44
|
+
await fetch(new URL(normalizedPath, pluginSpec.directUrl).toString(), {
|
|
45
|
+
method: 'GET',
|
|
46
|
+
headers: {
|
|
47
|
+
'Content-Type': 'application/json'
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
} else if (hasHTTPProxy(pluginSpec)) {
|
|
51
|
+
const proxyUrl = buildProxyUrl({
|
|
52
|
+
project,
|
|
53
|
+
dashboard
|
|
54
|
+
});
|
|
55
|
+
const body = {
|
|
56
|
+
method: 'GET',
|
|
57
|
+
spec,
|
|
58
|
+
body: null
|
|
59
|
+
};
|
|
60
|
+
await fetch(`${proxyUrl}${normalizedPath}`, {
|
|
61
|
+
method: 'POST',
|
|
62
|
+
headers: {
|
|
63
|
+
'Content-Type': 'application/json'
|
|
64
|
+
},
|
|
65
|
+
body: JSON.stringify(body)
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
throw new Error(`Unsupported datasource spec type for plugin kind '${spec.plugin.kind}'`);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
18
72
|
|
|
19
73
|
//# sourceMappingURL=datasource-api.js.map
|
|
@@ -1 +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
|
|
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 type { DatasourceSpec, HTTPProxy, UnknownSpec } from '@perses-dev/spec';\n\nimport { fetch } from '../util';\nimport type { 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 /** Omit to generate an unsaved-datasource proxy URL */\n name?: string;\n}\n\n/**\n * Function type for building datasource proxy URLs\n */\nexport type BuildDatasourceProxyUrlFunc = (params: BuildDatasourceProxyUrlParams) => string;\n\n/**\n * Builds a proxy URL for a datasource. When name is omitted the URL targets the\n * unsaved-datasource proxy endpoint (used for testing connectivity before saving).\n * Reads api_prefix from window.PERSES_APP_CONFIG if available.\n */\nexport function buildProxyUrl({ project, dashboard, name }: BuildDatasourceProxyUrlParams): string {\n const apiPrefix = (typeof window !== 'undefined' && window.PERSES_APP_CONFIG?.api_prefix) || '';\n let url = `${!project && !dashboard ? 'globaldatasources' : 'datasources'}`;\n if (dashboard) url = `dashboards/${encodeURIComponent(dashboard)}/${url}`;\n if (project) url = `projects/${encodeURIComponent(project)}/${url}`;\n url = name === undefined ? `unsaved/${url}` : `${url}/${encodeURIComponent(name)}`;\n return `${apiPrefix}/proxy/${url}`;\n}\n\ninterface UnsavedDatasourceProxyBody {\n method: string;\n body?: Uint8Array | null;\n spec: DatasourceSpec;\n}\n\nfunction hasDirectUrl(pluginSpec: UnknownSpec): pluginSpec is { directUrl: string } {\n return (\n typeof pluginSpec === 'object' &&\n pluginSpec !== null &&\n typeof (pluginSpec as Record<string, unknown>)['directUrl'] === 'string'\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\nexport function hasHTTPProxy(spec: UnknownSpec): spec is { proxy: HTTPProxy } {\n return (\n isRecord(spec) &&\n isRecord(spec['proxy']) &&\n spec['proxy']['kind'] === 'HTTPProxy' &&\n isRecord(spec['proxy']['spec']) &&\n typeof spec['proxy']['spec']['url'] === 'string'\n );\n}\n/**\n * Creates a function that tests connectivity for an unsaved datasource.\n * Supports directUrl (direct mode) and HTTPProxy (proxy mode).\n * Throws for any spec that does not match either shape.\n */\nexport function createTestDatasourceConnection({ project, dashboard }: { project?: string; dashboard?: string } = {}): (\n spec: DatasourceSpec,\n healthCheckPath: string,\n) => Promise<void> {\n return async (spec: DatasourceSpec, healthCheckPath: string): Promise<void> => {\n const normalizedPath = healthCheckPath.startsWith('/') ? healthCheckPath : `/${healthCheckPath}`;\n const pluginSpec = spec.plugin.spec;\n\n if (hasDirectUrl(pluginSpec)) {\n await fetch(new URL(normalizedPath, pluginSpec.directUrl).toString(), {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n });\n } else if (hasHTTPProxy(pluginSpec)) {\n const proxyUrl = buildProxyUrl({ project, dashboard });\n const body: UnsavedDatasourceProxyBody = { method: 'GET', spec, body: null };\n await fetch(`${proxyUrl}${normalizedPath}`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body),\n });\n } else {\n throw new Error(`Unsupported datasource spec type for plugin kind '${spec.plugin.kind}'`);\n }\n };\n}\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":["fetch","buildProxyUrl","project","dashboard","name","apiPrefix","window","PERSES_APP_CONFIG","api_prefix","url","encodeURIComponent","undefined","hasDirectUrl","pluginSpec","isRecord","value","hasHTTPProxy","spec","createTestDatasourceConnection","healthCheckPath","normalizedPath","startsWith","plugin","URL","directUrl","toString","method","headers","proxyUrl","body","JSON","stringify","Error","kind"],"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,SAASA,KAAK,QAAQ,mBAAU;AAkBhC;;;;CAIC,GACD,OAAO,SAASC,cAAc,EAAEC,OAAO,EAAEC,SAAS,EAAEC,IAAI,EAAiC;IACvF,MAAMC,YAAY,AAAC,OAAOC,WAAW,eAAeA,OAAOC,iBAAiB,EAAEC,cAAe;IAC7F,IAAIC,MAAM,GAAG,CAACP,WAAW,CAACC,YAAY,sBAAsB,eAAe;IAC3E,IAAIA,WAAWM,MAAM,CAAC,WAAW,EAAEC,mBAAmBP,WAAW,CAAC,EAAEM,KAAK;IACzE,IAAIP,SAASO,MAAM,CAAC,SAAS,EAAEC,mBAAmBR,SAAS,CAAC,EAAEO,KAAK;IACnEA,MAAML,SAASO,YAAY,CAAC,QAAQ,EAAEF,KAAK,GAAG,GAAGA,IAAI,CAAC,EAAEC,mBAAmBN,OAAO;IAClF,OAAO,GAAGC,UAAU,OAAO,EAAEI,KAAK;AACpC;AAQA,SAASG,aAAaC,UAAuB;IAC3C,OACE,OAAOA,eAAe,YACtBA,eAAe,QACf,OAAO,AAACA,UAAsC,CAAC,YAAY,KAAK;AAEpE;AAEA,SAASC,SAASC,KAAc;IAC9B,OAAO,OAAOA,UAAU,YAAYA,UAAU;AAChD;AAEA,OAAO,SAASC,aAAaC,IAAiB;IAC5C,OACEH,SAASG,SACTH,SAASG,IAAI,CAAC,QAAQ,KACtBA,IAAI,CAAC,QAAQ,CAAC,OAAO,KAAK,eAC1BH,SAASG,IAAI,CAAC,QAAQ,CAAC,OAAO,KAC9B,OAAOA,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,KAAK;AAE5C;AACA;;;;CAIC,GACD,OAAO,SAASC,+BAA+B,EAAEhB,OAAO,EAAEC,SAAS,EAA4C,GAAG,CAAC,CAAC;IAIlH,OAAO,OAAOc,MAAsBE;QAClC,MAAMC,iBAAiBD,gBAAgBE,UAAU,CAAC,OAAOF,kBAAkB,CAAC,CAAC,EAAEA,iBAAiB;QAChG,MAAMN,aAAaI,KAAKK,MAAM,CAACL,IAAI;QAEnC,IAAIL,aAAaC,aAAa;YAC5B,MAAMb,MAAM,IAAIuB,IAAIH,gBAAgBP,WAAWW,SAAS,EAAEC,QAAQ,IAAI;gBACpEC,QAAQ;gBACRC,SAAS;oBAAE,gBAAgB;gBAAmB;YAChD;QACF,OAAO,IAAIX,aAAaH,aAAa;YACnC,MAAMe,WAAW3B,cAAc;gBAAEC;gBAASC;YAAU;YACpD,MAAM0B,OAAmC;gBAAEH,QAAQ;gBAAOT;gBAAMY,MAAM;YAAK;YAC3E,MAAM7B,MAAM,GAAG4B,WAAWR,gBAAgB,EAAE;gBAC1CM,QAAQ;gBACRC,SAAS;oBAAE,gBAAgB;gBAAmB;gBAC9CE,MAAMC,KAAKC,SAAS,CAACF;YACvB;QACF,OAAO;YACL,MAAM,IAAIG,MAAM,CAAC,kDAAkD,EAAEf,KAAKK,MAAM,CAACW,IAAI,CAAC,CAAC,CAAC;QAC1F;IACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatasourceSpec, DatasourceSelector } from '@perses-dev/spec';
|
|
2
|
-
import { Metadata, ProjectMetadata } from './resource';
|
|
1
|
+
import type { DatasourceSpec, DatasourceSelector } from '@perses-dev/spec';
|
|
2
|
+
import type { Metadata, ProjectMetadata } from './resource';
|
|
3
3
|
export type { DatasourceSelector, DatasourceSpec };
|
|
4
4
|
/**
|
|
5
5
|
* A Datasource that's available across all projects.
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/model/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC5D,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"}
|
|
@@ -1 +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;
|
|
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 type { DatasourceSpec, DatasourceSelector } from '@perses-dev/spec';\n\nimport type { 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;AAiCjC,WAAuE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProjectMetadata } from '@perses-dev/client';
|
|
2
|
-
import { DashboardSelector, DashboardSpec, DurationString } from '@perses-dev/spec';
|
|
1
|
+
import type { ProjectMetadata } from '@perses-dev/client';
|
|
2
|
+
import type { DashboardSelector, DashboardSpec, DurationString } from '@perses-dev/spec';
|
|
3
3
|
export interface EphemeralDashboardResource {
|
|
4
4
|
kind: 'EphemeralDashboard';
|
|
5
5
|
metadata: ProjectMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ephemeralDashboard.d.ts","sourceRoot":"","sources":["../../src/model/ephemeralDashboard.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ephemeralDashboard.d.ts","sourceRoot":"","sources":["../../src/model/ephemeralDashboard.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEzF,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAuB,SAAQ,aAAa;IAC3D,GAAG,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,GAAG,EAAE,cAAc,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/ephemeralDashboard.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ProjectMetadata } from '@perses-dev/client';\nimport { DashboardSelector, DashboardSpec, DurationString } from '@perses-dev/spec';\n\nexport interface EphemeralDashboardResource {\n kind: 'EphemeralDashboard';\n metadata: ProjectMetadata;\n spec: EphemeralDashboardSpec;\n}\n\nexport interface EphemeralDashboardSpec extends DashboardSpec {\n ttl: DurationString;\n}\n\nexport interface EphemeralDashboardInfo extends DashboardSelector {\n ttl: DurationString;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAejC,WAEC"}
|
|
1
|
+
{"version":3,"sources":["../../src/model/ephemeralDashboard.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { ProjectMetadata } from '@perses-dev/client';\nimport type { DashboardSelector, DashboardSpec, DurationString } from '@perses-dev/spec';\n\nexport interface EphemeralDashboardResource {\n kind: 'EphemeralDashboard';\n metadata: ProjectMetadata;\n spec: EphemeralDashboardSpec;\n}\n\nexport interface EphemeralDashboardSpec extends DashboardSpec {\n ttl: DurationString;\n}\n\nexport interface EphemeralDashboardInfo extends DashboardSelector {\n ttl: DurationString;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAejC,WAEC"}
|
package/dist/model/folder.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../src/model/folder.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../src/model/folder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,UAAU,CAAC;CAClB"}
|
package/dist/model/folder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/folder.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ProjectMetadata } from './resource';\n\nexport interface FolderDisplay {\n name?: string;\n}\n\nexport interface FolderSpec {\n display?: FolderDisplay;\n items?: FolderItem[];\n}\n\nexport interface FolderItem {\n kind: 'Folder' | 'Dashboard';\n name: string;\n items?: FolderItem[];\n}\n\nexport interface FolderResource {\n kind: 'Folder';\n metadata: ProjectMetadata;\n spec: FolderSpec;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAmBjC,WAIC"}
|
|
1
|
+
{"version":3,"sources":["../../src/model/folder.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { ProjectMetadata } from './resource';\n\nexport interface FolderDisplay {\n name?: string;\n}\n\nexport interface FolderSpec {\n display?: FolderDisplay;\n items?: FolderItem[];\n}\n\nexport interface FolderItem {\n kind: 'Folder' | 'Dashboard';\n name: string;\n items?: FolderItem[];\n}\n\nexport interface FolderResource {\n kind: 'Folder';\n metadata: ProjectMetadata;\n spec: FolderSpec;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAmBjC,WAIC"}
|
package/dist/model/index.js
CHANGED
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
13
|
+
export * from "./datasource.js";
|
|
14
|
+
export * from "./folder.js";
|
|
15
|
+
export * from "./kind.js";
|
|
16
|
+
export * from "./resource.js";
|
|
17
|
+
export * from "./datasource-api.js";
|
|
18
|
+
export * from "./http.js";
|
|
19
|
+
export * from "./secret.js";
|
|
20
|
+
export * from "./role.js";
|
|
21
|
+
export * from "./roleBindings.js";
|
|
22
|
+
export * from "./user.js";
|
|
23
|
+
export * from "./ephemeralDashboard.js";
|
|
24
|
+
export * from "./variable.js";
|
|
25
|
+
export * from "./dashboard.js";
|
|
26
26
|
|
|
27
27
|
//# 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 './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';\nexport * from './dashboard';\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,
|
|
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';\nexport * from './dashboard';\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,kBAAe;AAC7B,cAAc,cAAW;AACzB,cAAc,YAAS;AACvB,cAAc,gBAAa;AAC3B,cAAc,sBAAmB;AACjC,cAAc,YAAS;AACvB,cAAc,cAAW;AACzB,cAAc,YAAS;AACvB,cAAc,oBAAiB;AAC/B,cAAc,YAAS;AACvB,cAAc,0BAAuB;AACrC,cAAc,gBAAa;AAC3B,cAAc,iBAAc"}
|
package/dist/model/resource.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Display } from '@perses-dev/spec';
|
|
2
|
-
import { Kind } from './kind';
|
|
1
|
+
import type { Display } from '@perses-dev/spec';
|
|
2
|
+
import type { Kind } from './kind';
|
|
3
3
|
export declare function isProjectMetadata(metadata: Metadata | ProjectMetadata): metadata is ProjectMetadata;
|
|
4
4
|
export interface Metadata {
|
|
5
5
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/model/resource.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/model/resource.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,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,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 { 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;
|
|
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 type { Display } from '@perses-dev/spec';\n\nimport type { 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;AAMjC,OAAO,SAASA,kBAAkBC,QAAoC;IACpE,OAAO,aAAaA;AACtB;AA+BA,OAAO,SAASC,mBAAmBD,QAAoC;IACrE,OAAO,aAAaA,WAAWA,SAASE,OAAO,GAAGC;AACpD"}
|
package/dist/model/role.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Kind, Metadata, ProjectMetadata } from '@perses-dev/client';
|
|
1
|
+
import type { Kind, Metadata, ProjectMetadata } from '@perses-dev/client';
|
|
2
2
|
export type Action = 'create' | 'read' | 'update' | 'delete' | '*';
|
|
3
3
|
export declare const ACTIONS: string[];
|
|
4
4
|
export type Scope = Kind | '*';
|
package/dist/model/role.d.ts.map
CHANGED
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../src/model/role.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1E,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"}
|
package/dist/model/role.js.map
CHANGED
|
@@ -1 +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"}
|
|
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 type { 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"}
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"roleBindings.d.ts","sourceRoot":"","sources":["../../src/model/roleBindings.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE5D,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"}
|
|
@@ -1 +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"}
|
|
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 type { 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"}
|
package/dist/model/secret.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../../src/model/secret.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../../src/model/secret.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,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"}
|
package/dist/model/secret.js.map
CHANGED
|
@@ -1 +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"}
|
|
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 type { 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"}
|
package/dist/model/user.d.ts
CHANGED
package/dist/model/user.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/model/user.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/model/user.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,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"}
|
package/dist/model/user.js.map
CHANGED
|
@@ -1 +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"}
|
|
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 type { 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"}
|
package/dist/model/variable.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Metadata, ProjectMetadata } from '@perses-dev/client';
|
|
2
|
-
import { Definition, Display, UnknownSpec } from '@perses-dev/spec';
|
|
1
|
+
import type { Metadata, ProjectMetadata } from '@perses-dev/client';
|
|
2
|
+
import type { Definition, Display, UnknownSpec } from '@perses-dev/spec';
|
|
3
3
|
export type VariableNameType = string;
|
|
4
4
|
export type VariableValue = string | string[] | null;
|
|
5
5
|
export interface VariableDisplay extends Display {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["../../src/model/variable.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["../../src/model/variable.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;AAErD,MAAM,WAAW,eAAgB,SAAQ,OAAO;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAuB,SAAQ,UAAU,CAAC,gBAAgB,CAAC;IAC1E,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAuB,SAAQ,UAAU,CAAC,gBAAgB,CAAC;IAC1E,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB,CAAC,UAAU,GAAG,WAAW,CAAE,SAAQ,YAAY;IAC9E,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,yBAA0B,SAAQ,UAAU,CAAC,mBAAmB,CAAC;IAChF,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,KAAK,EAAE,MAAM,MAAM,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,EAAG,QAAiB,CAAC"}
|
|
@@ -1 +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"}
|
|
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 type { Metadata, ProjectMetadata } from '@perses-dev/client';\nimport type { 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"}
|