From 1db23ebc74ca20b464d1143ae856b300bab2f00e Mon Sep 17 00:00:00 2001 From: Sumanth Kanakala Date: Wed, 2 Apr 2025 15:30:04 +0530 Subject: [PATCH] Chore: Portal client upgraded with pages API --- clients/customer-portal-client/package.json | 2 +- .../src/openapi-runtime.json | 117 ++++ .../customer-portal-client/src/openapi.d.ts | 553 ++++++++++++++++ .../customer-portal-client/src/openapi.json | 620 ++++++++++++++++++ 4 files changed, 1291 insertions(+), 1 deletion(-) diff --git a/clients/customer-portal-client/package.json b/clients/customer-portal-client/package.json index 8b57924d..2ce21dee 100644 --- a/clients/customer-portal-client/package.json +++ b/clients/customer-portal-client/package.json @@ -1,6 +1,6 @@ { "name": "@epilot/customer-portal-client", - "version": "0.20.11", + "version": "0.20.11-rc.1", "description": "API Client for epilot portal API", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/clients/customer-portal-client/src/openapi-runtime.json b/clients/customer-portal-client/src/openapi-runtime.json index 6f3cbc23..da0d5d49 100644 --- a/clients/customer-portal-client/src/openapi-runtime.json +++ b/clients/customer-portal-client/src/openapi-runtime.json @@ -1302,6 +1302,123 @@ }, "responses": {} } + }, + "/v2/portal/pages/{id}": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true + } + ], + "get": { + "operationId": "getPortalPage", + "responses": {} + }, + "put": { + "operationId": "updatePortalPage", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + }, + "delete": { + "operationId": "deletePortalPage", + "responses": {} + } + }, + "/v2/portal/pages": { + "parameters": [ + { + "in": "query", + "name": "domain", + "required": true + } + ], + "get": { + "operationId": "getPortalPages", + "parameters": [ + { + "in": "query", + "name": "fields", + "required": false + }, + { + "in": "query", + "name": "filter", + "required": false + } + ], + "responses": {} + }, + "post": { + "operationId": "createPortalPage", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, + "/v2/portal/pages/{id}/blocks": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true + } + ], + "post": { + "operationId": "createPortalPageBlock", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + }, + "get": { + "operationId": "getPortalPageBlocks", + "responses": {} + } + }, + "/v2/portal/pages/{id}/blocks/{block_id}": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true + }, + { + "in": "path", + "name": "block_id", + "required": true + } + ], + "get": { + "operationId": "getPortalPageBlock", + "responses": {} + }, + "put": { + "operationId": "updatePortalPageBlock", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + }, + "delete": { + "operationId": "deletePortalPageBlock", + "responses": {} + } } }, "components": { diff --git a/clients/customer-portal-client/src/openapi.d.ts b/clients/customer-portal-client/src/openapi.d.ts index 93451792..65c15795 100644 --- a/clients/customer-portal-client/src/openapi.d.ts +++ b/clients/customer-portal-client/src/openapi.d.ts @@ -3217,6 +3217,152 @@ declare namespace Components { grants?: Grant[]; identity_providers?: ProviderPublicConfig[]; } + export interface PortalPage { + [name: string]: any; + /** + * The slug of the page + * example: + * contracts + */ + slug: string; + /** + * The schema of the entity that page holds + * example: + * contract + */ + schema: string; + /** + * The description of the page + * example: + * Contracts + */ + description?: string; + /** + * The path of the page + * example: + * /contracts + */ + path: string; + /** + * The conditions that need to be met for the page to be shown + */ + conditions?: { + [key: string]: any; + }; + /** + * The navigation of the page + */ + navigation?: { + /** + * The label of the navigation + */ + label?: { + /** + * The label of the navigation in English + */ + en?: string; + /** + * The label of the navigation in German + */ + de?: string; + }; + }; + blocks?: PortalPageBlock[]; + /** + * The id of the page + * example: + * c495fef9-eeca-4019-a989-8390dcd9825b + */ + id: string; // uuid + } + export interface PortalPageBlock { + [name: string]: any; + /** + * The type of the block + * example: + * table + */ + type: string; + /** + * The conditions that need to be met for the block to be shown + */ + conditions?: { + [key: string]: any; + }; + /** + * The id of the block + * example: + * c495fef9-eeca-4019-a989-8390dcd9825b + */ + id: string; // uuid + } + export interface PortalPageBlockRequest { + [name: string]: any; + /** + * The type of the block + * example: + * table + */ + type: string; + /** + * The conditions that need to be met for the block to be shown + */ + conditions?: { + [key: string]: any; + }; + } + export interface PortalPageRequest { + [name: string]: any; + /** + * The slug of the page + * example: + * contracts + */ + slug: string; + /** + * The schema of the entity that page holds + * example: + * contract + */ + schema: string; + /** + * The description of the page + * example: + * Contracts + */ + description?: string; + /** + * The path of the page + * example: + * /contracts + */ + path: string; + /** + * The conditions that need to be met for the page to be shown + */ + conditions?: { + [key: string]: any; + }; + /** + * The navigation of the page + */ + navigation?: { + /** + * The label of the navigation + */ + label?: { + /** + * The label of the navigation in English + */ + en?: string; + /** + * The label of the navigation in German + */ + de?: string; + }; + }; + blocks?: PortalPageBlock[]; + } /** * The portal user entity */ @@ -4497,6 +4643,26 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace CreatePortalPage { + export type RequestBody = Components.Schemas.PortalPageRequest; + namespace Responses { + export type $200 = Components.Schemas.PortalPage; + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } + namespace CreatePortalPageBlock { + export type RequestBody = Components.Schemas.PortalPageBlockRequest; + namespace Responses { + export type $200 = Components.Schemas.PortalPageBlock; + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } namespace CreateUser { namespace Parameters { export type Origin = /* Origin of the portal */ Components.Schemas.Origin; @@ -4546,6 +4712,26 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace DeletePortalPage { + namespace Responses { + export interface $204 { + } + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } + namespace DeletePortalPageBlock { + namespace Responses { + export interface $204 { + } + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } namespace DeletePortalUser { namespace Responses { export interface $200 { @@ -6182,6 +6368,65 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace GetPortalPage { + namespace Responses { + export type $200 = Components.Schemas.PortalPage; + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } + namespace GetPortalPageBlock { + namespace Responses { + export type $200 = Components.Schemas.PortalPageBlock; + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } + namespace GetPortalPageBlocks { + namespace Responses { + export type $200 = Components.Schemas.PortalPageBlock[]; + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } + namespace GetPortalPages { + namespace Parameters { + /** + * example: + * id,slug,description + */ + export type Fields = string; + /** + * example: + * schema=contract,slug=contracts + */ + export type Filter = string; + } + export interface QueryParameters { + fields?: /** + * example: + * id,slug,description + */ + Parameters.Fields; + filter?: /** + * example: + * schema=contract,slug=contracts + */ + Parameters.Filter; + } + namespace Responses { + export type $200 = Components.Schemas.PortalPage[]; + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $500 = Components.Responses.InternalServerError; + } + } namespace GetPortalUser { namespace Responses { export interface $200 { @@ -7087,6 +7332,26 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace UpdatePortalPage { + export type RequestBody = Components.Schemas.PortalPageRequest; + namespace Responses { + export type $200 = Components.Schemas.PortalPage; + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } + namespace UpdatePortalPageBlock { + export type RequestBody = Components.Schemas.PortalPageBlockRequest; + namespace Responses { + export type $200 = Components.Schemas.PortalPageBlock; + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } namespace UpdatePortalUser { export type RequestBody = Components.Schemas.Entity; namespace Responses { @@ -7283,6 +7548,82 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace V2PortalPages { + namespace Parameters { + /** + * The domain of the portal + * example: + * customer-portal.epilot.io + */ + export type Domain = string; + } + export interface QueryParameters { + domain: /** + * The domain of the portal + * example: + * customer-portal.epilot.io + */ + Parameters.Domain; + } + } + namespace V2PortalPages$Id { + namespace Parameters { + /** + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + export type Id = string; // uuid + } + export interface PathParameters { + id: /** + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + Parameters.Id /* uuid */; + } + } + namespace V2PortalPages$IdBlocks { + namespace Parameters { + /** + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + export type Id = string; // uuid + } + export interface PathParameters { + id: /** + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + Parameters.Id /* uuid */; + } + } + namespace V2PortalPages$IdBlocks$BlockId { + namespace Parameters { + /** + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + export type BlockId = string; // uuid + /** + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + export type Id = string; // uuid + } + export interface PathParameters { + id: /** + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + Parameters.Id /* uuid */; + block_id: /** + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + Parameters.BlockId /* uuid */; + } + } namespace ValidateCaaRecords { namespace Parameters { export type Origin = /* Origin of the portal */ Components.Schemas.Origin; @@ -8189,6 +8530,106 @@ export interface OperationMethods { data?: Paths.SsoCallback.RequestBody, config?: AxiosRequestConfig ): OperationResponse + /** + * getPortalPage - getPortalPage + * + * Fetch a portal page by id + */ + 'getPortalPage'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * updatePortalPage - updatePortalPage + * + * Update a portal page by id + */ + 'updatePortalPage'( + parameters?: Parameters | null, + data?: Paths.UpdatePortalPage.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * deletePortalPage - deletePortalPage + * + * Delete a portal page by id + */ + 'deletePortalPage'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * getPortalPages - getPortalPages + * + * Fetch all portal pages + */ + 'getPortalPages'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * createPortalPage - createPortalPage + * + * Create a new portal page + */ + 'createPortalPage'( + parameters?: Parameters | null, + data?: Paths.CreatePortalPage.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * getPortalPageBlocks - getPortalPageBlocks + * + * Fetch all portal page blocks + */ + 'getPortalPageBlocks'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * createPortalPageBlock - createPortalPageBlock + * + * Create a new portal page block + */ + 'createPortalPageBlock'( + parameters?: Parameters | null, + data?: Paths.CreatePortalPageBlock.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * getPortalPageBlock - getPortalPageBlock + * + * Fetch a portal page block by id + */ + 'getPortalPageBlock'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * updatePortalPageBlock - updatePortalPageBlock + * + * Update a portal page block by id + */ + 'updatePortalPageBlock'( + parameters?: Parameters | null, + data?: Paths.UpdatePortalPageBlock.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * deletePortalPageBlock - deletePortalPageBlock + * + * Delete a portal page block by id + */ + 'deletePortalPageBlock'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse } export interface PathsDictionary { @@ -9171,6 +9612,114 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v2/portal/pages/{id}']: { + /** + * getPortalPage - getPortalPage + * + * Fetch a portal page by id + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * updatePortalPage - updatePortalPage + * + * Update a portal page by id + */ + 'put'( + parameters?: Parameters | null, + data?: Paths.UpdatePortalPage.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * deletePortalPage - deletePortalPage + * + * Delete a portal page by id + */ + 'delete'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/portal/pages']: { + /** + * getPortalPages - getPortalPages + * + * Fetch all portal pages + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * createPortalPage - createPortalPage + * + * Create a new portal page + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.CreatePortalPage.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/portal/pages/{id}/blocks']: { + /** + * createPortalPageBlock - createPortalPageBlock + * + * Create a new portal page block + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.CreatePortalPageBlock.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * getPortalPageBlocks - getPortalPageBlocks + * + * Fetch all portal page blocks + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/portal/pages/{id}/blocks/{block_id}']: { + /** + * getPortalPageBlock - getPortalPageBlock + * + * Fetch a portal page block by id + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * updatePortalPageBlock - updatePortalPageBlock + * + * Update a portal page block by id + */ + 'put'( + parameters?: Parameters | null, + data?: Paths.UpdatePortalPageBlock.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * deletePortalPageBlock - deletePortalPageBlock + * + * Delete a portal page block by id + */ + 'delete'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } } export type Client = OpenAPIClient @@ -9250,6 +9799,10 @@ export type OrganizationSettings = Components.Schemas.OrganizationSettings; export type Origin = Components.Schemas.Origin; export type PaymentWidget = Components.Schemas.PaymentWidget; export type PortalConfig = Components.Schemas.PortalConfig; +export type PortalPage = Components.Schemas.PortalPage; +export type PortalPageBlock = Components.Schemas.PortalPageBlock; +export type PortalPageBlockRequest = Components.Schemas.PortalPageBlockRequest; +export type PortalPageRequest = Components.Schemas.PortalPageRequest; export type PortalUser = Components.Schemas.PortalUser; export type PortalWidget = Components.Schemas.PortalWidget; export type Product = Components.Schemas.Product; diff --git a/clients/customer-portal-client/src/openapi.json b/clients/customer-portal-client/src/openapi.json index f7a7ca6c..7688215e 100644 --- a/clients/customer-portal-client/src/openapi.json +++ b/clients/customer-portal-client/src/openapi.json @@ -5513,6 +5513,501 @@ } } } + }, + "/v2/portal/pages/{id}": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "5da0a718-c822-403d-9f5d-20d4584e0528" + } + } + ], + "get": { + "operationId": "getPortalPage", + "summary": "getPortalPage", + "description": "Fetch a portal page by id", + "tags": [ + "ECP", + "ECP Admin" + ], + "security": [ + { + "EitherAuth": [] + } + ], + "responses": { + "200": { + "description": "The portal page has been fetched successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPage" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "operationId": "updatePortalPage", + "summary": "updatePortalPage", + "description": "Update a portal page by id", + "tags": [ + "ECP Admin" + ], + "security": [ + { + "EpilotAuth": [] + } + ], + "requestBody": { + "description": "The portal page to update", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPageRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The portal page has been fetched successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPage" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "delete": { + "operationId": "deletePortalPage", + "summary": "deletePortalPage", + "description": "Delete a portal page by id", + "tags": [ + "ECP Admin" + ], + "security": [ + { + "EpilotAuth": [] + } + ], + "responses": { + "204": { + "description": "The portal page has been fetched successfully." + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v2/portal/pages": { + "parameters": [ + { + "in": "query", + "name": "domain", + "required": true, + "schema": { + "type": "string", + "example": "customer-portal.epilot.io", + "description": "The domain of the portal" + } + } + ], + "get": { + "operationId": "getPortalPages", + "summary": "getPortalPages", + "description": "Fetch all portal pages", + "tags": [ + "ECP", + "ECP Admin" + ], + "security": [ + { + "EitherAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "fields", + "required": false, + "description": "The fields to include in the response", + "schema": { + "type": "string", + "example": "id,slug,description" + } + }, + { + "in": "query", + "name": "filter", + "required": false, + "description": "The filter to apply to the response", + "schema": { + "type": "string", + "example": "schema=contract,slug=contracts" + } + } + ], + "responses": { + "200": { + "description": "The portal pages have been fetched successfully.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PortalPage" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "operationId": "createPortalPage", + "summary": "createPortalPage", + "description": "Create a new portal page", + "tags": [ + "ECP Admin" + ], + "security": [ + { + "EpilotAuth": [] + } + ], + "requestBody": { + "description": "The portal page to create", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPageRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The portal page has been created successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPage" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v2/portal/pages/{id}/blocks": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "5da0a718-c822-403d-9f5d-20d4584e0528" + } + } + ], + "post": { + "operationId": "createPortalPageBlock", + "summary": "createPortalPageBlock", + "description": "Create a new portal page block", + "tags": [ + "ECP Admin" + ], + "security": [ + { + "EpilotAuth": [] + } + ], + "requestBody": { + "description": "The portal page block to create", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPageBlockRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The portal page block has been created successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPageBlock" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "get": { + "operationId": "getPortalPageBlocks", + "summary": "getPortalPageBlocks", + "description": "Fetch all portal page blocks", + "tags": [ + "ECP", + "ECP Admin" + ], + "security": [ + { + "EitherAuth": [] + } + ], + "responses": { + "200": { + "description": "The portal page blocks have been fetched successfully.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PortalPageBlock" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v2/portal/pages/{id}/blocks/{block_id}": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "5da0a718-c822-403d-9f5d-20d4584e0528" + } + }, + { + "in": "path", + "name": "block_id", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "5da0a718-c822-403d-9f5d-20d4584e0528" + } + } + ], + "get": { + "operationId": "getPortalPageBlock", + "summary": "getPortalPageBlock", + "description": "Fetch a portal page block by id", + "tags": [ + "ECP", + "ECP Admin" + ], + "security": [ + { + "EitherAuth": [] + } + ], + "responses": { + "200": { + "description": "The portal page block has been fetched successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPageBlock" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "operationId": "updatePortalPageBlock", + "summary": "updatePortalPageBlock", + "description": "Update a portal page block by id", + "tags": [ + "ECP Admin" + ], + "security": [ + { + "EpilotAuth": [] + } + ], + "requestBody": { + "description": "The portal page block to update", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPageBlockRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The portal page block has been fetched successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalPageBlock" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "delete": { + "operationId": "deletePortalPageBlock", + "summary": "deletePortalPageBlock", + "description": "Delete a portal page block by id", + "tags": [ + "ECP Admin" + ], + "security": [ + { + "EpilotAuth": [] + } + ], + "responses": { + "204": { + "description": "The portal page block has been fetched successfully." + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } } }, "components": { @@ -9836,6 +10331,131 @@ "example": "123456" } } + }, + "PortalPageBlockRequest": { + "type": "object", + "additionalProperties": true, + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the block", + "example": "table" + }, + "conditions": { + "type": "object", + "description": "The conditions that need to be met for the block to be shown" + } + } + }, + "PortalPageBlock": { + "type": "object", + "required": [ + "id" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PortalPageBlockRequest" + }, + { + "type": "object", + "additionalProperties": true, + "properties": { + "id": { + "type": "string", + "description": "The id of the block", + "format": "uuid", + "example": "c495fef9-eeca-4019-a989-8390dcd9825b" + } + } + } + ] + }, + "PortalPageRequest": { + "type": "object", + "additionalProperties": true, + "required": [ + "slug", + "schema", + "path" + ], + "properties": { + "slug": { + "type": "string", + "description": "The slug of the page", + "example": "contracts" + }, + "schema": { + "type": "string", + "description": "The schema of the entity that page holds", + "example": "contract" + }, + "description": { + "type": "string", + "description": "The description of the page", + "example": "Contracts" + }, + "path": { + "type": "string", + "description": "The path of the page", + "example": "/contracts" + }, + "conditions": { + "type": "object", + "description": "The conditions that need to be met for the page to be shown" + }, + "navigation": { + "type": "object", + "description": "The navigation of the page", + "properties": { + "label": { + "type": "object", + "description": "The label of the navigation", + "properties": { + "en": { + "type": "string", + "description": "The label of the navigation in English" + }, + "de": { + "type": "string", + "description": "The label of the navigation in German" + } + } + } + } + }, + "blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PortalPageBlock" + } + } + } + }, + "PortalPage": { + "type": "object", + "required": [ + "id" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PortalPageRequest" + }, + { + "type": "object", + "additionalProperties": true, + "properties": { + "id": { + "type": "string", + "description": "The id of the page", + "format": "uuid", + "example": "c495fef9-eeca-4019-a989-8390dcd9825b" + } + } + } + ] } } },