@perses-dev/client 0.55.0-beta.6 → 0.55.0-beta.8

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.
@@ -54,5 +54,5 @@ export interface GlobalVariableResource {
54
54
  }
55
55
  export type VariableType = VariableResource | GlobalVariableResource;
56
56
  export declare function getVariableProject(variable: VariableType): string | undefined;
57
- export declare const DEFAULT_ALL_VALUE: "$__all";
57
+ export declare const DEFAULT_ALL_VALUE: '$__all';
58
58
  //# sourceMappingURL=variable.d.ts.map
@@ -5,55 +5,18 @@ export declare const datasourceSchema: z.ZodObject<{
5
5
  kind: z.ZodLiteral<"Datasource">;
6
6
  metadata: z.ZodObject<{
7
7
  name: z.ZodString;
8
- } & {
9
8
  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
- spec: import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>;
21
- metadata: {
22
- project: string;
23
- name: string;
24
- };
25
- }, {
26
- kind: "Datasource";
27
- spec: import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>;
28
- metadata: {
29
- project: string;
30
- name: string;
31
- };
32
- }>;
9
+ }, z.core.$strip>;
10
+ spec: z.ZodType<import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>, import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>, z.core.$ZodTypeInternals<import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>, import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>>>;
11
+ }, z.core.$strip>;
33
12
  export declare const globalDatasourceSchema: z.ZodObject<{
34
13
  kind: z.ZodLiteral<"GlobalDatasource">;
35
14
  metadata: z.ZodObject<{
36
15
  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
- spec: import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>;
46
- metadata: {
47
- name: string;
48
- };
49
- }, {
50
- kind: "GlobalDatasource";
51
- spec: import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>;
52
- metadata: {
53
- name: string;
54
- };
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>;
16
+ }, z.core.$strip>;
17
+ spec: z.ZodType<import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>, import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>, z.core.$ZodTypeInternals<import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>, import("@perses-dev/spec").DatasourceSpec<import("@perses-dev/spec").UnknownSpec>>>;
18
+ }, z.core.$strip>;
19
+ export declare const datasourcesSchema: z.ZodType<Datasource>;
20
+ export declare const datasourceDefinitionSchema: z.ZodType<DatasourceDefinition, DatasourceDefinition>;
21
+ export declare function buildDatasourceDefinitionSchema(pluginSchema: PluginSchema): z.ZodType<DatasourceDefinition, DatasourceDefinition>;
59
22
  //# sourceMappingURL=datasource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/schema/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGjE,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"}
1
+ {"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/schema/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGjE,eAAO,MAAM,gBAAgB;;;;;;;iBAI3B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;iBAIjC,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAGlD,CAAC;AAEH,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,oBAAoB,CAG3F,CAAC;AAEH,wBAAgB,+BAA+B,CAC7C,YAAY,EAAE,YAAY,GACzB,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAKvD"}
@@ -1 +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 type { PluginSchema } from '@perses-dev/spec';\nimport { buildDatasourceSpecSchema, datasourceSpecSchema } from '@perses-dev/spec';\nimport { z } from 'zod';\n\nimport type { 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;AAGjC,SAASA,yBAAyB,EAAEC,oBAAoB,QAAQ,mBAAmB;AACnF,SAASC,CAAC,QAAQ,MAAM;AAGxB,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,gBAAa;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"}
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 type { PluginSchema } from '@perses-dev/spec';\nimport { buildDatasourceSpecSchema, datasourceSpecSchema } from '@perses-dev/spec';\nimport { z } from 'zod';\n\nimport type { 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.ZodType<Datasource> = z.discriminatedUnion('kind', [\n datasourceSchema,\n globalDatasourceSchema,\n]);\n\nexport const datasourceDefinitionSchema: z.ZodType<DatasourceDefinition, DatasourceDefinition> = z.object({\n name: z.string().min(1),\n spec: datasourceSpecSchema,\n});\n\nexport function buildDatasourceDefinitionSchema(\n pluginSchema: PluginSchema,\n): z.ZodType<DatasourceDefinition, 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;AAGjC,SAASA,yBAAyB,EAAEC,oBAAoB,QAAQ,mBAAmB;AACnF,SAASC,CAAC,QAAQ,MAAM;AAGxB,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,gBAAa;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,oBAA2CV,EAAEW,kBAAkB,CAAC,QAAQ;IACnFR;IACAM;CACD,EAAE;AAEH,OAAO,MAAMG,6BAAoFZ,EAAEI,MAAM,CAAC;IACxGS,MAAMb,EAAEc,MAAM,GAAGC,GAAG,CAAC;IACrBP,MAAMT;AACR,GAAG;AAEH,OAAO,SAASiB,gCACdC,YAA0B;IAE1B,OAAOjB,EAAEI,MAAM,CAAC;QACdS,MAAMb,EAAEc,MAAM,GAAGC,GAAG,CAAC;QACrBP,MAAMV,0BAA0BmB;IAClC;AACF"}
@@ -2,20 +2,9 @@ import { z } from 'zod';
2
2
  export declare const nameSchema: z.ZodString;
3
3
  export declare const metadataSchema: z.ZodObject<{
4
4
  name: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- name: string;
7
- }, {
8
- name: string;
9
- }>;
5
+ }, z.core.$strip>;
10
6
  export declare const projectMetadataSchema: z.ZodObject<{
11
7
  name: z.ZodString;
12
- } & {
13
8
  project: z.ZodString;
14
- }, "strip", z.ZodTypeAny, {
15
- project: string;
16
- name: string;
17
- }, {
18
- project: string;
19
- name: string;
20
- }>;
9
+ }, z.core.$strip>;
21
10
  //# sourceMappingURL=metadata.d.ts.map
