Skip to content

Commit 79f2153

Browse files
committed
docs: run lint and prettify
1 parent 58294b5 commit 79f2153

File tree

112 files changed

+1475
-1240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1475
-1240
lines changed

docs/.markdownlint.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,19 @@
44
"no-inline-html": {
55
"allowed_elements": [
66
"a",
7+
"br",
8+
"code",
9+
"div",
710
"img",
8-
"p"
11+
"iframe",
12+
"p",
13+
"pre",
14+
"sup",
15+
"CodeTabs",
16+
"Grid",
17+
"InfoBox",
18+
"LoomVideo",
19+
"WarningBox"
920
]
1021
},
1122
"no-trailing-punctuation": ""

docs/content/API-Reference/GraphQL-API.mdx

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ client. Instead inline variables directly in the query.
2222
</WarningBox>
2323

2424
First, ensure you're running Cube v0.28.58 or later. Then start the project
25-
locally in development mode, and navigate to
26-
`http://localhost:4000/` in your browser.
27-
After generating schema and running query you should see the GraphiQL interface if you click 'GraphiQL' button.
28-
If you click the 'Docs' button in the top-right, you can explore the introspected schema.
25+
locally in development mode, and navigate to `http://localhost:4000/` in your
26+
browser. After generating schema and running query you should see the GraphiQL
27+
interface if you click 'GraphiQL' button. If you click the 'Docs' button in the
28+
top-right, you can explore the introspected schema.
2929

3030
As an example, let's use the `Orders` cube from the example eCommerce database:
3131

@@ -126,10 +126,13 @@ Filters can be set on the load query or on a specific cube. Specifying the
126126
filter on the load query applies it to all cubes in the query. Filters can be
127127
added to the query as follows:
128128

