Skip to content

Commit 72e1e89

Browse files
committed
Run Prettier for the whole project
1 parent 80e0246 commit 72e1e89

25 files changed

+119
-124
lines changed

.github/workflows/ci-cd-pipeline.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ jobs:
9696
token: ${{ secrets.GITHUB_TOKEN }}
9797
status: ${{ job.status }}
9898
deployment_id: ${{ steps.production_deployment.outputs.deployment_id }}
99-
env_url: ${{ steps.vercel_production.outputs.preview-url }}
99+
env_url: ${{ steps.vercel_production.outputs.preview-url }}

.github/workflows/prune-closed-pr-deployments.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
uses: strumwolf/delete-deployment-environment@v2
1717
with:
1818
token: ${{ secrets.GITHUB_TOKEN }}
19-
environment: ${{ env.GITHUB_HEAD_REF_SLUG_URL }}
19+
environment: ${{ env.GITHUB_HEAD_REF_SLUG_URL }}

.prettierrc.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ module.exports = {
44
useTabs: false,
55
semi: true,
66
singleQuote: true,
7-
quoteProps: "as-needed",
8-
trailingComma: "es5",
7+
quoteProps: 'as-needed',
8+
trailingComma: 'es5',
99
bracketSpacing: true,
10-
arrowParens: "avoid",
11-
endOfLine: "lf",
12-
}
10+
arrowParens: 'avoid',
11+
endOfLine: 'lf',
12+
};

README.md

+24-21
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ The official home of Superface docs.
55
## Updating the docs
66

77
1. ### Run the docs locally
8+
89
- Clone the repo, then `yarn install` and `yarn start`
910

