diff --git a/versioned_docs/version-latest/04-standard-library/05-ex/_category_.yml b/versioned_docs/version-latest/04-standard-library/05-ex/_category_.yml new file mode 100644 index 000000000..763de0ca0 --- /dev/null +++ b/versioned_docs/version-latest/04-standard-library/05-ex/_category_.yml @@ -0,0 +1,3 @@ +label: External libraries +collapsible: true +collapsed: true diff --git a/versioned_docs/version-latest/04-standard-library/05-ex/api-reference.md b/versioned_docs/version-latest/04-standard-library/05-ex/api-reference.md new file mode 100644 index 000000000..9973fde3f --- /dev/null +++ b/versioned_docs/version-latest/04-standard-library/05-ex/api-reference.md @@ -0,0 +1,814 @@ +--- +title: API reference +id: api-reference +description: Wing standard library API reference for the ex module +keywords: [Wing sdk, sdk, Wing API Reference] +hide_title: true +sidebar_position: 100 +--- + + + +# API Reference + +## Resources + +### Redis + +**Inflight client:** [@winglang/sdk.ex.IRedisClient](#@winglang/sdk.ex.IRedisClient) + +A cloud redis db. + +#### Initializers + +```wing +bring ex; + +new ex.Redis(); +``` + +| **Name** | **Type** | **Description** | +| --- | --- | --- | + +--- + + + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| node | constructs.Node | The tree node. | +| display | Display | Information on how to display a resource in the UI. | + +--- + +##### `node`Required + +```wing +node: Node; +``` + +- *Type:* constructs.Node + +The tree node. + +--- + +##### `display`Required + +```wing +display: Display; +``` + +- *Type:* Display + +Information on how to display a resource in the UI. + +--- + + +### Table + +**Inflight client:** [@winglang/sdk.ex.ITableClient](#@winglang/sdk.ex.ITableClient) + +A NoSQL database table that can be used to store and query data. + +#### Initializers + +```wing +bring ex; + +new ex.Table(props: TableProps); +``` + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| props | TableProps | *No description.* | + +--- + +##### `props`Required + +- *Type:* TableProps + +--- + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| addRow | Add a row to the table that is created when the app is deployed. | + +--- + +##### `addRow` + +```wing +addRow(key: str, row: Json): void +``` + +Add a row to the table that is created when the app is deployed. + +###### `key`Required + +- *Type:* str + +--- + +###### `row`Required + +- *Type:* Json + +--- + + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| node | constructs.Node | The tree node. | +| display | Display | Information on how to display a resource in the UI. | +| columns | MutMap<ColumnType> | Table columns. | +| name | str | Table name. | +| primaryKey | str | Table primary key name. | + +--- + +##### `node`Required + +```wing +node: Node; +``` + +- *Type:* constructs.Node + +The tree node. + +--- + +##### `display`Required + +```wing +display: Display; +``` + +- *Type:* Display + +Information on how to display a resource in the UI. + +--- + +##### `columns`Required + +```wing +columns: MutMap; +``` + +- *Type:* MutMap<ColumnType> + +Table columns. + +--- + +##### `name`Required + +```wing +name: str; +``` + +- *Type:* str + +Table name. + +--- + +##### `primaryKey`Required + +```wing +primaryKey: str; +``` + +- *Type:* str + +Table primary key name. + +--- + + +## Classes + +### RedisClientBase + +- *Implements:* IRedisClient + +Base class for `Redis` Client. + +#### Initializers + +```wing +bring ex; + +new ex.RedisClientBase(); +``` + +| **Name** | **Type** | **Description** | +| --- | --- | --- | + +--- + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| del | Removes the specified key. | +| get | Get value at given key. | +| hget | Returns the value associated with field in the hash stored at key. | +| hset | Sets the specified field to respective value in the hash stored at key. | +| rawClient | Get raw redis client (currently IoRedis). | +| sadd | Add the specified members to the set stored at key. | +| set | Set key value pair. | +| smembers | Returns all the members of the set value stored at key. | +| url | Get url of redis server. | + +--- + +##### `del` + +```wing +del(key: str): num +``` + +Removes the specified key. + +###### `key`Required + +- *Type:* str + +--- + +##### `get` + +```wing +get(key: str): str +``` + +Get value at given key. + +###### `key`Required + +- *Type:* str + +--- + +##### `hget` + +```wing +hget(key: str, field: str): str +``` + +Returns the value associated with field in the hash stored at key. + +###### `key`Required + +- *Type:* str + +--- + +###### `field`Required + +- *Type:* str + +--- + +##### `hset` + +```wing +hset(key: str, field: str, value: str): num +``` + +Sets the specified field to respective value in the hash stored at key. + +###### `key`Required + +- *Type:* str + +--- + +###### `field`Required + +- *Type:* str + +--- + +###### `value`Required + +- *Type:* str + +--- + +##### `rawClient` + +```wing +rawClient(): any +``` + +Get raw redis client (currently IoRedis). + +##### `sadd` + +```wing +sadd(key: str, value: str): num +``` + +Add the specified members to the set stored at key. + +###### `key`Required + +- *Type:* str + +--- + +###### `value`Required + +- *Type:* str + +--- + +##### `set` + +```wing +set(key: str, value: str): void +``` + +Set key value pair. + +###### `key`Required + +- *Type:* str + +--- + +###### `value`Required + +- *Type:* str + +--- + +##### `smembers` + +```wing +smembers(key: str): MutArray +``` + +Returns all the members of the set value stored at key. + +###### `key`Required + +- *Type:* str + +--- + +##### `url` + +```wing +url(): str +``` + +Get url of redis server. + + + + +## Structs + +### TableProps + +Properties for `Table`. + +#### Initializer + +```wing +bring ex; + +let TableProps = ex.TableProps{ ... }; +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| columns | MutMap<ColumnType> | The table's columns. | +| initialRows | MutMap<Json> | The table's initial rows. | +| name | str | The table's name. | +| primaryKey | str | The table's primary key. | + +--- + +##### `columns`Optional + +```wing +columns: MutMap; +``` + +- *Type:* MutMap<ColumnType> +- *Default:* undefined + +The table's columns. + +--- + +##### `initialRows`Optional + +```wing +initialRows: MutMap; +``` + +- *Type:* MutMap<Json> +- *Default:* undefined + +The table's initial rows. + +--- + +##### `name`Optional + +```wing +name: str; +``` + +- *Type:* str +- *Default:* undefined + +The table's name. + +--- + +##### `primaryKey`Optional + +```wing +primaryKey: str; +``` + +- *Type:* str +- *Default:* undefined + +The table's primary key. + +No two rows can have the same value for the +primary key. + +--- + +## Protocols + +### IRedisClient + +- *Implemented By:* RedisClientBase, IRedisClient + +Inflight interface for `Redis`. + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| del | Removes the specified key. | +| get | Get value at given key. | +| hget | Returns the value associated with field in the hash stored at key. | +| hset | Sets the specified field to respective value in the hash stored at key. | +| rawClient | Get raw redis client (currently IoRedis). | +| sadd | Add the specified members to the set stored at key. | +| set | Set key value pair. | +| smembers | Returns all the members of the set value stored at key. | +| url | Get url of redis server. | + +--- + +##### `del` + +```wing +inflight del(key: str): num +``` + +Removes the specified key. + +###### `key`Required + +- *Type:* str + +the key. + +--- + +##### `get` + +```wing +inflight get(key: str): str +``` + +Get value at given key. + +###### `key`Required + +- *Type:* str + +the key to get. + +--- + +##### `hget` + +```wing +inflight hget(key: str, field: str): str +``` + +Returns the value associated with field in the hash stored at key. + +###### `key`Required + +- *Type:* str + +the key. + +--- + +###### `field`Required + +- *Type:* str + +the field at given key. + +--- + +##### `hset` + +```wing +inflight hset(key: str, field: str, value: str): num +``` + +Sets the specified field to respective value in the hash stored at key. + +###### `key`Required + +- *Type:* str + +key to set. + +--- + +###### `field`Required + +- *Type:* str + +field in key to set. + +--- + +###### `value`Required + +- *Type:* str + +value to set at field in key. + +--- + +##### `rawClient` + +```wing +inflight rawClient(): any +``` + +Get raw redis client (currently IoRedis). + +##### `sadd` + +```wing +inflight sadd(key: str, value: str): num +``` + +Add the specified members to the set stored at key. + +###### `key`Required + +- *Type:* str + +the key. + +--- + +###### `value`Required + +- *Type:* str + +the value to add to the set at given key. + +--- + +##### `set` + +```wing +inflight set(key: str, value: str): void +``` + +Set key value pair. + +###### `key`Required + +- *Type:* str + +the key to set. + +--- + +###### `value`Required + +- *Type:* str + +the value to store at given key. + +--- + +##### `smembers` + +```wing +inflight smembers(key: str): MutArray +``` + +Returns all the members of the set value stored at key. + +###### `key`Required + +- *Type:* str + +the key. + +--- + +##### `url` + +```wing +inflight url(): str +``` + +Get url of redis server. + + +### ITableClient + +- *Implemented By:* ITableClient + +Inflight interface for `Table`. + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| delete | Delete a row from the table, by primary key. | +| get | Get a row from the table, by primary key. | +| insert | Insert a row into the table. | +| list | List all rows in the table. | +| update | Update a row in the table. | + +--- + +##### `delete` + +```wing +inflight delete(key: str): void +``` + +Delete a row from the table, by primary key. + +###### `key`Required + +- *Type:* str + +primary key to delete the row. + +--- + +##### `get` + +```wing +inflight get(key: str): Json +``` + +Get a row from the table, by primary key. + +###### `key`Required + +- *Type:* str + +primary key to search. + +--- + +##### `insert` + +```wing +inflight insert(key: str, row: Json): void +``` + +Insert a row into the table. + +###### `key`Required + +- *Type:* str + +primary key to insert the row. + +--- + +###### `row`Required + +- *Type:* Json + +data to be inserted. + +--- + +##### `list` + +```wing +inflight list(): MutArray +``` + +List all rows in the table. + +##### `update` + +```wing +inflight update(key: str, row: Json): void +``` + +Update a row in the table. + +###### `key`Required + +- *Type:* str + +primary key to update the row. + +--- + +###### `row`Required + +- *Type:* Json + +data to be updated. + +--- + + +## Enums + +### ColumnType + +Table column types. + +#### Members + +| **Name** | **Description** | +| --- | --- | +| STRING | string type. | +| NUMBER | number type. | +| BOOLEAN | bool type. | +| DATE | date type. | +| JSON | json type. | + +--- + +##### `STRING` + +string type. + +--- + + +##### `NUMBER` + +number type. + +--- + + +##### `BOOLEAN` + +bool type. + +--- + + +##### `DATE` + +date type. + +--- + + +##### `JSON` + +json type. + +--- + diff --git a/versioned_docs/version-latest/999-faq/004-what-pains-wing-solves.md b/versioned_docs/version-latest/999-faq/004-what-pains-wing-solves.md index b64d19934..d9a1af482 100644 --- a/versioned_docs/version-latest/999-faq/004-what-pains-wing-solves.md +++ b/versioned_docs/version-latest/999-faq/004-what-pains-wing-solves.md @@ -25,4 +25,4 @@ Wing aims to enhance the developer experience by treating the entire cloud as it We'd like developers be able to write code with a "pencil" rather than a "pen," iterating quickly and learning from their mistakes. They could make a change and test it within milliseconds, even without WiFi. -You can experience how far Wing has advanced on its journey to solve the above pain points and enhance the cloud development experience in our [playground](https://www.winglang.io/play/). +You can experience how far Wing has advanced on its journey to solve the above pain points and enhance the cloud development experience in our [playground](https://play.winglang.io). \ No newline at end of file diff --git a/versioned_docs/version-latest/999-faq/040-alternatives/041-terraform-vs-wing.md b/versioned_docs/version-latest/999-faq/040-alternatives/041-terraform-vs-wing.md index 55e799b4c..da0080fd7 100644 --- a/versioned_docs/version-latest/999-faq/040-alternatives/041-terraform-vs-wing.md +++ b/versioned_docs/version-latest/999-faq/040-alternatives/041-terraform-vs-wing.md @@ -40,4 +40,4 @@ import CodeComparison from '../../src/components/CodeComparison'; | Provisioning engine | Same code compiles to Terraform or AWS-CDK (CloudFormation) | Terraform | | Testing | Same tests run on local simulator and cloud, without mocks | Need mocks for local testing | -You can get a sense of the development experience with Wing in our [playground](https://www.winglang.io/play/). +You can get a sense of the development experience with Wing in our [playground](https://play.winglang.io/). diff --git a/versioned_docs/version-latest/999-faq/040-alternatives/042-pulumi-vs-wing.md b/versioned_docs/version-latest/999-faq/040-alternatives/042-pulumi-vs-wing.md index ca4c68597..926816f29 100644 --- a/versioned_docs/version-latest/999-faq/040-alternatives/042-pulumi-vs-wing.md +++ b/versioned_docs/version-latest/999-faq/040-alternatives/042-pulumi-vs-wing.md @@ -40,4 +40,4 @@ import CodeComparison from '../../src/components/CodeComparison'; | Testing | Same tests run on local simulator and cloud, without mocks | Need mocks for local testing | -You can get a sense of the development experience with Wing in our [playground](https://www.winglang.io/play/). +You can get a sense of the development experience with Wing in our [playground](https://play.winglang.io/). diff --git a/versioned_docs/version-latest/999-faq/040-alternatives/043-awscdk-vs-wing.md b/versioned_docs/version-latest/999-faq/040-alternatives/043-awscdk-vs-wing.md index a73789305..0ebf8606f 100644 --- a/versioned_docs/version-latest/999-faq/040-alternatives/043-awscdk-vs-wing.md +++ b/versioned_docs/version-latest/999-faq/040-alternatives/043-awscdk-vs-wing.md @@ -41,4 +41,4 @@ import CodeComparison from '../../src/components/CodeComparison'; | Provisioning engine | Same code compiles to Terraform and AWS-CDK (CloudFormation) | CloudFormation (CDKTF is used for Terraform, but you cannot compile the same code to different engines) | | Testing | Same tests run on local simulator and cloud, without mocks | Need mocks for local testing | -You can get a sense of the development experience with Wing in our [playground](https://www.winglang.io/play/). +You can get a sense of the development experience with Wing in our [playground](https://play.winglang.io/). diff --git a/versioned_docs/version-latest/999-faq/040-alternatives/044-cdktf-vs-wing.md b/versioned_docs/version-latest/999-faq/040-alternatives/044-cdktf-vs-wing.md index 613c0bc19..f9c21ffdf 100644 --- a/versioned_docs/version-latest/999-faq/040-alternatives/044-cdktf-vs-wing.md +++ b/versioned_docs/version-latest/999-faq/040-alternatives/044-cdktf-vs-wing.md @@ -39,4 +39,4 @@ import CodeComparison from '../../src/components/CodeComparison'; | Provisioning engine | Same code compiles to Terraform and AWS-CDK (CloudFormation) | Terraform (AWS-CDK is used for Cloudformation, but you cannot compile the same code to different engines) | | Testing | Same tests run on local simulator and cloud, without mocks | Need mocks for local testing | -You can get a sense of the development experience with Wing in our [playground](https://www.winglang.io/play/). +You can get a sense of the development experience with Wing in our [playground](https://play.winglang.io/). diff --git a/versioned_docs/version-latest/999-faq/040-alternatives/047-darklang-vs-wing.md b/versioned_docs/version-latest/999-faq/040-alternatives/047-darklang-vs-wing.md index ea0387744..282c42e8b 100644 --- a/versioned_docs/version-latest/999-faq/040-alternatives/047-darklang-vs-wing.md +++ b/versioned_docs/version-latest/999-faq/040-alternatives/047-darklang-vs-wing.md @@ -9,4 +9,4 @@ There are several differences between Wing and Darklang, with the main distincti With Wing, you can write code that is interoperable with JavaScript, allowing you to leverage the extensive NPM ecosystem. When you compile your code, it is transformed into JavaScript and Terraform, ensuring that your downstream tools remain the same as before. This approach helps developers to adopt Wing more easily and integrate it into their existing workflows. -To get a feel for the development experience with Wing, try our [playground](https://www.winglang.io/play/). +To get a feel for the development experience with Wing, try our [playground](https://play.winglang.io/).