From e4671209b012fdf7a65a35f1a81ae79e77fdd1bc Mon Sep 17 00:00:00 2001 From: Harry Kimpel Date: Fri, 13 May 2022 00:28:14 +0200 Subject: [PATCH] Bindings commercetools (#2363) * Adding commercetools binding Signed-off-by: Harry Kimpel * Adding commercetools binding Signed-off-by: Harry Kimpel * Fixing GitHub Codespaces link validation issue Signed-off-by: Harry Kimpel * Updated docs for commercetools binding Signed-off-by: Harry Kimpel * Updated docs for commercetools binding Signed-off-by: Harry Kimpel * Updated docs for commercetools binding Signed-off-by: Harry Kimpel * Adding sample for commercetools GraphQL binding Signed-off-by: Harry Kimpel * Updated docs for Azure SQL database Signed-off-by: Harry Kimpel * Updating commercetools docs Signed-off-by: Harry Kimpel * Updating commercetools docs Signed-off-by: Harry Kimpel * Update daprdocs/content/en/reference/components-reference/supported-bindings/commercetools.md yes, fine with me Co-authored-by: Mark Fussell Co-authored-by: Yaron Schneider Co-authored-by: Mark Fussell --- .gitignore | 3 +- daprdocs/.gitignore | 1 + .../content/en/contributing/codespaces.md | 2 +- .../supported-bindings/_index.md | 1 + .../supported-bindings/commercetools.md | 71 +++++++++++++++++++ 5 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 daprdocs/content/en/reference/components-reference/supported-bindings/commercetools.md diff --git a/.gitignore b/.gitignore index 2cf039ab1..4fd695350 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ node_modules/ daprdocs/public daprdocs/resources/_gen .venv/ -.hugo_build.lock \ No newline at end of file +.hugo_build.lock +.dccache \ No newline at end of file diff --git a/daprdocs/.gitignore b/daprdocs/.gitignore index c2658d7d1..cbf1b3c91 100644 --- a/daprdocs/.gitignore +++ b/daprdocs/.gitignore @@ -1 +1,2 @@ node_modules/ +.dccache \ No newline at end of file diff --git a/daprdocs/content/en/contributing/codespaces.md b/daprdocs/content/en/contributing/codespaces.md index 993f3e2bd..c9e15e007 100644 --- a/daprdocs/content/en/contributing/codespaces.md +++ b/daprdocs/content/en/contributing/codespaces.md @@ -46,4 +46,4 @@ git reset --hard ``` ## Related links -- [GitHub documentation](https://docs.github.com/en/github/developing-online-with-codespaces/about-codespaces) +- [GitHub documentation](https://docs.github.com/en/codespaces/overview) diff --git a/daprdocs/content/en/reference/components-reference/supported-bindings/_index.md b/daprdocs/content/en/reference/components-reference/supported-bindings/_index.md index ea3cd2adb..8fcfdfc4d 100644 --- a/daprdocs/content/en/reference/components-reference/supported-bindings/_index.md +++ b/daprdocs/content/en/reference/components-reference/supported-bindings/_index.md @@ -26,6 +26,7 @@ Table captions: | Name | Input
Binding | Output
Binding | Status | Component version | Since runtime version | |------|:----------------:|:-----------------:|--------|-------- | ---------| | [Apple Push Notifications (APN)]({{< ref apns.md >}}) | | ✅ | Alpha | v1 | 1.0 | +| [commercetools]({{< ref commercetools.md >}}) | | ✅ | Alpha | v1 | 1.8 | | [Cron (Scheduler)]({{< ref cron.md >}}) | ✅ | ✅ | Alpha | v1 | 1.0 | | [GraphQL]({{< ref graghql.md >}}) | | ✅ | Alpha | v1 | 1.0 | | [HTTP]({{< ref http.md >}}) | | ✅ | Stable| v1 | 1.0 | diff --git a/daprdocs/content/en/reference/components-reference/supported-bindings/commercetools.md b/daprdocs/content/en/reference/components-reference/supported-bindings/commercetools.md new file mode 100644 index 000000000..9e16a2c48 --- /dev/null +++ b/daprdocs/content/en/reference/components-reference/supported-bindings/commercetools.md @@ -0,0 +1,71 @@ +--- +type: docs +title: "commercetools GraphQL binding spec" +linkTitle: "commercetools GraphQL" +description: "Detailed documentation on the commercetools GraphQL binding component" +aliases: + - "/operations/components/setup-bindings/supported-bindings/commercetools/" +--- + +## Component format + +To setup commercetools GraphQL binding create a component of type `bindings.commercetools`. See [this guide]({{< ref "howto-bindings.md#1-create-a-binding" >}}) on how to create and apply a binding configuration. + + + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: + namespace: +spec: + type: bindings.commercetools + version: v1 + metadata: + - name: region # required. + value: region + - name: provider # required. + value: provider (gcp/aws) + - name: projectKey # required. + value: project-key + - name: clientID # required. + value: ***************** + - name: clientSecret # required. + value: ***************** + - name: scopes # required. + value: scopes + +``` +{{% alert title="Warning" color="warning" %}} +The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}). +{{% /alert %}} + +## Spec metadata fields + +| Field | Required | Binding support | Details | Example | +|--------------------|:--------:|------------|-----|---------| +| region | Y | Output | The region of the commercetools project | `"europe-west1"` | +| provider | Y | Output | The cloud provider, either gcp or aws | `"gcp"` | +| projectKey | Y | Output | The commercetools project key | `"project-key"` | +| clientID | Y | Output | The commercetools client ID for the project | `"client ID"` | +| clientSecret | Y | Output | The commercetools client secret for the project | `"client secret"` | +| scopes | Y | Output | The commercetools scopes for the project | `"manage_project:project-key"` | + +For more information see [commercetools - Creating an API Client](https://docs.commercetools.com/tutorials/getting-started#creating-an-api-client) and [commercetools - Regions](https://docs.commercetools.com/api/general-concepts#regions). + +## Binding support + +This component supports **output binding** with the following operations: + +- `create` + + +## Related links + +- [Basic schema for a Dapr component]({{< ref component-schema >}}) +- [Bindings building block]({{< ref bindings >}}) +- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}}) +- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}}) +- [Bindings API reference]({{< ref bindings_api.md >}}) +- [Sample app](https://github.com/dapr/samples/tree/master/commercetools-graphql-sample) that leverages the commercetools binding with sample GraphQL query \ No newline at end of file