129-
```
129+
```graphql
130130
query {
131131
cube(limit: 100, offset: 50, timezone: "America/Los_Angeles") {
132-
orders(orderBy: { createdAt: asc, count: desc }, where: {status: {equals: "completed"}}) {
132+
orders(
133+
orderBy: { createdAt: asc, count: desc }
134+
where: { status: { equals: "completed" } }
135+
) {
133136
count
134137
status
135138
createdAt
@@ -148,10 +151,13 @@ note:
148151

149152
The GraphQL API supports `@skip` and `@include` directives too:
150153

151-
```
154+
```graphql
152155
query GetOrders($byStatus: Boolean) {
153156
cube(limit: 100, offset: 50, timezone: "America/Los_Angeles") {
154-
orders(orderBy: { createdAt: asc, count: desc }, where: {status: {equals: "completed"}}) {
157+
orders(
158+
orderBy: { createdAt: asc, count: desc }
159+
where: { status: { equals: "completed" } }
160+
) {
155161
count
156162
status @include(if: $byStatus)
157163
createdAt
@@ -187,7 +193,7 @@ to our query as follows:
187193

188194
### <--{"id" : "Reference"}--> cube
189195

190-
```
196+
```graphql
191197
query {
192198
cube [([cubeQueryArgs])] {
193199
<cubeName> [([cubeArgs])] {
@@ -204,13 +210,13 @@ query {
204210

205211
### <--{"id" : "Reference"}--> CubeQueryArgs
206212

207-
| Key | Schema | Description |
208-
| ------------ | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
209-
| `where` | [`RootWhereInput`](#root-where-input) | Represents a SQL `WHERE` clause |
210-
| `limit` | `Int` | A row limit for your query. The default value is `10000`. The maximum allowed limit is `50000` |
211-
| `offset` | `Int` | The number of initial rows to be skipped for your query. The default value is `0` |
212-
| `timezone` | `String` | The timezone to use for the query. The default value is `UTC` |
213-
| `renewQuery` | `Boolean` | If `renewQuery` is set to `true`, Cube.js will renew all `refreshKey` for queries and query results in the foreground. The default value is `false` |
213+
| Key | Schema | Description |
214+
| ------------ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
215+
| `where` | [`RootWhereInput`](#root-where-input) | Represents a SQL `WHERE` clause |
216+
| `limit` | `Int` | A row limit for your query. The default value is `10000`. The maximum allowed limit is `50000` |
217+
| `offset` | `Int` | The number of initial rows to be skipped for your query. The default value is `0` |
218+
| `timezone` | `String` | The timezone to use for the query. The default value is `UTC` |
219+
| `renewQuery` | `Boolean` | If `renewQuery` is set to `true`, Cube will renew all `refreshKey` for queries and query results in the foreground. The default value is `false` |
214220

215221
### <--{"id" : "Reference"}--> RootWhereInput
216222

docs/content/API-Reference/Query-Format.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ A filter is a Javascript object with the following properties:
132132
- `values`: An array of values for the filter. Values must be of type String. If
133133
you need to pass a date, pass it as a string in `YYYY-MM-DD` format.
134134

135-
#### Filtering Dimensions vs Filtering Measures
135+
### <--{"id" : "Filters Format"}--> Filtering Dimensions vs Filtering Measures
136136

137137
Filters are applied differently to dimensions and measures.
138138

@@ -527,8 +527,8 @@ provides a convenient shortcut to pass a dimension and a filter as a
527527
previous period
528528
- `granularity`: A granularity for a time dimension. It supports the following
529529
values `second`, `minute`, `hour`, `day`, `week`, `month`, `quarter`, `year`.
530-
If you pass `null` to the granularity, Cube will only perform filtering by
531-
a specified time dimension, without grouping.
530+
If you pass `null` to the granularity, Cube will only perform filtering by a
531+
specified time dimension, without grouping.
532532

533533
```javascript
534534
{

docs/content/API-Reference/REST-API.mdx

Lines changed: 47 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ you can still use it to pass a security context.
3333

3434
### <--{"id" : "Prerequisites"}--> Example request
3535

36-
```bash
36+
```bash{promptUser: user}
3737
curl -H "Authorization: EXAMPLE-API-TOKEN" https://example.com/cubejs-api/v1/sql
3838
```
3939

@@ -129,13 +129,13 @@ Response
129129

130130
Example request:
131131

132-
```bash
132+
```bash{outputLines: 1,3-9,11-15}
133133
# Request with http method GET
134134
curl \
135-
-H "Authorization: EXAMPLE-API-TOKEN" \
136-
-G \
137-
--data-urlencode 'query={"measures":["Users.count"]}' \
138-
http://localhost:4000/cubejs-api/v1/load
135+
-H "Authorization: EXAMPLE-API-TOKEN" \
136+
-G \
137+
--data-urlencode 'query={"measures":["Users.count"]}' \
138+
http://localhost:4000/cubejs-api/v1/load
139139
140140
# Request with http method POST
141141
# Use POST to fix problem with query length limits
@@ -208,13 +208,13 @@ Response
208208

209209
Example request:
210210

211-
```bash
211+
```bash{outputLines: 2-6}
212212
curl \
213-
-H "Authorization: EXAMPLE-API-TOKEN" \
214-
-G \
215-
--data-urlencode 'query={"measures":["Users.count"],
216-
"timeDimensions":[{"dimension": "Users.createdAt","granularity":"day","dateRange":["2019-03-01","2019-03-31"]}]}' \
217-
http://localhost:4000/cubejs-api/v1/sql
213+
-H "Authorization: EXAMPLE-API-TOKEN" \
214+
-G \
215+
--data-urlencode 'query={"measures":["Users.count"],
216+
"timeDimensions":[{"dimension": "Users.createdAt","granularity":"day","dateRange":["2019-03-01","2019-03-31"]}]}' \
217+
http://localhost:4000/cubejs-api/v1/sql
218218
```
219219

220220
Example response:
@@ -268,11 +268,11 @@ Response
268268

269269
Example request:
270270

271-
```bash
271+
```bash{outputLines: 2-4}
272272
curl \
273-
-H "Authorization: EXAMPLE-API-TOKEN" \
274-
-G \
275-
http://localhost:4000/cubejs-api/v1/meta
273+
-H "Authorization: EXAMPLE-API-TOKEN" \
274+
-G \
275+
http://localhost:4000/cubejs-api/v1/meta
276276
```
277277

278278
Example response:
@@ -335,12 +335,12 @@ Empty object response if scheduled successfully.
335335

336336
Example request:
337337

338-
```bash
338+
```bash{outputLines: 2-5}
339339
curl \
340-
-H "Authorization: EXAMPLE-API-TOKEN" \
341-
-G \
342-
--data-urlencode 'queryingOptions={"timezone":"UTC"}' \
343-
http://localhost:4000/cubejs-api/v1/run-scheduled-refresh
340+
-H "Authorization: EXAMPLE-API-TOKEN" \
341+
-G \
342+
--data-urlencode 'queryingOptions={"timezone":"UTC"}' \
343+
http://localhost:4000/cubejs-api/v1/run-scheduled-refresh
344344
```
345345

346346
### <--{"id" : "API Reference"}--> /cubejs-system/v1/pre-aggregations/jobs
@@ -364,12 +364,12 @@ job.
364364

365365
Example request:
366366

367-
```bash
367+
```bash{outputLines: 2-5}
368368
curl \
369-
-d '{"action": "post", "selector": { "preAggregations": ["Orders.ordersByStatus"]}}' \
370-
-H "Authorization: EXAMPLE-API-TOKEN" \
371-
-X POST \
372-
https://localhost:4000/cubejs-system/v1/pre-aggregations/jobs
369+
-d '{"action": "post", "selector": { "preAggregations": ["Orders.ordersByStatus"]}}' \
370+
-H "Authorization: EXAMPLE-API-TOKEN" \
371+
-X POST \
372+
https://localhost:4000/cubejs-system/v1/pre-aggregations/jobs
373373
```
374374

375375
Example response:
@@ -396,12 +396,12 @@ a `tokens` property.
396396

397397
Example request:
398398

399-
```bash
399+
```bash{outputLines: 2-5}
400400
curl \
401-
-d '{"action": "get", "tokens": ["e9a6a0c55885cea5371348500ce7d7dc","d1329b6c8d152e734fc4dcf7307b1b58","6f4ea38373663fffc4334a576574845b","ea903b10634b2f3141b35a2529870e89"]}' \
402-
-H "Authorization: EXAMPLE-API-TOKEN" \
403-
-X POST \
404-
https://localhost:4000/cubejs-system/v1/pre-aggregations/jobs
401+
-d '{"action": "get", "tokens": ["e9a6a0c55885cea5371348500ce7d7dc","d1329b6c8d152e734fc4dcf7307b1b58","6f4ea38373663fffc4334a576574845b","ea903b10634b2f3141b35a2529870e89"]}' \
402+
-H "Authorization: EXAMPLE-API-TOKEN" \
403+
-X POST \
404+
https://localhost:4000/cubejs-system/v1/pre-aggregations/jobs
405405
```
406406

407407
Example response:
@@ -485,12 +485,12 @@ Example response:
485485

486486
Example request with `resType: object`:
487487

488-
```bash
488+
```bash{outputLines: 2-5}
489489
curl \
490-
-d '{"action": "get", "resType": "object", "tokens": ["e9a6a0c55885cea5371348500ce7d7dc","d1329b6c8d152e734fc4dcf7307b1b58","6f4ea38373663fffc4334a576574845b","ea903b10634b2f3141b35a2529870e89"]}' \
491-
-H "Authorization: EXAMPLE-API-TOKEN" \
492-
-X POST \
493-
https://localhost:4000/cubejs-system/v1/pre-aggregations/jobs
490+
-d '{"action": "get", "resType": "object", "tokens": ["e9a6a0c55885cea5371348500ce7d7dc","d1329b6c8d152e734fc4dcf7307b1b58","6f4ea38373663fffc4334a576574845b","ea903b10634b2f3141b35a2529870e89"]}' \
491+
-H "Authorization: EXAMPLE-API-TOKEN" \
492+
-X POST \
493+
https://localhost:4000/cubejs-system/v1/pre-aggregations/jobs
494494
```
495495

496496
Example response with `resType: object`:
@@ -578,15 +578,10 @@ connection to the default `dataSource`.
578578
**Multi-tenant:** Tests connections per-tenant. If no connections exist, it will
579579
report as successful.
580580

581-
Example request:
581+
Example of a successful request:
582582

583-
```bash
583+
```bash{outputLines: 2-12}
584584
curl -i http://localhost:4000/readyz
585-
```
586-
587-
Successful example response:
588-
589-
```bash
590585
HTTP/1.1 200 OK
591586
X-Powered-By: Express
592587
Access-Control-Allow-Origin: *
@@ -600,9 +595,10 @@ Keep-Alive: timeout=5
600595
{"health":"HEALTH"}
601596
```
602597

603-
Failure example response:
598+
Example of a failed response:
604599

605-
```bash
600+
```bash{outputLines: 2-12}
601+
curl -i http://localhost:4000/readyz
606602
HTTP/1.1 500 Internal Server Error
607603
X-Powered-By: Express
608604
Access-Control-Allow-Origin: *
@@ -622,13 +618,10 @@ Returns the liveness state of the deployment. This is confirmed by testing any
622618
existing connections to `dataSource`. If no connections exist, it will report as
623619
successful.
624620

625-
```bash
626-
curl -i http://localhost:4000/livez
627-
```
628-
629-
Successful example response:
621+
Example of a successful response:
630622

631-
```bash
623+
```bash{outputLines: 2-12}
624+
curl -i http://localhost:4000/livez
632625
HTTP/1.1 200 OK
633626
X-Powered-By: Express
634627
Access-Control-Allow-Origin: *
@@ -642,9 +635,10 @@ Keep-Alive: timeout=5
642635
{"health":"HEALTH"}
643636
```
644637

645-
Failure example response:
638+
Example of a failed response:
646639

647-
```bash
640+
```bash{outputLines: 2-12}
641+
curl -i http://localhost:4000/livez
648642
HTTP/1.1 500 Internal Server Error
649643
X-Powered-By: Express
650644
Access-Control-Allow-Origin: *

docs/content/Auth/AWS-Cognito.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ menuOrder: 4
99
## Introduction
1010

1111
In this guide, you'll learn how to integrate AWS Cognito authentication with a
12-
Cube.js deployment. If you already have a pre-existing Cognito User Pool in AWS
12+
Cube deployment. If you already have a pre-existing Cognito User Pool in AWS
1313
that you'd like to re-use, please skip ahead to
14-
[Configure Cube.js](#configure-cube-js).
14+
[Configure Cube](#configure-cube-js).
1515

1616
## Create and configure a User Pool
1717

@@ -68,13 +68,13 @@ left sidebar and associate the Lambda function you created previously:
6868
You can find more examples of [modifying claims in JWTs
6969
here][link-aws-cognito-pretoken-example].
7070

71-
## Configure Cube.js
71+
## Configure Cube
7272

73-
Now we're ready to configure Cube.js to use AWS Cognito. Go to your Cube.js
74-
project and open the `.env` file and add the following, replacing the values
75-
wrapped in `<>`.
73+
Now we're ready to configure Cube to use AWS Cognito. Go to your Cube project
74+
and open the `.env` file and add the following, replacing the values wrapped in
75+
`<>`.
7676

77-
```bash
77+
```dotenv
7878
CUBEJS_JWK_URL=https://cognito-idp.<AWS_REGION>.amazonaws.com/<USER_POOL_ID>/.well-known/jwks.json
7979
CUBEJS_JWT_AUDIENCE=<APPLICATION_URL>
8080
CUBEJS_JWT_ISSUER=https://cognito-idp.<AWS_REGION>.amazonaws.com/<USER_POOL_ID>

0 commit comments

Comments
 (0)