@perses-dev/client 0.54.0-beta.4 → 0.54.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.
@@ -19,6 +19,7 @@ _export_star(require("./metadata"), exports);
19
19
  _export_star(require("./user"), exports);
20
20
  _export_star(require("./secret"), exports);
21
21
  _export_star(require("./role"), exports);
22
+ _export_star(require("./rolebinding"), exports);
22
23
  function _export_star(from, to) {
23
24
  Object.keys(from).forEach(function(k) {
24
25
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -0,0 +1,65 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
+ });
22
+ }
23
+ _export(exports, {
24
+ get globalRoleBindingSchema () {
25
+ return globalRoleBindingSchema;
26
+ },
27
+ get roleBindingSchema () {
28
+ return roleBindingSchema;
29
+ },
30
+ get roleBindingSpecSchema () {
31
+ return roleBindingSpecSchema;
32
+ },
33
+ get roleBindingsEditorSchema () {
34
+ return roleBindingsEditorSchema;
35
+ },
36
+ get subjectSchema () {
37
+ return subjectSchema;
38
+ }
39
+ });
40
+ const _zod = require("zod");
41
+ const _metadata = require("./metadata");
42
+ const subjectSchema = _zod.z.object({
43
+ kind: _zod.z.enum([
44
+ 'User'
45
+ ]),
46
+ name: _metadata.nameSchema
47
+ });
48
+ const roleBindingSpecSchema = _zod.z.object({
49
+ role: _metadata.nameSchema,
50
+ subjects: _zod.z.array(subjectSchema).nonempty()
51
+ });
52
+ const roleBindingSchema = _zod.z.object({
53
+ kind: _zod.z.literal('RoleBinding'),
54
+ metadata: _metadata.projectMetadataSchema,
55
+ spec: roleBindingSpecSchema
56
+ });
57
+ const globalRoleBindingSchema = _zod.z.object({
58
+ kind: _zod.z.literal('GlobalRoleBinding'),
59
+ metadata: _metadata.metadataSchema,
60
+ spec: roleBindingSpecSchema
61
+ });
62
+ const roleBindingsEditorSchema = _zod.z.discriminatedUnion('kind', [
63
+ roleBindingSchema,
64
+ globalRoleBindingSchema
65
+ ]);
@@ -3,4 +3,5 @@ export * from './metadata';
3
3
  export * from './user';
4
4
  export * from './secret';
5
5
  export * from './role';
6
+ export * from './rolebinding';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC"}
@@ -15,5 +15,6 @@ export * from './metadata';
15
15
  export * from './user';
16
16
  export * from './secret';
17
17
  export * from './role';
18
+ export * from './rolebinding';
18
19
 
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './datasource';\nexport * from './metadata';\nexport * from './user';\nexport * from './secret';\nexport * from './role';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe;AAC7B,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,SAAS"}
1
+ {"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './datasource';\nexport * from './metadata';\nexport * from './user';\nexport * from './secret';\nexport * from './role';\nexport * from './rolebinding';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe;AAC7B,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,gBAAgB"}
@@ -0,0 +1,58 @@
1
+ import { z } from 'zod';
2
+ import { RoleBinding, RoleBindingSpec, Subject } from '../model';
3
+ export declare const subjectSchema: z.ZodSchema<Subject>;
4
+ export declare const roleBindingSpecSchema: z.ZodSchema<RoleBindingSpec>;
5
+ export declare const roleBindingSchema: z.ZodObject<{
6
+ kind: z.ZodLiteral<"RoleBinding">;
7
+ metadata: z.ZodObject<{
8
+ name: z.ZodString;
9
+ } & {
10
+ project: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ project: string;
13
+ name: string;
14
+ }, {
15
+ project: string;
16
+ name: string;
17
+ }>;
18
+ spec: z.ZodType<RoleBindingSpec, z.ZodTypeDef, RoleBindingSpec>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ kind: "RoleBinding";
21
+ metadata: {
22
+ project: string;
23
+ name: string;
24
+ };
25
+ spec: RoleBindingSpec;
26
+ }, {
27
+ kind: "RoleBinding";
28
+ metadata: {
29
+ project: string;
30
+ name: string;
31
+ };
32
+ spec: RoleBindingSpec;
33
+ }>;
34
+ export declare const globalRoleBindingSchema: z.ZodObject<{
35
+ kind: z.ZodLiteral<"GlobalRoleBinding">;
36
+ metadata: z.ZodObject<{
37
+ 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
+ metadata: {
47
+ name: string;
48
+ };
49
+ spec: RoleBindingSpec;
50
+ }, {
51
+ kind: "GlobalRoleBinding";
52
+ metadata: {
53
+ name: string;
54
+ };
55
+ spec: RoleBindingSpec;
56
+ }>;
57
+ export declare const roleBindingsEditorSchema: z.ZodSchema<RoleBinding>;
58
+ //# sourceMappingURL=rolebinding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rolebinding.d.ts","sourceRoot":"","sources":["../../src/schema/rolebinding.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGjE,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"}
@@ -0,0 +1,40 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { z } from 'zod';
14
+ import { nameSchema, metadataSchema, projectMetadataSchema } from './metadata';
15
+ export const subjectSchema = z.object({
16
+ kind: z.enum([
17
+ 'User'
18
+ ]),
19
+ name: nameSchema
20
+ });
21
+ export const roleBindingSpecSchema = z.object({
22
+ role: nameSchema,
23
+ subjects: z.array(subjectSchema).nonempty()
24
+ });
25
+ export const roleBindingSchema = z.object({
26
+ kind: z.literal('RoleBinding'),
27
+ metadata: projectMetadataSchema,
28
+ spec: roleBindingSpecSchema
29
+ });
30
+ export const globalRoleBindingSchema = z.object({
31
+ kind: z.literal('GlobalRoleBinding'),
32
+ metadata: metadataSchema,
33
+ spec: roleBindingSpecSchema
34
+ });
35
+ export const roleBindingsEditorSchema = z.discriminatedUnion('kind', [
36
+ roleBindingSchema,
37
+ globalRoleBindingSchema
38
+ ]);
39
+
40
+ //# sourceMappingURL=rolebinding.js.map
@@ -0,0 +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';\nimport { 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;AAExB,SAASC,UAAU,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,aAAa;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/client",
3
- "version": "0.54.0-beta.4",
3
+ "version": "0.54.0-beta.6",
4
4
  "description": "Functions as an API client or Data fetching Layer for interacting with a backend service",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",