Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): update docs #1014

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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* |