From 605a1ff5cf861ca0d8e2711ca79374804f180b50 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:08:25 +0000 Subject: [PATCH] Updated API from documentation release --- api-specs/connect/api.raml | 35 +++++---- .../examples/connector/ConfigurationKey.json | 6 ++ .../ConnectorConfigurationApplication.json | 7 +- .../connect/examples/connector/draft.json | 33 ++++++++ .../connect/examples/connector/minimal.json | 7 +- .../connect/examples/connector/paged.json | 7 +- .../examples/connector/staged-paged.json | 7 +- .../connect/examples/connector/staged.json | 7 +- api-specs/connect/ruleset.xml | 4 +- api-specs/connect/types/common.raml | 78 ++++++++++++++----- .../types/connector/connector-staged.raml | 5 +- .../connect/types/connector/connector.raml | 6 +- .../types/deployment/deployment-draft.raml | 3 + .../connect/types/deployment/deployment.raml | 3 + .../updates/deployment-redeploy-action.raml | 5 +- ...tyRequiredGlobalConfigurationKeyError.raml | 14 ++++ ...entMissingGlobalConfigurationKeyError.raml | 14 ++++ ...DeploymentMustIncludeApplicationError.raml | 14 ---- ...entUnknownGlobalConfigurationKeyError.raml | 14 ++++ api-specs/connect/types/types.raml | 5 +- 20 files changed, 207 insertions(+), 67 deletions(-) create mode 100644 api-specs/connect/examples/connector/ConfigurationKey.json create mode 100644 api-specs/connect/types/error/DeploymentEmptyRequiredGlobalConfigurationKeyError.raml create mode 100644 api-specs/connect/types/error/DeploymentMissingGlobalConfigurationKeyError.raml delete mode 100644 api-specs/connect/types/error/DeploymentMustIncludeApplicationError.raml create mode 100644 api-specs/connect/types/error/DeploymentUnknownGlobalConfigurationKeyError.raml diff --git a/api-specs/connect/api.raml b/api-specs/connect/api.raml index 495585941..7d8eedf84 100644 --- a/api-specs/connect/api.raml +++ b/api-specs/connect/api.raml @@ -9,7 +9,7 @@ uses: version: v1 mediaType: application/json baseUri: https://connect.{region}.commercetools.com -(annotations.sdkBaseUri): https://connect.europe-west1.gcp.commercetools.com +(annotations.sdkBaseUri): https://connect.{region}.commercetools.com baseUriParameters: region: type: string @@ -114,14 +114,11 @@ resourceTypes: !include types/resource-types.raml type: DeploymentDraft example: !include ./examples/deployment/draft.json description: | - Specific error codes: + Specific Error Codes: - [ConnectorStagedNotPreviewable](ctp:connect:type:ConnectorStagedNotPreviewableError) - [DeploymentUnsupportedRegion](ctp:connect:type:DeploymentUnsupportedRegionError) - [DeploymentUnknownApplicationConfiguration](ctp:connect:type:DeploymentUnknownApplicationConfigurationError) - [DeploymentUnknownApplicationConfigurationKey](ctp:connect:type:DeploymentUnknownApplicationConfigurationKeyError) - - [DeploymentApplicationDoNotBelong](ctp:connect:type:DeploymentApplicationDoNotBelongError) - - [DeploymentMustIncludeApplication](ctp:connect:type:DeploymentMustIncludeApplicationError) - - [DeploymentApplicationRequired](ctp:connect:type:DeploymentApplicationRequiredError) responses: 201: body: @@ -133,14 +130,6 @@ resourceTypes: !include types/resource-types.raml type: ErrorResponse get: queryParameters: - integrationTypes?: - description: | - Filter the results by the `integrationType` of a Connector. - type: common.IntegrationType[] - deploymentType?: - description: | - Filter the results by the `deploymentType` of a Connector. - type: common.DeploymentType limit?: type: number format: int64 @@ -153,6 +142,14 @@ resourceTypes: !include types/resource-types.raml Number of [elements skipped](/../api/general-concepts#offset). sort?: type: string[] + integrationTypes?: + description: | + Filter the results by the `integrationType` of a Connector. + type: common.IntegrationType[] + deploymentType?: + description: | + Filter the results by the `deploymentType` of a Connector. + type: common.DeploymentType description: Retrieves all deployments of a project key. is: - secured_by_view_connectors_deployments @@ -283,10 +280,6 @@ resourceTypes: !include types/resource-types.raml type: ErrorResponse get: queryParameters: - integrationTypes?: - description: | - Filter the results by the `integrationType` of a ConnectorStaged. - type: common.IntegrationType[] limit?: type: number format: int64 @@ -299,6 +292,14 @@ resourceTypes: !include types/resource-types.raml Number of [elements skipped](/../api/general-concepts#offset). sort?: type: string[] + isPrivate?: + type: boolean + description: | + If `true`, only private Connectors are returned. If `false`, only public Connectors are returned. + integrationTypes?: + description: | + Filter the results by the `integrationType` of a ConnectorStaged. + type: common.IntegrationType[] is: - secured_by_view_connectors responses: diff --git a/api-specs/connect/examples/connector/ConfigurationKey.json b/api-specs/connect/examples/connector/ConfigurationKey.json new file mode 100644 index 000000000..d00ef4de8 --- /dev/null +++ b/api-specs/connect/examples/connector/ConfigurationKey.json @@ -0,0 +1,6 @@ +{ + "key": "CONFIG_KEY", + "description": "config key description", + "required": true, + "default": "config default value" +} diff --git a/api-specs/connect/examples/connector/ConnectorConfigurationApplication.json b/api-specs/connect/examples/connector/ConnectorConfigurationApplication.json index 84f723137..ec862bfc3 100644 --- a/api-specs/connect/examples/connector/ConnectorConfigurationApplication.json +++ b/api-specs/connect/examples/connector/ConnectorConfigurationApplication.json @@ -4,13 +4,16 @@ "standardConfiguration": [ { "key": "CONFIG_KEY", - "description": "config key description" + "description": "config key description", + "required": true, + "default": "config key default value" } ], "securedConfiguration": [ { "key": "CONFIG_SECRET_KEY", - "description": "config secret description" + "description": "config secret description", + "required": true } ] } diff --git a/api-specs/connect/examples/connector/draft.json b/api-specs/connect/examples/connector/draft.json index dfafca5f0..1ee427670 100644 --- a/api-specs/connect/examples/connector/draft.json +++ b/api-specs/connect/examples/connector/draft.json @@ -1,5 +1,7 @@ { + "id": "5ab3edcd-9d23-4934-8f48-256805253119", "key": "connector-key", + "version": 1, "name": "Connector's name", "description": "Connector's description", "creator": { @@ -14,5 +16,36 @@ "tag": "0.0.0" }, "privateProjects": [], + "private": false, + "hasChanges": true, + "alreadyListed": true, + "isPreviewable": "true", + "status": "Draft", + "publishingReport": null, + "previewableReport": { + "entries": [ + { + "title": "Image security analysis check succeeded", + "type": "Information", + "message": null, + "createdAt": "2024-02-15T10:12:12.069Z", + "application": null + }, + { + "title": "SAST and SCA analysis check succeeded", + "type": "Information", + "message": null, + "createdAt": "2024-02-15T10:12:12.072Z", + "application": null + }, + { + "title": "Connector specification file validation check succeeded", + "type": "Information", + "message": null, + "createdAt": "2024-02-15T10:12:12.073Z", + "application": null + } + ] + }, "supportedRegions": ["us-central1.gcp", "europe-west1.gcp"] } diff --git a/api-specs/connect/examples/connector/minimal.json b/api-specs/connect/examples/connector/minimal.json index 51e06b3b9..b69af9434 100644 --- a/api-specs/connect/examples/connector/minimal.json +++ b/api-specs/connect/examples/connector/minimal.json @@ -23,13 +23,16 @@ "standardConfiguration": [ { "key": "CONFIG_KEY", - "description": "config key description" + "description": "config key description", + "required": true, + "default": null } ], "securedConfiguration": [ { "key": "CONFIG_SECRET_KEY", - "description": "config secret description" + "description": "config secret description", + "required": true } ] } diff --git a/api-specs/connect/examples/connector/paged.json b/api-specs/connect/examples/connector/paged.json index 8bc3e449a..a3fc894d4 100644 --- a/api-specs/connect/examples/connector/paged.json +++ b/api-specs/connect/examples/connector/paged.json @@ -29,13 +29,16 @@ "standardConfiguration": [ { "key": "CONFIG_KEY", - "description": "config key description" + "description": "config key description", + "required": true, + "default": null } ], "securedConfiguration": [ { "key": "CONFIG_SECRET_KEY", - "description": "config secret description" + "description": "config secret description", + "required": true } ] } diff --git a/api-specs/connect/examples/connector/staged-paged.json b/api-specs/connect/examples/connector/staged-paged.json index 4347b2328..0d01a8ba0 100644 --- a/api-specs/connect/examples/connector/staged-paged.json +++ b/api-specs/connect/examples/connector/staged-paged.json @@ -29,13 +29,16 @@ "standardConfiguration": [ { "key": "CONFIG_KEY", - "description": "config key description" + "description": "config key description", + "required": true, + "default": "config default value" } ], "securedConfiguration": [ { "key": "CONFIG_SECRET_KEY", - "description": "config secret description" + "description": "config secret description", + "required": true } ] } diff --git a/api-specs/connect/examples/connector/staged.json b/api-specs/connect/examples/connector/staged.json index 91b8b8ac9..65d72f159 100644 --- a/api-specs/connect/examples/connector/staged.json +++ b/api-specs/connect/examples/connector/staged.json @@ -23,13 +23,16 @@ "standardConfiguration": [ { "key": "CONFIG_KEY", - "description": "config key description" + "description": "config key description", + "required": true, + "default": "config default value" } ], "securedConfiguration": [ { "key": "CONFIG_SECRET_KEY", - "description": "config secret description" + "description": "config secret description", + "required": true } ] } diff --git a/api-specs/connect/ruleset.xml b/api-specs/connect/ruleset.xml index 1dd537276..d7bb48b37 100644 --- a/api-specs/connect/ruleset.xml +++ b/api-specs/connect/ruleset.xml @@ -7,11 +7,13 @@ com.commercetools.rmf.validators.FilenameRule + + com.commercetools.rmf.validators.SdkBaseUriRule + com.commercetools.rmf.validators.ResourcePluralRule - diff --git a/api-specs/connect/types/common.raml b/api-specs/connect/types/common.raml index 05ce4c922..8a2b3b424 100644 --- a/api-specs/connect/types/common.raml +++ b/api-specs/connect/types/common.raml @@ -31,8 +31,8 @@ types: comment: type: string description: The body text of the comment. - ConfigurationKeyStandard: - example: !include ../examples/connector/ConfigurationKeyStandard.json + StandardConfigurationKey: + example: !include ../examples/connector/ConfigurationKey.json description: | The name, description, and default value of a standard environment variable. properties: @@ -49,8 +49,8 @@ types: type: boolean description: Indicates if the environment variable is required. default: false - ConfigurationKeySecured: - example: !include ../examples/connector/ConfigurationKeySecured.json + SecuredConfigurationKey: + example: !include ../examples/connector/ConfigurationKey.json description: | The name and description of a secret environment variable. properties: @@ -91,13 +91,22 @@ types: - service - event - job - - mc-app + - merchant-center-custom-application - assets standardConfiguration: - type: ConfigurationKeyStandard[] + type: StandardConfigurationKey[] description: Contains the name, description, and default values of standard environment variables. securedConfiguration: - type: ConfigurationKeySecured[] + type: SecuredConfigurationKey[] + description: Contains the name and description of secret environment variables. + ConnectorGlobalConfiguration: + description: Global configuration applied to all applications in the deployment. + properties: + standardConfiguration?: + type: StandardConfigurationKey[] + description: Contains the name and description of standard environment variables. + securedConfiguration?: + type: SecuredConfigurationKey[] description: Contains the name and description of secret environment variables. DeploymentConfigurationApplication: description: | @@ -270,9 +279,30 @@ types: repository: type: Repository description: Details of the GitHub repository that contains the Connect applications. + configurations?: + type: ConnectorConfigurationApplication[] + description: Configurations needed by Connectors for hosting. Loaded as environment variables in the application. + globalConfiguration?: + type: ConnectorGlobalConfiguration + description: Global configuration applied to all applications in the deployment. certified: type: boolean description: If `true`, the Connector is certified. + supportedRegions?: + type: Region[] + description: If not empty, Connectors can only be deployed in these Regions. If empty, Connectors can be deployed in any [supported Region](hosts-and-authorization#hosts). + documentationUrl?: + type: string + description: URL to the documentation of the Connector. + DeploymentGlobalConfiguration: + description: Global configuration applied to all applications in the deployment. + properties: + standardConfiguration?: + type: ConfigurationValue[] + description: List of standard environment variables. + securedConfiguration?: + type: ConfigurationValue[] + description: List of secured environment variables. DeploymentCreator: example: !include ../examples/deployment/DeploymentCreator.json description: The details of the deployed [DeploymentConnector](ctp:connect:type:DeploymentConnector) creator. @@ -293,6 +323,12 @@ types: noOfContributors?: type: integer description: Number of contributors currently working for the company. + logoUrl?: + type: string + description: URL to an image used as the company logo. + supportUrl?: + type: string + description: Url to support website of the company. DeploymentReportEntryType: type: string description: | @@ -403,20 +439,6 @@ types: IntegrationType: description: | Integration type of the Connector. - enum: - - tax - - marketplace - - oms - - psp - - pim - - promotion - - search - - erp - - crm - - email - - analytics - - shipping - - other (annotations.enumDescriptions): tax: Tax. marketplace: Marketplace. @@ -431,6 +453,20 @@ types: analytics: Analytics. shipping: Shipping and delivery. other: The Connector provides a service or functionality that is not covered by the other values. + enum: + - tax + - marketplace + - oms + - psp + - pim + - promotion + - search + - erp + - crm + - email + - analytics + - shipping + - other DeploymentType: description: | Deployment type of the Connector. diff --git a/api-specs/connect/types/connector/connector-staged.raml b/api-specs/connect/types/connector/connector-staged.raml index 0cf28540d..fb1fa4145 100644 --- a/api-specs/connect/types/connector/connector-staged.raml +++ b/api-specs/connect/types/connector/connector-staged.raml @@ -32,7 +32,10 @@ properties: description: GitHub repository details of the Connector. configurations: type: common.ConnectorConfigurationApplication[] - description: Configurations needed by Connectors for hosting. Loaded as environment variables in the workload. + description: Configurations needed by Connectors for hosting. Loaded as environment variables in the application. + globalConfiguration?: + type: common.ConnectorGlobalConfiguration + description: Global configuration applied to all applications in the Deployment. private: type: boolean description: If `true`, only Composable Commerce Projects specified in `privateProjects` can access the Connector. diff --git a/api-specs/connect/types/connector/connector.raml b/api-specs/connect/types/connector/connector.raml index 636ca0da0..418fcaa10 100644 --- a/api-specs/connect/types/connector/connector.raml +++ b/api-specs/connect/types/connector/connector.raml @@ -32,10 +32,14 @@ properties: description: GitHub repository details of the Connector. configurations?: type: common.ConnectorConfigurationApplication[] - description: Configurations needed by Connectors for hosting. Loaded as environment variables in the workload. + description: Configurations needed by Connectors for hosting. Loaded as environment variables in the application. + # @todo: add apiClient when it's ready to be released private: type: boolean description: If `true`, only Composable Commerce Projects specified in `privateProjects` can access the Connector. + globalConfiguration?: + description: Global configuration applied to all applications in the Deployment. + type: common.ConnectorGlobalConfiguration supportedRegions: type: common.Region[] description: If provided, Connectors can only be deployed in these Regions. If not provided, Connectors can be deployed in any [supported Region](hosts-and-authorization#hosts). For faster request processing, we recommend adding only the required Region. diff --git a/api-specs/connect/types/deployment/deployment-draft.raml b/api-specs/connect/types/deployment/deployment-draft.raml index 424dc8336..94d3db838 100644 --- a/api-specs/connect/types/deployment/deployment-draft.raml +++ b/api-specs/connect/types/deployment/deployment-draft.raml @@ -15,6 +15,9 @@ properties: configurations?: type: common.DeploymentConfigurationApplication[] description: Configuration values needed by the [Connector](ctp:connect:type:Connector) for hosting. Keys should match those in the Connector's `configurations` field. + globalConfiguration?: + type: common.DeploymentGlobalConfiguration + description: Global configuration values needed by the [Connector](ctp:connect:type:Connector) for hosting. Keys should match those in the Connector's `globalConfiguration` field. region: type: common.Region description: Region of Deployment. diff --git a/api-specs/connect/types/deployment/deployment.raml b/api-specs/connect/types/deployment/deployment.raml index 386501c26..ca81d0ea7 100644 --- a/api-specs/connect/types/deployment/deployment.raml +++ b/api-specs/connect/types/deployment/deployment.raml @@ -18,6 +18,9 @@ properties: connector: type: common.DeploymentConnector description: Details of the [Connector](ctp:connect:type:Connector) being deployed. + globalConfiguration?: + type: common.DeploymentGlobalConfiguration + description: Global configuration applied to all applications in the deployment. details: type: common.DeploymentDetails description: Build reference id and outcome of the Deployment. diff --git a/api-specs/connect/types/deployment/updates/deployment-redeploy-action.raml b/api-specs/connect/types/deployment/updates/deployment-redeploy-action.raml index 0c2c5f33e..572ef27a5 100644 --- a/api-specs/connect/types/deployment/updates/deployment-redeploy-action.raml +++ b/api-specs/connect/types/deployment/updates/deployment-redeploy-action.raml @@ -12,8 +12,11 @@ description: | - [DeploymentUnknownApplicationConfigurationKey](ctp:connect:type:DeploymentUnknownApplicationConfigurationKeyError) - [DeploymentInvalidStatusTransition](ctp:connect:type:DeploymentInvalidStatusTransitionError) - [DeploymentApplicationDoNotBelong](ctp:connect:type:DeploymentApplicationDoNotBelongError) - - [DeploymentMustIncludeApplication](ctp:connect:type:DeploymentMustIncludeApplicationError) + - [DeploymentApplicationRequiredError](ctp:connect:type:DeploymentApplicationRequiredError) - [DeploymentConnectorUpdateFailure](ctp:connect:type:DeploymentConnectorUpdateFailureError) + - [DeploymentUnknownGlobalConfigurationKeyError](ctp:connect:type:DeploymentUnknownGlobalConfigurationKeyError) + - [DeploymentEmptyRequiredGlobalConfigurationKeyError](ctp:connect:type:DeploymentEmptyRequiredGlobalConfigurationKeyError) + properties: skipScripts?: type: boolean diff --git a/api-specs/connect/types/error/DeploymentEmptyRequiredGlobalConfigurationKeyError.raml b/api-specs/connect/types/error/DeploymentEmptyRequiredGlobalConfigurationKeyError.raml new file mode 100644 index 000000000..6a5d72c78 --- /dev/null +++ b/api-specs/connect/types/error/DeploymentEmptyRequiredGlobalConfigurationKeyError.raml @@ -0,0 +1,14 @@ +#%RAML 1.0 DataType +(annotations.package): error +type: ErrorObject +displayName: DeploymentEmptyRequiredGlobalConfigurationKeyError +discriminatorValue: DeploymentEmptyRequiredGlobalConfigurationKey +description: | + Returned when a required global configuration key has an empty value. +properties: + code: + type: string + message: + type: string + description: | + `"Deployment requires a non empty value for (secret|standard) global configuration with key $configurationKey."` diff --git a/api-specs/connect/types/error/DeploymentMissingGlobalConfigurationKeyError.raml b/api-specs/connect/types/error/DeploymentMissingGlobalConfigurationKeyError.raml new file mode 100644 index 000000000..821514f97 --- /dev/null +++ b/api-specs/connect/types/error/DeploymentMissingGlobalConfigurationKeyError.raml @@ -0,0 +1,14 @@ +#%RAML 1.0 DataType +(annotations.package): error +type: ErrorObject +displayName: DeploymentMissingGlobalConfigurationKeyError +discriminatorValue: DeploymentMissingGlobalConfigurationKey +description: | + Returned when a required global configuration key is missing. +properties: + code: + type: string + message: + type: string + description: | + `"Deployment global configuration requires (secret|standard) with key $configurationKey."` diff --git a/api-specs/connect/types/error/DeploymentMustIncludeApplicationError.raml b/api-specs/connect/types/error/DeploymentMustIncludeApplicationError.raml deleted file mode 100644 index f00f5bcb1..000000000 --- a/api-specs/connect/types/error/DeploymentMustIncludeApplicationError.raml +++ /dev/null @@ -1,14 +0,0 @@ -#%RAML 1.0 DataType -(annotations.package): error -type: ErrorObject -displayName: DeploymentMustIncludeApplicationError -discriminatorValue: DeploymentMustIncludeApplication -description: | - Returned when attempting to remove an application that belongs to the Deployment. -properties: - code: - type: string - message: - type: string - description: | - `"Deployment with id=$resourceId or key=$resourceKey must include application: $applicationName"` diff --git a/api-specs/connect/types/error/DeploymentUnknownGlobalConfigurationKeyError.raml b/api-specs/connect/types/error/DeploymentUnknownGlobalConfigurationKeyError.raml new file mode 100644 index 000000000..445b0d173 --- /dev/null +++ b/api-specs/connect/types/error/DeploymentUnknownGlobalConfigurationKeyError.raml @@ -0,0 +1,14 @@ +#%RAML 1.0 DataType +(annotations.package): error +type: ErrorObject +displayName: DeploymentUnknownGlobalConfigurationKeyError +discriminatorValue: DeploymentUnknownGlobalConfigurationKey +description: | + Returned when attempting to provide a nonexistent global configuration. +properties: + code: + type: string + message: + type: string + description: | + `"Deployment global configuration does not require (secret|standard) with key $configurationKey."` diff --git a/api-specs/connect/types/types.raml b/api-specs/connect/types/types.raml index c6518aad9..1663d2853 100644 --- a/api-specs/connect/types/types.raml +++ b/api-specs/connect/types/types.raml @@ -68,4 +68,7 @@ DeploymentUnknownApplicationConfigurationKeyError: !include error/DeploymentUnkn DeploymentUnsupportedRegionError: !include error/DeploymentUnsupportedRegionError.raml DeploymentApplicationDoNotBelongError: !include error/DeploymentApplicationDoNotBelongError.raml DeploymentApplicationRequiredError: !include error/DeploymentApplicationRequiredError.raml -DeploymentMustIncludeApplicationError: !include error/DeploymentMustIncludeApplicationError.raml +DeploymentUnknownGlobalConfigurationKeyError: !include error/DeploymentUnknownGlobalConfigurationKeyError.raml +DeploymentMissingGlobalConfigurationKeyError: !include error/DeploymentMissingGlobalConfigurationKeyError.raml +DeploymentEmptyRequiredGlobalConfigurationKeyError: !include error/DeploymentEmptyRequiredGlobalConfigurationKeyError.raml +