diff --git a/ccm-apiclient-commons/src/main/typescript/ApiClient.ts b/ccm-apiclient-commons/src/main/typescript/ApiClient.ts index 7c89c1abc..7fb16d0d1 100644 --- a/ccm-apiclient-commons/src/main/typescript/ApiClient.ts +++ b/ccm-apiclient-commons/src/main/typescript/ApiClient.ts @@ -1,4 +1,6 @@ import * as http from "http"; +import { rejects } from "assert"; +import { timeStamp } from "console"; /** * The interface of a client for the LibreCcm RESTful API. @@ -410,9 +412,9 @@ class NodeResponse implements ApiResponse { readonly status: number; readonly statusText: string; - #data: Buffer; + #data: Buffer | null; - constructor(status: number, statusText: string, data: Buffer) { + constructor(status: number, statusText: string, data: Buffer | null) { this.status = status; this.statusText = statusText; this.#data = data; @@ -421,7 +423,11 @@ class NodeResponse implements ApiResponse { json(): Promise> { return new Promise((resolve, reject) => { try { - resolve(this.#data.toJSON()); + if (this.#data) { + resolve(this.#data.toJSON()); + } else { + resolve({}); + } } catch (err) { reject(err); } @@ -431,11 +437,15 @@ class NodeResponse implements ApiResponse { arrayBuffer(): Promise { return new Promise((resolve, reject) => { try { - const arrayBuf: ArrayBuffer = this.#data.buffer.slice( - this.#data.byteOffset, - this.#data.byteLength + this.#data.byteLength - ); - resolve(arrayBuf); + if (this.#data) { + const arrayBuf: ArrayBuffer = this.#data.buffer.slice( + this.#data.byteOffset, + this.#data.byteLength + this.#data.byteLength + ); + resolve(arrayBuf); + } else { + resolve(new ArrayBuffer(0)); + } } catch (err) { reject(err); } @@ -445,7 +455,11 @@ class NodeResponse implements ApiResponse { text(): Promise { return new Promise((resolve, reject) => { try { - return this.#data.toString(); + if (this.#data) { + resolve(this.#data.toString()); + } else { + resolve(""); + } } catch (err) { reject(err); } @@ -511,7 +525,37 @@ export class ApiClientNodeImpl implements LibreCcmApiClient { body: unknown, searchParams?: Record ): Promise { - throw "Not implemented yet."; + return new Promise((resolve, reject) => { + const url = buildUrl(this.#baseUrl, endpoint, searchParams); + const request: http.ClientRequest = http.request(url, { + headers: { + Authorization: "", + }, + method: "POST", + }); + + request.on("response", (response) => { + const status: number = response.statusCode + ? response.statusCode + : -1; + const statusText: string = response.statusMessage + ? response.statusMessage + : ""; + + response.on("end", () => { + const apiResponse: ApiResponse = new NodeResponse( + status, + statusText, + null + ); + resolve(apiResponse); + }); + }); + + request.on("error", (error) => reject(error)); + + request.end(); + }); } put( diff --git a/ccm-core/src/site/resources/ccm-core-api.json b/ccm-core/src/site/resources/ccm-core-api.json index be6f582ae..baf747b89 100644 --- a/ccm-core/src/site/resources/ccm-core-api.json +++ b/ccm-core/src/site/resources/ccm-core-api.json @@ -18,9 +18,58 @@ } } }, + "/api/admin/categories/UUID-{categoryUuid}" : { + "put" : { + "operationId" : "updateCategory", + "parameters" : [ { + "name" : "catgoryUuid", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CategoryData" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { } + } + } + } + }, + "delete" : { + "operationId" : "deleteCategory", + "parameters" : [ { + "name" : "categoryId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + } + }, "/api/admin/categories/ID-{categoryId}" : { "get" : { - "operationId" : "getCategory", + "operationId" : "getCategory_1", "parameters" : [ { "name" : "categoryId", "in" : "path", @@ -44,7 +93,7 @@ } }, "put" : { - "operationId" : "updateCategory", + "operationId" : "updateCategory_1", "parameters" : [ { "name" : "catgoryId", "in" : "path", @@ -73,7 +122,7 @@ } }, "delete" : { - "operationId" : "deleteCategory_2", + "operationId" : "deleteCategory_1", "parameters" : [ { "name" : "categoryId", "in" : "path", @@ -95,7 +144,7 @@ }, "/api/admin/categories/{domainIdentifier}/{path}" : { "get" : { - "operationId" : "getCategory_1", + "operationId" : "getCategory_2", "parameters" : [ { "name" : "domainIdentifier", "in" : "path", @@ -125,7 +174,7 @@ } }, "put" : { - "operationId" : "updateCategory_1", + "operationId" : "updateCategory_2", "parameters" : [ { "name" : "domainIdentifier", "in" : "path", @@ -160,7 +209,7 @@ } }, "delete" : { - "operationId" : "deleteCategory_1", + "operationId" : "deleteCategory_2", "parameters" : [ { "name" : "domainIdentifier", "in" : "path", @@ -186,9 +235,403 @@ } } }, + "/api/admin/categories/{domainIdentifier}/{path}/subcategories" : { + "get" : { + "operationId" : "getSubCategories_2", + "parameters" : [ { + "name" : "domainIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "path", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "limit", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 20 + } + }, { + "name" : "offset", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 20 + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ListViewCategoryData" + } + } + } + } + } + }, + "post" : { + "operationId" : "addNewSubCategory", + "parameters" : [ { + "name" : "domainIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "path", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CategoryData" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { } + } + } + } + } + }, + "/api/admin/categories/UUID-{uuid}/objects" : { + "get" : { + "operationId" : "getObjectsInCategory", + "parameters" : [ { + "name" : "uuid", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "limit", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "offset", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ListViewCategorizationData" + } + } + } + } + } + } + }, + "/api/admin/categories/{domainIdentifier}/{path}/objects" : { + "get" : { + "operationId" : "getObjectsInCategory_1", + "parameters" : [ { + "name" : "domainIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "path", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "limit", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "offset", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ListViewCategorizationData" + } + } + } + } + } + }, + "post" : { + "operationId" : "addObjectToCategory_1", + "parameters" : [ { + "name" : "domainIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "path", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CategorizationData" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + } + }, + "/api/admin/categories/ID-{categoryId}/objects" : { + "get" : { + "operationId" : "getCategoryObjectsInCategory", + "parameters" : [ { + "name" : "categoryId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + }, { + "name" : "limit", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "offset", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ListViewCategorizationData" + } + } + } + } + } + } + }, + "/api/admin/categories/ID-{categoryId}/objects/{objectIdentifier}" : { + "post" : { + "operationId" : "addObjectToCategory", + "parameters" : [ { + "name" : "categoryId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CategorizationData" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + }, + "delete" : { + "operationId" : "removeObjectFromCategory_1", + "parameters" : [ { + "name" : "categoryId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + }, { + "name" : "objectIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + } + }, + "/api/admin/categories/UUID-{categoryUuid}/objects/objectIdentifier" : { + "post" : { + "operationId" : "addObjectsToCategory", + "parameters" : [ { + "name" : "categoryUuid", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CategorizationData" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + } + }, + "/api/admin/categories/{domainIdentifier}/{path}/objects/{objectIdentifier}" : { + "delete" : { + "operationId" : "removeObjectFromCategory", + "parameters" : [ { + "name" : "domainIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "path", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "objectIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + } + }, + "/api/admin/categories/UUID-{categoryId}/objects/objectIdentifier" : { + "delete" : { + "operationId" : "removeObjectsFromCategory", + "parameters" : [ { + "name" : "categoryId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "objectIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { } + } + } + } + } + }, "/api/admin/categories/UUID-{categoryId}" : { "get" : { - "operationId" : "getCategory_2", + "operationId" : "getCategory", "parameters" : [ { "name" : "categoryId", "in" : "path", @@ -294,449 +737,6 @@ } } }, - "/api/admin/categories/{domainIdentifier}/{path}/subcategories" : { - "get" : { - "operationId" : "getSubCategories_2", - "parameters" : [ { - "name" : "domainIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "path", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "limit", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32", - "default" : 20 - } - }, { - "name" : "offset", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32", - "default" : 20 - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ListViewCategoryData" - } - } - } - } - } - }, - "post" : { - "operationId" : "addNewSubCategory", - "parameters" : [ { - "name" : "domainIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "path", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CategoryData" - } - } - } - }, - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "application/json" : { } - } - } - } - } - }, - "/api/admin/categories/UUID-{categoryUuid}" : { - "put" : { - "operationId" : "updateCategory_2", - "parameters" : [ { - "name" : "catgoryUuid", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CategoryData" - } - } - } - }, - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "application/json" : { } - } - } - } - }, - "delete" : { - "operationId" : "deleteCategory", - "parameters" : [ { - "name" : "categoryId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - } - }, - "/api/admin/categories/{domainIdentifier}/{path}/objects" : { - "get" : { - "operationId" : "getObjectsInCategory", - "parameters" : [ { - "name" : "domainIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "path", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "limit", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "offset", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ListViewCategorizationData" - } - } - } - } - } - }, - "post" : { - "operationId" : "addObjectToCategory", - "parameters" : [ { - "name" : "domainIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "path", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CategorizationData" - } - } - } - }, - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - } - }, - "/api/admin/categories/UUID-{uuid}/objects" : { - "get" : { - "operationId" : "getObjectsInCategory_1", - "parameters" : [ { - "name" : "uuid", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "limit", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "offset", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ListViewCategorizationData" - } - } - } - } - } - } - }, - "/api/admin/categories/ID-{categoryId}/objects" : { - "get" : { - "operationId" : "getCategoryObjectsInCategory", - "parameters" : [ { - "name" : "categoryId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" - } - }, { - "name" : "limit", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "offset", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ListViewCategorizationData" - } - } - } - } - } - } - }, - "/api/admin/categories/ID-{categoryId}/objects/{objectIdentifier}" : { - "post" : { - "operationId" : "addObjectToCategory_1", - "parameters" : [ { - "name" : "categoryId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CategorizationData" - } - } - } - }, - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - }, - "delete" : { - "operationId" : "removeObjectFromCategory", - "parameters" : [ { - "name" : "categoryId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" - } - }, { - "name" : "objectIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - } - }, - "/api/admin/categories/UUID-{categoryUuid}/objects/objectIdentifier" : { - "post" : { - "operationId" : "addObjectsToCategory", - "parameters" : [ { - "name" : "categoryUuid", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CategorizationData" - } - } - } - }, - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - } - }, - "/api/admin/categories/{domainIdentifier}/{path}/objects/{objectIdentifier}" : { - "delete" : { - "operationId" : "removeObjectFromCategory_1", - "parameters" : [ { - "name" : "domainIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "path", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "objectIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - } - }, - "/api/admin/categories/UUID-{categoryId}/objects/objectIdentifier" : { - "delete" : { - "operationId" : "removeObjectsFromCategory", - "parameters" : [ { - "name" : "categoryId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "objectIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "application/json" : { } - } - } - } - } - }, "/api/admin/domains/{domainIdentifier}" : { "get" : { "operationId" : "getDomain", @@ -1119,6 +1119,60 @@ } } }, + "/api/admin/groups/{groupIdentifier}/members/{userIdentifier}" : { + "put" : { + "operationId" : "addMember", + "parameters" : [ { + "name" : "groupIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "userIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + }, + "delete" : { + "operationId" : "removeMember", + "parameters" : [ { + "name" : "groupIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "userIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + } + }, "/api/admin/groups/{groupIdentifier}" : { "get" : { "operationId" : "getGroup", @@ -1327,60 +1381,6 @@ } } }, - "/api/admin/groups/{groupIdentifier}/members/{userIdentifier}" : { - "put" : { - "operationId" : "addMember", - "parameters" : [ { - "name" : "groupIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "userIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - }, - "delete" : { - "operationId" : "removeMember", - "parameters" : [ { - "name" : "groupIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "userIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - } - }, "/api/admin/groups/{groupIdentifier}/members" : { "get" : { "operationId" : "getMembers", @@ -1494,6 +1494,60 @@ } } }, + "/api/admin/roles/{roleIdentifier}/members/{partyIdentifier}" : { + "put" : { + "operationId" : "addMember_1", + "parameters" : [ { + "name" : "roleIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "partyIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + }, + "delete" : { + "operationId" : "removeMember_1", + "parameters" : [ { + "name" : "roleIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "partyIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + } + }, "/api/admin/roles" : { "get" : { "operationId" : "getRoles", @@ -1645,60 +1699,6 @@ } } }, - "/api/admin/roles/{roleIdentifier}/members/{partyIdentifier}" : { - "put" : { - "operationId" : "addMember_1", - "parameters" : [ { - "name" : "roleIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "partyIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - }, - "delete" : { - "operationId" : "removeMember_1", - "parameters" : [ { - "name" : "roleIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "partyIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - } - }, "/api/admin/roles/{roleIdentifier}/members" : { "get" : { "operationId" : "getMembers_1", @@ -1740,6 +1740,132 @@ } } }, + "/api/admin/users" : { + "get" : { + "operationId" : "getUsers", + "parameters" : [ { + "name" : "limit", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 20 + } + }, { + "name" : "offset", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 0 + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ListViewUserData" + } + } + } + } + } + }, + "post" : { + "operationId" : "addUser", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + } + }, + "/api/admin/users/{userIdentifier}" : { + "get" : { + "operationId" : "getUser", + "parameters" : [ { + "name" : "userIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UserData" + } + } + } + } + } + }, + "put" : { + "operationId" : "updateUser", + "parameters" : [ { + "name" : "userIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UserData" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + }, + "delete" : { + "operationId" : "deleteUser", + "parameters" : [ { + "name" : "userIdentifier", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "*/*" : { } + } + } + } + } + }, "/api/admin/users/{userIdentifier}/roles" : { "get" : { "operationId" : "getRoleMemberships_1", @@ -1822,78 +1948,6 @@ } } }, - "/api/admin/users/{userIdentifier}" : { - "get" : { - "operationId" : "getUser", - "parameters" : [ { - "name" : "userIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UserData" - } - } - } - } - } - }, - "put" : { - "operationId" : "updateUser", - "parameters" : [ { - "name" : "userIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UserData" - } - } - } - }, - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - }, - "delete" : { - "operationId" : "deleteUser", - "parameters" : [ { - "name" : "userIdentifier", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - } - }, "/api/admin/users/{userIdentifier}/groups" : { "get" : { "operationId" : "getGroupMemberships", @@ -1975,60 +2029,6 @@ } } } - }, - "/api/admin/users" : { - "get" : { - "operationId" : "getUsers", - "parameters" : [ { - "name" : "limit", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32", - "default" : 20 - } - }, { - "name" : "offset", - "in" : "query", - "schema" : { - "type" : "integer", - "format" : "int32", - "default" : 0 - } - } ], - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ListViewUserData" - } - } - } - } - } - }, - "post" : { - "operationId" : "addUser", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/User" - } - } - } - }, - "responses" : { - "default" : { - "description" : "default response", - "content" : { - "*/*" : { } - } - } - } - } } }, "components" : { @@ -2149,29 +2149,6 @@ "namespace" : "http://l10n.libreccm.org" } }, - "ListViewCategoryData" : { - "type" : "object", - "properties" : { - "list" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/CategoryData" - } - }, - "count" : { - "type" : "integer", - "format" : "int64" - }, - "limit" : { - "type" : "integer", - "format" : "int64" - }, - "offset" : { - "type" : "integer", - "format" : "int64" - } - } - }, "CategorizationData" : { "type" : "object", "properties" : { @@ -2239,6 +2216,29 @@ } } }, + "ListViewCategoryData" : { + "type" : "object", + "properties" : { + "list" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CategoryData" + } + }, + "count" : { + "type" : "integer", + "format" : "int64" + }, + "limit" : { + "type" : "integer", + "format" : "int64" + }, + "offset" : { + "type" : "integer", + "format" : "int64" + } + } + }, "CategoryId" : { "type" : "object", "properties" : { @@ -2709,83 +2709,6 @@ } } }, - "EmailAddressData" : { - "type" : "object", - "properties" : { - "address" : { - "type" : "string" - }, - "bouncing" : { - "type" : "boolean" - }, - "verified" : { - "type" : "boolean" - } - } - }, - "UserData" : { - "type" : "object", - "properties" : { - "partyId" : { - "type" : "integer", - "format" : "int64" - }, - "uuid" : { - "type" : "string" - }, - "name" : { - "type" : "string" - }, - "givenName" : { - "type" : "string" - }, - "familyName" : { - "type" : "string" - }, - "primaryEmailAddress" : { - "$ref" : "#/components/schemas/EmailAddressData" - }, - "emailAddresses" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/EmailAddressData" - } - }, - "banned" : { - "type" : "boolean" - }, - "passwordResetRequired" : { - "type" : "boolean" - }, - "groupMemberships" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/UserGroupMembership" - } - }, - "roleMemberships" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PartyRoleMembership" - } - } - } - }, - "UserGroupMembership" : { - "type" : "object", - "properties" : { - "membershipId" : { - "type" : "integer", - "format" : "int64" - }, - "uuid" : { - "type" : "string" - }, - "group" : { - "$ref" : "#/components/schemas/PartyId" - } - } - }, "EmailAddress" : { "required" : [ "address" ], "type" : "object", @@ -2883,6 +2806,83 @@ "namespace" : "http://core.libreccm.org" } }, + "EmailAddressData" : { + "type" : "object", + "properties" : { + "address" : { + "type" : "string" + }, + "bouncing" : { + "type" : "boolean" + }, + "verified" : { + "type" : "boolean" + } + } + }, + "UserData" : { + "type" : "object", + "properties" : { + "partyId" : { + "type" : "integer", + "format" : "int64" + }, + "uuid" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "givenName" : { + "type" : "string" + }, + "familyName" : { + "type" : "string" + }, + "primaryEmailAddress" : { + "$ref" : "#/components/schemas/EmailAddressData" + }, + "emailAddresses" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/EmailAddressData" + } + }, + "banned" : { + "type" : "boolean" + }, + "passwordResetRequired" : { + "type" : "boolean" + }, + "groupMemberships" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/UserGroupMembership" + } + }, + "roleMemberships" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PartyRoleMembership" + } + } + } + }, + "UserGroupMembership" : { + "type" : "object", + "properties" : { + "membershipId" : { + "type" : "integer", + "format" : "int64" + }, + "uuid" : { + "type" : "string" + }, + "group" : { + "$ref" : "#/components/schemas/PartyId" + } + } + }, "ListViewUserData" : { "type" : "object", "properties" : {