Skip to content

Commit

Permalink
feat(docs): update docs
Browse files Browse the repository at this point in the history
Updates the Wing docs. See details in [workflow run].

[Workflow Run]: https://github.com/winglang/docsite/actions/runs/5624328975

------

*Automatically created via the "update-docs" workflow*

Signed-off-by: monabot <[email protected]>
  • Loading branch information
monadabot committed Jul 21, 2023
1 parent 6c16fdb commit cfee4f3
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ sidebar_position: 1

The `cloud.Schedule` resource is used to trigger events at a regular interval.
Schedules are useful for periodic tasks, such as running backups or sending daily reports.
The timezone used in cron expressions is always UTC.

## Usage

Expand Down Expand Up @@ -246,6 +247,7 @@ cron: str;

Trigger events according to a cron schedule using the UNIX cron format.

Timezone is UTC.
[minute] [hour] [day of month] [month] [day of week]

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,12 +708,12 @@ to format as string.
##### `tryParse` <a name="tryParse" id="@winglang/sdk.std.Json.tryParse"></a>

```wing
Json.tryParse(str: str);
Json.tryParse(str?: str);
```

Try to parse a string into a Json.

###### `str`<sup>Required</sup> <a name="str" id="@winglang/sdk.std.Json.tryParse.parameter.str"></a>
###### `str`<sup>Optional</sup> <a name="str" id="@winglang/sdk.std.Json.tryParse.parameter.str"></a>

- *Type:* str

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,68 @@ Utility functions.

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.util.Util.base64Decode">base64Decode</a></code> | Converts a string from base64 to UTF-8. |
| <code><a href="#@winglang/sdk.util.Util.base64Encode">base64Encode</a></code> | Converts a string from UTF-8 to base64. |
| <code><a href="#@winglang/sdk.util.Util.env">env</a></code> | Returns the value of an environment variable. |
| <code><a href="#@winglang/sdk.util.Util.nanoid">nanoid</a></code> | Generates a unique ID using the nanoid library. |
| <code><a href="#@winglang/sdk.util.Util.sha256">sha256</a></code> | Computes the SHA256 hash of the given data. |
| <code><a href="#@winglang/sdk.util.Util.sleep">sleep</a></code> | Suspends execution for a given duration. |
| <code><a href="#@winglang/sdk.util.Util.tryEnv">tryEnv</a></code> | Returns the value of an environment variable. |
| <code><a href="#@winglang/sdk.util.Util.uuidv4">uuidv4</a></code> | Generates a version 4 UUID. |
| <code><a href="#@winglang/sdk.util.Util.waitUntil">waitUntil</a></code> | Run a predicate repeatedly, waiting until it returns true or until the timeout elapses. |

---

##### `base64Decode` <a name="base64Decode" id="@winglang/sdk.util.Util.base64Decode"></a>

```wing
bring util;
util.base64Decode(stringToDecode: str, url?: bool);
```

Converts a string from base64 to UTF-8.

###### `stringToDecode`<sup>Required</sup> <a name="stringToDecode" id="@winglang/sdk.util.Util.base64Decode.parameter.stringToDecode"></a>

- *Type:* str

base64 string to decode.

---

###### `url`<sup>Optional</sup> <a name="url" id="@winglang/sdk.util.Util.base64Decode.parameter.url"></a>

- *Type:* bool

If `true`, the source is expected to be a URL-safe base64 string.

---

##### `base64Encode` <a name="base64Encode" id="@winglang/sdk.util.Util.base64Encode"></a>

```wing
bring util;
util.base64Encode(stringToEncode: str, url?: bool);
```

Converts a string from UTF-8 to base64.

###### `stringToEncode`<sup>Required</sup> <a name="stringToEncode" id="@winglang/sdk.util.Util.base64Encode.parameter.stringToEncode"></a>

- *Type:* str

---

###### `url`<sup>Optional</sup> <a name="url" id="@winglang/sdk.util.Util.base64Encode.parameter.url"></a>

- *Type:* bool

If `true`, a URL-safe base64 is returned.

---

##### `env` <a name="env" id="@winglang/sdk.util.Util.env"></a>

