Skip to content

Commit

Permalink
Merge branch 'master' into feat/no-backoffice-for-api
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinovega committed Feb 14, 2025
2 parents a60ae9f + be61ed0 commit 2d1132b
Show file tree
Hide file tree
Showing 80 changed files with 484 additions and 177 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -698,3 +698,9 @@ We'd like to thank all the contributors who worked on this release!
- Create a new categorie for API not working [#797](https://github.com/MAIF/daikoku/issues/797)
- API is no more visible after version deletion [#796](https://github.com/MAIF/daikoku/issues/796)

## [v18.1.3] - 2025-02-13

## :beetle: Bug Fixes

- restrictions could'nt enabled [#806](https://github.com/MAIF/daikoku/issues/806)

83 changes: 46 additions & 37 deletions daikoku/app/domain/CommonServices.scala
Original file line number Diff line number Diff line change
Expand Up @@ -537,59 +537,68 @@ object CommonServices {
}
}
def getAllTags(research: String)(implicit
ctx: DaikokuActionContext[_],
ctx: DaikokuActionContext[JsValue],
env: Env,
ec: ExecutionContext
): Future[Seq[String]] = {
for {
apis <- env.dataStore.apiRepo.forTenant(ctx.tenant.id).findAllNotDeleted()
visibleApis <- getVisibleApis(research = "", limit = -1, offset = 0)
} yield {
apis
.flatMap(api =>
api.tags.toSeq.filter(tag => tag.indexOf(research) != -1)
)
.foldLeft(Map.empty[String, Int])((map, tag) => {
val nbOfMatching = map.get(tag) match {
case Some(count) => count + 1
case None => 1
}
map + (tag -> nbOfMatching)

})
.toSeq
.sortBy(_._2)
.reverse
.map(a => a._1)
.take(5)
visibleApis
.map(apis =>
apis.apis
.flatMap(api =>
api.api.tags.toSeq.filter(tag => tag.indexOf(research) != -1)
)
.foldLeft(Map.empty[String, Int])((map, tag) => {
val nbOfMatching = map.get(tag) match {
case Some(count) => count + 1
case None => 1
}
map + (tag -> nbOfMatching)

})
.toSeq
.sortBy(_._2)
.reverse
.map(a => a._1)
.take(5)
)
.getOrElse(Seq.empty)
}
}

def getAllCategories(research: String)(implicit
ctx: DaikokuActionContext[_],
ctx: DaikokuActionContext[JsValue],
env: Env,
ec: ExecutionContext
): Future[Seq[String]] = {
for {
apis <- env.dataStore.apiRepo.forTenant(ctx.tenant.id).findAllNotDeleted()
visibleApis <- getVisibleApis(research = "", limit = -1, offset = 0)
} yield {
apis
.flatMap(api =>
api.categories.toSeq.filter(cat => cat.indexOf(research) != -1)
)
.foldLeft(Map.empty[String, Int])((map, cat) => {
val nbOfMatching = map.get(cat) match {
case Some(count) => count + 1
case None => 1
}
map + (cat -> nbOfMatching)
visibleApis
.map(apis =>
apis.apis
.flatMap(api =>
api.api.categories.toSeq.filter(tag =>
tag.indexOf(research) != -1
)
)
.foldLeft(Map.empty[String, Int])((map, cat) => {
val nbOfMatching = map.get(cat) match {
case Some(count) => count + 1
case None => 1
}
map + (cat -> nbOfMatching)

})
.toSeq
.sortBy(_._2)
.reverse
.map(a => a._1)
.take(5)
})
.toSeq
.sortBy(_._2)
.reverse
.map(a => a._1)
.take(5)
)
.getOrElse(Seq.empty)
}
}

Expand Down
4 changes: 2 additions & 2 deletions daikoku/javascript/src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@
"apikeys.view.api": "Voir l'API",
"apikeys.view.apikeys": "Voir les clés d'API",
"subscription.for": "Souscription à",
"subscription.create.at": "Souscription créée le %s\"",
"subscription.created.at": "Souscription créée le %s\"",
"subscription.valid.until": "valid until %s",
"subscription.nota.part.1": "Consultez la documentation",
"subscription.nota.part.2": "ou explorez",
Expand Down Expand Up @@ -1494,4 +1494,4 @@
"add.api.documention.btn.label": "Créer une première page de documentation",
"api.consumption.plan.btn.aria.label": "Voir la consommation du plan %s",
"api.consumption.plan.btn.label": "Voir la consommation"
}
}
4 changes: 2 additions & 2 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v3.6.2">
<title data-rh="true">Page Not Found | Daikoku</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://maif.github.io/daikoku/img/daikoku-mini.jpg"><meta data-rh="true" name="twitter:image" content="https://maif.github.io/daikoku/img/daikoku-mini.jpg"><meta data-rh="true" property="og:url" content="https://maif.github.io/daikoku/404.html"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="Page Not Found | Daikoku"><link data-rh="true" rel="icon" href="/daikoku/img/daikoku-mini.svg"><link data-rh="true" rel="canonical" href="https://maif.github.io/daikoku/404.html"><link data-rh="true" rel="alternate" href="https://maif.github.io/daikoku/404.html" hreflang="en"><link data-rh="true" rel="alternate" href="https://maif.github.io/daikoku/404.html" hreflang="x-default"><link rel="stylesheet" href="/daikoku/assets/css/styles.111e5321.css">
<script src="/daikoku/assets/js/runtime~main.ae94eb80.js" defer="defer"></script>
<script src="/daikoku/assets/js/main.8a66cc76.js" defer="defer"></script>
<script src="/daikoku/assets/js/runtime~main.6c7bde3f.js" defer="defer"></script>
<script src="/daikoku/assets/js/main.c935f2f7.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/daikoku/"><div class="navbar__logo"><img src="/daikoku/img/daikoku-mini-dark.svg" alt="Daikoku logo" class="header-logo themedComponent__dKv themedComponent--light_rzkv"><img src="/daikoku/img/daikoku-mini-dark.svg" alt="Daikoku logo" class="header-logo themedComponent__dKv themedComponent--dark_mMAk"></div><b class="navbar__title text--truncate">Daikoku</b></a><a class="navbar__item navbar__link" href="/daikoku/docs/getstarted/">Documentation</a><a class="navbar__item navbar__link" href="/daikoku/openapi">OpenAPI</a><a class="navbar__item navbar__link" href="/daikoku/docs/cli">CLI</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/maif/daikoku" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-github-link" aria-label="GitHub repository"></a><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite" aria-pressed="false"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="navbarSearchContainer_Bca1"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><main class="container margin-vert--xl"><div class="row"><div class="col col--6 col--offset-3"><h1 class="hero__title">Page Not Found</h1><p>We could not find what you were looking for.</p><p>Please contact the owner of the site that linked you to the original URL and let them know their link is broken.</p></div></div></main></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">MAIF</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://maif.github.io/" target="_blank" rel="noopener noreferrer" class="footer__link-item">OSS by MAIF</a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://discord.gg/vUP2eKYu" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/MAIF/daikoku" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://github.com/MAIF/daikoku/releases/latest" target="_blank" rel="noopener noreferrer" class="footer__link-item">Download<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div></div></footer></div>
Expand Down
4 changes: 2 additions & 2 deletions docs/__server/server.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3229,7 +3229,7 @@ function _createMdxContent(props) {
type: "danger",
children: (0,jsx_runtime.jsxs)(_components.p, {
children: ["Since ", (0,jsx_runtime.jsx)(_components.strong, {
children: "v18.1.2"
children: "v18.1.4"
}), ", Daikoku does not support MongoDB anymore. To run database migration, you need to be in ", (0,jsx_runtime.jsx)(_components.strong, {
children: "16.3.6 max"
}), "."]
Expand Down Expand Up @@ -36817,7 +36817,7 @@ var lunr_default = /*#__PURE__*/__webpack_require__.n(lunr);
var mark = __webpack_require__(689);
var mark_default = /*#__PURE__*/__webpack_require__.n(mark);
;// ./.docusaurus/@easyops-cn/docusaurus-search-local/default/generated.js
__webpack_require__(86121)((lunr_default()));(__webpack_require__(3397)/* .lunrLanguageZh */ .A)((lunr_default()));__webpack_require__(66106)((lunr_default()));const language=["en","zh"];const removeDefaultStopWordFilter=false;const removeDefaultStemmer=false;const searchIndexUrl="search-index{dir}.json?_=cb5a8ebd";const searchResultLimits=8;const searchResultContextMaxLength=50;const explicitSearchResultPath=true;const searchBarShortcut=true;const searchBarShortcutHint=true;const searchBarPosition="right";const docsPluginIdForPreferredVersion=undefined;const indexDocs=true;const searchContextByPaths=null;const hideSearchBarWithNoSearchContext=false;const useAllContextsWithNoSearchContext=false;
__webpack_require__(86121)((lunr_default()));(__webpack_require__(3397)/* .lunrLanguageZh */ .A)((lunr_default()));__webpack_require__(66106)((lunr_default()));const language=["en","zh"];const removeDefaultStopWordFilter=false;const removeDefaultStemmer=false;const searchIndexUrl="search-index{dir}.json?_=cea3c502";const searchResultLimits=8;const searchResultContextMaxLength=50;const explicitSearchResultPath=true;const searchBarShortcut=true;const searchBarShortcutHint=true;const searchBarPosition="right";const docsPluginIdForPreferredVersion=undefined;const indexDocs=true;const searchContextByPaths=null;const hideSearchBarWithNoSearchContext=false;const useAllContextsWithNoSearchContext=false;
;// ./node_modules/@easyops-cn/docusaurus-search-local/dist/client/client/utils/proxiedGenerated.js
// This file is auto generated while building.

Expand Down
1 change: 1 addition & 0 deletions docs/assets/js/b277a811.764e7e02.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2d1132b

Please sign in to comment.