@backstage/plugin-catalog-common 1.0.1-next.0 → 1.0.2-next.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @backstage/plugin-catalog-common
2
2
 
3
+ ## 1.0.2-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-permission-common@0.6.1-next.0
9
+ - @backstage/search-common@0.3.4-next.0
10
+
11
+ ## 1.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - ada4446733: Use `createPermission` helper when creating permissions.
16
+ - 8c8bee47f4: Add `@alpha` `CatalogEntityPermission` convenience type, available for import from `@backstage/plugin-catalog-common/alpha`.
17
+ - Updated dependencies
18
+ - @backstage/plugin-permission-common@0.6.0
19
+ - @backstage/search-common@0.3.3
20
+
21
+ ## 1.0.1-next.1
22
+
23
+ ### Patch Changes
24
+
25
+ - ada4446733: Use `createPermission` helper when creating permissions.
26
+ - 8c8bee47f4: Add `@alpha` `CatalogEntityPermission` convenience type, available for import from `@backstage/plugin-catalog-common/alpha`.
27
+ - Updated dependencies
28
+ - @backstage/plugin-permission-common@0.6.0-next.0
29
+ - @backstage/search-common@0.3.3-next.1
30
+
3
31
  ## 1.0.1-next.0
4
32
 
5
33
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-common",
3
- "version": "1.0.1-next.0",
3
+ "version": "1.0.2-next.0",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "module": "../dist/index.esm.js",
6
6
  "types": "../dist/index.alpha.d.ts"
@@ -5,8 +5,9 @@
5
5
  * @packageDocumentation
6
6
  */
7
7
 
8
+ import { BasicPermission } from '@backstage/plugin-permission-common';
8
9
  import { IndexableDocument } from '@backstage/search-common';
9
- import { Permission } from '@backstage/plugin-permission-common';
10
+ import { ResourcePermission } from '@backstage/plugin-permission-common';
10
11
 
11
12
  /**
12
13
  * This permission is used to authorize actions that involve creating a new
@@ -14,14 +15,14 @@ import { Permission } from '@backstage/plugin-permission-common';
14
15
  * catalog.
15
16
  * @alpha
16
17
  */
17
- export declare const catalogEntityCreatePermission: Permission;
18
+ export declare const catalogEntityCreatePermission: BasicPermission;
18
19
 
19
20
  /**
20
21
  * This permission is used to designate actions that involve removing one or
21
22
  * more entities from the catalog.
22
23
  * @alpha
23
24
  */
24
- export declare const catalogEntityDeletePermission: Permission;
25
+ export declare const catalogEntityDeletePermission: ResourcePermission<"catalog-entity">;
25
26
 
26
27
  /**
27
28
  * The Document format for an Entity in the Catalog for search
@@ -38,6 +39,13 @@ export declare interface CatalogEntityDocument extends IndexableDocument {
38
39
  owner: string;
39
40
  }
40
41
 
42
+ /**
43
+ * Convenience type for catalog entity
44
+ * {@link @backstage/plugin-permission-common#ResourcePermission}s.
45
+ * @alpha
46
+ */
47
+ export declare type CatalogEntityPermission = ResourcePermission<typeof RESOURCE_TYPE_CATALOG_ENTITY>;
48
+
41
49
  /**
42
50
  * This permission is used to authorize actions that involve reading one or more
43
51
  * entities from the catalog.
@@ -46,28 +54,28 @@ export declare interface CatalogEntityDocument extends IndexableDocument {
46
54
  * exist in the catalog — both in the frontend and in API responses.
47
55
  * @alpha
48
56
  */
49
- export declare const catalogEntityReadPermission: Permission;
57
+ export declare const catalogEntityReadPermission: ResourcePermission<"catalog-entity">;
50
58
 
51
59
  /**
52
60
  * This permission is used to designate refreshing one or more entities from the
53
61
  * catalog.
54
62
  * @alpha
55
63
  */
