From 0160e166f87ca9ac13405136df77feccf9d3f560 Mon Sep 17 00:00:00 2001 From: Dario Ocles Date: Mon, 30 Oct 2023 14:34:43 +0100 Subject: [PATCH 1/3] chore: adding mc-app example to application kit --- README.md | 50 ++++++++++++++----- application-templates/javascript/connect.yaml | 13 ++++- .../javascript/docs/README.md | 2 +- .../javascript/mc-app/README.md | 3 ++ application-templates/typescript/connect.yaml | 13 ++++- .../typescript/docs/README.md | 2 +- .../typescript/mc-app/README.md | 3 ++ 7 files changed, 69 insertions(+), 17 deletions(-) create mode 100644 application-templates/javascript/mc-app/README.md create mode 100644 application-templates/typescript/mc-app/README.md diff --git a/README.md b/README.md index 5531af7..85f9fa6 100644 --- a/README.md +++ b/README.md @@ -118,25 +118,49 @@ deployAs: scripts: postDeploy: npm install && npm run build && npm run connector:post-deploy preUndeploy: npm install && npm run build && npm run connector:pre-undeploy - configurationType: - ENVIRONMENT_VARIABLE_1: standard - ENVIRONMENT_VARIABLE_2: secret - ENVIRONMENT_VARIABLE_3: secret + configuration: + standardConfiguration: + - key: ENVIRONMENT_VARIABLE_1 + description: description variable 1 + securedConfiguration: + - key: ENVIRONMENT_VARIABLE_2 + description: description variable 2 + - key: ENVIRONMENT_VARIABLE_3 + description: description variable 3 - name: app2 applicationType: job endpoint: /app2 properties: schedule: "*/5 * * * *" - configurationType: - ENVIRONMENT_VARIABLE_1: standard - ENVIRONMENT_VARIABLE_2: standard + configuration: + standardConfiguration: + - key: ENVIRONMENT_VARIABLE_1 + description: description variable 1 + - key: ENVIRONMENT_VARIABLE_2 + description: description variable 2 - name: app3 applicationType: event endpoint: /app3 - configurationType: - ENVIRONMENT_VARIABLE_1: standard - ENVIRONMENT_VARIABLE_2: secret - ENVIRONMENT_VARIABLE_3: standard + configuration: + securedConfiguration: + - key: ENVIRONMENT_VARIABLE_1 + description: description variable 1 + - key: ENVIRONMENT_VARIABLE_2 + description: description variable 2 + - key: ENVIRONMENT_VARIABLE_3 + description: description variable 3 + - name: app4 + applicationType: mc-app + endpoint: /app4 + configuration: + standardConfiguration: + - key: ENVIRONMENT_VARIABLE_1 + description: description variable 1 + securedConfiguration: + - key: ENVIRONMENT_VARIABLE_2 + description: description variable 2 + - key: ENVIRONMENT_VARIABLE_3 + description: description variable 3 ``` - Multiple applications of same type can be setup @@ -145,9 +169,9 @@ deployAs: ## Property definition - `name` - Folder name of respective application component from the root of monorepo which will be used as identifier of the application. Deployment output url, topic & schedule can be fetched based on this reference -- `applicationType` - Type of deployment . Can be one of `service`, `event` or `job` +- `applicationType` - Type of deployment . Can be one of `service`, `event`, `job` and `mc-app` - `endpoint` - Point of entry for respective application component - `scripts.postDeploy` - Post-deploy script to execute after the connector deployment process - `scripts.preUndeploy` - Pre-undeploy script to execute before the connector undeployment process -- `configurationType` - Definiton of all environment variables needed by the application, customer will be responsible to provide value for these variables when choosen to deploy. Definition includes defining the type of variable if it needs to be secured or not . `standard` for customer provided values to be saved as plain text , `secret` for customer provided values to be secured and stored in encrypted format +- `configuration` - Definiton of all environment variables needed by the application, customer will be responsible to provide value for these variables when choosen to deploy. You need to choose between `standardConfiguration` and `securedConfiguration`. `standardConfiguration` for customer provided values to be saved as plain text , `securedConfiguration` for customer provided values to be secured and stored in encrypted format - `schedule` - Schedule expression for job applications, it need to be input of type cron expression \ No newline at end of file diff --git a/application-templates/javascript/connect.yaml b/application-templates/javascript/connect.yaml index 6ec0fd9..e743c07 100644 --- a/application-templates/javascript/connect.yaml +++ b/application-templates/javascript/connect.yaml @@ -54,4 +54,15 @@ deployAs: - key: CTP_CLIENT_SECRET description: commercetools Composable Commerce client secret - key: CTP_SCOPE - description: commercetools Composable Commerce client scope \ No newline at end of file + description: commercetools Composable Commerce client scope + - name: mc-app + applicationType: mc-app + endpoint: /mc-app + configuration: + standardConfiguration: + - key: APPLICATION_ID + description: commercetools Composable Commerce application ID + required: true + - key: CLOUD_IDENTIFIER + description: commercetools Composable Commerce cloud identifier + required: true \ No newline at end of file diff --git a/application-templates/javascript/docs/README.md b/application-templates/javascript/docs/README.md index a4852bb..ef3c038 100644 --- a/application-templates/javascript/docs/README.md +++ b/application-templates/javascript/docs/README.md @@ -1 +1 @@ -This connector has sample `service` , `event` & `job` applications \ No newline at end of file +This connector has sample `service` , `event`, `job` & `mc-app` applications \ No newline at end of file diff --git a/application-templates/javascript/mc-app/README.md b/application-templates/javascript/mc-app/README.md new file mode 100644 index 0000000..fb6a10f --- /dev/null +++ b/application-templates/javascript/mc-app/README.md @@ -0,0 +1,3 @@ +To create Custom Application for the Merchant Center you can visit [getting starter documentation](https://docs.commercetools.com/custom-applications/getting-started). + +The easiest way to get started is to use Merchant Center's [starter template](https://docs.commercetools.com/custom-applications/getting-started#installing-a-starter-template). The app should live inside this folder and it should be the Custom Application's root folder. \ No newline at end of file diff --git a/application-templates/typescript/connect.yaml b/application-templates/typescript/connect.yaml index 3b7bffa..4cad605 100644 --- a/application-templates/typescript/connect.yaml +++ b/application-templates/typescript/connect.yaml @@ -54,4 +54,15 @@ deployAs: - key: CTP_CLIENT_SECRET description: commercetools Composable Commerce client secret - key: CTP_SCOPE - description: commercetools Composable Commerce client scope \ No newline at end of file + description: commercetools Composable Commerce client scope + - name: mc-app + applicationType: mc-app + endpoint: /mc-app + configuration: + standardConfiguration: + - key: APPLICATION_ID + description: commercetools Composable Commerce application ID + required: true + - key: CLOUD_IDENTIFIER + description: commercetools Composable Commerce cloud identifier + required: true \ No newline at end of file diff --git a/application-templates/typescript/docs/README.md b/application-templates/typescript/docs/README.md index a4852bb..ef3c038 100644 --- a/application-templates/typescript/docs/README.md +++ b/application-templates/typescript/docs/README.md @@ -1 +1 @@ -This connector has sample `service` , `event` & `job` applications \ No newline at end of file +This connector has sample `service` , `event`, `job` & `mc-app` applications \ No newline at end of file diff --git a/application-templates/typescript/mc-app/README.md b/application-templates/typescript/mc-app/README.md new file mode 100644 index 0000000..fb6a10f --- /dev/null +++ b/application-templates/typescript/mc-app/README.md @@ -0,0 +1,3 @@ +To create Custom Application for the Merchant Center you can visit [getting starter documentation](https://docs.commercetools.com/custom-applications/getting-started). + +The easiest way to get started is to use Merchant Center's [starter template](https://docs.commercetools.com/custom-applications/getting-started#installing-a-starter-template). The app should live inside this folder and it should be the Custom Application's root folder. \ No newline at end of file From 639340cebc4784729d5fbb220a739faa61b39892 Mon Sep 17 00:00:00 2001 From: Dario Ocles Date: Mon, 30 Oct 2023 16:59:31 +0100 Subject: [PATCH 2/3] fix: keeping / as endpoint in order to avoid confusion --- application-templates/javascript/connect.yaml | 2 +- application-templates/typescript/connect.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application-templates/javascript/connect.yaml b/application-templates/javascript/connect.yaml index e743c07..4396a3a 100644 --- a/application-templates/javascript/connect.yaml +++ b/application-templates/javascript/connect.yaml @@ -57,7 +57,7 @@ deployAs: description: commercetools Composable Commerce client scope - name: mc-app applicationType: mc-app - endpoint: /mc-app + endpoint: / configuration: standardConfiguration: - key: APPLICATION_ID diff --git a/application-templates/typescript/connect.yaml b/application-templates/typescript/connect.yaml index 4cad605..4283f62 100644 --- a/application-templates/typescript/connect.yaml +++ b/application-templates/typescript/connect.yaml @@ -57,7 +57,7 @@ deployAs: description: commercetools Composable Commerce client scope - name: mc-app applicationType: mc-app - endpoint: /mc-app + endpoint: / configuration: standardConfiguration: - key: APPLICATION_ID From d7150db3c7c98ad719cdf6a4960758f58d7761a0 Mon Sep 17 00:00:00 2001 From: Dario Ocles Date: Tue, 31 Oct 2023 09:39:31 +0100 Subject: [PATCH 3/3] fix: better description for mc-app variable's description --- application-templates/javascript/connect.yaml | 4 ++-- application-templates/typescript/connect.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application-templates/javascript/connect.yaml b/application-templates/javascript/connect.yaml index 4396a3a..e42b8fd 100644 --- a/application-templates/javascript/connect.yaml +++ b/application-templates/javascript/connect.yaml @@ -61,8 +61,8 @@ deployAs: configuration: standardConfiguration: - key: APPLICATION_ID - description: commercetools Composable Commerce application ID + description: The Custom Application ID is provided when you add a Custom Application in the Merchant Center required: true - key: CLOUD_IDENTIFIER - description: commercetools Composable Commerce cloud identifier + description: The identifier of the cloud Region that the Custom Application uses to connect to Composable Commerce. The values map to the actual Merchant Center API URL for that Region required: true \ No newline at end of file diff --git a/application-templates/typescript/connect.yaml b/application-templates/typescript/connect.yaml index 4283f62..6f23f7c 100644 --- a/application-templates/typescript/connect.yaml +++ b/application-templates/typescript/connect.yaml @@ -61,8 +61,8 @@ deployAs: configuration: standardConfiguration: - key: APPLICATION_ID - description: commercetools Composable Commerce application ID + description: The Custom Application ID is provided when you add a Custom Application in the Merchant Center required: true - key: CLOUD_IDENTIFIER - description: commercetools Composable Commerce cloud identifier + description: The identifier of the cloud Region that the Custom Application uses to connect to Composable Commerce. The values map to the actual Merchant Center API URL for that Region required: true \ No newline at end of file