@@ -1 +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"}
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;;iBAEzB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;iBAEhC,CAAC"}
@@ -1,58 +1,21 @@
1
1
  import { z } from 'zod';
2
2
  import type { Permission, Role, RoleSpec } from '../model';
3
- export declare const permissionSchema: z.ZodSchema<Permission>;
4
- export declare const roleSpecSchema: z.ZodSchema<RoleSpec>;
3
+ export declare const permissionSchema: z.ZodType<Permission>;
4
+ export declare const roleSpecSchema: z.ZodType<RoleSpec>;
5
5
  export declare const roleSchema: z.ZodObject<{
6
6
  kind: z.ZodLiteral<"Role">;
7
7
  metadata: z.ZodObject<{
8
8
  name: z.ZodString;
9
- } & {
10
9
  project: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- project: string;
13
- name: string;
14
- }, {
15
- project: string;
16
- name: string;
17
- }>;
18
- spec: z.ZodType<RoleSpec, z.ZodTypeDef, RoleSpec>;
19
- }, "strip", z.ZodTypeAny, {
20
- kind: "Role";
21
- spec: RoleSpec;
22
- metadata: {
23
- project: string;
24
- name: string;
25
- };
26
- }, {
27
- kind: "Role";
28
- spec: RoleSpec;
29
- metadata: {
30
- project: string;
31
- name: string;
32
- };
33
- }>;
10
+ }, z.core.$strip>;
11
+ spec: z.ZodType<RoleSpec, unknown, z.core.$ZodTypeInternals<RoleSpec, unknown>>;
12
+ }, z.core.$strip>;
34
13
  export declare const globalRoleSchema: z.ZodObject<{
35
14
  kind: z.ZodLiteral<"GlobalRole">;
36
15
  metadata: z.ZodObject<{
37
16
  name: z.ZodString;
38
- }, "strip", z.ZodTypeAny, {
39
- name: string;
40
- }, {
41
- name: string;
42
- }>;
43
- spec: z.ZodType<RoleSpec, z.ZodTypeDef, RoleSpec>;
44
- }, "strip", z.ZodTypeAny, {
45
- kind: "GlobalRole";
46
- spec: RoleSpec;
47
- metadata: {
48
- name: string;
49
- };
50
- }, {
51
- kind: "GlobalRole";
52
- spec: RoleSpec;
53
- metadata: {
54
- name: string;
55
- };
56
- }>;
57
- export declare const rolesEditorSchema: z.ZodSchema<Role>;
17
+ }, z.core.$strip>;
18
+ spec: z.ZodType<RoleSpec, unknown, z.core.$ZodTypeInternals<RoleSpec, unknown>>;
19
+ }, z.core.$strip>;
20
+ export declare const rolesEditorSchema: z.ZodType<Role>;
58
21
  //# sourceMappingURL=role.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../src/schema/role.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG3D,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,CAyBnD,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAE/C,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAgE,CAAC"}