56
- export declare const catalogEntityRefreshPermission: Permission;
64
+ export declare const catalogEntityRefreshPermission: ResourcePermission<"catalog-entity">;
57
65
 
58
66
  /**
59
67
  * This permission is used to designate actions that involve creating catalog
60
68
  * locations.
61
69
  * @alpha
62
70
  */
63
- export declare const catalogLocationCreatePermission: Permission;
71
+ export declare const catalogLocationCreatePermission: BasicPermission;
64
72
 
65
73
  /**
66
74
  * This permission is used to designate actions that involve deleting locations
67
75
  * from the catalog.
68
76
  * @alpha
69
77
  */
70
- export declare const catalogLocationDeletePermission: Permission;
78
+ export declare const catalogLocationDeletePermission: BasicPermission;
71
79
 
72
80
  /**
73
81
  * This permission is used to designate actions that involve reading one or more
@@ -77,7 +85,7 @@ export declare const catalogLocationDeletePermission: Permission;
77
85
  * not exist in the catalog — both in the frontend and in API responses.
78
86
  * @alpha
79
87
  */
80
- export declare const catalogLocationReadPermission: Permission;
88
+ export declare const catalogLocationReadPermission: BasicPermission;
81
89
 
82
90
  /**
83
91
  * Permission resource type which corresponds to catalog entities.
@@ -5,8 +5,9 @@
5
5
  * @packageDocumentation
6
6
  */
7
7
 
8
+ import { BasicPermission } from '@backstage/plugin-permission-common';
8
9
  import { IndexableDocument } from '@backstage/search-common';
9
- import { Permission } from '@backstage/plugin-permission-common';
10
+ import { ResourcePermission } from '@backstage/plugin-permission-common';
10
11
 
11
12
  /* Excluded from this release type: catalogEntityCreatePermission */
12
13
 
@@ -27,6 +28,8 @@ export declare interface CatalogEntityDocument extends IndexableDocument {
27
28
  owner: string;
28
29
  }
29
30
 
31
+ /* Excluded from this release type: CatalogEntityPermission */
32
+
30
33
  /* Excluded from this release type: catalogEntityReadPermission */
31
34
 
32
35
  /* Excluded from this release type: catalogEntityRefreshPermission */
package/dist/index.cjs.js CHANGED
@@ -2,52 +2,54 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var pluginPermissionCommon = require('@backstage/plugin-permission-common');
6
+
5
7
  const RESOURCE_TYPE_CATALOG_ENTITY = "catalog-entity";
6
- const catalogEntityReadPermission = {
8
+ const catalogEntityReadPermission = pluginPermissionCommon.createPermission({
7
9
  name: "catalog.entity.read",
8
10
  attributes: {
9
11
  action: "read"
10
12
  },
11
13
  resourceType: RESOURCE_TYPE_CATALOG_ENTITY
12
- };
13
- const catalogEntityCreatePermission = {
14
+ });
15
+ const catalogEntityCreatePermission = pluginPermissionCommon.createPermission({
14
16
  name: "catalog.entity.create",
15
17
  attributes: {
16
18
  action: "create"
17
19
  }
18
- };
19
- const catalogEntityDeletePermission = {
20
+ });
21
+ const catalogEntityDeletePermission = pluginPermissionCommon.createPermission({
20
22
  name: "catalog.entity.delete",
21
23
  attributes: {
22
24
  action: "delete"
23
25
  },
24
26
  resourceType: RESOURCE_TYPE_CATALOG_ENTITY
25
- };
26
- const catalogEntityRefreshPermission = {
27
+ });
28
+ const catalogEntityRefreshPermission = pluginPermissionCommon.createPermission({
27
29
  name: "catalog.entity.refresh",
28
30
  attributes: {
29
31
  action: "update"
30
32
  },
31
33
  resourceType: RESOURCE_TYPE_CATALOG_ENTITY
32
- };
33
- const catalogLocationReadPermission = {
34
+ });
35
+ const catalogLocationReadPermission = pluginPermissionCommon.createPermission({
34
36
  name: "catalog.location.read",
35
37
  attributes: {
36
38
  action: "read"
37
39
  }
38
- };
39
- const catalogLocationCreatePermission = {
40
+ });
41
+ const catalogLocationCreatePermission = pluginPermissionCommon.createPermission({
40
42
  name: "catalog.location.create",
41
43
  attributes: {
42
44
  action: "create"
43
45
  }
44
- };
45
- const catalogLocationDeletePermission = {
46
+ });
47
+ const catalogLocationDeletePermission = pluginPermissionCommon.createPermission({
46
48
  name: "catalog.location.delete",
47
49
  attributes: {
48
50
  action: "delete"
49
51
  }
50
- };
52
+ });
51
53
 
