Skip to content

Commit 02ffd3b

Browse files
authored
fix jolt metions (#305)
#299 Also, I changed CodeBlock to support more than one line of code.
1 parent b6db406 commit 02ffd3b

File tree

63 files changed

+614
-377
lines changed

Some content is hidden

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

63 files changed

+614
-377
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trying connection to fluvio router.infinyon.cloud:9003
2+
downloading infinyon/jolt@0.4.1 to infinyon-jolt-0.4.1.ipkg
3+
... downloading complete
4+
... checking package
5+
... cluster smartmodule install complete
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cdk hub download infinyon/http-source@0.3.8
1+
cdk hub download infinyon/http-source@0.3.8
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trying connection to fluvio router.infinyon.cloud:9003
2+
downloading infinyon/jolt@0.4.1 to infinyon-jolt-0.4.1.ipkg
3+
... downloading complete
4+
... checking package
5+
... cluster smartmodule install complete

docs/cloud/tutorials/mqtt-to-sql.mdx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,27 +137,20 @@ $ fluvio cloud connector create --config sql.yml
137137

138138
Download the [Jolt] and [Json-Sql] SmartModules used by this example connector
139139

140-
Example output
141-
140+
import CodeBlock from '@theme/CodeBlock';
141+
import SmDownloadJolt from '!!raw-loader!../../_embeds/cmds/hub-sm-download-jolt.bash';
142+
import SmDownloadJoltOutput from '!!raw-loader!../../_embeds/cmds/hub-sm-download-jolt-output.bash';
143+
import SmDownloadJsonSql from '!!raw-loader!../../_embeds/cmds/hub-sm-download-json-sql.bash';
144+
import SmDownloadJsonSqlOutput from '!!raw-loader!../../_embeds/cmds/hub-sm-download-json-sql-output.bash';
142145

143-
```bash
144-
$ fluvio hub sm download infinyon/json-sql@x.y.z
145-
downloading infinyon/json-sql@x.y.z to infinyon-json-sql-x.y.z.ipkg
146-
... downloading complete
147-
... checking package
148-
trying connection to fluvio router.infinyon.cloud:9003
149-
... cluster smartmodule install complete
150-
```
146+
<CodeBlock language="bash" copyBehavior="fl">$ {SmDownloadJsonSql} $ {SmDownloadJolt}</CodeBlock>
151147

148+
Expect the following output:
152149

153-
```bash
154-
$ fluvio hub sm download infinyon/jolt@x.y.z
155-
downloading infinyon/jolt@x.y.z to infinyon-jolt-x.y.z.ipkg
156-
... downloading complete
157-
... checking package
158-
trying connection to fluvio router.infinyon.cloud:9003
159-
... cluster smartmodule install complete
160-
```
150+
<CodeBlock language="bash">
151+
{SmDownloadJsonSqlOutput}
152+
{SmDownloadJoltOutput}
153+
</CodeBlock>
161154

162155
##### Connector with JSON to JSON transformation config
163156

docs/fluvio/concepts/transformations.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ Example:
2222

2323
```yaml
2424
transforms:
25-
- uses: infinyon/jolt@0.3.0
25+
- uses: infinyon/jolt@0.4.1
2626
with:
2727
spec:
2828
- operation: default
2929
spec:
3030
source: "http"
3131
```
3232
33-
we have one transformation, which is a SmartModule named [`infinyon/jolt@0.3.0`].
33+
we have one transformation, which is a SmartModule named [`infinyon/jolt@0.4.1`].
3434
The name must match a SmartModule previously downloaded to the Cluster:
3535

3636

3737
```bash
3838
fluvio sm list
3939
SMARTMODULE SIZE
40-
infinyon/jolt@0.3.0 608.4 KB
40+
infinyon/jolt@0.4.1 608.4 KB
4141
```
4242

4343

@@ -93,7 +93,7 @@ Multiple SmartModules can be activated in series. The output of the previous Sma
9393
9494
```yaml
9595
transforms:
96-
- uses: infinyon/jolt@0.3.0
96+
- uses: infinyon/jolt@0.4.1
9797
with:
9898
spec:
9999
- operation: shift
@@ -108,4 +108,4 @@ transforms:
108108
In this example, the `jolt` transformation is performed first, then its output is the input the `regex-filter`.
109109

110110
[SmartModules]: smartmodules/overview.mdx
111-
[`infinyon/jolt@0.3.0`]: hub/smartmodules/jolt.mdx
111+
[`infinyon/jolt@0.4.1`]: hub/smartmodules/jolt.mdx

docs/hub/smartmodules/jolt.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,23 @@ The Jolt SmartModule applies the operations in sequence: `remove` followed by `s
5252
To demonstrate how **Jolt** SmartModule works we will use [SMDK] tool.
5353

5454
:::info
55-
All smartmodule versions are marked with `x.y.z`. To find the latest version, run:
55+
All smartmodule versions are marked with `0.4.1`. To find the latest version, run:
5656
* `fluvio hub smartmodule list`
5757
:::
5858

5959
First, we need to download it to our cluster:
6060

61-
```bash copy="fl"
62-
$ fluvio hub smartmodule download infinyon/jolt@x.y.z
63-
```
61+
import CodeBlock from '@theme/CodeBlock';
62+
import SmDownloadJolt from '!!raw-loader!../../_embeds/cmds/hub-sm-download-jolt.bash';
63+
64+
<CodeBlock language="bash" copyBehavior="fl">$ {SmDownloadJolt}</CodeBlock>
6465

6566
Second, we create a file `transform.yaml` with transformation specification defined above:
6667

6768
```yaml
6869
# transform.yaml
6970
transforms:
70-
- uses: infinyon/jolt@x.y.z
71+
- uses: infinyon/jolt@0.4.1
7172
spec:
7273
- operation: remove
7374
spec:
@@ -113,4 +114,4 @@ For additional examples checkout the tutorials:
113114

114115
[Fluvio Jolt]: https://github.com/infinyon/fluvio-jolt
115116
[map-type]:smartmodules/features/operators/map.mdx
116-
[SMDK]: smartmodules/smdk.mdx
117+
[SMDK]: smartmodules/smdk.mdx

src/theme/CodeBlock/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@ function maybeStringifyChildren(children: ReactNode): ReactNode {
1717
return children;
1818
}
1919
// The children is now guaranteed to be one/more plain strings
20-
return Array.isArray(children) ? children.join('') : (children as string);
20+
21+
// If child is "$" or "$$" jump to the next line, if not add a space
22+
return React.Children.toArray(children).map((child, index) => {
23+
if (typeof child === 'string') {
24+
if (index > 0) {
25+
return child.replace(/\$\$?/g, (match) => (match === '$' ? '\n$' : ' '));
26+
}
27+
}
28+
return child;
29+
});
2130
}
2231

2332
export default function CodeBlock({
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cdk deploy start --ipkg infinyon-http-sink-0.2.11.ipkg --config <CONFIG>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cdk hub download infinyon/http-sink@0.2.11
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trying connection to fluvio router.infinyon.cloud:9003
2+
downloading infinyon/jolt@0.4.1 to infinyon-jolt-0.4.1.ipkg
3+
... downloading complete
4+
... checking package
5+
... cluster smartmodule install complete
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cdk hub download infinyon/http-source@0.3.8
1+
cdk hub download infinyon/http-source@0.3.8
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
fluvio hub connector list
2+
CONNECTOR Visibility
3+
infinyon-labs/graphite-sink@0.2.0 public
4+
infinyon/duckdb-sink@0.1.0 public
5+
infinyon/http-sink@0.2.11 public
6+
infinyon/http-source@0.4.3 public
7+
infinyon/ic-webhook-source@0.1.4 public
8+
infinyon/inf-webhook-source@0.1.9 public
9+
infinyon/kafka-sink@0.2.9 public
10+
infinyon/kafka-source@0.2.7 public
11+
infinyon/mqtt-source@0.2.9 public
12+
infinyon/sql-sink@0.4.3 public
13+
qdrant/qdrant-sink@0.1.0 public
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trying connection to fluvio router.infinyon.cloud:9003
2+
downloading infinyon/jolt@0.4.1 to infinyon-jolt-0.4.1.ipkg
3+
... downloading complete
4+
... checking package
5+
... cluster smartmodule install complete
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
fluvio hub smartmodule download infinyon/jolt@0.4.1
2-
... cluster smartmodule install complete
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trying connection to fluvio router.infinyon.cloud:9003
2+
downloading infinyon/json-sql@0.2.1 to infinyon-json-sql-0.2.1.ipkg
3+
... downloading complete
4+
... checking package
5+
... cluster smartmodule install complete
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
fluvio hub smartmodule list
2+
SMARTMODULE Visibility
3+
infinyon-labs/array-map-json@0.1.1 public
4+
infinyon-labs/csv-json@0.2.0 public
5+
infinyon-labs/dedup-filter@0.0.2 public
6+
infinyon-labs/json-formatter@0.1.3 public
7+
infinyon-labs/key-gen-json@0.1.1 public
8+
infinyon-labs/regex-map-json@0.1.2 public
9+
infinyon-labs/regex-map@0.1.1 public
10+
infinyon-labs/rss-json@0.1.1 public
11+
infinyon-labs/stars-forks-changes@0.1.4 public
12+
infinyon/csv-json@0.2.0 public
13+
infinyon/jolt@0.4.1 public
14+
infinyon/json-sql@0.2.1 public
15+
infinyon/regex-filter@0.2.0 public

versioned_docs/version-0.11.11/cloud/tutorials/mqtt-to-sql.mdx

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ transforms:
117117
json-key: "payload.device.device_id"
118118
value:
119119
type: "int"
120-
default: "0"
120+
defau1t: "0"
121121
required: true
122122
"record":
123123
json-key: "$"
@@ -137,27 +137,20 @@ $ fluvio cloud connector create --config sql.yml
137137

138138
Download the [Jolt] and [Json-Sql] SmartModules used by this example connector
139139

140-
Example output
140+
import CodeBlock from '@theme/CodeBlock';
141+
import SmDownloadJolt from '!!raw-loader!../../_embeds/cmds/hub-sm-download-jolt.bash';
142+
import SmDownloadJoltOutput from '!!raw-loader!../../_embeds/cmds/hub-sm-download-jolt-output.bash';
143+
import SmDownloadJsonSql from '!!raw-loader!../../_embeds/cmds/hub-sm-download-json-sql.bash';
144+
import SmDownloadJsonSqlOutput from '!!raw-loader!../../_embeds/cmds/hub-sm-download-json-sql-output.bash';
141145

146+
<CodeBlock language="bash" copyBehavior="fl">$ {SmDownloadJsonSql} $ {SmDownloadJolt}</CodeBlock>
142147

143-
```bash
144-
$ fluvio hub sm download infinyon/json-sql@x.y.z
145-
downloading infinyon/json-sql@x.y.z to infinyon-json-sql-x.y.z.ipkg
146-
... downloading complete
147-
... checking package
148-
trying connection to fluvio router.infinyon.cloud:9003
149-
... cluster smartmodule install complete
150-
```
151-
148+
Expect the following output:
152149

153-
```bash
154-
$ fluvio hub sm download infinyon/jolt@x.y.z
155-
downloading infinyon/jolt@x.y.z to infinyon-jolt-x.y.z.ipkg
156-
... downloading complete
157-
... checking package
158-
trying connection to fluvio router.infinyon.cloud:9003
159-
... cluster smartmodule install complete
160-
```
150+
<CodeBlock language="bash">
151+
{SmDownloadJsonSqlOutput}
152+
{SmDownloadJoltOutput}
153+
</CodeBlock>
161154

162155
##### Connector with JSON to JSON transformation config
163156

versioned_docs/version-0.11.11/fluvio/cli/fluvio/hub/list.mdx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ title: "list"
44
description: "Retrieves all SmartModules available for download in the Hub for a specific user"
55
---
66

7+
import CodeBlock from '@theme/CodeBlock';
8+
import HubSmListCmd from '!!raw-loader!../../../../_embeds/cmds/hub-sm-list.bash';
9+
710
# The `fluvio hub list` command
811

912
List operation retrieves all SmartModules available for download in the SmartModule Hub for a specific user.
@@ -14,15 +17,7 @@ By default, users can retrieve all public SmartModules and all private SmartModu
1417

1518
Listing Hub SmartModule from the CLI is straight forward:
1619

17-
```bash copy="fl"
18-
$ fluvio hub list
19-
20-
SMARTMODULE Visibility
21-
infinyon/jolt@0.1.0 public
22-
infinyon/json-sql@0.2.1 public
23-
infinyon/regex-filter@0.1.0 public
24-
...
25-
```
20+
<CodeBlock language="bash" copyBehavior="fl">$ {HubSmListCmd}</CodeBlock>
2621

2722
[`InfinyOn Cloud`]: https://infinyon.cloud/
2823
[ Download Fluvio CLI ]: /cli

versioned_docs/version-0.11.11/fluvio/concepts/transformations.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ Example:
2222

2323
```yaml
2424
transforms:
25-
- uses: infinyon/jolt@0.3.0
25+
- uses: infinyon/jolt@0.4.1
2626
with:
2727
spec:
2828
- operation: default
2929
spec:
3030
source: "http"
3131
```
3232
33-
we have one transformation, which is a SmartModule named [`infinyon/jolt@0.3.0`].
33+
we have one transformation, which is a SmartModule named [`infinyon/jolt@0.4.1`].
3434
The name must match a SmartModule previously downloaded to the Cluster:
3535

3636

3737
```bash
3838
fluvio sm list
3939
SMARTMODULE SIZE
40-
infinyon/jolt@0.3.0 608.4 KB
40+
infinyon/jolt@0.4.1 608.4 KB
4141
```
4242

4343

@@ -93,7 +93,7 @@ Multiple SmartModules can be activated in series. The output of the previous Sma
9393
9494
```yaml
9595
transforms:
96-
- uses: infinyon/jolt@0.3.0
96+
- uses: infinyon/jolt@0.4.1
9797
with:
9898
spec:
9999
- operation: shift
@@ -108,4 +108,4 @@ transforms:
108108
In this example, the `jolt` transformation is performed first, then its output is the input the `regex-filter`.
109109

110110
[SmartModules]: smartmodules/overview.mdx
111-
[`infinyon/jolt@0.3.0`]: hub/smartmodules/jolt.mdx
111+
[`infinyon/jolt@0.4.1`]: hub/smartmodules/jolt.mdx

versioned_docs/version-0.11.11/hub/smartmodules/jolt.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,23 @@ The Jolt SmartModule applies the operations in sequence: `remove` followed by `s
5252
To demonstrate how **Jolt** SmartModule works we will use [SMDK] tool.
5353

5454
:::info
55-
All smartmodule versions are marked with `x.y.z`. To find the latest version, run:
55+
All smartmodule versions are marked with `0.4.1`. To find the latest version, run:
5656
* `fluvio hub smartmodule list`
5757
:::
5858

5959
First, we need to download it to our cluster:
6060

61-
```bash copy="fl"
62-
$ fluvio hub smartmodule download infinyon/jolt@x.y.z
63-
```
61+
import CodeBlock from '@theme/CodeBlock';
62+
import SmDownloadJolt from '!!raw-loader!../../_embeds/cmds/hub-sm-download-jolt.bash';
63+
64+
<CodeBlock language="bash" copyBehavior="fl">$ {SmDownloadJolt}</CodeBlock>
6465

6566
Second, we create a file `transform.yaml` with transformation specification defined above:
6667

6768
```yaml
6869
# transform.yaml
6970
transforms:
70-
- uses: infinyon/jolt@x.y.z
71+
- uses: infinyon/jolt@0.4.1
7172
spec:
7273
- operation: remove
7374
spec:
@@ -86,7 +87,7 @@ Let's use `smdk test` to see it in action:
8687

8788
```bash copy="fl"
8889
$ smdk test --text '{}' --transforms-file ./transform.yaml
89-
1 records outputed
90+
1 records outputted
9091
{"data":{"source":"http-connector"}}
9192
```
9293

@@ -113,4 +114,4 @@ For additional examples checkout the tutorials:
113114

114115
[Fluvio Jolt]: https://github.com/infinyon/fluvio-jolt
115116
[map-type]:smartmodules/features/operators/map.mdx
116-
[SMDK]: smartmodules/smdk.mdx
117+
[SMDK]: smartmodules/smdk.mdx

0 commit comments

Comments
 (0)