periplus-map 0.2.1__py3-none-any.whl

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.
Files changed (272) hide show
  1. periplus/__init__.py +70 -0
  2. periplus/checkmap.py +80 -0
  3. periplus/cli.py +658 -0
  4. periplus/contract/schema/map.schema.json +138 -0
  5. periplus/contract/schema/navigation.schema.json +200 -0
  6. periplus/contract/schema/pack-file.schema.json +1405 -0
  7. periplus/contract/schema/pack-manifest.schema.json +245 -0
  8. periplus/contract/schema/project-settings.schema.json +85 -0
  9. periplus/contract/spec/engine.md +151 -0
  10. periplus/contract/spec/rules.md +352 -0
  11. periplus/detect.py +228 -0
  12. periplus/engine/__init__.py +5 -0
  13. periplus/engine/check.py +481 -0
  14. periplus/engine/emit.py +368 -0
  15. periplus/engine/packload.py +2321 -0
  16. periplus/engine/pattern.py +27 -0
  17. periplus/engine/rules.py +1946 -0
  18. periplus/engine/select.py +491 -0
  19. periplus/engine/source.py +172 -0
  20. periplus/engine/tree.py +424 -0
  21. periplus/errors.py +332 -0
  22. periplus/init.py +358 -0
  23. periplus/layout.py +28 -0
  24. periplus/manifest.py +498 -0
  25. periplus/map.py +364 -0
  26. periplus/navigate/__init__.py +1 -0
  27. periplus/navigate/find.py +143 -0
  28. periplus/navigate/ids.py +30 -0
  29. periplus/navigate/listing.py +42 -0
  30. periplus/navigate/mapfile.py +189 -0
  31. periplus/navigate/path.py +175 -0
  32. periplus/navigate/show.py +175 -0
  33. periplus/navigate/types.py +83 -0
  34. periplus/navigate/walk.py +138 -0
  35. periplus/packs/advancedqueue_basic@0.0.1/pack.yaml +14 -0
  36. periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type.yaml +9 -0
  37. periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type_annotation.yaml +43 -0
  38. periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type_attribute.yaml +43 -0
  39. periplus/packs/ai_basic@0.0.1/ai_agent/ai_agent.yaml +8 -0
  40. periplus/packs/ai_basic@0.0.1/ai_agent/ai_agent_attribute.yaml +43 -0
  41. periplus/packs/ai_basic@0.0.1/ai_function_call/ai_function_call.yaml +8 -0
  42. periplus/packs/ai_basic@0.0.1/ai_function_call/ai_function_call_attribute.yaml +43 -0
  43. periplus/packs/ai_basic@0.0.1/pack.yaml +15 -0
  44. periplus/packs/config_pages_basic@0.0.1/bundle/config_pages_bundle_config.yaml +54 -0
  45. periplus/packs/config_pages_basic@0.0.1/pack.yaml +11 -0
  46. periplus/packs/crop_basic@0.0.1/bundle/crop_bundle_config.yaml +54 -0
  47. periplus/packs/crop_basic@0.0.1/pack.yaml +11 -0
  48. periplus/packs/drupal@0.1.0/block/block_placement.yaml +25 -0
  49. periplus/packs/drupal@0.1.0/block/block_placement_code.yaml +58 -0
  50. periplus/packs/drupal@0.1.0/block/block_placement_config.yaml +53 -0
  51. periplus/packs/drupal@0.1.0/block/block_plugin.yaml +52 -0
  52. periplus/packs/drupal@0.1.0/block/block_plugin_altered.yaml +61 -0
  53. periplus/packs/drupal@0.1.0/block/block_plugin_annotation.yaml +69 -0
  54. periplus/packs/drupal@0.1.0/block/block_plugin_attribute.yaml +56 -0
  55. periplus/packs/drupal@0.1.0/block/block_plugin_content.yaml +46 -0
  56. periplus/packs/drupal@0.1.0/block/block_plugin_derived.yaml +110 -0
  57. periplus/packs/drupal@0.1.0/block/block_plugin_deriver.yaml +30 -0
  58. periplus/packs/drupal@0.1.0/block/block_type.yaml +14 -0
  59. periplus/packs/drupal@0.1.0/block/block_type_code.yaml +43 -0
  60. periplus/packs/drupal@0.1.0/block/block_type_config.yaml +45 -0
  61. periplus/packs/drupal@0.1.0/cache/cache.yaml +18 -0
  62. periplus/packs/drupal@0.1.0/cache/cache_backend.yaml +31 -0
  63. periplus/packs/drupal@0.1.0/component/sdc.yaml +19 -0
  64. periplus/packs/drupal@0.1.0/component/sdc_definition.yaml +25 -0
  65. periplus/packs/drupal@0.1.0/component/sdc_use.yaml +25 -0
  66. periplus/packs/drupal@0.1.0/config/config_object.yaml +65 -0
  67. periplus/packs/drupal@0.1.0/display/display.yaml +32 -0
  68. periplus/packs/drupal@0.1.0/display/display_code.yaml +53 -0
  69. periplus/packs/drupal@0.1.0/display/display_config.yaml +95 -0
  70. periplus/packs/drupal@0.1.0/entity/entity.yaml +33 -0
  71. periplus/packs/drupal@0.1.0/entity/entity_class.yaml +60 -0
  72. periplus/packs/drupal@0.1.0/entity/entity_save.yaml +27 -0
  73. periplus/packs/drupal@0.1.0/entity/entity_type_annotation.yaml +85 -0
  74. periplus/packs/drupal@0.1.0/entity/entity_type_attribute.yaml +76 -0
  75. periplus/packs/drupal@0.1.0/field/field_instance_code.yaml +40 -0
  76. periplus/packs/drupal@0.1.0/field/field_instance_config.yaml +58 -0
  77. periplus/packs/drupal@0.1.0/field/field_storage.yaml +37 -0
  78. periplus/packs/drupal@0.1.0/field/field_storage_code.yaml +39 -0
  79. periplus/packs/drupal@0.1.0/field/field_storage_config.yaml +24 -0
  80. periplus/packs/drupal@0.1.0/form/form.yaml +48 -0
  81. periplus/packs/drupal@0.1.0/form/form_class.yaml +50 -0
  82. periplus/packs/drupal@0.1.0/form/form_id.yaml +48 -0
  83. periplus/packs/drupal@0.1.0/form/form_methods.yaml +39 -0
  84. periplus/packs/drupal@0.1.0/hook/hook.yaml +8 -0
  85. periplus/packs/drupal@0.1.0/hook/hook_attribute.yaml +28 -0
  86. periplus/packs/drupal@0.1.0/module/module.yaml +8 -0
  87. periplus/packs/drupal@0.1.0/module/module_info.yaml +50 -0
  88. periplus/packs/drupal@0.1.0/pack.yaml +184 -0
  89. periplus/packs/drupal@0.1.0/plugin/plugin.yaml +17 -0
  90. periplus/packs/drupal@0.1.0/plugin/plugin_annotation.yaml +120 -0
  91. periplus/packs/drupal@0.1.0/recommendations/recommendations.yaml +14 -0
  92. periplus/packs/drupal@0.1.0/service/service.yaml +19 -0
  93. periplus/packs/drupal@0.1.0/service/service_autowire.yaml +28 -0
  94. periplus/packs/drupal@0.1.0/service/service_definition.yaml +24 -0
  95. periplus/packs/drupal@0.1.0/service/service_use.yaml +43 -0
  96. periplus/packs/drupal_basic@0.3.0/action/action.yaml +9 -0
  97. periplus/packs/drupal_basic@0.3.0/action/action_annotation.yaml +43 -0
  98. periplus/packs/drupal_basic@0.3.0/action/action_attribute.yaml +43 -0
  99. periplus/packs/drupal_basic@0.3.0/block/block_placement.yaml +16 -0
  100. periplus/packs/drupal_basic@0.3.0/block/block_placement_config.yaml +51 -0
  101. periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin.yaml +14 -0
  102. periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin_annotation.yaml +47 -0
  103. periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin_attribute.yaml +43 -0
  104. periplus/packs/drupal_basic@0.3.0/block_type/block_type.yaml +8 -0
  105. periplus/packs/drupal_basic@0.3.0/block_type/block_type_config.yaml +54 -0
  106. periplus/packs/drupal_basic@0.3.0/boundary/boundary_types.yaml +19 -0
  107. periplus/packs/drupal_basic@0.3.0/bundle/bundle.yaml +20 -0
  108. periplus/packs/drupal_basic@0.3.0/bundle/bundle_config.yaml +393 -0
  109. periplus/packs/drupal_basic@0.3.0/call/call.yaml +349 -0
  110. periplus/packs/drupal_basic@0.3.0/component/component.yaml +30 -0
  111. periplus/packs/drupal_basic@0.3.0/config/config_object.yaml +119 -0
  112. periplus/packs/drupal_basic@0.3.0/constraint/constraint.yaml +8 -0
  113. periplus/packs/drupal_basic@0.3.0/constraint/constraint_annotation.yaml +43 -0
  114. periplus/packs/drupal_basic@0.3.0/constraint/constraint_attribute.yaml +43 -0
  115. periplus/packs/drupal_basic@0.3.0/display/display.yaml +30 -0
  116. periplus/packs/drupal_basic@0.3.0/display/display_config.yaml +203 -0
  117. periplus/packs/drupal_basic@0.3.0/display/display_mode_config.yaml +60 -0
  118. periplus/packs/drupal_basic@0.3.0/entity_type/config_entity_type_annotation.yaml +46 -0
  119. periplus/packs/drupal_basic@0.3.0/entity_type/config_entity_type_attribute.yaml +43 -0
  120. periplus/packs/drupal_basic@0.3.0/entity_type/content_entity_type_annotation.yaml +46 -0
  121. periplus/packs/drupal_basic@0.3.0/entity_type/content_entity_type_attribute.yaml +43 -0
  122. periplus/packs/drupal_basic@0.3.0/entity_type/entity_type.yaml +16 -0
  123. periplus/packs/drupal_basic@0.3.0/field/field_instance_config.yaml +116 -0
  124. periplus/packs/drupal_basic@0.3.0/field/field_storage.yaml +21 -0
  125. periplus/packs/drupal_basic@0.3.0/field/field_storage_config.yaml +45 -0
  126. periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter.yaml +8 -0
  127. periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter_annotation.yaml +46 -0
  128. periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter_attribute.yaml +43 -0
  129. periplus/packs/drupal_basic@0.3.0/field_type/field_type_annotation.yaml +46 -0
  130. periplus/packs/drupal_basic@0.3.0/field_type/field_type_attribute.yaml +50 -0
  131. periplus/packs/drupal_basic@0.3.0/field_widget/field_widget_annotation.yaml +46 -0
  132. periplus/packs/drupal_basic@0.3.0/field_widget/field_widget_attribute.yaml +50 -0
  133. periplus/packs/drupal_basic@0.3.0/form/form_id.yaml +80 -0
  134. periplus/packs/drupal_basic@0.3.0/hook/hook.yaml +100 -0
  135. periplus/packs/drupal_basic@0.3.0/hook/hook_attribute.yaml +64 -0
  136. periplus/packs/drupal_basic@0.3.0/hook/hook_theme_include.yaml +34 -0
  137. periplus/packs/drupal_basic@0.3.0/library/library.yaml +12 -0
  138. periplus/packs/drupal_basic@0.3.0/library/library_definition.yaml +58 -0
  139. periplus/packs/drupal_basic@0.3.0/local_action/local_action.yaml +12 -0
  140. periplus/packs/drupal_basic@0.3.0/local_action/local_action_definition.yaml +49 -0
  141. periplus/packs/drupal_basic@0.3.0/mail/mail.yaml +8 -0
  142. periplus/packs/drupal_basic@0.3.0/mail/mail_attribute.yaml +43 -0
  143. periplus/packs/drupal_basic@0.3.0/media_source/media_source.yaml +8 -0
  144. periplus/packs/drupal_basic@0.3.0/media_source/media_source_annotation.yaml +43 -0
  145. periplus/packs/drupal_basic@0.3.0/media_source/media_source_attribute.yaml +79 -0
  146. periplus/packs/drupal_basic@0.3.0/menu_link/menu_link.yaml +18 -0
  147. periplus/packs/drupal_basic@0.3.0/menu_link/menu_link_definition.yaml +48 -0
  148. periplus/packs/drupal_basic@0.3.0/module/module.yaml +7 -0
  149. periplus/packs/drupal_basic@0.3.0/module/module_info.yaml +58 -0
  150. periplus/packs/drupal_basic@0.3.0/pack.yaml +528 -0
  151. periplus/packs/drupal_basic@0.3.0/permission/permission.yaml +7 -0
  152. periplus/packs/drupal_basic@0.3.0/permission/permission_definition.yaml +27 -0
  153. periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker.yaml +9 -0
  154. periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker_annotation.yaml +43 -0
  155. periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker_attribute.yaml +43 -0
  156. periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource.yaml +8 -0
  157. periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource_annotation.yaml +43 -0
  158. periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource_attribute.yaml +43 -0
  159. periplus/packs/drupal_basic@0.3.0/role/role.yaml +14 -0
  160. periplus/packs/drupal_basic@0.3.0/role/role_config.yaml +44 -0
  161. periplus/packs/drupal_basic@0.3.0/route/route.yaml +42 -0
  162. periplus/packs/drupal_basic@0.3.0/route/route_definition.yaml +113 -0
  163. periplus/packs/drupal_basic@0.3.0/route/route_options.yaml +55 -0
  164. periplus/packs/drupal_basic@0.3.0/route/route_requirements.yaml +108 -0
  165. periplus/packs/drupal_basic@0.3.0/service/service.yaml +56 -0
  166. periplus/packs/drupal_basic@0.3.0/service/service_definition.yaml +181 -0
  167. periplus/packs/drupal_basic@0.3.0/template/template.yaml +86 -0
  168. periplus/packs/drupal_basic@0.3.0/template/template_route_link.yaml +30 -0
  169. periplus/packs/drupal_basic@0.3.0/theme/theme.yaml +15 -0
  170. periplus/packs/drupal_basic@0.3.0/theme/theme_info.yaml +61 -0
  171. periplus/packs/drupal_basic@0.3.0/theme_hook/template_suggestion.yaml +29 -0
  172. periplus/packs/drupal_basic@0.3.0/theme_hook/theme_hook.yaml +87 -0
  173. periplus/packs/drupal_basic@0.3.0/theme_hook/theme_hook_render.yaml +20 -0
  174. periplus/packs/drupal_basic@0.3.0/url/url.yaml +88 -0
  175. periplus/packs/drupal_basic@0.3.0/views_plugin/views_field_attribute.yaml +80 -0
  176. periplus/packs/drupal_basic@0.3.0/views_plugin/views_filter_attribute.yaml +80 -0
  177. periplus/packs/drupal_basic@0.3.0/views_plugin/views_plugin.yaml +15 -0
  178. periplus/packs/drupal_basic@0.3.0/views_plugin/views_style_attribute.yaml +80 -0
  179. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment.yaml +12 -0
  180. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_php.yaml +15 -0
  181. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_php_array.yaml +52 -0
  182. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_twig.yaml +26 -0
  183. periplus/packs/drupal_js_basic@0.0.1/attachment/php_function_holder.yaml +13 -0
  184. periplus/packs/drupal_js_basic@0.0.1/behavior/behavior.yaml +198 -0
  185. periplus/packs/drupal_js_basic@0.0.1/pack.yaml +153 -0
  186. periplus/packs/drupal_js_basic@0.0.1/setting/setting.yaml +13 -0
  187. periplus/packs/drupal_js_basic@0.0.1/setting/setting_in_js.yaml +15 -0
  188. periplus/packs/drupal_js_basic@0.0.1/setting/setting_in_php.yaml +92 -0
  189. periplus/packs/drush_basic@0.0.1/command/command.yaml +15 -0
  190. periplus/packs/drush_basic@0.0.1/command/command_annotation.yaml +60 -0
  191. periplus/packs/drush_basic@0.0.1/command/command_attribute.yaml +88 -0
  192. periplus/packs/drush_basic@0.0.1/pack.yaml +29 -0
  193. periplus/packs/eck_basic@0.0.1/bundle/eck_bundle_config.yaml +56 -0
  194. periplus/packs/eck_basic@0.0.1/entity_type/eck_entity_type_config.yaml +26 -0
  195. periplus/packs/eck_basic@0.0.1/pack.yaml +28 -0
  196. periplus/packs/go@0.0.2/interfaces/satisfies.yaml +47 -0
  197. periplus/packs/go@0.0.2/pack.yaml +51 -0
  198. periplus/packs/go@0.0.2/types/find_declarations.yaml +137 -0
  199. periplus/packs/go@0.0.2/types/node_types.yaml +36 -0
  200. periplus/packs/go_basic@0.0.3/pack.yaml +104 -0
  201. periplus/packs/go_basic@0.0.3/rules/calls.yaml +25 -0
  202. periplus/packs/go_basic@0.0.3/rules/declarations.yaml +40 -0
  203. periplus/packs/go_basic@0.0.3/rules/imports.yaml +16 -0
  204. periplus/packs/go_basic@0.0.3/types/node_types.yaml +15 -0
  205. periplus/packs/js_basic@0.0.1/function/function.yaml +68 -0
  206. periplus/packs/js_basic@0.0.1/pack.yaml +50 -0
  207. periplus/packs/laravel_basic@0.0.5/pack.yaml +313 -0
  208. periplus/packs/laravel_basic@0.0.5/rules/classes.yaml +42 -0
  209. periplus/packs/laravel_basic@0.0.5/rules/config.yaml +229 -0
  210. periplus/packs/laravel_basic@0.0.5/rules/routes.yaml +210 -0
  211. periplus/packs/laravel_basic@0.0.5/rules/types.yaml +50 -0
  212. periplus/packs/laravel_basic@0.0.5/rules/views.yaml +100 -0
  213. periplus/packs/paragraphs_basic@0.0.1/bundle/paragraph_bundle_config.yaml +54 -0
  214. periplus/packs/paragraphs_basic@0.0.1/pack.yaml +12 -0
  215. periplus/packs/php@0.1.0/edges/edge_kinds.yaml +64 -0
  216. periplus/packs/php@0.1.0/edges/find_calls.yaml +34 -0
  217. periplus/packs/php@0.1.0/edges/find_imports.yaml +18 -0
  218. periplus/packs/php@0.1.0/edges/find_member_access.yaml +22 -0
  219. periplus/packs/php@0.1.0/edges/find_structure.yaml +38 -0
  220. periplus/packs/php@0.1.0/embedded/embedded_regions.yaml +19 -0
  221. periplus/packs/php@0.1.0/imports/imports.yaml +20 -0
  222. periplus/packs/php@0.1.0/pack.yaml +117 -0
  223. periplus/packs/php@0.1.0/resolution/excluded_tokens.yaml +23 -0
  224. periplus/packs/php@0.1.0/resolution/resolution.yaml +35 -0
  225. periplus/packs/php@0.1.0/types/find_declarations.yaml +102 -0
  226. periplus/packs/php@0.1.0/types/node_types.yaml +55 -0
  227. periplus/packs/php_basic@0.2.0/edges/edge_kinds.yaml +48 -0
  228. periplus/packs/php_basic@0.2.0/edges/find_structure.yaml +750 -0
  229. periplus/packs/php_basic@0.2.0/imports/imports.yaml +19 -0
  230. periplus/packs/php_basic@0.2.0/pack.yaml +94 -0
  231. periplus/packs/php_basic@0.2.0/types/find_declarations.yaml +267 -0
  232. periplus/packs/php_basic@0.2.0/types/node_types.yaml +55 -0
  233. periplus/packs/profile_basic@0.0.1/bundle/profile_bundle_config.yaml +54 -0
  234. periplus/packs/profile_basic@0.0.1/pack.yaml +12 -0
  235. periplus/packs/salesforce_basic@0.0.1/event/salesforce_event.yaml +36 -0
  236. periplus/packs/salesforce_basic@0.0.1/pack.yaml +31 -0
  237. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping/salesforce_mapping.yaml +19 -0
  238. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping/salesforce_mapping_config.yaml +83 -0
  239. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping_field/salesforce_mapping_field.yaml +8 -0
  240. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping_field/salesforce_mapping_field_annotation.yaml +43 -0
  241. periplus/packs/twig@0.0.1/pack.yaml +26 -0
  242. periplus/packs/twig@0.0.1/types/template.yaml +57 -0
  243. periplus/packs/twig_basic@0.1.0/pack.yaml +11 -0
  244. periplus/packs/twig_tweak_basic@0.0.1/pack.yaml +27 -0
  245. periplus/packs/twig_tweak_basic@0.0.1/rules/block.yaml +20 -0
  246. periplus/packs/twig_tweak_basic@0.0.1/rules/entity.yaml +35 -0
  247. periplus/packs/twig_tweak_basic@0.0.1/rules/field.yaml +21 -0
  248. periplus/packs/twig_tweak_basic@0.0.1/rules/menu.yaml +21 -0
  249. periplus/packs/webform_basic@0.0.1/bundle/webform_submission_bundle_config.yaml +54 -0
  250. periplus/packs/webform_basic@0.0.1/pack.yaml +20 -0
  251. periplus/packs/webform_basic@0.0.1/webform_handler/webform_handler.yaml +8 -0
  252. periplus/packs/webform_basic@0.0.1/webform_handler/webform_handler_annotation.yaml +43 -0
  253. periplus/packs/yaml@0.0.1/pack.yaml +72 -0
  254. periplus/packs/yaml@0.0.1/types/find_mapping_entry.yaml +21 -0
  255. periplus/packs/yaml@0.0.1/types/yaml_types.yaml +44 -0
  256. periplus/packs/yaml_basic@0.1.0/pack.yaml +10 -0
  257. periplus/packs.py +447 -0
  258. periplus/preflight.py +102 -0
  259. periplus/py.typed +0 -0
  260. periplus/report.py +596 -0
  261. periplus/resolution.py +355 -0
  262. periplus/settings.py +617 -0
  263. periplus/settings.stub.yml +99 -0
  264. periplus/spec.py +774 -0
  265. periplus/update.py +197 -0
  266. periplus/validate.py +655 -0
  267. periplus_map-0.2.1.dist-info/METADATA +566 -0
  268. periplus_map-0.2.1.dist-info/RECORD +272 -0
  269. periplus_map-0.2.1.dist-info/WHEEL +4 -0
  270. periplus_map-0.2.1.dist-info/entry_points.txt +2 -0
  271. periplus_map-0.2.1.dist-info/licenses/LICENSE +202 -0
  272. periplus_map-0.2.1.dist-info/licenses/NOTICE +2 -0
