Skip to content

Commit

Permalink
Merge pull request #2526 from kuzzleio/2-dev
Browse files Browse the repository at this point in the history
2 dev
  • Loading branch information
rolljee authored Mar 13, 2024
2 parents 7ba9e6e + 8f029a3 commit c9fea20
Show file tree
Hide file tree
Showing 29 changed files with 299 additions and 1,065 deletions.
1 change: 1 addition & 0 deletions docker/scripts/start-kuzzle-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ app.hook.register("custom:event", async (name) => {
let syncedHello = "World";
let dynamicPipeId;

app.openApi.definition.components = {}
app.openApi.definition.components.LogisticObjects = {
Item: {
type: "object",
Expand Down
2 changes: 0 additions & 2 deletions features/ServerController.feature
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ Feature: Server Controller
When I successfully execute the action "server":"openapi"
Then I should receive a response matching:
| swagger | "2.0" |
| components.RequestPayload | "_OBJECT_" |
| paths./users/{_id}/_replace.put.tags[0] | "security" |

@http
Expand All @@ -87,7 +86,6 @@ Feature: Server Controller
| scope | "app" |
Then I should receive a response matching:
| paths./openapi-test/{company}/{objectType}/{_id}.post.tags[0] | "openapi-test" |
| components.LogisticObjects.Item | "_OBJECT_" |

# server:publicApi ========================================================================
@development @http
Expand Down
29 changes: 0 additions & 29 deletions lib/api/httpRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@

"use strict";

const {
OpenApiDocumentCount,
OpenApiDocumentDeleteByQuery,
OpenApiDocumentDelete,
OpenApiDocumentScroll,
OpenApiDocumentExists,
OpenApiDocumentUpdate,
OpenApiDocumentReplace,
OpenApiDocumentGet,
OpenApiDocumentCreate,
OpenApiDocumentCreateOrReplace,
OpenApiDocumentValidate,
OpenApiSecurityUpsertUser,
OpenApiDocumentmCreateOrReplace,
} = require("./openapi/components");

const routes = [
// GET (idempotent)
{ verb: "get", path: "/_me", controller: "auth", action: "getCurrentUser" },
Expand Down Expand Up @@ -242,7 +226,6 @@ const routes = [
path: "/:index/:collection/:_id",
controller: "document",
action: "get",
openapi: OpenApiDocumentGet,
},
{
verb: "get",
Expand All @@ -255,7 +238,6 @@ const routes = [
path: "/:index/:collection/:_id/_exists",
controller: "document",
action: "exists",
openapi: OpenApiDocumentExists,
},
{
verb: "post",
Expand All @@ -268,7 +250,6 @@ const routes = [
path: "/_scroll/:scrollId",
controller: "document",
action: "scroll",
openapi: OpenApiDocumentScroll,
},

{
Expand Down Expand Up @@ -770,14 +751,12 @@ const routes = [
path: "/:index/:collection/_count",
controller: "document",
action: "count",
openapi: OpenApiDocumentCount,
},
{
verb: "post",
path: "/:index/:collection/_create",
controller: "document",
action: "create",
openapi: OpenApiDocumentCreate,
},
{
verb: "post",
Expand Down Expand Up @@ -832,7 +811,6 @@ const routes = [
path: "/:index/:collection/_validate",
controller: "document",
action: "validate",
openapi: OpenApiDocumentValidate,
},

{
Expand Down Expand Up @@ -955,7 +933,6 @@ const routes = [
path: "/users/:_id/_upsert",
controller: "security",
action: "upsertUser",
openapi: OpenApiSecurityUpsertUser,
},
{
verb: "post",
Expand Down Expand Up @@ -1241,7 +1218,6 @@ const routes = [
path: "/:index/:collection/:_id",
controller: "document",
action: "delete",
openapi: OpenApiDocumentDelete,
},
{
verb: "delete",
Expand All @@ -1254,7 +1230,6 @@ const routes = [
path: "/:index/:collection/_query",
controller: "document",
action: "deleteByQuery",
openapi: OpenApiDocumentDeleteByQuery,
},
{
verb: "delete",
Expand Down Expand Up @@ -1421,21 +1396,18 @@ const routes = [
path: "/:index/:collection/:_id",
controller: "document",
action: "createOrReplace",
openapi: OpenApiDocumentCreateOrReplace,
},
{
verb: "put",
path: "/:index/:collection/_mCreateOrReplace",
controller: "document",
action: "mCreateOrReplace",
openapi: OpenApiDocumentmCreateOrReplace,
},
{
verb: "put",
path: "/:index/:collection/:_id/_replace",
controller: "document",
action: "replace",
openapi: OpenApiDocumentReplace,
},
{
verb: "put",
Expand All @@ -1458,7 +1430,6 @@ const routes = [
path: "/:index/:collection/:_id/_update",
controller: "document",
action: "update",
openapi: OpenApiDocumentUpdate,
deprecated: {
since: "2.11.0",
message: 'Use "document:update" route with PATCH instead of PUT',
Expand Down
48 changes: 0 additions & 48 deletions lib/api/openapi/OpenApiManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@
* limitations under the License.
*/

import {
OpenApiPayloadsDefinitions,
OpenApiDocumentCountComponent,
OpenApiDocumentDeleteByQueryComponent,
OpenApiDocumentDeleteComponent,
OpenApiDocumentScrollComponent,
OpenApiDocumentExistsComponent,
OpenApiDocumentUpdateComponent,
OpenApiDocumentReplaceComponent,
OpenApiDocumentGetComponent,
OpenApiDocumentCreateOrReplaceComponent,
OpenApiDocumentCreateComponent,
OpenApiDocumentValidateComponent,
OpenApiSecurityUpsertUserComponent,
OpenApiDocumentmCreateOrReplaceComponent,
} from "./components";
import { OpenApiDefinition } from "../../types/OpenApiDefinition";
import { version } from "../../../package.json";
import { generateOpenApi } from "./openApiGenerator";
Expand All @@ -50,7 +34,6 @@ export class OpenApiManager {
name: "Kuzzle team",
url: "https://kuzzle.io",
email: "[email protected]",
discord: "http://join.discord.kuzzle.io",
},
license: {
name: "Apache 2",
Expand All @@ -62,40 +45,9 @@ export class OpenApiManager {
description: "Kuzzle API Documentation",
url: "https://docs.kuzzle.io/core/2/api/",
},
servers: [
{
url: "https://{baseUrl}:{port}",
description: "Kuzzle Base Url",
variables: {
baseUrl: { default: "localhost" },
port: { default: 7512 },
},
},
],
tags: [],
schemes: ["https", "http"],
paths: {},
components: {
...OpenApiPayloadsDefinitions,

document: {
...OpenApiDocumentCountComponent,
...OpenApiDocumentDeleteByQueryComponent,
...OpenApiDocumentDeleteComponent,
...OpenApiDocumentScrollComponent,
...OpenApiDocumentExistsComponent,
...OpenApiDocumentUpdateComponent,
...OpenApiDocumentReplaceComponent,
...OpenApiDocumentGetComponent,
...OpenApiDocumentCreateOrReplaceComponent,
...OpenApiDocumentCreateComponent,
...OpenApiDocumentValidateComponent,
},
security: {
...OpenApiSecurityUpsertUserComponent,
...OpenApiDocumentmCreateOrReplaceComponent,
},
},
};
/* eslint-enable sort-keys */

Expand Down
47 changes: 0 additions & 47 deletions lib/api/openapi/components/document/count.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions lib/api/openapi/components/document/create.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions lib/api/openapi/components/document/createOrReplace.yaml

This file was deleted.

Loading

0 comments on commit c9fea20

Please sign in to comment.