```wing
Expand All @@ -50,6 +105,44 @@ The name of the environment variable.

---

##### `nanoid` <a name="nanoid" id="@winglang/sdk.util.Util.nanoid"></a>

```wing
bring util;
util.nanoid(options?: NanoidOptions);
```

Generates a unique ID using the nanoid library.

# @link https://github.com/ai/nanoid

###### `options`<sup>Optional</sup> <a name="options" id="@winglang/sdk.util.Util.nanoid.parameter.options"></a>

- *Type:* <a href="#@winglang/sdk.util.NanoidOptions">NanoidOptions</a>

Optional options object for generating the ID.

---

##### `sha256` <a name="sha256" id="@winglang/sdk.util.Util.sha256"></a>

```wing
bring util;
util.sha256(data: str);
```

Computes the SHA256 hash of the given data.

###### `data`<sup>Required</sup> <a name="data" id="@winglang/sdk.util.Util.sha256.parameter.data"></a>

- *Type:* str

The string to be hashed.

---

##### `sleep` <a name="sleep" id="@winglang/sdk.util.Util.sleep"></a>

```wing
Expand Down Expand Up @@ -88,6 +181,16 @@ The name of the environment variable.

---

##### `uuidv4` <a name="uuidv4" id="@winglang/sdk.util.Util.uuidv4"></a>

```wing
bring util;
util.uuidv4();
```

Generates a version 4 UUID.

##### `waitUntil` <a name="waitUntil" id="@winglang/sdk.util.Util.waitUntil"></a>

```wing
Expand Down Expand Up @@ -118,6 +221,52 @@ Timeout and interval values, default to one 1m timeout and 0.1sec interval.

## Structs <a name="Structs" id="Structs"></a>

### NanoidOptions <a name="NanoidOptions" id="@winglang/sdk.util.NanoidOptions"></a>

Options to generating a unique ID.

#### Initializer <a name="Initializer" id="@winglang/sdk.util.NanoidOptions.Initializer"></a>

```wing
bring util;
let NanoidOptions = util.NanoidOptions{ ... };
```

#### Properties <a name="Properties" id="Properties"></a>

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@winglang/sdk.util.NanoidOptions.property.alphabet">alphabet</a></code> | <code>str</code> | Characters that make up the alphabet to generate the ID, limited to 256 characters or fewer. |
| <code><a href="#@winglang/sdk.util.NanoidOptions.property.size">size</a></code> | <code>num</code> | Size of ID. |

---

##### `alphabet`<sup>Optional</sup> <a name="alphabet" id="@winglang/sdk.util.NanoidOptions.property.alphabet"></a>

```wing
alphabet: str;
```

- *Type:* str

Characters that make up the alphabet to generate the ID, limited to 256 characters or fewer.

---

##### `size`<sup>Optional</sup> <a name="size" id="@winglang/sdk.util.NanoidOptions.property.size"></a>

```wing
size: num;
```

- *Type:* num
- *Default:* 21

Size of ID.

---

### WaitUntilProps <a name="WaitUntilProps" id="@winglang/sdk.util.WaitUntilProps"></a>

Properties for `util.waitUntil`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
"tf-aws": {"implemented": true},
"tf-azure": {"implemented": false},
"tf-gcp": {"implemented": false},
"aws-cdk": {"implemented": false}
"aws-cdk": {"implemented": true}
},
"FunctionProps.concurrency": {
"sim": {"implemented": false},
Expand All @@ -247,7 +247,7 @@
"tf-aws": {"implemented": true},
"tf-azure": {"implemented": false},
"tf-gcp": {"implemented": false},
"aws-cdk": {"implemented": false}
"aws-cdk": {"implemented": true}
},
"timeout": {
"sim": {"implemented": true},
Expand Down Expand Up @@ -275,7 +275,7 @@
"tf-aws": {"implemented": true},
"tf-azure": {"implemented": false},
"tf-gcp": {"implemented": false},
"aws-cdk": {"implemented": false}
"aws-cdk": {"implemented": true}
},
"invoke": {
"sim": {"implemented": true},
Expand Down

0 comments on commit cfee4f3

Please sign in to comment.