@backstage/plugin-catalog-common 0.1.1 → 0.1.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,11 @@
1
1
  # @backstage/plugin-catalog-common
2
2
 
3
+ ## 0.1.2-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - ba59832aed: Adds new `catalogEntityCreatePermission` which can be imported and used when authoring a permission policy to restrict/grant a user's access to the catalog import plugin. (And the "Register Existing Component" button which navigates there).
8
+
3
9
  ## 0.1.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -10,6 +10,13 @@ const catalogEntityReadPermission = {
10
10
  },
11
11
  resourceType: RESOURCE_TYPE_CATALOG_ENTITY
12
12
  };
13
+ const catalogEntityCreatePermission = {
14
+ name: "catalog.entity.create",
15
+ attributes: {
16
+ action: "create"
17
+ },
18
+ resourceType: RESOURCE_TYPE_CATALOG_ENTITY
19
+ };
13
20
  const catalogEntityDeletePermission = {
14
21
  name: "catalog.entity.delete",
15
22
  attributes: {
@@ -44,6 +51,7 @@ const catalogLocationDeletePermission = {
44
51
  };
45
52
 
46
53
  exports.RESOURCE_TYPE_CATALOG_ENTITY = RESOURCE_TYPE_CATALOG_ENTITY;
54
+ exports.catalogEntityCreatePermission = catalogEntityCreatePermission;
47
55
  exports.catalogEntityDeletePermission = catalogEntityDeletePermission;
48
56
  exports.catalogEntityReadPermission = catalogEntityReadPermission;
49
57
  exports.catalogEntityRefreshPermission = catalogEntityRefreshPermission;
@@ -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 * {@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 * 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};\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};\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};\n"],"names":[],"mappings":";;;;MAsBa,+BAA+B;MAU/B,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;MASC,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA;MASC,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA;;;;;;;;;;"}
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 * 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 authorize actions that involve creating a new\n * catalog entity. This includes registering an existing component into the\n * catalog.\n * @public\n */\nexport const catalogEntityCreatePermission: Permission = {\n name: 'catalog.entity.create',\n attributes: {\n action: 'create',\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};\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};\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};\n"],"names":[],"mappings":";;;;MAsBa,+BAA+B;MAU/B,8BAA0C;AAAA,EACrD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MASH,gCAA4C;AAAA,EACvD,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;MASC,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA;MASC,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -14,6 +14,13 @@ declare const RESOURCE_TYPE_CATALOG_ENTITY = "catalog-entity";
14
14
  * @public
15
15
  */
16
16
  declare const catalogEntityReadPermission: Permission;
17
+ /**
18
+ * This permission is used to authorize actions that involve creating a new
19
+ * catalog entity. This includes registering an existing component into the
20
+ * catalog.
21
+ * @public
22
+ */
23
+ declare const catalogEntityCreatePermission: Permission;
17
24
  /**
18
25
  * This permission is used to designate actions that involve removing one or
19
26
  * more entities from the catalog.
@@ -48,4 +55,4 @@ declare const catalogLocationCreatePermission: Permission;
48
55
  */
49
56
  declare const catalogLocationDeletePermission: Permission;
50
57
 
51
- export { RESOURCE_TYPE_CATALOG_ENTITY, catalogEntityDeletePermission, catalogEntityReadPermission, catalogEntityRefreshPermission, catalogLocationCreatePermission, catalogLocationDeletePermission, catalogLocationReadPermission };
58
+ export { RESOURCE_TYPE_CATALOG_ENTITY, catalogEntityCreatePermission, catalogEntityDeletePermission, catalogEntityReadPermission, catalogEntityRefreshPermission, catalogLocationCreatePermission, catalogLocationDeletePermission, catalogLocationReadPermission };
package/dist/index.esm.js CHANGED
@@ -6,6 +6,13 @@ const catalogEntityReadPermission = {
6
6
  },
7
7
  resourceType: RESOURCE_TYPE_CATALOG_ENTITY
8
8
  };
9
+ const catalogEntityCreatePermission = {
10
+ name: "catalog.entity.create",
11
+ attributes: {
12
+ action: "create"
13
+ },
14
+ resourceType: RESOURCE_TYPE_CATALOG_ENTITY
15
+ };
9
16
  const catalogEntityDeletePermission = {
10
17
  name: "catalog.entity.delete",
11
18
  attributes: {
@@ -39,5 +46,5 @@ const catalogLocationDeletePermission = {
39
46
  }
40
47
  };
41
48
 
42
- export { RESOURCE_TYPE_CATALOG_ENTITY, catalogEntityDeletePermission, catalogEntityReadPermission, catalogEntityRefreshPermission, catalogLocationCreatePermission, catalogLocationDeletePermission, catalogLocationReadPermission };
49
+ export { RESOURCE_TYPE_CATALOG_ENTITY, catalogEntityCreatePermission, catalogEntityDeletePermission, catalogEntityReadPermission, catalogEntityRefreshPermission, catalogLocationCreatePermission, catalogLocationDeletePermission, catalogLocationReadPermission };
43
50
  //# 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 * {@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 * 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};\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};\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};\n"],"names":[],"mappings":"MAsBa,+BAA+B;MAU/B,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;MASC,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA;MASC,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA;;;;"}
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 * 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 authorize actions that involve creating a new\n * catalog entity. This includes registering an existing component into the\n * catalog.\n * @public\n */\nexport const catalogEntityCreatePermission: Permission = {\n name: 'catalog.entity.create',\n attributes: {\n action: 'create',\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};\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};\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};\n"],"names":[],"mappings":"MAsBa,+BAA+B;MAU/B,8BAA0C;AAAA,EACrD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA,EAEV,cAAc;AAAA;MASH,gCAA4C;AAAA,EACvD,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;MASC,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA;MASC,kCAA8C;AAAA,EACzD,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA;AAAA;;;;"}
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": "0.1.1",
4
+ "version": "0.1.2-next.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -33,11 +33,11 @@
33
33
  "@backstage/plugin-permission-common": "^0.4.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@backstage/cli": "^0.12.0"
36
+ "@backstage/cli": "^0.13.1-next.1"
37
37
  },
38
38
  "files": [
39
39
  "dist"
40
40
  ],
41
- "gitHead": "600d6e3c854bbfb12a0078ca6f726d1c0d1fea0b",
41
+ "gitHead": "d6da97a1edeb21fcefc682d91916987ba9f3d89a",
42
42
  "module": "dist/index.esm.js"
43
43
  }