1
+ {"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../src/schema/role.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG3D,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAyBjD,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAE7C,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;iBAIrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;iBAI3B,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAgE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schema/role.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { z } from 'zod';\n\nimport type { Permission, Role, RoleSpec } from '../model';\nimport { metadataSchema, projectMetadataSchema } from './metadata';\n\nexport const permissionSchema: z.ZodSchema<Permission> = z.object({\n // TODO: use SCOPE & ACTIONS constants\n actions: z.array(z.enum(['*', 'create', 'read', 'update', 'delete'])).nonempty('Must contains at least 1 action'),\n scopes: z\n .array(\n z.enum([\n '*',\n 'Dashboard',\n 'Datasource',\n 'EphemeralDashboard',\n 'Folder',\n 'GlobalDatasource',\n 'GlobalRole',\n 'GlobalRoleBinding',\n 'GlobalSecret',\n 'GlobalVariable',\n 'Project',\n 'Role',\n 'RoleBinding',\n 'Secret',\n 'User',\n 'Variable',\n ]),\n )\n .nonempty('Must contains at least 1 scope'), // TODO: limit project role\n});\n\nexport const roleSpecSchema: z.ZodSchema<RoleSpec> = z.object({\n permissions: z.array(permissionSchema),\n});\n\nexport const roleSchema = z.object({\n kind: z.literal('Role'),\n metadata: projectMetadataSchema,\n spec: roleSpecSchema,\n});\n\nexport const globalRoleSchema = z.object({\n kind: z.literal('GlobalRole'),\n metadata: metadataSchema,\n spec: roleSpecSchema,\n});\n\nexport const rolesEditorSchema: z.ZodSchema<Role> = z.discriminatedUnion('kind', [roleSchema, globalRoleSchema]);\n"],"names":["z","metadataSchema","projectMetadataSchema","permissionSchema","object","actions","array","enum","nonempty","scopes","roleSpecSchema","permissions","roleSchema","kind","literal","metadata","spec","globalRoleSchema","rolesEditorSchema","discriminatedUnion"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,CAAC,QAAQ,MAAM;AAGxB,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,gBAAa;AAEnE,OAAO,MAAMC,mBAA4CH,EAAEI,MAAM,CAAC;IAChE,sCAAsC;IACtCC,SAASL,EAAEM,KAAK,CAACN,EAAEO,IAAI,CAAC;QAAC;QAAK;QAAU;QAAQ;QAAU;KAAS,GAAGC,QAAQ,CAAC;IAC/EC,QAAQT,EACLM,KAAK,CACJN,EAAEO,IAAI,CAAC;QACL;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD,GAEFC,QAAQ,CAAC;AACd,GAAG;AAEH,OAAO,MAAME,iBAAwCV,EAAEI,MAAM,CAAC;IAC5DO,aAAaX,EAAEM,KAAK,CAACH;AACvB,GAAG;AAEH,OAAO,MAAMS,aAAaZ,EAAEI,MAAM,CAAC;IACjCS,MAAMb,EAAEc,OAAO,CAAC;IAChBC,UAAUb;IACVc,MAAMN;AACR,GAAG;AAEH,OAAO,MAAMO,mBAAmBjB,EAAEI,MAAM,CAAC;IACvCS,MAAMb,EAAEc,OAAO,CAAC;IAChBC,UAAUd;IACVe,MAAMN;AACR,GAAG;AAEH,OAAO,MAAMQ,oBAAuClB,EAAEmB,kBAAkB,CAAC,QAAQ;IAACP;IAAYK;CAAiB,EAAE"}
1
+ {"version":3,"sources":["../../src/schema/role.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { z } from 'zod';\n\nimport type { Permission, Role, RoleSpec } from '../model';\nimport { metadataSchema, projectMetadataSchema } from './metadata';\n\nexport const permissionSchema: z.ZodType<Permission> = z.object({\n // TODO: use SCOPE & ACTIONS constants\n actions: z.array(z.enum(['*', 'create', 'read', 'update', 'delete'])).nonempty('Must contains at least 1 action'),\n scopes: z\n .array(\n z.enum([\n '*',\n 'Dashboard',\n 'Datasource',\n 'EphemeralDashboard',\n 'Folder',\n 'GlobalDatasource',\n 'GlobalRole',\n 'GlobalRoleBinding',\n 'GlobalSecret',\n 'GlobalVariable',\n 'Project',\n 'Role',\n 'RoleBinding',\n 'Secret',\n 'User',\n 'Variable',\n ]),\n )\n .nonempty('Must contains at least 1 scope'), // TODO: limit project role\n});\n\nexport const roleSpecSchema: z.ZodType<RoleSpec> = z.object({\n permissions: z.array(permissionSchema),\n});\n\nexport const roleSchema = z.object({\n kind: z.literal('Role'),\n metadata: projectMetadataSchema,\n spec: roleSpecSchema,\n});\n\nexport const globalRoleSchema = z.object({\n kind: z.literal('GlobalRole'),\n metadata: metadataSchema,\n spec: roleSpecSchema,\n});\n\nexport const rolesEditorSchema: z.ZodType<Role> = z.discriminatedUnion('kind', [roleSchema, globalRoleSchema]);\n"],"names":["z","metadataSchema","projectMetadataSchema","permissionSchema","object","actions","array","enum","nonempty","scopes","roleSpecSchema","permissions","roleSchema","kind","literal","metadata","spec","globalRoleSchema","rolesEditorSchema","discriminatedUnion"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,CAAC,QAAQ,MAAM;AAGxB,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,gBAAa;AAEnE,OAAO,MAAMC,mBAA0CH,EAAEI,MAAM,CAAC;IAC9D,sCAAsC;IACtCC,SAASL,EAAEM,KAAK,CAACN,EAAEO,IAAI,CAAC;QAAC;QAAK;QAAU;QAAQ;QAAU;KAAS,GAAGC,QAAQ,CAAC;IAC/EC,QAAQT,EACLM,KAAK,CACJN,EAAEO,IAAI,CAAC;QACL;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD,GAEFC,QAAQ,CAAC;AACd,GAAG;AAEH,OAAO,MAAME,iBAAsCV,EAAEI,MAAM,CAAC;IAC1DO,aAAaX,EAAEM,KAAK,CAACH;AACvB,GAAG;AAEH,OAAO,MAAMS,aAAaZ,EAAEI,MAAM,CAAC;IACjCS,MAAMb,EAAEc,OAAO,CAAC;IAChBC,UAAUb;IACVc,MAAMN;AACR,GAAG;AAEH,OAAO,MAAMO,mBAAmBjB,EAAEI,MAAM,CAAC;IACvCS,MAAMb,EAAEc,OAAO,CAAC;IAChBC,UAAUd;IACVe,MAAMN;AACR,GAAG;AAEH,OAAO,MAAMQ,oBAAqClB,EAAEmB,kBAAkB,CAAC,QAAQ;IAACP;IAAYK;CAAiB,EAAE"}
@@ -1,58 +1,21 @@
1
1
  import { z } from 'zod';
2
2
  import type { RoleBinding, RoleBindingSpec, Subject } from '../model';
3
- export declare const subjectSchema: z.ZodSchema<Subject>;
4
- export declare const roleBindingSpecSchema: z.ZodSchema<RoleBindingSpec>;
3
+ export declare const subjectSchema: z.ZodType<Subject>;
4
+ export declare const roleBindingSpecSchema: z.ZodType<RoleBindingSpec>;
5
5
  export declare const roleBindingSchema: z.ZodObject<{
6
6
  kind: z.ZodLiteral<"RoleBinding">;
7
7
  metadata: z.ZodObject<{
8
8
  name: z.ZodString;
9
- } & {
10
9
  project: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- project: string;
13
- name: string;
14
- }, {
15
- project: string;
16
- name: string;
17
- }>;
18
- spec: z.ZodType<RoleBindingSpec, z.ZodTypeDef, RoleBindingSpec>;
19
- }, "strip", z.ZodTypeAny, {
20
- kind: "RoleBinding";
21
- spec: RoleBindingSpec;
22
- metadata: {
23
- project: string;
24
- name: string;
25
- };
26
- }, {
27
- kind: "RoleBinding";
28
- spec: RoleBindingSpec;
29
- metadata: {
30
- project: string;
31
- name: string;
32
- };
33
- }>;
10
+ }, z.core.$strip>;
11
+ spec: z.ZodType<RoleBindingSpec, unknown, z.core.$ZodTypeInternals<RoleBindingSpec, unknown>>;
12
+ }, z.core.$strip>;
34
13
  export declare const globalRoleBindingSchema: z.ZodObject<{
35
14
  kind: z.ZodLiteral<"GlobalRoleBinding">;
36
15
  metadata: z.ZodObject<{
37
16
  name: z.ZodString;
38
- }, "strip", z.ZodTypeAny, {
39
- name: string;
40
- }, {
41
- name: string;
42
- }>;
43
- spec: z.ZodType<RoleBindingSpec, z.ZodTypeDef, RoleBindingSpec>;
44
- }, "strip", z.ZodTypeAny, {
45
- kind: "GlobalRoleBinding";
46
- spec: RoleBindingSpec;
47
- metadata: {
48
- name: string;
49
- };
50
- }, {
51
- kind: "GlobalRoleBinding";
52
- spec: RoleBindingSpec;
53
- metadata: {
54
- name: string;
55
- };
56
- }>;
57
- export declare const roleBindingsEditorSchema: z.ZodSchema<RoleBinding>;
17
+ }, z.core.$strip>;
18
+ spec: z.ZodType<RoleBindingSpec, unknown, z.core.$ZodTypeInternals<RoleBindingSpec, unknown>>;
19
+ }, z.core.$strip>;
20
+ export declare const roleBindingsEditorSchema: z.ZodType<RoleBinding>;
58
21
  //# sourceMappingURL=rolebinding.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rolebinding.d.ts","sourceRoot":"","sources":["../../src/schema/rolebinding.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGtE,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAG7C,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,SAAS,CAAC,eAAe,CAG7D,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI5B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;EAIlC,CAAC;AAEH,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,SAAS,CAAC,WAAW,CAG5D,CAAC"}