52
54
  exports.RESOURCE_TYPE_CATALOG_ENTITY = RESOURCE_TYPE_CATALOG_ENTITY;
53
55
  exports.catalogEntityCreatePermission = catalogEntityCreatePermission;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Permission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to catalog entities.\n *\n * {@link https://backstage.io/docs/features/software-catalog/software-catalog-overview}\n * @alpha\n */\nexport const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';\n\n/**\n * This permission is used to authorize actions that involve reading one or more\n * entities from the catalog.\n *\n * If this permission is not authorized, it will appear that the entity does not\n * exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogEntityReadPermission: Permission = {\n name: 'catalog.entity.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n};\n\n/**\n * This permission is used to authorize actions that involve creating a new\n * catalog entity. This includes registering an existing component into the\n * catalog.\n * @alpha\n */\nexport const catalogEntityCreatePermission: Permission = {\n name: 'catalog.entity.create',\n attributes: {\n action: 'create',\n },\n};\n\n/**\n * This permission is used to designate actions that involve removing one or\n * more entities from the catalog.\n * @alpha\n */\nexport const catalogEntityDeletePermission: Permission = {\n name: 'catalog.entity.delete',\n attributes: {\n action: 'delete',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n};\n\n/**\n * This permission is used to designate refreshing one or more entities from the\n * catalog.\n * @alpha\n */\nexport const catalogEntityRefreshPermission: Permission = {\n name: 'catalog.entity.refresh',\n attributes: {\n action: 'update',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n};\n\n/**\n * This permission is used to designate actions that involve reading one or more\n * locations from the catalog.\n *\n * If this permission is not authorized, it will appear that the location does\n * not exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogLocationReadPermission: Permission = {\n name: 'catalog.location.read',\n attributes: {\n action: 'read',\n },\n};\n\n/**\n * This permission is used to designate actions that involve creating catalog\n * locations.\n * @alpha\n */\nexport const catalogLocationCreatePermission: Permission = {\n name: 'catalog.location.create',\n attributes: {\n action: 'create',\n },\n};\n\n/**\n * This permission is used to designate actions that involve deleting locations\n * from the catalog.\n * @alpha\n */\nexport const catalogLocationDeletePermission: Permission = {\n name: 'catalog.location.delete',\n attributes: {\n action: 'delete',\n },\n};\n"],"names":[],"mappings":";;;;AAwBO,MAAM,4BAA+B,GAAA,iBAAA;AAUrC,MAAM,2BAA0C,GAAA;AAAA,EACrD,IAAM,EAAA,qBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,4BAAA;AAChB,EAAA;AAQO,MAAM,6BAA4C,GAAA;AAAA,EACvD,IAAM,EAAA,uBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AACF,EAAA;AAOO,MAAM,6BAA4C,GAAA;AAAA,EACvD,IAAM,EAAA,uBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,4BAAA;AAChB,EAAA;AAOO,MAAM,8BAA6C,GAAA;AAAA,EACxD,IAAM,EAAA,wBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,4BAAA;AAChB,EAAA;AAUO,MAAM,6BAA4C,GAAA;AAAA,EACvD,IAAM,EAAA,uBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AACF,EAAA;AAOO,MAAM,+BAA8C,GAAA;AAAA,EACzD,IAAM,EAAA,yBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AACF,EAAA;AAOO,MAAM,+BAA8C,GAAA;AAAA,EACzD,IAAM,EAAA,yBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AACF;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createPermission,\n ResourcePermission,\n} from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to catalog entities.\n *\n * {@link https://backstage.io/docs/features/software-catalog/software-catalog-overview}\n * @alpha\n */\nexport const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';\n\n/**\n * Convenience type for catalog entity\n * {@link @backstage/plugin-permission-common#ResourcePermission}s.\n * @alpha\n */\nexport type CatalogEntityPermission = ResourcePermission<\n typeof RESOURCE_TYPE_CATALOG_ENTITY\n>;\n\n/**\n * This permission is used to authorize actions that involve reading one or more\n * entities from the catalog.\n *\n * If this permission is not authorized, it will appear that the entity does not\n * exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogEntityReadPermission = createPermission({\n name: 'catalog.entity.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to authorize actions that involve creating a new\n * catalog entity. This includes registering an existing component into the\n * catalog.\n * @alpha\n */\nexport const catalogEntityCreatePermission = createPermission({\n name: 'catalog.entity.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to designate actions that involve removing one or\n * more entities from the catalog.\n * @alpha\n */\nexport const catalogEntityDeletePermission = createPermission({\n name: 'catalog.entity.delete',\n attributes: {\n action: 'delete',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to designate refreshing one or more entities from the\n * catalog.\n * @alpha\n */\nexport const catalogEntityRefreshPermission = createPermission({\n name: 'catalog.entity.refresh',\n attributes: {\n action: 'update',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to designate actions that involve reading one or more\n * locations from the catalog.\n *\n * If this permission is not authorized, it will appear that the location does\n * not exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogLocationReadPermission = createPermission({\n name: 'catalog.location.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to designate actions that involve creating catalog\n * locations.\n * @alpha\n */\nexport const catalogLocationCreatePermission = createPermission({\n name: 'catalog.location.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to designate actions that involve deleting locations\n * from the catalog.\n * @alpha\n */\nexport const catalogLocationDeletePermission = createPermission({\n name: 'catalog.location.delete',\n attributes: {\n action: 'delete',\n },\n});\n"],"names":["createPermission"],"mappings":";;;;;;AAGY,MAAC,4BAA4B,GAAG,iBAAiB;AACjD,MAAC,2BAA2B,GAAGA,uCAAgB,CAAC;AAC5D,EAAE,IAAI,EAAE,qBAAqB;AAC7B,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,MAAM;AAClB,GAAG;AACH,EAAE,YAAY,EAAE,4BAA4B;AAC5C,CAAC,EAAE;AACS,MAAC,6BAA6B,GAAGA,uCAAgB,CAAC;AAC9D,EAAE,IAAI,EAAE,uBAAuB;AAC/B,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,6BAA6B,GAAGA,uCAAgB,CAAC;AAC9D,EAAE,IAAI,EAAE,uBAAuB;AAC/B,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,EAAE,YAAY,EAAE,4BAA4B;AAC5C,CAAC,EAAE;AACS,MAAC,8BAA8B,GAAGA,uCAAgB,CAAC;AAC/D,EAAE,IAAI,EAAE,wBAAwB;AAChC,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,EAAE,YAAY,EAAE,4BAA4B;AAC5C,CAAC,EAAE;AACS,MAAC,6BAA6B,GAAGA,uCAAgB,CAAC;AAC9D,EAAE,IAAI,EAAE,uBAAuB;AAC/B,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,MAAM;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,+BAA+B,GAAGA,uCAAgB,CAAC;AAChE,EAAE,IAAI,EAAE,yBAAyB;AACjC,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,+BAA+B,GAAGA,uCAAgB,CAAC;AAChE,EAAE,IAAI,EAAE,yBAAyB;AACjC,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,CAAC;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -5,8 +5,9 @@
5
5
  * @packageDocumentation
6
6
  */
7
7
 
8
+ import { BasicPermission } from '@backstage/plugin-permission-common';
8
9
  import { IndexableDocument } from '@backstage/search-common';
9
- import { Permission } from '@backstage/plugin-permission-common';
10
+ import { ResourcePermission } from '@backstage/plugin-permission-common';
10
11
 
11
12
  /* Excluded from this release type: catalogEntityCreatePermission */
12
13
 
@@ -27,6 +28,8 @@ export declare interface CatalogEntityDocument extends IndexableDocument {
27
28
  owner: string;
28
29
  }
29
30
 
31
+ /* Excluded from this release type: CatalogEntityPermission */
32
+
30
33
  /* Excluded from this release type: catalogEntityReadPermission */
31
34
 
32
35
  /* Excluded from this release type: catalogEntityRefreshPermission */
package/dist/index.esm.js CHANGED
@@ -1,49 +1,51 @@
1
+ import { createPermission } from '@backstage/plugin-permission-common';
2
+
1
3
  const RESOURCE_TYPE_CATALOG_ENTITY = "catalog-entity";
2
- const catalogEntityReadPermission = {
4
+ const catalogEntityReadPermission = createPermission({
3
5
  name: "catalog.entity.read",
4
6
  attributes: {
5
7
  action: "read"
6
8
  },
7
9
  resourceType: RESOURCE_TYPE_CATALOG_ENTITY
8
- };
9
- const catalogEntityCreatePermission = {
10
+ });
11
+ const catalogEntityCreatePermission = createPermission({
10
12
  name: "catalog.entity.create",
11
13
  attributes: {
12
14
  action: "create"
13
15
  }
14
- };
15
- const catalogEntityDeletePermission = {
16
+ });
17
+ const catalogEntityDeletePermission = createPermission({
16
18
  name: "catalog.entity.delete",
17
19
  attributes: {
18
20
  action: "delete"
19
21
  },
20
22
  resourceType: RESOURCE_TYPE_CATALOG_ENTITY
21
- };
22
- const catalogEntityRefreshPermission = {
23
+ });
24
+ const catalogEntityRefreshPermission = createPermission({
23
25
  name: "catalog.entity.refresh",
24
26
  attributes: {
25
27
  action: "update"
26
28
  },
27
29
  resourceType: RESOURCE_TYPE_CATALOG_ENTITY
28
- };
29
- const catalogLocationReadPermission = {
30
+ });
31
+ const catalogLocationReadPermission = createPermission({
30
32
  name: "catalog.location.read",
31
33
  attributes: {
32
34
  action: "read"
33
35
  }
34
- };
35
- const catalogLocationCreatePermission = {
36
+ });
37
+ const catalogLocationCreatePermission = createPermission({
36
38
  name: "catalog.location.create",
37
39
  attributes: {
38
40
  action: "create"
39
41
  }
40
- };
41
- const catalogLocationDeletePermission = {
42
+ });
43
+ const catalogLocationDeletePermission = createPermission({
42
44
  name: "catalog.location.delete",
43
45
  attributes: {
44
46
  action: "delete"
45
47
  }
46
- };
48
+ });
47
49
 
48
50
  export { RESOURCE_TYPE_CATALOG_ENTITY, catalogEntityCreatePermission, catalogEntityDeletePermission, catalogEntityReadPermission, catalogEntityRefreshPermission, catalogLocationCreatePermission, catalogLocationDeletePermission, catalogLocationReadPermission };
49
51
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Permission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to catalog entities.\n *\n * {@link https://backstage.io/docs/features/software-catalog/software-catalog-overview}\n * @alpha\n */\nexport const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';\n\n/**\n * This permission is used to authorize actions that involve reading one or more\n * entities from the catalog.\n *\n * If this permission is not authorized, it will appear that the entity does not\n * exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogEntityReadPermission: Permission = {\n name: 'catalog.entity.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n};\n\n/**\n * This permission is used to authorize actions that involve creating a new\n * catalog entity. This includes registering an existing component into the\n * catalog.\n * @alpha\n */\nexport const catalogEntityCreatePermission: Permission = {\n name: 'catalog.entity.create',\n attributes: {\n action: 'create',\n },\n};\n\n/**\n * This permission is used to designate actions that involve removing one or\n * more entities from the catalog.\n * @alpha\n */\nexport const catalogEntityDeletePermission: Permission = {\n name: 'catalog.entity.delete',\n attributes: {\n action: 'delete',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n};\n\n/**\n * This permission is used to designate refreshing one or more entities from the\n * catalog.\n * @alpha\n */\nexport const catalogEntityRefreshPermission: Permission = {\n name: 'catalog.entity.refresh',\n attributes: {\n action: 'update',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n};\n\n/**\n * This permission is used to designate actions that involve reading one or more\n * locations from the catalog.\n *\n * If this permission is not authorized, it will appear that the location does\n * not exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogLocationReadPermission: Permission = {\n name: 'catalog.location.read',\n attributes: {\n action: 'read',\n },\n};\n\n/**\n * This permission is used to designate actions that involve creating catalog\n * locations.\n * @alpha\n */\nexport const catalogLocationCreatePermission: Permission = {\n name: 'catalog.location.create',\n attributes: {\n action: 'create',\n },\n};\n\n/**\n * This permission is used to designate actions that involve deleting locations\n * from the catalog.\n * @alpha\n */\nexport const catalogLocationDeletePermission: Permission = {\n name: 'catalog.location.delete',\n attributes: {\n action: 'delete',\n },\n};\n"],"names":[],"mappings":"AAwBO,MAAM,4BAA+B,GAAA,iBAAA;AAUrC,MAAM,2BAA0C,GAAA;AAAA,EACrD,IAAM,EAAA,qBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,4BAAA;AAChB,EAAA;AAQO,MAAM,6BAA4C,GAAA;AAAA,EACvD,IAAM,EAAA,uBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AACF,EAAA;AAOO,MAAM,6BAA4C,GAAA;AAAA,EACvD,IAAM,EAAA,uBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,4BAAA;AAChB,EAAA;AAOO,MAAM,8BAA6C,GAAA;AAAA,EACxD,IAAM,EAAA,wBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,4BAAA;AAChB,EAAA;AAUO,MAAM,6BAA4C,GAAA;AAAA,EACvD,IAAM,EAAA,uBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AACF,EAAA;AAOO,MAAM,+BAA8C,GAAA;AAAA,EACzD,IAAM,EAAA,yBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AACF,EAAA;AAOO,MAAM,+BAA8C,GAAA;AAAA,EACzD,IAAM,EAAA,yBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AACF;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createPermission,\n ResourcePermission,\n} from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to catalog entities.\n *\n * {@link https://backstage.io/docs/features/software-catalog/software-catalog-overview}\n * @alpha\n */\nexport const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';\n\n/**\n * Convenience type for catalog entity\n * {@link @backstage/plugin-permission-common#ResourcePermission}s.\n * @alpha\n */\nexport type CatalogEntityPermission = ResourcePermission<\n typeof RESOURCE_TYPE_CATALOG_ENTITY\n>;\n\n/**\n * This permission is used to authorize actions that involve reading one or more\n * entities from the catalog.\n *\n * If this permission is not authorized, it will appear that the entity does not\n * exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogEntityReadPermission = createPermission({\n name: 'catalog.entity.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to authorize actions that involve creating a new\n * catalog entity. This includes registering an existing component into the\n * catalog.\n * @alpha\n */\nexport const catalogEntityCreatePermission = createPermission({\n name: 'catalog.entity.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to designate actions that involve removing one or\n * more entities from the catalog.\n * @alpha\n */\nexport const catalogEntityDeletePermission = createPermission({\n name: 'catalog.entity.delete',\n attributes: {\n action: 'delete',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to designate refreshing one or more entities from the\n * catalog.\n * @alpha\n */\nexport const catalogEntityRefreshPermission = createPermission({\n name: 'catalog.entity.refresh',\n attributes: {\n action: 'update',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to designate actions that involve reading one or more\n * locations from the catalog.\n *\n * If this permission is not authorized, it will appear that the location does\n * not exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogLocationReadPermission = createPermission({\n name: 'catalog.location.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to designate actions that involve creating catalog\n * locations.\n * @alpha\n */\nexport const catalogLocationCreatePermission = createPermission({\n name: 'catalog.location.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to designate actions that involve deleting locations\n * from the catalog.\n * @alpha\n */\nexport const catalogLocationDeletePermission = createPermission({\n name: 'catalog.location.delete',\n attributes: {\n action: 'delete',\n },\n});\n"],"names":[],"mappings":";;AAGY,MAAC,4BAA4B,GAAG,iBAAiB;AACjD,MAAC,2BAA2B,GAAG,gBAAgB,CAAC;AAC5D,EAAE,IAAI,EAAE,qBAAqB;AAC7B,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,MAAM;AAClB,GAAG;AACH,EAAE,YAAY,EAAE,4BAA4B;AAC5C,CAAC,EAAE;AACS,MAAC,6BAA6B,GAAG,gBAAgB,CAAC;AAC9D,EAAE,IAAI,EAAE,uBAAuB;AAC/B,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,6BAA6B,GAAG,gBAAgB,CAAC;AAC9D,EAAE,IAAI,EAAE,uBAAuB;AAC/B,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,EAAE,YAAY,EAAE,4BAA4B;AAC5C,CAAC,EAAE;AACS,MAAC,8BAA8B,GAAG,gBAAgB,CAAC;AAC/D,EAAE,IAAI,EAAE,wBAAwB;AAChC,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,EAAE,YAAY,EAAE,4BAA4B;AAC5C,CAAC,EAAE;AACS,MAAC,6BAA6B,GAAG,gBAAgB,CAAC;AAC9D,EAAE,IAAI,EAAE,uBAAuB;AAC/B,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,MAAM;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,+BAA+B,GAAG,gBAAgB,CAAC;AAChE,EAAE,IAAI,EAAE,yBAAyB;AACjC,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,+BAA+B,GAAG,gBAAgB,CAAC;AAChE,EAAE,IAAI,EAAE,yBAAyB;AACjC,EAAE,UAAU,EAAE;AACd,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,CAAC;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-common",
3
3
  "description": "Common functionalities for the catalog plugin",
4
- "version": "1.0.1-next.0",
4
+ "version": "1.0.2-next.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -34,16 +34,16 @@
34
34
  "clean": "backstage-cli package clean"
35
35
  },
36
36
  "dependencies": {
37
- "@backstage/plugin-permission-common": "^0.5.3",
38
- "@backstage/search-common": "^0.3.3-next.0"
37
+ "@backstage/plugin-permission-common": "^0.6.1-next.0",
38
+ "@backstage/search-common": "^0.3.4-next.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@backstage/cli": "^0.16.1-next.0"
41
+ "@backstage/cli": "^0.17.1-next.2"
42
42
  },
43
43
  "files": [
44
44
  "dist",
45
45
  "alpha"
46
46
  ],
47
- "gitHead": "6bc4253672337538ce7ea5aadb3e9f60daeb3f80",
47
+ "gitHead": "cfbf5762d7d91eee18999306b21d63840400ee29",
48
48
  "module": "dist/index.esm.js"
49
49
  }