diff --git a/clients/customer-portal-client/package-lock.json b/clients/customer-portal-client/package-lock.json index 4b60a71..946777b 100644 --- a/clients/customer-portal-client/package-lock.json +++ b/clients/customer-portal-client/package-lock.json @@ -1,12 +1,12 @@ { "name": "@epilot/customer-portal-client", - "version": "0.17.1", + "version": "0.17.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@epilot/customer-portal-client", - "version": "0.17.1", + "version": "0.17.4", "license": "UNLICENSED", "dependencies": { "buffer": "^6.0.3", diff --git a/clients/customer-portal-client/package.json b/clients/customer-portal-client/package.json index 496d35e..fb43060 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.17.2", + "version": "0.17.4", "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 8fc5dce..2780f4f 100644 --- a/clients/customer-portal-client/src/openapi-runtime.json +++ b/clients/customer-portal-client/src/openapi-runtime.json @@ -148,6 +148,29 @@ "responses": {} } }, + "/v2/portal/resolve:external-link/{id}": { + "get": { + "operationId": "getResolvedExternalLink", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true + }, + { + "in": "query", + "name": "origin", + "required": false + }, + { + "in": "query", + "name": "contactId", + "required": false + } + ], + "responses": {} + } + }, "/v2/portal/public/portal/config": { "get": { "operationId": "getPublicPortalConfig", @@ -415,6 +438,11 @@ "in": "query", "name": "confirmation_link_token", "required": true + }, + { + "in": "query", + "name": "use_redirect", + "required": false } ], "responses": {} @@ -1101,6 +1129,11 @@ "content": { "application/json": {} } + }, + "ConfirmUserInvalidRequest": { + "content": { + "application/json": {} + } } } }, diff --git a/clients/customer-portal-client/src/openapi.d.ts b/clients/customer-portal-client/src/openapi.d.ts index 364a5be..8cc8a91 100644 --- a/clients/customer-portal-client/src/openapi.d.ts +++ b/clients/customer-portal-client/src/openapi.d.ts @@ -10,6 +10,13 @@ import type { declare namespace Components { namespace Responses { + export interface ConfirmUserInvalidRequest { + /** + * Error message + */ + message?: string; + reason: "invalid_token"; + } export type Conflict = Schemas.ErrorResp; export interface ContractAssignmentConflict { /** @@ -38,7 +45,7 @@ declare namespace Components { } export interface ActionWidget { id: string; - type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET"; + type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET" | "METER_READING_WIDGET"; /** * Index of the widget in the list, used for ordering (left or right) */ @@ -486,6 +493,10 @@ declare namespace Components { * Change due date feature flag */ change_due_date?: boolean; + /** + * Enable or disable the new design for the portal + */ + new_design?: boolean; }; /** * Access token for the portal @@ -584,10 +595,6 @@ declare namespace Components { [name: string]: string[]; }; email_templates?: /* Email templates used for authentication and internal processes */ EmailTemplates; - /** - * Permissions granted to a portal user while accessing entities - */ - grants?: Grant[]; /** * Teaser & Banner Image web links */ @@ -721,10 +728,6 @@ declare namespace Components { number_of_days_before_restriction?: number; }[]; allowed_file_extensions?: /* Allowed file extensions for upload */ AllowedFileExtensions; - /** - * Configured Portal extensions - */ - extensions?: ExtensionConfig[]; } /** * The mapped contact of the portal user @@ -813,7 +816,7 @@ declare namespace Components { } export interface ContentWidget { id: string; - type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET"; + type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET" | "METER_READING_WIDGET"; /** * Index of the widget in the list, used for ordering (left or right) */ @@ -1137,7 +1140,7 @@ declare namespace Components { } export interface DocumentWidget { id: string; - type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET"; + type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET" | "METER_READING_WIDGET"; /** * Index of the widget in the list, used for ordering (left or right) */ @@ -1228,7 +1231,7 @@ declare namespace Components { */ EntityId /* uuid */; /** - * ID of the email template for email update confirmation + * ID of the email template for setting password while updating email */ confirmEmailUpdate?: /** * Entity ID @@ -1380,7 +1383,7 @@ declare namespace Components { export type EntitySlug = "contact" | "contract" | "file" | "order" | "opportunity" | "product" | "price" | "meter" | "meter_counter"; export interface EntityWidget { id: string; - type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET"; + type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET" | "METER_READING_WIDGET"; /** * Index of the widget in the list, used for ordering (left or right) */ @@ -1433,80 +1436,131 @@ declare namespace Components { */ en: string; }; + /** + * Name of the extension. + */ + description: { + [name: string]: string; + /** + * Name of the extension in English. + */ + en: string; + }; /** * Version of the extension. */ version: string; /** - * Variables available to the extension configurable by the portal administrator. + * Options available to the extension configurable by the portal administrator. */ - variables?: { + options?: { /** - * Identifier of the variable. Should not change between updates. + * Identifier of the option. Should not change between updates. */ id: string; /** - * Name of the variable. + * Name of the option. */ name: { [name: string]: string; /** - * Name of the variable in English. + * Name of the option in English. */ en: string; }; /** - * Type of the variable. + * Type of the option. */ type: "secret"; /** - * Description of the variable. + * Description of the option. */ description?: { [name: string]: string; /** - * Description of the variable in English. + * Description of the option in English. */ en: string; }; /** - * Default value of the variable. + * Default value of the option. */ default?: string; /** - * Indicate whether the variable is required. + * Indicate whether the option is required. */ required?: boolean; }[]; /** - * Widgets that can be used by portal administrator. + * External links added to the portal. */ - widgets?: ({ + links?: { /** - * Identifier of the widget. Should not change between updates. + * Identifier of the link. Should not change between updates. */ - id?: string; + id: string; /** - * Name of the widget. + * Name of the extension. */ - name?: { + name: { [name: string]: string; /** - * Name of the widget in English. + * Name of the extension in English. */ en: string; }; /** - * Description of the widget. + * Name of the extension. */ description?: { [name: string]: string; /** - * Description of the widget in English. + * Name of the extension in English. */ en: string; }; - } & (ExtensionWidgetSeamlessLink))[]; + type: "seamless"; + auth?: { + /** + * HTTP method to use for authentication + */ + method?: string; + /** + * URL to use for authentication. Supports variable interpolation. + */ + url: string; + /** + * Parameters to append to the URL. Supports variable interpolation. + */ + params?: { + [name: string]: string; + }; + /** + * Headers to use for authentication. Supports variable interpolation. + */ + headers?: { + [name: string]: string; + }; + /** + * JSON body to use for authentication. Supports variable interpolation. + */ + body?: { + [name: string]: string; + }; + }; + redirect: { + /** + * URL to redirect to. Supports variable interpolation. + */ + url?: string; + /** + * Parameters to append to the URL. Supports variable interpolation. + */ + params?: { + [name: string]: string; + }; + }; + }[]; /** * Hooks that influence the behavior of Portal. */ @@ -1516,8 +1570,8 @@ declare namespace Components { */ id?: string; } & (/** - * Hook that replaces the built-in registration identifiers check. This hook makes the specified call whenever a user is trying to register to find the corresponding contact. The expected response to the call is: - * - 200 with body `{ "contactId": "uuid" }` if exactly one contact is found + * Hook that replaces the built-in registration identifiers check. This hook makes a POST call whenever a user is trying to register to find the corresponding contact. The expected response to the call is: + * - 200 with contact id if exactly one contact is found * - 404 if no contact is found or more than contact is found * */ @@ -1546,20 +1600,48 @@ declare namespace Components { id?: string; } /** - * Hook that replaces the built-in registration identifiers check. This hook makes the specified call whenever a user is trying to register to find the corresponding contact. The expected response to the call is: - * - 200 with body `{ "contactId": "uuid" }` if exactly one contact is found + * Hook that replaces the built-in registration identifiers check. This hook makes a POST call whenever a user is trying to register to find the corresponding contact. The expected response to the call is: + * - 200 with contact id if exactly one contact is found * - 404 if no contact is found or more than contact is found * */ export interface ExtensionHookRegistrationIdentifiersCheck { type: "registrationIdentifiersCheck"; + auth?: { + /** + * HTTP method to use for authentication + */ + method?: string; + /** + * URL to use for authentication. Supports variable interpolation. + */ + url: string; + /** + * Parameters to append to the URL. Supports variable interpolation. + */ + params?: { + [name: string]: string; + }; + /** + * Headers to use for authentication. Supports variable interpolation. + */ + headers?: { + [name: string]: string; + }; + /** + * JSON body to use for authentication. Supports variable interpolation. + */ + body?: { + [name: string]: string; + }; + }; call: { /** * URL to call. Supports variable interpolation. */ url: string; /** - * Parameters to append to the URL. + * Parameters to append to the URL. Supports variable interpolation. */ params?: { [name: string]: string; @@ -1570,78 +1652,129 @@ declare namespace Components { headers: { [name: string]: string; }; + /** + * Contact ID usually retrieved from the response body, e.g. `{{CallResponse.data.contactId}}`. Supports variable interpolation. + */ + result: string; }; } - export interface ExtensionWidget { + export interface ExtensionSeamlessLink { /** - * Identifier of the widget. Should not change between updates. + * Identifier of the link. Should not change between updates. */ - id?: string; + id: string; /** - * Name of the widget. + * Name of the extension. */ - name?: { + name: { [name: string]: string; /** - * Name of the widget in English. + * Name of the extension in English. */ en: string; }; /** - * Description of the widget. + * Name of the extension. */ description?: { [name: string]: string; /** - * Description of the widget in English. + * Name of the extension in English. */ en: string; }; - } - export interface ExtensionWidgetSeamlessLink { - type?: "seamlessLink"; - authentication?: { - type?: "token"; + type: "seamless"; + auth?: { /** * HTTP method to use for authentication */ method?: string; /** - * URL to use for authentication + * URL to use for authentication. Supports variable interpolation. */ - url?: string; + url: string; /** - * Parameters to append to the URL. + * Parameters to append to the URL. Supports variable interpolation. */ params?: { [name: string]: string; }; /** - * Headers to use for authentication + * Headers to use for authentication. Supports variable interpolation. */ headers?: { [name: string]: string; }; /** - * JSON body to use for authentication + * JSON body to use for authentication. Supports variable interpolation. */ body?: { [name: string]: string; }; }; - redirect?: { + redirect: { /** - * URL to redirect to. + * URL to redirect to. Supports variable interpolation. */ url?: string; /** - * Parameters to append to the URL. + * Parameters to append to the URL. Supports variable interpolation. */ params?: { [name: string]: string; }; }; } + export interface ExternalLink { + /** + * Unique identifier for the external link + */ + id: string; + label: { + [name: string]: string; + }; + type: "link" | "journey" | "seamless"; + /** + * The URL of the external link + */ + link: string; + rules?: { + [key: string]: any; + }[]; + /** + * Attribute associated with the link + */ + attribute?: string; + /** + * Entity associated with the link + */ + entity?: string; + /** + * Attribute value for the link + */ + attribute_value?: string; + /** + * Configuration of the icon for the external link + */ + icon?: { + /** + * The name of the icon + */ + name?: string; + /** + * The color of the icon + */ + color?: string; + /** + * Size of the icon in pixels + */ + size?: number; + }; + /** + * Seamless link identifier in a form of [extensionId, linkId] + */ + extension_link_id?: string[]; + } export type ExtraSchemaAttributes = { /** * Attribute name @@ -1989,6 +2122,40 @@ declare namespace Components { _updated_at: string; // date-time _schema: "meter"; } + export interface MeterChartWidget { + id: string; + type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET" | "METER_READING_WIDGET"; + /** + * Index of the widget in the list, used for ordering (left or right) + */ + listIndex: number; + headline?: { + en?: string; + de?: string; + }; + subHeadline?: { + en?: string; + de?: string; + }; + schema?: string; + } + export interface MeterReadingWidget { + id: string; + type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET" | "METER_READING_WIDGET"; + /** + * Index of the widget in the list, used for ordering (left or right) + */ + listIndex: number; + headline?: { + en?: string; + de?: string; + }; + subHeadline?: { + en?: string; + de?: string; + }; + schema?: string; + } /** * The opportunity entity */ @@ -2203,7 +2370,7 @@ declare namespace Components { export type Origin = "END_CUSTOMER_PORTAL" | "INSTALLER_PORTAL"; export interface PaymentWidget { id: string; - type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET"; + type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET" | "METER_READING_WIDGET"; /** * Index of the widget in the list, used for ordering (left or right) */ @@ -2261,6 +2428,10 @@ declare namespace Components { * Change due date feature flag */ change_due_date?: boolean; + /** + * Enable or disable the new design for the portal + */ + new_design?: boolean; }; /** * Access token for the portal @@ -2359,10 +2530,6 @@ declare namespace Components { [name: string]: string[]; }; email_templates?: /* Email templates used for authentication and internal processes */ EmailTemplates; - /** - * Permissions granted to a portal user while accessing entities - */ - grants?: Grant[]; /** * Teaser & Banner Image web links */ @@ -2496,10 +2663,6 @@ declare namespace Components { number_of_days_before_restriction?: number; }[]; allowed_file_extensions?: /* Allowed file extensions for upload */ AllowedFileExtensions; - /** - * Configured Portal extensions - */ - extensions?: ExtensionConfig[]; /** * ID of the organization * example: @@ -2548,6 +2711,10 @@ declare namespace Components { feature_flags?: { [name: string]: boolean; }; + /** + * Permissions granted to a portal user while accessing entities + */ + grants?: Grant[]; } /** * The portal user entity @@ -2595,7 +2762,7 @@ declare namespace Components { _updated_at: string; // date-time _schema: "portal_user"; } - export type PortalWidget = EntityWidget | ContentWidget | ActionWidget | TeaserWidget | DocumentWidget | PaymentWidget; + export type PortalWidget = EntityWidget | ContentWidget | ActionWidget | TeaserWidget | DocumentWidget | PaymentWidget | MeterReadingWidget | MeterChartWidget; /** * The product entity */ @@ -2843,7 +3010,7 @@ declare namespace Components { } export interface TeaserWidget { id: string; - type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET"; + type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET" | "METER_READING_WIDGET"; /** * Index of the widget in the list, used for ordering (left or right) */ @@ -2903,6 +3070,10 @@ declare namespace Components { de?: string; }; }[]; + /** + * Configured Portal extensions + */ + extensions?: ExtensionConfig[]; /** * Default 360 user to notify upon an internal notification */ @@ -2935,6 +3106,10 @@ declare namespace Components { de?: string; }; }[]; + /** + * Configured Portal extensions + */ + extensions?: ExtensionConfig[]; /** * Default 360 user to notify upon an internal notification */ @@ -2987,6 +3162,10 @@ declare namespace Components { * Change due date feature flag */ change_due_date?: boolean; + /** + * Enable or disable the new design for the portal + */ + new_design?: boolean; }; /** * Access token for the portal @@ -3085,10 +3264,6 @@ declare namespace Components { [name: string]: string[]; }; email_templates?: /* Email templates used for authentication and internal processes */ EmailTemplates; - /** - * Permissions granted to a portal user while accessing entities - */ - grants?: Grant[]; /** * Teaser & Banner Image web links */ @@ -3222,10 +3397,6 @@ declare namespace Components { number_of_days_before_restriction?: number; }[]; allowed_file_extensions?: /* Allowed file extensions for upload */ AllowedFileExtensions; - /** - * Configured Portal extensions - */ - extensions?: ExtensionConfig[]; } export interface UpsertPortalWidget { widgets: PortalWidget[]; @@ -3266,7 +3437,7 @@ declare namespace Components { } export interface WidgetBase { id: string; - type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET"; + type: "ACTION_WIDGET" | "CONTENT_WIDGET" | "ENTITY_WIDGET" | "TEASER_WIDGET" | "DOCUMENT_WIDGET" | "PAYMENT_WIDGET" | "METER_READING_WIDGET"; /** * Index of the widget in the list, used for ordering (left or right) */ @@ -3464,6 +3635,15 @@ declare namespace Paths { * true */ exists?: boolean; + /** + * ID of the contact if exists + */ + contactId?: /** + * Entity ID + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + Components.Schemas.EntityId /* uuid */; } export type $400 = Components.Responses.InvalidRequest; export type $404 = Components.Responses.NotFound; @@ -3497,13 +3677,27 @@ declare namespace Paths { * Confirmation link token */ export type ConfirmationLinkToken = string; + /** + * Should the operation result in a 301 redirect + */ + export type UseRedirect = boolean; } export interface QueryParameters { confirmation_link_token: /* Confirmation link token */ Parameters.ConfirmationLinkToken; + use_redirect?: /* Should the operation result in a 301 redirect */ Parameters.UseRedirect; } namespace Responses { + export interface $200 { + /** + * Is the user confirmed + * example: + * true + */ + exists?: boolean; + } export interface $301 { } + export type $400 = Components.Responses.ConfirmUserInvalidRequest; export type $500 = Components.Responses.InternalServerError; } } @@ -4487,7 +4681,7 @@ declare namespace Paths { contactId?: Parameters.ContactId; } namespace Responses { - export type $200 = Components.Schemas.JourneyActions[]; + export type $200 = Components.Schemas.ExternalLink[]; export type $401 = Components.Responses.Unauthorized; export type $403 = Components.Responses.Forbidden; export type $500 = Components.Responses.InternalServerError; @@ -4754,6 +4948,10 @@ declare namespace Paths { * Change due date feature flag */ change_due_date?: boolean; + /** + * Enable or disable the new design for the portal + */ + new_design?: boolean; }; /** * Access token for the portal @@ -4852,10 +5050,6 @@ declare namespace Paths { [name: string]: string[]; }; email_templates?: /* Email templates used for authentication and internal processes */ Components.Schemas.EmailTemplates; - /** - * Permissions granted to a portal user while accessing entities - */ - grants?: Components.Schemas.Grant[]; /** * Teaser & Banner Image web links */ @@ -4989,10 +5183,6 @@ declare namespace Paths { number_of_days_before_restriction?: number; }[]; allowed_file_extensions?: /* Allowed file extensions for upload */ Components.Schemas.AllowedFileExtensions; - /** - * Configured Portal extensions - */ - extensions?: Components.Schemas.ExtensionConfig[]; /** * ID of the organization * example: @@ -5041,6 +5231,10 @@ declare namespace Paths { feature_flags?: { [name: string]: boolean; }; + /** + * Permissions granted to a portal user while accessing entities + */ + grants?: Components.Schemas.Grant[]; certificate_details?: { /** * Status of the certificate @@ -5272,6 +5466,36 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace GetResolvedExternalLink { + namespace Parameters { + export type ContactId = /** + * Entity ID + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + Components.Schemas.EntityId /* uuid */; + export type Id = /** + * Entity ID + * example: + * 5da0a718-c822-403d-9f5d-20d4584e0528 + */ + Components.Schemas.EntityId /* uuid */; + export type Origin = /* Origin of the portal */ Components.Schemas.Origin; + } + export interface PathParameters { + id: Parameters.Id; + } + export interface QueryParameters { + origin?: Parameters.Origin; + contactId?: Parameters.ContactId; + } + namespace Responses { + export type $200 = Components.Schemas.ExternalLink; + export type $401 = Components.Responses.Unauthorized; + export type $403 = Components.Responses.Forbidden; + export type $500 = Components.Responses.InternalServerError; + } + } namespace GetSchemas { namespace Responses { export interface $200 { @@ -6085,6 +6309,16 @@ export interface OperationMethods { data?: any, config?: AxiosRequestConfig ): OperationResponse + /** + * getResolvedExternalLink - getResolvedExternalLink + * + * Retrieves a resolved portal external link. + */ + 'getResolvedExternalLink'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse /** * getPublicPortalConfig - getPublicPortalConfig * @@ -6324,7 +6558,7 @@ export interface OperationMethods { parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** * confirmUserWithUserId - confirmUserWithUserId * @@ -6832,6 +7066,18 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v2/portal/resolve:external-link/{id}']: { + /** + * getResolvedExternalLink - getResolvedExternalLink + * + * Retrieves a resolved portal external link. + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } ['/v2/portal/public/portal/config']: { /** * getPublicPortalConfig - getPublicPortalConfig @@ -7108,7 +7354,7 @@ export interface PathsDictionary { parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } ['/v2/portal/user/confirm/{id}']: { /** @@ -7609,8 +7855,8 @@ export type Extension = Components.Schemas.Extension; export type ExtensionConfig = Components.Schemas.ExtensionConfig; export type ExtensionHook = Components.Schemas.ExtensionHook; export type ExtensionHookRegistrationIdentifiersCheck = Components.Schemas.ExtensionHookRegistrationIdentifiersCheck; -export type ExtensionWidget = Components.Schemas.ExtensionWidget; -export type ExtensionWidgetSeamlessLink = Components.Schemas.ExtensionWidgetSeamlessLink; +export type ExtensionSeamlessLink = Components.Schemas.ExtensionSeamlessLink; +export type ExternalLink = Components.Schemas.ExternalLink; export type ExtraSchemaAttributes = Components.Schemas.ExtraSchemaAttributes; export type FailedRuleErrorResp = Components.Schemas.FailedRuleErrorResp; export type File = Components.Schemas.File; @@ -7620,6 +7866,8 @@ export type IdentifierAttribute = Components.Schemas.IdentifierAttribute; export type InstallmentEvent = Components.Schemas.InstallmentEvent; export type JourneyActions = Components.Schemas.JourneyActions; export type Meter = Components.Schemas.Meter; +export type MeterChartWidget = Components.Schemas.MeterChartWidget; +export type MeterReadingWidget = Components.Schemas.MeterReadingWidget; export type Opportunity = Components.Schemas.Opportunity; export type Order = Components.Schemas.Order; export type OrganizationSettings = Components.Schemas.OrganizationSettings; diff --git a/clients/customer-portal-client/src/openapi.json b/clients/customer-portal-client/src/openapi.json index 3a1f90b..0adb539 100644 --- a/clients/customer-portal-client/src/openapi.json +++ b/clients/customer-portal-client/src/openapi.json @@ -17,6 +17,27 @@ { "name": "Public", "description": "Public APIs" + }, + { + "name": "portal_user_schema", + "x-displayName": "Portal User", + "description": "\n" + } + ], + "x-tagGroups": [ + { + "name": "APIs", + "tags": [ + "ECP", + "ECP Admin", + "Public" + ] + }, + { + "name": "Schemas", + "tags": [ + "portal_user_schema" + ] } ], "security": [ @@ -522,7 +543,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/JourneyActions" + "$ref": "#/components/schemas/ExternalLink" } } } @@ -540,6 +561,72 @@ } } }, + "/v2/portal/resolve:external-link/{id}": { + "get": { + "operationId": "getResolvedExternalLink", + "summary": "getResolvedExternalLink", + "description": "Retrieves a resolved portal external link.", + "tags": [ + "ECP Admin", + "ECP" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/EntityId" + }, + "description": "ID of the External Link" + }, + { + "in": "query", + "name": "origin", + "required": false, + "schema": { + "$ref": "#/components/schemas/Origin" + }, + "description": "Origin of the portal" + }, + { + "in": "query", + "name": "contactId", + "required": false, + "schema": { + "$ref": "#/components/schemas/EntityId" + }, + "description": "Contact ID of the user" + } + ], + "security": [ + { + "EitherAuth": [] + } + ], + "responses": { + "200": { + "description": "Resolved portal config link retrieved successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExternalLink" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, "/v2/portal/public/portal/config": { "get": { "operationId": "getPublicPortalConfig", @@ -1444,6 +1531,10 @@ "type": "boolean", "description": "Whether the contact exists with the given identifier values", "example": true + }, + "contactId": { + "$ref": "#/components/schemas/EntityId", + "description": "ID of the contact if exists" } } } @@ -1851,12 +1942,45 @@ "type": "string", "description": "Confirmation link token" } + }, + { + "in": "query", + "name": "use_redirect", + "required": false, + "schema": { + "type": "boolean", + "description": "Should the operation result in a 301 redirect", + "default": true + } } ], "responses": { + "200": { + "description": "Returned in case of successful user confirmation", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "confirmed" + ], + "properties": { + "exists": { + "type": "boolean", + "description": "Is the user confirmed", + "example": true + } + } + } + } + } + }, "301": { "description": "User is confirmed and redirected to the portal successfully." }, + "400": { + "$ref": "#/components/responses/ConfirmUserInvalidRequest" + }, "500": { "$ref": "#/components/responses/InternalServerError" } @@ -4618,6 +4742,33 @@ } } } + }, + "ConfirmUserInvalidRequest": { + "description": "The request could not be validated", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ErrorResp" + }, + { + "properties": { + "reason": { + "type": "string", + "enum": [ + "invalid_token" + ] + } + }, + "required": [ + "reason" + ] + } + ] + } + } + } } }, "securitySchemes": { @@ -4705,7 +4856,7 @@ }, "confirmEmailUpdate": { "$ref": "#/components/schemas/EntityId", - "description": "ID of the email template for email update confirmation" + "description": "ID of the email template for setting password while updating email" } } }, @@ -5000,6 +5151,13 @@ } } }, + "extensions": { + "type": "array", + "description": "Configured Portal extensions", + "items": { + "$ref": "#/components/schemas/ExtensionConfig" + } + }, "default_user_to_notify": { "type": "object", "description": "Default 360 user to notify upon an internal notification", @@ -5066,6 +5224,10 @@ "change_due_date": { "type": "boolean", "description": "Change due date feature flag" + }, + "new_design": { + "type": "boolean", + "description": "Enable or disable the new design for the portal" } } }, @@ -5171,13 +5333,6 @@ "email_templates": { "$ref": "#/components/schemas/EmailTemplates" }, - "grants": { - "type": "array", - "description": "Permissions granted to a portal user while accessing entities", - "items": { - "$ref": "#/components/schemas/Grant" - } - }, "images": { "type": "object", "description": "Teaser & Banner Image web links", @@ -5343,13 +5498,6 @@ }, "allowed_file_extensions": { "$ref": "#/components/schemas/AllowedFileExtensions" - }, - "extensions": { - "type": "array", - "description": "Configured Portal extensions", - "items": { - "$ref": "#/components/schemas/ExtensionConfig" - } } } }, @@ -5426,6 +5574,13 @@ "additionalProperties": { "type": "boolean" } + }, + "grants": { + "type": "array", + "description": "Permissions granted to a portal user while accessing entities", + "items": { + "$ref": "#/components/schemas/Grant" + } } } } @@ -5464,7 +5619,8 @@ "ENTITY_WIDGET", "TEASER_WIDGET", "DOCUMENT_WIDGET", - "PAYMENT_WIDGET" + "PAYMENT_WIDGET", + "METER_READING_WIDGET" ] }, "listIndex": { @@ -5510,6 +5666,36 @@ } ] }, + "MeterReadingWidget": { + "allOf": [ + { + "$ref": "#/components/schemas/WidgetBase" + }, + { + "type": "object", + "properties": { + "schema": { + "type": "string" + } + } + } + ] + }, + "MeterChartWidget": { + "allOf": [ + { + "$ref": "#/components/schemas/WidgetBase" + }, + { + "type": "object", + "properties": { + "schema": { + "type": "string" + } + } + } + ] + }, "WidgetAction": { "type": "object", "properties": { @@ -5667,6 +5853,12 @@ }, { "$ref": "#/components/schemas/PaymentWidget" + }, + { + "$ref": "#/components/schemas/MeterReadingWidget" + }, + { + "$ref": "#/components/schemas/MeterChartWidget" } ] }, @@ -6920,6 +7112,82 @@ } } }, + "ExternalLink": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the external link" + }, + "label": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "link", + "journey", + "seamless" + ] + }, + "link": { + "type": "string", + "description": "The URL of the external link" + }, + "rules": { + "type": "array", + "items": { + "type": "object" + } + }, + "attribute": { + "type": "string", + "description": "Attribute associated with the link" + }, + "entity": { + "type": "string", + "description": "Entity associated with the link" + }, + "attribute_value": { + "type": "string", + "description": "Attribute value for the link" + }, + "icon": { + "type": "object", + "description": "Configuration of the icon for the external link", + "properties": { + "name": { + "type": "string", + "description": "The name of the icon" + }, + "color": { + "type": "string", + "description": "The color of the icon" + }, + "size": { + "type": "integer", + "description": "Size of the icon in pixels" + } + } + }, + "extension_link_id": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Seamless link identifier in a form of [extensionId, linkId]" + } + }, + "required": [ + "id", + "label", + "type", + "link" + ] + }, "WorkflowExecution": { "type": "object", "properties": {}, @@ -7345,68 +7613,85 @@ ], "description": "Name of the extension." }, + "description": { + "type": "object", + "properties": { + "en": { + "type": "string", + "description": "Name of the extension in English." + } + }, + "additionalProperties": { + "type": "string", + "description": "Name of the extension in some other language denoted by ISO 3166-1 alpha-2 code." + }, + "required": [ + "en" + ], + "description": "Name of the extension." + }, "version": { "type": "string", "description": "Version of the extension." }, - "variables": { + "options": { "type": "array", - "description": "Variables available to the extension configurable by the portal administrator.", + "description": "Options available to the extension configurable by the portal administrator.", "items": { "type": "object", "properties": { "id": { "type": "string", - "description": "Identifier of the variable. Should not change between updates." + "description": "Identifier of the option. Should not change between updates." }, "name": { "type": "object", "properties": { "en": { "type": "string", - "description": "Name of the variable in English." + "description": "Name of the option in English." } }, "additionalProperties": { "type": "string", - "description": "Name of the variable in some other language denoted by ISO 3166-1 alpha-2 code." + "description": "Name of the option in some other language denoted by ISO 3166-1 alpha-2 code." }, "required": [ "en" ], - "description": "Name of the variable." + "description": "Name of the option." }, "type": { "type": "string", "enum": [ "secret" ], - "description": "Type of the variable." + "description": "Type of the option." }, "description": { "type": "object", "properties": { "en": { "type": "string", - "description": "Description of the variable in English." + "description": "Description of the option in English." } }, "additionalProperties": { "type": "string", - "description": "Description of the variable in some other language denoted by ISO 3166-1 alpha-2 code." + "description": "Description of the option in some other language denoted by ISO 3166-1 alpha-2 code." }, "required": [ "en" ], - "description": "Description of the variable." + "description": "Description of the option." }, "default": { "type": "string", - "description": "Default value of the variable." + "description": "Default value of the option." }, "required": { "type": "boolean", - "description": "Indicate whether the variable is required.", + "description": "Indicate whether the option is required.", "default": false } }, @@ -7417,20 +7702,13 @@ ] } }, - "widgets": { + "links": { "type": "array", - "description": "Widgets that can be used by portal administrator.", + "description": "External links added to the portal.", "items": { "allOf": [ { - "$ref": "#/components/schemas/ExtensionWidget" - }, - { - "anyOf": [ - { - "$ref": "#/components/schemas/ExtensionWidgetSeamlessLink" - } - ] + "$ref": "#/components/schemas/ExtensionSeamlessLink" } ] } @@ -7460,67 +7738,56 @@ "description" ] }, - "ExtensionWidget": { + "ExtensionSeamlessLink": { "type": "object", "properties": { "id": { "type": "string", - "description": "Identifier of the widget. Should not change between updates." + "description": "Identifier of the link. Should not change between updates." }, "name": { "type": "object", "properties": { "en": { "type": "string", - "description": "Name of the widget in English." + "description": "Name of the extension in English." } }, "additionalProperties": { "type": "string", - "description": "Name of the widget in some other language denoted by ISO 3166-1 alpha-2 code." + "description": "Name of the extension in some other language denoted by ISO 3166-1 alpha-2 code." }, "required": [ "en" ], - "description": "Name of the widget." + "description": "Name of the extension." }, "description": { "type": "object", "properties": { "en": { "type": "string", - "description": "Description of the widget in English." + "description": "Name of the extension in English." } }, "additionalProperties": { "type": "string", - "description": "Description of the widget in some other language denoted by ISO 3166-1 alpha-2 code." + "description": "Name of the extension in some other language denoted by ISO 3166-1 alpha-2 code." }, "required": [ "en" ], - "description": "Description of the widget." - } - } - }, - "ExtensionWidgetSeamlessLink": { - "type": "object", - "properties": { + "description": "Name of the extension." + }, "type": { "type": "string", "enum": [ - "seamlessLink" + "seamless" ] }, - "authentication": { + "auth": { "type": "object", "properties": { - "type": { - "type": "string", - "enum": [ - "token" - ] - }, "method": { "type": "string", "description": "HTTP method to use for authentication", @@ -7528,11 +7795,11 @@ }, "url": { "type": "string", - "description": "URL to use for authentication" + "description": "URL to use for authentication. Supports variable interpolation." }, "params": { "type": "object", - "description": "Parameters to append to the URL.", + "description": "Parameters to append to the URL. Supports variable interpolation.", "additionalProperties": { "type": "string" }, @@ -7540,7 +7807,7 @@ }, "headers": { "type": "object", - "description": "Headers to use for authentication", + "description": "Headers to use for authentication. Supports variable interpolation.", "additionalProperties": { "type": "string" }, @@ -7548,24 +7815,27 @@ }, "body": { "type": "object", - "description": "JSON body to use for authentication", + "description": "JSON body to use for authentication. Supports variable interpolation.", "additionalProperties": { "type": "string" }, "default": {} } - } + }, + "required": [ + "url" + ] }, "redirect": { "type": "object", "properties": { "url": { "type": "string", - "description": "URL to redirect to." + "description": "URL to redirect to. Supports variable interpolation." }, "params": { "type": "object", - "description": "Parameters to append to the URL.", + "description": "Parameters to append to the URL. Supports variable interpolation.", "additionalProperties": { "type": "string" }, @@ -7573,7 +7843,13 @@ } } } - } + }, + "required": [ + "id", + "name", + "type", + "redirect" + ] }, "ExtensionHook": { "type": "object", @@ -7585,7 +7861,7 @@ } }, "ExtensionHookRegistrationIdentifiersCheck": { - "description": "Hook that replaces the built-in registration identifiers check. This hook makes the specified call whenever a user is trying to register to find the corresponding contact. The expected response to the call is:\n - 200 with body `{ \"contactId\": \"uuid\" }` if exactly one contact is found\n - 404 if no contact is found or more than contact is found\n", + "description": "Hook that replaces the built-in registration identifiers check. This hook makes a POST call whenever a user is trying to register to find the corresponding contact. The expected response to the call is:\n - 200 with contact id if exactly one contact is found\n - 404 if no contact is found or more than contact is found\n", "type": "object", "properties": { "type": { @@ -7594,6 +7870,47 @@ "registrationIdentifiersCheck" ] }, + "auth": { + "type": "object", + "properties": { + "method": { + "type": "string", + "description": "HTTP method to use for authentication", + "default": "GET" + }, + "url": { + "type": "string", + "description": "URL to use for authentication. Supports variable interpolation." + }, + "params": { + "type": "object", + "description": "Parameters to append to the URL. Supports variable interpolation.", + "additionalProperties": { + "type": "string" + }, + "default": {} + }, + "headers": { + "type": "object", + "description": "Headers to use for authentication. Supports variable interpolation.", + "additionalProperties": { + "type": "string" + }, + "default": {} + }, + "body": { + "type": "object", + "description": "JSON body to use for authentication. Supports variable interpolation.", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "required": [ + "url" + ] + }, "call": { "type": "object", "properties": { @@ -7603,7 +7920,7 @@ }, "params": { "type": "object", - "description": "Parameters to append to the URL.", + "description": "Parameters to append to the URL. Supports variable interpolation.", "additionalProperties": { "type": "string" }, @@ -7616,11 +7933,16 @@ "type": "string" }, "default": {} + }, + "result": { + "type": "string", + "description": "Contact ID usually retrieved from the response body, e.g. `{{CallResponse.data.contactId}}`. Supports variable interpolation." } }, "required": [ "url", - "headers" + "headers", + "result" ] } },