From f93e6b6b290d63f70811ded575af6c5e89723099 Mon Sep 17 00:00:00 2001 From: Jakub Claude Date: Wed, 11 Nov 2026 08:45:37 +0000 Subject: [PATCH 1/3] chore(design-client): update design builder API spec Sync with the prod design-builder-api spec: adds generateDesign and generateDesignDocument, regenerates types, SDK v2 and CLI definitions. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HtDoULXUVaHMuES6rnCxLK --- .../design-client-generate-endpoints.md | 7 + .../design-client/src/openapi-runtime.json | 32 + clients/design-client/src/openapi.d.ts | 635 ++++++++++++++++- clients/design-client/src/openapi.json | 669 +++++++++++++++++- packages/cli/definitions/design.json | 669 +++++++++++++++++- packages/cli/docs/design.md | 286 +++++--- packages/epilot-sdk-v2/docs/design.md | 555 +++++++++++++-- .../src/definitions/design-runtime.json | 2 +- packages/epilot-sdk-v2/src/docs/design.json | 2 +- packages/epilot-sdk-v2/src/types/design.d.ts | 635 ++++++++++++++++- 10 files changed, 3272 insertions(+), 220 deletions(-) create mode 100644 .changeset/design-client-generate-endpoints.md diff --git a/.changeset/design-client-generate-endpoints.md b/.changeset/design-client-generate-endpoints.md new file mode 100644 index 000000000..43d879a74 --- /dev/null +++ b/.changeset/design-client-generate-endpoints.md @@ -0,0 +1,7 @@ +--- +"@epilot/design-client": minor +"@epilot/sdk": patch +"@epilot/cli": patch +--- + +Refresh the Design Builder API contract and expose `generateDesign` (`POST /v1/designs/generate`) and `generateDesignDocument` (`POST /v1/designs/document/generate`). diff --git a/clients/design-client/src/openapi-runtime.json b/clients/design-client/src/openapi-runtime.json index eec01c16f..beab6dd59 100644 --- a/clients/design-client/src/openapi-runtime.json +++ b/clients/design-client/src/openapi-runtime.json @@ -56,6 +56,11 @@ "in": "path", "name": "designId", "required": true + }, + { + "in": "header", + "name": "If-Match", + "required": false } ], "requestBody": { @@ -83,6 +88,7 @@ "/v1/designs/{designId}/parse": { "get": { "operationId": "getThemeFromDesign", + "deprecated": true, "parameters": [ { "in": "path", @@ -103,6 +109,30 @@ "responses": {} } }, + "/v1/designs/generate": { + "post": { + "operationId": "generateDesign", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, + "/v1/designs/document/generate": { + "post": { + "operationId": "generateDesignDocument", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, "/v1/designs/files": { "post": { "operationId": "uploadFile", @@ -167,6 +197,7 @@ "/v1/designs/addConsumer/{application}/{designId}": { "put": { "operationId": "addConsumer", + "deprecated": true, "parameters": [ { "in": "path", @@ -191,6 +222,7 @@ "/v1/designs/removeConsumer/{application}/{designId}": { "put": { "operationId": "removeConsumer", + "deprecated": true, "parameters": [ { "in": "path", diff --git a/clients/design-client/src/openapi.d.ts b/clients/design-client/src/openapi.d.ts index d217a15f7..940c7ade2 100644 --- a/clients/design-client/src/openapi.d.ts +++ b/clients/design-client/src/openapi.d.ts @@ -16,9 +16,11 @@ declare namespace Components { */ DesignId; consumer_name: string; - should_delete?: string; } export interface AddDesignReq { + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ design: { brand_id?: string; brand_name?: string; @@ -279,9 +281,29 @@ declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }; } export interface AddDesignRes { + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ design?: { id?: string; /** @@ -552,6 +574,23 @@ declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }; } /** @@ -583,6 +622,33 @@ declare namespace Components { id: string; name: string; } + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ + export interface DesignDocumentV1 { + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; + } + export interface DesignFinding { + id: FindingId; + status: FindingStatus; + detail?: FindingDetail; + } /** * Id of the design * example: @@ -634,6 +700,10 @@ declare namespace Components { } export interface ErrorResp { message?: string; + /** + * Machine-readable reason, e.g. `invalid_url` or `rate_limited` + */ + code?: string; error?: { [key: string]: any; }; @@ -649,6 +719,14 @@ declare namespace Components { */ file_id?: string; } + export interface FindingDetail { + /** + * Font family that was found but cannot be loaded + */ + family: string; + } + export type FindingId = "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon"; + export type FindingStatus = "found" | "not_found" | "not_available"; export interface FontData { font_id: string; font_name: string; @@ -662,6 +740,68 @@ declare namespace Components { type?: "WOFF2" | "WOFF" | "TTF" | "EOT"; url?: string; } + export interface GenerateDesignDocumentReq { + /** + * Public website to read the design from + * example: + * https://www.stadtwerke-musterstadt.de + */ + url: string; // uri + } + export interface GenerateDesignDocumentRes { + document: /* Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. */ DesignDocumentV1; + findings: [ + DesignFinding, + DesignFinding, + DesignFinding, + DesignFinding, + DesignFinding, + DesignFinding + ]; + /** + * example: + * Stadtwerke Musterstadt + */ + site_name: string; + /** + * True when the response was served from an earlier successful generation for this organization, normalised URL and generator version + */ + cached: boolean; + } + export interface GenerateDesignReq { + /** + * Public website to derive the design from + * example: + * https://www.twl.de + */ + url: string; // uri + } + export interface GenerateDesignRes { + design: /* Partial design to merge into the design being edited */ GeneratedDesign; + /** + * True when the design was generated earlier for this organization and URL + */ + cached: boolean; + } + /** + * Partial design to merge into the design being edited + */ + export interface GeneratedDesign { + style: { + logo: LogoData; + palette: PaletteData; + typography: TypographyData; + }; + theme: { + shape: { + /** + * example: + * 8 + */ + borderRadius: string; + }; + }; + } export interface GetAllDesignsRes { designs?: { id?: string; @@ -933,6 +1073,23 @@ declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }[]; } export interface GetBrandsRes { @@ -949,6 +1106,9 @@ declare namespace Components { }[]; } export interface GetDesignRes { + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ design?: { id?: string; /** @@ -1219,6 +1379,23 @@ declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }; } export type GetFilesRes = { @@ -1518,6 +1695,28 @@ declare namespace Components { journey_design_tokens?: { [key: string]: any; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + /** + * v1 designs only: the journey group of @epilot/design-document (custom_css, tokens and the journey overrides primary_color, font, border_radius, logo), derived on read from the stored journey fields and compared with the stored v1 groups. What a journey paints from it equals what it paints from the theme built from the old fields. Not returned by GET. + */ + journey?: { + [name: string]: any; + }; }; } export interface RemoveConsumerReq { @@ -1527,7 +1726,6 @@ declare namespace Components { * 4a062990-a6a3-11eb-9828-4f3da7d4935a */ DesignId; - should_delete?: string; } export interface ShapeData { border_radius?: number; @@ -1543,7 +1741,304 @@ declare namespace Components { primary: string; secondary: string; } + export interface UpdateDesignConflict { + message?: string; + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ + design?: { + id?: string; + /** + * Creation date and time + * example: + * 2021-01-30T08:30:00Z + */ + created_at?: string; + created_by?: string; + edited: boolean; + last_modified_at?: string; + brand_id?: string; + brand_name?: string; + user?: { + emailaddress?: string; + fullname?: string; + name?: string; + userid?: string; + }; + style_name: string; + style: { + logo?: LogoData; + palette: PaletteData; + typography: TypographyData; + shape?: ShapeData; + consumer: ConsumerData; + }; + is_default?: boolean; + /** + * The manifest IDs associated with this design + */ + _manifest?: string[]; + custom_theme?: string; + use_custom_theme?: boolean; + /** + * Design tokens for journey customization + */ + design_tokens?: { + coupon?: string; + cashback?: string; + custom_css?: string; + /** + * Accent color, defaults to primary + */ + accent_color?: string; + /** + * Global outline/focus color + */ + outline_color?: string; + /** + * Divider line color + */ + divider_color?: string; + /** + * Link text color + */ + link_color?: string; + /** + * Link hover text color + */ + link_hover_color?: string; + /** + * Font size scale factor + */ + font_size_scale?: "xs" | "sm" | "md" | "lg" | "xl"; + /** + * Topbar minimum height in pixels + */ + topbar_height?: number; + /** + * Logo/content alignment in the top bar + */ + topbar_logo_alignment?: "flex-start" | "center" | "flex-end"; + /** + * Logo size in pixels + */ + logo_size?: number; + /** + * Input field background color + */ + input_background?: string; + /** + * Input field border color + */ + input_border_color?: string; + /** + * Input field text color + */ + input_text_color?: string; + /** + * Input field label color + */ + input_label_color?: string; + /** + * Input field border radius in pixels + */ + input_border_radius?: number; + /** + * Input field height in pixels + */ + input_height?: number; + /** + * Input field variant style + */ + input_variant?: "outlined" | "filled" | "underlined"; + /** + * Primary button background color or gradient + */ + button_primary_bg?: string; + /** + * Primary button text color + */ + button_primary_text?: string; + /** + * Primary button hover background color or gradient + */ + button_primary_hover_bg?: string; + /** + * Primary button hover text color + */ + button_primary_hover_text?: string; + /** + * Outlined button border color + */ + button_outlined_border?: string; + /** + * Outlined button text color + */ + button_outlined_text?: string; + /** + * Outlined button hover background color + */ + button_outlined_hover_bg?: string; + /** + * Outlined button hover text color + */ + button_outlined_hover_text?: string; + /** + * Ghost button background color + */ + button_ghost_bg?: string; + /** + * Ghost button text color + */ + button_ghost_text?: string; + /** + * Ghost button hover background color + */ + button_ghost_hover_bg?: string; + /** + * Ghost button hover text color + */ + button_ghost_hover_text?: string; + /** + * Button border radius in pixels + */ + button_border_radius?: number; + /** + * Button height in pixels + */ + button_height?: number; + /** + * Card background color + */ + card_background?: string; + /** + * Card border color for outlined variant + */ + card_border_color?: string; + /** + * Card visual variant + */ + card_variant?: "shadow" | "outlined"; + /** + * Summary card background color + */ + summary_card_background?: string; + /** + * Toggle button selected background color + */ + toggle_selected_bg?: string; + /** + * Toggle button selected text color + */ + toggle_selected_text?: string; + /** + * Toggle button hover background color + */ + toggle_hover_bg?: string; + /** + * Toggle button hover text color + */ + toggle_hover_text?: string; + /** + * Toggle group wrapper border color + */ + toggle_border_color?: string; + /** + * Dropdown option hover background color + */ + dropdown_hover_bg?: string; + /** + * Dropdown option hover text color + */ + dropdown_hover_text?: string; + /** + * Dropdown option selected background color + */ + dropdown_selected_bg?: string; + /** + * Dropdown option selected text color + */ + dropdown_selected_text?: string; + /** + * Switch unchecked thumb color + */ + switch_unchecked_color?: string; + /** + * Switch unchecked track background color + */ + switch_unchecked_bg?: string; + /** + * Switch border radius in pixels + */ + switch_border_radius?: number; + /** + * Checkbox unchecked border color + */ + checkbox_unchecked_color?: string; + /** + * Checkbox label text color + */ + checkbox_label_color?: string; + /** + * Radio button unchecked border color + */ + radio_unchecked_color?: string; + /** + * Radio button label text color + */ + radio_label_color?: string; + /** + * Date picker selected date background color + */ + datepicker_selected_bg?: string; + /** + * Date picker selected date text color + */ + datepicker_selected_color?: string; + /** + * Date picker border radius in pixels + */ + datepicker_border_radius?: number; + /** + * Chip background color + */ + chip_background?: string; + /** + * Chip hover background color + */ + chip_hover_background?: string; + /** + * Chip text color + */ + chip_text_color?: string; + /** + * Chip hover text color + */ + chip_hover_text_color?: string; + }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; + }; + } export interface UpdateDesignReq { + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ design: { brand_id?: string; brand_name?: string; @@ -1804,6 +2299,23 @@ declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }; } export interface UploadFileReq { @@ -1887,7 +2399,9 @@ declare namespace Paths { export type $401 = Components.Schemas.ErrorResp; export interface $404 { } + export type $409 = Components.Schemas.ErrorResp; export type $500 = Components.Schemas.ErrorResp; + export type $503 = Components.Schemas.ErrorResp; } } namespace DuplicateDesign { @@ -1911,6 +2425,33 @@ declare namespace Paths { export type $500 = Components.Schemas.ErrorResp; } } + namespace GenerateDesign { + export type RequestBody = Components.Schemas.GenerateDesignReq; + namespace Responses { + export type $200 = Components.Schemas.GenerateDesignRes; + export type $201 = Components.Schemas.GenerateDesignRes; + export type $400 = Components.Schemas.ErrorResp; + export type $401 = Components.Schemas.ErrorResp; + export type $403 = Components.Schemas.ErrorResp; + export type $422 = Components.Schemas.ErrorResp; + export type $502 = Components.Schemas.ErrorResp; + export type $504 = Components.Schemas.ErrorResp; + } + } + namespace GenerateDesignDocument { + export type RequestBody = Components.Schemas.GenerateDesignDocumentReq; + namespace Responses { + export type $200 = Components.Schemas.GenerateDesignDocumentRes; + export type $201 = Components.Schemas.GenerateDesignDocumentRes; + export type $400 = Components.Schemas.ErrorResp; + export type $401 = Components.Schemas.ErrorResp; + export type $403 = Components.Schemas.ErrorResp; + export type $422 = Components.Schemas.ErrorResp; + export type $429 = Components.Schemas.ErrorResp; + export type $502 = Components.Schemas.ErrorResp; + export type $504 = Components.Schemas.ErrorResp; + } + } namespace GetAllDesigns { namespace Responses { export type $200 = Components.Schemas.GetAllDesignsRes; @@ -2050,6 +2591,9 @@ declare namespace Paths { } } namespace UpdateDesign { + export interface HeaderParameters { + "If-Match"?: Parameters.IfMatch; + } namespace Parameters { export type DesignId = /** * Id of the design @@ -2057,6 +2601,7 @@ declare namespace Paths { * 4a062990-a6a3-11eb-9828-4f3da7d4935a */ Components.Schemas.DesignId; + export type IfMatch = string; } export interface PathParameters { designId: Parameters.DesignId; @@ -2069,6 +2614,7 @@ declare namespace Paths { export type $401 = Components.Schemas.ErrorResp; export interface $404 { } + export type $409 = Components.Schemas.UpdateDesignConflict; export type $500 = Components.Schemas.ErrorResp; } } @@ -2118,10 +2664,10 @@ export interface OperationMethods { /** * updateDesign - updateDesign * - * Update a especific design owned by user organization + * Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`, `custom_theme` and `use_custom_theme` untouched. A body without `version` on a v1 design is treated as an old client's read-modify-write: those four fields are stored as sent, and brand-wide changes in `style` are applied to the v1 groups. */ 'updateDesign'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: Paths.UpdateDesign.RequestBody, config?: AxiosRequestConfig ): OperationResponse @@ -2148,13 +2694,42 @@ export interface OperationMethods { /** * getThemeFromDesign - getThemeFromDesign * - * Search for a especific design owned by user organization and parse them to a new or old theme + * Search for a especific design owned by user organization and parse them to a new or old theme. Deprecated: kept for old readers only. For a v1 design the response carries the v1 groups and the derived `journey` group next to the stored old fields and the theme built from them; new runtimes read the v1 groups. */ 'getThemeFromDesign'( parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig ): OperationResponse + /** + * generateDesign - generateDesign + * + * Generates a design (palette, text colours, font, logo and border radius) from a public + * website with AI. The result is cached per organization and URL for 30 days. + * + */ + 'generateDesign'( + parameters?: Parameters | null, + data?: Paths.GenerateDesign.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * generateDesignDocument - generateDesignDocument + * + * Reads a public website and returns a v1 design document plus one finding for each + * id in fixed order. This version chooses the favicon in code and derives the site name. + * The other findings are `not_found` until they are implemented. The document contains + * only the leaves that passed validation, and defaults are not pruned. + * Successful responses are cached per organization, normalised URL and generator version + * for 7 days. Each organization may run 20 new generations per UTC day; cache hits do not + * count toward the limit. A client abort still finishes on the server and is cached. + * + */ + 'generateDesignDocument'( + parameters?: Parameters | null, + data?: Paths.GenerateDesignDocument.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse /** * getFiles - getFiles * @@ -2274,10 +2849,10 @@ export interface PathsDictionary { /** * updateDesign - updateDesign * - * Update a especific design owned by user organization + * Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`, `custom_theme` and `use_custom_theme` untouched. A body without `version` on a v1 design is treated as an old client's read-modify-write: those four fields are stored as sent, and brand-wide changes in `style` are applied to the v1 groups. */ 'put'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: Paths.UpdateDesign.RequestBody, config?: AxiosRequestConfig ): OperationResponse @@ -2298,7 +2873,7 @@ export interface PathsDictionary { /** * getThemeFromDesign - getThemeFromDesign * - * Search for a especific design owned by user organization and parse them to a new or old theme + * Search for a especific design owned by user organization and parse them to a new or old theme. Deprecated: kept for old readers only. For a v1 design the response carries the v1 groups and the derived `journey` group next to the stored old fields and the theme built from them; new runtimes read the v1 groups. */ 'get'( parameters?: Parameters | null, @@ -2306,6 +2881,39 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v1/designs/generate']: { + /** + * generateDesign - generateDesign + * + * Generates a design (palette, text colours, font, logo and border radius) from a public + * website with AI. The result is cached per organization and URL for 30 days. + * + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.GenerateDesign.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v1/designs/document/generate']: { + /** + * generateDesignDocument - generateDesignDocument + * + * Reads a public website and returns a v1 design document plus one finding for each + * id in fixed order. This version chooses the favicon in code and derives the site name. + * The other findings are `not_found` until they are implemented. The document contains + * only the leaves that passed validation, and defaults are not pruned. + * Successful responses are cached per organization, normalised URL and generator version + * for 7 days. Each organization may run 20 new generations per UTC day; cache hits do not + * count toward the limit. A client abort still finishes on the server and is cached. + * + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.GenerateDesignDocument.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } ['/v1/designs/files']: { /** * uploadFile - uploadFile @@ -2401,13 +3009,23 @@ export type BrandItem = Components.Schemas.BrandItem; export type ConsumerData = Components.Schemas.ConsumerData; export type Custom_Style = Components.Schemas.CustomStyle; export type CustomerPortalData = Components.Schemas.CustomerPortalData; +export type Design_Document_V1 = Components.Schemas.DesignDocumentV1; +export type DesignFinding = Components.Schemas.DesignFinding; export type DesignId = Components.Schemas.DesignId; export type DesignItem = Components.Schemas.DesignItem; export type DesignParameters = Components.Schemas.DesignParameters; export type ErrorResp = Components.Schemas.ErrorResp; export type FileData = Components.Schemas.FileData; +export type FindingDetail = Components.Schemas.FindingDetail; +export type FindingId = Components.Schemas.FindingId; +export type FindingStatus = Components.Schemas.FindingStatus; export type FontData = Components.Schemas.FontData; export type FontResponseUrl = Components.Schemas.FontResponseUrl; +export type GenerateDesignDocumentReq = Components.Schemas.GenerateDesignDocumentReq; +export type GenerateDesignDocumentRes = Components.Schemas.GenerateDesignDocumentRes; +export type GenerateDesignReq = Components.Schemas.GenerateDesignReq; +export type GenerateDesignRes = Components.Schemas.GenerateDesignRes; +export type GeneratedDesign = Components.Schemas.GeneratedDesign; export type GetAllDesignsRes = Components.Schemas.GetAllDesignsRes; export type GetBrandsRes = Components.Schemas.GetBrandsRes; export type GetDesignRes = Components.Schemas.GetDesignRes; @@ -2421,6 +3039,7 @@ export type RemoveConsumerReq = Components.Schemas.RemoveConsumerReq; export type ShapeData = Components.Schemas.ShapeData; export type Theme = Components.Schemas.Theme; export type TypographyData = Components.Schemas.TypographyData; +export type UpdateDesignConflict = Components.Schemas.UpdateDesignConflict; export type UpdateDesignReq = Components.Schemas.UpdateDesignReq; export type UploadFileReq = Components.Schemas.UploadFileReq; export type UploadFileRes = Components.Schemas.UploadFileRes; diff --git a/clients/design-client/src/openapi.json b/clients/design-client/src/openapi.json index 2e4c25182..bccf35dec 100644 --- a/clients/design-client/src/openapi.json +++ b/clients/design-client/src/openapi.json @@ -24,6 +24,11 @@ "/v1/designs": { "get": { "operationId": "getAllDesigns", + "x-epilot-permissions": [ + { + "action": "design:view" + } + ], "summary": "getAllDesigns", "description": "Scan all designs linked to a organization, based in orgId attribute from JWT auth token", "tags": [ @@ -54,6 +59,11 @@ }, "post": { "operationId": "addDesign", + "x-epilot-permissions": [ + { + "action": "design:create" + } + ], "summary": "addDesign", "description": "Create a brand new design linked to a organization, based in orgId attribute from JWT auth token", "tags": [ @@ -117,6 +127,11 @@ "/v1/designs/{designId}": { "get": { "operationId": "getDesign", + "x-epilot-permissions": [ + { + "action": "design:view" + } + ], "summary": "getDesign", "description": "Search for a especific design owned by user organization", "tags": [ @@ -180,6 +195,11 @@ }, "delete": { "operationId": "deleteDesign", + "x-epilot-permissions": [ + { + "action": "design:delete" + } + ], "summary": "deleteDesign", "description": "Search and delete for a especific design owned by user organization", "tags": [ @@ -222,6 +242,16 @@ "404": { "description": "No design found" }, + "409": { + "description": "The design cannot be deleted: it is the only one of the organization, it is still\nassigned to journeys (listed in `journeys`) or portals (listed in `portals`), or the\ncaller may not view the organization's portals, so their usage cannot be checked.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, "500": { "description": "Other errors", "content": { @@ -231,13 +261,28 @@ } } } + }, + "503": { + "description": "customer-portal-api could not be reached to check which portals use the design. Retry later.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } } } }, "put": { "operationId": "updateDesign", + "x-epilot-permissions": [ + { + "action": "design:edit" + } + ], "summary": "updateDesign", - "description": "Update a especific design owned by user organization", + "description": "Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`, `custom_theme` and `use_custom_theme` untouched. A body without `version` on a v1 design is treated as an old client's read-modify-write: those four fields are stored as sent, and brand-wide changes in `style` are applied to the v1 groups.", "tags": [ "design-builder" ], @@ -249,6 +294,15 @@ "schema": { "$ref": "#/components/schemas/DesignId" } + }, + { + "in": "header", + "name": "If-Match", + "required": false, + "description": "The `last_modified_at` of the design the client read. When it no longer matches the stored design, the update is rejected with 409. Without the header the update is unconditional.", + "schema": { + "type": "string" + } } ], "requestBody": { @@ -289,6 +343,16 @@ "404": { "description": "No design found" }, + "409": { + "description": "The design was changed since the `If-Match` value was read. Returns the current design.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateDesignConflict" + } + } + } + }, "500": { "description": "Other errors", "content": { @@ -305,6 +369,11 @@ "/v1/designs/{designId}/duplicate": { "post": { "operationId": "duplicateDesign", + "x-epilot-permissions": [ + { + "action": "design:create" + } + ], "summary": "duplicateDesign", "description": "Duplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marked as a copy) but does NOT carry over journey/portal relations, so the new design starts with 0 consumers, exactly like a freshly created design.", "tags": [ @@ -371,7 +440,8 @@ "get": { "operationId": "getThemeFromDesign", "summary": "getThemeFromDesign", - "description": "Search for a especific design owned by user organization and parse them to a new or old theme", + "deprecated": true, + "description": "Search for a especific design owned by user organization and parse them to a new or old theme. Deprecated: kept for old readers only. For a v1 design the response carries the v1 groups and the derived `journey` group next to the stored old fields and the theme built from them; new runtimes read the v1 groups.", "security": [], "tags": [ "design-builder" @@ -450,9 +520,245 @@ } } }, + "/v1/designs/generate": { + "post": { + "operationId": "generateDesign", + "x-epilot-permissions": [ + { + "anyOf": [ + { + "action": "design:create" + }, + { + "action": "design:edit" + } + ] + } + ], + "summary": "generateDesign", + "description": "Generates a design (palette, text colours, font, logo and border radius) from a public\nwebsite with AI. The result is cached per organization and URL for 30 days.\n", + "tags": [ + "design-builder" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignReq" + } + } + } + }, + "responses": { + "200": { + "description": "A design generated earlier for this organization and URL", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignRes" + } + } + } + }, + "201": { + "description": "A newly generated design", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignRes" + } + } + } + }, + "400": { + "description": "The URL is not a valid http(s) URL (`invalid_url`) or points to a private network (`blocked_url`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "401": { + "description": "Authentication Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "403": { + "description": "The caller may not edit designs", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "422": { + "description": "The website could not be fetched (`fetch_failed`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "502": { + "description": "The design could not be generated (`generation_failed`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "504": { + "description": "The generation did not finish in time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + } + } + } + }, + "/v1/designs/document/generate": { + "post": { + "operationId": "generateDesignDocument", + "x-epilot-permissions": [ + { + "action": "design:create" + } + ], + "summary": "generateDesignDocument", + "description": "Reads a public website and returns a v1 design document plus one finding for each\nid in fixed order. This version chooses the favicon in code and derives the site name.\nThe other findings are `not_found` until they are implemented. The document contains\nonly the leaves that passed validation, and defaults are not pruned.\nSuccessful responses are cached per organization, normalised URL and generator version\nfor 7 days. Each organization may run 20 new generations per UTC day; cache hits do not\ncount toward the limit. A client abort still finishes on the server and is cached.\n", + "tags": [ + "design-builder" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignDocumentReq" + } + } + } + }, + "responses": { + "200": { + "description": "A design document generated earlier for this organization, URL and generator version", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignDocumentRes" + } + } + } + }, + "201": { + "description": "A newly generated design document", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignDocumentRes" + } + } + } + }, + "400": { + "description": "The URL is not a valid http(s) URL (`invalid_url`) or points to a private network (`blocked_url`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "401": { + "description": "Authentication Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "403": { + "description": "The caller does not have design:create", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "422": { + "description": "The website could not be fetched (`fetch_failed`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "429": { + "description": "The organization has used today's generation limit (`rate_limited`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "502": { + "description": "Generation failed, or no finding survived (`generation_failed`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "504": { + "description": "The 27 second budget ran out (`timeout`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + } + } + } + }, "/v1/designs/files": { "post": { "operationId": "uploadFile", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "uploadFile", "description": "Upload a new file for the user organization bucket", "tags": [ @@ -519,6 +825,11 @@ }, "get": { "operationId": "getFiles", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "getFiles", "description": "List all files for the user organization bucket", "tags": [ @@ -589,6 +900,11 @@ "get": { "deprecated": true, "operationId": "getLimit", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "getLimit", "description": "Gets designs number limit from database per organization", "tags": [ @@ -622,6 +938,11 @@ "get": { "deprecated": true, "operationId": "getBrands", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "getBrands", "description": "Scan all brands linked to a organization, based in orgId attribute from JWT auth token", "tags": [ @@ -657,6 +978,11 @@ "/v1/designs/consumer/{application}/{consumerId}": { "get": { "operationId": "getConsumerDesign", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "getConsumerDesign", "description": "Search for a especific design owned by user organization", "tags": [ @@ -730,6 +1056,30 @@ "/v1/designs/addConsumer/{application}/{designId}": { "put": { "operationId": "addConsumer", + "deprecated": true, + "x-epilot-permissions": [ + { + "anyOf": [ + { + "action": "entity:edit", + "resource": "journey" + }, + { + "action": "customer_portal:edit" + }, + { + "action": "installer_portal:edit" + }, + { + "action": "portal:content:edit", + "resource": "{consumer_id}" + }, + { + "action": "design:edit" + } + ] + } + ], "summary": "addConsumer", "description": "Add a consumer that uses a specific design", "tags": [ @@ -809,6 +1159,30 @@ "/v1/designs/removeConsumer/{application}/{designId}": { "put": { "operationId": "removeConsumer", + "deprecated": true, + "x-epilot-permissions": [ + { + "anyOf": [ + { + "action": "entity:edit", + "resource": "journey" + }, + { + "action": "customer_portal:edit" + }, + { + "action": "installer_portal:edit" + }, + { + "action": "portal:content:edit", + "resource": "{consumer_id}" + }, + { + "action": "design:edit" + } + ] + } + ], "summary": "removeConsumer", "description": "Remove a consumer that uses a specific design", "tags": [ @@ -959,6 +1333,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -993,6 +1370,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1017,6 +1397,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1038,6 +1421,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1056,6 +1442,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1094,9 +1483,6 @@ }, "consumer_name": { "type": "string" - }, - "should_delete": { - "type": "string" } }, "required": [ @@ -1109,10 +1495,6 @@ "properties": { "consumer_id": { "$ref": "#/components/schemas/DesignId" - }, - "should_delete": { - "type": "string", - "deprecated": true } }, "required": [ @@ -1232,6 +1614,68 @@ "name" ] }, + "Design_Document_V1": { + "type": "object", + "description": "Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet.", + "properties": { + "version": { + "type": "integer", + "enum": [ + 1 + ] + }, + "colors": { + "type": "object", + "additionalProperties": {} + }, + "typography": { + "type": "object", + "additionalProperties": {} + }, + "shape": { + "type": "object", + "additionalProperties": {} + }, + "components": { + "type": "object", + "additionalProperties": {} + }, + "assets": { + "type": "object", + "additionalProperties": {} + }, + "consumer": { + "$ref": "#/components/schemas/ConsumerData" + } + } + }, + "UpdateDesignConflict": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "design": { + "allOf": [ + { + "$ref": "#/components/schemas/ItemMetada" + }, + { + "$ref": "#/components/schemas/DesignItem" + }, + { + "$ref": "#/components/schemas/Custom_Style" + }, + { + "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" + } + ] + } + } + }, "Custom_Style": { "type": "object", "properties": { @@ -1696,12 +2140,188 @@ "name" ] }, + "GenerateDesignReq": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "Public website to derive the design from", + "example": "https://www.twl.de" + } + }, + "required": [ + "url" + ] + }, + "GenerateDesignRes": { + "type": "object", + "properties": { + "design": { + "$ref": "#/components/schemas/GeneratedDesign" + }, + "cached": { + "type": "boolean", + "description": "True when the design was generated earlier for this organization and URL" + } + }, + "required": [ + "design", + "cached" + ] + }, + "GenerateDesignDocumentReq": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "Public website to read the design from", + "example": "https://www.stadtwerke-musterstadt.de" + } + }, + "required": [ + "url" + ] + }, + "FindingId": { + "type": "string", + "enum": [ + "primary_color", + "fonts", + "corners", + "primary_button", + "logo", + "favicon" + ] + }, + "FindingStatus": { + "type": "string", + "enum": [ + "found", + "not_found", + "not_available" + ] + }, + "FindingDetail": { + "type": "object", + "properties": { + "family": { + "type": "string", + "description": "Font family that was found but cannot be loaded" + } + }, + "required": [ + "family" + ] + }, + "DesignFinding": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/FindingId" + }, + "status": { + "$ref": "#/components/schemas/FindingStatus" + }, + "detail": { + "$ref": "#/components/schemas/FindingDetail" + } + }, + "required": [ + "id", + "status" + ] + }, + "GenerateDesignDocumentRes": { + "type": "object", + "properties": { + "document": { + "$ref": "#/components/schemas/Design_Document_V1" + }, + "findings": { + "type": "array", + "minItems": 6, + "maxItems": 6, + "items": { + "$ref": "#/components/schemas/DesignFinding" + } + }, + "site_name": { + "type": "string", + "example": "Stadtwerke Musterstadt" + }, + "cached": { + "type": "boolean", + "description": "True when the response was served from an earlier successful generation for this organization, normalised URL and generator version" + } + }, + "required": [ + "document", + "findings", + "site_name", + "cached" + ] + }, + "GeneratedDesign": { + "type": "object", + "description": "Partial design to merge into the design being edited", + "properties": { + "style": { + "type": "object", + "properties": { + "logo": { + "$ref": "#/components/schemas/LogoData" + }, + "palette": { + "$ref": "#/components/schemas/PaletteData" + }, + "typography": { + "$ref": "#/components/schemas/TypographyData" + } + }, + "required": [ + "logo", + "palette", + "typography" + ] + }, + "theme": { + "type": "object", + "properties": { + "shape": { + "type": "object", + "properties": { + "borderRadius": { + "type": "string", + "example": "8" + } + }, + "required": [ + "borderRadius" + ] + } + }, + "required": [ + "shape" + ] + } + }, + "required": [ + "style", + "theme" + ] + }, "ErrorResp": { "type": "object", "properties": { "message": { "type": "string" }, + "code": { + "type": "string", + "description": "Machine-readable reason, e.g. `invalid_url` or `rate_limited`" + }, "error": { "type": "object" } @@ -1817,6 +2437,37 @@ "journey_design_tokens": { "type": "object", "description": "Design tokens for journey customization (renamed from design_tokens)" + }, + "version": { + "type": "integer", + "enum": [ + 1 + ] + }, + "colors": { + "type": "object", + "additionalProperties": {} + }, + "typography": { + "type": "object", + "additionalProperties": {} + }, + "shape": { + "type": "object", + "additionalProperties": {} + }, + "components": { + "type": "object", + "additionalProperties": {} + }, + "assets": { + "type": "object", + "additionalProperties": {} + }, + "journey": { + "type": "object", + "additionalProperties": {}, + "description": "v1 designs only: the journey group of @epilot/design-document (custom_css, tokens and the journey overrides primary_color, font, border_radius, logo), derived on read from the stored journey fields and compared with the stored v1 groups. What a journey paints from it equals what it paints from the theme built from the old fields. Not returned by GET." } } } diff --git a/packages/cli/definitions/design.json b/packages/cli/definitions/design.json index 2e4c25182..bccf35dec 100644 --- a/packages/cli/definitions/design.json +++ b/packages/cli/definitions/design.json @@ -24,6 +24,11 @@ "/v1/designs": { "get": { "operationId": "getAllDesigns", + "x-epilot-permissions": [ + { + "action": "design:view" + } + ], "summary": "getAllDesigns", "description": "Scan all designs linked to a organization, based in orgId attribute from JWT auth token", "tags": [ @@ -54,6 +59,11 @@ }, "post": { "operationId": "addDesign", + "x-epilot-permissions": [ + { + "action": "design:create" + } + ], "summary": "addDesign", "description": "Create a brand new design linked to a organization, based in orgId attribute from JWT auth token", "tags": [ @@ -117,6 +127,11 @@ "/v1/designs/{designId}": { "get": { "operationId": "getDesign", + "x-epilot-permissions": [ + { + "action": "design:view" + } + ], "summary": "getDesign", "description": "Search for a especific design owned by user organization", "tags": [ @@ -180,6 +195,11 @@ }, "delete": { "operationId": "deleteDesign", + "x-epilot-permissions": [ + { + "action": "design:delete" + } + ], "summary": "deleteDesign", "description": "Search and delete for a especific design owned by user organization", "tags": [ @@ -222,6 +242,16 @@ "404": { "description": "No design found" }, + "409": { + "description": "The design cannot be deleted: it is the only one of the organization, it is still\nassigned to journeys (listed in `journeys`) or portals (listed in `portals`), or the\ncaller may not view the organization's portals, so their usage cannot be checked.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, "500": { "description": "Other errors", "content": { @@ -231,13 +261,28 @@ } } } + }, + "503": { + "description": "customer-portal-api could not be reached to check which portals use the design. Retry later.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } } } }, "put": { "operationId": "updateDesign", + "x-epilot-permissions": [ + { + "action": "design:edit" + } + ], "summary": "updateDesign", - "description": "Update a especific design owned by user organization", + "description": "Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`, `custom_theme` and `use_custom_theme` untouched. A body without `version` on a v1 design is treated as an old client's read-modify-write: those four fields are stored as sent, and brand-wide changes in `style` are applied to the v1 groups.", "tags": [ "design-builder" ], @@ -249,6 +294,15 @@ "schema": { "$ref": "#/components/schemas/DesignId" } + }, + { + "in": "header", + "name": "If-Match", + "required": false, + "description": "The `last_modified_at` of the design the client read. When it no longer matches the stored design, the update is rejected with 409. Without the header the update is unconditional.", + "schema": { + "type": "string" + } } ], "requestBody": { @@ -289,6 +343,16 @@ "404": { "description": "No design found" }, + "409": { + "description": "The design was changed since the `If-Match` value was read. Returns the current design.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateDesignConflict" + } + } + } + }, "500": { "description": "Other errors", "content": { @@ -305,6 +369,11 @@ "/v1/designs/{designId}/duplicate": { "post": { "operationId": "duplicateDesign", + "x-epilot-permissions": [ + { + "action": "design:create" + } + ], "summary": "duplicateDesign", "description": "Duplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marked as a copy) but does NOT carry over journey/portal relations, so the new design starts with 0 consumers, exactly like a freshly created design.", "tags": [ @@ -371,7 +440,8 @@ "get": { "operationId": "getThemeFromDesign", "summary": "getThemeFromDesign", - "description": "Search for a especific design owned by user organization and parse them to a new or old theme", + "deprecated": true, + "description": "Search for a especific design owned by user organization and parse them to a new or old theme. Deprecated: kept for old readers only. For a v1 design the response carries the v1 groups and the derived `journey` group next to the stored old fields and the theme built from them; new runtimes read the v1 groups.", "security": [], "tags": [ "design-builder" @@ -450,9 +520,245 @@ } } }, + "/v1/designs/generate": { + "post": { + "operationId": "generateDesign", + "x-epilot-permissions": [ + { + "anyOf": [ + { + "action": "design:create" + }, + { + "action": "design:edit" + } + ] + } + ], + "summary": "generateDesign", + "description": "Generates a design (palette, text colours, font, logo and border radius) from a public\nwebsite with AI. The result is cached per organization and URL for 30 days.\n", + "tags": [ + "design-builder" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignReq" + } + } + } + }, + "responses": { + "200": { + "description": "A design generated earlier for this organization and URL", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignRes" + } + } + } + }, + "201": { + "description": "A newly generated design", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignRes" + } + } + } + }, + "400": { + "description": "The URL is not a valid http(s) URL (`invalid_url`) or points to a private network (`blocked_url`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "401": { + "description": "Authentication Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "403": { + "description": "The caller may not edit designs", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "422": { + "description": "The website could not be fetched (`fetch_failed`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "502": { + "description": "The design could not be generated (`generation_failed`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "504": { + "description": "The generation did not finish in time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + } + } + } + }, + "/v1/designs/document/generate": { + "post": { + "operationId": "generateDesignDocument", + "x-epilot-permissions": [ + { + "action": "design:create" + } + ], + "summary": "generateDesignDocument", + "description": "Reads a public website and returns a v1 design document plus one finding for each\nid in fixed order. This version chooses the favicon in code and derives the site name.\nThe other findings are `not_found` until they are implemented. The document contains\nonly the leaves that passed validation, and defaults are not pruned.\nSuccessful responses are cached per organization, normalised URL and generator version\nfor 7 days. Each organization may run 20 new generations per UTC day; cache hits do not\ncount toward the limit. A client abort still finishes on the server and is cached.\n", + "tags": [ + "design-builder" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignDocumentReq" + } + } + } + }, + "responses": { + "200": { + "description": "A design document generated earlier for this organization, URL and generator version", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignDocumentRes" + } + } + } + }, + "201": { + "description": "A newly generated design document", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateDesignDocumentRes" + } + } + } + }, + "400": { + "description": "The URL is not a valid http(s) URL (`invalid_url`) or points to a private network (`blocked_url`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "401": { + "description": "Authentication Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "403": { + "description": "The caller does not have design:create", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "422": { + "description": "The website could not be fetched (`fetch_failed`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "429": { + "description": "The organization has used today's generation limit (`rate_limited`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "502": { + "description": "Generation failed, or no finding survived (`generation_failed`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "504": { + "description": "The 27 second budget ran out (`timeout`)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + } + } + } + }, "/v1/designs/files": { "post": { "operationId": "uploadFile", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "uploadFile", "description": "Upload a new file for the user organization bucket", "tags": [ @@ -519,6 +825,11 @@ }, "get": { "operationId": "getFiles", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "getFiles", "description": "List all files for the user organization bucket", "tags": [ @@ -589,6 +900,11 @@ "get": { "deprecated": true, "operationId": "getLimit", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "getLimit", "description": "Gets designs number limit from database per organization", "tags": [ @@ -622,6 +938,11 @@ "get": { "deprecated": true, "operationId": "getBrands", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "getBrands", "description": "Scan all brands linked to a organization, based in orgId attribute from JWT auth token", "tags": [ @@ -657,6 +978,11 @@ "/v1/designs/consumer/{application}/{consumerId}": { "get": { "operationId": "getConsumerDesign", + "x-epilot-permissions": [ + { + "access": "org" + } + ], "summary": "getConsumerDesign", "description": "Search for a especific design owned by user organization", "tags": [ @@ -730,6 +1056,30 @@ "/v1/designs/addConsumer/{application}/{designId}": { "put": { "operationId": "addConsumer", + "deprecated": true, + "x-epilot-permissions": [ + { + "anyOf": [ + { + "action": "entity:edit", + "resource": "journey" + }, + { + "action": "customer_portal:edit" + }, + { + "action": "installer_portal:edit" + }, + { + "action": "portal:content:edit", + "resource": "{consumer_id}" + }, + { + "action": "design:edit" + } + ] + } + ], "summary": "addConsumer", "description": "Add a consumer that uses a specific design", "tags": [ @@ -809,6 +1159,30 @@ "/v1/designs/removeConsumer/{application}/{designId}": { "put": { "operationId": "removeConsumer", + "deprecated": true, + "x-epilot-permissions": [ + { + "anyOf": [ + { + "action": "entity:edit", + "resource": "journey" + }, + { + "action": "customer_portal:edit" + }, + { + "action": "installer_portal:edit" + }, + { + "action": "portal:content:edit", + "resource": "{consumer_id}" + }, + { + "action": "design:edit" + } + ] + } + ], "summary": "removeConsumer", "description": "Remove a consumer that uses a specific design", "tags": [ @@ -959,6 +1333,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -993,6 +1370,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1017,6 +1397,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1038,6 +1421,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1056,6 +1442,9 @@ }, { "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1094,9 +1483,6 @@ }, "consumer_name": { "type": "string" - }, - "should_delete": { - "type": "string" } }, "required": [ @@ -1109,10 +1495,6 @@ "properties": { "consumer_id": { "$ref": "#/components/schemas/DesignId" - }, - "should_delete": { - "type": "string", - "deprecated": true } }, "required": [ @@ -1232,6 +1614,68 @@ "name" ] }, + "Design_Document_V1": { + "type": "object", + "description": "Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet.", + "properties": { + "version": { + "type": "integer", + "enum": [ + 1 + ] + }, + "colors": { + "type": "object", + "additionalProperties": {} + }, + "typography": { + "type": "object", + "additionalProperties": {} + }, + "shape": { + "type": "object", + "additionalProperties": {} + }, + "components": { + "type": "object", + "additionalProperties": {} + }, + "assets": { + "type": "object", + "additionalProperties": {} + }, + "consumer": { + "$ref": "#/components/schemas/ConsumerData" + } + } + }, + "UpdateDesignConflict": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "design": { + "allOf": [ + { + "$ref": "#/components/schemas/ItemMetada" + }, + { + "$ref": "#/components/schemas/DesignItem" + }, + { + "$ref": "#/components/schemas/Custom_Style" + }, + { + "$ref": "#/components/schemas/Journey" + }, + { + "$ref": "#/components/schemas/Design_Document_V1" + } + ] + } + } + }, "Custom_Style": { "type": "object", "properties": { @@ -1696,12 +2140,188 @@ "name" ] }, + "GenerateDesignReq": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "Public website to derive the design from", + "example": "https://www.twl.de" + } + }, + "required": [ + "url" + ] + }, + "GenerateDesignRes": { + "type": "object", + "properties": { + "design": { + "$ref": "#/components/schemas/GeneratedDesign" + }, + "cached": { + "type": "boolean", + "description": "True when the design was generated earlier for this organization and URL" + } + }, + "required": [ + "design", + "cached" + ] + }, + "GenerateDesignDocumentReq": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "Public website to read the design from", + "example": "https://www.stadtwerke-musterstadt.de" + } + }, + "required": [ + "url" + ] + }, + "FindingId": { + "type": "string", + "enum": [ + "primary_color", + "fonts", + "corners", + "primary_button", + "logo", + "favicon" + ] + }, + "FindingStatus": { + "type": "string", + "enum": [ + "found", + "not_found", + "not_available" + ] + }, + "FindingDetail": { + "type": "object", + "properties": { + "family": { + "type": "string", + "description": "Font family that was found but cannot be loaded" + } + }, + "required": [ + "family" + ] + }, + "DesignFinding": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/FindingId" + }, + "status": { + "$ref": "#/components/schemas/FindingStatus" + }, + "detail": { + "$ref": "#/components/schemas/FindingDetail" + } + }, + "required": [ + "id", + "status" + ] + }, + "GenerateDesignDocumentRes": { + "type": "object", + "properties": { + "document": { + "$ref": "#/components/schemas/Design_Document_V1" + }, + "findings": { + "type": "array", + "minItems": 6, + "maxItems": 6, + "items": { + "$ref": "#/components/schemas/DesignFinding" + } + }, + "site_name": { + "type": "string", + "example": "Stadtwerke Musterstadt" + }, + "cached": { + "type": "boolean", + "description": "True when the response was served from an earlier successful generation for this organization, normalised URL and generator version" + } + }, + "required": [ + "document", + "findings", + "site_name", + "cached" + ] + }, + "GeneratedDesign": { + "type": "object", + "description": "Partial design to merge into the design being edited", + "properties": { + "style": { + "type": "object", + "properties": { + "logo": { + "$ref": "#/components/schemas/LogoData" + }, + "palette": { + "$ref": "#/components/schemas/PaletteData" + }, + "typography": { + "$ref": "#/components/schemas/TypographyData" + } + }, + "required": [ + "logo", + "palette", + "typography" + ] + }, + "theme": { + "type": "object", + "properties": { + "shape": { + "type": "object", + "properties": { + "borderRadius": { + "type": "string", + "example": "8" + } + }, + "required": [ + "borderRadius" + ] + } + }, + "required": [ + "shape" + ] + } + }, + "required": [ + "style", + "theme" + ] + }, "ErrorResp": { "type": "object", "properties": { "message": { "type": "string" }, + "code": { + "type": "string", + "description": "Machine-readable reason, e.g. `invalid_url` or `rate_limited`" + }, "error": { "type": "object" } @@ -1817,6 +2437,37 @@ "journey_design_tokens": { "type": "object", "description": "Design tokens for journey customization (renamed from design_tokens)" + }, + "version": { + "type": "integer", + "enum": [ + 1 + ] + }, + "colors": { + "type": "object", + "additionalProperties": {} + }, + "typography": { + "type": "object", + "additionalProperties": {} + }, + "shape": { + "type": "object", + "additionalProperties": {} + }, + "components": { + "type": "object", + "additionalProperties": {} + }, + "assets": { + "type": "object", + "additionalProperties": {} + }, + "journey": { + "type": "object", + "additionalProperties": {}, + "description": "v1 designs only: the journey group of @epilot/design-document (custom_css, tokens and the journey overrides primary_color, font, border_radius, logo), derived on read from the stored journey fields and compared with the stored v1 groups. What a journey paints from it equals what it paints from the theme built from the old fields. Not returned by GET." } } } diff --git a/packages/cli/docs/design.md b/packages/cli/docs/design.md index 3fb7c85bf..bdd90249b 100644 --- a/packages/cli/docs/design.md +++ b/packages/cli/docs/design.md @@ -37,15 +37,14 @@ epilot design getAllDesigns - [`getAllDesigns`](#getalldesigns) — Scan all designs linked to a organization, based in orgId attribute from JWT auth token - [`addDesign`](#adddesign) — Create a brand new design linked to a organization, based in orgId attribute from JWT auth token - [`getDesign`](#getdesign) — Search for a especific design owned by user organization -- [`updateDesign`](#updatedesign) — Update a especific design owned by user organization +- [`updateDesign`](#updatedesign) — Update a especific design owned by user organization. A body with `version: 1` is validated against the design document - [`deleteDesign`](#deletedesign) — Search and delete for a especific design owned by user organization - [`duplicateDesign`](#duplicatedesign) — Duplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marke -- [`getThemeFromDesign`](#getthemefromdesign) — Search for a especific design owned by user organization and parse them to a new or old theme +- [`generateDesign`](#generatedesign) — Generates a design (palette, text colours, font, logo and border radius) from a public +- [`generateDesignDocument`](#generatedesigndocument) — Reads a public website and returns a v1 design document plus one finding for each - [`getFiles`](#getfiles) — List all files for the user organization bucket - [`uploadFile`](#uploadfile) — Upload a new file for the user organization bucket - [`getConsumerDesign`](#getconsumerdesign) — Search for a especific design owned by user organization -- [`addConsumer`](#addconsumer) — Add a consumer that uses a specific design -- [`removeConsumer`](#removeconsumer) — Remove a consumer that uses a specific design ### `getAllDesigns` @@ -86,7 +85,14 @@ epilot design getAllDesigns --jsonata 'designs' "_manifest": ["string"], "custom_theme": "string", "use_custom_theme": true, - "design_tokens": {} + "design_tokens": {}, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": {} } ] } @@ -197,6 +203,16 @@ epilot design addDesign \ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } }' @@ -306,6 +322,16 @@ epilot design addDesign --jsonata 'design' "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } } @@ -438,6 +464,16 @@ epilot design getDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a --jsona "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } } @@ -449,7 +485,7 @@ epilot design getDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a --jsona ### `updateDesign` -Update a especific design owned by user organization +Update a especific design owned by user organization. A body with `version: 1` is validated against the design document `PUT /v1/designs/{designId}` @@ -458,6 +494,7 @@ Update a especific design owned by user organization | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | | `designId` | path | string | Yes | | +| `If-Match` | header | string | No | The `last_modified_at` of the design the client read. When it no longer matches the stored design, the update is rejected with 409. Without the header the update is unconditional. | **Request Body** (required) @@ -556,6 +593,16 @@ epilot design updateDesign \ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } }' @@ -737,6 +784,16 @@ epilot design duplicateDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a - "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } } @@ -746,38 +803,31 @@ epilot design duplicateDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a - --- -### `getThemeFromDesign` +### `generateDesign` -Search for a especific design owned by user organization and parse them to a new or old theme +Generates a design (palette, text colours, font, logo and border radius) from a public -`GET /v1/designs/{designId}/parse` +`POST /v1/designs/generate` -**Parameters** - -| Name | In | Type | Required | Description | -| ---- | -- | ---- | -------- | ----------- | -| `designId` | path | string | Yes | | -| `orgId` | query | string | No | Organization id of the user | -| `theme` | query | "NEW" \| "OLD" | Yes | | +**Request Body** (required) **Sample Call** ```bash -epilot design getThemeFromDesign \ - -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a \ - -p theme=NEW +epilot design generateDesign \ + -d '{"url":"https://www.twl.de"}' ``` -Using positional args for path parameters: +Using stdin pipe: ```bash -epilot design getThemeFromDesign 4a062990-a6a3-11eb-9828-4f3da7d4935a +cat body.json | epilot design generateDesign ``` With JSONata filter: ```bash -epilot design getThemeFromDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p theme=NEW --jsonata 'theme' +epilot design generateDesign --jsonata 'design' ```
@@ -785,11 +835,7 @@ epilot design getThemeFromDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935 ```json { - "theme": "NEW", "design": { - "id": "string", - "last_modified_at": "string", - "style_name": "string", "style": { "logo": { "main": { @@ -829,10 +875,92 @@ epilot design getThemeFromDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935 "secondary": "string" } }, - "custom_theme": "string", - "use_custom_theme": true, - "journey_design_tokens": {} - } + "theme": { + "shape": { + "borderRadius": "8" + } + } + }, + "cached": true +} +``` + +
+ +--- + +### `generateDesignDocument` + +Reads a public website and returns a v1 design document plus one finding for each + +`POST /v1/designs/document/generate` + +**Request Body** (required) + +**Sample Call** + +```bash +epilot design generateDesignDocument \ + -d '{"url":"https://www.stadtwerke-musterstadt.de"}' +``` + +Using stdin pipe: + +```bash +cat body.json | epilot design generateDesignDocument +``` + +With JSONata filter: + +```bash +epilot design generateDesignDocument --jsonata 'document' +``` + +
+Sample Response + +```json +{ + "document": { + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [ + { + "id": "string", + "name": "string" + } + ], + "customer_portals": [ + { + "id": "string", + "name": "string" + } + ] + } + }, + "findings": [ + { + "id": "primary_color", + "status": "found", + "detail": { + "family": "string" + } + }, + { + "id": "primary_color", + "status": "found", + "detail": { + "family": "string" + } + } + ], + "site_name": "Stadtwerke Musterstadt", + "cached": true } ``` @@ -1045,6 +1173,16 @@ epilot design getConsumerDesign -p consumerId=4a062990-a6a3-11eb-9828-4f3da7d493 "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } } @@ -1053,91 +1191,3 @@ epilot design getConsumerDesign -p consumerId=4a062990-a6a3-11eb-9828-4f3da7d493
--- - -### `addConsumer` - -Add a consumer that uses a specific design - -`PUT /v1/designs/addConsumer/{application}/{designId}` - -**Parameters** - -| Name | In | Type | Required | Description | -| ---- | -- | ---- | -------- | ----------- | -| `designId` | path | string | Yes | | -| `application` | path | string | Yes | Type of application that uses the design | - -**Request Body** (required) - -**Sample Call** - -```bash -epilot design addConsumer \ - -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a \ - -p application=journey \ - -d '{"consumer_id":"4a062990-a6a3-11eb-9828-4f3da7d4935a","consumer_name":"string","should_delete":"string"}' -``` - -Using positional args for path parameters: - -```bash -epilot design addConsumer 4a062990-a6a3-11eb-9828-4f3da7d4935a journey -``` - -Using stdin pipe: - -```bash -cat body.json | epilot design addConsumer -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p application=journey -``` - -With JSONata filter: - -```bash -epilot design addConsumer -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p application=journey --jsonata '$' -``` - ---- - -### `removeConsumer` - -Remove a consumer that uses a specific design - -`PUT /v1/designs/removeConsumer/{application}/{designId}` - -**Parameters** - -| Name | In | Type | Required | Description | -| ---- | -- | ---- | -------- | ----------- | -| `designId` | path | string | Yes | | -| `application` | path | string | Yes | Type of application that uses the design | - -**Request Body** (required) - -**Sample Call** - -```bash -epilot design removeConsumer \ - -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a \ - -p application=journey \ - -d '{"consumer_id":"4a062990-a6a3-11eb-9828-4f3da7d4935a","should_delete":"string"}' -``` - -Using positional args for path parameters: - -```bash -epilot design removeConsumer 4a062990-a6a3-11eb-9828-4f3da7d4935a journey -``` - -Using stdin pipe: - -```bash -cat body.json | epilot design removeConsumer -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p application=journey -``` - -With JSONata filter: - -```bash -epilot design removeConsumer -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p application=journey --jsonata '$' -``` - ---- diff --git a/packages/epilot-sdk-v2/docs/design.md b/packages/epilot-sdk-v2/docs/design.md index 77277bd10..028d60e8b 100644 --- a/packages/epilot-sdk-v2/docs/design.md +++ b/packages/epilot-sdk-v2/docs/design.md @@ -31,12 +31,11 @@ const { data } = await designClient.getAllDesigns(...) - [`deleteDesign`](#deletedesign) - [`updateDesign`](#updatedesign) - [`duplicateDesign`](#duplicatedesign) -- [`getThemeFromDesign`](#getthemefromdesign) +- [`generateDesign`](#generatedesign) +- [`generateDesignDocument`](#generatedesigndocument) - [`uploadFile`](#uploadfile) - [`getFiles`](#getfiles) - [`getConsumerDesign`](#getconsumerdesign) -- [`addConsumer`](#addconsumer) -- [`removeConsumer`](#removeconsumer) **Schemas** - [`UploadFileReq`](#uploadfilereq) @@ -53,6 +52,8 @@ const { data } = await designClient.getAllDesigns(...) - [`RemoveConsumerReq`](#removeconsumerreq) - [`DesignItem`](#designitem) - [`BrandItem`](#branditem) +- [`Design_Document_V1`](#design_document_v1) +- [`UpdateDesignConflict`](#updatedesignconflict) - [`Custom_Style`](#custom_style) - [`Journey`](#journey) - [`ConsumerData`](#consumerdata) @@ -65,6 +66,15 @@ const { data } = await designClient.getAllDesigns(...) - [`FontData`](#fontdata) - [`FontResponseUrl`](#fontresponseurl) - [`WidgetPortalData`](#widgetportaldata) +- [`GenerateDesignReq`](#generatedesignreq) +- [`GenerateDesignRes`](#generatedesignres) +- [`GenerateDesignDocumentReq`](#generatedesigndocumentreq) +- [`FindingId`](#findingid) +- [`FindingStatus`](#findingstatus) +- [`FindingDetail`](#findingdetail) +- [`DesignFinding`](#designfinding) +- [`GenerateDesignDocumentRes`](#generatedesigndocumentres) +- [`GeneratedDesign`](#generateddesign) - [`ErrorResp`](#errorresp) - [`FileData`](#filedata) - [`DesignId`](#designid) @@ -104,7 +114,14 @@ const { data } = await client.getAllDesigns() "_manifest": ["string"], "custom_theme": "string", "use_custom_theme": true, - "design_tokens": {} + "design_tokens": {}, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": {} } ] } @@ -206,6 +223,16 @@ const { data } = await client.addDesign( chip_hover_background: 'string', chip_text_color: 'string', chip_hover_text_color: 'string' + }, + version: 1, + colors: {}, + typography: {}, + shape: {}, + components: {}, + assets: {}, + consumer: { + widgets: [ /* ... */ ], + customer_portals: [ /* ... */ ] } } }, @@ -304,6 +331,16 @@ const { data } = await client.addDesign( "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } } @@ -417,6 +454,16 @@ const { data } = await client.getDesign({ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } } @@ -442,7 +489,7 @@ const { data } = await client.deleteDesign({ ### `updateDesign` -Update a especific design owned by user organization +Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens` `PUT /v1/designs/{designId}` @@ -450,6 +497,7 @@ Update a especific design owned by user organization const { data } = await client.updateDesign( { designId: 'example', + If-Match: 'example', }, { design: { @@ -534,6 +582,16 @@ const { data } = await client.updateDesign( chip_hover_background: 'string', chip_text_color: 'string', chip_hover_text_color: 'string' + }, + version: 1, + colors: {}, + typography: {}, + shape: {}, + components: {}, + assets: {}, + consumer: { + widgets: [ /* ... */ ], + customer_portals: [ /* ... */ ] } } }, @@ -646,6 +704,16 @@ const { data } = await client.duplicateDesign({ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } } @@ -655,18 +723,20 @@ const { data } = await client.duplicateDesign({ --- -### `getThemeFromDesign` +### `generateDesign` -Search for a especific design owned by user organization and parse them to a new or old theme +Generates a design (palette, text colours, font, logo and border radius) from a public +website with AI. The result is cached per organization and URL for 30 days. -`GET /v1/designs/{designId}/parse` +`POST /v1/designs/generate` ```ts -const { data } = await client.getThemeFromDesign({ - designId: 'example', - orgId: 'example', - theme: 'example', -}) +const { data } = await client.generateDesign( + null, + { + url: 'https://www.twl.de' + }, +) ```
@@ -674,11 +744,7 @@ const { data } = await client.getThemeFromDesign({ ```json { - "theme": "NEW", "design": { - "id": "string", - "last_modified_at": "string", - "style_name": "string", "style": { "logo": { "main": { @@ -718,10 +784,82 @@ const { data } = await client.getThemeFromDesign({ "secondary": "string" } }, - "custom_theme": "string", - "use_custom_theme": true, - "journey_design_tokens": {} - } + "theme": { + "shape": { + "borderRadius": "8" + } + } + }, + "cached": true +} +``` + +
+ +--- + +### `generateDesignDocument` + +Reads a public website and returns a v1 design document plus one finding for each +id in fixed order. This version chooses the favicon in code and derives the site name. +The other findings are `not_fou + +`POST /v1/designs/document/generate` + +```ts +const { data } = await client.generateDesignDocument( + null, + { + url: 'https://www.stadtwerke-musterstadt.de' + }, +) +``` + +
+Response + +```json +{ + "document": { + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [ + { + "id": "string", + "name": "string" + } + ], + "customer_portals": [ + { + "id": "string", + "name": "string" + } + ] + } + }, + "findings": [ + { + "id": "primary_color", + "status": "found", + "detail": { + "family": "string" + } + }, + { + "id": "primary_color", + "status": "found", + "detail": { + "family": "string" + } + } + ], + "site_name": "Stadtwerke Musterstadt", + "cached": true } ``` @@ -894,6 +1032,16 @@ const { data } = await client.getConsumerDesign({ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" + }, + "version": 1, + "colors": {}, + "typography": {}, + "shape": {}, + "components": {}, + "assets": {}, + "consumer": { + "widgets": [], + "customer_portals": [] } } } @@ -903,49 +1051,6 @@ const { data } = await client.getConsumerDesign({ --- -### `addConsumer` - -Add a consumer that uses a specific design - -`PUT /v1/designs/addConsumer/{application}/{designId}` - -```ts -const { data } = await client.addConsumer( - { - designId: 'example', - application: 'example', - }, - { - consumer_id: '4a062990-a6a3-11eb-9828-4f3da7d4935a', - consumer_name: 'string', - should_delete: 'string' - }, -) -``` - ---- - -### `removeConsumer` - -Remove a consumer that uses a specific design - -`PUT /v1/designs/removeConsumer/{application}/{designId}` - -```ts -const { data } = await client.removeConsumer( - { - designId: 'example', - application: 'example', - }, - { - consumer_id: '4a062990-a6a3-11eb-9828-4f3da7d4935a', - should_delete: 'string' - }, -) -``` - ---- - ## Schemas ### `UploadFileReq` @@ -1077,7 +1182,18 @@ type GetAllDesignsRes = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } + version?: 1 + colors?: Record + typography?: Record + shape?: Record + components?: Record + assets?: Record + consumer?: { + widgets: { ... } + customer_portals: { ... } + } }> + // ... } ``` @@ -1186,6 +1302,16 @@ type AddDesignReq = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } + version?: 1 + colors?: Record + typography?: Record + shape?: Record + components?: Record + assets?: Record + consumer?: { + widgets: { ... } + customer_portals: { ... } + } } } ``` @@ -1282,7 +1408,18 @@ type AddDesignRes = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } + version?: 1 + colors?: Record + typography?: Record + shape?: Record + components?: Record + assets?: Record + consumer?: { + widgets: { ... } + customer_portals: { ... } + } } + // ... } ``` @@ -1378,7 +1515,18 @@ type GetDesignRes = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } + version?: 1 + colors?: Record + typography?: Record + shape?: Record + components?: Record + assets?: Record + consumer?: { + widgets: { ... } + customer_portals: { ... } + } } + // ... } ``` @@ -1469,6 +1617,16 @@ type UpdateDesignReq = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } + version?: 1 + colors?: Record + typography?: Record + shape?: Record + components?: Record + assets?: Record + consumer?: { + widgets: { ... } + customer_portals: { ... } + } } } ``` @@ -1491,7 +1649,6 @@ type ItemMetada = { type AddConsumerReq = { consumer_id: string consumer_name: string - should_delete?: string } ``` @@ -1500,7 +1657,6 @@ type AddConsumerReq = { ```ts type RemoveConsumerReq = { consumer_id: string - should_delete?: string } ``` @@ -1564,6 +1720,138 @@ type BrandItem = { } ``` +### `Design_Document_V1` + +Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and + +```ts +type Design_Document_V1 = { + version?: 1 + colors?: Record + typography?: Record + shape?: Record + components?: Record + assets?: Record + consumer?: { + widgets: Array<{ + id: { ... } + name: { ... } + }> + customer_portals: Array<{ + id: { ... } + name: { ... } + }> + } +} +``` + +### `UpdateDesignConflict` + +```ts +type UpdateDesignConflict = { + message?: string + design?: { + id?: string + created_at?: string + created_by?: string + edited: boolean + last_modified_at?: string + brand_id?: string + brand_name?: string + user?: { + emailaddress?: { ... } + fullname?: { ... } + name?: { ... } + userid?: { ... } + } + style_name: string + style: { + logo?: { ... } + palette: { ... } + typography: { ... } + shape?: { ... } + consumer: { ... } + } + is_default?: boolean + _manifest?: string[] + custom_theme?: string + use_custom_theme?: boolean + design_tokens?: { + coupon?: { ... } + cashback?: { ... } + custom_css?: { ... } + accent_color?: { ... } + outline_color?: { ... } + divider_color?: { ... } + link_color?: { ... } + link_hover_color?: { ... } + font_size_scale?: { ... } + topbar_height?: { ... } + topbar_logo_alignment?: { ... } + logo_size?: { ... } + input_background?: { ... } + input_border_color?: { ... } + input_text_color?: { ... } + input_label_color?: { ... } + input_border_radius?: { ... } + input_height?: { ... } + input_variant?: { ... } + button_primary_bg?: { ... } + button_primary_text?: { ... } + button_primary_hover_bg?: { ... } + button_primary_hover_text?: { ... } + button_outlined_border?: { ... } + button_outlined_text?: { ... } + button_outlined_hover_bg?: { ... } + button_outlined_hover_text?: { ... } + button_ghost_bg?: { ... } + button_ghost_text?: { ... } + button_ghost_hover_bg?: { ... } + button_ghost_hover_text?: { ... } + button_border_radius?: { ... } + button_height?: { ... } + card_background?: { ... } + card_border_color?: { ... } + card_variant?: { ... } + summary_card_background?: { ... } + toggle_selected_bg?: { ... } + toggle_selected_text?: { ... } + toggle_hover_bg?: { ... } + toggle_hover_text?: { ... } + toggle_border_color?: { ... } + dropdown_hover_bg?: { ... } + dropdown_hover_text?: { ... } + dropdown_selected_bg?: { ... } + dropdown_selected_text?: { ... } + switch_unchecked_color?: { ... } + switch_unchecked_bg?: { ... } + switch_border_radius?: { ... } + checkbox_unchecked_color?: { ... } + checkbox_label_color?: { ... } + radio_unchecked_color?: { ... } + radio_label_color?: { ... } + datepicker_selected_bg?: { ... } + datepicker_selected_color?: { ... } + datepicker_border_radius?: { ... } + chip_background?: { ... } + chip_hover_background?: { ... } + chip_text_color?: { ... } + chip_hover_text_color?: { ... } + } + version?: 1 + colors?: Record + typography?: Record + shape?: Record + components?: Record + assets?: Record + consumer?: { + widgets: { ... } + customer_portals: { ... } + } + // ... +} +``` + ### `Custom_Style` ```ts @@ -1768,11 +2056,139 @@ type WidgetPortalData = { } ``` +### `GenerateDesignReq` + +```ts +type GenerateDesignReq = { + url: string // uri +} +``` + +### `GenerateDesignRes` + +```ts +type GenerateDesignRes = { + design: { + style: { + logo: { ... } + palette: { ... } + typography: { ... } + } + theme: { + shape: { ... } + } + } + cached: boolean +} +``` + +### `GenerateDesignDocumentReq` + +```ts +type GenerateDesignDocumentReq = { + url: string // uri +} +``` + +### `FindingId` + +```ts +type FindingId = "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon" +``` + +### `FindingStatus` + +```ts +type FindingStatus = "found" | "not_found" | "not_available" +``` + +### `FindingDetail` + +```ts +type FindingDetail = { + family: string +} +``` + +### `DesignFinding` + +```ts +type DesignFinding = { + id: "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon" + status: "found" | "not_found" | "not_available" + detail?: { + family: string + } +} +``` + +### `GenerateDesignDocumentRes` + +```ts +type GenerateDesignDocumentRes = { + document: { + version?: 1 + colors?: Record + typography?: Record + shape?: Record + components?: Record + assets?: Record + consumer?: { + widgets: { ... } + customer_portals: { ... } + } + } + findings: Array<{ + id: "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon" + status: "found" | "not_found" | "not_available" + detail?: { + family: { ... } + } + }> + site_name: string + cached: boolean +} +``` + +### `GeneratedDesign` + +Partial design to merge into the design being edited + +```ts +type GeneratedDesign = { + style: { + logo: { + main?: { ... } + } + palette: { + primary: { ... } + secondary: { ... } + error: { ... } + background: { ... } + paper: { ... } + navbar: { ... } + portal_login_background?: { ... } + } + typography: { + font: { ... } + primary: { ... } + secondary: { ... } + } + } + theme: { + shape: { + borderRadius: { ... } + } + } +} +``` + ### `ErrorResp` ```ts type ErrorResp = { message?: string + code?: string error?: object } ``` @@ -1841,6 +2257,13 @@ type ParseThemeFromDesignResp = { custom_theme?: string use_custom_theme?: boolean journey_design_tokens?: object + version?: 1 + colors?: Record + typography?: Record + shape?: Record + components?: Record + assets?: Record + journey?: Record } } ``` diff --git a/packages/epilot-sdk-v2/src/definitions/design-runtime.json b/packages/epilot-sdk-v2/src/definitions/design-runtime.json index 460c8e53f..71551c999 100644 --- a/packages/epilot-sdk-v2/src/definitions/design-runtime.json +++ b/packages/epilot-sdk-v2/src/definitions/design-runtime.json @@ -1 +1 @@ -{"s":"https://design-builder-api.sls.epilot.io","o":[["getAllDesigns","get","/v1/designs"],["addDesign","post","/v1/designs",null,1],["getDesign","get","/v1/designs/{designId}",[["designId","p",true]]],["deleteDesign","delete","/v1/designs/{designId}",[["designId","p",true]]],["updateDesign","put","/v1/designs/{designId}",[["designId","p",true]],1],["duplicateDesign","post","/v1/designs/{designId}/duplicate",[["designId","p",true]]],["getThemeFromDesign","get","/v1/designs/{designId}/parse",[["designId","p",true],["orgId","q"],["theme","q",true]]],["uploadFile","post","/v1/designs/files",null,1],["getFiles","get","/v1/designs/files",[["type","q"]]],["getLimit","get","/v1/designs/limit"],["getBrands","get","/v1/brands"],["getConsumerDesign","get","/v1/designs/consumer/{application}/{consumerId}",[["consumerId","p",true],["application","p",true]]],["addConsumer","put","/v1/designs/addConsumer/{application}/{designId}",[["designId","p",true],["application","p",true]],1],["removeConsumer","put","/v1/designs/removeConsumer/{application}/{designId}",[["designId","p",true],["application","p",true]],1]],"v":"3.0.3"} \ No newline at end of file +{"s":"https://design-builder-api.sls.epilot.io","o":[["getAllDesigns","get","/v1/designs"],["addDesign","post","/v1/designs",null,1],["getDesign","get","/v1/designs/{designId}",[["designId","p",true]]],["deleteDesign","delete","/v1/designs/{designId}",[["designId","p",true]]],["updateDesign","put","/v1/designs/{designId}",[["designId","p",true],["If-Match","h"]],1],["duplicateDesign","post","/v1/designs/{designId}/duplicate",[["designId","p",true]]],["getThemeFromDesign","get","/v1/designs/{designId}/parse",[["designId","p",true],["orgId","q"],["theme","q",true]]],["generateDesign","post","/v1/designs/generate",null,1],["generateDesignDocument","post","/v1/designs/document/generate",null,1],["uploadFile","post","/v1/designs/files",null,1],["getFiles","get","/v1/designs/files",[["type","q"]]],["getLimit","get","/v1/designs/limit"],["getBrands","get","/v1/brands"],["getConsumerDesign","get","/v1/designs/consumer/{application}/{consumerId}",[["consumerId","p",true],["application","p",true]]],["addConsumer","put","/v1/designs/addConsumer/{application}/{designId}",[["designId","p",true],["application","p",true]],1],["removeConsumer","put","/v1/designs/removeConsumer/{application}/{designId}",[["designId","p",true],["application","p",true]],1]],"v":"3.0.3"} \ No newline at end of file diff --git a/packages/epilot-sdk-v2/src/docs/design.json b/packages/epilot-sdk-v2/src/docs/design.json index 59e45ec17..de8fd02f7 100644 --- a/packages/epilot-sdk-v2/src/docs/design.json +++ b/packages/epilot-sdk-v2/src/docs/design.json @@ -1 +1 @@ -"# Design Builder API v2\n\n- **Base URL:** `https://design-builder-api.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/design](https://docs.epilot.io/api/design)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.design.getAllDesigns(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/design'\n\nconst designClient = getClient()\nauthorize(designClient, () => '')\nconst { data } = await designClient.getAllDesigns(...)\n```\n\n## Operations\n\n**design-builder**\n- [`getAllDesigns`](#getalldesigns)\n- [`addDesign`](#adddesign)\n- [`getDesign`](#getdesign)\n- [`deleteDesign`](#deletedesign)\n- [`updateDesign`](#updatedesign)\n- [`duplicateDesign`](#duplicatedesign)\n- [`getThemeFromDesign`](#getthemefromdesign)\n- [`uploadFile`](#uploadfile)\n- [`getFiles`](#getfiles)\n- [`getConsumerDesign`](#getconsumerdesign)\n- [`addConsumer`](#addconsumer)\n- [`removeConsumer`](#removeconsumer)\n\n**Schemas**\n- [`UploadFileReq`](#uploadfilereq)\n- [`UploadFileRes`](#uploadfileres)\n- [`GetFilesRes`](#getfilesres)\n- [`GetAllDesignsRes`](#getalldesignsres)\n- [`GetBrandsRes`](#getbrandsres)\n- [`AddDesignReq`](#adddesignreq)\n- [`AddDesignRes`](#adddesignres)\n- [`GetDesignRes`](#getdesignres)\n- [`UpdateDesignReq`](#updatedesignreq)\n- [`ItemMetada`](#itemmetada)\n- [`AddConsumerReq`](#addconsumerreq)\n- [`RemoveConsumerReq`](#removeconsumerreq)\n- [`DesignItem`](#designitem)\n- [`BrandItem`](#branditem)\n- [`Custom_Style`](#custom_style)\n- [`Journey`](#journey)\n- [`ConsumerData`](#consumerdata)\n- [`WidgetData`](#widgetdata)\n- [`CustomerPortalData`](#customerportaldata)\n- [`LogoData`](#logodata)\n- [`PaletteData`](#palettedata)\n- [`TypographyData`](#typographydata)\n- [`ShapeData`](#shapedata)\n- [`FontData`](#fontdata)\n- [`FontResponseUrl`](#fontresponseurl)\n- [`WidgetPortalData`](#widgetportaldata)\n- [`ErrorResp`](#errorresp)\n- [`FileData`](#filedata)\n- [`DesignId`](#designid)\n- [`Theme`](#theme)\n- [`Application`](#application)\n- [`DesignParameters`](#designparameters)\n- [`ParseThemeFromDesignResp`](#parsethemefromdesignresp)\n\n### `getAllDesigns`\n\nScan all designs linked to a organization, based in orgId attribute from JWT auth token\n\n`GET /v1/designs`\n\n```ts\nconst { data } = await client.getAllDesigns()\n```\n\n
\nResponse\n\n```json\n{\n \"designs\": [\n {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {},\n \"style_name\": \"string\",\n \"style\": {},\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `addDesign`\n\nCreate a brand new design linked to a organization, based in orgId attribute from JWT auth token\n\n`POST /v1/designs`\n\n```ts\nconst { data } = await client.addDesign(\n null,\n {\n design: {\n brand_id: 'string',\n brand_name: 'string',\n user: {\n emailaddress: 'string',\n fullname: 'string',\n name: 'string',\n userid: 'string'\n },\n style_name: 'string',\n style: {\n logo: { /* ... */ },\n palette: { /* ... */ },\n typography: { /* ... */ },\n shape: { /* ... */ },\n consumer: { /* ... */ }\n },\n is_default: true,\n _manifest: ['string'],\n custom_theme: 'string',\n use_custom_theme: true,\n design_tokens: {\n coupon: 'string',\n cashback: 'string',\n custom_css: 'string',\n accent_color: 'string',\n outline_color: 'string',\n divider_color: 'string',\n link_color: 'string',\n link_hover_color: 'string',\n font_size_scale: 'xs',\n topbar_height: 0,\n topbar_logo_alignment: 'flex-start',\n logo_size: 0,\n input_background: 'string',\n input_border_color: 'string',\n input_text_color: 'string',\n input_label_color: 'string',\n input_border_radius: 0,\n input_height: 0,\n input_variant: 'outlined',\n button_primary_bg: 'string',\n button_primary_text: 'string',\n button_primary_hover_bg: 'string',\n button_primary_hover_text: 'string',\n button_outlined_border: 'string',\n button_outlined_text: 'string',\n button_outlined_hover_bg: 'string',\n button_outlined_hover_text: 'string',\n button_ghost_bg: 'string',\n button_ghost_text: 'string',\n button_ghost_hover_bg: 'string',\n button_ghost_hover_text: 'string',\n button_border_radius: 0,\n button_height: 0,\n card_background: 'string',\n card_border_color: 'string',\n card_variant: 'shadow',\n summary_card_background: 'string',\n toggle_selected_bg: 'string',\n toggle_selected_text: 'string',\n toggle_hover_bg: 'string',\n toggle_hover_text: 'string',\n toggle_border_color: 'string',\n dropdown_hover_bg: 'string',\n dropdown_hover_text: 'string',\n dropdown_selected_bg: 'string',\n dropdown_selected_text: 'string',\n switch_unchecked_color: 'string',\n switch_unchecked_bg: 'string',\n switch_border_radius: 0,\n checkbox_unchecked_color: 'string',\n checkbox_label_color: 'string',\n radio_unchecked_color: 'string',\n radio_label_color: 'string',\n datepicker_selected_bg: 'string',\n datepicker_selected_color: 'string',\n datepicker_border_radius: 0,\n chip_background: 'string',\n chip_hover_background: 'string',\n chip_text_color: 'string',\n chip_hover_text_color: 'string'\n }\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n }\n }\n}\n```\n\n
\n\n---\n\n### `getDesign`\n\nSearch for a especific design owned by user organization\n\n`GET /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.getDesign({\n designId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n }\n }\n}\n```\n\n
\n\n---\n\n### `deleteDesign`\n\nSearch and delete for a especific design owned by user organization\n\n`DELETE /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.deleteDesign({\n designId: 'example',\n})\n```\n\n---\n\n### `updateDesign`\n\nUpdate a especific design owned by user organization\n\n`PUT /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.updateDesign(\n {\n designId: 'example',\n },\n {\n design: {\n brand_id: 'string',\n brand_name: 'string',\n user: {\n emailaddress: 'string',\n fullname: 'string',\n name: 'string',\n userid: 'string'\n },\n style_name: 'string',\n style: {\n logo: { /* ... */ },\n palette: { /* ... */ },\n typography: { /* ... */ },\n shape: { /* ... */ },\n consumer: { /* ... */ }\n },\n is_default: true,\n _manifest: ['string'],\n custom_theme: 'string',\n use_custom_theme: true,\n design_tokens: {\n coupon: 'string',\n cashback: 'string',\n custom_css: 'string',\n accent_color: 'string',\n outline_color: 'string',\n divider_color: 'string',\n link_color: 'string',\n link_hover_color: 'string',\n font_size_scale: 'xs',\n topbar_height: 0,\n topbar_logo_alignment: 'flex-start',\n logo_size: 0,\n input_background: 'string',\n input_border_color: 'string',\n input_text_color: 'string',\n input_label_color: 'string',\n input_border_radius: 0,\n input_height: 0,\n input_variant: 'outlined',\n button_primary_bg: 'string',\n button_primary_text: 'string',\n button_primary_hover_bg: 'string',\n button_primary_hover_text: 'string',\n button_outlined_border: 'string',\n button_outlined_text: 'string',\n button_outlined_hover_bg: 'string',\n button_outlined_hover_text: 'string',\n button_ghost_bg: 'string',\n button_ghost_text: 'string',\n button_ghost_hover_bg: 'string',\n button_ghost_hover_text: 'string',\n button_border_radius: 0,\n button_height: 0,\n card_background: 'string',\n card_border_color: 'string',\n card_variant: 'shadow',\n summary_card_background: 'string',\n toggle_selected_bg: 'string',\n toggle_selected_text: 'string',\n toggle_hover_bg: 'string',\n toggle_hover_text: 'string',\n toggle_border_color: 'string',\n dropdown_hover_bg: 'string',\n dropdown_hover_text: 'string',\n dropdown_selected_bg: 'string',\n dropdown_selected_text: 'string',\n switch_unchecked_color: 'string',\n switch_unchecked_bg: 'string',\n switch_border_radius: 0,\n checkbox_unchecked_color: 'string',\n checkbox_label_color: 'string',\n radio_unchecked_color: 'string',\n radio_label_color: 'string',\n datepicker_selected_bg: 'string',\n datepicker_selected_color: 'string',\n datepicker_border_radius: 0,\n chip_background: 'string',\n chip_hover_background: 'string',\n chip_text_color: 'string',\n chip_hover_text_color: 'string'\n }\n }\n },\n)\n```\n\n---\n\n### `duplicateDesign`\n\nDuplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marked as a copy) but does NOT carry over journey/portal relations, so the new design\n\n`POST /v1/designs/{designId}/duplicate`\n\n```ts\nconst { data } = await client.duplicateDesign({\n designId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n }\n }\n}\n```\n\n
\n\n---\n\n### `getThemeFromDesign`\n\nSearch for a especific design owned by user organization and parse them to a new or old theme\n\n`GET /v1/designs/{designId}/parse`\n\n```ts\nconst { data } = await client.getThemeFromDesign({\n designId: 'example',\n orgId: 'example',\n theme: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"theme\": \"NEW\",\n \"design\": {\n \"id\": \"string\",\n \"last_modified_at\": \"string\",\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {\n \"main\": {\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n }\n },\n \"palette\": {\n \"primary\": \"string\",\n \"secondary\": \"string\",\n \"error\": \"string\",\n \"background\": \"string\",\n \"paper\": \"string\",\n \"navbar\": \"string\",\n \"portal_login_background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_id\": \"string\",\n \"font_name\": \"string\",\n \"font_family\": \"string\",\n \"font_weight_regular\": \"string\",\n \"font_weight_medium\": \"string\",\n \"font_weight_bold\": \"string\",\n \"urls\": [\n {\n \"type\": \"WOFF2\",\n \"url\": \"string\"\n }\n ]\n },\n \"primary\": \"string\",\n \"secondary\": \"string\"\n }\n },\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"journey_design_tokens\": {}\n }\n}\n```\n\n
\n\n---\n\n### `uploadFile`\n\nUpload a new file for the user organization bucket\n\n`POST /v1/designs/files`\n\n```ts\nconst { data } = await client.uploadFile()\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n}\n```\n\n
\n\n---\n\n### `getFiles`\n\nList all files for the user organization bucket\n\n`GET /v1/designs/files`\n\n```ts\nconst { data } = await client.getFiles({\n type: 'example',\n})\n```\n\n
\nResponse\n\n```json\n[\n {\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n }\n]\n```\n\n
\n\n---\n\n### `getConsumerDesign`\n\nSearch for a especific design owned by user organization\n\n`GET /v1/designs/consumer/{application}/{consumerId}`\n\n```ts\nconst { data } = await client.getConsumerDesign({\n consumerId: 'example',\n application: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n }\n }\n}\n```\n\n
\n\n---\n\n### `addConsumer`\n\nAdd a consumer that uses a specific design\n\n`PUT /v1/designs/addConsumer/{application}/{designId}`\n\n```ts\nconst { data } = await client.addConsumer(\n {\n designId: 'example',\n application: 'example',\n },\n {\n consumer_id: '4a062990-a6a3-11eb-9828-4f3da7d4935a',\n consumer_name: 'string',\n should_delete: 'string'\n },\n)\n```\n\n---\n\n### `removeConsumer`\n\nRemove a consumer that uses a specific design\n\n`PUT /v1/designs/removeConsumer/{application}/{designId}`\n\n```ts\nconst { data } = await client.removeConsumer(\n {\n designId: 'example',\n application: 'example',\n },\n {\n consumer_id: '4a062990-a6a3-11eb-9828-4f3da7d4935a',\n should_delete: 'string'\n },\n)\n```\n\n---\n\n## Schemas\n\n### `UploadFileReq`\n\n```ts\ntype UploadFileReq = {\n file_type: \"LOGO\" | \"FONT\" | \"IMAGE\"\n file_data: string // base64\n display_name?: string\n file_name: string\n}\n```\n\n### `UploadFileRes`\n\n```ts\ntype UploadFileRes = {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}\n```\n\n### `GetFilesRes`\n\n```ts\ntype GetFilesRes = Array<{\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}>\n```\n\n### `GetAllDesignsRes`\n\n```ts\ntype GetAllDesignsRes = {\n designs?: Array<{\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }>\n}\n```\n\n### `GetBrandsRes`\n\n```ts\ntype GetBrandsRes = {\n brands?: Array<{\n id: string\n name: string\n created_by?: string\n created_date?: string\n main_brand?: string\n organization_id?: string\n updated_date?: string\n updated_by?: string\n status?: string\n }>\n}\n```\n\n### `AddDesignReq`\n\n```ts\ntype AddDesignReq = {\n design: {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }\n}\n```\n\n### `AddDesignRes`\n\n```ts\ntype AddDesignRes = {\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }\n}\n```\n\n### `GetDesignRes`\n\n```ts\ntype GetDesignRes = {\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }\n}\n```\n\n### `UpdateDesignReq`\n\n```ts\ntype UpdateDesignReq = {\n design: {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }\n}\n```\n\n### `ItemMetada`\n\n```ts\ntype ItemMetada = {\n id?: string\n created_at?: string\n created_by?: string\n edited?: boolean\n last_modified_at?: string\n}\n```\n\n### `AddConsumerReq`\n\n```ts\ntype AddConsumerReq = {\n consumer_id: string\n consumer_name: string\n should_delete?: string\n}\n```\n\n### `RemoveConsumerReq`\n\n```ts\ntype RemoveConsumerReq = {\n consumer_id: string\n should_delete?: string\n}\n```\n\n### `DesignItem`\n\n```ts\ntype DesignItem = {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: string\n fullname?: string\n name?: string\n userid?: string\n }\n style_name: string\n style: {\n logo?: {\n main?: { ... }\n }\n palette: {\n primary: { ... }\n secondary: { ... }\n error: { ... }\n background: { ... }\n paper: { ... }\n navbar: { ... }\n portal_login_background?: { ... }\n }\n typography: {\n font: { ... }\n primary: { ... }\n secondary: { ... }\n }\n shape?: {\n border_radius?: { ... }\n }\n consumer: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n is_default?: boolean\n _manifest?: string[]\n}\n```\n\n### `BrandItem`\n\n```ts\ntype BrandItem = {\n id: string\n name: string\n created_by?: string\n created_date?: string\n main_brand?: string\n organization_id?: string\n updated_date?: string\n updated_by?: string\n status?: string\n}\n```\n\n### `Custom_Style`\n\n```ts\ntype Custom_Style = {\n custom_theme?: string\n use_custom_theme?: boolean\n}\n```\n\n### `Journey`\n\n```ts\ntype Journey = {\n design_tokens?: {\n coupon?: string\n cashback?: string\n custom_css?: string\n accent_color?: string\n outline_color?: string\n divider_color?: string\n link_color?: string\n link_hover_color?: string\n font_size_scale?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"\n topbar_height?: number\n topbar_logo_alignment?: \"flex-start\" | \"center\" | \"flex-end\"\n logo_size?: number\n input_background?: string\n input_border_color?: string\n input_text_color?: string\n input_label_color?: string\n input_border_radius?: number\n input_height?: number\n input_variant?: \"outlined\" | \"filled\" | \"underlined\"\n button_primary_bg?: string\n button_primary_text?: string\n button_primary_hover_bg?: string\n button_primary_hover_text?: string\n button_outlined_border?: string\n button_outlined_text?: string\n button_outlined_hover_bg?: string\n button_outlined_hover_text?: string\n button_ghost_bg?: string\n button_ghost_text?: string\n button_ghost_hover_bg?: string\n button_ghost_hover_text?: string\n button_border_radius?: number\n button_height?: number\n card_background?: string\n card_border_color?: string\n card_variant?: \"shadow\" | \"outlined\"\n summary_card_background?: string\n toggle_selected_bg?: string\n toggle_selected_text?: string\n toggle_hover_bg?: string\n toggle_hover_text?: string\n toggle_border_color?: string\n dropdown_hover_bg?: string\n dropdown_hover_text?: string\n dropdown_selected_bg?: string\n dropdown_selected_text?: string\n switch_unchecked_color?: string\n switch_unchecked_bg?: string\n switch_border_radius?: number\n checkbox_unchecked_color?: string\n checkbox_label_color?: string\n radio_unchecked_color?: string\n radio_label_color?: string\n datepicker_selected_bg?: string\n datepicker_selected_color?: string\n datepicker_border_radius?: number\n chip_background?: string\n chip_hover_background?: string\n chip_text_color?: string\n chip_hover_text_color?: string\n }\n}\n```\n\n### `ConsumerData`\n\n```ts\ntype ConsumerData = {\n widgets: Array<{\n id: string\n name: string\n }>\n customer_portals: Array<{\n id: string\n name: string\n }>\n}\n```\n\n### `WidgetData`\n\n```ts\ntype WidgetData = {\n id: string\n name: string\n}\n```\n\n### `CustomerPortalData`\n\n```ts\ntype CustomerPortalData = {\n id: string\n name: string\n}\n```\n\n### `LogoData`\n\n```ts\ntype LogoData = {\n main?: {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n }\n}\n```\n\n### `PaletteData`\n\n```ts\ntype PaletteData = {\n primary: string\n secondary: string\n error: string\n background: string\n paper: string\n navbar: string\n portal_login_background?: string\n}\n```\n\n### `TypographyData`\n\n```ts\ntype TypographyData = {\n font: {\n font_id: string\n font_name: string\n font_family?: string\n font_weight_regular?: string\n font_weight_medium?: string\n font_weight_bold?: string\n urls: Array<{\n type?: { ... }\n url?: { ... }\n }>\n }\n primary: string\n secondary: string\n}\n```\n\n### `ShapeData`\n\n```ts\ntype ShapeData = {\n border_radius?: number\n}\n```\n\n### `FontData`\n\n```ts\ntype FontData = {\n font_id: string\n font_name: string\n font_family?: string\n font_weight_regular?: string\n font_weight_medium?: string\n font_weight_bold?: string\n urls: Array<{\n type?: \"WOFF2\" | \"WOFF\" | \"TTF\" | \"EOT\"\n url?: string\n }>\n}\n```\n\n### `FontResponseUrl`\n\n```ts\ntype FontResponseUrl = {\n type?: \"WOFF2\" | \"WOFF\" | \"TTF\" | \"EOT\"\n url?: string\n}\n```\n\n### `WidgetPortalData`\n\n```ts\ntype WidgetPortalData = {\n id: string\n name: string\n}\n```\n\n### `ErrorResp`\n\n```ts\ntype ErrorResp = {\n message?: string\n error?: object\n}\n```\n\n### `FileData`\n\n```ts\ntype FileData = {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}\n```\n\n### `DesignId`\n\nId of the design\n\n```ts\ntype DesignId = string\n```\n\n### `Theme`\n\nType of theme to be parsed and returned\n\n```ts\ntype Theme = \"NEW\" | \"OLD\"\n```\n\n### `Application`\n\nType of application that uses the design\n\n```ts\ntype Application = string\n```\n\n### `DesignParameters`\n\n```ts\ntype DesignParameters = {\n designId?: string\n theme?: \"NEW\" | \"OLD\"\n application?: string\n}\n```\n\n### `ParseThemeFromDesignResp`\n\n```ts\ntype ParseThemeFromDesignResp = {\n theme?: \"NEW\" | \"OLD\"\n design?: {\n id?: string\n last_modified_at?: string\n style_name?: string\n style?: {\n logo?: { ... }\n palette?: { ... }\n typography?: { ... }\n }\n custom_theme?: string\n use_custom_theme?: boolean\n journey_design_tokens?: object\n }\n}\n```\n" +"# Design Builder API v2\n\n- **Base URL:** `https://design-builder-api.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/design](https://docs.epilot.io/api/design)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.design.getAllDesigns(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/design'\n\nconst designClient = getClient()\nauthorize(designClient, () => '')\nconst { data } = await designClient.getAllDesigns(...)\n```\n\n## Operations\n\n**design-builder**\n- [`getAllDesigns`](#getalldesigns)\n- [`addDesign`](#adddesign)\n- [`getDesign`](#getdesign)\n- [`deleteDesign`](#deletedesign)\n- [`updateDesign`](#updatedesign)\n- [`duplicateDesign`](#duplicatedesign)\n- [`generateDesign`](#generatedesign)\n- [`generateDesignDocument`](#generatedesigndocument)\n- [`uploadFile`](#uploadfile)\n- [`getFiles`](#getfiles)\n- [`getConsumerDesign`](#getconsumerdesign)\n\n**Schemas**\n- [`UploadFileReq`](#uploadfilereq)\n- [`UploadFileRes`](#uploadfileres)\n- [`GetFilesRes`](#getfilesres)\n- [`GetAllDesignsRes`](#getalldesignsres)\n- [`GetBrandsRes`](#getbrandsres)\n- [`AddDesignReq`](#adddesignreq)\n- [`AddDesignRes`](#adddesignres)\n- [`GetDesignRes`](#getdesignres)\n- [`UpdateDesignReq`](#updatedesignreq)\n- [`ItemMetada`](#itemmetada)\n- [`AddConsumerReq`](#addconsumerreq)\n- [`RemoveConsumerReq`](#removeconsumerreq)\n- [`DesignItem`](#designitem)\n- [`BrandItem`](#branditem)\n- [`Design_Document_V1`](#design_document_v1)\n- [`UpdateDesignConflict`](#updatedesignconflict)\n- [`Custom_Style`](#custom_style)\n- [`Journey`](#journey)\n- [`ConsumerData`](#consumerdata)\n- [`WidgetData`](#widgetdata)\n- [`CustomerPortalData`](#customerportaldata)\n- [`LogoData`](#logodata)\n- [`PaletteData`](#palettedata)\n- [`TypographyData`](#typographydata)\n- [`ShapeData`](#shapedata)\n- [`FontData`](#fontdata)\n- [`FontResponseUrl`](#fontresponseurl)\n- [`WidgetPortalData`](#widgetportaldata)\n- [`GenerateDesignReq`](#generatedesignreq)\n- [`GenerateDesignRes`](#generatedesignres)\n- [`GenerateDesignDocumentReq`](#generatedesigndocumentreq)\n- [`FindingId`](#findingid)\n- [`FindingStatus`](#findingstatus)\n- [`FindingDetail`](#findingdetail)\n- [`DesignFinding`](#designfinding)\n- [`GenerateDesignDocumentRes`](#generatedesigndocumentres)\n- [`GeneratedDesign`](#generateddesign)\n- [`ErrorResp`](#errorresp)\n- [`FileData`](#filedata)\n- [`DesignId`](#designid)\n- [`Theme`](#theme)\n- [`Application`](#application)\n- [`DesignParameters`](#designparameters)\n- [`ParseThemeFromDesignResp`](#parsethemefromdesignresp)\n\n### `getAllDesigns`\n\nScan all designs linked to a organization, based in orgId attribute from JWT auth token\n\n`GET /v1/designs`\n\n```ts\nconst { data } = await client.getAllDesigns()\n```\n\n
\nResponse\n\n```json\n{\n \"designs\": [\n {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {},\n \"style_name\": \"string\",\n \"style\": {},\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {},\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `addDesign`\n\nCreate a brand new design linked to a organization, based in orgId attribute from JWT auth token\n\n`POST /v1/designs`\n\n```ts\nconst { data } = await client.addDesign(\n null,\n {\n design: {\n brand_id: 'string',\n brand_name: 'string',\n user: {\n emailaddress: 'string',\n fullname: 'string',\n name: 'string',\n userid: 'string'\n },\n style_name: 'string',\n style: {\n logo: { /* ... */ },\n palette: { /* ... */ },\n typography: { /* ... */ },\n shape: { /* ... */ },\n consumer: { /* ... */ }\n },\n is_default: true,\n _manifest: ['string'],\n custom_theme: 'string',\n use_custom_theme: true,\n design_tokens: {\n coupon: 'string',\n cashback: 'string',\n custom_css: 'string',\n accent_color: 'string',\n outline_color: 'string',\n divider_color: 'string',\n link_color: 'string',\n link_hover_color: 'string',\n font_size_scale: 'xs',\n topbar_height: 0,\n topbar_logo_alignment: 'flex-start',\n logo_size: 0,\n input_background: 'string',\n input_border_color: 'string',\n input_text_color: 'string',\n input_label_color: 'string',\n input_border_radius: 0,\n input_height: 0,\n input_variant: 'outlined',\n button_primary_bg: 'string',\n button_primary_text: 'string',\n button_primary_hover_bg: 'string',\n button_primary_hover_text: 'string',\n button_outlined_border: 'string',\n button_outlined_text: 'string',\n button_outlined_hover_bg: 'string',\n button_outlined_hover_text: 'string',\n button_ghost_bg: 'string',\n button_ghost_text: 'string',\n button_ghost_hover_bg: 'string',\n button_ghost_hover_text: 'string',\n button_border_radius: 0,\n button_height: 0,\n card_background: 'string',\n card_border_color: 'string',\n card_variant: 'shadow',\n summary_card_background: 'string',\n toggle_selected_bg: 'string',\n toggle_selected_text: 'string',\n toggle_hover_bg: 'string',\n toggle_hover_text: 'string',\n toggle_border_color: 'string',\n dropdown_hover_bg: 'string',\n dropdown_hover_text: 'string',\n dropdown_selected_bg: 'string',\n dropdown_selected_text: 'string',\n switch_unchecked_color: 'string',\n switch_unchecked_bg: 'string',\n switch_border_radius: 0,\n checkbox_unchecked_color: 'string',\n checkbox_label_color: 'string',\n radio_unchecked_color: 'string',\n radio_label_color: 'string',\n datepicker_selected_bg: 'string',\n datepicker_selected_color: 'string',\n datepicker_border_radius: 0,\n chip_background: 'string',\n chip_hover_background: 'string',\n chip_text_color: 'string',\n chip_hover_text_color: 'string'\n },\n version: 1,\n colors: {},\n typography: {},\n shape: {},\n components: {},\n assets: {},\n consumer: {\n widgets: [ /* ... */ ],\n customer_portals: [ /* ... */ ]\n }\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n },\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [],\n \"customer_portals\": []\n }\n }\n}\n```\n\n
\n\n---\n\n### `getDesign`\n\nSearch for a especific design owned by user organization\n\n`GET /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.getDesign({\n designId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n },\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [],\n \"customer_portals\": []\n }\n }\n}\n```\n\n
\n\n---\n\n### `deleteDesign`\n\nSearch and delete for a especific design owned by user organization\n\n`DELETE /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.deleteDesign({\n designId: 'example',\n})\n```\n\n---\n\n### `updateDesign`\n\nUpdate a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`\n\n`PUT /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.updateDesign(\n {\n designId: 'example',\n If-Match: 'example',\n },\n {\n design: {\n brand_id: 'string',\n brand_name: 'string',\n user: {\n emailaddress: 'string',\n fullname: 'string',\n name: 'string',\n userid: 'string'\n },\n style_name: 'string',\n style: {\n logo: { /* ... */ },\n palette: { /* ... */ },\n typography: { /* ... */ },\n shape: { /* ... */ },\n consumer: { /* ... */ }\n },\n is_default: true,\n _manifest: ['string'],\n custom_theme: 'string',\n use_custom_theme: true,\n design_tokens: {\n coupon: 'string',\n cashback: 'string',\n custom_css: 'string',\n accent_color: 'string',\n outline_color: 'string',\n divider_color: 'string',\n link_color: 'string',\n link_hover_color: 'string',\n font_size_scale: 'xs',\n topbar_height: 0,\n topbar_logo_alignment: 'flex-start',\n logo_size: 0,\n input_background: 'string',\n input_border_color: 'string',\n input_text_color: 'string',\n input_label_color: 'string',\n input_border_radius: 0,\n input_height: 0,\n input_variant: 'outlined',\n button_primary_bg: 'string',\n button_primary_text: 'string',\n button_primary_hover_bg: 'string',\n button_primary_hover_text: 'string',\n button_outlined_border: 'string',\n button_outlined_text: 'string',\n button_outlined_hover_bg: 'string',\n button_outlined_hover_text: 'string',\n button_ghost_bg: 'string',\n button_ghost_text: 'string',\n button_ghost_hover_bg: 'string',\n button_ghost_hover_text: 'string',\n button_border_radius: 0,\n button_height: 0,\n card_background: 'string',\n card_border_color: 'string',\n card_variant: 'shadow',\n summary_card_background: 'string',\n toggle_selected_bg: 'string',\n toggle_selected_text: 'string',\n toggle_hover_bg: 'string',\n toggle_hover_text: 'string',\n toggle_border_color: 'string',\n dropdown_hover_bg: 'string',\n dropdown_hover_text: 'string',\n dropdown_selected_bg: 'string',\n dropdown_selected_text: 'string',\n switch_unchecked_color: 'string',\n switch_unchecked_bg: 'string',\n switch_border_radius: 0,\n checkbox_unchecked_color: 'string',\n checkbox_label_color: 'string',\n radio_unchecked_color: 'string',\n radio_label_color: 'string',\n datepicker_selected_bg: 'string',\n datepicker_selected_color: 'string',\n datepicker_border_radius: 0,\n chip_background: 'string',\n chip_hover_background: 'string',\n chip_text_color: 'string',\n chip_hover_text_color: 'string'\n },\n version: 1,\n colors: {},\n typography: {},\n shape: {},\n components: {},\n assets: {},\n consumer: {\n widgets: [ /* ... */ ],\n customer_portals: [ /* ... */ ]\n }\n }\n },\n)\n```\n\n---\n\n### `duplicateDesign`\n\nDuplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marked as a copy) but does NOT carry over journey/portal relations, so the new design\n\n`POST /v1/designs/{designId}/duplicate`\n\n```ts\nconst { data } = await client.duplicateDesign({\n designId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n },\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [],\n \"customer_portals\": []\n }\n }\n}\n```\n\n
\n\n---\n\n### `generateDesign`\n\nGenerates a design (palette, text colours, font, logo and border radius) from a public\nwebsite with AI. The result is cached per organization and URL for 30 days.\n\n`POST /v1/designs/generate`\n\n```ts\nconst { data } = await client.generateDesign(\n null,\n {\n url: 'https://www.twl.de'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"style\": {\n \"logo\": {\n \"main\": {\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n }\n },\n \"palette\": {\n \"primary\": \"string\",\n \"secondary\": \"string\",\n \"error\": \"string\",\n \"background\": \"string\",\n \"paper\": \"string\",\n \"navbar\": \"string\",\n \"portal_login_background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_id\": \"string\",\n \"font_name\": \"string\",\n \"font_family\": \"string\",\n \"font_weight_regular\": \"string\",\n \"font_weight_medium\": \"string\",\n \"font_weight_bold\": \"string\",\n \"urls\": [\n {\n \"type\": \"WOFF2\",\n \"url\": \"string\"\n }\n ]\n },\n \"primary\": \"string\",\n \"secondary\": \"string\"\n }\n },\n \"theme\": {\n \"shape\": {\n \"borderRadius\": \"8\"\n }\n }\n },\n \"cached\": true\n}\n```\n\n
\n\n---\n\n### `generateDesignDocument`\n\nReads a public website and returns a v1 design document plus one finding for each\nid in fixed order. This version chooses the favicon in code and derives the site name.\nThe other findings are `not_fou\n\n`POST /v1/designs/document/generate`\n\n```ts\nconst { data } = await client.generateDesignDocument(\n null,\n {\n url: 'https://www.stadtwerke-musterstadt.de'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"document\": {\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [\n {\n \"id\": \"string\",\n \"name\": \"string\"\n }\n ],\n \"customer_portals\": [\n {\n \"id\": \"string\",\n \"name\": \"string\"\n }\n ]\n }\n },\n \"findings\": [\n {\n \"id\": \"primary_color\",\n \"status\": \"found\",\n \"detail\": {\n \"family\": \"string\"\n }\n },\n {\n \"id\": \"primary_color\",\n \"status\": \"found\",\n \"detail\": {\n \"family\": \"string\"\n }\n }\n ],\n \"site_name\": \"Stadtwerke Musterstadt\",\n \"cached\": true\n}\n```\n\n
\n\n---\n\n### `uploadFile`\n\nUpload a new file for the user organization bucket\n\n`POST /v1/designs/files`\n\n```ts\nconst { data } = await client.uploadFile()\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n}\n```\n\n
\n\n---\n\n### `getFiles`\n\nList all files for the user organization bucket\n\n`GET /v1/designs/files`\n\n```ts\nconst { data } = await client.getFiles({\n type: 'example',\n})\n```\n\n
\nResponse\n\n```json\n[\n {\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n }\n]\n```\n\n
\n\n---\n\n### `getConsumerDesign`\n\nSearch for a especific design owned by user organization\n\n`GET /v1/designs/consumer/{application}/{consumerId}`\n\n```ts\nconst { data } = await client.getConsumerDesign({\n consumerId: 'example',\n application: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n },\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [],\n \"customer_portals\": []\n }\n }\n}\n```\n\n
\n\n---\n\n## Schemas\n\n### `UploadFileReq`\n\n```ts\ntype UploadFileReq = {\n file_type: \"LOGO\" | \"FONT\" | \"IMAGE\"\n file_data: string // base64\n display_name?: string\n file_name: string\n}\n```\n\n### `UploadFileRes`\n\n```ts\ntype UploadFileRes = {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}\n```\n\n### `GetFilesRes`\n\n```ts\ntype GetFilesRes = Array<{\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}>\n```\n\n### `GetAllDesignsRes`\n\n```ts\ntype GetAllDesignsRes = {\n designs?: Array<{\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }>\n // ...\n}\n```\n\n### `GetBrandsRes`\n\n```ts\ntype GetBrandsRes = {\n brands?: Array<{\n id: string\n name: string\n created_by?: string\n created_date?: string\n main_brand?: string\n organization_id?: string\n updated_date?: string\n updated_by?: string\n status?: string\n }>\n}\n```\n\n### `AddDesignReq`\n\n```ts\ntype AddDesignReq = {\n design: {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n}\n```\n\n### `AddDesignRes`\n\n```ts\ntype AddDesignRes = {\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n // ...\n}\n```\n\n### `GetDesignRes`\n\n```ts\ntype GetDesignRes = {\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n // ...\n}\n```\n\n### `UpdateDesignReq`\n\n```ts\ntype UpdateDesignReq = {\n design: {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n}\n```\n\n### `ItemMetada`\n\n```ts\ntype ItemMetada = {\n id?: string\n created_at?: string\n created_by?: string\n edited?: boolean\n last_modified_at?: string\n}\n```\n\n### `AddConsumerReq`\n\n```ts\ntype AddConsumerReq = {\n consumer_id: string\n consumer_name: string\n}\n```\n\n### `RemoveConsumerReq`\n\n```ts\ntype RemoveConsumerReq = {\n consumer_id: string\n}\n```\n\n### `DesignItem`\n\n```ts\ntype DesignItem = {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: string\n fullname?: string\n name?: string\n userid?: string\n }\n style_name: string\n style: {\n logo?: {\n main?: { ... }\n }\n palette: {\n primary: { ... }\n secondary: { ... }\n error: { ... }\n background: { ... }\n paper: { ... }\n navbar: { ... }\n portal_login_background?: { ... }\n }\n typography: {\n font: { ... }\n primary: { ... }\n secondary: { ... }\n }\n shape?: {\n border_radius?: { ... }\n }\n consumer: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n is_default?: boolean\n _manifest?: string[]\n}\n```\n\n### `BrandItem`\n\n```ts\ntype BrandItem = {\n id: string\n name: string\n created_by?: string\n created_date?: string\n main_brand?: string\n organization_id?: string\n updated_date?: string\n updated_by?: string\n status?: string\n}\n```\n\n### `Design_Document_V1`\n\nGroups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and \n\n```ts\ntype Design_Document_V1 = {\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: Array<{\n id: { ... }\n name: { ... }\n }>\n customer_portals: Array<{\n id: { ... }\n name: { ... }\n }>\n }\n}\n```\n\n### `UpdateDesignConflict`\n\n```ts\ntype UpdateDesignConflict = {\n message?: string\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n // ...\n}\n```\n\n### `Custom_Style`\n\n```ts\ntype Custom_Style = {\n custom_theme?: string\n use_custom_theme?: boolean\n}\n```\n\n### `Journey`\n\n```ts\ntype Journey = {\n design_tokens?: {\n coupon?: string\n cashback?: string\n custom_css?: string\n accent_color?: string\n outline_color?: string\n divider_color?: string\n link_color?: string\n link_hover_color?: string\n font_size_scale?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"\n topbar_height?: number\n topbar_logo_alignment?: \"flex-start\" | \"center\" | \"flex-end\"\n logo_size?: number\n input_background?: string\n input_border_color?: string\n input_text_color?: string\n input_label_color?: string\n input_border_radius?: number\n input_height?: number\n input_variant?: \"outlined\" | \"filled\" | \"underlined\"\n button_primary_bg?: string\n button_primary_text?: string\n button_primary_hover_bg?: string\n button_primary_hover_text?: string\n button_outlined_border?: string\n button_outlined_text?: string\n button_outlined_hover_bg?: string\n button_outlined_hover_text?: string\n button_ghost_bg?: string\n button_ghost_text?: string\n button_ghost_hover_bg?: string\n button_ghost_hover_text?: string\n button_border_radius?: number\n button_height?: number\n card_background?: string\n card_border_color?: string\n card_variant?: \"shadow\" | \"outlined\"\n summary_card_background?: string\n toggle_selected_bg?: string\n toggle_selected_text?: string\n toggle_hover_bg?: string\n toggle_hover_text?: string\n toggle_border_color?: string\n dropdown_hover_bg?: string\n dropdown_hover_text?: string\n dropdown_selected_bg?: string\n dropdown_selected_text?: string\n switch_unchecked_color?: string\n switch_unchecked_bg?: string\n switch_border_radius?: number\n checkbox_unchecked_color?: string\n checkbox_label_color?: string\n radio_unchecked_color?: string\n radio_label_color?: string\n datepicker_selected_bg?: string\n datepicker_selected_color?: string\n datepicker_border_radius?: number\n chip_background?: string\n chip_hover_background?: string\n chip_text_color?: string\n chip_hover_text_color?: string\n }\n}\n```\n\n### `ConsumerData`\n\n```ts\ntype ConsumerData = {\n widgets: Array<{\n id: string\n name: string\n }>\n customer_portals: Array<{\n id: string\n name: string\n }>\n}\n```\n\n### `WidgetData`\n\n```ts\ntype WidgetData = {\n id: string\n name: string\n}\n```\n\n### `CustomerPortalData`\n\n```ts\ntype CustomerPortalData = {\n id: string\n name: string\n}\n```\n\n### `LogoData`\n\n```ts\ntype LogoData = {\n main?: {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n }\n}\n```\n\n### `PaletteData`\n\n```ts\ntype PaletteData = {\n primary: string\n secondary: string\n error: string\n background: string\n paper: string\n navbar: string\n portal_login_background?: string\n}\n```\n\n### `TypographyData`\n\n```ts\ntype TypographyData = {\n font: {\n font_id: string\n font_name: string\n font_family?: string\n font_weight_regular?: string\n font_weight_medium?: string\n font_weight_bold?: string\n urls: Array<{\n type?: { ... }\n url?: { ... }\n }>\n }\n primary: string\n secondary: string\n}\n```\n\n### `ShapeData`\n\n```ts\ntype ShapeData = {\n border_radius?: number\n}\n```\n\n### `FontData`\n\n```ts\ntype FontData = {\n font_id: string\n font_name: string\n font_family?: string\n font_weight_regular?: string\n font_weight_medium?: string\n font_weight_bold?: string\n urls: Array<{\n type?: \"WOFF2\" | \"WOFF\" | \"TTF\" | \"EOT\"\n url?: string\n }>\n}\n```\n\n### `FontResponseUrl`\n\n```ts\ntype FontResponseUrl = {\n type?: \"WOFF2\" | \"WOFF\" | \"TTF\" | \"EOT\"\n url?: string\n}\n```\n\n### `WidgetPortalData`\n\n```ts\ntype WidgetPortalData = {\n id: string\n name: string\n}\n```\n\n### `GenerateDesignReq`\n\n```ts\ntype GenerateDesignReq = {\n url: string // uri\n}\n```\n\n### `GenerateDesignRes`\n\n```ts\ntype GenerateDesignRes = {\n design: {\n style: {\n logo: { ... }\n palette: { ... }\n typography: { ... }\n }\n theme: {\n shape: { ... }\n }\n }\n cached: boolean\n}\n```\n\n### `GenerateDesignDocumentReq`\n\n```ts\ntype GenerateDesignDocumentReq = {\n url: string // uri\n}\n```\n\n### `FindingId`\n\n```ts\ntype FindingId = \"primary_color\" | \"fonts\" | \"corners\" | \"primary_button\" | \"logo\" | \"favicon\"\n```\n\n### `FindingStatus`\n\n```ts\ntype FindingStatus = \"found\" | \"not_found\" | \"not_available\"\n```\n\n### `FindingDetail`\n\n```ts\ntype FindingDetail = {\n family: string\n}\n```\n\n### `DesignFinding`\n\n```ts\ntype DesignFinding = {\n id: \"primary_color\" | \"fonts\" | \"corners\" | \"primary_button\" | \"logo\" | \"favicon\"\n status: \"found\" | \"not_found\" | \"not_available\"\n detail?: {\n family: string\n }\n}\n```\n\n### `GenerateDesignDocumentRes`\n\n```ts\ntype GenerateDesignDocumentRes = {\n document: {\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n findings: Array<{\n id: \"primary_color\" | \"fonts\" | \"corners\" | \"primary_button\" | \"logo\" | \"favicon\"\n status: \"found\" | \"not_found\" | \"not_available\"\n detail?: {\n family: { ... }\n }\n }>\n site_name: string\n cached: boolean\n}\n```\n\n### `GeneratedDesign`\n\nPartial design to merge into the design being edited\n\n```ts\ntype GeneratedDesign = {\n style: {\n logo: {\n main?: { ... }\n }\n palette: {\n primary: { ... }\n secondary: { ... }\n error: { ... }\n background: { ... }\n paper: { ... }\n navbar: { ... }\n portal_login_background?: { ... }\n }\n typography: {\n font: { ... }\n primary: { ... }\n secondary: { ... }\n }\n }\n theme: {\n shape: {\n borderRadius: { ... }\n }\n }\n}\n```\n\n### `ErrorResp`\n\n```ts\ntype ErrorResp = {\n message?: string\n code?: string\n error?: object\n}\n```\n\n### `FileData`\n\n```ts\ntype FileData = {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}\n```\n\n### `DesignId`\n\nId of the design\n\n```ts\ntype DesignId = string\n```\n\n### `Theme`\n\nType of theme to be parsed and returned\n\n```ts\ntype Theme = \"NEW\" | \"OLD\"\n```\n\n### `Application`\n\nType of application that uses the design\n\n```ts\ntype Application = string\n```\n\n### `DesignParameters`\n\n```ts\ntype DesignParameters = {\n designId?: string\n theme?: \"NEW\" | \"OLD\"\n application?: string\n}\n```\n\n### `ParseThemeFromDesignResp`\n\n```ts\ntype ParseThemeFromDesignResp = {\n theme?: \"NEW\" | \"OLD\"\n design?: {\n id?: string\n last_modified_at?: string\n style_name?: string\n style?: {\n logo?: { ... }\n palette?: { ... }\n typography?: { ... }\n }\n custom_theme?: string\n use_custom_theme?: boolean\n journey_design_tokens?: object\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n journey?: Record\n }\n}\n```\n" diff --git a/packages/epilot-sdk-v2/src/types/design.d.ts b/packages/epilot-sdk-v2/src/types/design.d.ts index 25aa85007..c3a7bb7c8 100644 --- a/packages/epilot-sdk-v2/src/types/design.d.ts +++ b/packages/epilot-sdk-v2/src/types/design.d.ts @@ -17,9 +17,11 @@ export declare namespace Components { */ DesignId; consumer_name: string; - should_delete?: string; } export interface AddDesignReq { + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ design: { brand_id?: string; brand_name?: string; @@ -280,9 +282,29 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }; } export interface AddDesignRes { + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ design?: { id?: string; /** @@ -553,6 +575,23 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }; } /** @@ -584,6 +623,33 @@ export declare namespace Components { id: string; name: string; } + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ + export interface DesignDocumentV1 { + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; + } + export interface DesignFinding { + id: FindingId; + status: FindingStatus; + detail?: FindingDetail; + } /** * Id of the design * example: @@ -635,6 +701,10 @@ export declare namespace Components { } export interface ErrorResp { message?: string; + /** + * Machine-readable reason, e.g. `invalid_url` or `rate_limited` + */ + code?: string; error?: { [key: string]: any; }; @@ -650,6 +720,14 @@ export declare namespace Components { */ file_id?: string; } + export interface FindingDetail { + /** + * Font family that was found but cannot be loaded + */ + family: string; + } + export type FindingId = "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon"; + export type FindingStatus = "found" | "not_found" | "not_available"; export interface FontData { font_id: string; font_name: string; @@ -663,6 +741,68 @@ export declare namespace Components { type?: "WOFF2" | "WOFF" | "TTF" | "EOT"; url?: string; } + export interface GenerateDesignDocumentReq { + /** + * Public website to read the design from + * example: + * https://www.stadtwerke-musterstadt.de + */ + url: string; // uri + } + export interface GenerateDesignDocumentRes { + document: /* Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. */ DesignDocumentV1; + findings: [ + DesignFinding, + DesignFinding, + DesignFinding, + DesignFinding, + DesignFinding, + DesignFinding + ]; + /** + * example: + * Stadtwerke Musterstadt + */ + site_name: string; + /** + * True when the response was served from an earlier successful generation for this organization, normalised URL and generator version + */ + cached: boolean; + } + export interface GenerateDesignReq { + /** + * Public website to derive the design from + * example: + * https://www.twl.de + */ + url: string; // uri + } + export interface GenerateDesignRes { + design: /* Partial design to merge into the design being edited */ GeneratedDesign; + /** + * True when the design was generated earlier for this organization and URL + */ + cached: boolean; + } + /** + * Partial design to merge into the design being edited + */ + export interface GeneratedDesign { + style: { + logo: LogoData; + palette: PaletteData; + typography: TypographyData; + }; + theme: { + shape: { + /** + * example: + * 8 + */ + borderRadius: string; + }; + }; + } export interface GetAllDesignsRes { designs?: { id?: string; @@ -934,6 +1074,23 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }[]; } export interface GetBrandsRes { @@ -950,6 +1107,9 @@ export declare namespace Components { }[]; } export interface GetDesignRes { + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ design?: { id?: string; /** @@ -1220,6 +1380,23 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }; } export type GetFilesRes = { @@ -1519,6 +1696,28 @@ export declare namespace Components { journey_design_tokens?: { [key: string]: any; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + /** + * v1 designs only: the journey group of @epilot/design-document (custom_css, tokens and the journey overrides primary_color, font, border_radius, logo), derived on read from the stored journey fields and compared with the stored v1 groups. What a journey paints from it equals what it paints from the theme built from the old fields. Not returned by GET. + */ + journey?: { + [name: string]: any; + }; }; } export interface RemoveConsumerReq { @@ -1528,7 +1727,6 @@ export declare namespace Components { * 4a062990-a6a3-11eb-9828-4f3da7d4935a */ DesignId; - should_delete?: string; } export interface ShapeData { border_radius?: number; @@ -1544,7 +1742,304 @@ export declare namespace Components { primary: string; secondary: string; } + export interface UpdateDesignConflict { + message?: string; + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ + design?: { + id?: string; + /** + * Creation date and time + * example: + * 2021-01-30T08:30:00Z + */ + created_at?: string; + created_by?: string; + edited: boolean; + last_modified_at?: string; + brand_id?: string; + brand_name?: string; + user?: { + emailaddress?: string; + fullname?: string; + name?: string; + userid?: string; + }; + style_name: string; + style: { + logo?: LogoData; + palette: PaletteData; + typography: TypographyData; + shape?: ShapeData; + consumer: ConsumerData; + }; + is_default?: boolean; + /** + * The manifest IDs associated with this design + */ + _manifest?: string[]; + custom_theme?: string; + use_custom_theme?: boolean; + /** + * Design tokens for journey customization + */ + design_tokens?: { + coupon?: string; + cashback?: string; + custom_css?: string; + /** + * Accent color, defaults to primary + */ + accent_color?: string; + /** + * Global outline/focus color + */ + outline_color?: string; + /** + * Divider line color + */ + divider_color?: string; + /** + * Link text color + */ + link_color?: string; + /** + * Link hover text color + */ + link_hover_color?: string; + /** + * Font size scale factor + */ + font_size_scale?: "xs" | "sm" | "md" | "lg" | "xl"; + /** + * Topbar minimum height in pixels + */ + topbar_height?: number; + /** + * Logo/content alignment in the top bar + */ + topbar_logo_alignment?: "flex-start" | "center" | "flex-end"; + /** + * Logo size in pixels + */ + logo_size?: number; + /** + * Input field background color + */ + input_background?: string; + /** + * Input field border color + */ + input_border_color?: string; + /** + * Input field text color + */ + input_text_color?: string; + /** + * Input field label color + */ + input_label_color?: string; + /** + * Input field border radius in pixels + */ + input_border_radius?: number; + /** + * Input field height in pixels + */ + input_height?: number; + /** + * Input field variant style + */ + input_variant?: "outlined" | "filled" | "underlined"; + /** + * Primary button background color or gradient + */ + button_primary_bg?: string; + /** + * Primary button text color + */ + button_primary_text?: string; + /** + * Primary button hover background color or gradient + */ + button_primary_hover_bg?: string; + /** + * Primary button hover text color + */ + button_primary_hover_text?: string; + /** + * Outlined button border color + */ + button_outlined_border?: string; + /** + * Outlined button text color + */ + button_outlined_text?: string; + /** + * Outlined button hover background color + */ + button_outlined_hover_bg?: string; + /** + * Outlined button hover text color + */ + button_outlined_hover_text?: string; + /** + * Ghost button background color + */ + button_ghost_bg?: string; + /** + * Ghost button text color + */ + button_ghost_text?: string; + /** + * Ghost button hover background color + */ + button_ghost_hover_bg?: string; + /** + * Ghost button hover text color + */ + button_ghost_hover_text?: string; + /** + * Button border radius in pixels + */ + button_border_radius?: number; + /** + * Button height in pixels + */ + button_height?: number; + /** + * Card background color + */ + card_background?: string; + /** + * Card border color for outlined variant + */ + card_border_color?: string; + /** + * Card visual variant + */ + card_variant?: "shadow" | "outlined"; + /** + * Summary card background color + */ + summary_card_background?: string; + /** + * Toggle button selected background color + */ + toggle_selected_bg?: string; + /** + * Toggle button selected text color + */ + toggle_selected_text?: string; + /** + * Toggle button hover background color + */ + toggle_hover_bg?: string; + /** + * Toggle button hover text color + */ + toggle_hover_text?: string; + /** + * Toggle group wrapper border color + */ + toggle_border_color?: string; + /** + * Dropdown option hover background color + */ + dropdown_hover_bg?: string; + /** + * Dropdown option hover text color + */ + dropdown_hover_text?: string; + /** + * Dropdown option selected background color + */ + dropdown_selected_bg?: string; + /** + * Dropdown option selected text color + */ + dropdown_selected_text?: string; + /** + * Switch unchecked thumb color + */ + switch_unchecked_color?: string; + /** + * Switch unchecked track background color + */ + switch_unchecked_bg?: string; + /** + * Switch border radius in pixels + */ + switch_border_radius?: number; + /** + * Checkbox unchecked border color + */ + checkbox_unchecked_color?: string; + /** + * Checkbox label text color + */ + checkbox_label_color?: string; + /** + * Radio button unchecked border color + */ + radio_unchecked_color?: string; + /** + * Radio button label text color + */ + radio_label_color?: string; + /** + * Date picker selected date background color + */ + datepicker_selected_bg?: string; + /** + * Date picker selected date text color + */ + datepicker_selected_color?: string; + /** + * Date picker border radius in pixels + */ + datepicker_border_radius?: number; + /** + * Chip background color + */ + chip_background?: string; + /** + * Chip hover background color + */ + chip_hover_background?: string; + /** + * Chip text color + */ + chip_text_color?: string; + /** + * Chip hover text color + */ + chip_hover_text_color?: string; + }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; + }; + } export interface UpdateDesignReq { + /** + * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. + */ design: { brand_id?: string; brand_name?: string; @@ -1805,6 +2300,23 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; + version?: 1; + colors?: { + [name: string]: any; + }; + typography?: { + [name: string]: any; + }; + shape?: { + [name: string]: any; + }; + components?: { + [name: string]: any; + }; + assets?: { + [name: string]: any; + }; + consumer?: ConsumerData; }; } export interface UploadFileReq { @@ -1888,7 +2400,9 @@ export declare namespace Paths { export type $401 = Components.Schemas.ErrorResp; export interface $404 { } + export type $409 = Components.Schemas.ErrorResp; export type $500 = Components.Schemas.ErrorResp; + export type $503 = Components.Schemas.ErrorResp; } } namespace DuplicateDesign { @@ -1912,6 +2426,33 @@ export declare namespace Paths { export type $500 = Components.Schemas.ErrorResp; } } + namespace GenerateDesign { + export type RequestBody = Components.Schemas.GenerateDesignReq; + namespace Responses { + export type $200 = Components.Schemas.GenerateDesignRes; + export type $201 = Components.Schemas.GenerateDesignRes; + export type $400 = Components.Schemas.ErrorResp; + export type $401 = Components.Schemas.ErrorResp; + export type $403 = Components.Schemas.ErrorResp; + export type $422 = Components.Schemas.ErrorResp; + export type $502 = Components.Schemas.ErrorResp; + export type $504 = Components.Schemas.ErrorResp; + } + } + namespace GenerateDesignDocument { + export type RequestBody = Components.Schemas.GenerateDesignDocumentReq; + namespace Responses { + export type $200 = Components.Schemas.GenerateDesignDocumentRes; + export type $201 = Components.Schemas.GenerateDesignDocumentRes; + export type $400 = Components.Schemas.ErrorResp; + export type $401 = Components.Schemas.ErrorResp; + export type $403 = Components.Schemas.ErrorResp; + export type $422 = Components.Schemas.ErrorResp; + export type $429 = Components.Schemas.ErrorResp; + export type $502 = Components.Schemas.ErrorResp; + export type $504 = Components.Schemas.ErrorResp; + } + } namespace GetAllDesigns { namespace Responses { export type $200 = Components.Schemas.GetAllDesignsRes; @@ -2051,6 +2592,9 @@ export declare namespace Paths { } } namespace UpdateDesign { + export interface HeaderParameters { + "If-Match"?: Parameters.IfMatch; + } namespace Parameters { export type DesignId = /** * Id of the design @@ -2058,6 +2602,7 @@ export declare namespace Paths { * 4a062990-a6a3-11eb-9828-4f3da7d4935a */ Components.Schemas.DesignId; + export type IfMatch = string; } export interface PathParameters { designId: Parameters.DesignId; @@ -2070,6 +2615,7 @@ export declare namespace Paths { export type $401 = Components.Schemas.ErrorResp; export interface $404 { } + export type $409 = Components.Schemas.UpdateDesignConflict; export type $500 = Components.Schemas.ErrorResp; } } @@ -2119,10 +2665,10 @@ export interface OperationMethods { /** * updateDesign - updateDesign * - * Update a especific design owned by user organization + * Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`, `custom_theme` and `use_custom_theme` untouched. A body without `version` on a v1 design is treated as an old client's read-modify-write: those four fields are stored as sent, and brand-wide changes in `style` are applied to the v1 groups. */ 'updateDesign'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: Paths.UpdateDesign.RequestBody, config?: AxiosRequestConfig ): OperationResponse @@ -2149,13 +2695,42 @@ export interface OperationMethods { /** * getThemeFromDesign - getThemeFromDesign * - * Search for a especific design owned by user organization and parse them to a new or old theme + * Search for a especific design owned by user organization and parse them to a new or old theme. Deprecated: kept for old readers only. For a v1 design the response carries the v1 groups and the derived `journey` group next to the stored old fields and the theme built from them; new runtimes read the v1 groups. */ 'getThemeFromDesign'( parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig ): OperationResponse + /** + * generateDesign - generateDesign + * + * Generates a design (palette, text colours, font, logo and border radius) from a public + * website with AI. The result is cached per organization and URL for 30 days. + * + */ + 'generateDesign'( + parameters?: Parameters | null, + data?: Paths.GenerateDesign.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * generateDesignDocument - generateDesignDocument + * + * Reads a public website and returns a v1 design document plus one finding for each + * id in fixed order. This version chooses the favicon in code and derives the site name. + * The other findings are `not_found` until they are implemented. The document contains + * only the leaves that passed validation, and defaults are not pruned. + * Successful responses are cached per organization, normalised URL and generator version + * for 7 days. Each organization may run 20 new generations per UTC day; cache hits do not + * count toward the limit. A client abort still finishes on the server and is cached. + * + */ + 'generateDesignDocument'( + parameters?: Parameters | null, + data?: Paths.GenerateDesignDocument.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse /** * getFiles - getFiles * @@ -2275,10 +2850,10 @@ export interface PathsDictionary { /** * updateDesign - updateDesign * - * Update a especific design owned by user organization + * Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`, `custom_theme` and `use_custom_theme` untouched. A body without `version` on a v1 design is treated as an old client's read-modify-write: those four fields are stored as sent, and brand-wide changes in `style` are applied to the v1 groups. */ 'put'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: Paths.UpdateDesign.RequestBody, config?: AxiosRequestConfig ): OperationResponse @@ -2299,7 +2874,7 @@ export interface PathsDictionary { /** * getThemeFromDesign - getThemeFromDesign * - * Search for a especific design owned by user organization and parse them to a new or old theme + * Search for a especific design owned by user organization and parse them to a new or old theme. Deprecated: kept for old readers only. For a v1 design the response carries the v1 groups and the derived `journey` group next to the stored old fields and the theme built from them; new runtimes read the v1 groups. */ 'get'( parameters?: Parameters | null, @@ -2307,6 +2882,39 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v1/designs/generate']: { + /** + * generateDesign - generateDesign + * + * Generates a design (palette, text colours, font, logo and border radius) from a public + * website with AI. The result is cached per organization and URL for 30 days. + * + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.GenerateDesign.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v1/designs/document/generate']: { + /** + * generateDesignDocument - generateDesignDocument + * + * Reads a public website and returns a v1 design document plus one finding for each + * id in fixed order. This version chooses the favicon in code and derives the site name. + * The other findings are `not_found` until they are implemented. The document contains + * only the leaves that passed validation, and defaults are not pruned. + * Successful responses are cached per organization, normalised URL and generator version + * for 7 days. Each organization may run 20 new generations per UTC day; cache hits do not + * count toward the limit. A client abort still finishes on the server and is cached. + * + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.GenerateDesignDocument.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } ['/v1/designs/files']: { /** * uploadFile - uploadFile @@ -2402,13 +3010,23 @@ export type BrandItem = Components.Schemas.BrandItem; export type ConsumerData = Components.Schemas.ConsumerData; export type Custom_Style = Components.Schemas.CustomStyle; export type CustomerPortalData = Components.Schemas.CustomerPortalData; +export type Design_Document_V1 = Components.Schemas.DesignDocumentV1; +export type DesignFinding = Components.Schemas.DesignFinding; export type DesignId = Components.Schemas.DesignId; export type DesignItem = Components.Schemas.DesignItem; export type DesignParameters = Components.Schemas.DesignParameters; export type ErrorResp = Components.Schemas.ErrorResp; export type FileData = Components.Schemas.FileData; +export type FindingDetail = Components.Schemas.FindingDetail; +export type FindingId = Components.Schemas.FindingId; +export type FindingStatus = Components.Schemas.FindingStatus; export type FontData = Components.Schemas.FontData; export type FontResponseUrl = Components.Schemas.FontResponseUrl; +export type GenerateDesignDocumentReq = Components.Schemas.GenerateDesignDocumentReq; +export type GenerateDesignDocumentRes = Components.Schemas.GenerateDesignDocumentRes; +export type GenerateDesignReq = Components.Schemas.GenerateDesignReq; +export type GenerateDesignRes = Components.Schemas.GenerateDesignRes; +export type GeneratedDesign = Components.Schemas.GeneratedDesign; export type GetAllDesignsRes = Components.Schemas.GetAllDesignsRes; export type GetBrandsRes = Components.Schemas.GetBrandsRes; export type GetDesignRes = Components.Schemas.GetDesignRes; @@ -2422,6 +3040,7 @@ export type RemoveConsumerReq = Components.Schemas.RemoveConsumerReq; export type ShapeData = Components.Schemas.ShapeData; export type Theme = Components.Schemas.Theme; export type TypographyData = Components.Schemas.TypographyData; +export type UpdateDesignConflict = Components.Schemas.UpdateDesignConflict; export type UpdateDesignReq = Components.Schemas.UpdateDesignReq; export type UploadFileReq = Components.Schemas.UploadFileReq; export type UploadFileRes = Components.Schemas.UploadFileRes; From b5534072d0ed9a29bd72de39383dba32bd895da7 Mon Sep 17 00:00:00 2001 From: Jakub Claude Date: Wed, 11 Nov 2026 08:50:42 +0000 Subject: [PATCH 2/3] chore(design-client): drop changeset and generated SDK/CLI files CI regenerates @epilot/sdk and the CLI definitions from the client spec on main, so the PR only needs the client files. Bump design-client to 0.6.0 for the new operations. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HtDoULXUVaHMuES6rnCxLK --- .../design-client-generate-endpoints.md | 7 - clients/design-client/package.json | 2 +- packages/cli/definitions/design.json | 669 +----------------- packages/cli/docs/design.md | 286 +++----- packages/epilot-sdk-v2/docs/design.md | 555 ++------------- .../src/definitions/design-runtime.json | 2 +- packages/epilot-sdk-v2/src/docs/design.json | 2 +- packages/epilot-sdk-v2/src/types/design.d.ts | 635 +---------------- 8 files changed, 204 insertions(+), 1954 deletions(-) delete mode 100644 .changeset/design-client-generate-endpoints.md diff --git a/.changeset/design-client-generate-endpoints.md b/.changeset/design-client-generate-endpoints.md deleted file mode 100644 index 43d879a74..000000000 --- a/.changeset/design-client-generate-endpoints.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@epilot/design-client": minor -"@epilot/sdk": patch -"@epilot/cli": patch ---- - -Refresh the Design Builder API contract and expose `generateDesign` (`POST /v1/designs/generate`) and `generateDesignDocument` (`POST /v1/designs/document/generate`). diff --git a/clients/design-client/package.json b/clients/design-client/package.json index fd3ac8749..ed2c9ba31 100644 --- a/clients/design-client/package.json +++ b/clients/design-client/package.json @@ -1,6 +1,6 @@ { "name": "@epilot/design-client", - "version": "0.5.7", + "version": "0.6.0", "description": "Client for epilot Design API", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/cli/definitions/design.json b/packages/cli/definitions/design.json index bccf35dec..2e4c25182 100644 --- a/packages/cli/definitions/design.json +++ b/packages/cli/definitions/design.json @@ -24,11 +24,6 @@ "/v1/designs": { "get": { "operationId": "getAllDesigns", - "x-epilot-permissions": [ - { - "action": "design:view" - } - ], "summary": "getAllDesigns", "description": "Scan all designs linked to a organization, based in orgId attribute from JWT auth token", "tags": [ @@ -59,11 +54,6 @@ }, "post": { "operationId": "addDesign", - "x-epilot-permissions": [ - { - "action": "design:create" - } - ], "summary": "addDesign", "description": "Create a brand new design linked to a organization, based in orgId attribute from JWT auth token", "tags": [ @@ -127,11 +117,6 @@ "/v1/designs/{designId}": { "get": { "operationId": "getDesign", - "x-epilot-permissions": [ - { - "action": "design:view" - } - ], "summary": "getDesign", "description": "Search for a especific design owned by user organization", "tags": [ @@ -195,11 +180,6 @@ }, "delete": { "operationId": "deleteDesign", - "x-epilot-permissions": [ - { - "action": "design:delete" - } - ], "summary": "deleteDesign", "description": "Search and delete for a especific design owned by user organization", "tags": [ @@ -242,16 +222,6 @@ "404": { "description": "No design found" }, - "409": { - "description": "The design cannot be deleted: it is the only one of the organization, it is still\nassigned to journeys (listed in `journeys`) or portals (listed in `portals`), or the\ncaller may not view the organization's portals, so their usage cannot be checked.\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, "500": { "description": "Other errors", "content": { @@ -261,28 +231,13 @@ } } } - }, - "503": { - "description": "customer-portal-api could not be reached to check which portals use the design. Retry later.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } } } }, "put": { "operationId": "updateDesign", - "x-epilot-permissions": [ - { - "action": "design:edit" - } - ], "summary": "updateDesign", - "description": "Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`, `custom_theme` and `use_custom_theme` untouched. A body without `version` on a v1 design is treated as an old client's read-modify-write: those four fields are stored as sent, and brand-wide changes in `style` are applied to the v1 groups.", + "description": "Update a especific design owned by user organization", "tags": [ "design-builder" ], @@ -294,15 +249,6 @@ "schema": { "$ref": "#/components/schemas/DesignId" } - }, - { - "in": "header", - "name": "If-Match", - "required": false, - "description": "The `last_modified_at` of the design the client read. When it no longer matches the stored design, the update is rejected with 409. Without the header the update is unconditional.", - "schema": { - "type": "string" - } } ], "requestBody": { @@ -343,16 +289,6 @@ "404": { "description": "No design found" }, - "409": { - "description": "The design was changed since the `If-Match` value was read. Returns the current design.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateDesignConflict" - } - } - } - }, "500": { "description": "Other errors", "content": { @@ -369,11 +305,6 @@ "/v1/designs/{designId}/duplicate": { "post": { "operationId": "duplicateDesign", - "x-epilot-permissions": [ - { - "action": "design:create" - } - ], "summary": "duplicateDesign", "description": "Duplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marked as a copy) but does NOT carry over journey/portal relations, so the new design starts with 0 consumers, exactly like a freshly created design.", "tags": [ @@ -440,8 +371,7 @@ "get": { "operationId": "getThemeFromDesign", "summary": "getThemeFromDesign", - "deprecated": true, - "description": "Search for a especific design owned by user organization and parse them to a new or old theme. Deprecated: kept for old readers only. For a v1 design the response carries the v1 groups and the derived `journey` group next to the stored old fields and the theme built from them; new runtimes read the v1 groups.", + "description": "Search for a especific design owned by user organization and parse them to a new or old theme", "security": [], "tags": [ "design-builder" @@ -520,245 +450,9 @@ } } }, - "/v1/designs/generate": { - "post": { - "operationId": "generateDesign", - "x-epilot-permissions": [ - { - "anyOf": [ - { - "action": "design:create" - }, - { - "action": "design:edit" - } - ] - } - ], - "summary": "generateDesign", - "description": "Generates a design (palette, text colours, font, logo and border radius) from a public\nwebsite with AI. The result is cached per organization and URL for 30 days.\n", - "tags": [ - "design-builder" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignReq" - } - } - } - }, - "responses": { - "200": { - "description": "A design generated earlier for this organization and URL", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignRes" - } - } - } - }, - "201": { - "description": "A newly generated design", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignRes" - } - } - } - }, - "400": { - "description": "The URL is not a valid http(s) URL (`invalid_url`) or points to a private network (`blocked_url`)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "401": { - "description": "Authentication Errors", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "403": { - "description": "The caller may not edit designs", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "422": { - "description": "The website could not be fetched (`fetch_failed`)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "502": { - "description": "The design could not be generated (`generation_failed`)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "504": { - "description": "The generation did not finish in time", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - } - } - } - }, - "/v1/designs/document/generate": { - "post": { - "operationId": "generateDesignDocument", - "x-epilot-permissions": [ - { - "action": "design:create" - } - ], - "summary": "generateDesignDocument", - "description": "Reads a public website and returns a v1 design document plus one finding for each\nid in fixed order. This version chooses the favicon in code and derives the site name.\nThe other findings are `not_found` until they are implemented. The document contains\nonly the leaves that passed validation, and defaults are not pruned.\nSuccessful responses are cached per organization, normalised URL and generator version\nfor 7 days. Each organization may run 20 new generations per UTC day; cache hits do not\ncount toward the limit. A client abort still finishes on the server and is cached.\n", - "tags": [ - "design-builder" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignDocumentReq" - } - } - } - }, - "responses": { - "200": { - "description": "A design document generated earlier for this organization, URL and generator version", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignDocumentRes" - } - } - } - }, - "201": { - "description": "A newly generated design document", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignDocumentRes" - } - } - } - }, - "400": { - "description": "The URL is not a valid http(s) URL (`invalid_url`) or points to a private network (`blocked_url`)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "401": { - "description": "Authentication Errors", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "403": { - "description": "The caller does not have design:create", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "422": { - "description": "The website could not be fetched (`fetch_failed`)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "429": { - "description": "The organization has used today's generation limit (`rate_limited`)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "502": { - "description": "Generation failed, or no finding survived (`generation_failed`)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - }, - "504": { - "description": "The 27 second budget ran out (`timeout`)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - } - } - } - }, "/v1/designs/files": { "post": { "operationId": "uploadFile", - "x-epilot-permissions": [ - { - "access": "org" - } - ], "summary": "uploadFile", "description": "Upload a new file for the user organization bucket", "tags": [ @@ -825,11 +519,6 @@ }, "get": { "operationId": "getFiles", - "x-epilot-permissions": [ - { - "access": "org" - } - ], "summary": "getFiles", "description": "List all files for the user organization bucket", "tags": [ @@ -900,11 +589,6 @@ "get": { "deprecated": true, "operationId": "getLimit", - "x-epilot-permissions": [ - { - "access": "org" - } - ], "summary": "getLimit", "description": "Gets designs number limit from database per organization", "tags": [ @@ -938,11 +622,6 @@ "get": { "deprecated": true, "operationId": "getBrands", - "x-epilot-permissions": [ - { - "access": "org" - } - ], "summary": "getBrands", "description": "Scan all brands linked to a organization, based in orgId attribute from JWT auth token", "tags": [ @@ -978,11 +657,6 @@ "/v1/designs/consumer/{application}/{consumerId}": { "get": { "operationId": "getConsumerDesign", - "x-epilot-permissions": [ - { - "access": "org" - } - ], "summary": "getConsumerDesign", "description": "Search for a especific design owned by user organization", "tags": [ @@ -1056,30 +730,6 @@ "/v1/designs/addConsumer/{application}/{designId}": { "put": { "operationId": "addConsumer", - "deprecated": true, - "x-epilot-permissions": [ - { - "anyOf": [ - { - "action": "entity:edit", - "resource": "journey" - }, - { - "action": "customer_portal:edit" - }, - { - "action": "installer_portal:edit" - }, - { - "action": "portal:content:edit", - "resource": "{consumer_id}" - }, - { - "action": "design:edit" - } - ] - } - ], "summary": "addConsumer", "description": "Add a consumer that uses a specific design", "tags": [ @@ -1159,30 +809,6 @@ "/v1/designs/removeConsumer/{application}/{designId}": { "put": { "operationId": "removeConsumer", - "deprecated": true, - "x-epilot-permissions": [ - { - "anyOf": [ - { - "action": "entity:edit", - "resource": "journey" - }, - { - "action": "customer_portal:edit" - }, - { - "action": "installer_portal:edit" - }, - { - "action": "portal:content:edit", - "resource": "{consumer_id}" - }, - { - "action": "design:edit" - } - ] - } - ], "summary": "removeConsumer", "description": "Remove a consumer that uses a specific design", "tags": [ @@ -1333,9 +959,6 @@ }, { "$ref": "#/components/schemas/Journey" - }, - { - "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1370,9 +993,6 @@ }, { "$ref": "#/components/schemas/Journey" - }, - { - "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1397,9 +1017,6 @@ }, { "$ref": "#/components/schemas/Journey" - }, - { - "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1421,9 +1038,6 @@ }, { "$ref": "#/components/schemas/Journey" - }, - { - "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1442,9 +1056,6 @@ }, { "$ref": "#/components/schemas/Journey" - }, - { - "$ref": "#/components/schemas/Design_Document_V1" } ] } @@ -1483,6 +1094,9 @@ }, "consumer_name": { "type": "string" + }, + "should_delete": { + "type": "string" } }, "required": [ @@ -1495,6 +1109,10 @@ "properties": { "consumer_id": { "$ref": "#/components/schemas/DesignId" + }, + "should_delete": { + "type": "string", + "deprecated": true } }, "required": [ @@ -1614,68 +1232,6 @@ "name" ] }, - "Design_Document_V1": { - "type": "object", - "description": "Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet.", - "properties": { - "version": { - "type": "integer", - "enum": [ - 1 - ] - }, - "colors": { - "type": "object", - "additionalProperties": {} - }, - "typography": { - "type": "object", - "additionalProperties": {} - }, - "shape": { - "type": "object", - "additionalProperties": {} - }, - "components": { - "type": "object", - "additionalProperties": {} - }, - "assets": { - "type": "object", - "additionalProperties": {} - }, - "consumer": { - "$ref": "#/components/schemas/ConsumerData" - } - } - }, - "UpdateDesignConflict": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "design": { - "allOf": [ - { - "$ref": "#/components/schemas/ItemMetada" - }, - { - "$ref": "#/components/schemas/DesignItem" - }, - { - "$ref": "#/components/schemas/Custom_Style" - }, - { - "$ref": "#/components/schemas/Journey" - }, - { - "$ref": "#/components/schemas/Design_Document_V1" - } - ] - } - } - }, "Custom_Style": { "type": "object", "properties": { @@ -2140,188 +1696,12 @@ "name" ] }, - "GenerateDesignReq": { - "type": "object", - "properties": { - "url": { - "type": "string", - "format": "uri", - "description": "Public website to derive the design from", - "example": "https://www.twl.de" - } - }, - "required": [ - "url" - ] - }, - "GenerateDesignRes": { - "type": "object", - "properties": { - "design": { - "$ref": "#/components/schemas/GeneratedDesign" - }, - "cached": { - "type": "boolean", - "description": "True when the design was generated earlier for this organization and URL" - } - }, - "required": [ - "design", - "cached" - ] - }, - "GenerateDesignDocumentReq": { - "type": "object", - "properties": { - "url": { - "type": "string", - "format": "uri", - "description": "Public website to read the design from", - "example": "https://www.stadtwerke-musterstadt.de" - } - }, - "required": [ - "url" - ] - }, - "FindingId": { - "type": "string", - "enum": [ - "primary_color", - "fonts", - "corners", - "primary_button", - "logo", - "favicon" - ] - }, - "FindingStatus": { - "type": "string", - "enum": [ - "found", - "not_found", - "not_available" - ] - }, - "FindingDetail": { - "type": "object", - "properties": { - "family": { - "type": "string", - "description": "Font family that was found but cannot be loaded" - } - }, - "required": [ - "family" - ] - }, - "DesignFinding": { - "type": "object", - "properties": { - "id": { - "$ref": "#/components/schemas/FindingId" - }, - "status": { - "$ref": "#/components/schemas/FindingStatus" - }, - "detail": { - "$ref": "#/components/schemas/FindingDetail" - } - }, - "required": [ - "id", - "status" - ] - }, - "GenerateDesignDocumentRes": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Design_Document_V1" - }, - "findings": { - "type": "array", - "minItems": 6, - "maxItems": 6, - "items": { - "$ref": "#/components/schemas/DesignFinding" - } - }, - "site_name": { - "type": "string", - "example": "Stadtwerke Musterstadt" - }, - "cached": { - "type": "boolean", - "description": "True when the response was served from an earlier successful generation for this organization, normalised URL and generator version" - } - }, - "required": [ - "document", - "findings", - "site_name", - "cached" - ] - }, - "GeneratedDesign": { - "type": "object", - "description": "Partial design to merge into the design being edited", - "properties": { - "style": { - "type": "object", - "properties": { - "logo": { - "$ref": "#/components/schemas/LogoData" - }, - "palette": { - "$ref": "#/components/schemas/PaletteData" - }, - "typography": { - "$ref": "#/components/schemas/TypographyData" - } - }, - "required": [ - "logo", - "palette", - "typography" - ] - }, - "theme": { - "type": "object", - "properties": { - "shape": { - "type": "object", - "properties": { - "borderRadius": { - "type": "string", - "example": "8" - } - }, - "required": [ - "borderRadius" - ] - } - }, - "required": [ - "shape" - ] - } - }, - "required": [ - "style", - "theme" - ] - }, "ErrorResp": { "type": "object", "properties": { "message": { "type": "string" }, - "code": { - "type": "string", - "description": "Machine-readable reason, e.g. `invalid_url` or `rate_limited`" - }, "error": { "type": "object" } @@ -2437,37 +1817,6 @@ "journey_design_tokens": { "type": "object", "description": "Design tokens for journey customization (renamed from design_tokens)" - }, - "version": { - "type": "integer", - "enum": [ - 1 - ] - }, - "colors": { - "type": "object", - "additionalProperties": {} - }, - "typography": { - "type": "object", - "additionalProperties": {} - }, - "shape": { - "type": "object", - "additionalProperties": {} - }, - "components": { - "type": "object", - "additionalProperties": {} - }, - "assets": { - "type": "object", - "additionalProperties": {} - }, - "journey": { - "type": "object", - "additionalProperties": {}, - "description": "v1 designs only: the journey group of @epilot/design-document (custom_css, tokens and the journey overrides primary_color, font, border_radius, logo), derived on read from the stored journey fields and compared with the stored v1 groups. What a journey paints from it equals what it paints from the theme built from the old fields. Not returned by GET." } } } diff --git a/packages/cli/docs/design.md b/packages/cli/docs/design.md index bdd90249b..3fb7c85bf 100644 --- a/packages/cli/docs/design.md +++ b/packages/cli/docs/design.md @@ -37,14 +37,15 @@ epilot design getAllDesigns - [`getAllDesigns`](#getalldesigns) — Scan all designs linked to a organization, based in orgId attribute from JWT auth token - [`addDesign`](#adddesign) — Create a brand new design linked to a organization, based in orgId attribute from JWT auth token - [`getDesign`](#getdesign) — Search for a especific design owned by user organization -- [`updateDesign`](#updatedesign) — Update a especific design owned by user organization. A body with `version: 1` is validated against the design document +- [`updateDesign`](#updatedesign) — Update a especific design owned by user organization - [`deleteDesign`](#deletedesign) — Search and delete for a especific design owned by user organization - [`duplicateDesign`](#duplicatedesign) — Duplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marke -- [`generateDesign`](#generatedesign) — Generates a design (palette, text colours, font, logo and border radius) from a public -- [`generateDesignDocument`](#generatedesigndocument) — Reads a public website and returns a v1 design document plus one finding for each +- [`getThemeFromDesign`](#getthemefromdesign) — Search for a especific design owned by user organization and parse them to a new or old theme - [`getFiles`](#getfiles) — List all files for the user organization bucket - [`uploadFile`](#uploadfile) — Upload a new file for the user organization bucket - [`getConsumerDesign`](#getconsumerdesign) — Search for a especific design owned by user organization +- [`addConsumer`](#addconsumer) — Add a consumer that uses a specific design +- [`removeConsumer`](#removeconsumer) — Remove a consumer that uses a specific design ### `getAllDesigns` @@ -85,14 +86,7 @@ epilot design getAllDesigns --jsonata 'designs' "_manifest": ["string"], "custom_theme": "string", "use_custom_theme": true, - "design_tokens": {}, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": {} + "design_tokens": {} } ] } @@ -203,16 +197,6 @@ epilot design addDesign \ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } }' @@ -322,16 +306,6 @@ epilot design addDesign --jsonata 'design' "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } } @@ -464,16 +438,6 @@ epilot design getDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a --jsona "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } } @@ -485,7 +449,7 @@ epilot design getDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a --jsona ### `updateDesign` -Update a especific design owned by user organization. A body with `version: 1` is validated against the design document +Update a especific design owned by user organization `PUT /v1/designs/{designId}` @@ -494,7 +458,6 @@ Update a especific design owned by user organization. A body with `version: 1` i | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | | `designId` | path | string | Yes | | -| `If-Match` | header | string | No | The `last_modified_at` of the design the client read. When it no longer matches the stored design, the update is rejected with 409. Without the header the update is unconditional. | **Request Body** (required) @@ -593,16 +556,6 @@ epilot design updateDesign \ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } }' @@ -784,16 +737,6 @@ epilot design duplicateDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a - "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } } @@ -803,31 +746,38 @@ epilot design duplicateDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a - --- -### `generateDesign` +### `getThemeFromDesign` -Generates a design (palette, text colours, font, logo and border radius) from a public +Search for a especific design owned by user organization and parse them to a new or old theme -`POST /v1/designs/generate` +`GET /v1/designs/{designId}/parse` -**Request Body** (required) +**Parameters** + +| Name | In | Type | Required | Description | +| ---- | -- | ---- | -------- | ----------- | +| `designId` | path | string | Yes | | +| `orgId` | query | string | No | Organization id of the user | +| `theme` | query | "NEW" \| "OLD" | Yes | | **Sample Call** ```bash -epilot design generateDesign \ - -d '{"url":"https://www.twl.de"}' +epilot design getThemeFromDesign \ + -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a \ + -p theme=NEW ``` -Using stdin pipe: +Using positional args for path parameters: ```bash -cat body.json | epilot design generateDesign +epilot design getThemeFromDesign 4a062990-a6a3-11eb-9828-4f3da7d4935a ``` With JSONata filter: ```bash -epilot design generateDesign --jsonata 'design' +epilot design getThemeFromDesign -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p theme=NEW --jsonata 'theme' ```
@@ -835,7 +785,11 @@ epilot design generateDesign --jsonata 'design' ```json { + "theme": "NEW", "design": { + "id": "string", + "last_modified_at": "string", + "style_name": "string", "style": { "logo": { "main": { @@ -875,92 +829,10 @@ epilot design generateDesign --jsonata 'design' "secondary": "string" } }, - "theme": { - "shape": { - "borderRadius": "8" - } - } - }, - "cached": true -} -``` - -
- ---- - -### `generateDesignDocument` - -Reads a public website and returns a v1 design document plus one finding for each - -`POST /v1/designs/document/generate` - -**Request Body** (required) - -**Sample Call** - -```bash -epilot design generateDesignDocument \ - -d '{"url":"https://www.stadtwerke-musterstadt.de"}' -``` - -Using stdin pipe: - -```bash -cat body.json | epilot design generateDesignDocument -``` - -With JSONata filter: - -```bash -epilot design generateDesignDocument --jsonata 'document' -``` - -
-Sample Response - -```json -{ - "document": { - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [ - { - "id": "string", - "name": "string" - } - ], - "customer_portals": [ - { - "id": "string", - "name": "string" - } - ] - } - }, - "findings": [ - { - "id": "primary_color", - "status": "found", - "detail": { - "family": "string" - } - }, - { - "id": "primary_color", - "status": "found", - "detail": { - "family": "string" - } - } - ], - "site_name": "Stadtwerke Musterstadt", - "cached": true + "custom_theme": "string", + "use_custom_theme": true, + "journey_design_tokens": {} + } } ``` @@ -1173,16 +1045,6 @@ epilot design getConsumerDesign -p consumerId=4a062990-a6a3-11eb-9828-4f3da7d493 "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } } @@ -1191,3 +1053,91 @@ epilot design getConsumerDesign -p consumerId=4a062990-a6a3-11eb-9828-4f3da7d493
--- + +### `addConsumer` + +Add a consumer that uses a specific design + +`PUT /v1/designs/addConsumer/{application}/{designId}` + +**Parameters** + +| Name | In | Type | Required | Description | +| ---- | -- | ---- | -------- | ----------- | +| `designId` | path | string | Yes | | +| `application` | path | string | Yes | Type of application that uses the design | + +**Request Body** (required) + +**Sample Call** + +```bash +epilot design addConsumer \ + -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a \ + -p application=journey \ + -d '{"consumer_id":"4a062990-a6a3-11eb-9828-4f3da7d4935a","consumer_name":"string","should_delete":"string"}' +``` + +Using positional args for path parameters: + +```bash +epilot design addConsumer 4a062990-a6a3-11eb-9828-4f3da7d4935a journey +``` + +Using stdin pipe: + +```bash +cat body.json | epilot design addConsumer -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p application=journey +``` + +With JSONata filter: + +```bash +epilot design addConsumer -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p application=journey --jsonata '$' +``` + +--- + +### `removeConsumer` + +Remove a consumer that uses a specific design + +`PUT /v1/designs/removeConsumer/{application}/{designId}` + +**Parameters** + +| Name | In | Type | Required | Description | +| ---- | -- | ---- | -------- | ----------- | +| `designId` | path | string | Yes | | +| `application` | path | string | Yes | Type of application that uses the design | + +**Request Body** (required) + +**Sample Call** + +```bash +epilot design removeConsumer \ + -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a \ + -p application=journey \ + -d '{"consumer_id":"4a062990-a6a3-11eb-9828-4f3da7d4935a","should_delete":"string"}' +``` + +Using positional args for path parameters: + +```bash +epilot design removeConsumer 4a062990-a6a3-11eb-9828-4f3da7d4935a journey +``` + +Using stdin pipe: + +```bash +cat body.json | epilot design removeConsumer -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p application=journey +``` + +With JSONata filter: + +```bash +epilot design removeConsumer -p designId=4a062990-a6a3-11eb-9828-4f3da7d4935a -p application=journey --jsonata '$' +``` + +--- diff --git a/packages/epilot-sdk-v2/docs/design.md b/packages/epilot-sdk-v2/docs/design.md index 028d60e8b..77277bd10 100644 --- a/packages/epilot-sdk-v2/docs/design.md +++ b/packages/epilot-sdk-v2/docs/design.md @@ -31,11 +31,12 @@ const { data } = await designClient.getAllDesigns(...) - [`deleteDesign`](#deletedesign) - [`updateDesign`](#updatedesign) - [`duplicateDesign`](#duplicatedesign) -- [`generateDesign`](#generatedesign) -- [`generateDesignDocument`](#generatedesigndocument) +- [`getThemeFromDesign`](#getthemefromdesign) - [`uploadFile`](#uploadfile) - [`getFiles`](#getfiles) - [`getConsumerDesign`](#getconsumerdesign) +- [`addConsumer`](#addconsumer) +- [`removeConsumer`](#removeconsumer) **Schemas** - [`UploadFileReq`](#uploadfilereq) @@ -52,8 +53,6 @@ const { data } = await designClient.getAllDesigns(...) - [`RemoveConsumerReq`](#removeconsumerreq) - [`DesignItem`](#designitem) - [`BrandItem`](#branditem) -- [`Design_Document_V1`](#design_document_v1) -- [`UpdateDesignConflict`](#updatedesignconflict) - [`Custom_Style`](#custom_style) - [`Journey`](#journey) - [`ConsumerData`](#consumerdata) @@ -66,15 +65,6 @@ const { data } = await designClient.getAllDesigns(...) - [`FontData`](#fontdata) - [`FontResponseUrl`](#fontresponseurl) - [`WidgetPortalData`](#widgetportaldata) -- [`GenerateDesignReq`](#generatedesignreq) -- [`GenerateDesignRes`](#generatedesignres) -- [`GenerateDesignDocumentReq`](#generatedesigndocumentreq) -- [`FindingId`](#findingid) -- [`FindingStatus`](#findingstatus) -- [`FindingDetail`](#findingdetail) -- [`DesignFinding`](#designfinding) -- [`GenerateDesignDocumentRes`](#generatedesigndocumentres) -- [`GeneratedDesign`](#generateddesign) - [`ErrorResp`](#errorresp) - [`FileData`](#filedata) - [`DesignId`](#designid) @@ -114,14 +104,7 @@ const { data } = await client.getAllDesigns() "_manifest": ["string"], "custom_theme": "string", "use_custom_theme": true, - "design_tokens": {}, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": {} + "design_tokens": {} } ] } @@ -223,16 +206,6 @@ const { data } = await client.addDesign( chip_hover_background: 'string', chip_text_color: 'string', chip_hover_text_color: 'string' - }, - version: 1, - colors: {}, - typography: {}, - shape: {}, - components: {}, - assets: {}, - consumer: { - widgets: [ /* ... */ ], - customer_portals: [ /* ... */ ] } } }, @@ -331,16 +304,6 @@ const { data } = await client.addDesign( "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } } @@ -454,16 +417,6 @@ const { data } = await client.getDesign({ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } } @@ -489,7 +442,7 @@ const { data } = await client.deleteDesign({ ### `updateDesign` -Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens` +Update a especific design owned by user organization `PUT /v1/designs/{designId}` @@ -497,7 +450,6 @@ Update a especific design owned by user organization. A body with `version: 1` i const { data } = await client.updateDesign( { designId: 'example', - If-Match: 'example', }, { design: { @@ -582,16 +534,6 @@ const { data } = await client.updateDesign( chip_hover_background: 'string', chip_text_color: 'string', chip_hover_text_color: 'string' - }, - version: 1, - colors: {}, - typography: {}, - shape: {}, - components: {}, - assets: {}, - consumer: { - widgets: [ /* ... */ ], - customer_portals: [ /* ... */ ] } } }, @@ -704,16 +646,6 @@ const { data } = await client.duplicateDesign({ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } } @@ -723,20 +655,18 @@ const { data } = await client.duplicateDesign({ --- -### `generateDesign` +### `getThemeFromDesign` -Generates a design (palette, text colours, font, logo and border radius) from a public -website with AI. The result is cached per organization and URL for 30 days. +Search for a especific design owned by user organization and parse them to a new or old theme -`POST /v1/designs/generate` +`GET /v1/designs/{designId}/parse` ```ts -const { data } = await client.generateDesign( - null, - { - url: 'https://www.twl.de' - }, -) +const { data } = await client.getThemeFromDesign({ + designId: 'example', + orgId: 'example', + theme: 'example', +}) ```
@@ -744,7 +674,11 @@ const { data } = await client.generateDesign( ```json { + "theme": "NEW", "design": { + "id": "string", + "last_modified_at": "string", + "style_name": "string", "style": { "logo": { "main": { @@ -784,82 +718,10 @@ const { data } = await client.generateDesign( "secondary": "string" } }, - "theme": { - "shape": { - "borderRadius": "8" - } - } - }, - "cached": true -} -``` - -
- ---- - -### `generateDesignDocument` - -Reads a public website and returns a v1 design document plus one finding for each -id in fixed order. This version chooses the favicon in code and derives the site name. -The other findings are `not_fou - -`POST /v1/designs/document/generate` - -```ts -const { data } = await client.generateDesignDocument( - null, - { - url: 'https://www.stadtwerke-musterstadt.de' - }, -) -``` - -
-Response - -```json -{ - "document": { - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [ - { - "id": "string", - "name": "string" - } - ], - "customer_portals": [ - { - "id": "string", - "name": "string" - } - ] - } - }, - "findings": [ - { - "id": "primary_color", - "status": "found", - "detail": { - "family": "string" - } - }, - { - "id": "primary_color", - "status": "found", - "detail": { - "family": "string" - } - } - ], - "site_name": "Stadtwerke Musterstadt", - "cached": true + "custom_theme": "string", + "use_custom_theme": true, + "journey_design_tokens": {} + } } ``` @@ -1032,16 +894,6 @@ const { data } = await client.getConsumerDesign({ "chip_hover_background": "string", "chip_text_color": "string", "chip_hover_text_color": "string" - }, - "version": 1, - "colors": {}, - "typography": {}, - "shape": {}, - "components": {}, - "assets": {}, - "consumer": { - "widgets": [], - "customer_portals": [] } } } @@ -1051,6 +903,49 @@ const { data } = await client.getConsumerDesign({ --- +### `addConsumer` + +Add a consumer that uses a specific design + +`PUT /v1/designs/addConsumer/{application}/{designId}` + +```ts +const { data } = await client.addConsumer( + { + designId: 'example', + application: 'example', + }, + { + consumer_id: '4a062990-a6a3-11eb-9828-4f3da7d4935a', + consumer_name: 'string', + should_delete: 'string' + }, +) +``` + +--- + +### `removeConsumer` + +Remove a consumer that uses a specific design + +`PUT /v1/designs/removeConsumer/{application}/{designId}` + +```ts +const { data } = await client.removeConsumer( + { + designId: 'example', + application: 'example', + }, + { + consumer_id: '4a062990-a6a3-11eb-9828-4f3da7d4935a', + should_delete: 'string' + }, +) +``` + +--- + ## Schemas ### `UploadFileReq` @@ -1182,18 +1077,7 @@ type GetAllDesignsRes = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } - version?: 1 - colors?: Record - typography?: Record - shape?: Record - components?: Record - assets?: Record - consumer?: { - widgets: { ... } - customer_portals: { ... } - } }> - // ... } ``` @@ -1302,16 +1186,6 @@ type AddDesignReq = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } - version?: 1 - colors?: Record - typography?: Record - shape?: Record - components?: Record - assets?: Record - consumer?: { - widgets: { ... } - customer_portals: { ... } - } } } ``` @@ -1408,18 +1282,7 @@ type AddDesignRes = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } - version?: 1 - colors?: Record - typography?: Record - shape?: Record - components?: Record - assets?: Record - consumer?: { - widgets: { ... } - customer_portals: { ... } - } } - // ... } ``` @@ -1515,18 +1378,7 @@ type GetDesignRes = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } - version?: 1 - colors?: Record - typography?: Record - shape?: Record - components?: Record - assets?: Record - consumer?: { - widgets: { ... } - customer_portals: { ... } - } } - // ... } ``` @@ -1617,16 +1469,6 @@ type UpdateDesignReq = { chip_text_color?: { ... } chip_hover_text_color?: { ... } } - version?: 1 - colors?: Record - typography?: Record - shape?: Record - components?: Record - assets?: Record - consumer?: { - widgets: { ... } - customer_portals: { ... } - } } } ``` @@ -1649,6 +1491,7 @@ type ItemMetada = { type AddConsumerReq = { consumer_id: string consumer_name: string + should_delete?: string } ``` @@ -1657,6 +1500,7 @@ type AddConsumerReq = { ```ts type RemoveConsumerReq = { consumer_id: string + should_delete?: string } ``` @@ -1720,138 +1564,6 @@ type BrandItem = { } ``` -### `Design_Document_V1` - -Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and - -```ts -type Design_Document_V1 = { - version?: 1 - colors?: Record - typography?: Record - shape?: Record - components?: Record - assets?: Record - consumer?: { - widgets: Array<{ - id: { ... } - name: { ... } - }> - customer_portals: Array<{ - id: { ... } - name: { ... } - }> - } -} -``` - -### `UpdateDesignConflict` - -```ts -type UpdateDesignConflict = { - message?: string - design?: { - id?: string - created_at?: string - created_by?: string - edited: boolean - last_modified_at?: string - brand_id?: string - brand_name?: string - user?: { - emailaddress?: { ... } - fullname?: { ... } - name?: { ... } - userid?: { ... } - } - style_name: string - style: { - logo?: { ... } - palette: { ... } - typography: { ... } - shape?: { ... } - consumer: { ... } - } - is_default?: boolean - _manifest?: string[] - custom_theme?: string - use_custom_theme?: boolean - design_tokens?: { - coupon?: { ... } - cashback?: { ... } - custom_css?: { ... } - accent_color?: { ... } - outline_color?: { ... } - divider_color?: { ... } - link_color?: { ... } - link_hover_color?: { ... } - font_size_scale?: { ... } - topbar_height?: { ... } - topbar_logo_alignment?: { ... } - logo_size?: { ... } - input_background?: { ... } - input_border_color?: { ... } - input_text_color?: { ... } - input_label_color?: { ... } - input_border_radius?: { ... } - input_height?: { ... } - input_variant?: { ... } - button_primary_bg?: { ... } - button_primary_text?: { ... } - button_primary_hover_bg?: { ... } - button_primary_hover_text?: { ... } - button_outlined_border?: { ... } - button_outlined_text?: { ... } - button_outlined_hover_bg?: { ... } - button_outlined_hover_text?: { ... } - button_ghost_bg?: { ... } - button_ghost_text?: { ... } - button_ghost_hover_bg?: { ... } - button_ghost_hover_text?: { ... } - button_border_radius?: { ... } - button_height?: { ... } - card_background?: { ... } - card_border_color?: { ... } - card_variant?: { ... } - summary_card_background?: { ... } - toggle_selected_bg?: { ... } - toggle_selected_text?: { ... } - toggle_hover_bg?: { ... } - toggle_hover_text?: { ... } - toggle_border_color?: { ... } - dropdown_hover_bg?: { ... } - dropdown_hover_text?: { ... } - dropdown_selected_bg?: { ... } - dropdown_selected_text?: { ... } - switch_unchecked_color?: { ... } - switch_unchecked_bg?: { ... } - switch_border_radius?: { ... } - checkbox_unchecked_color?: { ... } - checkbox_label_color?: { ... } - radio_unchecked_color?: { ... } - radio_label_color?: { ... } - datepicker_selected_bg?: { ... } - datepicker_selected_color?: { ... } - datepicker_border_radius?: { ... } - chip_background?: { ... } - chip_hover_background?: { ... } - chip_text_color?: { ... } - chip_hover_text_color?: { ... } - } - version?: 1 - colors?: Record - typography?: Record - shape?: Record - components?: Record - assets?: Record - consumer?: { - widgets: { ... } - customer_portals: { ... } - } - // ... -} -``` - ### `Custom_Style` ```ts @@ -2056,139 +1768,11 @@ type WidgetPortalData = { } ``` -### `GenerateDesignReq` - -```ts -type GenerateDesignReq = { - url: string // uri -} -``` - -### `GenerateDesignRes` - -```ts -type GenerateDesignRes = { - design: { - style: { - logo: { ... } - palette: { ... } - typography: { ... } - } - theme: { - shape: { ... } - } - } - cached: boolean -} -``` - -### `GenerateDesignDocumentReq` - -```ts -type GenerateDesignDocumentReq = { - url: string // uri -} -``` - -### `FindingId` - -```ts -type FindingId = "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon" -``` - -### `FindingStatus` - -```ts -type FindingStatus = "found" | "not_found" | "not_available" -``` - -### `FindingDetail` - -```ts -type FindingDetail = { - family: string -} -``` - -### `DesignFinding` - -```ts -type DesignFinding = { - id: "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon" - status: "found" | "not_found" | "not_available" - detail?: { - family: string - } -} -``` - -### `GenerateDesignDocumentRes` - -```ts -type GenerateDesignDocumentRes = { - document: { - version?: 1 - colors?: Record - typography?: Record - shape?: Record - components?: Record - assets?: Record - consumer?: { - widgets: { ... } - customer_portals: { ... } - } - } - findings: Array<{ - id: "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon" - status: "found" | "not_found" | "not_available" - detail?: { - family: { ... } - } - }> - site_name: string - cached: boolean -} -``` - -### `GeneratedDesign` - -Partial design to merge into the design being edited - -```ts -type GeneratedDesign = { - style: { - logo: { - main?: { ... } - } - palette: { - primary: { ... } - secondary: { ... } - error: { ... } - background: { ... } - paper: { ... } - navbar: { ... } - portal_login_background?: { ... } - } - typography: { - font: { ... } - primary: { ... } - secondary: { ... } - } - } - theme: { - shape: { - borderRadius: { ... } - } - } -} -``` - ### `ErrorResp` ```ts type ErrorResp = { message?: string - code?: string error?: object } ``` @@ -2257,13 +1841,6 @@ type ParseThemeFromDesignResp = { custom_theme?: string use_custom_theme?: boolean journey_design_tokens?: object - version?: 1 - colors?: Record - typography?: Record - shape?: Record - components?: Record - assets?: Record - journey?: Record } } ``` diff --git a/packages/epilot-sdk-v2/src/definitions/design-runtime.json b/packages/epilot-sdk-v2/src/definitions/design-runtime.json index 71551c999..460c8e53f 100644 --- a/packages/epilot-sdk-v2/src/definitions/design-runtime.json +++ b/packages/epilot-sdk-v2/src/definitions/design-runtime.json @@ -1 +1 @@ -{"s":"https://design-builder-api.sls.epilot.io","o":[["getAllDesigns","get","/v1/designs"],["addDesign","post","/v1/designs",null,1],["getDesign","get","/v1/designs/{designId}",[["designId","p",true]]],["deleteDesign","delete","/v1/designs/{designId}",[["designId","p",true]]],["updateDesign","put","/v1/designs/{designId}",[["designId","p",true],["If-Match","h"]],1],["duplicateDesign","post","/v1/designs/{designId}/duplicate",[["designId","p",true]]],["getThemeFromDesign","get","/v1/designs/{designId}/parse",[["designId","p",true],["orgId","q"],["theme","q",true]]],["generateDesign","post","/v1/designs/generate",null,1],["generateDesignDocument","post","/v1/designs/document/generate",null,1],["uploadFile","post","/v1/designs/files",null,1],["getFiles","get","/v1/designs/files",[["type","q"]]],["getLimit","get","/v1/designs/limit"],["getBrands","get","/v1/brands"],["getConsumerDesign","get","/v1/designs/consumer/{application}/{consumerId}",[["consumerId","p",true],["application","p",true]]],["addConsumer","put","/v1/designs/addConsumer/{application}/{designId}",[["designId","p",true],["application","p",true]],1],["removeConsumer","put","/v1/designs/removeConsumer/{application}/{designId}",[["designId","p",true],["application","p",true]],1]],"v":"3.0.3"} \ No newline at end of file +{"s":"https://design-builder-api.sls.epilot.io","o":[["getAllDesigns","get","/v1/designs"],["addDesign","post","/v1/designs",null,1],["getDesign","get","/v1/designs/{designId}",[["designId","p",true]]],["deleteDesign","delete","/v1/designs/{designId}",[["designId","p",true]]],["updateDesign","put","/v1/designs/{designId}",[["designId","p",true]],1],["duplicateDesign","post","/v1/designs/{designId}/duplicate",[["designId","p",true]]],["getThemeFromDesign","get","/v1/designs/{designId}/parse",[["designId","p",true],["orgId","q"],["theme","q",true]]],["uploadFile","post","/v1/designs/files",null,1],["getFiles","get","/v1/designs/files",[["type","q"]]],["getLimit","get","/v1/designs/limit"],["getBrands","get","/v1/brands"],["getConsumerDesign","get","/v1/designs/consumer/{application}/{consumerId}",[["consumerId","p",true],["application","p",true]]],["addConsumer","put","/v1/designs/addConsumer/{application}/{designId}",[["designId","p",true],["application","p",true]],1],["removeConsumer","put","/v1/designs/removeConsumer/{application}/{designId}",[["designId","p",true],["application","p",true]],1]],"v":"3.0.3"} \ No newline at end of file diff --git a/packages/epilot-sdk-v2/src/docs/design.json b/packages/epilot-sdk-v2/src/docs/design.json index de8fd02f7..59e45ec17 100644 --- a/packages/epilot-sdk-v2/src/docs/design.json +++ b/packages/epilot-sdk-v2/src/docs/design.json @@ -1 +1 @@ -"# Design Builder API v2\n\n- **Base URL:** `https://design-builder-api.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/design](https://docs.epilot.io/api/design)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.design.getAllDesigns(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/design'\n\nconst designClient = getClient()\nauthorize(designClient, () => '')\nconst { data } = await designClient.getAllDesigns(...)\n```\n\n## Operations\n\n**design-builder**\n- [`getAllDesigns`](#getalldesigns)\n- [`addDesign`](#adddesign)\n- [`getDesign`](#getdesign)\n- [`deleteDesign`](#deletedesign)\n- [`updateDesign`](#updatedesign)\n- [`duplicateDesign`](#duplicatedesign)\n- [`generateDesign`](#generatedesign)\n- [`generateDesignDocument`](#generatedesigndocument)\n- [`uploadFile`](#uploadfile)\n- [`getFiles`](#getfiles)\n- [`getConsumerDesign`](#getconsumerdesign)\n\n**Schemas**\n- [`UploadFileReq`](#uploadfilereq)\n- [`UploadFileRes`](#uploadfileres)\n- [`GetFilesRes`](#getfilesres)\n- [`GetAllDesignsRes`](#getalldesignsres)\n- [`GetBrandsRes`](#getbrandsres)\n- [`AddDesignReq`](#adddesignreq)\n- [`AddDesignRes`](#adddesignres)\n- [`GetDesignRes`](#getdesignres)\n- [`UpdateDesignReq`](#updatedesignreq)\n- [`ItemMetada`](#itemmetada)\n- [`AddConsumerReq`](#addconsumerreq)\n- [`RemoveConsumerReq`](#removeconsumerreq)\n- [`DesignItem`](#designitem)\n- [`BrandItem`](#branditem)\n- [`Design_Document_V1`](#design_document_v1)\n- [`UpdateDesignConflict`](#updatedesignconflict)\n- [`Custom_Style`](#custom_style)\n- [`Journey`](#journey)\n- [`ConsumerData`](#consumerdata)\n- [`WidgetData`](#widgetdata)\n- [`CustomerPortalData`](#customerportaldata)\n- [`LogoData`](#logodata)\n- [`PaletteData`](#palettedata)\n- [`TypographyData`](#typographydata)\n- [`ShapeData`](#shapedata)\n- [`FontData`](#fontdata)\n- [`FontResponseUrl`](#fontresponseurl)\n- [`WidgetPortalData`](#widgetportaldata)\n- [`GenerateDesignReq`](#generatedesignreq)\n- [`GenerateDesignRes`](#generatedesignres)\n- [`GenerateDesignDocumentReq`](#generatedesigndocumentreq)\n- [`FindingId`](#findingid)\n- [`FindingStatus`](#findingstatus)\n- [`FindingDetail`](#findingdetail)\n- [`DesignFinding`](#designfinding)\n- [`GenerateDesignDocumentRes`](#generatedesigndocumentres)\n- [`GeneratedDesign`](#generateddesign)\n- [`ErrorResp`](#errorresp)\n- [`FileData`](#filedata)\n- [`DesignId`](#designid)\n- [`Theme`](#theme)\n- [`Application`](#application)\n- [`DesignParameters`](#designparameters)\n- [`ParseThemeFromDesignResp`](#parsethemefromdesignresp)\n\n### `getAllDesigns`\n\nScan all designs linked to a organization, based in orgId attribute from JWT auth token\n\n`GET /v1/designs`\n\n```ts\nconst { data } = await client.getAllDesigns()\n```\n\n
\nResponse\n\n```json\n{\n \"designs\": [\n {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {},\n \"style_name\": \"string\",\n \"style\": {},\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {},\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `addDesign`\n\nCreate a brand new design linked to a organization, based in orgId attribute from JWT auth token\n\n`POST /v1/designs`\n\n```ts\nconst { data } = await client.addDesign(\n null,\n {\n design: {\n brand_id: 'string',\n brand_name: 'string',\n user: {\n emailaddress: 'string',\n fullname: 'string',\n name: 'string',\n userid: 'string'\n },\n style_name: 'string',\n style: {\n logo: { /* ... */ },\n palette: { /* ... */ },\n typography: { /* ... */ },\n shape: { /* ... */ },\n consumer: { /* ... */ }\n },\n is_default: true,\n _manifest: ['string'],\n custom_theme: 'string',\n use_custom_theme: true,\n design_tokens: {\n coupon: 'string',\n cashback: 'string',\n custom_css: 'string',\n accent_color: 'string',\n outline_color: 'string',\n divider_color: 'string',\n link_color: 'string',\n link_hover_color: 'string',\n font_size_scale: 'xs',\n topbar_height: 0,\n topbar_logo_alignment: 'flex-start',\n logo_size: 0,\n input_background: 'string',\n input_border_color: 'string',\n input_text_color: 'string',\n input_label_color: 'string',\n input_border_radius: 0,\n input_height: 0,\n input_variant: 'outlined',\n button_primary_bg: 'string',\n button_primary_text: 'string',\n button_primary_hover_bg: 'string',\n button_primary_hover_text: 'string',\n button_outlined_border: 'string',\n button_outlined_text: 'string',\n button_outlined_hover_bg: 'string',\n button_outlined_hover_text: 'string',\n button_ghost_bg: 'string',\n button_ghost_text: 'string',\n button_ghost_hover_bg: 'string',\n button_ghost_hover_text: 'string',\n button_border_radius: 0,\n button_height: 0,\n card_background: 'string',\n card_border_color: 'string',\n card_variant: 'shadow',\n summary_card_background: 'string',\n toggle_selected_bg: 'string',\n toggle_selected_text: 'string',\n toggle_hover_bg: 'string',\n toggle_hover_text: 'string',\n toggle_border_color: 'string',\n dropdown_hover_bg: 'string',\n dropdown_hover_text: 'string',\n dropdown_selected_bg: 'string',\n dropdown_selected_text: 'string',\n switch_unchecked_color: 'string',\n switch_unchecked_bg: 'string',\n switch_border_radius: 0,\n checkbox_unchecked_color: 'string',\n checkbox_label_color: 'string',\n radio_unchecked_color: 'string',\n radio_label_color: 'string',\n datepicker_selected_bg: 'string',\n datepicker_selected_color: 'string',\n datepicker_border_radius: 0,\n chip_background: 'string',\n chip_hover_background: 'string',\n chip_text_color: 'string',\n chip_hover_text_color: 'string'\n },\n version: 1,\n colors: {},\n typography: {},\n shape: {},\n components: {},\n assets: {},\n consumer: {\n widgets: [ /* ... */ ],\n customer_portals: [ /* ... */ ]\n }\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n },\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [],\n \"customer_portals\": []\n }\n }\n}\n```\n\n
\n\n---\n\n### `getDesign`\n\nSearch for a especific design owned by user organization\n\n`GET /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.getDesign({\n designId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n },\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [],\n \"customer_portals\": []\n }\n }\n}\n```\n\n
\n\n---\n\n### `deleteDesign`\n\nSearch and delete for a especific design owned by user organization\n\n`DELETE /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.deleteDesign({\n designId: 'example',\n})\n```\n\n---\n\n### `updateDesign`\n\nUpdate a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`\n\n`PUT /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.updateDesign(\n {\n designId: 'example',\n If-Match: 'example',\n },\n {\n design: {\n brand_id: 'string',\n brand_name: 'string',\n user: {\n emailaddress: 'string',\n fullname: 'string',\n name: 'string',\n userid: 'string'\n },\n style_name: 'string',\n style: {\n logo: { /* ... */ },\n palette: { /* ... */ },\n typography: { /* ... */ },\n shape: { /* ... */ },\n consumer: { /* ... */ }\n },\n is_default: true,\n _manifest: ['string'],\n custom_theme: 'string',\n use_custom_theme: true,\n design_tokens: {\n coupon: 'string',\n cashback: 'string',\n custom_css: 'string',\n accent_color: 'string',\n outline_color: 'string',\n divider_color: 'string',\n link_color: 'string',\n link_hover_color: 'string',\n font_size_scale: 'xs',\n topbar_height: 0,\n topbar_logo_alignment: 'flex-start',\n logo_size: 0,\n input_background: 'string',\n input_border_color: 'string',\n input_text_color: 'string',\n input_label_color: 'string',\n input_border_radius: 0,\n input_height: 0,\n input_variant: 'outlined',\n button_primary_bg: 'string',\n button_primary_text: 'string',\n button_primary_hover_bg: 'string',\n button_primary_hover_text: 'string',\n button_outlined_border: 'string',\n button_outlined_text: 'string',\n button_outlined_hover_bg: 'string',\n button_outlined_hover_text: 'string',\n button_ghost_bg: 'string',\n button_ghost_text: 'string',\n button_ghost_hover_bg: 'string',\n button_ghost_hover_text: 'string',\n button_border_radius: 0,\n button_height: 0,\n card_background: 'string',\n card_border_color: 'string',\n card_variant: 'shadow',\n summary_card_background: 'string',\n toggle_selected_bg: 'string',\n toggle_selected_text: 'string',\n toggle_hover_bg: 'string',\n toggle_hover_text: 'string',\n toggle_border_color: 'string',\n dropdown_hover_bg: 'string',\n dropdown_hover_text: 'string',\n dropdown_selected_bg: 'string',\n dropdown_selected_text: 'string',\n switch_unchecked_color: 'string',\n switch_unchecked_bg: 'string',\n switch_border_radius: 0,\n checkbox_unchecked_color: 'string',\n checkbox_label_color: 'string',\n radio_unchecked_color: 'string',\n radio_label_color: 'string',\n datepicker_selected_bg: 'string',\n datepicker_selected_color: 'string',\n datepicker_border_radius: 0,\n chip_background: 'string',\n chip_hover_background: 'string',\n chip_text_color: 'string',\n chip_hover_text_color: 'string'\n },\n version: 1,\n colors: {},\n typography: {},\n shape: {},\n components: {},\n assets: {},\n consumer: {\n widgets: [ /* ... */ ],\n customer_portals: [ /* ... */ ]\n }\n }\n },\n)\n```\n\n---\n\n### `duplicateDesign`\n\nDuplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marked as a copy) but does NOT carry over journey/portal relations, so the new design\n\n`POST /v1/designs/{designId}/duplicate`\n\n```ts\nconst { data } = await client.duplicateDesign({\n designId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n },\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [],\n \"customer_portals\": []\n }\n }\n}\n```\n\n
\n\n---\n\n### `generateDesign`\n\nGenerates a design (palette, text colours, font, logo and border radius) from a public\nwebsite with AI. The result is cached per organization and URL for 30 days.\n\n`POST /v1/designs/generate`\n\n```ts\nconst { data } = await client.generateDesign(\n null,\n {\n url: 'https://www.twl.de'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"style\": {\n \"logo\": {\n \"main\": {\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n }\n },\n \"palette\": {\n \"primary\": \"string\",\n \"secondary\": \"string\",\n \"error\": \"string\",\n \"background\": \"string\",\n \"paper\": \"string\",\n \"navbar\": \"string\",\n \"portal_login_background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_id\": \"string\",\n \"font_name\": \"string\",\n \"font_family\": \"string\",\n \"font_weight_regular\": \"string\",\n \"font_weight_medium\": \"string\",\n \"font_weight_bold\": \"string\",\n \"urls\": [\n {\n \"type\": \"WOFF2\",\n \"url\": \"string\"\n }\n ]\n },\n \"primary\": \"string\",\n \"secondary\": \"string\"\n }\n },\n \"theme\": {\n \"shape\": {\n \"borderRadius\": \"8\"\n }\n }\n },\n \"cached\": true\n}\n```\n\n
\n\n---\n\n### `generateDesignDocument`\n\nReads a public website and returns a v1 design document plus one finding for each\nid in fixed order. This version chooses the favicon in code and derives the site name.\nThe other findings are `not_fou\n\n`POST /v1/designs/document/generate`\n\n```ts\nconst { data } = await client.generateDesignDocument(\n null,\n {\n url: 'https://www.stadtwerke-musterstadt.de'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"document\": {\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [\n {\n \"id\": \"string\",\n \"name\": \"string\"\n }\n ],\n \"customer_portals\": [\n {\n \"id\": \"string\",\n \"name\": \"string\"\n }\n ]\n }\n },\n \"findings\": [\n {\n \"id\": \"primary_color\",\n \"status\": \"found\",\n \"detail\": {\n \"family\": \"string\"\n }\n },\n {\n \"id\": \"primary_color\",\n \"status\": \"found\",\n \"detail\": {\n \"family\": \"string\"\n }\n }\n ],\n \"site_name\": \"Stadtwerke Musterstadt\",\n \"cached\": true\n}\n```\n\n
\n\n---\n\n### `uploadFile`\n\nUpload a new file for the user organization bucket\n\n`POST /v1/designs/files`\n\n```ts\nconst { data } = await client.uploadFile()\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n}\n```\n\n
\n\n---\n\n### `getFiles`\n\nList all files for the user organization bucket\n\n`GET /v1/designs/files`\n\n```ts\nconst { data } = await client.getFiles({\n type: 'example',\n})\n```\n\n
\nResponse\n\n```json\n[\n {\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n }\n]\n```\n\n
\n\n---\n\n### `getConsumerDesign`\n\nSearch for a especific design owned by user organization\n\n`GET /v1/designs/consumer/{application}/{consumerId}`\n\n```ts\nconst { data } = await client.getConsumerDesign({\n consumerId: 'example',\n application: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n },\n \"version\": 1,\n \"colors\": {},\n \"typography\": {},\n \"shape\": {},\n \"components\": {},\n \"assets\": {},\n \"consumer\": {\n \"widgets\": [],\n \"customer_portals\": []\n }\n }\n}\n```\n\n
\n\n---\n\n## Schemas\n\n### `UploadFileReq`\n\n```ts\ntype UploadFileReq = {\n file_type: \"LOGO\" | \"FONT\" | \"IMAGE\"\n file_data: string // base64\n display_name?: string\n file_name: string\n}\n```\n\n### `UploadFileRes`\n\n```ts\ntype UploadFileRes = {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}\n```\n\n### `GetFilesRes`\n\n```ts\ntype GetFilesRes = Array<{\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}>\n```\n\n### `GetAllDesignsRes`\n\n```ts\ntype GetAllDesignsRes = {\n designs?: Array<{\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }>\n // ...\n}\n```\n\n### `GetBrandsRes`\n\n```ts\ntype GetBrandsRes = {\n brands?: Array<{\n id: string\n name: string\n created_by?: string\n created_date?: string\n main_brand?: string\n organization_id?: string\n updated_date?: string\n updated_by?: string\n status?: string\n }>\n}\n```\n\n### `AddDesignReq`\n\n```ts\ntype AddDesignReq = {\n design: {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n}\n```\n\n### `AddDesignRes`\n\n```ts\ntype AddDesignRes = {\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n // ...\n}\n```\n\n### `GetDesignRes`\n\n```ts\ntype GetDesignRes = {\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n // ...\n}\n```\n\n### `UpdateDesignReq`\n\n```ts\ntype UpdateDesignReq = {\n design: {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n}\n```\n\n### `ItemMetada`\n\n```ts\ntype ItemMetada = {\n id?: string\n created_at?: string\n created_by?: string\n edited?: boolean\n last_modified_at?: string\n}\n```\n\n### `AddConsumerReq`\n\n```ts\ntype AddConsumerReq = {\n consumer_id: string\n consumer_name: string\n}\n```\n\n### `RemoveConsumerReq`\n\n```ts\ntype RemoveConsumerReq = {\n consumer_id: string\n}\n```\n\n### `DesignItem`\n\n```ts\ntype DesignItem = {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: string\n fullname?: string\n name?: string\n userid?: string\n }\n style_name: string\n style: {\n logo?: {\n main?: { ... }\n }\n palette: {\n primary: { ... }\n secondary: { ... }\n error: { ... }\n background: { ... }\n paper: { ... }\n navbar: { ... }\n portal_login_background?: { ... }\n }\n typography: {\n font: { ... }\n primary: { ... }\n secondary: { ... }\n }\n shape?: {\n border_radius?: { ... }\n }\n consumer: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n is_default?: boolean\n _manifest?: string[]\n}\n```\n\n### `BrandItem`\n\n```ts\ntype BrandItem = {\n id: string\n name: string\n created_by?: string\n created_date?: string\n main_brand?: string\n organization_id?: string\n updated_date?: string\n updated_by?: string\n status?: string\n}\n```\n\n### `Design_Document_V1`\n\nGroups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and \n\n```ts\ntype Design_Document_V1 = {\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: Array<{\n id: { ... }\n name: { ... }\n }>\n customer_portals: Array<{\n id: { ... }\n name: { ... }\n }>\n }\n}\n```\n\n### `UpdateDesignConflict`\n\n```ts\ntype UpdateDesignConflict = {\n message?: string\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n // ...\n}\n```\n\n### `Custom_Style`\n\n```ts\ntype Custom_Style = {\n custom_theme?: string\n use_custom_theme?: boolean\n}\n```\n\n### `Journey`\n\n```ts\ntype Journey = {\n design_tokens?: {\n coupon?: string\n cashback?: string\n custom_css?: string\n accent_color?: string\n outline_color?: string\n divider_color?: string\n link_color?: string\n link_hover_color?: string\n font_size_scale?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"\n topbar_height?: number\n topbar_logo_alignment?: \"flex-start\" | \"center\" | \"flex-end\"\n logo_size?: number\n input_background?: string\n input_border_color?: string\n input_text_color?: string\n input_label_color?: string\n input_border_radius?: number\n input_height?: number\n input_variant?: \"outlined\" | \"filled\" | \"underlined\"\n button_primary_bg?: string\n button_primary_text?: string\n button_primary_hover_bg?: string\n button_primary_hover_text?: string\n button_outlined_border?: string\n button_outlined_text?: string\n button_outlined_hover_bg?: string\n button_outlined_hover_text?: string\n button_ghost_bg?: string\n button_ghost_text?: string\n button_ghost_hover_bg?: string\n button_ghost_hover_text?: string\n button_border_radius?: number\n button_height?: number\n card_background?: string\n card_border_color?: string\n card_variant?: \"shadow\" | \"outlined\"\n summary_card_background?: string\n toggle_selected_bg?: string\n toggle_selected_text?: string\n toggle_hover_bg?: string\n toggle_hover_text?: string\n toggle_border_color?: string\n dropdown_hover_bg?: string\n dropdown_hover_text?: string\n dropdown_selected_bg?: string\n dropdown_selected_text?: string\n switch_unchecked_color?: string\n switch_unchecked_bg?: string\n switch_border_radius?: number\n checkbox_unchecked_color?: string\n checkbox_label_color?: string\n radio_unchecked_color?: string\n radio_label_color?: string\n datepicker_selected_bg?: string\n datepicker_selected_color?: string\n datepicker_border_radius?: number\n chip_background?: string\n chip_hover_background?: string\n chip_text_color?: string\n chip_hover_text_color?: string\n }\n}\n```\n\n### `ConsumerData`\n\n```ts\ntype ConsumerData = {\n widgets: Array<{\n id: string\n name: string\n }>\n customer_portals: Array<{\n id: string\n name: string\n }>\n}\n```\n\n### `WidgetData`\n\n```ts\ntype WidgetData = {\n id: string\n name: string\n}\n```\n\n### `CustomerPortalData`\n\n```ts\ntype CustomerPortalData = {\n id: string\n name: string\n}\n```\n\n### `LogoData`\n\n```ts\ntype LogoData = {\n main?: {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n }\n}\n```\n\n### `PaletteData`\n\n```ts\ntype PaletteData = {\n primary: string\n secondary: string\n error: string\n background: string\n paper: string\n navbar: string\n portal_login_background?: string\n}\n```\n\n### `TypographyData`\n\n```ts\ntype TypographyData = {\n font: {\n font_id: string\n font_name: string\n font_family?: string\n font_weight_regular?: string\n font_weight_medium?: string\n font_weight_bold?: string\n urls: Array<{\n type?: { ... }\n url?: { ... }\n }>\n }\n primary: string\n secondary: string\n}\n```\n\n### `ShapeData`\n\n```ts\ntype ShapeData = {\n border_radius?: number\n}\n```\n\n### `FontData`\n\n```ts\ntype FontData = {\n font_id: string\n font_name: string\n font_family?: string\n font_weight_regular?: string\n font_weight_medium?: string\n font_weight_bold?: string\n urls: Array<{\n type?: \"WOFF2\" | \"WOFF\" | \"TTF\" | \"EOT\"\n url?: string\n }>\n}\n```\n\n### `FontResponseUrl`\n\n```ts\ntype FontResponseUrl = {\n type?: \"WOFF2\" | \"WOFF\" | \"TTF\" | \"EOT\"\n url?: string\n}\n```\n\n### `WidgetPortalData`\n\n```ts\ntype WidgetPortalData = {\n id: string\n name: string\n}\n```\n\n### `GenerateDesignReq`\n\n```ts\ntype GenerateDesignReq = {\n url: string // uri\n}\n```\n\n### `GenerateDesignRes`\n\n```ts\ntype GenerateDesignRes = {\n design: {\n style: {\n logo: { ... }\n palette: { ... }\n typography: { ... }\n }\n theme: {\n shape: { ... }\n }\n }\n cached: boolean\n}\n```\n\n### `GenerateDesignDocumentReq`\n\n```ts\ntype GenerateDesignDocumentReq = {\n url: string // uri\n}\n```\n\n### `FindingId`\n\n```ts\ntype FindingId = \"primary_color\" | \"fonts\" | \"corners\" | \"primary_button\" | \"logo\" | \"favicon\"\n```\n\n### `FindingStatus`\n\n```ts\ntype FindingStatus = \"found\" | \"not_found\" | \"not_available\"\n```\n\n### `FindingDetail`\n\n```ts\ntype FindingDetail = {\n family: string\n}\n```\n\n### `DesignFinding`\n\n```ts\ntype DesignFinding = {\n id: \"primary_color\" | \"fonts\" | \"corners\" | \"primary_button\" | \"logo\" | \"favicon\"\n status: \"found\" | \"not_found\" | \"not_available\"\n detail?: {\n family: string\n }\n}\n```\n\n### `GenerateDesignDocumentRes`\n\n```ts\ntype GenerateDesignDocumentRes = {\n document: {\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n consumer?: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n findings: Array<{\n id: \"primary_color\" | \"fonts\" | \"corners\" | \"primary_button\" | \"logo\" | \"favicon\"\n status: \"found\" | \"not_found\" | \"not_available\"\n detail?: {\n family: { ... }\n }\n }>\n site_name: string\n cached: boolean\n}\n```\n\n### `GeneratedDesign`\n\nPartial design to merge into the design being edited\n\n```ts\ntype GeneratedDesign = {\n style: {\n logo: {\n main?: { ... }\n }\n palette: {\n primary: { ... }\n secondary: { ... }\n error: { ... }\n background: { ... }\n paper: { ... }\n navbar: { ... }\n portal_login_background?: { ... }\n }\n typography: {\n font: { ... }\n primary: { ... }\n secondary: { ... }\n }\n }\n theme: {\n shape: {\n borderRadius: { ... }\n }\n }\n}\n```\n\n### `ErrorResp`\n\n```ts\ntype ErrorResp = {\n message?: string\n code?: string\n error?: object\n}\n```\n\n### `FileData`\n\n```ts\ntype FileData = {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}\n```\n\n### `DesignId`\n\nId of the design\n\n```ts\ntype DesignId = string\n```\n\n### `Theme`\n\nType of theme to be parsed and returned\n\n```ts\ntype Theme = \"NEW\" | \"OLD\"\n```\n\n### `Application`\n\nType of application that uses the design\n\n```ts\ntype Application = string\n```\n\n### `DesignParameters`\n\n```ts\ntype DesignParameters = {\n designId?: string\n theme?: \"NEW\" | \"OLD\"\n application?: string\n}\n```\n\n### `ParseThemeFromDesignResp`\n\n```ts\ntype ParseThemeFromDesignResp = {\n theme?: \"NEW\" | \"OLD\"\n design?: {\n id?: string\n last_modified_at?: string\n style_name?: string\n style?: {\n logo?: { ... }\n palette?: { ... }\n typography?: { ... }\n }\n custom_theme?: string\n use_custom_theme?: boolean\n journey_design_tokens?: object\n version?: 1\n colors?: Record\n typography?: Record\n shape?: Record\n components?: Record\n assets?: Record\n journey?: Record\n }\n}\n```\n" +"# Design Builder API v2\n\n- **Base URL:** `https://design-builder-api.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/design](https://docs.epilot.io/api/design)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.design.getAllDesigns(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/design'\n\nconst designClient = getClient()\nauthorize(designClient, () => '')\nconst { data } = await designClient.getAllDesigns(...)\n```\n\n## Operations\n\n**design-builder**\n- [`getAllDesigns`](#getalldesigns)\n- [`addDesign`](#adddesign)\n- [`getDesign`](#getdesign)\n- [`deleteDesign`](#deletedesign)\n- [`updateDesign`](#updatedesign)\n- [`duplicateDesign`](#duplicatedesign)\n- [`getThemeFromDesign`](#getthemefromdesign)\n- [`uploadFile`](#uploadfile)\n- [`getFiles`](#getfiles)\n- [`getConsumerDesign`](#getconsumerdesign)\n- [`addConsumer`](#addconsumer)\n- [`removeConsumer`](#removeconsumer)\n\n**Schemas**\n- [`UploadFileReq`](#uploadfilereq)\n- [`UploadFileRes`](#uploadfileres)\n- [`GetFilesRes`](#getfilesres)\n- [`GetAllDesignsRes`](#getalldesignsres)\n- [`GetBrandsRes`](#getbrandsres)\n- [`AddDesignReq`](#adddesignreq)\n- [`AddDesignRes`](#adddesignres)\n- [`GetDesignRes`](#getdesignres)\n- [`UpdateDesignReq`](#updatedesignreq)\n- [`ItemMetada`](#itemmetada)\n- [`AddConsumerReq`](#addconsumerreq)\n- [`RemoveConsumerReq`](#removeconsumerreq)\n- [`DesignItem`](#designitem)\n- [`BrandItem`](#branditem)\n- [`Custom_Style`](#custom_style)\n- [`Journey`](#journey)\n- [`ConsumerData`](#consumerdata)\n- [`WidgetData`](#widgetdata)\n- [`CustomerPortalData`](#customerportaldata)\n- [`LogoData`](#logodata)\n- [`PaletteData`](#palettedata)\n- [`TypographyData`](#typographydata)\n- [`ShapeData`](#shapedata)\n- [`FontData`](#fontdata)\n- [`FontResponseUrl`](#fontresponseurl)\n- [`WidgetPortalData`](#widgetportaldata)\n- [`ErrorResp`](#errorresp)\n- [`FileData`](#filedata)\n- [`DesignId`](#designid)\n- [`Theme`](#theme)\n- [`Application`](#application)\n- [`DesignParameters`](#designparameters)\n- [`ParseThemeFromDesignResp`](#parsethemefromdesignresp)\n\n### `getAllDesigns`\n\nScan all designs linked to a organization, based in orgId attribute from JWT auth token\n\n`GET /v1/designs`\n\n```ts\nconst { data } = await client.getAllDesigns()\n```\n\n
\nResponse\n\n```json\n{\n \"designs\": [\n {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {},\n \"style_name\": \"string\",\n \"style\": {},\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `addDesign`\n\nCreate a brand new design linked to a organization, based in orgId attribute from JWT auth token\n\n`POST /v1/designs`\n\n```ts\nconst { data } = await client.addDesign(\n null,\n {\n design: {\n brand_id: 'string',\n brand_name: 'string',\n user: {\n emailaddress: 'string',\n fullname: 'string',\n name: 'string',\n userid: 'string'\n },\n style_name: 'string',\n style: {\n logo: { /* ... */ },\n palette: { /* ... */ },\n typography: { /* ... */ },\n shape: { /* ... */ },\n consumer: { /* ... */ }\n },\n is_default: true,\n _manifest: ['string'],\n custom_theme: 'string',\n use_custom_theme: true,\n design_tokens: {\n coupon: 'string',\n cashback: 'string',\n custom_css: 'string',\n accent_color: 'string',\n outline_color: 'string',\n divider_color: 'string',\n link_color: 'string',\n link_hover_color: 'string',\n font_size_scale: 'xs',\n topbar_height: 0,\n topbar_logo_alignment: 'flex-start',\n logo_size: 0,\n input_background: 'string',\n input_border_color: 'string',\n input_text_color: 'string',\n input_label_color: 'string',\n input_border_radius: 0,\n input_height: 0,\n input_variant: 'outlined',\n button_primary_bg: 'string',\n button_primary_text: 'string',\n button_primary_hover_bg: 'string',\n button_primary_hover_text: 'string',\n button_outlined_border: 'string',\n button_outlined_text: 'string',\n button_outlined_hover_bg: 'string',\n button_outlined_hover_text: 'string',\n button_ghost_bg: 'string',\n button_ghost_text: 'string',\n button_ghost_hover_bg: 'string',\n button_ghost_hover_text: 'string',\n button_border_radius: 0,\n button_height: 0,\n card_background: 'string',\n card_border_color: 'string',\n card_variant: 'shadow',\n summary_card_background: 'string',\n toggle_selected_bg: 'string',\n toggle_selected_text: 'string',\n toggle_hover_bg: 'string',\n toggle_hover_text: 'string',\n toggle_border_color: 'string',\n dropdown_hover_bg: 'string',\n dropdown_hover_text: 'string',\n dropdown_selected_bg: 'string',\n dropdown_selected_text: 'string',\n switch_unchecked_color: 'string',\n switch_unchecked_bg: 'string',\n switch_border_radius: 0,\n checkbox_unchecked_color: 'string',\n checkbox_label_color: 'string',\n radio_unchecked_color: 'string',\n radio_label_color: 'string',\n datepicker_selected_bg: 'string',\n datepicker_selected_color: 'string',\n datepicker_border_radius: 0,\n chip_background: 'string',\n chip_hover_background: 'string',\n chip_text_color: 'string',\n chip_hover_text_color: 'string'\n }\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n }\n }\n}\n```\n\n
\n\n---\n\n### `getDesign`\n\nSearch for a especific design owned by user organization\n\n`GET /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.getDesign({\n designId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n }\n }\n}\n```\n\n
\n\n---\n\n### `deleteDesign`\n\nSearch and delete for a especific design owned by user organization\n\n`DELETE /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.deleteDesign({\n designId: 'example',\n})\n```\n\n---\n\n### `updateDesign`\n\nUpdate a especific design owned by user organization\n\n`PUT /v1/designs/{designId}`\n\n```ts\nconst { data } = await client.updateDesign(\n {\n designId: 'example',\n },\n {\n design: {\n brand_id: 'string',\n brand_name: 'string',\n user: {\n emailaddress: 'string',\n fullname: 'string',\n name: 'string',\n userid: 'string'\n },\n style_name: 'string',\n style: {\n logo: { /* ... */ },\n palette: { /* ... */ },\n typography: { /* ... */ },\n shape: { /* ... */ },\n consumer: { /* ... */ }\n },\n is_default: true,\n _manifest: ['string'],\n custom_theme: 'string',\n use_custom_theme: true,\n design_tokens: {\n coupon: 'string',\n cashback: 'string',\n custom_css: 'string',\n accent_color: 'string',\n outline_color: 'string',\n divider_color: 'string',\n link_color: 'string',\n link_hover_color: 'string',\n font_size_scale: 'xs',\n topbar_height: 0,\n topbar_logo_alignment: 'flex-start',\n logo_size: 0,\n input_background: 'string',\n input_border_color: 'string',\n input_text_color: 'string',\n input_label_color: 'string',\n input_border_radius: 0,\n input_height: 0,\n input_variant: 'outlined',\n button_primary_bg: 'string',\n button_primary_text: 'string',\n button_primary_hover_bg: 'string',\n button_primary_hover_text: 'string',\n button_outlined_border: 'string',\n button_outlined_text: 'string',\n button_outlined_hover_bg: 'string',\n button_outlined_hover_text: 'string',\n button_ghost_bg: 'string',\n button_ghost_text: 'string',\n button_ghost_hover_bg: 'string',\n button_ghost_hover_text: 'string',\n button_border_radius: 0,\n button_height: 0,\n card_background: 'string',\n card_border_color: 'string',\n card_variant: 'shadow',\n summary_card_background: 'string',\n toggle_selected_bg: 'string',\n toggle_selected_text: 'string',\n toggle_hover_bg: 'string',\n toggle_hover_text: 'string',\n toggle_border_color: 'string',\n dropdown_hover_bg: 'string',\n dropdown_hover_text: 'string',\n dropdown_selected_bg: 'string',\n dropdown_selected_text: 'string',\n switch_unchecked_color: 'string',\n switch_unchecked_bg: 'string',\n switch_border_radius: 0,\n checkbox_unchecked_color: 'string',\n checkbox_label_color: 'string',\n radio_unchecked_color: 'string',\n radio_label_color: 'string',\n datepicker_selected_bg: 'string',\n datepicker_selected_color: 'string',\n datepicker_border_radius: 0,\n chip_background: 'string',\n chip_hover_background: 'string',\n chip_text_color: 'string',\n chip_hover_text_color: 'string'\n }\n }\n },\n)\n```\n\n---\n\n### `duplicateDesign`\n\nDuplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marked as a copy) but does NOT carry over journey/portal relations, so the new design\n\n`POST /v1/designs/{designId}/duplicate`\n\n```ts\nconst { data } = await client.duplicateDesign({\n designId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n }\n }\n}\n```\n\n
\n\n---\n\n### `getThemeFromDesign`\n\nSearch for a especific design owned by user organization and parse them to a new or old theme\n\n`GET /v1/designs/{designId}/parse`\n\n```ts\nconst { data } = await client.getThemeFromDesign({\n designId: 'example',\n orgId: 'example',\n theme: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"theme\": \"NEW\",\n \"design\": {\n \"id\": \"string\",\n \"last_modified_at\": \"string\",\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {\n \"main\": {\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n }\n },\n \"palette\": {\n \"primary\": \"string\",\n \"secondary\": \"string\",\n \"error\": \"string\",\n \"background\": \"string\",\n \"paper\": \"string\",\n \"navbar\": \"string\",\n \"portal_login_background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_id\": \"string\",\n \"font_name\": \"string\",\n \"font_family\": \"string\",\n \"font_weight_regular\": \"string\",\n \"font_weight_medium\": \"string\",\n \"font_weight_bold\": \"string\",\n \"urls\": [\n {\n \"type\": \"WOFF2\",\n \"url\": \"string\"\n }\n ]\n },\n \"primary\": \"string\",\n \"secondary\": \"string\"\n }\n },\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"journey_design_tokens\": {}\n }\n}\n```\n\n
\n\n---\n\n### `uploadFile`\n\nUpload a new file for the user organization bucket\n\n`POST /v1/designs/files`\n\n```ts\nconst { data } = await client.uploadFile()\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n}\n```\n\n
\n\n---\n\n### `getFiles`\n\nList all files for the user organization bucket\n\n`GET /v1/designs/files`\n\n```ts\nconst { data } = await client.getFiles({\n type: 'example',\n})\n```\n\n
\nResponse\n\n```json\n[\n {\n \"name\": \"string\",\n \"display_name\": \"string\",\n \"file_type\": \"LOGO\",\n \"s3_object_key\": \"string\",\n \"url\": \"string\",\n \"file_id\": \"string\"\n }\n]\n```\n\n
\n\n---\n\n### `getConsumerDesign`\n\nSearch for a especific design owned by user organization\n\n`GET /v1/designs/consumer/{application}/{consumerId}`\n\n```ts\nconst { data } = await client.getConsumerDesign({\n consumerId: 'example',\n application: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"design\": {\n \"id\": \"string\",\n \"created_at\": \"2021-01-30T08:30:00Z\",\n \"created_by\": \"string\",\n \"edited\": true,\n \"last_modified_at\": \"string\",\n \"brand_id\": \"string\",\n \"brand_name\": \"string\",\n \"user\": {\n \"emailaddress\": \"string\",\n \"fullname\": \"string\",\n \"name\": \"string\",\n \"userid\": \"string\"\n },\n \"style_name\": \"string\",\n \"style\": {\n \"logo\": {},\n \"palette\": {},\n \"typography\": {},\n \"shape\": {},\n \"consumer\": {}\n },\n \"is_default\": true,\n \"_manifest\": [\"string\"],\n \"custom_theme\": \"string\",\n \"use_custom_theme\": true,\n \"design_tokens\": {\n \"coupon\": \"string\",\n \"cashback\": \"string\",\n \"custom_css\": \"string\",\n \"accent_color\": \"string\",\n \"outline_color\": \"string\",\n \"divider_color\": \"string\",\n \"link_color\": \"string\",\n \"link_hover_color\": \"string\",\n \"font_size_scale\": \"xs\",\n \"topbar_height\": 0,\n \"topbar_logo_alignment\": \"flex-start\",\n \"logo_size\": 0,\n \"input_background\": \"string\",\n \"input_border_color\": \"string\",\n \"input_text_color\": \"string\",\n \"input_label_color\": \"string\",\n \"input_border_radius\": 0,\n \"input_height\": 0,\n \"input_variant\": \"outlined\",\n \"button_primary_bg\": \"string\",\n \"button_primary_text\": \"string\",\n \"button_primary_hover_bg\": \"string\",\n \"button_primary_hover_text\": \"string\",\n \"button_outlined_border\": \"string\",\n \"button_outlined_text\": \"string\",\n \"button_outlined_hover_bg\": \"string\",\n \"button_outlined_hover_text\": \"string\",\n \"button_ghost_bg\": \"string\",\n \"button_ghost_text\": \"string\",\n \"button_ghost_hover_bg\": \"string\",\n \"button_ghost_hover_text\": \"string\",\n \"button_border_radius\": 0,\n \"button_height\": 0,\n \"card_background\": \"string\",\n \"card_border_color\": \"string\",\n \"card_variant\": \"shadow\",\n \"summary_card_background\": \"string\",\n \"toggle_selected_bg\": \"string\",\n \"toggle_selected_text\": \"string\",\n \"toggle_hover_bg\": \"string\",\n \"toggle_hover_text\": \"string\",\n \"toggle_border_color\": \"string\",\n \"dropdown_hover_bg\": \"string\",\n \"dropdown_hover_text\": \"string\",\n \"dropdown_selected_bg\": \"string\",\n \"dropdown_selected_text\": \"string\",\n \"switch_unchecked_color\": \"string\",\n \"switch_unchecked_bg\": \"string\",\n \"switch_border_radius\": 0,\n \"checkbox_unchecked_color\": \"string\",\n \"checkbox_label_color\": \"string\",\n \"radio_unchecked_color\": \"string\",\n \"radio_label_color\": \"string\",\n \"datepicker_selected_bg\": \"string\",\n \"datepicker_selected_color\": \"string\",\n \"datepicker_border_radius\": 0,\n \"chip_background\": \"string\",\n \"chip_hover_background\": \"string\",\n \"chip_text_color\": \"string\",\n \"chip_hover_text_color\": \"string\"\n }\n }\n}\n```\n\n
\n\n---\n\n### `addConsumer`\n\nAdd a consumer that uses a specific design\n\n`PUT /v1/designs/addConsumer/{application}/{designId}`\n\n```ts\nconst { data } = await client.addConsumer(\n {\n designId: 'example',\n application: 'example',\n },\n {\n consumer_id: '4a062990-a6a3-11eb-9828-4f3da7d4935a',\n consumer_name: 'string',\n should_delete: 'string'\n },\n)\n```\n\n---\n\n### `removeConsumer`\n\nRemove a consumer that uses a specific design\n\n`PUT /v1/designs/removeConsumer/{application}/{designId}`\n\n```ts\nconst { data } = await client.removeConsumer(\n {\n designId: 'example',\n application: 'example',\n },\n {\n consumer_id: '4a062990-a6a3-11eb-9828-4f3da7d4935a',\n should_delete: 'string'\n },\n)\n```\n\n---\n\n## Schemas\n\n### `UploadFileReq`\n\n```ts\ntype UploadFileReq = {\n file_type: \"LOGO\" | \"FONT\" | \"IMAGE\"\n file_data: string // base64\n display_name?: string\n file_name: string\n}\n```\n\n### `UploadFileRes`\n\n```ts\ntype UploadFileRes = {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}\n```\n\n### `GetFilesRes`\n\n```ts\ntype GetFilesRes = Array<{\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}>\n```\n\n### `GetAllDesignsRes`\n\n```ts\ntype GetAllDesignsRes = {\n designs?: Array<{\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }>\n}\n```\n\n### `GetBrandsRes`\n\n```ts\ntype GetBrandsRes = {\n brands?: Array<{\n id: string\n name: string\n created_by?: string\n created_date?: string\n main_brand?: string\n organization_id?: string\n updated_date?: string\n updated_by?: string\n status?: string\n }>\n}\n```\n\n### `AddDesignReq`\n\n```ts\ntype AddDesignReq = {\n design: {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }\n}\n```\n\n### `AddDesignRes`\n\n```ts\ntype AddDesignRes = {\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }\n}\n```\n\n### `GetDesignRes`\n\n```ts\ntype GetDesignRes = {\n design?: {\n id?: string\n created_at?: string\n created_by?: string\n edited: boolean\n last_modified_at?: string\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }\n}\n```\n\n### `UpdateDesignReq`\n\n```ts\ntype UpdateDesignReq = {\n design: {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: { ... }\n fullname?: { ... }\n name?: { ... }\n userid?: { ... }\n }\n style_name: string\n style: {\n logo?: { ... }\n palette: { ... }\n typography: { ... }\n shape?: { ... }\n consumer: { ... }\n }\n is_default?: boolean\n _manifest?: string[]\n custom_theme?: string\n use_custom_theme?: boolean\n design_tokens?: {\n coupon?: { ... }\n cashback?: { ... }\n custom_css?: { ... }\n accent_color?: { ... }\n outline_color?: { ... }\n divider_color?: { ... }\n link_color?: { ... }\n link_hover_color?: { ... }\n font_size_scale?: { ... }\n topbar_height?: { ... }\n topbar_logo_alignment?: { ... }\n logo_size?: { ... }\n input_background?: { ... }\n input_border_color?: { ... }\n input_text_color?: { ... }\n input_label_color?: { ... }\n input_border_radius?: { ... }\n input_height?: { ... }\n input_variant?: { ... }\n button_primary_bg?: { ... }\n button_primary_text?: { ... }\n button_primary_hover_bg?: { ... }\n button_primary_hover_text?: { ... }\n button_outlined_border?: { ... }\n button_outlined_text?: { ... }\n button_outlined_hover_bg?: { ... }\n button_outlined_hover_text?: { ... }\n button_ghost_bg?: { ... }\n button_ghost_text?: { ... }\n button_ghost_hover_bg?: { ... }\n button_ghost_hover_text?: { ... }\n button_border_radius?: { ... }\n button_height?: { ... }\n card_background?: { ... }\n card_border_color?: { ... }\n card_variant?: { ... }\n summary_card_background?: { ... }\n toggle_selected_bg?: { ... }\n toggle_selected_text?: { ... }\n toggle_hover_bg?: { ... }\n toggle_hover_text?: { ... }\n toggle_border_color?: { ... }\n dropdown_hover_bg?: { ... }\n dropdown_hover_text?: { ... }\n dropdown_selected_bg?: { ... }\n dropdown_selected_text?: { ... }\n switch_unchecked_color?: { ... }\n switch_unchecked_bg?: { ... }\n switch_border_radius?: { ... }\n checkbox_unchecked_color?: { ... }\n checkbox_label_color?: { ... }\n radio_unchecked_color?: { ... }\n radio_label_color?: { ... }\n datepicker_selected_bg?: { ... }\n datepicker_selected_color?: { ... }\n datepicker_border_radius?: { ... }\n chip_background?: { ... }\n chip_hover_background?: { ... }\n chip_text_color?: { ... }\n chip_hover_text_color?: { ... }\n }\n }\n}\n```\n\n### `ItemMetada`\n\n```ts\ntype ItemMetada = {\n id?: string\n created_at?: string\n created_by?: string\n edited?: boolean\n last_modified_at?: string\n}\n```\n\n### `AddConsumerReq`\n\n```ts\ntype AddConsumerReq = {\n consumer_id: string\n consumer_name: string\n should_delete?: string\n}\n```\n\n### `RemoveConsumerReq`\n\n```ts\ntype RemoveConsumerReq = {\n consumer_id: string\n should_delete?: string\n}\n```\n\n### `DesignItem`\n\n```ts\ntype DesignItem = {\n brand_id?: string\n brand_name?: string\n user?: {\n emailaddress?: string\n fullname?: string\n name?: string\n userid?: string\n }\n style_name: string\n style: {\n logo?: {\n main?: { ... }\n }\n palette: {\n primary: { ... }\n secondary: { ... }\n error: { ... }\n background: { ... }\n paper: { ... }\n navbar: { ... }\n portal_login_background?: { ... }\n }\n typography: {\n font: { ... }\n primary: { ... }\n secondary: { ... }\n }\n shape?: {\n border_radius?: { ... }\n }\n consumer: {\n widgets: { ... }\n customer_portals: { ... }\n }\n }\n is_default?: boolean\n _manifest?: string[]\n}\n```\n\n### `BrandItem`\n\n```ts\ntype BrandItem = {\n id: string\n name: string\n created_by?: string\n created_date?: string\n main_brand?: string\n organization_id?: string\n updated_date?: string\n updated_by?: string\n status?: string\n}\n```\n\n### `Custom_Style`\n\n```ts\ntype Custom_Style = {\n custom_theme?: string\n use_custom_theme?: boolean\n}\n```\n\n### `Journey`\n\n```ts\ntype Journey = {\n design_tokens?: {\n coupon?: string\n cashback?: string\n custom_css?: string\n accent_color?: string\n outline_color?: string\n divider_color?: string\n link_color?: string\n link_hover_color?: string\n font_size_scale?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"\n topbar_height?: number\n topbar_logo_alignment?: \"flex-start\" | \"center\" | \"flex-end\"\n logo_size?: number\n input_background?: string\n input_border_color?: string\n input_text_color?: string\n input_label_color?: string\n input_border_radius?: number\n input_height?: number\n input_variant?: \"outlined\" | \"filled\" | \"underlined\"\n button_primary_bg?: string\n button_primary_text?: string\n button_primary_hover_bg?: string\n button_primary_hover_text?: string\n button_outlined_border?: string\n button_outlined_text?: string\n button_outlined_hover_bg?: string\n button_outlined_hover_text?: string\n button_ghost_bg?: string\n button_ghost_text?: string\n button_ghost_hover_bg?: string\n button_ghost_hover_text?: string\n button_border_radius?: number\n button_height?: number\n card_background?: string\n card_border_color?: string\n card_variant?: \"shadow\" | \"outlined\"\n summary_card_background?: string\n toggle_selected_bg?: string\n toggle_selected_text?: string\n toggle_hover_bg?: string\n toggle_hover_text?: string\n toggle_border_color?: string\n dropdown_hover_bg?: string\n dropdown_hover_text?: string\n dropdown_selected_bg?: string\n dropdown_selected_text?: string\n switch_unchecked_color?: string\n switch_unchecked_bg?: string\n switch_border_radius?: number\n checkbox_unchecked_color?: string\n checkbox_label_color?: string\n radio_unchecked_color?: string\n radio_label_color?: string\n datepicker_selected_bg?: string\n datepicker_selected_color?: string\n datepicker_border_radius?: number\n chip_background?: string\n chip_hover_background?: string\n chip_text_color?: string\n chip_hover_text_color?: string\n }\n}\n```\n\n### `ConsumerData`\n\n```ts\ntype ConsumerData = {\n widgets: Array<{\n id: string\n name: string\n }>\n customer_portals: Array<{\n id: string\n name: string\n }>\n}\n```\n\n### `WidgetData`\n\n```ts\ntype WidgetData = {\n id: string\n name: string\n}\n```\n\n### `CustomerPortalData`\n\n```ts\ntype CustomerPortalData = {\n id: string\n name: string\n}\n```\n\n### `LogoData`\n\n```ts\ntype LogoData = {\n main?: {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n }\n}\n```\n\n### `PaletteData`\n\n```ts\ntype PaletteData = {\n primary: string\n secondary: string\n error: string\n background: string\n paper: string\n navbar: string\n portal_login_background?: string\n}\n```\n\n### `TypographyData`\n\n```ts\ntype TypographyData = {\n font: {\n font_id: string\n font_name: string\n font_family?: string\n font_weight_regular?: string\n font_weight_medium?: string\n font_weight_bold?: string\n urls: Array<{\n type?: { ... }\n url?: { ... }\n }>\n }\n primary: string\n secondary: string\n}\n```\n\n### `ShapeData`\n\n```ts\ntype ShapeData = {\n border_radius?: number\n}\n```\n\n### `FontData`\n\n```ts\ntype FontData = {\n font_id: string\n font_name: string\n font_family?: string\n font_weight_regular?: string\n font_weight_medium?: string\n font_weight_bold?: string\n urls: Array<{\n type?: \"WOFF2\" | \"WOFF\" | \"TTF\" | \"EOT\"\n url?: string\n }>\n}\n```\n\n### `FontResponseUrl`\n\n```ts\ntype FontResponseUrl = {\n type?: \"WOFF2\" | \"WOFF\" | \"TTF\" | \"EOT\"\n url?: string\n}\n```\n\n### `WidgetPortalData`\n\n```ts\ntype WidgetPortalData = {\n id: string\n name: string\n}\n```\n\n### `ErrorResp`\n\n```ts\ntype ErrorResp = {\n message?: string\n error?: object\n}\n```\n\n### `FileData`\n\n```ts\ntype FileData = {\n name: string\n display_name?: string\n file_type?: \"LOGO\" | \"FONT\" | \"IMAGE\"\n s3_object_key: string\n url: string\n file_id?: string\n}\n```\n\n### `DesignId`\n\nId of the design\n\n```ts\ntype DesignId = string\n```\n\n### `Theme`\n\nType of theme to be parsed and returned\n\n```ts\ntype Theme = \"NEW\" | \"OLD\"\n```\n\n### `Application`\n\nType of application that uses the design\n\n```ts\ntype Application = string\n```\n\n### `DesignParameters`\n\n```ts\ntype DesignParameters = {\n designId?: string\n theme?: \"NEW\" | \"OLD\"\n application?: string\n}\n```\n\n### `ParseThemeFromDesignResp`\n\n```ts\ntype ParseThemeFromDesignResp = {\n theme?: \"NEW\" | \"OLD\"\n design?: {\n id?: string\n last_modified_at?: string\n style_name?: string\n style?: {\n logo?: { ... }\n palette?: { ... }\n typography?: { ... }\n }\n custom_theme?: string\n use_custom_theme?: boolean\n journey_design_tokens?: object\n }\n}\n```\n" diff --git a/packages/epilot-sdk-v2/src/types/design.d.ts b/packages/epilot-sdk-v2/src/types/design.d.ts index c3a7bb7c8..25aa85007 100644 --- a/packages/epilot-sdk-v2/src/types/design.d.ts +++ b/packages/epilot-sdk-v2/src/types/design.d.ts @@ -17,11 +17,9 @@ export declare namespace Components { */ DesignId; consumer_name: string; + should_delete?: string; } export interface AddDesignReq { - /** - * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. - */ design: { brand_id?: string; brand_name?: string; @@ -282,29 +280,9 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; - version?: 1; - colors?: { - [name: string]: any; - }; - typography?: { - [name: string]: any; - }; - shape?: { - [name: string]: any; - }; - components?: { - [name: string]: any; - }; - assets?: { - [name: string]: any; - }; - consumer?: ConsumerData; }; } export interface AddDesignRes { - /** - * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. - */ design?: { id?: string; /** @@ -575,23 +553,6 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; - version?: 1; - colors?: { - [name: string]: any; - }; - typography?: { - [name: string]: any; - }; - shape?: { - [name: string]: any; - }; - components?: { - [name: string]: any; - }; - assets?: { - [name: string]: any; - }; - consumer?: ConsumerData; }; } /** @@ -623,33 +584,6 @@ export declare namespace Components { id: string; name: string; } - /** - * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. - */ - export interface DesignDocumentV1 { - version?: 1; - colors?: { - [name: string]: any; - }; - typography?: { - [name: string]: any; - }; - shape?: { - [name: string]: any; - }; - components?: { - [name: string]: any; - }; - assets?: { - [name: string]: any; - }; - consumer?: ConsumerData; - } - export interface DesignFinding { - id: FindingId; - status: FindingStatus; - detail?: FindingDetail; - } /** * Id of the design * example: @@ -701,10 +635,6 @@ export declare namespace Components { } export interface ErrorResp { message?: string; - /** - * Machine-readable reason, e.g. `invalid_url` or `rate_limited` - */ - code?: string; error?: { [key: string]: any; }; @@ -720,14 +650,6 @@ export declare namespace Components { */ file_id?: string; } - export interface FindingDetail { - /** - * Font family that was found but cannot be loaded - */ - family: string; - } - export type FindingId = "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon"; - export type FindingStatus = "found" | "not_found" | "not_available"; export interface FontData { font_id: string; font_name: string; @@ -741,68 +663,6 @@ export declare namespace Components { type?: "WOFF2" | "WOFF" | "TTF" | "EOT"; url?: string; } - export interface GenerateDesignDocumentReq { - /** - * Public website to read the design from - * example: - * https://www.stadtwerke-musterstadt.de - */ - url: string; // uri - } - export interface GenerateDesignDocumentRes { - document: /* Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. */ DesignDocumentV1; - findings: [ - DesignFinding, - DesignFinding, - DesignFinding, - DesignFinding, - DesignFinding, - DesignFinding - ]; - /** - * example: - * Stadtwerke Musterstadt - */ - site_name: string; - /** - * True when the response was served from an earlier successful generation for this organization, normalised URL and generator version - */ - cached: boolean; - } - export interface GenerateDesignReq { - /** - * Public website to derive the design from - * example: - * https://www.twl.de - */ - url: string; // uri - } - export interface GenerateDesignRes { - design: /* Partial design to merge into the design being edited */ GeneratedDesign; - /** - * True when the design was generated earlier for this organization and URL - */ - cached: boolean; - } - /** - * Partial design to merge into the design being edited - */ - export interface GeneratedDesign { - style: { - logo: LogoData; - palette: PaletteData; - typography: TypographyData; - }; - theme: { - shape: { - /** - * example: - * 8 - */ - borderRadius: string; - }; - }; - } export interface GetAllDesignsRes { designs?: { id?: string; @@ -1074,23 +934,6 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; - version?: 1; - colors?: { - [name: string]: any; - }; - typography?: { - [name: string]: any; - }; - shape?: { - [name: string]: any; - }; - components?: { - [name: string]: any; - }; - assets?: { - [name: string]: any; - }; - consumer?: ConsumerData; }[]; } export interface GetBrandsRes { @@ -1107,9 +950,6 @@ export declare namespace Components { }[]; } export interface GetDesignRes { - /** - * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. - */ design?: { id?: string; /** @@ -1380,23 +1220,6 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; - version?: 1; - colors?: { - [name: string]: any; - }; - typography?: { - [name: string]: any; - }; - shape?: { - [name: string]: any; - }; - components?: { - [name: string]: any; - }; - assets?: { - [name: string]: any; - }; - consumer?: ConsumerData; }; } export type GetFilesRes = { @@ -1696,28 +1519,6 @@ export declare namespace Components { journey_design_tokens?: { [key: string]: any; }; - version?: 1; - colors?: { - [name: string]: any; - }; - typography?: { - [name: string]: any; - }; - shape?: { - [name: string]: any; - }; - components?: { - [name: string]: any; - }; - assets?: { - [name: string]: any; - }; - /** - * v1 designs only: the journey group of @epilot/design-document (custom_css, tokens and the journey overrides primary_color, font, border_radius, logo), derived on read from the stored journey fields and compared with the stored v1 groups. What a journey paints from it equals what it paints from the theme built from the old fields. Not returned by GET. - */ - journey?: { - [name: string]: any; - }; }; } export interface RemoveConsumerReq { @@ -1727,6 +1528,7 @@ export declare namespace Components { * 4a062990-a6a3-11eb-9828-4f3da7d4935a */ DesignId; + should_delete?: string; } export interface ShapeData { border_radius?: number; @@ -1742,304 +1544,7 @@ export declare namespace Components { primary: string; secondary: string; } - export interface UpdateDesignConflict { - message?: string; - /** - * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. - */ - design?: { - id?: string; - /** - * Creation date and time - * example: - * 2021-01-30T08:30:00Z - */ - created_at?: string; - created_by?: string; - edited: boolean; - last_modified_at?: string; - brand_id?: string; - brand_name?: string; - user?: { - emailaddress?: string; - fullname?: string; - name?: string; - userid?: string; - }; - style_name: string; - style: { - logo?: LogoData; - palette: PaletteData; - typography: TypographyData; - shape?: ShapeData; - consumer: ConsumerData; - }; - is_default?: boolean; - /** - * The manifest IDs associated with this design - */ - _manifest?: string[]; - custom_theme?: string; - use_custom_theme?: boolean; - /** - * Design tokens for journey customization - */ - design_tokens?: { - coupon?: string; - cashback?: string; - custom_css?: string; - /** - * Accent color, defaults to primary - */ - accent_color?: string; - /** - * Global outline/focus color - */ - outline_color?: string; - /** - * Divider line color - */ - divider_color?: string; - /** - * Link text color - */ - link_color?: string; - /** - * Link hover text color - */ - link_hover_color?: string; - /** - * Font size scale factor - */ - font_size_scale?: "xs" | "sm" | "md" | "lg" | "xl"; - /** - * Topbar minimum height in pixels - */ - topbar_height?: number; - /** - * Logo/content alignment in the top bar - */ - topbar_logo_alignment?: "flex-start" | "center" | "flex-end"; - /** - * Logo size in pixels - */ - logo_size?: number; - /** - * Input field background color - */ - input_background?: string; - /** - * Input field border color - */ - input_border_color?: string; - /** - * Input field text color - */ - input_text_color?: string; - /** - * Input field label color - */ - input_label_color?: string; - /** - * Input field border radius in pixels - */ - input_border_radius?: number; - /** - * Input field height in pixels - */ - input_height?: number; - /** - * Input field variant style - */ - input_variant?: "outlined" | "filled" | "underlined"; - /** - * Primary button background color or gradient - */ - button_primary_bg?: string; - /** - * Primary button text color - */ - button_primary_text?: string; - /** - * Primary button hover background color or gradient - */ - button_primary_hover_bg?: string; - /** - * Primary button hover text color - */ - button_primary_hover_text?: string; - /** - * Outlined button border color - */ - button_outlined_border?: string; - /** - * Outlined button text color - */ - button_outlined_text?: string; - /** - * Outlined button hover background color - */ - button_outlined_hover_bg?: string; - /** - * Outlined button hover text color - */ - button_outlined_hover_text?: string; - /** - * Ghost button background color - */ - button_ghost_bg?: string; - /** - * Ghost button text color - */ - button_ghost_text?: string; - /** - * Ghost button hover background color - */ - button_ghost_hover_bg?: string; - /** - * Ghost button hover text color - */ - button_ghost_hover_text?: string; - /** - * Button border radius in pixels - */ - button_border_radius?: number; - /** - * Button height in pixels - */ - button_height?: number; - /** - * Card background color - */ - card_background?: string; - /** - * Card border color for outlined variant - */ - card_border_color?: string; - /** - * Card visual variant - */ - card_variant?: "shadow" | "outlined"; - /** - * Summary card background color - */ - summary_card_background?: string; - /** - * Toggle button selected background color - */ - toggle_selected_bg?: string; - /** - * Toggle button selected text color - */ - toggle_selected_text?: string; - /** - * Toggle button hover background color - */ - toggle_hover_bg?: string; - /** - * Toggle button hover text color - */ - toggle_hover_text?: string; - /** - * Toggle group wrapper border color - */ - toggle_border_color?: string; - /** - * Dropdown option hover background color - */ - dropdown_hover_bg?: string; - /** - * Dropdown option hover text color - */ - dropdown_hover_text?: string; - /** - * Dropdown option selected background color - */ - dropdown_selected_bg?: string; - /** - * Dropdown option selected text color - */ - dropdown_selected_text?: string; - /** - * Switch unchecked thumb color - */ - switch_unchecked_color?: string; - /** - * Switch unchecked track background color - */ - switch_unchecked_bg?: string; - /** - * Switch border radius in pixels - */ - switch_border_radius?: number; - /** - * Checkbox unchecked border color - */ - checkbox_unchecked_color?: string; - /** - * Checkbox label text color - */ - checkbox_label_color?: string; - /** - * Radio button unchecked border color - */ - radio_unchecked_color?: string; - /** - * Radio button label text color - */ - radio_label_color?: string; - /** - * Date picker selected date background color - */ - datepicker_selected_bg?: string; - /** - * Date picker selected date text color - */ - datepicker_selected_color?: string; - /** - * Date picker border radius in pixels - */ - datepicker_border_radius?: number; - /** - * Chip background color - */ - chip_background?: string; - /** - * Chip hover background color - */ - chip_hover_background?: string; - /** - * Chip text color - */ - chip_text_color?: string; - /** - * Chip hover text color - */ - chip_hover_text_color?: string; - }; - version?: 1; - colors?: { - [name: string]: any; - }; - typography?: { - [name: string]: any; - }; - shape?: { - [name: string]: any; - }; - components?: { - [name: string]: any; - }; - assets?: { - [name: string]: any; - }; - consumer?: ConsumerData; - }; - } export interface UpdateDesignReq { - /** - * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. - */ design: { brand_id?: string; brand_name?: string; @@ -2300,23 +1805,6 @@ export declare namespace Components { */ chip_hover_text_color?: string; }; - version?: 1; - colors?: { - [name: string]: any; - }; - typography?: { - [name: string]: any; - }; - shape?: { - [name: string]: any; - }; - components?: { - [name: string]: any; - }; - assets?: { - [name: string]: any; - }; - consumer?: ConsumerData; }; } export interface UploadFileReq { @@ -2400,9 +1888,7 @@ export declare namespace Paths { export type $401 = Components.Schemas.ErrorResp; export interface $404 { } - export type $409 = Components.Schemas.ErrorResp; export type $500 = Components.Schemas.ErrorResp; - export type $503 = Components.Schemas.ErrorResp; } } namespace DuplicateDesign { @@ -2426,33 +1912,6 @@ export declare namespace Paths { export type $500 = Components.Schemas.ErrorResp; } } - namespace GenerateDesign { - export type RequestBody = Components.Schemas.GenerateDesignReq; - namespace Responses { - export type $200 = Components.Schemas.GenerateDesignRes; - export type $201 = Components.Schemas.GenerateDesignRes; - export type $400 = Components.Schemas.ErrorResp; - export type $401 = Components.Schemas.ErrorResp; - export type $403 = Components.Schemas.ErrorResp; - export type $422 = Components.Schemas.ErrorResp; - export type $502 = Components.Schemas.ErrorResp; - export type $504 = Components.Schemas.ErrorResp; - } - } - namespace GenerateDesignDocument { - export type RequestBody = Components.Schemas.GenerateDesignDocumentReq; - namespace Responses { - export type $200 = Components.Schemas.GenerateDesignDocumentRes; - export type $201 = Components.Schemas.GenerateDesignDocumentRes; - export type $400 = Components.Schemas.ErrorResp; - export type $401 = Components.Schemas.ErrorResp; - export type $403 = Components.Schemas.ErrorResp; - export type $422 = Components.Schemas.ErrorResp; - export type $429 = Components.Schemas.ErrorResp; - export type $502 = Components.Schemas.ErrorResp; - export type $504 = Components.Schemas.ErrorResp; - } - } namespace GetAllDesigns { namespace Responses { export type $200 = Components.Schemas.GetAllDesignsRes; @@ -2592,9 +2051,6 @@ export declare namespace Paths { } } namespace UpdateDesign { - export interface HeaderParameters { - "If-Match"?: Parameters.IfMatch; - } namespace Parameters { export type DesignId = /** * Id of the design @@ -2602,7 +2058,6 @@ export declare namespace Paths { * 4a062990-a6a3-11eb-9828-4f3da7d4935a */ Components.Schemas.DesignId; - export type IfMatch = string; } export interface PathParameters { designId: Parameters.DesignId; @@ -2615,7 +2070,6 @@ export declare namespace Paths { export type $401 = Components.Schemas.ErrorResp; export interface $404 { } - export type $409 = Components.Schemas.UpdateDesignConflict; export type $500 = Components.Schemas.ErrorResp; } } @@ -2665,10 +2119,10 @@ export interface OperationMethods { /** * updateDesign - updateDesign * - * Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`, `custom_theme` and `use_custom_theme` untouched. A body without `version` on a v1 design is treated as an old client's read-modify-write: those four fields are stored as sent, and brand-wide changes in `style` are applied to the v1 groups. + * Update a especific design owned by user organization */ 'updateDesign'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: Paths.UpdateDesign.RequestBody, config?: AxiosRequestConfig ): OperationResponse @@ -2695,42 +2149,13 @@ export interface OperationMethods { /** * getThemeFromDesign - getThemeFromDesign * - * Search for a especific design owned by user organization and parse them to a new or old theme. Deprecated: kept for old readers only. For a v1 design the response carries the v1 groups and the derived `journey` group next to the stored old fields and the theme built from them; new runtimes read the v1 groups. + * Search for a especific design owned by user organization and parse them to a new or old theme */ 'getThemeFromDesign'( parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig ): OperationResponse - /** - * generateDesign - generateDesign - * - * Generates a design (palette, text colours, font, logo and border radius) from a public - * website with AI. The result is cached per organization and URL for 30 days. - * - */ - 'generateDesign'( - parameters?: Parameters | null, - data?: Paths.GenerateDesign.RequestBody, - config?: AxiosRequestConfig - ): OperationResponse - /** - * generateDesignDocument - generateDesignDocument - * - * Reads a public website and returns a v1 design document plus one finding for each - * id in fixed order. This version chooses the favicon in code and derives the site name. - * The other findings are `not_found` until they are implemented. The document contains - * only the leaves that passed validation, and defaults are not pruned. - * Successful responses are cached per organization, normalised URL and generator version - * for 7 days. Each organization may run 20 new generations per UTC day; cache hits do not - * count toward the limit. A client abort still finishes on the server and is cached. - * - */ - 'generateDesignDocument'( - parameters?: Parameters | null, - data?: Paths.GenerateDesignDocument.RequestBody, - config?: AxiosRequestConfig - ): OperationResponse /** * getFiles - getFiles * @@ -2850,10 +2275,10 @@ export interface PathsDictionary { /** * updateDesign - updateDesign * - * Update a especific design owned by user organization. A body with `version: 1` is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored `style`, `design_tokens`, `custom_theme` and `use_custom_theme` untouched. A body without `version` on a v1 design is treated as an old client's read-modify-write: those four fields are stored as sent, and brand-wide changes in `style` are applied to the v1 groups. + * Update a especific design owned by user organization */ 'put'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: Paths.UpdateDesign.RequestBody, config?: AxiosRequestConfig ): OperationResponse @@ -2874,7 +2299,7 @@ export interface PathsDictionary { /** * getThemeFromDesign - getThemeFromDesign * - * Search for a especific design owned by user organization and parse them to a new or old theme. Deprecated: kept for old readers only. For a v1 design the response carries the v1 groups and the derived `journey` group next to the stored old fields and the theme built from them; new runtimes read the v1 groups. + * Search for a especific design owned by user organization and parse them to a new or old theme */ 'get'( parameters?: Parameters | null, @@ -2882,39 +2307,6 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } - ['/v1/designs/generate']: { - /** - * generateDesign - generateDesign - * - * Generates a design (palette, text colours, font, logo and border radius) from a public - * website with AI. The result is cached per organization and URL for 30 days. - * - */ - 'post'( - parameters?: Parameters | null, - data?: Paths.GenerateDesign.RequestBody, - config?: AxiosRequestConfig - ): OperationResponse - } - ['/v1/designs/document/generate']: { - /** - * generateDesignDocument - generateDesignDocument - * - * Reads a public website and returns a v1 design document plus one finding for each - * id in fixed order. This version chooses the favicon in code and derives the site name. - * The other findings are `not_found` until they are implemented. The document contains - * only the leaves that passed validation, and defaults are not pruned. - * Successful responses are cached per organization, normalised URL and generator version - * for 7 days. Each organization may run 20 new generations per UTC day; cache hits do not - * count toward the limit. A client abort still finishes on the server and is cached. - * - */ - 'post'( - parameters?: Parameters | null, - data?: Paths.GenerateDesignDocument.RequestBody, - config?: AxiosRequestConfig - ): OperationResponse - } ['/v1/designs/files']: { /** * uploadFile - uploadFile @@ -3010,23 +2402,13 @@ export type BrandItem = Components.Schemas.BrandItem; export type ConsumerData = Components.Schemas.ConsumerData; export type Custom_Style = Components.Schemas.CustomStyle; export type CustomerPortalData = Components.Schemas.CustomerPortalData; -export type Design_Document_V1 = Components.Schemas.DesignDocumentV1; -export type DesignFinding = Components.Schemas.DesignFinding; export type DesignId = Components.Schemas.DesignId; export type DesignItem = Components.Schemas.DesignItem; export type DesignParameters = Components.Schemas.DesignParameters; export type ErrorResp = Components.Schemas.ErrorResp; export type FileData = Components.Schemas.FileData; -export type FindingDetail = Components.Schemas.FindingDetail; -export type FindingId = Components.Schemas.FindingId; -export type FindingStatus = Components.Schemas.FindingStatus; export type FontData = Components.Schemas.FontData; export type FontResponseUrl = Components.Schemas.FontResponseUrl; -export type GenerateDesignDocumentReq = Components.Schemas.GenerateDesignDocumentReq; -export type GenerateDesignDocumentRes = Components.Schemas.GenerateDesignDocumentRes; -export type GenerateDesignReq = Components.Schemas.GenerateDesignReq; -export type GenerateDesignRes = Components.Schemas.GenerateDesignRes; -export type GeneratedDesign = Components.Schemas.GeneratedDesign; export type GetAllDesignsRes = Components.Schemas.GetAllDesignsRes; export type GetBrandsRes = Components.Schemas.GetBrandsRes; export type GetDesignRes = Components.Schemas.GetDesignRes; @@ -3040,7 +2422,6 @@ export type RemoveConsumerReq = Components.Schemas.RemoveConsumerReq; export type ShapeData = Components.Schemas.ShapeData; export type Theme = Components.Schemas.Theme; export type TypographyData = Components.Schemas.TypographyData; -export type UpdateDesignConflict = Components.Schemas.UpdateDesignConflict; export type UpdateDesignReq = Components.Schemas.UpdateDesignReq; export type UploadFileReq = Components.Schemas.UploadFileReq; export type UploadFileRes = Components.Schemas.UploadFileRes; From ea474bb89818acfe557a4cd73abd20e102888c6e Mon Sep 17 00:00:00 2001 From: Jakub Claude Date: Wed, 11 Nov 2026 08:52:24 +0000 Subject: [PATCH 3/3] chore(design-client): drop removed getLimit and getBrands operations Both endpoints were removed from svc-design-builder-api and are no longer in the prod spec. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HtDoULXUVaHMuES6rnCxLK --- .../design-client/src/openapi-runtime.json | 14 -- clients/design-client/src/openapi.d.ts | 82 ----------- clients/design-client/src/openapi.json | 130 ------------------ 3 files changed, 226 deletions(-) diff --git a/clients/design-client/src/openapi-runtime.json b/clients/design-client/src/openapi-runtime.json index beab6dd59..8062f742b 100644 --- a/clients/design-client/src/openapi-runtime.json +++ b/clients/design-client/src/openapi-runtime.json @@ -162,20 +162,6 @@ "responses": {} } }, - "/v1/designs/limit": { - "get": { - "deprecated": true, - "operationId": "getLimit", - "responses": {} - } - }, - "/v1/brands": { - "get": { - "deprecated": true, - "operationId": "getBrands", - "responses": {} - } - }, "/v1/designs/consumer/{application}/{consumerId}": { "get": { "operationId": "getConsumerDesign", diff --git a/clients/design-client/src/openapi.d.ts b/clients/design-client/src/openapi.d.ts index 940c7ade2..bb04639a3 100644 --- a/clients/design-client/src/openapi.d.ts +++ b/clients/design-client/src/openapi.d.ts @@ -599,17 +599,6 @@ declare namespace Components { * journey */ export type Application = string; - export interface BrandItem { - id: string; - name: string; - created_by?: string; - created_date?: string; - main_brand?: string; - organization_id?: string; - updated_date?: string; - updated_by?: string; - status?: string; - } export interface ConsumerData { widgets: (WidgetData)[]; customer_portals: (CustomerPortalData)[]; @@ -1092,19 +1081,6 @@ declare namespace Components { consumer?: ConsumerData; }[]; } - export interface GetBrandsRes { - brands?: { - id: string; - name: string; - created_by?: string; - created_date?: string; - main_brand?: string; - organization_id?: string; - updated_date?: string; - updated_by?: string; - status?: string; - }[]; - } export interface GetDesignRes { /** * Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet. @@ -2458,12 +2434,6 @@ declare namespace Paths { export type $500 = Components.Schemas.ErrorResp; } } - namespace GetBrands { - namespace Responses { - export type $200 = Components.Schemas.GetBrandsRes[]; - export type $500 = Components.Schemas.ErrorResp; - } - } namespace GetConsumerDesign { namespace Parameters { export type Application = /** @@ -2527,12 +2497,6 @@ declare namespace Paths { export type $500 = Components.Schemas.ErrorResp; } } - namespace GetLimit { - namespace Responses { - export type $200 = number; - export type $500 = Components.Schemas.ErrorResp; - } - } namespace GetThemeFromDesign { namespace Parameters { export type DesignId = /** @@ -2750,26 +2714,6 @@ export interface OperationMethods { data?: Paths.UploadFile.RequestBody, config?: AxiosRequestConfig ): OperationResponse - /** - * getLimit - getLimit - * - * Gets designs number limit from database per organization - */ - 'getLimit'( - parameters?: Parameters | null, - data?: any, - config?: AxiosRequestConfig - ): OperationResponse - /** - * getBrands - getBrands - * - * Scan all brands linked to a organization, based in orgId attribute from JWT auth token - */ - 'getBrands'( - parameters?: Parameters | null, - data?: any, - config?: AxiosRequestConfig - ): OperationResponse /** * getConsumerDesign - getConsumerDesign * @@ -2936,30 +2880,6 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } - ['/v1/designs/limit']: { - /** - * getLimit - getLimit - * - * Gets designs number limit from database per organization - */ - 'get'( - parameters?: Parameters | null, - data?: any, - config?: AxiosRequestConfig - ): OperationResponse - } - ['/v1/brands']: { - /** - * getBrands - getBrands - * - * Scan all brands linked to a organization, based in orgId attribute from JWT auth token - */ - 'get'( - parameters?: Parameters | null, - data?: any, - config?: AxiosRequestConfig - ): OperationResponse - } ['/v1/designs/consumer/{application}/{consumerId}']: { /** * getConsumerDesign - getConsumerDesign @@ -3005,7 +2925,6 @@ export type AddConsumerReq = Components.Schemas.AddConsumerReq; export type AddDesignReq = Components.Schemas.AddDesignReq; export type AddDesignRes = Components.Schemas.AddDesignRes; export type Application = Components.Schemas.Application; -export type BrandItem = Components.Schemas.BrandItem; export type ConsumerData = Components.Schemas.ConsumerData; export type Custom_Style = Components.Schemas.CustomStyle; export type CustomerPortalData = Components.Schemas.CustomerPortalData; @@ -3027,7 +2946,6 @@ export type GenerateDesignReq = Components.Schemas.GenerateDesignReq; export type GenerateDesignRes = Components.Schemas.GenerateDesignRes; export type GeneratedDesign = Components.Schemas.GeneratedDesign; export type GetAllDesignsRes = Components.Schemas.GetAllDesignsRes; -export type GetBrandsRes = Components.Schemas.GetBrandsRes; export type GetDesignRes = Components.Schemas.GetDesignRes; export type GetFilesRes = Components.Schemas.GetFilesRes; export type ItemMetada = Components.Schemas.ItemMetada; diff --git a/clients/design-client/src/openapi.json b/clients/design-client/src/openapi.json index bccf35dec..abf708a88 100644 --- a/clients/design-client/src/openapi.json +++ b/clients/design-client/src/openapi.json @@ -896,85 +896,6 @@ } } }, - "/v1/designs/limit": { - "get": { - "deprecated": true, - "operationId": "getLimit", - "x-epilot-permissions": [ - { - "access": "org" - } - ], - "summary": "getLimit", - "description": "Gets designs number limit from database per organization", - "tags": [ - "design-builder" - ], - "responses": { - "200": { - "description": "Success - limit loaded with success.", - "content": { - "application/json": { - "schema": { - "type": "number" - } - } - } - }, - "500": { - "description": "Other errors", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - } - } - } - }, - "/v1/brands": { - "get": { - "deprecated": true, - "operationId": "getBrands", - "x-epilot-permissions": [ - { - "access": "org" - } - ], - "summary": "getBrands", - "description": "Scan all brands linked to a organization, based in orgId attribute from JWT auth token", - "tags": [ - "design-builder" - ], - "responses": { - "200": { - "description": "Success - brands loaded with success. Empty array if org has no designs.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetBrandsRes" - } - } - } - } - }, - "500": { - "description": "Other errors", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResp" - } - } - } - } - } - } - }, "/v1/designs/consumer/{application}/{consumerId}": { "get": { "operationId": "getConsumerDesign", @@ -1342,21 +1263,6 @@ } } }, - "GetBrandsRes": { - "type": "object", - "properties": { - "brands": { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/BrandItem" - } - ] - } - } - } - }, "AddDesignReq": { "type": "object", "properties": { @@ -1578,42 +1484,6 @@ "style" ] }, - "BrandItem": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "created_by": { - "type": "string" - }, - "created_date": { - "type": "string" - }, - "main_brand": { - "type": "string" - }, - "organization_id": { - "type": "string" - }, - "updated_date": { - "type": "string" - }, - "updated_by": { - "type": "string" - }, - "status": { - "type": "string" - } - }, - "required": [ - "id", - "name" - ] - }, "Design_Document_V1": { "type": "object", "description": "Groups of the design document v1. A design is v1 when `version` is 1, otherwise it is the old shape (`style`, `design_tokens`, `custom_theme`). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps `style`, `design_tokens`, `custom_theme` and `use_custom_theme` as stored. The `journey` group is not accepted yet.",