1
+ {"version":3,"file":"rolebinding.d.ts","sourceRoot":"","sources":["../../src/schema/rolebinding.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGtE,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAG3C,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAG3D,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;iBAI5B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;iBAIlC,CAAC;AAEH,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAG1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schema/rolebinding.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\nimport type { RoleBinding, RoleBindingSpec, Subject } from '../model';\nimport { nameSchema, metadataSchema, projectMetadataSchema } from './metadata';\n\nexport const subjectSchema: z.ZodSchema<Subject> = z.object({\n kind: z.enum(['User']),\n name: nameSchema,\n});\n\nexport const roleBindingSpecSchema: z.ZodSchema<RoleBindingSpec> = z.object({\n role: nameSchema,\n subjects: z.array(subjectSchema).nonempty(),\n});\n\nexport const roleBindingSchema = z.object({\n kind: z.literal('RoleBinding'),\n metadata: projectMetadataSchema,\n spec: roleBindingSpecSchema,\n});\n\nexport const globalRoleBindingSchema = z.object({\n kind: z.literal('GlobalRoleBinding'),\n metadata: metadataSchema,\n spec: roleBindingSpecSchema,\n});\n\nexport const roleBindingsEditorSchema: z.ZodSchema<RoleBinding> = z.discriminatedUnion('kind', [\n roleBindingSchema,\n globalRoleBindingSchema,\n]);\n"],"names":["z","nameSchema","metadataSchema","projectMetadataSchema","subjectSchema","object","kind","enum","name","roleBindingSpecSchema","role","subjects","array","nonempty","roleBindingSchema","literal","metadata","spec","globalRoleBindingSchema","roleBindingsEditorSchema","discriminatedUnion"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,CAAC,QAAQ,MAAM;AAGxB,SAASC,UAAU,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,gBAAa;AAE/E,OAAO,MAAMC,gBAAsCJ,EAAEK,MAAM,CAAC;IAC1DC,MAAMN,EAAEO,IAAI,CAAC;QAAC;KAAO;IACrBC,MAAMP;AACR,GAAG;AAEH,OAAO,MAAMQ,wBAAsDT,EAAEK,MAAM,CAAC;IAC1EK,MAAMT;IACNU,UAAUX,EAAEY,KAAK,CAACR,eAAeS,QAAQ;AAC3C,GAAG;AAEH,OAAO,MAAMC,oBAAoBd,EAAEK,MAAM,CAAC;IACxCC,MAAMN,EAAEe,OAAO,CAAC;IAChBC,UAAUb;IACVc,MAAMR;AACR,GAAG;AAEH,OAAO,MAAMS,0BAA0BlB,EAAEK,MAAM,CAAC;IAC9CC,MAAMN,EAAEe,OAAO,CAAC;IAChBC,UAAUd;IACVe,MAAMR;AACR,GAAG;AAEH,OAAO,MAAMU,2BAAqDnB,EAAEoB,kBAAkB,CAAC,QAAQ;IAC7FN;IACAI;CACD,EAAE"}
1
+ {"version":3,"sources":["../../src/schema/rolebinding.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\nimport type { RoleBinding, RoleBindingSpec, Subject } from '../model';\nimport { nameSchema, metadataSchema, projectMetadataSchema } from './metadata';\n\nexport const subjectSchema: z.ZodType<Subject> = z.object({\n kind: z.enum(['User']),\n name: nameSchema,\n});\n\nexport const roleBindingSpecSchema: z.ZodType<RoleBindingSpec> = z.object({\n role: nameSchema,\n subjects: z.array(subjectSchema).nonempty(),\n});\n\nexport const roleBindingSchema = z.object({\n kind: z.literal('RoleBinding'),\n metadata: projectMetadataSchema,\n spec: roleBindingSpecSchema,\n});\n\nexport const globalRoleBindingSchema = z.object({\n kind: z.literal('GlobalRoleBinding'),\n metadata: metadataSchema,\n spec: roleBindingSpecSchema,\n});\n\nexport const roleBindingsEditorSchema: z.ZodType<RoleBinding> = z.discriminatedUnion('kind', [\n roleBindingSchema,\n globalRoleBindingSchema,\n]);\n"],"names":["z","nameSchema","metadataSchema","projectMetadataSchema","subjectSchema","object","kind","enum","name","roleBindingSpecSchema","role","subjects","array","nonempty","roleBindingSchema","literal","metadata","spec","globalRoleBindingSchema","roleBindingsEditorSchema","discriminatedUnion"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,CAAC,QAAQ,MAAM;AAGxB,SAASC,UAAU,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,gBAAa;AAE/E,OAAO,MAAMC,gBAAoCJ,EAAEK,MAAM,CAAC;IACxDC,MAAMN,EAAEO,IAAI,CAAC;QAAC;KAAO;IACrBC,MAAMP;AACR,GAAG;AAEH,OAAO,MAAMQ,wBAAoDT,EAAEK,MAAM,CAAC;IACxEK,MAAMT;IACNU,UAAUX,EAAEY,KAAK,CAACR,eAAeS,QAAQ;AAC3C,GAAG;AAEH,OAAO,MAAMC,oBAAoBd,EAAEK,MAAM,CAAC;IACxCC,MAAMN,EAAEe,OAAO,CAAC;IAChBC,UAAUb;IACVc,MAAMR;AACR,GAAG;AAEH,OAAO,MAAMS,0BAA0BlB,EAAEK,MAAM,CAAC;IAC9CC,MAAMN,EAAEe,OAAO,CAAC;IAChBC,UAAUd;IACVe,MAAMR;AACR,GAAG;AAEH,OAAO,MAAMU,2BAAmDnB,EAAEoB,kBAAkB,CAAC,QAAQ;IAC3FN;IACAI;CACD,EAAE"}