Skip to content

Commit

Permalink
chore: adding mc-app example to application kit (#70)
Browse files Browse the repository at this point in the history
* chore: adding mc-app example to application kit

* fix: keeping / as endpoint in order to avoid confusion

* fix: better description for mc-app variable's description

---------

Co-authored-by: Dario Ocles <Dario Ocles>
  • Loading branch information
dario-commercetools authored Oct 31, 2023
1 parent 16a6c23 commit e2cfde1
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 17 deletions.
50 changes: 37 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <a href="https://en.wikipedia.org/wiki/Cron">cron</a> expression
13 changes: 12 additions & 1 deletion application-templates/javascript/connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,15 @@ deployAs:
- key: CTP_CLIENT_SECRET
description: commercetools Composable Commerce client secret
- key: CTP_SCOPE
description: commercetools Composable Commerce client scope
description: commercetools Composable Commerce client scope
- name: mc-app
applicationType: mc-app
endpoint: /
configuration:
standardConfiguration:
- key: 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: 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
2 changes: 1 addition & 1 deletion application-templates/javascript/docs/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This connector has sample `service` , `event` & `job` applications
This connector has sample `service` , `event`, `job` & `mc-app` applications
3 changes: 3 additions & 0 deletions application-templates/javascript/mc-app/README.md
Original file line number Diff line number Diff line change
@@ -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.
13 changes: 12 additions & 1 deletion application-templates/typescript/connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,15 @@ deployAs:
- key: CTP_CLIENT_SECRET
description: commercetools Composable Commerce client secret
- key: CTP_SCOPE
description: commercetools Composable Commerce client scope
description: commercetools Composable Commerce client scope
- name: mc-app
applicationType: mc-app
endpoint: /
configuration:
standardConfiguration:
- key: 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: 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
2 changes: 1 addition & 1 deletion application-templates/typescript/docs/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This connector has sample `service` , `event` & `job` applications
This connector has sample `service` , `event`, `job` & `mc-app` applications
3 changes: 3 additions & 0 deletions application-templates/typescript/mc-app/README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit e2cfde1

Please sign in to comment.