You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/spin/v2/http-trigger.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -265,11 +265,11 @@ For a full Rust SDK reference, see the [Rust Spin SDK documentation](https://doc
265
265
266
266
{{ startTab "TypeScript"}}
267
267
268
-
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
268
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/)
269
269
270
270
The user must a define a function named `handler` which the SDK attaches to the [`FetchEvent` listener](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent). Note that the incoming HTTP event is translated to a `FetchEvent`.
271
271
272
-
The handler function takes in two arguments a [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and a [ResponseBuilder](https://spinframework.github.io/spin-js-sdk/classes/ResponseBuilder.html)
272
+
The handler function takes in two arguments a [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and a [ResponseBuilder](https://spinframework.github.io/spin-js-sdk/v2.3/classes/ResponseBuilder.html)
Copy file name to clipboardexpand all lines: content/spin/v2/javascript-components.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ With JavaScript being a very popular language, Spin provides an SDK to support b
31
31
32
32
> All examples from this page can be found in [the JavaScript SDK repository on GitHub](https://github.com/spinframework/spin-js-sdk/tree/sdk-v2/examples).
33
33
34
-
[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
34
+
[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/)
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
86
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/)
87
87
88
-
The key value functions can be accessed after opening a store using either [the `Kv.open` or the `Kv.openDefault` methods](https://spinframework.github.io/spin-js-sdk/modules/Kv.html) which returns a [handle to the store](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html). For example:
88
+
The key value functions can be accessed after opening a store using either [the `Kv.open` or the `Kv.openDefault` methods](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Kv.html) which returns a [handle to the store](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Kv.Store.html). For example:
- The value argument is of the type `Uint8Array | string | object`.
111
111
112
-
[`setJson`](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#setJson) and [`getJson`**Operation**](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#getJson)
112
+
[`setJson`](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Kv.Store.html#setJson) and [`getJson`**Operation**](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Kv.Store.html#getJson)
113
113
- Applications can store JavaScript objects using `setJson`; these are serialized within the store as JSON. These serialized objects can be retrieved and deserialized using `getJson`. If you call `getJson` on a key that doesn't exist then it returns an empty object.
Copy file name to clipboardexpand all lines: content/spin/v2/language-support-overview.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ This page contains information about language support for Spin features:
37
37
38
38
{{ startTab "TypeScript"}}
39
39
40
-
**[📄 Visit the JS/TS Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/) to see specific modules, functions, variables and syntax relating to the following TS/JS features.**
40
+
**[📄 Visit the JS/TS Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/v2.3/) to see specific modules, functions, variables and syntax relating to the following TS/JS features.**
For full details of the MQTT API, see the [Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/modules/Mqtt.html)
75
+
For full details of the MQTT API, see the [Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Mqtt.html)
76
76
77
77
You can find a complete Rust code example for using outbound MQTT from an HTTP component in the [Spin Rust SDK repository on GitHub](https://github.com/spinframework/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-mqtt).
Copy file name to clipboardexpand all lines: content/spin/v2/rdbms-storage.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ For full information about the MySQL and PostgreSQL APIs, see [the Spin SDK refe
71
71
72
72
{{ startTab "TypeScript"}}
73
73
74
-
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
74
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/)
75
75
76
76
The code below is an [Outbound MySQL example](https://github.com/spinframework/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-mysql). There is also an outbound [PostgreSQL example](https://github.com/spinframework/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-postgres) available.
Copy file name to clipboardexpand all lines: content/spin/v2/redis-outbound.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -89,9 +89,9 @@ You can find a complete Rust code example for using outbound Redis from an HTTP
89
89
90
90
{{ startTab "TypeScript"}}
91
91
92
-
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
92
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/)
93
93
94
-
Redis functions are available on [the `Redis` module](https://spinframework.github.io/spin-js-sdk/modules/Redis.html). The function names match the operations above. For example:
94
+
Redis functions are available on [the `Redis` module](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Redis.html). The function names match the operations above. For example:
Copy file name to clipboardexpand all lines: content/spin/v2/serverless-ai-api-guide.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -112,9 +112,9 @@ The `infer_with_options` examples, operation:
112
112
113
113
{{ startTab "Typescript"}}
114
114
115
-
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Llm.html)
115
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Llm.html)
116
116
117
-
To use Serverless AI functions, [the `Llm` module](https://spinframework.github.io/spin-js-sdk/modules/Llm.html) from the Spin SDK provides two methods: `infer` and `generateEmbeddings`. For example:
117
+
To use Serverless AI functions, [the `Llm` module](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Llm.html) from the Spin SDK provides two methods: `infer` and `generateEmbeddings`. For example:
- It takes in the following arguments - model name, prompt and a optional third parameter for inferencing options.
137
-
- The model name is a string. There are enums for the inbuilt models (llama2-chat and codellama) in [`InferencingModels`](https://spinframework.github.io/spin-js-sdk/enums/Llm.InferencingModels.html).
138
-
- The optional third parameter which is an [InferencingOptions](https://spinframework.github.io/spin-js-sdk/interfaces/Llm.InferencingOptions.html) interface allows you to specify parameters such as `maxTokens`, `repeatPenalty`, `repeatPenaltyLastNTokenCount`, `temperature`, `topK`, `topP`.
139
-
- The return value is an [`InferenceResult`](https://spinframework.github.io/spin-js-sdk/interfaces/Llm.EmbeddingResult.html).
137
+
- The model name is a string. There are enums for the inbuilt models (llama2-chat and codellama) in [`InferencingModels`](https://spinframework.github.io/spin-js-sdk/v2.3/enums/Llm.InferencingModels.html).
138
+
- The optional third parameter which is an [InferencingOptions](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Llm.InferencingOptions.html) interface allows you to specify parameters such as `maxTokens`, `repeatPenalty`, `repeatPenaltyLastNTokenCount`, `temperature`, `topK`, `topP`.
139
+
- The return value is an [`InferenceResult`](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Llm.EmbeddingResult.html).
140
140
141
141
`generateEmbeddings` operation:
142
142
143
143
- It takes two arguments - model name and list of strings to generate the embeddings for.
144
-
- The model name is a string. There are enums for the inbuilt models (AllMiniLmL6V2) in [`EmbeddingModels`](https://spinframework.github.io/spin-js-sdk/enums/Llm.EmbeddingModels.html).
145
-
- The return value is an [`EmbeddingResult`](https://spinframework.github.io/spin-js-sdk/interfaces/Llm.EmbeddingResult.html)
144
+
- The model name is a string. There are enums for the inbuilt models (AllMiniLmL6V2) in [`EmbeddingModels`](https://spinframework.github.io/spin-js-sdk/v2.3/enums/Llm.EmbeddingModels.html).
145
+
- The return value is an [`EmbeddingResult`](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Llm.EmbeddingResult.html)
Copy file name to clipboardexpand all lines: content/spin/v2/sqlite-api-guide.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -120,9 +120,9 @@ struct ToDo {
120
120
121
121
{{ startTab "Typescript"}}
122
122
123
-
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Sqlite.html)
123
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Sqlite.html)
124
124
125
-
To use SQLite functions, use [the `Sqlite.open` or `Sqlite.openDefault` function](https://spinframework.github.io/spin-js-sdk/modules/Sqlite.html) to obtain [a `SqliteConnection` object](https://spinframework.github.io/spin-js-sdk/interfaces/Sqlite.SqliteConnection.html). `SqliteConnection` provides the `execute` method as described above. For example:
125
+
To use SQLite functions, use [the `Sqlite.open` or `Sqlite.openDefault` function](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Sqlite.html) to obtain [a `SqliteConnection` object](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Sqlite.SqliteConnection.html). `SqliteConnection` provides the `execute` method as described above. For example:
Copy file name to clipboardexpand all lines: content/spin/v3/http-trigger.md
+14-8
Original file line number
Diff line number
Diff line change
@@ -256,19 +256,25 @@ For a full Rust SDK reference, see the [Rust Spin SDK documentation](https://doc
256
256
257
257
{{ startTab "TypeScript"}}
258
258
259
-
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
259
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/)
260
260
261
-
The user must a define a function named `handler` which the SDK attaches to the [`FetchEvent` listener](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent). Note that the incoming HTTP event is translated to a `FetchEvent`.
261
+
Building a Spin HTTP component with the JavaScript/TypeScript SDK now involves adding an event listener for the `fetch` event. This event listener handles incoming HTTP requests and allows you to construct and return HTTP responses.
262
262
263
-
The handler function takes in two arguments a [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and a [ResponseBuilder](https://spinframework.github.io/spin-js-sdk/classes/ResponseBuilder.html)
263
+
Below is a complete implementation for such a component in TypeScript:
Copy file name to clipboardexpand all lines: content/spin/v3/javascript-components.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ With JavaScript being a very popular language, Spin provides an SDK to support b
30
30
31
31
> All examples from this page can be found in [the JavaScript SDK repository on GitHub](https://github.com/spinframework/spin-js-sdk/tree/main/examples).
32
32
33
-
[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
33
+
[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/)
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
86
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/)
87
87
88
-
The key value functions can be accessed after opening a store using either [the `Kv.open` or the `Kv.openDefault` methods](https://spinframework.github.io/spin-js-sdk/modules/Kv.html) which returns a [handle to the store](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html). For example:
88
+
The key value functions can be accessed after opening a store using either [the `Kv.open` or the `Kv.openDefault` methods](https://spinframework.github.io/spin-js-sdk/stable/modules/Kv.html) which returns a [handle to the store](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Kv.Store.html). For example:
- The value argument is of the type `Uint8Array | string | object`.
118
118
119
-
[`setJson`](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#setJson) and [`getJson`**Operation**](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#getJson)
119
+
[`setJson`](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Kv.Store.html#setJson) and [`getJson`**Operation**](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Kv.Store.html#getJson)
120
120
- Applications can store JavaScript objects using `setJson`; these are serialized within the store as JSON. These serialized objects can be retrieved and deserialized using `getJson`. If you call `getJson` on a key that doesn't exist then it returns an empty object.
Copy file name to clipboardexpand all lines: content/spin/v3/language-support-overview.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ This page contains information about language support for Spin features:
37
37
38
38
{{ startTab "TypeScript"}}
39
39
40
-
**[📄 Visit the JS/TS Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/) to see specific modules, functions, variables and syntax relating to the following TS/JS features.**
40
+
**[📄 Visit the JS/TS Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/stable/) to see specific modules, functions, variables and syntax relating to the following TS/JS features.**
For full details of the MQTT API, see the [Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/modules/Mqtt.html)
75
+
For full details of the MQTT API, see the [Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/stable/modules/Mqtt.html)
76
76
77
77
You can find a complete Rust code example for using outbound MQTT from an HTTP component in the [Spin Rust SDK repository on GitHub](https://github.com/spinframework/spin-js-sdk/tree/main/examples/spin-host-apis/spin-mqtt).
Copy file name to clipboardexpand all lines: content/spin/v3/rdbms-storage.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ For full information about the MySQL and PostgreSQL APIs, see [the Spin SDK refe
73
73
74
74
{{ startTab "TypeScript"}}
75
75
76
-
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
76
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/)
77
77
78
78
The code below is an [Outbound MySQL example](https://github.com/spinframework/spin-js-sdk/tree/main/examples/spin-host-apis/spin-mysql). There is also an outbound [PostgreSQL example](https://github.com/spinframework/spin-js-sdk/tree/main/examples/spin-host-apis/spin-postgres) available.
Copy file name to clipboardexpand all lines: content/spin/v3/redis-outbound.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -89,9 +89,9 @@ You can find a complete Rust code example for using outbound Redis from an HTTP
89
89
90
90
{{ startTab "TypeScript"}}
91
91
92
-
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/)
92
+
> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/)
93
93
94
-
Redis functions are available on [the `Redis` module](https://spinframework.github.io/spin-js-sdk/modules/Redis.html). The function names match the operations above. For example:
94
+
Redis functions are available on [the `Redis` module](https://spinframework.github.io/spin-js-sdk/stable/modules/Redis.html). The function names match the operations above. For example:
0 commit comments