@@ -0,0 +1,43 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A REST resource plugin declared by the RestResource docblock annotation on its class. Two rules
4
+ # because a rule that emits an edge emits no node. An id that is not text in double quotes makes no
5
+ # plugin and is listed under skipped in the map report.
6
+
7
+ rules:
8
+ - rule: rest_resource_from_annotation
9
+ reads: file
10
+ in:
11
+ - rest_resource_classes
12
+ match:
13
+ annotation: RestResource
14
+ filetype: php
15
+ where:
16
+ - applies_to: class_declaration
17
+ id:
18
+ from:
19
+ annotation_key: id
20
+ must_be: string_literal
21
+ emits:
22
+ - node:
23
+ type: drupal.rest_resource
24
+ confidence: declared
25
+ - rule: rest_resource_from_annotation_edges
26
+ reads: file
27
+ in:
28
+ - rest_resource_classes
29
+ match:
30
+ annotation: RestResource
31
+ filetype: php
32
+ where:
33
+ - applies_to: class_declaration
34
+ id:
35
+ from:
36
+ annotation_key: id
37
+ must_be: string_literal
38
+ emits:
39
+ - edge:
40
+ kind: plugin_class
41
+ from: this_node
42
+ to: enclosing_class
43
+ confidence: declared
@@ -0,0 +1,43 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A REST resource plugin declared by the RestResource attribute on its class, the twin of the
4
+ # annotation rule. Two rules because a rule that emits an edge emits no node. An id that is not a
5
+ # text literal makes no plugin and is listed under skipped.
6
+
7
+ rules:
8
+ - rule: rest_resource_from_attribute
9
+ reads: file
10
+ in:
11
+ - rest_resource_classes
12
+ match:
13
+ attribute: Drupal\rest\Attribute\RestResource
14
+ filetype: php
15
+ where:
16
+ - applies_to: class_declaration
17
+ id:
18
+ from:
19
+ attribute_argument: id
20
+ must_be: string_literal
21
+ emits:
22
+ - node:
23
+ type: drupal.rest_resource
24
+ confidence: declared
25
+ - rule: rest_resource_from_attribute_edges
26
+ reads: file
27
+ in:
28
+ - rest_resource_classes
29
+ match:
30
+ attribute: Drupal\rest\Attribute\RestResource
31
+ filetype: php
32
+ where:
33
+ - applies_to: class_declaration
34
+ id:
35
+ from:
36
+ attribute_argument: id
37
+ must_be: string_literal
38
+ emits:
39
+ - edge:
40
+ kind: plugin_class
41
+ from: this_node
42
+ to: enclosing_class
43
+ confidence: declared
@@ -0,0 +1,14 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # The configuration of a user role, and each permission it grants. It refines
4
+ # drupal.config_object, so it lands on the node the config-file rule finds. A permission no mapped
5
+ # file declares, such as one from core or a contributed module, ends at a referenced node.
6
+
7
+ node_types:
8
+ - name: drupal.role
9
+ parent: drupal.config_object
10
+
11
+ edge_kinds:
12
+ - kind: grants_permission
13
+ from: drupal.role
14
+ to: drupal.permission
@@ -0,0 +1,44 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A role read from its config file, user.role.<role>, and one grants_permission edge per entry of
4
+ # its permissions list, each cited at its entry's line. Two rules because a rule that emits an edge
5
+ # emits no node.
6
+
7
+ rules:
8
+ - rule: role_from_config
9
+ reads: file
10
+ in:
11
+ - config
12
+ - module_config
13
+ match:
14
+ file: user.role.*
15
+ filetype: yaml
16
+ id:
17
+ from: file_stem
18
+ emits:
19
+ - node:
20
+ type: drupal.role
21
+ - attribute:
22
+ name: is_admin
23
+ from:
24
+ key: is_admin
25
+ confidence: declared
26
+ - rule: role_from_config_edges
27
+ reads: file
28
+ in:
29
+ - config
30
+ - module_config
31
+ match:
32
+ file: user.role.*
33
+ filetype: yaml
34
+ id:
35
+ from: file_stem
36
+ emits:
37
+ - edge:
38
+ kind: grants_permission
39
+ from: this_node
40
+ to:
41
+ from:
42
+ key: permissions
43
+ each: true
44
+ confidence: declared
@@ -0,0 +1,42 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A route, named by its key in a routing file, and the PHP method or form class that answers it. A
4
+ # route requires a permission or a role it needs, and accepts each of permissions or roles any one
5
+ # of which lets in. A route's title comes from a PHP method, its access from a service or a PHP
6
+ # method, and a parameter's value is loaded as an entity of an entity type.
7
+
8
+ node_types:
9
+ - name: drupal.route
10
+ id_namespace: drupal.route
11
+
12
+ edge_kinds:
13
+ - kind: requires_permission
14
+ from: drupal.route
15
+ to: drupal.permission
16
+ - kind: accepts_permission
17
+ from: drupal.route
18
+ to: drupal.permission
19
+ - kind: handled_by
20
+ from: drupal.route
21
+ to: php.method
22
+ - kind: uses_form
23
+ from: drupal.route
24
+ to: php.class
25
+ - kind: titled_by
26
+ from: drupal.route
27
+ to: php.method
28
+ - kind: requires_role
29
+ from: drupal.route
30
+ to: drupal.role
31
+ - kind: accepts_role
32
+ from: drupal.route
33
+ to: drupal.role
34
+ - kind: access_checked_by_service
35
+ from: drupal.route
36
+ to: drupal.service
37
+ - kind: access_checked_by
38
+ from: drupal.route
39
+ to: php.method
40
+ - kind: loads_entity_type
41
+ from: drupal.route
42
+ to: drupal.entity_type
@@ -0,0 +1,113 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A route read from a routing file, one per top-level key that has a path. Two rules because a
4
+ # rule that emits an edge emits no node. The key route_callbacks is a list, not a route, and has no
5
+ # path. A route's _permission joins permissions with a comma (all needed), read first, or with a
6
+ # plus sign (any one); each permission between them is one edge, without the spaces around it: a
7
+ # requires_permission edge, or an accepts_permission edge for a value with a plus sign and no
8
+ # comma. The first branch of each pattern takes the whole of a value that is not its own and names
9
+ # no permission, so that value gives the edge kind nothing. A _controller written Class::method is
10
+ # handled_by that method; one written service:method names a service and makes no edge. A
11
+ # _title_callback written Class::method is titled_by that method. A leading backslash is dropped
12
+ # from a class name. A route serves its path as written, a route_serves_path edge to the
13
+ # drupal.url_path node that url/url.yaml joins links to.
14
+
15
+ rules:
16
+ - rule: route_from_routing_file
17
+ reads: file
18
+ in:
19
+ - module_root
20
+ match:
21
+ file: '*.routing'
22
+ filetype: yaml
23
+ each: '*'
24
+ where:
25
+ - has_key:
26
+ path: path
27
+ id:
28
+ from: key
29
+ emits:
30
+ - node:
31
+ type: drupal.route
32
+ - attribute:
33
+ name: path
34
+ from:
35
+ key: path
36
+ - attribute:
37
+ name: controller
38
+ from:
39
+ key: defaults._controller
40
+ - attribute:
41
+ name: form
42
+ from:
43
+ key: defaults._form
44
+ - attribute:
45
+ name: title
46
+ from:
47
+ key: defaults._title
48
+ confidence: declared
49
+ - rule: route_from_routing_file_edges
50
+ reads: file
51
+ in:
52
+ - module_root
53
+ match:
54
+ file: '*.routing'
55
+ filetype: yaml
56
+ each: '*'
57
+ where:
58
+ - has_key:
59
+ path: path
60
+ id:
61
+ from: key
62
+ emits:
63
+ - edge:
64
+ kind: requires_permission
65
+ from: this_node
66
+ to:
67
+ from:
68
+ key: requirements._permission
69
+ each: true
70
+ pattern: '^[^,]*\+[^,]*$|(?<permission>[^,\s](?:[^,]*[^,\s])?)'
71
+ template: '{permission}'
72
+ - edge:
73
+ kind: accepts_permission
74
+ from: this_node
75
+ to:
76
+ from:
77
+ key: requirements._permission
78
+ each: true
79
+ where:
80
+ - matches: '*+*'
81
+ pattern: '.*,.*|(?<permission>[^+\s](?:[^+]*[^+\s])?)'
82
+ template: '{permission}'
83
+ - edge:
84
+ kind: handled_by
85
+ from: this_node
86
+ to:
87
+ from:
88
+ key: defaults._controller
89
+ pattern: '^\\?(?<method>[^\\:][^:]*::[^:]+)$'
90
+ template: '{method}'
91
+ - edge:
92
+ kind: titled_by
93
+ from: this_node
94
+ to:
95
+ from:
96
+ key: defaults._title_callback
97
+ pattern: '^\\?(?<method>[^\\:][^:]*::[^:]+)$'
98
+ template: '{method}'
99
+ - edge:
100
+ kind: uses_form
101
+ from: this_node
102
+ to:
103
+ from:
104
+ key: defaults._form
105
+ pattern: '^\\?(?<form>[^\\].*)$'
106
+ template: '{form}'
107
+ - edge:
108
+ kind: route_serves_path
109
+ from: this_node
110
+ to:
111
+ from:
112
+ key: path
113
+ confidence: declared
@@ -0,0 +1,55 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A route's options, read from the routing file. Two rules because a rule that emits an edge emits
4
+ # no node. A route parameter whose type is entity:<type> is converted to an entity of that type, a
5
+ # loads_entity_type edge; any other parameter type names no entity type and gives no edge.
6
+
7
+ rules:
8
+ - rule: route_options_from_routing_file
9
+ reads: file
10
+ in:
11
+ - module_root
12
+ match:
13
+ file: '*.routing'
14
+ filetype: yaml
15
+ each: '*'
16
+ where:
17
+ - has_key:
18
+ path: path
19
+ id:
20
+ from: key
21
+ emits:
22
+ - node:
23
+ type: drupal.route
24
+ - attribute:
25
+ name: no_cache
26
+ from:
27
+ key: options.no_cache
28
+ - attribute:
29
+ name: admin_route
30
+ from:
31
+ key: options._admin_route
32
+ confidence: declared
33
+ - rule: route_options_from_routing_file_edges
34
+ reads: file
35
+ in:
36
+ - module_root
37
+ match:
38
+ file: '*.routing'
39
+ filetype: yaml
40
+ each: '*'
41
+ where:
42
+ - has_key:
43
+ path: path
44
+ id:
45
+ from: key
46
+ emits:
47
+ - edge:
48
+ kind: loads_entity_type
49
+ from: this_node
50
+ to:
51
+ from:
52
+ key: options.parameters.*.type
53
+ pattern: '^entity:(?<entity_type>.+)$'
54
+ template: '{entity_type}'
55
+ confidence: declared
@@ -0,0 +1,108 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A route's methods and its access requirements, read from the routing file. Two rules because a
4
+ # rule that emits an edge emits no node. A requirement that is only a value is an attribute. A
5
+ # route's _role joins roles as _permission joins permissions: with a comma (all needed), read
6
+ # first, or with a plus sign (any one); each role is one edge to the role's configuration,
7
+ # user.role.<role>, a requires_role edge, or an accepts_role edge for a value with a plus sign and
8
+ # no comma. A _custom_access written service:method is access_checked_by_service that service; one
9
+ # written Class::method is access_checked_by that method. The whole value stays in the attribute
10
+ # custom_access. A leading backslash is dropped from a class name.
11
+
12
+ rules:
13
+ - rule: route_requirements_from_routing_file
14
+ reads: file
15
+ in:
16
+ - module_root
17
+ match:
18
+ file: '*.routing'
19
+ filetype: yaml
20
+ each: '*'
21
+ where:
22
+ - has_key:
23
+ path: path
24
+ id:
25
+ from: key
26
+ emits:
27
+ - node:
28
+ type: drupal.route
29
+ - attribute:
30
+ name: methods
31
+ from:
32
+ key: methods
33
+ - attribute:
34
+ name: access
35
+ from:
36
+ key: requirements._access
37
+ - attribute:
38
+ name: format
39
+ from:
40
+ key: requirements._format
41
+ - attribute:
42
+ name: user_is_logged_in
43
+ from:
44
+ key: requirements._user_is_logged_in
45
+ - attribute:
46
+ name: csrf_token
47
+ from:
48
+ key: requirements._csrf_token
49
+ - attribute:
50
+ name: entity_access
51
+ from:
52
+ key: requirements._entity_access
53
+ - attribute:
54
+ name: custom_access
55
+ from:
56
+ key: requirements._custom_access
57
+ confidence: declared
58
+ - rule: route_requirements_from_routing_file_edges
59
+ reads: file
60
+ in:
61
+ - module_root
62
+ match:
63
+ file: '*.routing'
64
+ filetype: yaml
65
+ each: '*'
66
+ where:
67
+ - has_key:
68
+ path: path
69
+ id:
70
+ from: key
71
+ emits:
72
+ - edge:
73
+ kind: requires_role
74
+ from: this_node
75
+ to:
76
+ from:
77
+ key: requirements._role
78
+ each: true
79
+ pattern: '^[^,]*\+[^,]*$|(?<role>[^,\s](?:[^,]*[^,\s])?)'
80
+ template: 'user.role.{role}'
81
+ - edge:
82
+ kind: accepts_role
83
+ from: this_node
84
+ to:
85
+ from:
86
+ key: requirements._role
87
+ each: true
88
+ where:
89
+ - matches: '*+*'
90
+ pattern: '.*,.*|(?<role>[^+\s](?:[^+]*[^+\s])?)'
91
+ template: 'user.role.{role}'
92
+ - edge:
93
+ kind: access_checked_by_service
94
+ from: this_node
95
+ to:
96
+ from:
97
+ key: requirements._custom_access
98
+ pattern: '^(?<service>[^\\:][^:]*):[^:]+$'
99
+ template: '{service}'
100
+ - edge:
101
+ kind: access_checked_by
102
+ from: this_node
103
+ to:
104
+ from:
105
+ key: requirements._custom_access
106
+ pattern: '^\\?(?<method>[^\\:][^:]*::[^:]+)$'
107
+ template: '{method}'
108
+ confidence: declared
@@ -0,0 +1,56 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A service, named by its key in a services file, a tag a service carries, and the PHP class that
4
+ # implements a service. service_class ends at a class or an interface, because a service built by a
5
+ # factory may name an interface under class.
6
+
7
+ node_types:
8
+ - name: drupal.service
9
+ id_namespace: drupal.service
10
+ - name: drupal.service_tag
11
+ id_namespace: drupal.service_tag
12
+
13
+ edge_kinds:
14
+ - kind: injects_service
15
+ from: drupal.service
16
+ to: drupal.service
17
+ - kind: extends_service
18
+ from: drupal.service
19
+ to: drupal.service
20
+ - kind: alias_of_service
21
+ from: drupal.service
22
+ to: drupal.service
23
+ - kind: tagged_as
24
+ from: drupal.service
25
+ to: drupal.service_tag
26
+ - kind: service_class
27
+ from: drupal.service
28
+ to: [php.class, php.interface]
29
+
30
+ # A call site $this->helper->run() to Helper::run, when the call's class or its nearest ancestor
31
+ # that declares the property assigns it $this->helper = \Drupal::service('my_module.helper') and
32
+ # a services file gives that service its class. php_basic's calls_through_assigned_property reads
33
+ # the same chain up to the assignment's value. The id is read in single or double quotes; the
34
+ # edge runs from the method around the call, at the call's line. Inferred: the services file, not
35
+ # the call, names the class.
36
+ rules:
37
+ - rule: calls_through_service_property
38
+ reads: map
39
+ match:
40
+ node_type: php.call_site
41
+ where: [{id_matches: '^php\.call_site::(?<site>(?<class>[^:]+)::[^:]+::\$this->(?<member>\w+)->(?<method>\w+))$'}]
42
+ follow:
43
+ - node: 'php.type::{class}'
44
+ - ancestors: [inherits]
45
+ - id_matches: '^php\.type::(?<owner>.+)$'
46
+ - node: 'php.property::{owner}::${member}'
47
+ - node: 'php.member_assignment::{owner}::$this->{member}'
48
+ - edge: assigned_value
49
+ - id_matches: '=\\?Drupal::service\(["''](?<service>[^"'']+)["'']\)$'
50
+ - node: 'drupal.service::{service}'
51
+ - edge: service_class
52
+ - id_matches: '^php\.type::(?<type>.+)$'
53
+ - node: 'php.call_site::{site}'
54
+ - edge: call_site_in
55
+ emits: [{edge: {kind: calls, from: matched_node, to: {template: "{type}::{method}", types: [php.method], on_miss: unresolved}}}]
56
+ confidence: inferred
@@ -0,0 +1,181 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A service read from a services file, one per key under services. Two rules because a rule that
4
+ # emits an edge emits no node. The key _defaults holds settings for the file, not a service, and
5
+ # id_matches leaves it out. An argument names a service when it is written @name or @?name; the
6
+ # arguments may be a list or a mapping of names. The class key names the service's PHP class; a
7
+ # leading backslash is dropped. An entry whose whole value is @name, or whose alias key is not
8
+ # null, is an alias of the service it names and has no class, so an alias in either form is read
9
+ # by its own node rule, which reads no class. An entry whose key holds a backslash and that has no
10
+ # class key is a service of the class its key names, unless it is an alias. An access_check tag's
11
+ # applies_to, the route requirement key the checker answers, is kept as an attribute of the
12
+ # service, because an attribute on the tagged_as edge is accepted and not executed.
13
+
14
+ rules:
15
+ - rule: service_from_services_file
16
+ reads: file
17
+ in:
18
+ - module_root
19
+ match:
20
+ file: '*.services'
21
+ filetype: yaml
22
+ each: services.*
23
+ where:
24
+ - id_matches: ^[^_]
25
+ - key:
26
+ name: alias
27
+ equals: null
28
+ - is_mapping: true
29
+ id:
30
+ from: key
31
+ emits:
32
+ - node:
33
+ type: drupal.service
34
+ - attribute:
35
+ name: class
36
+ from:
37
+ key: class
38
+ - attribute:
39
+ name: applies_to
40
+ from:
41
+ key: tags.*.applies_to
42
+ confidence: declared
43
+ - rule: service_alias_from_services_file
44
+ reads: file
45
+ in:
46
+ - module_root
47
+ match:
48
+ file: '*.services'
49
+ filetype: yaml
50
+ each: services.*
51
+ where:
52
+ - id_matches: ^[^_]
53
+ - key:
54
+ name: alias
55
+ not_equals: null
56
+ id:
57
+ from: key
58
+ emits:
59
+ - node:
60
+ type: drupal.service
61
+ confidence: declared
62
+ - rule: service_text_alias_from_services_file
63
+ reads: file
64
+ in:
65
+ - module_root
66
+ match:
67
+ file: '*.services'
68
+ filetype: yaml
69
+ each: services.*
70
+ where:
71
+ - id_matches: ^[^_]
72
+ - is_mapping: false
73
+ id:
74
+ from: key
75
+ emits:
76
+ - node:
77
+ type: drupal.service
78
+ confidence: declared
79
+ - rule: service_from_services_file_edges
80
+ reads: file
81
+ in:
82
+ - module_root
83
+ match:
84
+ file: '*.services'
85
+ filetype: yaml
86
+ each: services.*
87
+ where:
88
+ - id_matches: ^[^_]
89
+ id:
90
+ from: key
91
+ emits:
92
+ - edge:
93
+ kind: injects_service
94
+ from: this_node
95
+ to:
96
+ from:
97
+ key: arguments
98
+ each: true
99
+ pattern: '^@\??(?<service>[^@=].*)$'
100
+ template: '{service}'
101
+ - edge:
102
+ kind: extends_service
103
+ from: this_node
104
+ to:
105
+ from:
106
+ key: parent
107
+ - edge:
108
+ kind: alias_of_service
109
+ from: this_node
110
+ to:
111
+ from:
112
+ key: alias
113
+ pattern: '^@?(?<service>.+)$'
114
+ template: '{service}'
115
+ - edge:
116
+ kind: alias_of_service
117
+ from: this_node
118
+ to:
119
+ from: text
120
+ pattern: '^@(?<service>.+)$'
121
+ template: '{service}'
122
+ - edge:
123
+ kind: tagged_as
124
+ from: this_node
125
+ to:
126
+ from:
127
+ key: tags.*.name
128
+ confidence: declared
129
+ - rule: service_from_services_file_class
130
+ reads: file
131
+ in:
132
+ - module_root
133
+ match:
134
+ file: '*.services'
135
+ filetype: yaml
136
+ each: services.*
137
+ where:
138
+ - id_matches: ^[^_]
139
+ - key:
140
+ name: alias
141
+ equals: null
142
+ id:
143
+ from: key
144
+ emits:
145
+ - edge:
146
+ kind: service_class
147
+ from: this_node
148
+ to:
149
+ from:
150
+ key: class
151
+ pattern: '^\\?(?<class>[^\\].*)$'
152
+ template: '{class}'
153
+ confidence: declared
154
+ - rule: service_from_services_file_class_key
155
+ reads: file
156
+ in:
157
+ - module_root
158
+ match:
159
+ file: '*.services'
160
+ filetype: yaml
161
+ each: services.*
162
+ where:
163
+ - id_matches: \\
164
+ - key:
165
+ name: class
166
+ equals: null
167
+ - key:
168
+ name: alias
169
+ equals: null
170
+ - is_mapping: true
171
+ id:
172
+ from: key
173
+ emits:
174
+ - edge:
175
+ kind: service_class
176
+ from: this_node
177
+ to:
178
+ from:
179
+ - key
180
+ template: '{key}'
181
+ confidence: declared