Skip to content

Commit

Permalink
chore: update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
solaris007 committed Nov 28, 2023
1 parent 532b464 commit f31f451
Showing 1 changed file with 4 additions and 83 deletions.
87 changes: 4 additions & 83 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@
<dt><a href="#createClient">createClient(log, dbClient, docClient)</a> ⇒ <code>Object</code></dt>
<dd><p>Creates a client object for interacting with DynamoDB.</p>
</dd>
<dt><a href="#query">query(originalParams)</a> ⇒ <code>Promise.&lt;Array&gt;</code></dt>
<dd><p>Queries DynamoDB and automatically handles pagination to retrieve all items.</p>
</dd>
<dt><a href="#getItem">getItem(tableName, partitionKey, [sortKey])</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Retrieves an item from DynamoDB using a table name and key.</p>
</dd>
<dt><a href="#putItem">putItem(tableName, item)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Inserts or updates an item in a DynamoDB table.</p>
</dd>
<dt><a href="#removeItem">removeItem(tableName, partitionKey, [sortKey])</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Removes an item from a DynamoDB table.</p>
</dd>
<dt><a href="#isBoolean">isBoolean(value)</a> ⇒ <code>boolean</code></dt>
<dd><p>Determines if the given value is a boolean or a string representation of a boolean.</p>
</dd>
Expand All @@ -39,7 +27,8 @@
</dd>
<dt><a href="#isIsoDate">isIsoDate(str)</a> ⇒ <code>boolean</code></dt>
<dd><p>Validates whether the given string is a JavaScript ISO date string in
Zulu (UTC) timezone. Used for persisting system dates, which must be independent of any user timezone.</p>
Zulu (UTC) timezone. Used for persisting system dates, which must be
independent of any user timezone.</p>
</dd>
<dt><a href="#isIsoTimeOffsetsDate">isIsoTimeOffsetsDate(str)</a> ⇒ <code>boolean</code></dt>
<dd><p>Validates whether the given string is a JavaScript ISO date string
Expand Down Expand Up @@ -70,75 +59,6 @@ Creates a client object for interacting with DynamoDB.
| dbClient | <code>DynamoDB</code> | The AWS SDK DynamoDB client instance. |
| docClient | <code>DynamoDBDocumentClient</code> | The AWS SDK DynamoDB Document client instance. |

<a name="query"></a>

## query(originalParams) ⇒ <code>Promise.&lt;Array&gt;</code>
Queries DynamoDB and automatically handles pagination to retrieve all items.

**Kind**: global function
**Returns**: <code>Promise.&lt;Array&gt;</code> - A promise that resolves to an array of items retrieved from DynamoDB.
**Throws**:

- <code>Error</code> Throws an error if the DynamoDB query operation fails.


| Param | Type | Description |
| --- | --- | --- |
| originalParams | <code>Object</code> | The parameters for the DynamoDB query. |

<a name="getItem"></a>

## getItem(tableName, partitionKey, [sortKey]) ⇒ <code>Promise.&lt;Object&gt;</code>
Retrieves an item from DynamoDB using a table name and key.

**Kind**: global function
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise that resolves to the retrieved item.
**Throws**:

- <code>Error</code> Throws an error if the DynamoDB get operation fails.


| Param | Type | Description |
| --- | --- | --- |
| tableName | <code>string</code> | The name of the DynamoDB table. |
| partitionKey | <code>string</code> | The partition key of the item to retrieve. |
| [sortKey] | <code>string</code> | The sort key of the item to retrieve, if applicable. |

<a name="putItem"></a>

## putItem(tableName, item) ⇒ <code>Promise.&lt;Object&gt;</code>
Inserts or updates an item in a DynamoDB table.

**Kind**: global function
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise that resolves to a message indicating success.
**Throws**:

- <code>Error</code> Throws an error if the DynamoDB put operation fails.


| Param | Type | Description |
| --- | --- | --- |
| tableName | <code>string</code> | The name of the DynamoDB table. |
| item | <code>Object</code> | The item to insert or update in the table. |

<a name="removeItem"></a>

## removeItem(tableName, partitionKey, [sortKey]) ⇒ <code>Promise.&lt;Object&gt;</code>
Removes an item from a DynamoDB table.

**Kind**: global function
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise that resolves to a message indicating successful removal.
**Throws**:

- <code>Error</code> Throws an error if the DynamoDB delete operation fails.


| Param | Type | Description |
| --- | --- | --- |
| tableName | <code>string</code> | The name of the DynamoDB table. |
| partitionKey | <code>string</code> | The partition key of the item to remove. |
| [sortKey] | <code>string</code> | The sort key of the item to remove, if applicable. |

<a name="isBoolean"></a>

## isBoolean(value) ⇒ <code>boolean</code>
Expand Down Expand Up @@ -227,7 +147,8 @@ Checks whether the given object is a valid JavaScript Date.

## isIsoDate(str) ⇒ <code>boolean</code>
Validates whether the given string is a JavaScript ISO date string in
Zulu (UTC) timezone. Used for persisting system dates, which must be independent of any user timezone.
Zulu (UTC) timezone. Used for persisting system dates, which must be
independent of any user timezone.

**Kind**: global function
**Returns**: <code>boolean</code> - True if the given string validates successfully.
Expand Down

0 comments on commit f31f451

Please sign in to comment.