1011
2. ### Update the content
11-
- Make your desired changes to the documents inside
12-
[`/docs`](https://github.com/superfaceai/docs/tree/main/docs) directory<br />
12+
13+
- Make your desired changes to the documents inside
14+
[`/docs`](https://github.com/superfaceai/docs/tree/main/docs) directory<br />
1315
It uses a standard Markdown syntax, but can be extended with custom React components via MDX.
1416

1517
<sup>[Help for Markdown features ➚](https://docusaurus.io/docs/markdown-features)</sup>
1618

17-
- Put your static content (e.g. images) to
18-
[`/static`](https://github.com/superfaceai/docs/tree/main/static) directory<br />
19+
- Put your static content (e.g. images) to
20+
[`/static`](https://github.com/superfaceai/docs/tree/main/static) directory<br />
1921
When linking to it from the docs, just drop `/static` from path, e.g. rendering `/img/diagram.png`
2022
will render an image saved at `/static/img/diagram.png`.
2123

@@ -44,16 +46,16 @@ The official home of Superface docs.
4446

4547
<sup>[Help for config ➚](https://docusaurus.io/docs/docusaurus.config.js)</sup>
4648

47-
4849
4. ### Get the changes reviewed
50+
4951
- When you're happy with your changes, open a PR and get it reviewed by someone.<br />
50-
_Opening a PR will automatically deploy an online preview of your docs. It also verifies the build
51-
doesn't contain any broken links._
52+
_Opening a PR will automatically deploy an online preview of your docs. It also verifies the build
53+
doesn't contain any broken links._
5254

5355
5. ### Deploy to production
54-
- Once your changes are verified and reviewed by another pair of eyes, it is ready to be merged to `main`.<br />
55-
_Merging will automatically deploy `main` branch to production._
5656

57+
- Once your changes are verified and reviewed by another pair of eyes, it is ready to be merged to `main`.<br />
58+
_Merging will automatically deploy `main` branch to production._
5759

5860
---
5961

@@ -63,20 +65,21 @@ _Merging will automatically deploy `main` branch to production._
6365
<br />
6466
These docs are built using https://docusaurus.io/.
6567

66-
The site is deployed on [Vercel](https://vercel.com/) to
67-
[`docs`](https://vercel.com/superface/docs) project.
68+
The site is deployed on [Vercel](https://vercel.com/) to
69+
[`docs`](https://vercel.com/superface/docs) project.
70+
71+
All deployments are automated via GitHub Actions and you can keep track of them
72+
in [the repository's environments](https://github.com/superfaceai/docs/deployments).
6873

69-
All deployments are automated via GitHub Actions and you can keep track of them
70-
in [the repository's environments](https://github.com/superfaceai/docs/deployments).
74+
- Preview: gets deployed for each PR
75+
- Production: gets deployed continuously from `main` branch
7176

72-
- Preview: gets deployed for each PR
73-
- Production: gets deployed continuously from `main` branch
77+
Each deploy first verifies the validity of the build.
7478

75-
Each deploy first verifies the validity of the build.
79+
If you'd like to build locally:
7680

77-
If you'd like to build locally:
81+
```bash
82+
yarn build
83+
```
7884

79-
```bash
80-
yarn build
81-
```
82-
</details>
85+
</details>

docs/comlink/comlink-intro.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ slug: /comlink
6262
</div>
6363
</div>
6464
</div>
65-
</div>
65+
</div>

docs/guides/add-new-provider.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This definition is later used by _Map_ documents that create a request/response
3232

3333
:::info Before you start
3434

35-
Please [check our registry for existing providers](./find-provider-by-name.md) before creating your own. Chances are the provider you're interested in was already defined by someone else.
35+
Please [check our registry for existing providers](./find-provider-by-name.md) before creating your own. Chances are the provider you're interested in was already defined by someone else.
3636

3737
In that case you can skip this guide & simply [create a mapping for the capability using an existing provider](./map-capability-to-provider.md).
3838

@@ -71,7 +71,6 @@ Running the above command creates a new JSON file at `<provider-name>.provider.j
7171

7272
To be able to call the provider's web services, you need to first define them. Each service points to a specific base URL and has an identifier that is unique within the provider document.
7373

74-
7574
```json title="<provider-name>.provider.json" {3-8}
7675
{
7776
"name": "<provider-name>",
@@ -116,7 +115,7 @@ If the provider offers a public API that _does not_ require any authentication,
116115

117116
:::
118117

119-
Define the expected form of authentication using _security schemes_. The actual credentials, tokens or keys will be provided later in runtime by the consumer either directly or via environment variables. Currently 3 types of security schemes are supported:
118+
Define the expected form of authentication using _security schemes_. The actual credentials, tokens or keys will be provided later in runtime by the consumer either directly or via environment variables. Currently 3 types of security schemes are supported:
120119

121120
- [Basic Auth](#basic-auth)
122121
- [Bearer Token](#bearer-token)
@@ -143,7 +142,7 @@ Use the following scheme with an arbitrary ID which can be referenced later from
143142
"id": "<scheme-id>",
144143
"type": "http",
145144
"scheme": "basic"
146-
}
145+
}
147146
]
148147
}
149148
```
@@ -185,7 +184,6 @@ _Replace the security scheme `id` value in the example with your own ID. Provide
185184

186185
Use the following scheme with an arbitrary ID which can be referenced later from the mapping.
187186

188-
189187
```json title="<provider-name>.provider.json" {10-17}
190188
{
191189
"name": "<provider-name>",
@@ -223,7 +221,6 @@ _e.g. `https://api.example.com/?accessKey=<apikey>`_
223221
- `in` must be set to `query`
224222
- `name` is the query param name that holds the API key (e.g. `accessKey`)
225223

226-
227224
## Examples
228225

229226
- [Provider using Basic auth](https://github.com/superfaceai/station/blob/main/providers/twilio.json)

docs/guides/create-new-capability.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Use the `--help` flag for more options and examples:
5757
```shell
5858
superface create --help
5959
```
60+
6061
:::
6162

6263
The CLI creates `use_case_name.supr` file in current directory and links to it from the `superface/super.json`.
@@ -150,7 +151,6 @@ If you prefer learning by example, you can check the source Comlink profile for
150151

151152
The use-case can be marked as `safe`, `unsafe` or `idempotent`. If the safety is not specified, the use-case is treated as `unsafe` by default.
152153

153-
154154
`safe`
155155
: The use-case doesn't change anything or doesn't perform any action. Generally reading operations can be considered safe, for example retrieving information about shipment or geocoding a postal address.
156156

@@ -189,7 +189,7 @@ While the safety information is optional, it can be used by OneSDK to treat the
189189

190190
### Define Input Fields {#input}
191191

192-
To execute the use-case, you typically need to provide some input. For example to send a text message, you need at least a recipient's phone number and the message's contents.
192+
To execute the use-case, you typically need to provide some input. For example to send a text message, you need at least a recipient's phone number and the message's contents.
193193

194194
In Comlink profile, the use-case's input is specified in the `input` block:
195195

@@ -272,7 +272,7 @@ The first description in the profile should explain the overall purpose of the u
272272
"""
273273
Shipment information
274274
275-
Track your shipment. Get the latest information on your shipment status.
275+
Track your shipment. Get the latest information on your shipment status.
276276
"""
277277
278278
name = "delivery-tracking/shipment-info"
@@ -353,8 +353,7 @@ Object
353353
: Corresponds to Object in JavaScript or Dictionary in Python.
354354
: Uses curly brackets, e.g. `{myField number}` defines an object with single field of type number.
355355

356-
Objects are commonly used to define inputs, results, and errors:
357-
356+
Objects are commonly used to define inputs, results, and errors:
358357

359358
```hcl
360359
usecase UseCaseName {
@@ -418,7 +417,6 @@ Note that marking the field as non-nullable doesn't make it required. To make th
418417

419418
In the above use-case the `trackingNumber` field is both required, and non-nullable:
420419

421-
422420
```hcl
423421
usecase UseCaseName {
424422
input {

docs/guides/find-provider-by-name.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ curl -H "Accept: application/json" https://superface.ai/providers/<provider-name
1212

1313
#### Using any other HTTP requesting tool
1414

15-
Send `GET` request to `https://superface.ai/providers/<provider-name>` with `Accept` header set to `application/json`.
15+
Send `GET` request to `https://superface.ai/providers/<provider-name>` with `Accept` header set to `application/json`.

docs/guides/map-capability-to-provider.md

+11-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The easiest way to then bootstrap a new Map document is using [Superface CLI](/r
2121
superface create --map --profileId <profile-name@version> --providerName <provider-name>
2222
```
2323

24-
_Replace the `<profile-name@version>` and `<provider-name>` in the command with the actual profile and provider you wish to create new Map for._
24+
_Replace the `<profile-name@version>` and `<provider-name>` in the command with the actual profile and provider you wish to create new Map for._
2525

2626
Running the above command creates a new Comlink file and links the new map in your local `super.json` configuration file. The new empty map will look something like this:
2727

@@ -35,7 +35,6 @@ Comment for the map to UseCaseName
3535
map UseCaseName {} // UseCaseName will be different based on the actual use case in the profile
3636
```
3737

38-
3938
## Map use cases
4039

4140
Every profile defines one or more _use cases_. You need to map the use case interfaces to the concrete requests and results towards a provider. If you used CLI to bootstrap the map, it will have pre-defined empty mappings for every profile use case.
@@ -49,7 +48,7 @@ You can access these inputs via `input` object which is available _inside use ca
4948
<details>
5049
<summary>Example</summary>
5150

52-
Given the following use case definition in a profile:
51+
Given the following use case definition in a profile:
5352

5453
```hcl title="profile.supr" {4-7}
5554
...
@@ -68,7 +67,7 @@ usecase GetWeather {
6867
...
6968
```
7069

71-
These input props are accessible in the use case mapping.
70+
These input props are accessible in the use case mapping.
7271

7372
```hcl title="profile.provider.suma" {4-6}
7473
...
@@ -149,7 +148,7 @@ map UseCaseName {
149148
}
150149
```
151150

152-
_The above definition makes call to `/api/messages?from=...` with body of content type `application/json` including object with 2 parameters (`to` & `text`).<br />See [Comlink reference](https://superface.ai/docs/comlink/map#sec-HTTP-Request) for details on `request` block._
151+
_The above definition makes call to `/api/messages?from=...` with body of content type `application/json` including object with 2 parameters (`to` & `text`).<br />See [Comlink reference](https://superface.ai/docs/comlink/map#sec-HTTP-Request) for details on `request` block._
153152

154153
### Handle server responses {#handle-response}
155154

@@ -177,8 +176,9 @@ map UseCaseName {
177176
```
178177

179178
_The above example definition:_
180-
- _handles any response with status code `201` and `application/json` content type in success context,_
181-
- _handles any response with status code `400` and `application/problem+json` content type in error context._
179+
180+
- _handles any response with status code `201` and `application/json` content type in success context,_
181+
- _handles any response with status code `400` and `application/problem+json` content type in error context._
182182

183183
_Any other response won't be handled and will result in an unexpected error_.
184184

@@ -245,8 +245,7 @@ map UseCaseName {
245245

246246
_The above definition maps the 2 expected result fields. One from the response's body, the other is loaded from headers and transformed with a simple Comlink expression.<br />See [Comlink reference](https://superface.ai/docs/comlink/map#sec-Map-Result) for detailed specification of `map result` statement._
247247

248-
249-
:::note
248+
:::note
250249

251250
`map result` is a regular Comlink statement; and as such can theoretically happen from anywhere inside the use case mapping, not necessarily from an inside of the response handler. An example of this would be a capability that doesn't need to call a remote server. However this is _very rare_ and the results are usually mapped from the HTTP responses so the example shows the most common place where the result mapping happens.
252251

@@ -286,8 +285,7 @@ map UseCaseName {
286285

287286
_The above definition maps the 2 expected error fields when server responds with status `429 (Too Many Requests)`. One is hardcoded as it describes the error scenario, the other constructs a helpful message with a value from response headers using a simple Comlink expression.<br />See [Comlink reference](https://superface.ai/docs/comlink/map#sec-Map-Error) for detailed specification of `map error` statement._
288287

289-
290-
:::note
288+
:::note
291289

292290
`map error` is a regular Comlink statement; and as such can theoretically happen from anywhere inside the use case mapping, not necessarily from an inside of the response handler. Although the errors are usually mapped from the failed HTTP responses, sometimes you might want to map error from different places. _One example would be validating the inputs against some domain rule. In such case, you might want to map error (or; fail early) when invalid inputs were provided, even before making the request._
293291

@@ -363,7 +361,7 @@ response 400 "application/problem+json" {
363361
return map error if (body.error_code === "InvalidPhone") {
364362
title = "Invalid phone number"
365363
detail = "Please provide phone number in E.164 format"
366-
}
364+
}
367365
368366
return map error if (body.error_code === "InvalidKey") {
369367
title = "Unauthorized"
@@ -397,4 +395,4 @@ Comlink supports everything you might expect from a powerful scripting language.
397395
## Examples {#examples}
398396

399397
- [Map with reusable operations, iterations & expressions](https://github.com/superfaceai/station/blob/main/capabilities/delivery-tracking/shipment-info/maps/dhl.suma)
400-
- [Map with multiple error response mappings](https://github.com/superfaceai/station/blob/main/capabilities/communication/send-email/maps/postmark.suma)
398+
- [Map with multiple error response mappings](https://github.com/superfaceai/station/blob/main/capabilities/communication/send-email/maps/postmark.suma)

0 commit comments

Comments
 (0)