Merge: src/doc/commands: use filters
[nit.git] / src / doc / api / api_model.nit
index e2b3473..39d4305 100644 (file)
@@ -48,6 +48,18 @@ redef class APIRouter
                use("/catalog/person/:pid", new APICatalogPerson(config))
                use("/catalog/person/:pid/maintaining", new APICatalogMaintaining(config))
                use("/catalog/person/:pid/contributing", new APICatalogContributing(config))
+
+               use("/ini/desc/:id", new APIIniDesc(config))
+               use("/ini/git/:id", new APIIniGit(config))
+               use("/ini/clone/:id", new APIIniClone(config))
+               use("/ini/issues/:id", new APIIniIssues(config))
+               use("/ini/maintainer/:id", new APIIniMaintainer(config))
+               use("/ini/contributors/:id", new APIIniContributors(config))
+               use("/ini/license/:id", new APIIniLicense(config))
+               use("/ini/license-file/:id", new APIIniLicenseFile(config))
+               use("/ini/license-content/:id", new APIIniLicenseFileContent(config))
+               use("/ini/contrib-file/:id", new APIIniContribFile(config))
+               use("/ini/contrib-content/:id", new APIIniContribFileContent(config))
        end
 end
 
@@ -77,7 +89,7 @@ end
 class APIList
        super APICommand
 
-       redef fun command do return new CmdModelEntities(config.view)
+       redef fun command do return new CmdModelEntities(config.model)
 end
 
 # Return a random list of MEntities.
@@ -86,7 +98,7 @@ end
 class APIRandom
        super APICommand
 
-       redef fun command do return new CmdRandomEntities(config.view)
+       redef fun command do return new CmdRandomEntities(config.model)
 end
 
 # Search mentities from a cmd string.
@@ -95,7 +107,7 @@ end
 class APISearch
        super APIList
 
-       redef fun command do return new CmdCatalogSearch(config.view, config.catalog)
+       redef fun command do return new CmdCatalogSearch(config.model, config.catalog)
 end
 
 # CmdEntity
@@ -106,7 +118,7 @@ end
 class APIEntity
        super APICommand
 
-       redef fun command do return new CmdEntity(config.view)
+       redef fun command do return new CmdEntity(config.model)
 end
 
 # Return the full MDoc of a MEntity.
@@ -115,7 +127,7 @@ end
 class APIEntityDoc
        super APICommand
 
-       redef fun command do return new CmdComment(config.view)
+       redef fun command do return new CmdComment(config.model)
 end
 
 # List MEntity ancestors
@@ -124,7 +136,7 @@ end
 class APIEntityAncestors
        super APICommand
 
-       redef fun command do return new CmdAncestors(config.view)
+       redef fun command do return new CmdAncestors(config.model, config.mainmodule)
 end
 
 # List MEntity parents
@@ -133,7 +145,7 @@ end
 class APIEntityParents
        super APICommand
 
-       redef fun command do return new CmdParents(config.view)
+       redef fun command do return new CmdParents(config.model, config.mainmodule)
 end
 
 # List MEntity children
@@ -142,7 +154,7 @@ end
 class APIEntityChildren
        super APICommand
 
-       redef fun command do return new CmdChildren(config.view)
+       redef fun command do return new CmdChildren(config.model, config.mainmodule)
 end
 
 # List MEntity descendants
@@ -151,7 +163,7 @@ end
 class APIEntityDescendants
        super APICommand
 
-       redef fun command do return new CmdDescendants(config.view)
+       redef fun command do return new CmdDescendants(config.model, config.mainmodule)
 end
 
 # Linearize super definitions of a MClassDef or a MPropDef if any.
@@ -160,7 +172,7 @@ end
 class APIEntityLinearization
        super APICommand
 
-       redef fun command do return new CmdLinearization(config.view)
+       redef fun command do return new CmdLinearization(config.model, config.mainmodule)
 end
 
 # List definitions of a MEntity.
@@ -169,7 +181,7 @@ end
 class APIEntityDefs
        super APICommand
 
-       redef fun command do return new CmdFeatures(config.view)
+       redef fun command do return new CmdFeatures(config.model)
 end
 
 # List intro definitions of a MEntity.
@@ -178,7 +190,7 @@ end
 class APIEntityIntros
        super APICommand
 
-       redef fun command do return new CmdIntros(config.view)
+       redef fun command do return new CmdIntros(config.model, config.mainmodule)
 end
 
 # List redef definitions of a MEntity.
@@ -187,7 +199,7 @@ end
 class APIEntityRedefs
        super APICommand
 
-       redef fun command do return new CmdRedefs(config.view)
+       redef fun command do return new CmdRedefs(config.model, config.mainmodule)
 end
 
 # List all definitions accessible from a MEntity.
@@ -196,7 +208,7 @@ end
 class APIEntityAll
        super APICommand
 
-       redef fun command do return new CmdAllProps(config.view)
+       redef fun command do return new CmdAllProps(config.model, config.mainmodule)
 end
 
 # Return the source code of MEntity.
@@ -205,7 +217,7 @@ end
 class APIEntityCode
        super APICommand
 
-       redef fun command do return new CmdEntityCode(config.view, config.modelbuilder)
+       redef fun command do return new CmdEntityCode(config.model, config.modelbuilder)
 end
 
 # Return the UML diagram for MEntity.
@@ -214,7 +226,7 @@ end
 class APIEntityUML
        super APICommand
 
