From f31f451f048252cf42b986ecabad4e03c6d152f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominique=20J=C3=A4ggi?= Date: Tue, 28 Nov 2023 11:02:33 +0100 Subject: [PATCH] chore: update doc --- docs/API.md | 87 +++-------------------------------------------------- 1 file changed, 4 insertions(+), 83 deletions(-) diff --git a/docs/API.md b/docs/API.md index c4d46ad9..6392f828 100644 --- a/docs/API.md +++ b/docs/API.md @@ -4,18 +4,6 @@
createClient(log, dbClient, docClient)Object

Creates a client object for interacting with DynamoDB.

-
query(originalParams)Promise.<Array>
-

Queries DynamoDB and automatically handles pagination to retrieve all items.

-
-
getItem(tableName, partitionKey, [sortKey])Promise.<Object>
-

Retrieves an item from DynamoDB using a table name and key.

-
-
putItem(tableName, item)Promise.<Object>
-

Inserts or updates an item in a DynamoDB table.

-
-
removeItem(tableName, partitionKey, [sortKey])Promise.<Object>
-

Removes an item from a DynamoDB table.

-
isBoolean(value)boolean

Determines if the given value is a boolean or a string representation of a boolean.

@@ -39,7 +27,8 @@
isIsoDate(str)boolean

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.

isIsoTimeOffsetsDate(str)boolean

Validates whether the given string is a JavaScript ISO date string @@ -70,75 +59,6 @@ Creates a client object for interacting with DynamoDB. | dbClient | DynamoDB | The AWS SDK DynamoDB client instance. | | docClient | DynamoDBDocumentClient | The AWS SDK DynamoDB Document client instance. | - - -## query(originalParams) ⇒ Promise.<Array> -Queries DynamoDB and automatically handles pagination to retrieve all items. - -**Kind**: global function -**Returns**: Promise.<Array> - A promise that resolves to an array of items retrieved from DynamoDB. -**Throws**: - -- Error Throws an error if the DynamoDB query operation fails. - - -| Param | Type | Description | -| --- | --- | --- | -| originalParams | Object | The parameters for the DynamoDB query. | - - - -## getItem(tableName, partitionKey, [sortKey]) ⇒ Promise.<Object> -Retrieves an item from DynamoDB using a table name and key. - -**Kind**: global function -**Returns**: Promise.<Object> - A promise that resolves to the retrieved item. -**Throws**: - -- Error Throws an error if the DynamoDB get operation fails. - - -| Param | Type | Description | -| --- | --- | --- | -| tableName | string | The name of the DynamoDB table. | -| partitionKey | string | The partition key of the item to retrieve. | -| [sortKey] | string | The sort key of the item to retrieve, if applicable. | - - - -## putItem(tableName, item) ⇒ Promise.<Object> -Inserts or updates an item in a DynamoDB table. - -**Kind**: global function -**Returns**: Promise.<Object> - A promise that resolves to a message indicating success. -**Throws**: - -- Error Throws an error if the DynamoDB put operation fails. - - -| Param | Type | Description | -| --- | --- | --- | -| tableName | string | The name of the DynamoDB table. | -| item | Object | The item to insert or update in the table. | - - - -## removeItem(tableName, partitionKey, [sortKey]) ⇒ Promise.<Object> -Removes an item from a DynamoDB table. - -**Kind**: global function -**Returns**: Promise.<Object> - A promise that resolves to a message indicating successful removal. -**Throws**: - -- Error Throws an error if the DynamoDB delete operation fails. - - -| Param | Type | Description | -| --- | --- | --- | -| tableName | string | The name of the DynamoDB table. | -| partitionKey | string | The partition key of the item to remove. | -| [sortKey] | string | The sort key of the item to remove, if applicable. | - ## isBoolean(value) ⇒ boolean @@ -227,7 +147,8 @@ Checks whether the given object is a valid JavaScript Date. ## isIsoDate(str) ⇒ boolean 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**: boolean - True if the given string validates successfully.