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/10816586225

------

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

Signed-off-by: monabot <monabot@monada.co>
  • Loading branch information
monadabot committed Sep 11, 2024
1 parent 2d59dbc commit 0cddf76
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,32 +105,35 @@ By default, buckets are configured with CORS for any origin. When a bucket is pr

```js playground example
bring cloud;
bring http;

let uploads = new cloud.Bucket(
// these are the default values
public: false,
cors: true,
corsOptions: {
allowedMethods: [http.HttpMethod.GET, http.HttpMethod.POST, http.HttpMethod.PUT, http.HttpMethod.DELETE, http.HttpMethod.HEAD]
allowedMethods: [http.HttpMethod.GET, http.HttpMethod.POST, http.HttpMethod.PUT, http.HttpMethod.DELETE, http.HttpMethod.HEAD],
allowedOrigins: ["*"],
allowedHeaders: ["*"],
exposeHeaders: [],
maxAge: 0s
},
)
);
```

The CORS configuration can be disabled by passing `cors: false` to the constructor. CORS rules can also be configured after the bucket is created by calling the `addCorsRule` method:

```js playground example
bring cloud;
bring http;

let bucket = new cloud.Bucket(
cors: false, // disable any default CORS rules
);

bucket.addCorsRule({
allowedOrigins: ["https://example.com"],
allowedMethods: [http.HttpMethod.GET],
});
```

Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-latest/04-winglibs/04-toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords: [winglib, Wing library]
| [cloudv2](/docs/winglibs/winglibs/cloudv2) | [@winglibs/cloudv2](/docs/winglibs/winglibs/cloudv2) | v0.1.2 | Standard cloud library for Wing | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [Amazon Cognito](/docs/winglibs/winglibs/cognito) | [@winglibs/cognito](/docs/winglibs/winglibs/cognito) | v0.0.14 | A wing library to work with Amazon Cognito | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [Containers](/docs/winglibs/winglibs/containers) | [@winglibs/containers](/docs/winglibs/winglibs/containers) | v0.1.6 | Deploy containers with Wing | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [Amazon DynamoDB](/docs/winglibs/winglibs/dynamodb) | [@winglibs/dynamodb](/docs/winglibs/winglibs/dynamodb) | v0.2.3 | A Wing library for Amazon DynamoDB | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [Amazon DynamoDB](/docs/winglibs/winglibs/dynamodb) | [@winglibs/dynamodb](/docs/winglibs/winglibs/dynamodb) | v0.2.4 | A Wing library for Amazon DynamoDB | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [Amazon EventBridge](/docs/winglibs/winglibs/eventbridge) | [@winglibs/eventbridge](/docs/winglibs/winglibs/eventbridge) | v0.1.8 | A Wing library for working with Amazon EventBridge | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws), [awscdk](/docs/platforms/AWS/awscdk) |
| [FIFO Queue](/docs/winglibs/winglibs/fifoqueue) | [@winglibs/fifoqueue](/docs/winglibs/winglibs/fifoqueue) | v0.0.12 | A wing library to work with FIFO (first-in first-out) Queues | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [GitHub](/docs/winglibs/winglibs/github) | [@winglibs/github](/docs/winglibs/winglibs/github) | v0.0.16 | A wing library to work with GitHub Probot | [*](/docs/platforms/platforms) |
Expand Down
19 changes: 16 additions & 3 deletions versioned_docs/version-latest/04-winglibs/05-winglibs/dynamodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ This library is licensed under the [MIT License](./LICENSE).
- <a href="#@winglibs/dynamodb.UpdateOptions">UpdateOptions</a>
- <a href="#@winglibs/dynamodb.UpdateOutput">UpdateOutput</a>
- <a href="#@winglibs/dynamodb.ClientProps">ClientProps</a>
- **Enums**
- <a href="#@winglibs/dynamodb.BillingMode">BillingMode</a>

### Table (preflight class) <a class="wing-docs-anchor" id="@winglibs/dynamodb.Table"></a>

Expand Down Expand Up @@ -264,9 +266,7 @@ new(): Client

#### Properties

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code>node</code> | <code>Node</code> | The tree node. |
*No properties*

#### Methods

Expand Down Expand Up @@ -533,6 +533,8 @@ new(): Client
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code>attributes</code> | <code>Array<AttributeDefinition></code> | *No description* |
| <code>billingMode</code> | <code>BillingMode?</code> | Billing mode for the table. Defaults to `PAY_PER_REQUEST`. |
| <code>deletionProtection</code> | <code>bool?</code> | Enables deletion protection for table. Disabled by default. For the Terraform AWS provider, this will also enable `lifecycle { prevent_destroy = true }` |
| <code>globalSecondaryIndex</code> | <code>Array<GlobalSecondaryIndex>?</code> | *No description* |
| <code>hashKey</code> | <code>str</code> | *No description* |
| <code>name</code> | <code>str?</code> | *No description* |
Expand Down Expand Up @@ -671,4 +673,15 @@ new(): Client
| <code>region</code> | <code>str?</code> | *No description* |
| <code>tableName</code> | <code>str</code> | *No description* |

### BillingMode (enum) <a class="wing-docs-anchor" id="@winglibs/dynamodb.BillingMode"></a>

*No description*

#### Values

| **Name** | **Description** |
| --- | --- |
| <code>PAY_PER_REQUEST</code> | *No description* |
| <code>PROVISIONED</code> | *No description* |


0 comments on commit 0cddf76

Please sign in to comment.