@backstage/plugin-catalog-common 0.0.0-nightly-202111172277

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 ADDED
@@ -0,0 +1,6 @@
1
+ # @backstage/plugin-catalog-common
2
+
3
+ ## 0.0.0-nightly-202111172277
4
+ ### Minor Changes
5
+
6
+ - 393f107893: Create catalog-common and add catalog permissions.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # Catalog Common
2
+
3
+ Shared isomorphic code for the catalog plugin.
4
+
5
+ ## Links
6
+
7
+ - [Frontend part of the plugin](https://github.com/backstage/backstage/tree/master/plugins/catalog)
8
+ - [Backend part of the plugin](https://github.com/backstage/backstage/tree/master/plugins/catalog-backend)
9
+ - [The Backstage homepage](https://backstage.io)
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const RESOURCE_TYPE_CATALOG_ENTITY = "catalog-entity";
6
+ const RESOURCE_TYPE_CATALOG_LOCATION = "catalog-location";
7
+ const catalogEntityReadPermission = {
8
+ name: "catalog.entity.read",
9
+ attributes: {
10
+ action: "read"
11
+ },
12
+ resourceType: RESOURCE_TYPE_CATALOG_ENTITY
13
+ };
14
+ const catalogEntityDeletePermission = {
15
+ name: "catalog.entity.delete",
16
+ attributes: {
17
+ action: "delete"
18
+ },
19
+ resourceType: RESOURCE_TYPE_CATALOG_ENTITY
20
+ };
21
+ const catalogEntityRefreshPermission = {
22
+ name: "catalog.entity.refresh",
23
+ attributes: {
24
+ action: "update"
25
+ },
26
+ resourceType: RESOURCE_TYPE_CATALOG_ENTITY
27
+ };
28
+ const catalogLocationReadPermission = {
29
+ name: "catalog.location.read",
30
+ attributes: {
31
+ action: "read"
32
+ },
33
+ resourceType: RESOURCE_TYPE_CATALOG_LOCATION
34
+ };
35
+ const catalogLocationCreatePermission = {
36
+ name: "catalog.location.create",
37
+ attributes: {
38
+ action: "create"
39
+ },
40
+ resourceType: RESOURCE_TYPE_CATALOG_LOCATION
41
+ };
42
+ const catalogLocationDeletePermission = {
43
+ name: "catalog.location.delete",
44
+ attributes: {
45
+ action: "delete"
46
+ },
47
+ resourceType: RESOURCE_TYPE_CATALOG_LOCATION
48
+ };
49
+
50
+ exports.RESOURCE_TYPE_CATALOG_ENTITY = RESOURCE_TYPE_CATALOG_ENTITY;
51
+ exports.RESOURCE_TYPE_CATALOG_LOCATION = RESOURCE_TYPE_CATALOG_LOCATION;
52
+ exports.catalogEntityDeletePermission = catalogEntityDeletePermission;
53
+ exports.catalogEntityReadPermission = catalogEntityReadPermission;
54
+ exports.catalogEntityRefreshPermission = catalogEntityRefreshPermission;
55
+ exports.catalogLocationCreatePermission = catalogLocationCreatePermission;
56
+ exports.catalogLocationDeletePermission = catalogLocationDeletePermission;
57
+ exports.catalogLocationReadPermission = catalogLocationReadPermission;
58
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +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 * {@link https://backstage.io/docs/features/software-catalog/software-catalog-overview}\n * @public\n */\nexport const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';\n\n/**\n * {@link https://backstage.io/docs/features/software-catalog/descriptor-format#kind-location}\n * @public\n */\nexport const RESOURCE_TYPE_CATALOG_LOCATION = 'catalog-location';\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 * @public\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 designate actions that involve removing one or\n * more entities from the catalog.\n * @public\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 * @public\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 * @public\n */\nexport const catalogLocationReadPermission: Permission = {\n name: 'catalog.location.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_CATALOG_LOCATION,\n};\n\n/**\n * This permission is used to designate actions that involve creating catalog\n * locations.\n * @public\n */\nexport const catalogLocationCreatePermission: Permission = {\n name: 'catalog.location.create',\n attributes: {\n action: 'create',\n },\n resourceType: RESOURCE_TYPE_CATALOG_LOCATION,\n};\n\n/**\n * This permission is used to designate actions that involve deleting locations\n * from the catalog.\n * @public\n */\nexport const catalogLocationDeletePermission: Permission = {\n name: 'catalog.location.delete',\n attributes: {\n action: 'delete',\n },\n resourceType: RESOURCE_TYPE_CATALOG_LOCATION,\n};\n"],"names":[],"mappings":";;;;MAsBa,+BAA+B;MAM/B,iCAAiC;MAUjC,8BAA0C;AAAA,EACrD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAQH,gCAA4C;AAAA,EACvD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAQH,iCAA6C;AAAA,EACxD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAWH,gCAA4C;AAAA,EACvD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAQH,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAQH,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;;;;;;;;;;;"}
@@ -0,0 +1,56 @@
1
+ import { Permission } from '@backstage/plugin-permission-common';
2
+
3
+ /**
4
+ * {@link https://backstage.io/docs/features/software-catalog/software-catalog-overview}
5
+ * @public
6
+ */
7
+ declare const RESOURCE_TYPE_CATALOG_ENTITY = "catalog-entity";
8
+ /**
9
+ * {@link https://backstage.io/docs/features/software-catalog/descriptor-format#kind-location}
10
+ * @public
11
+ */
12
+ declare const RESOURCE_TYPE_CATALOG_LOCATION = "catalog-location";
13
+ /**
14
+ * This permission is used to authorize actions that involve reading one or more
15
+ * entities from the catalog.
16
+ *
17
+ * If this permission is not authorized, it will appear that the entity does not
18
+ * exist in the catalog — both in the frontend and in API responses.
19
+ * @public
20
+ */
21
+ declare const catalogEntityReadPermission: Permission;
22
+ /**
23
+ * This permission is used to designate actions that involve removing one or
24
+ * more entities from the catalog.
25
+ * @public
26
+ */
27
+ declare const catalogEntityDeletePermission: Permission;
28
+ /**
29
+ * This permission is used to designate refreshing one or more entities from the
30
+ * catalog.
31
+ * @public
32
+ */
33
+ declare const catalogEntityRefreshPermission: Permission;
34
+ /**
35
+ * This permission is used to designate actions that involve reading one or more
36
+ * locations from the catalog.
37
+ *
38
+ * If this permission is not authorized, it will appear that the location does
39
+ * not exist in the catalog — both in the frontend and in API responses.
40
+ * @public
41
+ */
42
+ declare const catalogLocationReadPermission: Permission;
43
+ /**
44
+ * This permission is used to designate actions that involve creating catalog
45
+ * locations.
46
+ * @public
47
+ */
48
+ declare const catalogLocationCreatePermission: Permission;
49
+ /**
50
+ * This permission is used to designate actions that involve deleting locations
51
+ * from the catalog.
52
+ * @public
53
+ */
54
+ declare const catalogLocationDeletePermission: Permission;
55
+
56
+ export { RESOURCE_TYPE_CATALOG_ENTITY, RESOURCE_TYPE_CATALOG_LOCATION, catalogEntityDeletePermission, catalogEntityReadPermission, catalogEntityRefreshPermission, catalogLocationCreatePermission, catalogLocationDeletePermission, catalogLocationReadPermission };
@@ -0,0 +1,47 @@
1
+ const RESOURCE_TYPE_CATALOG_ENTITY = "catalog-entity";
2
+ const RESOURCE_TYPE_CATALOG_LOCATION = "catalog-location";
3
+ const catalogEntityReadPermission = {
4
+ name: "catalog.entity.read",
5
+ attributes: {
6
+ action: "read"
7
+ },
8
+ resourceType: RESOURCE_TYPE_CATALOG_ENTITY
9
+ };
10
+ const catalogEntityDeletePermission = {
11
+ name: "catalog.entity.delete",
12
+ attributes: {
13
+ action: "delete"
14
+ },
15
+ resourceType: RESOURCE_TYPE_CATALOG_ENTITY
16
+ };
17
+ const catalogEntityRefreshPermission = {
18
+ name: "catalog.entity.refresh",
19
+ attributes: {
20
+ action: "update"
21
+ },
22
+ resourceType: RESOURCE_TYPE_CATALOG_ENTITY
23
+ };
24
+ const catalogLocationReadPermission = {
25
+ name: "catalog.location.read",
26
+ attributes: {
27
+ action: "read"
28
+ },
29
+ resourceType: RESOURCE_TYPE_CATALOG_LOCATION
30
+ };
31
+ const catalogLocationCreatePermission = {
32
+ name: "catalog.location.create",
33
+ attributes: {
34
+ action: "create"
35
+ },
36
+ resourceType: RESOURCE_TYPE_CATALOG_LOCATION
37
+ };
38
+ const catalogLocationDeletePermission = {
39
+ name: "catalog.location.delete",
40
+ attributes: {
41
+ action: "delete"
42
+ },
43
+ resourceType: RESOURCE_TYPE_CATALOG_LOCATION
44
+ };
45
+
46
+ export { RESOURCE_TYPE_CATALOG_ENTITY, RESOURCE_TYPE_CATALOG_LOCATION, catalogEntityDeletePermission, catalogEntityReadPermission, catalogEntityRefreshPermission, catalogLocationCreatePermission, catalogLocationDeletePermission, catalogLocationReadPermission };
47
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +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 * {@link https://backstage.io/docs/features/software-catalog/software-catalog-overview}\n * @public\n */\nexport const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';\n\n/**\n * {@link https://backstage.io/docs/features/software-catalog/descriptor-format#kind-location}\n * @public\n */\nexport const RESOURCE_TYPE_CATALOG_LOCATION = 'catalog-location';\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 * @public\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 designate actions that involve removing one or\n * more entities from the catalog.\n * @public\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 * @public\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 * @public\n */\nexport const catalogLocationReadPermission: Permission = {\n name: 'catalog.location.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_CATALOG_LOCATION,\n};\n\n/**\n * This permission is used to designate actions that involve creating catalog\n * locations.\n * @public\n */\nexport const catalogLocationCreatePermission: Permission = {\n name: 'catalog.location.create',\n attributes: {\n action: 'create',\n },\n resourceType: RESOURCE_TYPE_CATALOG_LOCATION,\n};\n\n/**\n * This permission is used to designate actions that involve deleting locations\n * from the catalog.\n * @public\n */\nexport const catalogLocationDeletePermission: Permission = {\n name: 'catalog.location.delete',\n attributes: {\n action: 'delete',\n },\n resourceType: RESOURCE_TYPE_CATALOG_LOCATION,\n};\n"],"names":[],"mappings":"MAsBa,+BAA+B;MAM/B,iCAAiC;MAUjC,8BAA0C;AAAA,EACrD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAQH,gCAA4C;AAAA,EACvD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAQH,iCAA6C;AAAA,EACxD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAWH,gCAA4C;AAAA,EACvD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAQH,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MAQH,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;;;;"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@backstage/plugin-catalog-common",
3
+ "description": "Common functionalities for the catalog plugin",
4
+ "version": "0.0.0-nightly-202111172277",
5
+ "main": "dist/index.cjs.js",
6
+ "types": "dist/index.d.ts",
7
+ "license": "Apache-2.0",
8
+ "private": false,
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "main": "dist/index.cjs.js",
12
+ "module": "dist/index.esm.js",
13
+ "types": "dist/index.d.ts"
14
+ },
15
+ "homepage": "https://backstage.io",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/backstage/backstage",
19
+ "directory": "plugins/catalog-common"
20
+ },
21
+ "keywords": [
22
+ "backstage"
23
+ ],
24
+ "scripts": {
25
+ "build": "backstage-cli build",
26
+ "lint": "backstage-cli lint",
27
+ "test": "backstage-cli test --passWithNoTests",
28
+ "prepack": "backstage-cli prepack",
29
+ "postpack": "backstage-cli postpack",
30
+ "clean": "backstage-cli clean"
31
+ },
32
+ "dependencies": {
33
+ "@backstage/plugin-permission-common": "^0.2.0"
34
+ },
35
+ "devDependencies": {
36
+ "@backstage/cli": "^0.10.0"
37
+ },
38
+ "files": [
39
+ "dist"
40
+ ],
41
+ "module": "dist/index.esm.js"
42
+ }