-       redef fun command do return new CmdUML(config.view)
+       redef fun command do return new CmdUML(config.model, config.mainmodule)
 end
 
 # Return the inheritance graph for MEntity.
@@ -223,7 +235,7 @@ end
 class APIInheritanceGraph
        super APICommand
 
-       redef fun command do return new CmdInheritanceGraph(config.view)
+       redef fun command do return new CmdInheritanceGraph(config.model, config.mainmodule)
 end
 
 # CmdCatalog
@@ -234,7 +246,7 @@ end
 class APICatalogPackages
        super APICommand
 
-       redef fun command do return new CmdCatalogPackages(config.view, config.catalog)
+       redef fun command do return new CmdCatalogPackages(config.model, config.catalog)
 end
 
 # Get the catalog statistics
@@ -243,7 +255,7 @@ end
 class APICatalogStats
        super APICommand
 
-       redef fun command do return new CmdCatalogStats(config.view, config.catalog)
+       redef fun command do return new CmdCatalogStats(config.model, config.catalog)
 end
 
 # Get the package metadata
@@ -252,7 +264,7 @@ end
 class APIEntityMetadata
        super APICommand
 
-       redef fun command do return new CmdMetadata(config.view)
+       redef fun command do return new CmdMetadata(config.model)
 end
 
 # Get all the tags from the catalog
@@ -261,7 +273,7 @@ end
 class APICatalogTags
        super APICommand
 
-       redef fun command do return new CmdCatalogTags(config.view, config.catalog)
+       redef fun command do return new CmdCatalogTags(config.model, config.catalog)
 end
 
 # Get the packages related to a tag
@@ -270,7 +282,7 @@ end
 class APICatalogTag
        super APICommand
 
-       redef fun command do return new CmdCatalogTag(config.view, config.catalog)
+       redef fun command do return new CmdCatalogTag(config.model, config.catalog)
 end
 
 # Get a person existing in the catalog
@@ -279,7 +291,7 @@ end
 class APICatalogPerson
        super APICommand
 
-       redef fun command do return new CmdCatalogPerson(config.view, config.catalog)
+       redef fun command do return new CmdCatalogPerson(config.model, config.catalog)
 end
 
 # Get the list of mpackages maintained by a person
@@ -288,7 +300,7 @@ end
 class APICatalogMaintaining
        super APICommand
 
-       redef fun command do return new CmdCatalogMaintaining(config.view, config.catalog)
+       redef fun command do return new CmdCatalogMaintaining(config.model, config.catalog)
 end
 
 # Get the list of mpackages contributed by a person
@@ -297,5 +309,106 @@ end
 class APICatalogContributing
        super APICommand
 
-       redef fun command do return new CmdCatalogContributing(config.view, config.catalog)
+       redef fun command do return new CmdCatalogContributing(config.model, config.catalog)
+end
+
+# CmdIni
+
+# Get the package description from the ini file
+#
+# `GET /ini/desc/:pid`: return the package description
+class APIIniDesc
+       super APICommand
+
+       redef fun command do return new CmdIniDescription(config.model)
+end
+
+# Get the package Git URL from the ini file
+#
+# `GET /ini/git/:pid`: return the package Git URL
+class APIIniGit
+       super APICommand
+
+       redef fun command do return new CmdIniGitUrl(config.model)
+end
+
+# Get the package Git clone command from the ini file
+#
+# `GET /ini/clone/:pid`: return the package Git clone command
+class APIIniClone
+       super APICommand
+
+       redef fun command do return new CmdIniCloneCommand(config.model)
+end
+
+# Get the package issues URL from the ini file
+#
+# `GET /ini/issues/:pid`: return the package issues URL
+class APIIniIssues
+       super APICommand
+
+       redef fun command do return new CmdIniIssuesUrl(config.model)
+end
+
+# Get the package maintainer from the ini file
+#
+# `GET /ini/maintainer/:pid`: return the package maintainer
+class APIIniMaintainer
+       super APICommand
+
+       redef fun command do return new CmdIniMaintainer(config.model)
+end
+
+# Get the package contributors from the ini file
+#
+# `GET /ini/clone/:pid`: return the package contributors
+class APIIniContributors
+       super APICommand
+
+       redef fun command do return new CmdIniContributors(config.model)
+end
+
+# Get the package license from the ini file
+#
+# `GET /ini/clone/:pid`: return the package license
+class APIIniLicense
+       super APICommand
+
+       redef fun command do return new CmdIniLicense(config.model)
+end
+
+# Get the package license file
+#
+# `GET /ini/license-file/:pid`: return the package license file
+class APIIniLicenseFile
+       super APICommand
+
+       redef fun command do return new CmdLicenseFile(config.model)
+end
+
+# Get the package contrib file
+#
+# `GET /ini/contrib-file/:pid`: return the package contrib file
+class APIIniContribFile
+       super APICommand
+
+       redef fun command do return new CmdContribFile(config.model)
+end
+
+# Get the package license file content
+#
+# `GET /ini/license-file/:pid`: return the package license file content
+class APIIniLicenseFileContent
+       super APICommand
+
+       redef fun command do return new CmdLicenseFileContent(config.model)
+end
+
+# Get the package contrib file content
+#
+# `GET /ini/contrib-file/:pid`: return the package contrib file content
+class APIIniContribFileContent
+       super APICommand
+
+       redef fun command do return new CmdContribFileContent(config.model)
 end