From 71c4ae1c3822ede7533bfb7e37aee77360417e58 Mon Sep 17 00:00:00 2001 From: Thomas De Meyer Date: Fri, 14 Feb 2025 11:28:57 +0100 Subject: [PATCH 1/4] feat: updated FieldInput fields --- .../unreleased/Added-20250214-112754.yaml | 3 + Taskfile.yaml | 3 +- openapi.yaml | 169 ++++++++++++----- redocly.yaml | 1 + sbmgmt/main.gen.go | 159 +++++++++++----- schemas/components.yaml | 170 +++++++++++++----- 6 files changed, 371 insertions(+), 134 deletions(-) create mode 100644 .changes/unreleased/Added-20250214-112754.yaml diff --git a/.changes/unreleased/Added-20250214-112754.yaml b/.changes/unreleased/Added-20250214-112754.yaml new file mode 100644 index 0000000..8c0aaa8 --- /dev/null +++ b/.changes/unreleased/Added-20250214-112754.yaml @@ -0,0 +1,3 @@ +kind: Added +body: Updated FieldInput with additional fields +time: 2025-02-14T11:27:54.852745844+01:00 diff --git a/Taskfile.yaml b/Taskfile.yaml index 5f3462b..3f2de19 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -3,6 +3,5 @@ version: '3' tasks: generate: cmds: - - npx @redocly/cli bundle --output openapi.yaml - - oapi-codegen -config oapi-config.yaml openapi.yaml + - npx @redocly/cli bundle --config=redocly.yaml - go generate ./... diff --git a/openapi.yaml b/openapi.yaml index 7c40d00..7dc7691 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1573,167 +1573,248 @@ components: properties: type: type: string - description: The type of the field + description: The type of your field. pos: type: integer format: int64 - description: The position of the field + description: Position of the field in the component. add_https: type: boolean - description: 'Prepends https: to stop usage of relative protocol' + description: Prepends 'https:' to avoid relative protocol issues (image/file fields). default: false allow_target_blank: type: boolean - description: Allow target blank for links in richtext + description: Allows links in richtext to open in a new tab. default: false asset_folder_id: type: integer format: int64 - description: Default asset folder numeric id to store uploaded image of that field + description: Defines the asset folder for uploaded images (asset fields). can_sync: type: boolean - description: Advanced usage to sync with field in preview + description: Allows syncing with the field in preview (advanced usage). default: false component_whitelist: type: array items: type: string - description: 'Array of component/content type names: ["post","page","product"]' + description: Array of component names that can be used in bloks, multilink, or richtext. conditional_settings: type: array - description: Array containing the object with information about conditions set on the field + description: Array containing conditional settings for the field. items: $ref: '#/components/schemas/ConditionalSettings' customize_toolbar: type: boolean - description: Customize toolbar in richtext or markdown + description: True if richtext or markdown toolbar can be customized. default: false datasource_slug: type: string - description: Define selectable datasources string; Effects editor only if source=internal + description: Defines the selectable datasource for options (internal sources). default_value: type: string - description: Default value for the field; Can be an escaped JSON object + description: Default value for the field. description: type: string - description: Description shown in the editor interface + description: The description shown in the editor interface. display_name: type: string - description: Name of the field for the editor interface + description: Name used in the editor interface. disable_time: type: boolean - description: 'Disables time selection from date picker; Default: false' + description: Disables time selection for datetime fields. default: false external_datasource: type: string - description: Define external datasource JSON Url; Effects editor only if source=external + description: Defines external datasource URL for options. field_type: type: string - description: Name of the custom field type plugin + description: Name of the custom field type plugin (custom fields). filetypes: type: array items: type: string - description: 'Array of file type names: ["images", "videos", "audios", "texts"]' + description: Array of file types for multiasset fields (e.g., images, videos). filter_content_type: type: array items: type: string - description: 'An array of content types that can be selected in a option or options field where source is internal_stories: e.g. ["post", "faq_item"]' + description: Array of content types that can be selected in an option field. folder_slug: type: string - description: 'Filter on selectable stories path; Effects editor only if source=internal_stories; In case you have a multi-language folder structure you can add the ''{0}'' placeholder and the path will be adapted dynamically. Examples: "{0}/categories/", {0}/{1}/categories/' + description: Defines a folder filter for internal stories in options. force_link_scope: type: boolean - description: Force link scope to be internal or external + description: Forces folder restrictions in multilink fields. + default: false image_crop: type: boolean - description: 'Activate force crop for images: (true/false)' + description: Activates forced image cropping (image fields). image_height: type: string - description: Define height in px or height ratio if keep_image_size is enabled + description: Defines image height in pixels or ratio (image fields). image_width: type: string - description: Define width in px or width ratio if keep_image_size is enabled + description: Defines image width in pixels or ratio (image fields). keep_image_size: type: boolean - description: 'Keep original size: (true/false)' + description: Keeps the original image size (image fields). keys: type: array items: type: string - description: Array of field keys to include in this section + description: Array of field keys for group field types. link_scope: type: string - description: 'Filter on selectable stories path; In case you have a multi-language folder structure you can add the ''{0}'' placeholder and the path will be adapted dynamically. Examples: "{0}/categories/", {0}/{1}/categories/' + description: Defines folder filtering for multilink fields. + default: false max_length: type: integer format: int64 - description: Set the max length of the input string + description: Maximum length for text, textarea, or markdown fields. maximum: type: integer format: int64 - description: Maximum amount of bloks in this field + description: Maximum number of components for bloks type fields. minimum: type: integer format: int64 - description: Minimum amount of bloks in this field + description: Minimum number of components for bloks type fields. max_options: type: integer format: int64 - description: Maximum amount of options in this field + description: Maximum options that can be selected in an options field. min_options: type: integer format: int64 - description: Minimum amount of options in this field + description: Minimum options that should be selected in an options field. no_translate: type: boolean - description: Should be excluded in translation export + description: Excludes the field from translation export (for text and number types). options: type: array - description: Array of datasource entries [{name:"", value:""}]; Effects editor only if source=undefined + description: Array of data source entries for option fields. items: $ref: '#/components/schemas/FieldOption' toolbar: type: array items: type: string - description: Array of toolbar options + description: Array of enabled items when customizing the toolbar for richtext/markdown. tooltip: type: boolean - description: Show the description as a tooltip + description: True if description is shown as a tooltip. default: false regex: type: string - description: Client Regex validation for the field + description: Regex validation for text fields. required: type: boolean - description: 'Is field required; Default: false' + description: Is this field required? default: false restrict_components: type: boolean - description: 'Activate restriction nestable component option; Default: false' + description: Enables restriction for nestable components in bloks (for bloks and richtext). default: false restrict_content_types: type: boolean - description: Activate restriction content type option + description: Activates restriction for content types in multilink fields. rich_markdown: type: boolean - description: Enable rich markdown view by default (true/false) + description: Enables rich markdown view for markdown fields. rtl: type: boolean - description: Enable global RTL for this field + description: Enables RTL for markdown, text, or textarea fields. source: type: string - description: 'Possible values: undefined: Self; internal_stories: Stories; internal: Datasource; external: API Endpoint in Datasource Entries Array Format' + description: Defines where options are sourced from (e.g., internal stories, external APIs). translatable: type: boolean - description: 'Can field be translated; Default: false' + description: True if translation is enabled over the field. default: false use_uuid: type: boolean - description: 'Default: true; available in option and source=internal_stories' + description: Specifies if UUID should be used in options. default: true + restrict_type: + type: string + description: Restricts the type of components used in bloks fields (e.g., tags, groups). + component_tag_whitelist: + type: array + items: + type: integer + description: Array of tag IDs for restricting components in bloks fields. + component_group_whitelist: + type: array + items: + type: string + description: Array of group UUIDs for restricting components in bloks fields. + style_options: + type: array + items: + type: object + description: Custom CSS data for richtext fields. + allow_custom_attributes: + type: boolean + description: Enables custom attributes in links for richtext or multilink fields. + allow_multiline: + type: boolean + description: Enables empty paragraphs in markdown fields. + min_value: + type: integer + description: Minimum value for number fields. + max_value: + type: integer + description: Maximum value for number fields. + decimals: + type: integer + description: Number of decimal places for number fields. + steps: + type: integer + description: Step interval for number fields. + inline_label: + type: boolean + description: Makes the label of a boolean field inline. + exclude_empty_option: + type: boolean + description: Hides empty options in option fields. + entry_appearance: + type: string + description: Appearance of an option (link or card) in an option field. + default: link + allow_advanced_search: + type: boolean + description: Allows advanced search in option fields. + is_reference_type: + type: boolean + description: True if the options field is of type reference. + allow_external_url: + type: boolean + description: Allows external URLs in asset or multiasset fields. + email_link_type: + type: boolean + description: Allows emails in multilink fields. + default: false + asset_link_type: + type: boolean + description: Allows assets in multilink fields. + default: false + show_anchor: + type: boolean + description: Enables anchor field for internal links in multilink fields. + default: false + required_fields: + type: string + description: Comma-separated list of required fields for custom fields. + exclude_from_merge: + type: boolean + description: Excludes a blok from merge actions (Dimensions App). + exclude_from_overwrite: + type: boolean + description: Excludes a blok from overwrite actions (Dimensions App). + force_merge: + type: boolean + description: Forces overwriting a blok during a merge action (Dimensions App). required: - type - pos diff --git a/redocly.yaml b/redocly.yaml index cb09033..4a5fd19 100644 --- a/redocly.yaml +++ b/redocly.yaml @@ -1,5 +1,6 @@ apis: storyblok@latest: root: "source.yaml" + output: openapi.yaml extends: - recommended diff --git a/sbmgmt/main.gen.go b/sbmgmt/main.gen.go index 045ab8d..889314c 100644 --- a/sbmgmt/main.gen.go +++ b/sbmgmt/main.gen.go @@ -387,134 +387,205 @@ type DatasourceUpdateInput = DatasourceCreateInput // FieldInput defines model for FieldInput. type FieldInput struct { - // AddHttps Prepends https: to stop usage of relative protocol + // AddHttps Prepends 'https:' to avoid relative protocol issues (image/file fields). AddHttps *bool `json:"add_https,omitempty"` - // AllowTargetBlank Allow target blank for links in richtext + // AllowAdvancedSearch Allows advanced search in option fields. + AllowAdvancedSearch *bool `json:"allow_advanced_search,omitempty"` + + // AllowCustomAttributes Enables custom attributes in links for richtext or multilink fields. + AllowCustomAttributes *bool `json:"allow_custom_attributes,omitempty"` + + // AllowExternalUrl Allows external URLs in asset or multiasset fields. + AllowExternalUrl *bool `json:"allow_external_url,omitempty"` + + // AllowMultiline Enables empty paragraphs in markdown fields. + AllowMultiline *bool `json:"allow_multiline,omitempty"` + + // AllowTargetBlank Allows links in richtext to open in a new tab. AllowTargetBlank *bool `json:"allow_target_blank,omitempty"` - // AssetFolderId Default asset folder numeric id to store uploaded image of that field + // AssetFolderId Defines the asset folder for uploaded images (asset fields). AssetFolderId *int64 `json:"asset_folder_id,omitempty"` - // CanSync Advanced usage to sync with field in preview + // AssetLinkType Allows assets in multilink fields. + AssetLinkType *bool `json:"asset_link_type,omitempty"` + + // CanSync Allows syncing with the field in preview (advanced usage). CanSync *bool `json:"can_sync,omitempty"` - // ComponentWhitelist Array of component/content type names: ["post","page","product"] + // ComponentGroupWhitelist Array of group UUIDs for restricting components in bloks fields. + ComponentGroupWhitelist *[]string `json:"component_group_whitelist,omitempty"` + + // ComponentTagWhitelist Array of tag IDs for restricting components in bloks fields. + ComponentTagWhitelist *[]int `json:"component_tag_whitelist,omitempty"` + + // ComponentWhitelist Array of component names that can be used in bloks, multilink, or richtext. ComponentWhitelist *[]string `json:"component_whitelist,omitempty"` - // ConditionalSettings Array containing the object with information about conditions set on the field + // ConditionalSettings Array containing conditional settings for the field. ConditionalSettings *[]ConditionalSettings `json:"conditional_settings,omitempty"` - // CustomizeToolbar Customize toolbar in richtext or markdown + // CustomizeToolbar True if richtext or markdown toolbar can be customized. CustomizeToolbar *bool `json:"customize_toolbar,omitempty"` - // DatasourceSlug Define selectable datasources string; Effects editor only if source=internal + // DatasourceSlug Defines the selectable datasource for options (internal sources). DatasourceSlug *string `json:"datasource_slug,omitempty"` - // DefaultValue Default value for the field; Can be an escaped JSON object + // Decimals Number of decimal places for number fields. + Decimals *int `json:"decimals,omitempty"` + + // DefaultValue Default value for the field. DefaultValue *string `json:"default_value,omitempty"` - // Description Description shown in the editor interface + // Description The description shown in the editor interface. Description *string `json:"description,omitempty"` - // DisableTime Disables time selection from date picker; Default: false + // DisableTime Disables time selection for datetime fields. DisableTime *bool `json:"disable_time,omitempty"` - // DisplayName Name of the field for the editor interface + // DisplayName Name used in the editor interface. DisplayName *string `json:"display_name,omitempty"` - // ExternalDatasource Define external datasource JSON Url; Effects editor only if source=external + // EmailLinkType Allows emails in multilink fields. + EmailLinkType *bool `json:"email_link_type,omitempty"` + + // EntryAppearance Appearance of an option (link or card) in an option field. + EntryAppearance *string `json:"entry_appearance,omitempty"` + + // ExcludeEmptyOption Hides empty options in option fields. + ExcludeEmptyOption *bool `json:"exclude_empty_option,omitempty"` + + // ExcludeFromMerge Excludes a blok from merge actions (Dimensions App). + ExcludeFromMerge *bool `json:"exclude_from_merge,omitempty"` + + // ExcludeFromOverwrite Excludes a blok from overwrite actions (Dimensions App). + ExcludeFromOverwrite *bool `json:"exclude_from_overwrite,omitempty"` + + // ExternalDatasource Defines external datasource URL for options. ExternalDatasource *string `json:"external_datasource,omitempty"` - // FieldType Name of the custom field type plugin + // FieldType Name of the custom field type plugin (custom fields). FieldType *string `json:"field_type,omitempty"` - // Filetypes Array of file type names: ["images", "videos", "audios", "texts"] - Filetypes *[]string `json:"filetypes,omitempty"` + // Filetypes Array of file types for multiasset fields (e.g., images, videos). + Filetypes *[]string `json:"filetypes,omitempty"` + + // FilterContentType Array of content types that can be selected in an option field. FilterContentType *[]string `json:"filter_content_type,omitempty"` - // FolderSlug Filter on selectable stories path; Effects editor only if source=internal_stories; In case you have a multi-language folder structure you can add the '{0}' placeholder and the path will be adapted dynamically. Examples: "{0}/categories/", {0}/{1}/categories/ + // FolderSlug Defines a folder filter for internal stories in options. FolderSlug *string `json:"folder_slug,omitempty"` - // ForceLinkScope Force link scope to be internal or external + // ForceLinkScope Forces folder restrictions in multilink fields. ForceLinkScope *bool `json:"force_link_scope,omitempty"` - // ImageCrop Activate force crop for images: (true/false) + // ForceMerge Forces overwriting a blok during a merge action (Dimensions App). + ForceMerge *bool `json:"force_merge,omitempty"` + + // ImageCrop Activates forced image cropping (image fields). ImageCrop *bool `json:"image_crop,omitempty"` - // ImageHeight Define height in px or height ratio if keep_image_size is enabled + // ImageHeight Defines image height in pixels or ratio (image fields). ImageHeight *string `json:"image_height,omitempty"` - // ImageWidth Define width in px or width ratio if keep_image_size is enabled + // ImageWidth Defines image width in pixels or ratio (image fields). ImageWidth *string `json:"image_width,omitempty"` - // KeepImageSize Keep original size: (true/false) + // InlineLabel Makes the label of a boolean field inline. + InlineLabel *bool `json:"inline_label,omitempty"` + + // IsReferenceType True if the options field is of type reference. + IsReferenceType *bool `json:"is_reference_type,omitempty"` + + // KeepImageSize Keeps the original image size (image fields). KeepImageSize *bool `json:"keep_image_size,omitempty"` - // Keys Array of field keys to include in this section + // Keys Array of field keys for group field types. Keys *[]string `json:"keys,omitempty"` - // LinkScope Filter on selectable stories path; In case you have a multi-language folder structure you can add the '{0}' placeholder and the path will be adapted dynamically. Examples: "{0}/categories/", {0}/{1}/categories/ + // LinkScope Defines folder filtering for multilink fields. LinkScope *string `json:"link_scope,omitempty"` - // MaxLength Set the max length of the input string + // MaxLength Maximum length for text, textarea, or markdown fields. MaxLength *int64 `json:"max_length,omitempty"` - // MaxOptions Maximum amount of options in this field + // MaxOptions Maximum options that can be selected in an options field. MaxOptions *int64 `json:"max_options,omitempty"` - // Maximum Maximum amount of bloks in this field + // MaxValue Maximum value for number fields. + MaxValue *int `json:"max_value,omitempty"` + + // Maximum Maximum number of components for bloks type fields. Maximum *int64 `json:"maximum,omitempty"` - // MinOptions Minimum amount of options in this field + // MinOptions Minimum options that should be selected in an options field. MinOptions *int64 `json:"min_options,omitempty"` - // Minimum Minimum amount of bloks in this field + // MinValue Minimum value for number fields. + MinValue *int `json:"min_value,omitempty"` + + // Minimum Minimum number of components for bloks type fields. Minimum *int64 `json:"minimum,omitempty"` - // NoTranslate Should be excluded in translation export + // NoTranslate Excludes the field from translation export (for text and number types). NoTranslate *bool `json:"no_translate,omitempty"` - // Options Array of datasource entries [{name:"", value:""}]; Effects editor only if source=undefined + // Options Array of data source entries for option fields. Options *[]FieldOption `json:"options,omitempty"` - // Pos The position of the field + // Pos Position of the field in the component. Pos int64 `json:"pos"` - // Regex Client Regex validation for the field + // Regex Regex validation for text fields. Regex *string `json:"regex,omitempty"` - // Required Is field required; Default: false + // Required Is this field required? Required *bool `json:"required,omitempty"` - // RestrictComponents Activate restriction nestable component option; Default: false + // RequiredFields Comma-separated list of required fields for custom fields. + RequiredFields *string `json:"required_fields,omitempty"` + + // RestrictComponents Enables restriction for nestable components in bloks (for bloks and richtext). RestrictComponents *bool `json:"restrict_components,omitempty"` - // RestrictContentTypes Activate restriction content type option + // RestrictContentTypes Activates restriction for content types in multilink fields. RestrictContentTypes *bool `json:"restrict_content_types,omitempty"` - // RichMarkdown Enable rich markdown view by default (true/false) + // RestrictType Restricts the type of components used in bloks fields (e.g., tags, groups). + RestrictType *string `json:"restrict_type,omitempty"` + + // RichMarkdown Enables rich markdown view for markdown fields. RichMarkdown *bool `json:"rich_markdown,omitempty"` - // Rtl Enable global RTL for this field + // Rtl Enables RTL for markdown, text, or textarea fields. Rtl *bool `json:"rtl,omitempty"` - // Source Possible values: undefined: Self; internal_stories: Stories; internal: Datasource; external: API Endpoint in Datasource Entries Array Format + // ShowAnchor Enables anchor field for internal links in multilink fields. + ShowAnchor *bool `json:"show_anchor,omitempty"` + + // Source Defines where options are sourced from (e.g., internal stories, external APIs). Source *string `json:"source,omitempty"` - // Toolbar Array of toolbar options + // Steps Step interval for number fields. + Steps *int `json:"steps,omitempty"` + + // StyleOptions Custom CSS data for richtext fields. + StyleOptions *[]map[string]interface{} `json:"style_options,omitempty"` + + // Toolbar Array of enabled items when customizing the toolbar for richtext/markdown. Toolbar *[]string `json:"toolbar,omitempty"` - // Tooltip Show the description as a tooltip + // Tooltip True if description is shown as a tooltip. Tooltip *bool `json:"tooltip,omitempty"` - // Translatable Can field be translated; Default: false + // Translatable True if translation is enabled over the field. Translatable *bool `json:"translatable,omitempty"` - // Type The type of the field + // Type The type of your field. Type string `json:"type"` - // UseUuid Default: true; available in option and source=internal_stories + // UseUuid Specifies if UUID should be used in options. UseUuid *bool `json:"use_uuid,omitempty"` } diff --git a/schemas/components.yaml b/schemas/components.yaml index b93c9f7..4ff8193 100644 --- a/schemas/components.yaml +++ b/schemas/components.yaml @@ -138,167 +138,249 @@ FieldInput: properties: type: type: string - description: The type of the field + description: The type of your field. pos: type: integer format: int64 - description: The position of the field + description: Position of the field in the component. add_https: type: boolean - description: "Prepends https: to stop usage of relative protocol" + description: Prepends 'https:' to avoid relative protocol issues (image/file fields). default: false allow_target_blank: type: boolean - description: "Allow target blank for links in richtext" + description: Allows links in richtext to open in a new tab. default: false asset_folder_id: type: integer format: int64 - description: "Default asset folder numeric id to store uploaded image of that field" + description: Defines the asset folder for uploaded images (asset fields). can_sync: type: boolean - description: "Advanced usage to sync with field in preview" + description: Allows syncing with the field in preview (advanced usage). default: false component_whitelist: type: array items: type: string - description: 'Array of component/content type names: ["post","page","product"]' + description: Array of component names that can be used in bloks, multilink, or richtext. conditional_settings: type: array - description: "Array containing the object with information about conditions set on the field" + description: Array containing conditional settings for the field. items: $ref: "#/ConditionalSettings" customize_toolbar: type: boolean - description: "Customize toolbar in richtext or markdown" + description: True if richtext or markdown toolbar can be customized. default: false datasource_slug: type: string - description: "Define selectable datasources string; Effects editor only if source=internal" + description: Defines the selectable datasource for options (internal sources). default_value: type: string - description: "Default value for the field; Can be an escaped JSON object" + description: Default value for the field. description: type: string - description: "Description shown in the editor interface" + description: The description shown in the editor interface. display_name: type: string - description: "Name of the field for the editor interface" + description: Name used in the editor interface. disable_time: type: boolean - description: "Disables time selection from date picker; Default: false" + description: Disables time selection for datetime fields. default: false external_datasource: type: string - description: "Define external datasource JSON Url; Effects editor only if source=external" + description: Defines external datasource URL for options. field_type: type: string - description: "Name of the custom field type plugin" + description: Name of the custom field type plugin (custom fields). filetypes: type: array items: type: string - description: 'Array of file type names: ["images", "videos", "audios", "texts"]' + description: Array of file types for multiasset fields (e.g., images, videos). filter_content_type: type: array items: type: string - description: 'An array of content types that can be selected in a option or options field where source is internal_stories: e.g. ["post", "faq_item"]' + description: Array of content types that can be selected in an option field. folder_slug: type: string - description: 'Filter on selectable stories path; Effects editor only if source=internal_stories; In case you have a multi-language folder structure you can add the ''{0}'' placeholder and the path will be adapted dynamically. Examples: "{0}/categories/", {0}/{1}/categories/' + description: Defines a folder filter for internal stories in options. force_link_scope: type: boolean - description: "Force link scope to be internal or external" + description: Forces folder restrictions in multilink fields. + default: false image_crop: type: boolean - description: "Activate force crop for images: (true/false)" + description: Activates forced image cropping (image fields). image_height: type: string - description: "Define height in px or height ratio if keep_image_size is enabled" + description: Defines image height in pixels or ratio (image fields). image_width: type: string - description: "Define width in px or width ratio if keep_image_size is enabled" + description: Defines image width in pixels or ratio (image fields). keep_image_size: type: boolean - description: "Keep original size: (true/false)" + description: Keeps the original image size (image fields). keys: type: array items: type: string - description: "Array of field keys to include in this section" + description: Array of field keys for group field types. link_scope: type: string - description: 'Filter on selectable stories path; In case you have a multi-language folder structure you can add the ''{0}'' placeholder and the path will be adapted dynamically. Examples: "{0}/categories/", {0}/{1}/categories/' + description: Defines folder filtering for multilink fields. + default: false max_length: type: integer format: int64 - description: "Set the max length of the input string" + description: Maximum length for text, textarea, or markdown fields. maximum: type: integer format: int64 - description: "Maximum amount of bloks in this field" + description: Maximum number of components for bloks type fields. minimum: type: integer format: int64 - description: "Minimum amount of bloks in this field" + description: Minimum number of components for bloks type fields. max_options: type: integer format: int64 - description: "Maximum amount of options in this field" + description: Maximum options that can be selected in an options field. min_options: type: integer format: int64 - description: "Minimum amount of options in this field" + description: Minimum options that should be selected in an options field. no_translate: type: boolean - description: "Should be excluded in translation export" + description: Excludes the field from translation export (for text and number types). options: type: array - description: 'Array of datasource entries [{name:"", value:""}]; Effects editor only if source=undefined' + description: Array of data source entries for option fields. items: $ref: "#/FieldOption" toolbar: type: array items: type: string - description: "Array of toolbar options" + description: Array of enabled items when customizing the toolbar for richtext/markdown. tooltip: type: boolean - description: "Show the description as a tooltip" + description: True if description is shown as a tooltip. default: false regex: type: string - description: "Client Regex validation for the field" + description: Regex validation for text fields. required: type: boolean - description: "Is field required; Default: false" + description: Is this field required? default: false restrict_components: type: boolean - description: "Activate restriction nestable component option; Default: false" + description: Enables restriction for nestable components in bloks (for bloks and richtext). default: false restrict_content_types: type: boolean - description: "Activate restriction content type option" + description: Activates restriction for content types in multilink fields. rich_markdown: type: boolean - description: "Enable rich markdown view by default (true/false)" + description: Enables rich markdown view for markdown fields. rtl: type: boolean - description: "Enable global RTL for this field" + description: Enables RTL for markdown, text, or textarea fields. source: type: string - description: "Possible values: undefined: Self; internal_stories: Stories; internal: Datasource; external: API Endpoint in Datasource Entries Array Format" + description: Defines where options are sourced from (e.g., internal stories, external APIs). translatable: type: boolean - description: "Can field be translated; Default: false" + description: True if translation is enabled over the field. default: false use_uuid: type: boolean - description: "Default: true; available in option and source=internal_stories" + description: Specifies if UUID should be used in options. default: true + restrict_type: + type: string + description: Restricts the type of components used in bloks fields (e.g., tags, + groups). + component_tag_whitelist: + type: array + items: + type: integer + description: Array of tag IDs for restricting components in bloks fields. + component_group_whitelist: + type: array + items: + type: string + description: Array of group UUIDs for restricting components in bloks fields. + style_options: + type: array + items: + type: object + description: Custom CSS data for richtext fields. + allow_custom_attributes: + type: boolean + description: Enables custom attributes in links for richtext or multilink fields. + allow_multiline: + type: boolean + description: Enables empty paragraphs in markdown fields. + min_value: + type: integer + description: Minimum value for number fields. + max_value: + type: integer + description: Maximum value for number fields. + decimals: + type: integer + description: Number of decimal places for number fields. + steps: + type: integer + description: Step interval for number fields. + inline_label: + type: boolean + description: Makes the label of a boolean field inline. + exclude_empty_option: + type: boolean + description: Hides empty options in option fields. + entry_appearance: + type: string + description: Appearance of an option (link or card) in an option field. + default: link + allow_advanced_search: + type: boolean + description: Allows advanced search in option fields. + is_reference_type: + type: boolean + description: True if the options field is of type reference. + allow_external_url: + type: boolean + description: Allows external URLs in asset or multiasset fields. + email_link_type: + type: boolean + description: Allows emails in multilink fields. + default: false + asset_link_type: + type: boolean + description: Allows assets in multilink fields. + default: false + show_anchor: + type: boolean + description: Enables anchor field for internal links in multilink fields. + default: false + required_fields: + type: string + description: Comma-separated list of required fields for custom fields. + exclude_from_merge: + type: boolean + description: Excludes a blok from merge actions (Dimensions App). + exclude_from_overwrite: + type: boolean + description: Excludes a blok from overwrite actions (Dimensions App). + force_merge: + type: boolean + description: Forces overwriting a blok during a merge action (Dimensions App). required: - type - pos From f4eab2451f6b0f0f903feba1e6e4d5320e2be238 Mon Sep 17 00:00:00 2001 From: Thomas De Meyer Date: Fri, 14 Feb 2025 12:04:54 +0100 Subject: [PATCH 2/4] feat: updated to go 1.21 and oapi-codegen v2 --- .gitignore | 1 + generate.go | 2 +- go.mod | 4 +- go.sum | 19 +- openapi.yaml | 2319 -------------------------------------------- redocly.yaml | 2 +- sbmgmt/main.gen.go | 2 +- 7 files changed, 23 insertions(+), 2326 deletions(-) delete mode 100644 openapi.yaml diff --git a/.gitignore b/.gitignore index 3eb952d..0bc82cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ main .env /.idea +openapi.generated.yaml \ No newline at end of file diff --git a/generate.go b/generate.go index 46fd2a0..8af40ac 100644 --- a/generate.go +++ b/generate.go @@ -1,3 +1,3 @@ package main -//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config oapi-config.yaml ./openapi.yaml +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config oapi-config.yaml ./openapi.generated.yaml diff --git a/go.mod b/go.mod index 72c267c..a5da99b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/labd/storyblok-go-sdk -go 1.20 +go 1.21.0 require ( github.com/gofrs/uuid v4.4.0+incompatible @@ -20,7 +20,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/invopop/yaml v0.3.1 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect + github.com/mailru/easyjson v0.9.0 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/speakeasy-api/openapi-overlay v0.9.0 // indirect diff --git a/go.sum b/go.sum index 43a3a4d..0c7fd6c 100644 --- a/go.sum +++ b/go.sum @@ -26,6 +26,7 @@ github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+Gr github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -42,6 +43,7 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -54,11 +56,13 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= +github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -80,11 +84,13 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= +github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/speakeasy-api/openapi-overlay v0.9.0 h1:Wrz6NO02cNlLzx1fB093lBlYxSI54VRhy1aSutx0PQg= @@ -95,7 +101,9 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk= github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= @@ -107,6 +115,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -115,10 +124,12 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -134,6 +145,7 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -147,6 +159,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= +golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -162,6 +176,7 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= diff --git a/openapi.yaml b/openapi.yaml deleted file mode 100644 index 7dc7691..0000000 --- a/openapi.yaml +++ /dev/null @@ -1,2319 +0,0 @@ -openapi: 3.0.0 -info: - title: Storyblok Managmenet OpenAPI Specs - description: | - Unofficial Storyblok Management OpenAPI Specs. Generated from - https://www.storyblok.com/docs/api/management/v1 by mostly ChatGPT ;-) - version: 0.0.1 -security: - - BearerAuth: [] -paths: - /v1/spaces/: - post: - summary: Create a space - description: Create a space - operationId: createSpace - tags: - - spaces - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SpaceCreateInput' - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - space: - $ref: '#/components/schemas/Space' - get: - summary: List spaces - description: Retrieve a list of spaces - operationId: listSpaces - tags: - - spaces - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - spaces: - type: array - items: - $ref: '#/components/schemas/Space' - /v1/spaces/{space_id}/: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - get: - summary: Get a space - description: Get a space - operationId: getSpace - tags: - - spaces - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - space: - $ref: '#/components/schemas/Space' - put: - summary: Update a space - description: Update a space - operationId: updateSpace - tags: - - spaces - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SpaceUpdateInput' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - space: - $ref: '#/components/schemas/Space' - delete: - summary: Delete a space - description: Delete a space - operationId: deleteSpace - tags: - - spaces - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - space: - $ref: '#/components/schemas/Space' - post: - summary: Duplicate a space - description: Duplicate a space - operationId: duplicateSpace - tags: - - spaces - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SpaceDuplicateInput' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - space: - $ref: '#/components/schemas/Space' - /v1/spaces/{space_id}/backups/: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - post: - summary: Backup a space - description: Backup a space - operationId: backupSpace - tags: - - spaces - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - space: - $ref: '#/components/schemas/Space' - /v1/spaces/{space_id}/components/: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - post: - summary: Create a component - description: Create a component - operationId: createComponent - tags: - - components - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ComponentCreateInput' - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - component: - $ref: '#/components/schemas/Component' - get: - summary: List components - description: Retrieve a list of components - operationId: listComponents - tags: - - components - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - components: - type: array - items: - $ref: '#/components/schemas/Component' - /v1/spaces/{space_id}/components/{id}: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Get a component - description: Get a component - operationId: getComponent - tags: - - components - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - component: - $ref: '#/components/schemas/Component' - put: - summary: Update a component - description: Update a component - operationId: updateComponent - tags: - - components - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ComponentUpdateInput' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - component: - $ref: '#/components/schemas/Component' - delete: - summary: Delete a component - description: Delete a component - operationId: deleteComponent - tags: - - components - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - component: - $ref: '#/components/schemas/Component' - /v1/spaces/{space_id}/component_groups/: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - post: - summary: Create a component group - description: Create a component group - operationId: createComponentGroup - tags: - - component group - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ComponentGroupCreateInput' - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - component_group: - $ref: '#/components/schemas/ComponentGroup' - get: - summary: List component group - description: Retrieve a list of component group - operationId: listComponentGroups - tags: - - component groups - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - component_groups: - type: array - items: - $ref: '#/components/schemas/ComponentGroup' - /v1/spaces/{space_id}/component_groups/{id}: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Get a component group - description: Get a component group - operationId: getComponentGroup - tags: - - component groups - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - component_group: - $ref: '#/components/schemas/ComponentGroup' - put: - summary: Update a component group - description: Update a component group - operationId: updateComponentGroup - tags: - - component groups - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ComponentGroupUpdateInput' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - component_group: - $ref: '#/components/schemas/ComponentGroup' - delete: - summary: Delete a component group - description: Delete a component group - operationId: deleteComponentGroup - tags: - - component groups - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - component_group: - $ref: '#/components/schemas/ComponentGroup' - /v1/spaces/{space_id}/asset_folders/: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - post: - summary: Create a asset folder - description: Create a asset folder - operationId: createAssetFolder - tags: - - asset folder - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AssetFolderCreateInput' - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - asset_folder: - $ref: '#/components/schemas/AssetFolder' - get: - summary: List asset folder - description: Retrieve a list of asset folder - operationId: listAssetFolders - tags: - - asset folders - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - asset_folders: - type: array - items: - $ref: '#/components/schemas/AssetFolder' - /v1/spaces/{space_id}/asset_folders/{id}: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Get a asset folder - description: Get a asset folder - operationId: getAssetFolder - tags: - - asset folders - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - asset_folder: - $ref: '#/components/schemas/AssetFolder' - put: - summary: Update a asset folder - description: Update a asset folder - operationId: updateAssetFolder - tags: - - asset folders - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AssetFolderUpdateInput' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - asset_folder: - $ref: '#/components/schemas/AssetFolder' - delete: - summary: Delete a asset folder - description: Delete a asset folder - operationId: deleteAssetFolder - tags: - - asset folders - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - asset_folder: - $ref: '#/components/schemas/AssetFolder' - /v1/spaces/{space_id}/datasources/: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - post: - summary: Create a datasource - description: Create a datasource - operationId: createDatasource - tags: - - datasource - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DatasourceCreateInput' - responses: - '201': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Datasource' - get: - summary: List datasource - description: Retrieve a list of datasource - operationId: listDatasources - tags: - - datasources - responses: - '200': - description: OK - headers: - schema: - allOf: - - $ref: ../schemas/pagination.yaml#/pagination - - type: object - properties: - by_slug: - type: string - search: - type: string - content: - application/json: - schema: - type: object - properties: - datasources: - type: array - items: - $ref: '#/components/schemas/Datasource' - /v1/spaces/{space_id}/datasources/{id}: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Get a datasource - description: Get a datasource - operationId: getDatasource - tags: - - datasources - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - datasource: - $ref: '#/components/schemas/Datasource' - put: - summary: Update a datasource - description: Update a datasource - operationId: updateDatasource - tags: - - datasources - requestBody: - content: - application/json: - schema: - type: object - properties: - datasource: - $ref: '#/components/schemas/DatasourceUpdateInput' - responses: - '200': - description: OK - content: - application/json: - schema: - type: null - properties: - datasource: - $ref: '#/components/schemas/Datasource' - delete: - summary: Delete a datasource - description: Delete a datasource - operationId: deleteDatasource - tags: - - datasources - responses: - '200': - description: OK - content: - application/json: - schema: - type: null - properties: - datasource: - $ref: '#/components/schemas/Datasource' - /v1/spaces/{space_id}/datasource_entries/: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - post: - summary: Create a datasource entry - description: Create a datasource entry - operationId: createDatasourceEntry - tags: - - datasource_entries - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DatasourceEntryCreateInput' - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - datasource_entry: - $ref: '#/components/schemas/DatasourceEntry' - get: - summary: List datasource entries - description: Retrieve a list of datasource entries - operationId: listDatasourceEntries - tags: - - datasource_entries - responses: - '200': - description: OK - headers: - schema: - $ref: '#/components/headers/pagination' - content: - application/json: - schema: - type: object - properties: - datasource_entries: - type: array - items: - $ref: '#/components/schemas/DatasourceEntry' - /v1/spaces/{space_id}/datasource_entries/{id}: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Get a datasource entry - description: Get a datasource entry - operationId: getDatasourceEntry - tags: - - datasource_entries - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - datasource_entry: - $ref: '#/components/schemas/DatasourceEntry' - put: - summary: Update a datasource entry - description: Update a datasource entry - operationId: updateDatasourceEntry - tags: - - datasource_entries - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DatasourceEntryUpdateInput' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - datasource_entry: - $ref: '#/components/schemas/DatasourceEntry' - delete: - summary: Delete a datasource entry - description: Delete a datasource entry - operationId: deleteDatasourceEntry - tags: - - datasource_entries - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - datasource_entry: - $ref: '#/components/schemas/DatasourceEntry' - /v1/spaces/{space_id}/webhook_endpoints/: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - post: - summary: Create a webhook endpoint - description: Create a webhook endpoint - operationId: createWebhook - tags: - - webhooks - requestBody: - content: - application/json: - schema: - type: object - properties: - webhook_endpoint: - $ref: '#/components/schemas/WebhookCreateInput' - required: - - webhook_endpoint - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - webhook_endpoint: - $ref: '#/components/schemas/Webhook' - required: - - webhook_endpoint - /v1/spaces/{space_id}/webhook_endpoints/{id}: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Get a webhook - description: Get a webhook - operationId: getWebhook - tags: - - webhooks - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - webhook_endpoint: - $ref: '#/components/schemas/Webhook' - required: - - webhook_endpoint - put: - summary: Update webhook - description: Update webhook - operationId: updateWebhook - tags: - - Webhooks - requestBody: - content: - application/json: - schema: - type: object - properties: - webhook_endpoint: - $ref: '#/components/schemas/WebhookUpdateInput' - required: - - webhook_endpoint - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - webhook_endpoint: - $ref: '#/components/schemas/Webhook' - required: - - webhook_endpoint - delete: - summary: Delete a webhook - description: Delete a webhook - operationId: deleteWebhook - tags: - - webhooks - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - webhook_endpoint: - $ref: '#/components/schemas/Webhook' - required: - - webhook_endpoint - /v1/spaces/{space_id}/stories/: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - post: - summary: Create a story - description: Create a story - operationId: createStory - tags: - - story - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/StoryCreateInput' - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - story: - $ref: '#/components/schemas/Story' - get: - summary: List story - description: Retrieve a list of story - operationId: listStories - tags: - - stories - responses: - '200': - description: OK - headers: - schema: - allOf: - - $ref: ../schemas/pagination.yaml#/pagination - - type: object - properties: - contain_component: - type: string - text_search: - type: string - sort_by: - type: string - pinned: - type: string - excluding_ids: - type: string - by_ids: - type: string - by_uuids: - type: string - with_tag: - type: string - folder_only: - type: string - story_only: - type: string - with_parent: - type: string - with_slug: - type: string - starts_with: - type: string - in_trash: - type: string - search: - type: string - filter_query: - type: string - in_release: - type: string - is_published: - type: string - content: - application/json: - schema: - type: object - properties: - stories: - type: array - items: - $ref: '#/components/schemas/Story' - /v1/spaces/{space_id}/stories/{id}: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Get a story - description: Get a story - operationId: getStory - tags: - - stories - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - story: - $ref: '#/components/schemas/Story' - put: - summary: Update a story - description: Update a story - operationId: updateStory - tags: - - stories - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/StoryUpdateInput' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - story: - $ref: '#/components/schemas/Story' - delete: - summary: Delete a story - description: Delete a story - operationId: deleteStory - tags: - - stories - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - story: - $ref: '#/components/schemas/Story' - /spaces/{space_id}/stories/{id}/publish: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Publish a story - description: Publish a story - operationId: publishStory - tags: - - stories - responses: - '200': - description: OK - headers: - schema: - type: object - properties: - release_id: - type: string - lang: - type: string - content: - application/json: - schema: - type: object - properties: - story: - $ref: '#/components/schemas/Story' - /spaces/{space_id}/stories/{id}/unpublish: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Unpublish a story - description: Unpublish a story - operationId: unpublishStory - tags: - - stories - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - story: - $ref: '#/components/schemas/Story' - /spaces/{space_id}/stories/{id}/compare: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Compare with a version of a story - description: Compare with a version of a story - operationId: compareStory - tags: - - stories - responses: - '200': - description: OK - headers: - schema: - type: object - properties: - version: - type: string - content: - application/json: - schema: - type: array - items: - type: array - items: - type: string - /spaces/{space_id}/stories/{id}/versions: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/idParam' - get: - summary: Get versions of a story - description: Get versions of a story - operationId: versionsStory - tags: - - stories - responses: - '200': - description: OK - headers: - schema: - type: object - properties: - page: - type: string - id: - type: string - event: - type: string - created_at: - type: string - author_id: - type: string - author: - type: string - item_id: - type: string - is_draft: - type: string - content: - application/json: - schema: - type: object - properties: - versions: - type: array - items: - $ref: '#/components/schemas/Version' - /v1/spaces/{space_id}/space_roles: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - post: - summary: Create a Space Role - description: Create a Space Role - operationId: createSpaceRole - tags: - - space_roles - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SpaceRoleCreateInput' - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - space_role: - $ref: '#/components/schemas/SpaceRole' - get: - summary: Retrieve multiple Space Roles - description: Returns an array of space role objects. - operationId: getMultipleSpaceRoles - tags: - - space_roles - responses: - '200': - description: OK - content: - application/json: - schema: - type: array - items: - type: object - properties: - space_role: - $ref: '#/components/schemas/SpaceRole' - /v1/spaces/{space_id}/space_roles/{space_role_id}: - parameters: - - $ref: '#/components/parameters/spaceIdParam' - - $ref: '#/components/parameters/spaceRoleIdParam' - get: - summary: Retrieve one Space Role - description: Retrieve one Space Role - operationId: getSpaceRole - tags: - - space_roles - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - space_role: - $ref: '#/components/schemas/SpaceRole' - put: - summary: Update a Space Role - description: Update a Space Role - operationId: updateSpaceRole - tags: - - space_roles - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SpaceRoleUpdateInput' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - space_role: - $ref: '#/components/schemas/SpaceRole' - delete: - summary: Delete a Space Role - description: Delete a Space Role - operationId: deleteSpaceRole - tags: - - space_roles - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - space_role: - $ref: '#/components/schemas/SpaceRole' -components: - securitySchemes: - BearerAuth: - type: http - scheme: bearer - parameters: - spaceIdParam: - in: path - name: space_id - required: true - schema: - type: integer - format: int64 - description: The ID of the space - idParam: - in: path - name: id - schema: - type: integer - format: int64 - required: true - description: The ID of the component group to retrieve - spaceRoleIdParam: - in: path - name: space_role_id - required: true - schema: - type: integer - format: int64 - description: The ID of the space role - schemas: - AssetFolderCreateInput: - type: object - properties: - asset_folder: - $ref: '#/components/schemas/AssetFolderBase' - required: - - asset_folder - AssetFolderUpdateInput: - type: object - allOf: - - $ref: '#/components/schemas/AssetFolderCreateInput' - AssetFolder: - type: object - description: A asset folder can be used to group components together. Each component can have only one asset folder. - allOf: - - $ref: '#/components/schemas/AssetFolderBase' - - type: object - properties: - id: - type: integer - format: int64 - description: The ID of the asset folder - uuid: - type: string - description: The UUID of the asset folder - parent_uuid: - type: string - description: The UUID of the asset folder - required: - - id - - uuid - ComponentGroupCreateInput: - type: object - properties: - component_group: - $ref: '#/components/schemas/ComponentGroupBase' - required: - - component_group - ComponentGroupUpdateInput: - type: object - allOf: - - $ref: '#/components/schemas/ComponentGroupCreateInput' - ComponentGroup: - type: object - description: A component group can be used to group components together. Each component can have only one component group. - allOf: - - $ref: '#/components/schemas/ComponentGroupBase' - - type: object - properties: - id: - type: integer - format: int64 - description: The ID of the component group - uuid: - type: string - format: uuid - description: The UUID of the component group - x-go-type: uuid.UUID - x-go-type-import: - name: uuid - path: github.com/gofrs/uuid - required: - - id - - uuid - ComponentCreateInput: - type: object - properties: - component: - $ref: '#/components/schemas/ComponentBase' - required: - - component - ComponentUpdateInput: - type: object - allOf: - - $ref: '#/components/schemas/ComponentCreateInput' - Component: - type: object - description: A component is a standalone entity that is meaningful in its own right. While components (or bloks) can be nested in each other, semantically they remain equal. Each component is a small piece of your data structure which can be filled with content or nested by your content editor. One component can consist of as many field types as required. - allOf: - - $ref: '#/components/schemas/ComponentBase' - - type: object - properties: - id: - type: integer - format: int64 - description: The ID of the component - created_at: - type: string - format: date-time - description: The creation timestamp of the component - updated_at: - type: string - format: date-time - description: The update timestamp of the component - preset_id: - type: string - description: The ID of the preset associated with the component (null if not set) - real_name: - type: string - description: The real name of the component - required: - - id - - created_at - - updated_at - DatasourceEntryCreateInput: - type: object - properties: - datasource_entry: - $ref: '#/components/schemas/DatasourceEntryBase' - required: - - datasource_entry - DatasourceEntryUpdateInput: - type: object - allOf: - - $ref: '#/components/schemas/DatasourceEntryCreateInput' - DatasourceEntry: - type: object - description: 'The actual KEY/VALUE pair object a datasource consists of. One specific datasource entry is a set of two linked data items: a key, which is a unique identifier for the item of data scoped in the data source, and the value, which is the data that is identified.' - allOf: - - $ref: '#/components/schemas/DatasourceEntryBase' - - type: object - properties: - id: - type: integer - format: int64 - description: The ID of the datasource entry - required: - - id - - name - DatasourceCreateInput: - type: object - properties: - datasource: - $ref: '#/components/schemas/DatasourceBase' - required: - - datasource - DatasourceUpdateInput: - type: object - allOf: - - $ref: '#/components/schemas/DatasourceCreateInput' - Datasource: - type: object - description: A datasource is a collection of datasource entries with a specific name and slug. Each datasource entry is a collection of key-value pairs (KVP), so called datasource entries. Those key-value pairs can be used for a single choice, multiple choice options and as well directly through our API to use them for multi-language labels, categories, or anything similar. - allOf: - - $ref: '#/components/schemas/DatasourceBase' - - type: object - properties: - id: - type: integer - format: int64 - description: The ID of the datasource - created_at: - type: string - format: date-time - description: The creation timestamp of the datasource - updated_at: - type: string - format: date-time - description: The update timestamp of the datasource - required: - - id - - name - - slug - - created_at - - updated_at - - dimensions - SpaceCreateInput: - type: object - properties: - space: - $ref: '#/components/schemas/SpaceBase' - required: - - space - SpaceUpdateInput: - type: object - allOf: - - $ref: '#/components/schemas/SpaceCreateInput' - - type: object - properties: - id: - type: integer - format: int64 - description: The ID of the space - uniq_domain: - type: string - description: The unique domain of the space (null if not set) - owner_id: - type: integer - description: The ID of the owner of the space - parent_id: - type: integer - description: The ID of the parent space (null if not set) - duplicatable: - type: string - description: Indicates whether the space is duplicatable (null if not set) - default_root: - type: string - description: The default root of the space - options: - type: object - description: The options of the space - additionalProperties: {} - routes: - type: array - items: {} - description: An array of routes - billing_address: - type: object - description: The billing address of the space - additionalProperties: {} - Space: - type: object - allOf: - - $ref: '#/components/schemas/SpaceBase' - - type: object - properties: - plan: - type: string - description: The plan of the space - plan_level: - type: integer - description: The plan level of the space - limits: - type: object - description: The limits of the space - additionalProperties: {} - created_at: - type: string - format: date-time - description: The creation timestamp of the space - updated_at: - type: string - format: date-time - description: The update timestamp of the space - role: - type: string - description: The role of the user in the space - stories_count: - type: integer - description: The count of stories in the space - assets_count: - type: integer - description: The count of assets in the space - request_count_today: - type: integer - description: The count of requests made today - api_requests: - type: integer - description: The total number of API requests allowed - exceeded_requests: - type: integer - description: The count of exceeded API requests - euid: - type: string - description: The EUID of the space (null if not set) - trial: - type: boolean - description: Indicates whether the space is in trial mode - has_slack_webhook: - type: boolean - description: Indicates whether the space has a Slack webhook - api_logs_per_month: - type: array - items: {} - description: An array of API logs per month - first_token: - type: string - description: The first token of the space - has_pending_tasks: - type: boolean - description: Indicates whether the space has pending tasks - options: - type: object - description: The options of the space - additionalProperties: {} - collaborators: - type: array - items: {} - description: An array of collaborators - settings: - type: array - items: {} - description: An array of settings - owner: - type: object - description: The owner of the space - additionalProperties: {} - required: - - name - - domain - - plan - - plan_level - - created_at - - updated_at - - id - - role - - owner_id - - stories_count - - assets_count - - request_count_today - - api_requests - - exceeded_requests - - trial - - routes - - default_root - - has_slack_webhook - - api_logs_per_month - - first_token - - has_pending_tasks - - options - - collaborators - - settings - - owner - SpaceRoleCreateInput: - type: object - properties: - space_role: - $ref: '#/components/schemas/SpaceRoleBase' - SpaceRoleUpdateInput: - type: object - properties: - space_role: - $ref: '#/components/schemas/SpaceRoleBase' - SpaceRole: - allOf: - - $ref: '#/components/schemas/SpaceRoleBase' - - type: object - properties: - id: - type: integer - description: Numeric Unique ID - required: - - id - SpaceBase: - type: object - properties: - name: - type: string - description: The name of the space - domain: - type: string - description: The domain of the space - story_published_hook: - type: string - description: The story published hook of the space (null if not set) - searchblok_id: - type: string - description: The Searchblok ID of the space (null if not set) - environments: - type: string - description: The environments of the space (null if not set) - required: - - name - SpaceDuplicateInput: - type: object - properties: - space: - $ref: '#/components/schemas/SpaceBase' - dup_id: - type: integer - description: The numeric id of the original space - required: - - space - Modification: - type: object - properties: - display: - type: string - enum: - - hide - required: - type: boolean - ValidatedObject: - type: object - properties: - type: - type: string - enum: - - field - field_key: - type: string - field_attr: - type: string - enum: - - value - RuleCondition: - type: object - properties: - validated_object: - $ref: '#/components/schemas/ValidatedObject' - validation: - type: string - enum: - - empty - - not_empty - - equals - - not_equals - value: - type: string - nullable: true - ConditionalSettings: - type: object - properties: - modifications: - type: array - description: List of modifications to be applied to the field. Only 1 modification can be applied at a time (hide OR required) - items: - $ref: '#/components/schemas/Modification' - rule_match: - description: Define if all or any of the conditions should be met to apply the modifications - type: string - enum: - - any - - all - rule_conditions: - description: Conditional rules to be applied to the field - type: array - items: - $ref: '#/components/schemas/RuleCondition' - FieldOption: - type: object - properties: - name: - type: string - value: - type: string - required: - - name - - value - FieldInput: - type: object - properties: - type: - type: string - description: The type of your field. - pos: - type: integer - format: int64 - description: Position of the field in the component. - add_https: - type: boolean - description: Prepends 'https:' to avoid relative protocol issues (image/file fields). - default: false - allow_target_blank: - type: boolean - description: Allows links in richtext to open in a new tab. - default: false - asset_folder_id: - type: integer - format: int64 - description: Defines the asset folder for uploaded images (asset fields). - can_sync: - type: boolean - description: Allows syncing with the field in preview (advanced usage). - default: false - component_whitelist: - type: array - items: - type: string - description: Array of component names that can be used in bloks, multilink, or richtext. - conditional_settings: - type: array - description: Array containing conditional settings for the field. - items: - $ref: '#/components/schemas/ConditionalSettings' - customize_toolbar: - type: boolean - description: True if richtext or markdown toolbar can be customized. - default: false - datasource_slug: - type: string - description: Defines the selectable datasource for options (internal sources). - default_value: - type: string - description: Default value for the field. - description: - type: string - description: The description shown in the editor interface. - display_name: - type: string - description: Name used in the editor interface. - disable_time: - type: boolean - description: Disables time selection for datetime fields. - default: false - external_datasource: - type: string - description: Defines external datasource URL for options. - field_type: - type: string - description: Name of the custom field type plugin (custom fields). - filetypes: - type: array - items: - type: string - description: Array of file types for multiasset fields (e.g., images, videos). - filter_content_type: - type: array - items: - type: string - description: Array of content types that can be selected in an option field. - folder_slug: - type: string - description: Defines a folder filter for internal stories in options. - force_link_scope: - type: boolean - description: Forces folder restrictions in multilink fields. - default: false - image_crop: - type: boolean - description: Activates forced image cropping (image fields). - image_height: - type: string - description: Defines image height in pixels or ratio (image fields). - image_width: - type: string - description: Defines image width in pixels or ratio (image fields). - keep_image_size: - type: boolean - description: Keeps the original image size (image fields). - keys: - type: array - items: - type: string - description: Array of field keys for group field types. - link_scope: - type: string - description: Defines folder filtering for multilink fields. - default: false - max_length: - type: integer - format: int64 - description: Maximum length for text, textarea, or markdown fields. - maximum: - type: integer - format: int64 - description: Maximum number of components for bloks type fields. - minimum: - type: integer - format: int64 - description: Minimum number of components for bloks type fields. - max_options: - type: integer - format: int64 - description: Maximum options that can be selected in an options field. - min_options: - type: integer - format: int64 - description: Minimum options that should be selected in an options field. - no_translate: - type: boolean - description: Excludes the field from translation export (for text and number types). - options: - type: array - description: Array of data source entries for option fields. - items: - $ref: '#/components/schemas/FieldOption' - toolbar: - type: array - items: - type: string - description: Array of enabled items when customizing the toolbar for richtext/markdown. - tooltip: - type: boolean - description: True if description is shown as a tooltip. - default: false - regex: - type: string - description: Regex validation for text fields. - required: - type: boolean - description: Is this field required? - default: false - restrict_components: - type: boolean - description: Enables restriction for nestable components in bloks (for bloks and richtext). - default: false - restrict_content_types: - type: boolean - description: Activates restriction for content types in multilink fields. - rich_markdown: - type: boolean - description: Enables rich markdown view for markdown fields. - rtl: - type: boolean - description: Enables RTL for markdown, text, or textarea fields. - source: - type: string - description: Defines where options are sourced from (e.g., internal stories, external APIs). - translatable: - type: boolean - description: True if translation is enabled over the field. - default: false - use_uuid: - type: boolean - description: Specifies if UUID should be used in options. - default: true - restrict_type: - type: string - description: Restricts the type of components used in bloks fields (e.g., tags, groups). - component_tag_whitelist: - type: array - items: - type: integer - description: Array of tag IDs for restricting components in bloks fields. - component_group_whitelist: - type: array - items: - type: string - description: Array of group UUIDs for restricting components in bloks fields. - style_options: - type: array - items: - type: object - description: Custom CSS data for richtext fields. - allow_custom_attributes: - type: boolean - description: Enables custom attributes in links for richtext or multilink fields. - allow_multiline: - type: boolean - description: Enables empty paragraphs in markdown fields. - min_value: - type: integer - description: Minimum value for number fields. - max_value: - type: integer - description: Maximum value for number fields. - decimals: - type: integer - description: Number of decimal places for number fields. - steps: - type: integer - description: Step interval for number fields. - inline_label: - type: boolean - description: Makes the label of a boolean field inline. - exclude_empty_option: - type: boolean - description: Hides empty options in option fields. - entry_appearance: - type: string - description: Appearance of an option (link or card) in an option field. - default: link - allow_advanced_search: - type: boolean - description: Allows advanced search in option fields. - is_reference_type: - type: boolean - description: True if the options field is of type reference. - allow_external_url: - type: boolean - description: Allows external URLs in asset or multiasset fields. - email_link_type: - type: boolean - description: Allows emails in multilink fields. - default: false - asset_link_type: - type: boolean - description: Allows assets in multilink fields. - default: false - show_anchor: - type: boolean - description: Enables anchor field for internal links in multilink fields. - default: false - required_fields: - type: string - description: Comma-separated list of required fields for custom fields. - exclude_from_merge: - type: boolean - description: Excludes a blok from merge actions (Dimensions App). - exclude_from_overwrite: - type: boolean - description: Excludes a blok from overwrite actions (Dimensions App). - force_merge: - type: boolean - description: Forces overwriting a blok during a merge action (Dimensions App). - required: - - type - - pos - ComponentBase: - type: object - properties: - name: - type: string - description: Technical name used for component property in entries - display_name: - type: string - description: The display name of the component - image: - type: string - description: URL to the preview image, if uploaded - preview_field: - type: string - description: Define the field that should be used for preview in the interface - preview_tmpl: - type: string - description: Define the template that should be used for preview in the interface - icon: - type: string - description: An optional icon for the component to identify this component type in the interface - enum: - - block-@ - - block-1-2block - - block-add - - block-arrow-pointer - - block-block - - block-buildin - - block-center-m - - block-comment - - block-doc - - block-dollar-sign - - block-email - - block-image - - block-keyboard - - block-locked - - block-map-pin - - block-mobile - - block-monitor - - block-paycard - - block-resize-fc - - block-cart - - block-share - - block-shield-2 - - block-shield - - block-sticker - - block-suitcase - - block-table-2 - - block-table - - block-tag - - block-text-c - - block-text-img-c - - block-text-img-l - - block-text-img-r-l - - block-text-img-r - - block-text-img-t-l - - block-text-img-t-r - - block-text-l - - block-text-r - - block-unlocked - - block-wallet - color: - type: string - description: Css color used as background for the icon - is_root: - type: boolean - description: Component should be usable as a Content Type - is_nestable: - type: boolean - description: Component should be insertable in blocks field type fields - component_group_uuid: - type: string - format: uuid - description: The component group uuid of the component - x-go-type: uuid.UUID - x-go-type-import: - name: uuid - path: github.com/gofrs/uuid - schema: - type: object - description: The definition of fields (schema) for this component - additionalProperties: - $ref: '#/components/schemas/FieldInput' - x-go-type: orderedmap.OrderedMap[string,FieldInput] - x-go-type-import: - name: orderedmap - path: github.com/wk8/go-ordered-map/v2 - required: - - name - ComponentGroupBase: - type: object - properties: - name: - type: string - description: The name of the component group - required: - - name - AssetFolderBase: - type: object - properties: - name: - type: string - description: The name of the asset folder - parent_id: - type: integer - format: int64 - description: The ID of the parent folder - required: - - name - DatasourceBase: - type: object - properties: - name: - type: string - description: The name of the data source - slug: - type: string - description: The slug of the data source - required: - - name - - slug - DatasourceEntryBase: - type: object - properties: - name: - type: string - description: The name of the datasource entry - value: - type: string - description: The value of the datasource entry - datasource_id: - type: integer - format: int64 - description: The ID of the datasource containing the entry - required: - - name - - slug - WebhookCreateInput: - type: object - properties: - name: - type: string - description: The name of the data source - endpoint: - type: string - description: The endpoint of the webhook - secret: - type: string - description: The secret of the webhook - actions: - type: array - items: - type: string - description: The actions of the webhook - description: - type: string - description: The description of the webhook - activated: - type: boolean - description: The activation status of the webhook - required: - - name - - endpoint - - secret - - actions - - activated - Webhook: - type: object - properties: - id: - type: integer - format: int64 - description: The id of the webhook - name: - type: string - description: The name of the data source - endpoint: - type: string - description: The endpoint of the webhook - secret: - type: string - description: The secret of the webhook - actions: - type: array - items: - type: string - description: The actions of the webhook - description: - type: string - description: The description of the webhook - activated: - type: boolean - description: The activation status of the webhook - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - required: - - id - - name - - endpoint - - secret - - actions - - activated - WebhookUpdateInput: - type: object - properties: - name: - type: string - description: The name of the data source - endpoint: - type: string - description: The endpoint of the webhook - secret: - type: string - description: The secret of the webhook - actions: - type: array - items: - type: string - description: The actions of the webhook - description: - type: string - description: The description of the webhook - activated: - type: boolean - description: The activation status of the webhook - required: - - name - - endpoint - - secret - - actions - - activated - StoryBase: - type: object - properties: - name: - type: string - description: The name of the story - slug: - type: string - description: The slug of the story - content: - type: object - description: The content of the story - is_folder: - type: boolean - description: Flag indicating whether the story is a folder - default_root: - type: boolean - description: Default content type/root component. (*Required if is_folder is true) - parent_id: - type: integer - description: The ID of the parent story/folder - disable_fe_editor: - type: boolean - description: Is side by side editor disabled for all entries in folder (true/false) - path: - type: string - description: Given real path, used in the preview editor - is_startpage: - type: boolean - description: Flag indicating whether the story is the start page - position: - type: integer - description: The position of the story/folder within its parent - first_published_at: - type: string - description: 'First publishing date (Format: YYYY-mm-dd HH:MM)' - translated_slugs_attributes: - type: array - items: - type: object - properties: - lang: - type: string - slug: - type: string - name: - type: string - required: - - name - - slug - Story: - type: object - description: This is an object representing your content entry. One Story object can be of a specific type, so called content types and is able to contain components. You define the fields and nestability of your content types to achieve your content structure. You can use this object to build up your entities when migrating or importing content. You can set alternate versions of a story with Management API using the group_id of the story. - allOf: - - $ref: '#/components/schemas/StoryBase' - - type: object - properties: - id: - type: integer - format: int64 - description: The ID of the story - uuid: - type: string - description: The UUID of the story - parent_uuid: - type: string - description: The UUID of the story - created_at: - type: string - format: date-time - description: The creation timestamp of the story - deleted_at: - type: string - format: date-time - description: The deletion timestamp of the story - updated_at: - type: string - format: date-time - description: The update timestamp of the story - publish_at: - type: string - format: date-time - description: The publish timestamp of the story - expire_at: - type: string - format: date-time - description: The expire timestamp of the story - parent: - type: object - unpublished_changes: - type: boolean - sort_by_date: - type: string - full_slug: - type: string - meta_data: - type: object - preview_token: - type: object - properties: - token: - type: string - timestamp: - type: string - pinned: - type: boolean - last_author: - type: object - properties: - id: - type: integer - userid: - type: string - friendly_name: - type: string - user_ids: - type: array - items: - type: integer - space_role_ids: - type: array - items: - type: integer - translated_slugs: - type: array - items: - type: object - localized_paths: - type: array - items: - type: object - translated_stories: - type: array - can_not_view: - type: boolean - is_scheduled: - type: boolean - tag_list: - type: array - items: - type: string - alternates: - type: array - items: - type: object - required: - - id - - uuid - - created_at - - updated_at - - full-slug - - pinned - - can_not_view - - last_author - - user_ids - - space_role_ids - - translated_slugs - - localized_paths - - position - - translated_stories - - preview_token - - alternates - StoryCreateInput: - type: object - properties: - story: - $ref: '#/components/schemas/StoryBase' - publish: - type: integer - description: If '1' it will publish the story, 'publish' must be omitted if publication is not desired - format: int64 - release_id: - type: integer - format: int64 - required: - - story - StoryUpdateInput: - type: object - allOf: - - $ref: '#/components/schemas/StoryCreateInput' - - type: object - properties: - force_update: - type: integer - description: If '1' it will overwrite a locked story - group_id: - type: integer - lang: - type: string - Version: - type: object - properties: - id: - type: integer - event: - type: string - created_at: - type: string - format: date-time - author_id: - type: integer - author: - type: string - item_id: - type: integer - is_draft: - type: boolean - SpaceRoleBase: - type: object - required: - - role - properties: - role: - type: string - ext_id: - type: string - subtitle: - type: string - allowed_languages: - type: array - items: - type: string - resolved_allowed_paths: - type: array - items: - type: string - allowed_paths: - type: array - items: - type: string - permissions: - type: array - items: - type: string - field_permissions: - type: array - items: - type: string - readonly_field_permissions: - type: array - items: - type: string - datasource_ids: - type: array - items: - type: integer - component_ids: - type: array - items: - type: integer - branch_ids: - type: array - items: - type: integer - headers: - pagination: - type: object - properties: - total: - type: integer - description: The total number of items - per-page: - type: integer - description: The number of items per page diff --git a/redocly.yaml b/redocly.yaml index 4a5fd19..6c41f09 100644 --- a/redocly.yaml +++ b/redocly.yaml @@ -1,6 +1,6 @@ apis: storyblok@latest: root: "source.yaml" - output: openapi.yaml + output: openapi.generated.yaml extends: - recommended diff --git a/sbmgmt/main.gen.go b/sbmgmt/main.gen.go index 889314c..d80ae91 100644 --- a/sbmgmt/main.gen.go +++ b/sbmgmt/main.gen.go @@ -1,6 +1,6 @@ // Package sbmgmt provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. package sbmgmt import ( From cbf15bcb70375904444fc75a17757280096cd101 Mon Sep 17 00:00:00 2001 From: Thomas De Meyer Date: Fri, 14 Feb 2025 12:06:26 +0100 Subject: [PATCH 3/4] feat: removed 1.20 from testing --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ec0404f..4279cf9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - go-version: [ "1.20", "1.21", "1.22" ] + go-version: [ "1.21", "1.22", "1.23", "1.24" ] steps: - uses: actions/checkout@v4 From 1f3c6f8a72d441f5455d237cdec77d51a42390c6 Mon Sep 17 00:00:00 2001 From: Thomas De Meyer Date: Fri, 14 Feb 2025 14:23:18 +0100 Subject: [PATCH 4/4] feat: made some fields int64 for consistency --- sbmgmt/main.gen.go | 8 ++++---- schemas/components.yaml | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sbmgmt/main.gen.go b/sbmgmt/main.gen.go index d80ae91..5a7845a 100644 --- a/sbmgmt/main.gen.go +++ b/sbmgmt/main.gen.go @@ -433,7 +433,7 @@ type FieldInput struct { DatasourceSlug *string `json:"datasource_slug,omitempty"` // Decimals Number of decimal places for number fields. - Decimals *int `json:"decimals,omitempty"` + Decimals *int64 `json:"decimals,omitempty"` // DefaultValue Default value for the field. DefaultValue *string `json:"default_value,omitempty"` @@ -514,7 +514,7 @@ type FieldInput struct { MaxOptions *int64 `json:"max_options,omitempty"` // MaxValue Maximum value for number fields. - MaxValue *int `json:"max_value,omitempty"` + MaxValue *int64 `json:"max_value,omitempty"` // Maximum Maximum number of components for bloks type fields. Maximum *int64 `json:"maximum,omitempty"` @@ -523,7 +523,7 @@ type FieldInput struct { MinOptions *int64 `json:"min_options,omitempty"` // MinValue Minimum value for number fields. - MinValue *int `json:"min_value,omitempty"` + MinValue *int64 `json:"min_value,omitempty"` // Minimum Minimum number of components for bloks type fields. Minimum *int64 `json:"minimum,omitempty"` @@ -568,7 +568,7 @@ type FieldInput struct { Source *string `json:"source,omitempty"` // Steps Step interval for number fields. - Steps *int `json:"steps,omitempty"` + Steps *int64 `json:"steps,omitempty"` // StyleOptions Custom CSS data for richtext fields. StyleOptions *[]map[string]interface{} `json:"style_options,omitempty"` diff --git a/schemas/components.yaml b/schemas/components.yaml index 4ff8193..b8e9d7a 100644 --- a/schemas/components.yaml +++ b/schemas/components.yaml @@ -328,15 +328,19 @@ FieldInput: description: Enables empty paragraphs in markdown fields. min_value: type: integer + format: int64 description: Minimum value for number fields. max_value: type: integer + format: int64 description: Maximum value for number fields. decimals: type: integer + format: int64 description: Number of decimal places for number fields. steps: type: integer + format: int64 description: Step interval for number fields. inline_label: type: boolean